Imagine your server hangs even on simple, seemingly unrelated commands such as cat file, ps aux or top. This is the issue I’ve been dealing with today. Short version: it was MySQL/MariaDB server clogging the VPS I/O. Important: even though a terminal window with an established SSH connection would freeze, I could always open a… Continue reading FreeBSD gets unresponsive on commands touching disk
Category: Servers
Icecast: auth to server failed with could not resolve host
The problem Consider this configuration in icecast.xml /your-mount … resulting in this error: WARN auth_url/url_add_listener auth to server http://example.com/auth_mount failed with Could not resolve host: example.com To debug, you wget -O /dev/null http://example.com/auth_mount on the same server and it works file. That means it’s Icecast itself (the daemon) that cannot resolve the hostname. This typically… Continue reading Icecast: auth to server failed with could not resolve host
FreeBSD Certbot: AttributeError: ‘Meta’ object has no attribute ‘profiles’
The problem Requesting a certificate for example.com An unexpected error occurred: AttributeError: ‘Meta’ object has no attribute ‘profiles’ The solution Upgrade or reinstall py311-acme Debugging Check /var/log/letsencrypt/letsencrypt.log for JSON dump of the Directory object: DEBUG:acme.client:Sending GET request to https://acme-v02.api.letsencrypt.org/directory. DEBUG:acme.client:Received response: { "keyChange": "https://acme-v02.api.letsencrypt.org/acme/key-change", "meta": { "caaIdentities": [ "letsencrypt.org" ], "profiles": { "classic": "https://letsencrypt.org/docs/profiles#classic", "shortlived":… Continue reading FreeBSD Certbot: AttributeError: ‘Meta’ object has no attribute ‘profiles’
Server migration cheat sheet
Have history with timestamps May not be enabled by default on a new server ~/.bash_profile: if [ -f ~/.bashrc ]; then . ~/.bashrc fi ~/.bashrc: # Enable timestamp in history export HISTTIMEFORMAT=”%F %T ” # Make history append instead of overwrite shopt -s histappend # Increase history size export HISTSIZE=1000000 export HISTFILESIZE=2000000 (optional) Automatically cd… Continue reading Server migration cheat sheet
Custom rc.d script won’t start on boot?
You have a very small rc.d script that you intend to both run as service xyz action and have autostart on boot. It works when you call it manually, but won’t start on boot. The script pseudocode looks like this: #!/bin/sh # PROVIDE: xyz # REQUIRE: NETWORKING # KEYWORD: shutdown case "$1" in start) echo… Continue reading Custom rc.d script won’t start on boot?
Reisntalling package with default config files
If you delete a package using e.g. pkg delete nginx it will leave the configuration files behind. If you then delete /usr/local/etc/nginx manually and reinstall the package using e.g. pkg install nginx, it will not restore the default configs, because it thinks this is not the first install of said package on the system and… Continue reading Reisntalling package with default config files
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
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