Category: General

  • Minecraft Linux Server Auto-Update

    Keeping your Minecraft Bedrock Dedicated Server up to date is essential for performance, stability, and player compatibility. In this guide, we’ll show you how to set up a lightweight Bash script that checks for new server versions and installs them, all while preserving your world and configuration files.

    Step 1: Install Dependencies

    sudo apt update
    sudo apt install curl jq unzip rsync wget

    Step 2: Create the Update Script

    Save the following as ~/update-bedrock.sh.:

    #!/usr/bin/env bash
    set -euo pipefail
    
    HOME_DIR="$HOME"
    INSTALL_DIR="$HOME_DIR/bedrock-server"
    TMP_DIR="$HOME_DIR/bedrock-tmp"
    API_URL="https://net-secondary.web.minecraft-services.net/api/v1.0/download/links"
    ZIP_NAME="bedrock.zip"
    
    command -v jq >/dev/null || { echo "jq is required"; exit 1; }
    
    echo "Fetching version info..."
    DATA=$(curl -fsSL "$API_URL")
    DOWNLOAD_URL=$(echo "$DATA" | jq -r '.result.links[] | select(.downloadType == "serverBedrockLinux") | .downloadUrl')
    VERSION=$(basename "$DOWNLOAD_URL" | grep -o '[0-9.]\+')
    
    [[ -z "$DOWNLOAD_URL" || -z "$VERSION" ]] && { echo "Failed to extract URL/version"; exit 1; }
    
    [[ -f "$INSTALL_DIR/bedrock-server.version" && "$(cat "$INSTALL_DIR/bedrock-server.version")" == "$VERSION" ]] && {
      echo "Already up to date"
      exit 0
    }
    
    mkdir -p "$TMP_DIR"
    wget -q -O "$TMP_DIR/$ZIP_NAME" "$DOWNLOAD_URL"
    unzip -t "$TMP_DIR/$ZIP_NAME" >/dev/null || { echo "ZIP test failed"; exit 1; }
    unzip -oq "$TMP_DIR/$ZIP_NAME" -d "$TMP_DIR/unpacked"
    
    [[ -x "$TMP_DIR/unpacked/bedrock_server" ]] || { echo "Missing server binary"; exit 1; }
    
    rsync -a \
      --exclude='autoupdate.sh' \
      --exclude='server.properties' \
      --exclude='permissions.json' \
      --exclude='whitelist.json' \
      --exclude='ops.json' \
      --exclude='allowlist.json' \
      --exclude='valid_known_packs.json' \
      --exclude='worlds/' \
      "$TMP_DIR/unpacked/" "$INSTALL_DIR/"
    
    echo "$VERSION" > "$INSTALL_DIR/bedrock-server.version"
    rm -rf "$TMP_DIR"
    echo "Updated to version $VERSION"
    

    Step 3: Make It Executable

    chmod +x ~/update-bedrock.sh

    Step 4: Automate with Cron (Optional)

    Edit your crontab with crontab -e and add this line to check daily at 3 AM:

    0 3 * * * ~/update-bedrock.sh >> ~/bedrock-update.log 2>&1

    Done ✅

    You now have a self-maintaining Minecraft Bedrock server that stays updated automatically!

  • Vshare / Widdit / searchcompletion.com Adware

    Vshare plugin *IS* an adware.

    Whether you are on Mac, Windows or Linux this is the same, and you don’t even need the toolbar, only the plugin.

    I’ve installed the old version of the Vshare plugin on my Firefox, on Linux, (old version because the newest isn’t available on Linux) then some popups started to appear on sites like wikipedia.org, loaded from some files hosted on widdit.com,  and leading to search.searchcompletion.com (a quick lookup on Google shows some Windows users also see this site as their main browser page, after installing Vshare).

    Widdit belongs to an Israeli company (SimplyGen), so does Vshare. Maybe both sites are from the same company.

    At this point i don’t know if it only adds some random popups or also does other nasty things (like replacing ads). I didn’t read any other article on the subject, so i decided to write this post. If you have other info, post it in the comments!

  • MySQL: Restore a dropped database

    NOTE BEFORE TRYING ANYTHING DO A BACKUP OF ALL DATABASES. 1 MISTAKE CAN BE A BIG PROBLEM, IMAGINE 2 MISTAKES AT THE SAME TIME!!

    You need bin logs for this tutorial, if you didn’t have them enabled, then you have to look somewhere else..

    Today i accidentally “dropped” the database of a site i host thanks to my lazyness and the use and the brilliant and intuitive software called phpmyadmin, which i usually NEVER use.

    What i did is a simple drop database mysite;

    I had a backup from may 21 at 07:40 (check carefully the filetime of your last backup).

    Then i went to /var/log/mysql/

    Did ls -la to check the time of the logs:

    -rw-rw—-  1 mysql adm   66005373 mai 21 06:25 mysql-bin.001036
    -rw-rw—-  1 mysql adm   38683086 mai 22 06:25 mysql-bin.001037
    -rw-rw—-  1 mysql adm   48038277 mai 23 06:25 mysql-bin.001038
    -rw-rw—-  1 mysql adm   40780613 mai 24 06:25 mysql-bin.001039
    -rw-rw—-  1 mysql adm   42856471 mai 25 06:25 mysql-bin.001040
    -rw-rw—-  1 mysql adm   48990369 mai 26 06:25 mysql-bin.001041
    -rw-rw—-  1 mysql adm   54580611 mai 27 06:25 mysql-bin.001042
    -rw-rw—-  1 mysql adm   49505245 mai 28 06:25 mysql-bin.001043
    -rw-rw—-  1 mysql adm   57696248 mai 29 06:25 mysql-bin.001044
    As i knew i deleted the database on may 29 near 18:10, i ran this command:
    mysqlbinlog –start-datetime=”2010-05-21 07:40:00″ –stop-datetime=”2010-05-29 18:05:00″ -d mysite mysql-bin.0010* > /tmp/replay.sql
    Then i recreated my dropped database:
    create database mysite;
    Put the old backup:
    mysql -umysite -pmysite mysite < mysite.sql
    And applied the replay sql right after:
    mysql -umysite -pmysite mysite < /tmp/replay.sql
    And everything came back magically! Hope it helps!
  • Finally opened!

    This is it! My blog is finally opened, i really thought i’d never open one.. I will mostly post my personal experiences related to IT, so i will use it as a notebook to write some notes that i should remember and hopefully help other people with them. I often found many tutorials and interesting articles in personal blogs, so now i think it is time for me to help the community as well.

    Enjoy your stay.