Automate connecting to temporary and rotating development servers

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

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

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

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)