awk tidbit
I like to take notes in Simplenote to capture the steps I take on any projects that I do. Today, I was doing an install for a little project that I’m working on (which might be a future topic if it comes to anything) and wanted to capture the recent history of the command lines I had used in a format that I could just copy and paste into my notes.
Read MoreBash strict mode
I’d been starting bash scripts with set -euo pipefail. I don’t really know where I got it from but it was something I’d picked up over the years. Aaron Maxwell has an excellent description of how this works and why it is a good idea. I also learned about the Internal File Seperator setting in that blog post and why that is a good idea. Read his excellent post. The net is that you should start your bash scripts with the following:
Read MoreHTTP codes
In my recent explorations, I found an interesting service that might come in handy for testing scripts: httpstat.us. As described on the site, it is a super simple service for generating different HTTP codes. It pretty much does what’s on the tin: $ curl -s -v http://httpstat.us/200 * Trying 104.31.87.226... * TCP_NODELAY set * Connected to httpstat.us (104.31.87.226) port 80 (#0) > GET /200 HTTP/1.1 > Host: httpstat.us > User-Agent: curl/7.
Read MoreHetzner Cloud review
I’ve been a customer of Hetzner Cloud for a few years. The TLDR; is that it’s a solid service that is worth taking a look at if you want low prices for virtual machines if you don’t mind rolling your own solutions for many things. Prices are very competitive. A basic system with 1 vCPU, 2 GB RAM and 20 GB of disk is €2.89 ($3.42). This includes 20 TB of traffic which is plenty for most small projects.
Read MoreFun with curl
A simple way to get a little understanding on all of the back and forth that goes into an HTTP request is to use the venerable curl command. If you run curl with the following arguments: $ curl -s -v -o /dev/null https://l10systems.com You get back a verbose (-v) listing of the calls that suppresses the payload response (-o /dev/null) and doesn’t show the status of the call (-s). This allows you to just see the headers and the back and forth that goes into an HTTP request:
Read MoreSlow down script kiddies and other malcreants
The null program is a really great blog written by Chris Wellons. He has a great amount of interesting stuff on a wide array of programming topics. One that caught my attention recently, is Endlessh: an SSH Tarpit. Essentially, what he is proposing is a very simple and low cost way to slow down unsophisticated attacks on Internet facing servers. If you’ve ever had an Internet facing server with port 22 open, you can immediately see the value of this.
Read MoreScheduling builds on Netlify
I like the publication workflow in Netlify with Hugo. It’s pretty easy: everything in your master branch is published when it’s committed. That’s quite nice. But if you want to create entries that get published in the future, it’s not as convienient. A quick search on the Netlify Community had a few options listed. But none seemed easier than this one which proposes using a scheduled Github Action to push the build to a Netlify build hook.
Read MorePython code to migrate Google Play Music playlists to Spotify
After getting everything downloaded from Google Takeout, I unzipped everything and figured out what we have from the exported playlists. In the unzipped Takeout folder, there is an archive_browser.html file that lists all of the stuff that was downloaded. To start, I’ll just get my Thumbs Up playlist (which had a nice property in Google Play Music where you could have all of your liked tracks downloaded to your device automatically - I don’t see that in Spotify).
Read MoreImporting Google Play Music Playlists to Spotify
Google Play Music is going away. I’ve been a subscriber for a number of years and I liked the service but they are changing it to YouTube Music which I don’t like as much. So I decided to make a change to Spotify. People seem to really like Spotify and I like that they have a Linux client and a decent family plan ($15 per month). All good. Except that I’ve got years of playlists on Google Play Music that I’d like to bring along.
Read More