Category: Dev Stuff
-
More Garbage Sysadmin: Reboot Linux Server on Kernel Panic
Just like restarting a server when the memory is low, I’ve had a recent problem with kernel panics on my Raspberry Pi, and I’ve found a terrible solution to fix it: Just reboot. Setting the /proc/sys/kernel/panic file contents to a non-zero integer will reboot the server on kernel panic after that many seconds. Because I’m…
-
Get First Date of Week in Google Sheets, When the Week of the Year is Related to the Row Number
*phew* what a title For a recent project, I wanted to set up a Google Sheet that tracked something daily/weekly. I wanted one column to show the starting day of the week to help keep me on track, and I ended up with this: I used ChatGPT to help me make the formula to determine…
-
Quick Tip: Bash CLI params
While working on a bash script, I stumbled upon what I think may be the cleanest and simplest way to add CLI params to a bash script so far: This lets you use short (-V), long (–version), space separated (–user john), and equal separated (–user=john) arguments. It’s not perfect, but for a quick bash script…
-
Nano: The One True Editor
Forget about vi/vim/edlin. Nano is the only editor that you need in the console. Sure, it may not be perfect, but with a few extra steps in .nanorc it can really be a great experience. Here’s my .nanorc with some comments showing what’s changed:
-
Quick Tip: Export WordPress SQL output via WP-CLI
If for some reason you can’t run wp db query, but need to export SQL output to a CSV or other file, then have a look at this small WP-CLI command I whipped up that should allow this: I’d add an example here, but I don’t have any right now that I can share 😐…
-
phpMyAdmin and MariaDB with Docker
I used to run a MariaDB server on an old Linux machine for working with database dumps and other things, but after moving all of that to a new Raspberry Pi 4, I never really set it back up. So instead I thought I’d play with this fancy new Docker stuff all the cool kids…
-
Converting CSV to SQL
I was recently working on an issue that required me to dig through gigabytes of CSV files to look for patterns and data points. I had no intention of bringing all of this data in to Excel, because there’s not enough RAM on earth for that to work. Instead I thought it would be easier…
-
Quick Tip: Looping a command in bash
I recently came across the need to watch my disk space while running a slow program to make sure I didn’t run out. If I did, the command would fail silently and I’d have to start over again. This can easily be done with this short snippet: The important part here is disk1s5, which is…
-
Open source ngrok alternative
During a client onsite last year, I was first introduced to ngrok. Ngrok provides “secure introspectable tunnels to localhost.” The free tier of ngrok provides temporary, random subdomains to use. This is fine most of the time, but kind of causes problems for things like Jetpack that require persistent domain names for connecting. While I…