I rotate a lot of short-lived VPS instances for testing and development. A lot of them are hosted with Oracle Cloud free tier, and so rotating them is effortless: they are all created using the same instance configuration, recognize the same SSH keys etc. On my Mac OS, however, it took me a while to… Continue reading Automate connecting to temporary and rotating development servers
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?
If Nginx cannot read your SSL certificate file
I got my Letsencrypt SSL certificate and wanted to configure Nginx to use it. I added listen 443 ssl and pointed ssl_certificate and ssl_certificate_key to the right files, using $server_name variable. listen 443 ssl; ssl_certificate /usr/local/etc/letsencrypt/live/$server_name/fullchain.pem; ssl_certificate_key /usr/local/etc/letsencrypt/live/$server_name/privkey.pem; The above didn’t work, giving me these cryptic errors: SSL_ERROR_INTERNAL_ERROR_ALERT in Firefox ERR_SSL_PROTOCOL_ERROR in Chrome Here’s what… Continue reading If Nginx cannot read your SSL certificate file
Spotify PWA buttons not working on iPad?
What’s going on here? I have Spotify installed as a "progressive web app" (PWA) instead of a full iPadOS application. This is because Spotify’s PWA lets you do more things on a free plan. You can: loop songs/playlists; skip as many songs as you want; add songs to queue; play whatever song you want on… Continue reading Spotify PWA buttons not working on iPad?
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
Recursive grep in a directory on macOS
If you need to look for a literal string in a directory and all its subdirectories, use grep -rF "your.literal.string" . -r or –recursive: Recursively read all files under each directory. -F or –fixed-strings: Treat the pattern as a literal string (not a regular expression). This is important if your string contains characters like .… Continue reading Recursive grep in a directory on macOS
Oracle Cloud FreeBSD: LaunchInstance NotAuthorizedOrNotFound
I created an instance configuration on Oracle Cloud based on FreeBSD-14.2-RELEASE-arm64-ufs image (could have been any other FreeBSD). When launching an instance from this configuration, I got: Error returned by LaunchInstance operation in Compute service.(404, NotAuthorizedOrNotFound, false) Authorization failed or requested resource not found. The likely problem is some value is missing in the instance… Continue reading Oracle Cloud FreeBSD: LaunchInstance NotAuthorizedOrNotFound
Recovering an Oracle Cloud instance
Use case: you have an Oracle Cloud instance but lost SSH access to it. To recover access, you need to know which pubkey you used on it, or which port SSH is listening on. Or, you don’t want to terminate it before you make sure it doesn’t contain important data. Solution: you will have to… Continue reading Recovering an Oracle Cloud instance
Quickly mount USB drive as Shared Folder for VirtualBox
You want to access a USB flash drive connected to your host machine from VirtualBox. You use a GUI tool on your host machine to manage your VirtualBoxes. The flash drive you want to use is connected to your host machine. Create a Shared Folder Launch the "VirtualBox Manager" tool and go to your VM… Continue reading Quickly mount USB drive as Shared Folder for VirtualBox
Deploying a Python bot to Azure Web App Service (Free Tier)
Run a Python bot for free on Azure Web App Service Pre-requisite: have a bot. You can use mehov/bot-clock as an example. It works with Telegram, so you will need TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID – see the bot’s readme for more info. Create a new Web App Go to Azure Portal → App Services and create… Continue reading Deploying a Python bot to Azure Web App Service (Free Tier)