Do you want to use actual Debian (not Raspbian aka Raspberry Pi OS) on a Raspberry Pi? Here are the small adjustments you will need to make to an official Debian image to make it 1. boot and 2. contain some of the features you would expect from Raspbian
Tag: debian
Use USB drive as apt-get cache for frequent Raspberry PI reinstalls
I work on a configuration script for a Raspberry Pi, and as I debug it, more often than not I need to run reinstall over and over. On a metered connection it may be a problem, as not only it’s slow, it also uses your data plan. A way around this would be having a… Continue reading Use USB drive as apt-get cache for frequent Raspberry PI reinstalls
Cleaning up multiple logs in a folder
LEts say you have to manually look through a bunch of log files to do a check on something. To make the job easier, you can clean up those logs from the lines you know you don’t need, significantly reducing the amount of stuff you have to go through. sed -i '#192.168.1.1#d' /tmp/*.log Here we’re… Continue reading Cleaning up multiple logs in a folder
Searching for code snippets in a given directory
One thing that saved me lots of time and potential bugs is using grep for a given string in a given directory. Imagine you decided to rename a function and you now need to update every piece of code that calls it. No chance you will remember all places where you used it, and manually… Continue reading Searching for code snippets in a given directory
Connecting to Github from Debian Jessie in 2024
Upgrade everything that still upgrades. Add these to your /etc/apt/sources.list: deb [trusted=yes] http://archive.debian.org/debian jessie main deb [trusted=yes] http://archive.debian.org/debian-security jessie/updates main Optionally, you can comment out the old entries you may already have there. Run apt-get update && apt-get upgrade Chances are, if you try to connect with what you got, Github will complain: ERROR: You’re… Continue reading Connecting to Github from Debian Jessie in 2024
Tar complaining about “You must specify one of the options”
If you’re trying to create a backup using tar but you’re getting this error tar: You must specify one of the ‘-Acdtrux’, ‘–delete’ or ‘–test-label’ options Try ‘tar –help’ or ‘tar –usage’ for more information. … check your options order. In my case, I was using –exclude. It turns out, if the paths you provide… Continue reading Tar complaining about “You must specify one of the options”
Forwarding MySQL from local port to remote server
If you have access to a MySQL server which allows whitelisting only a few IP addresses and you need to allow a whole range, you can use a tiny separate "proxy" VPS that would receive the connections and forward them to your MySQL server. You will then only have to whitelist the "proxy" VPS IP… Continue reading Forwarding MySQL from local port to remote server
nvm, npm, node: Command not found
The problem I had gatsbyjs, node and npm installed on a Debian system. Now I’m getting this error: -bash: gatsby: command not found -bash: node: command not found -bash: npm: command not found Troubleshooting Check npm installation using the package manager: apt-cache policy npm npm: Installed: (none) Check nvm installation: nvm –version 0.39.3 This means… Continue reading nvm, npm, node: Command not found
Migrate whole VPS to another server using rsync
Say you’re about to cancel a VPS, but first you need to copy its contents (source) over to another server (destination). We will be using rsync. Note: rsync will keep the original timestamps for both files and folders, so that’s good. General idea: rsync –params source destination Because we will copy the whole source VPS,… Continue reading Migrate whole VPS to another server using rsync
Add nvm-managed node to $PATH in init.d or crontab
When I was using node installed via apt-get, a simple NODE=$(which node) was enough. However, once I switched to the nvm-based node, it was no longer installed in one of the $PATH locations where the system is looking. So the correct path had to be added manually. One option is to hardcode whatever the current… Continue reading Add nvm-managed node to $PATH in init.d or crontab