Install GCC-14 on ARM64 Debian 11 Bullseye

I need to install the latest gcc on an old ARM64 board, which runs Debian 11 Bullseye. Straightforward of running “sudo apt install g++-14” won’t find the package. And Internet search does not lead to a simple answer either. There deserves a post.

sudo update-alternatives --remove-all gcc 
sudo update-alternatives --remove-all g++
sudo update-alternatives --remove-all cpp

sudo add-apt-repository "deb http://deb.debian.org/debian sid main"
sudo apt update
sudo apt install g++-14

vers=14; sudo update-alternatives  \
    --install /usr/bin/gcc gcc /usr/bin/gcc-"${vers}" "${vers}"0  \
    --slave /usr/bin/aarch64-linux-gnu-gcc aarch64-linux-gnu-gcc /usr/bin/aarch64-linux-gnu-gcc-"${vers}"  \
    --slave /usr/bin/g++ g++ /usr/bin/g++-"${vers}"  \
    --slave /usr/bin/aarch64-linux-gnu-g++ aarch64-linux-gnu-g++ /usr/bin/aarch64-linux-gnu-g++-"${vers}"  \
    --slave /usr/bin/cpp cpp /usr/bin/cpp-"${vers}"  \
    --slave /usr/bin/aarch64-linux-gnu-cpp aarch64-linux-gnu-cpp /usr/bin/aarch64-linux-gnu-cpp-"${vers}"  \
    --slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-"${vers}"  \
    --slave /usr/bin/aarch64-linux-gnu-gcc-ar aarch64-linux-gnu-gcc-ar /usr/bin/aarch64-linux-gnu-gcc-ar-"${vers}"  \
    --slave /usr/bin/gcc-nm gcc-nm /usr/bin/gcc-nm-"${vers}"  \
    --slave /usr/bin/aarch64-linux-gnu-gcc-nm aarch64-linux-gnu-gcc-nm /usr/bin/aarch64-linux-gnu-gcc-nm-"${vers}"  \
    --slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-"${vers}"  \
    --slave /usr/bin/aarch64-linux-gnu-gcc-ranlib aarch64-linux-gnu-gcc-ranlib /usr/bin/aarch64-linux-gnu-gcc-ranlib-"${vers}"  \
    --slave /usr/bin/gcov gcov /usr/bin/gcov-"${vers}"  \
    --slave /usr/bin/aarch64-linux-gnu-gcov aarch64-linux-gnu-gcov /usr/bin/aarch64-linux-gnu-gcov-"${vers}"  \
    --slave /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-dump-"${vers}"  \
    --slave /usr/bin/aarch64-linux-gnu-gcov-dump aarch64-linux-gnu-gcov-dump /usr/bin/aarch64-linux-gnu-gcov-dump-"${vers}"  \
    --slave /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-"${vers}"  \
    --slave /usr/bin/aarch64-linux-gnu-gcov-tool aarch64-linux-gnu-gcov-tool /usr/bin/aarch64-linux-gnu-gcov-tool-"${vers}"  \
    --slave /usr/bin/lto-dump lto-dump /usr/bin/lto-dump-"${vers}"  \
    --slave /usr/bin/aarch64-linux-gnu-lto-dump aarch64-linux-gnu-lto-dump /usr/bin/aarch64-linux-gnu-lto-dump-"${vers}"

My Complaints/Wish List for Tesla FSD 12.5.2 (Model Y)

Don’t get me wrong. I love FSD. It is one of the most exciting consumer experiences in the recent years. Last such excitement for me probably goes back more than 10 years when I first put my hand on Apple iPhone 2. For me, FSD changes the perception of distance and mobility. It makes San Francisco symphony concert much more enjoyable than ever.

That said, I still have a lot of complaints of today’s FSD.

  1. Too many unnecessary accelerations, many of which are followed by consequential breakings, which means more discomfort. Note I chose “Chill” profile. Otherwise it is probably even worse.
  2. Acceleration is often too aggressive, especially for local driving. Why so? saving time? There are many other wasted opportunities for saving time. No need to focus on the acceleration aspect.
  3. Phantom breaking, i.e., breaking for no obvious reasons. (discomfort and wasting time)
  4. Non-human breaking pattern, which often breaks too hard at beginning and then, realizing it, relax the breaking. Human often breaks soft, and then, realizing not enough, start to break harder (discomfort)
  5. Don’t remember routine route road conditions. Every road has its own quirks. It is OK for Tesla to be cautious when seeing those quirk if it sees for the first time. However, it does not remember those quirks and repeating driving always feels like first-timer driving on those roads. Human tend to be more relaxed (and thus more smooth) on later repeated driving.
  6. Map sucks and don’t remember my corrections. This is especially annoying for routine routes.
  7. Can’t back to my garage, which is the only way I can charge my Tesla today.

Elon Musk, I hope you can see my wish list.

Build leveldb v1.22 for latest Alpine Linux (3.20)

Alpine Linux is a popular choice for building docker. Since v3.17, leveldb version is bumped from v1.22 to v1.23, where the new version disabled rtti, which caused many packages to break, including popular python module, plyvel. I encountered this problem when building electrumX docker image. Googling around I realize this is a popular problem and there are no easy and obvious solutions.

I decided to simply build apk files for leveldb v1.22 against the latest alpine linux, which is 3.20 today.

Steps:

  1. Mostly follow an excellent tutorial at fudex.org on setting up the docker build environment.
  2. Check out aports at alpine version v3.16, (host) git clone –depth=1 https://gitlab.alpinelinux.org/alpine/aports -b 3.16-stable aports-3.16
  3. Copy over leveldb APKBUILD file over to the latest 3.20 aports, (host) cp -a aports-3.16/main/leveldb aports/main/
  4. go back to alpine-dev container and build the package files
    1. (alpine-dev) cd ~/aports/main/leveldb
    2. (alpine-dev) abuild -r

The file APK files are located under ~/packages/main/x86_64. For convenience, I have include those two files below. Of course, you should strip the “.bin” suffix before using them. I had to add the suffix to work around wordpress restrictions. Please refer to this docker file to see how these files are used in a real case.

Migrate/Re-use UmbrelOS SSD from Raspberry Pi to X86

I was running UmbrelOS on Raspberry Pi, with an external 2TB SSD disk. The machine is obviously under powered and started to show weakness. So I decided to migrate to a Lenovo mini-PC, M710q.

I need to re-use the same the SSD disk because M710q doesn’t have enough storage by itself (500GB). Ideally I can keep all the blockchain data and setup, so that I don’t have re-sync everything and re-setup everything.

While this may sound like a common question, I did not find many answers on the internet. The closest one is this one. However, UmbrelOS is currently at v1.x. A lot of don’t apply anymore.

Below is how I did it.

  • Prepare SSD disk
    • Upgrade Raspberry Pi to the latest UmbrelOS v1.1.
    • Shut it down via Umbrel Settings and unplug SSD disk.
  • Prepare PC
  • Migrate SSD disk over
    • Plug SSD disk into PC. Permanently mount it at /mnt/umbrel-ssd
      • /etc/fstab: UUID=e9ae3217-6a06-4721-b725-78e6524b4272 /mnt/umbrel-ssd ext4 defaults 0 0
    • sudo systemctl stop umbrel
    • cd /home/umbrel; mv umbrel umbrel.bak; ln -s /mnt/umbrel-ssd/umbrel umbrel
    • sudo systemctl start umbrel

It will take a long to re-start umbrel since it will fetch various containers etc. But it will use the same blockchain and other app-specific settings you had before on SSD disk. After a couple of coffee time, you will be all set!

How I Rooted OnePlus 12 with Magisk

There are many conflicting sources on the Internet. Specifically I tried this one and did not work. Below is a short recap what has worked for me.

Short Recap

  • Follow Magisk official installation guide
    • OnePlus 12 has ramdisk and uses init_boot.img
    • get oneplus 12 image zip file from this site
    • use payload dumper to extract init_boot.img from here
    • patch init_boot.img and flash the patched version according to the guide
  • By now, Magisk should be installed and you should have root access
  • Install Magisk Module Manager to install modules
    • for unknown reasons, I could install modules with Magisk app itself, nor through the manual method
  • (Bonus) I like to create your own Magisk module. I used the template
    • Specifically if you like to modify a file under /system_ext, please use the path /system/system_ext.
    • For example, if you like to add a file /system_ext/foo, use /system/system_ext/foo instead.

That is it!

My Bucket List

It is time to write down my bucket list, v2024.

Countries

  • Turkey
  • Egypt
  • France
  • Antarctic
  • Thailand
  • Really, as many countries as possible…

Places

  • Mt. Everest base
  • Machu Pichu
  • Tibet
  • Xinjiang

Experience

  • Over-the-water bungalows, learning scuba diving
  • Africa Safari
  • RV all over North America
  • See nothern lights

Events

  • Tennis Grand Slams – all four of them
  • Burning man
  • Big apple drop on NY square on NYE

Personal achievements

  • Form a band, playing guitar
  • Become a Rust expert
  • Sail across ocean

Setup NaiveProxy Server

NaiveProxy is an unique tool that can potentially escape the most strict censorship firewall. I thought I would give it a try.

Setup the server

This is actually the simple part.

  • Follows this page to create a Caddyfile (See “Server setup”)
  • Go to this page to download the binaries you need
  • Follows this page to set up a systemctl service.

Set up client on Ubuntu

Client side is a little bit tricky and cumbersome to use.

  • Go to this download page to download the right naive client
  • Follow the readme page and create config.json file in the same directory
  • Open Ubuntu Settings/Network/Network Proxy
  • Choose “Manual”, and fill in “127.0.0.1:1080” for “Socks Host”, while leaving others empty (IMPORTANT!) See picture below.
  • After that, download and start to use “start-naive” and “stop-naive” scripts to switch between using and not using proxy.
    • Note only browsers work with this scheme
    • And it seems only Chrome is working while Firefox is not working (bug?)

Setup TailScale VPN Server on Synology RT6600ax/RT2600AC Router

[Updated on 2/2, 2025, after setting TailScale on RT2600AC and seeing this post]

TailScale is great VPN. It is even greater if it runs all the time on a router! Currently it is available as 3rd party package for Synology NAS (X64-based) machines, but not for Routers (usually ARM64-based). *sigh* This blog talks about a way to set it up.

Grab the binaries

  • Copy (scp) over these two files to Synology router, say under your home directory’s subdirectory, “tailscale”.

Testing

  • Download the script below that starts/stops the tailscale daemon
    • This script is derived from TailScale’s original script and is adapted to SRM environment
    • MODIFY SCRIPT with your own path for PKGVAR variable
  • Now type “./start-stop-status start” and “./start-stop-status status”
  • For the first time running, type “./tailscale --socket tailscaled.sock up --advertise-exit-node --advertise-routes 172.30.1.0/24″ and perform web-based login/setup, which will
    • connect to your tailscale account and join your VPN network;
    • advertise itself as exit node (router to internet) (if needed);
    • route traffic to nodes on its own subet.
    • Refer to my previous post.

Start up TailScale automatically

This only works on RT2600AC!!

  • Create /etc/rc.local
#!/bin/sh

/var/services/home/jsun/tailscale/start-stop-status start

Following method should work on RT6600AX, but it does’nt. Please help!!

  • Copy the start-stop-status script to /usr/local/etc/rc.d/ directory
sudo cp start-stop-status /usr/local/etc/rc.d/tailscale 

Set Up TailScale VPN Server on AWS

TailScale website has an excellent collection of documents. I just want to quickly jot down what I did for simpler reference later. A couple of notes:

  • It runs on AWS EC2 instance (t3a.micro) with Ubuntu 22.04
  • It is a server node, a.k.a. exit node in TailScale terms.

Install

curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/jammy.noarmor.gpg | sudo tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null
curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/jammy.tailscale-keyring.list | sudo tee /etc/apt/sources.list.d/tailscale.list

sudo apt-get update

sudo apt-get install tailscale

First-time setup

We need to create an account first. Then we will be asked to login and make this machine as server, i.e., exit node.

sudo tailscale up   # perform web login
sudo tailscale up --advertise-exit-node

Log into TailScale website,

  • click on the “…” setting button for the server
  • select “Edit routing …” menu
  • Check “Use as exit node” button.

Usage

To use for yourself, simply turn on tailscale on your phone/PC, and use the above server as the exit node.

To share the server with others, go to tailscale web portal and click on “Share …” button for the server.

Disable/remove TailScale

sudo systemctl disable --now tailscaled     # to disable

sudo apt purge tailscale                    # to uninstall