Quick Tip: Get Absolute Path to Directory Script is Running in

When running a bash script, it’s sometimes convenient to get a fully qualified path to the directory that the source of the running script is in.

I continually have to remind myself of the exact syntax for this tip, so I’ve posted it for posterity. This approach should work around most issues of symlinked files, sourced files, etc.

Tuesday, January 17, 2023

Quick Tip: Run Bash Commands in Parallel

I have a useful script that demonstrates a few different bash techniques.

This script:

  • Executes multiple commands on multiple SSH client hosts
  • Connects to each host in parallel, and waits for all host processes to terminate
  • As a freebie, demonstrates running apt in a non-interactive process
Wednesday, May 18, 2022

Quick Tip: create ico from png or jpg

I regularly have to look up the ImageMagick syntax for converting image files to ico formats when I’m creating a favicon.ico

The convert command, part of the ImageMagick suite, is quite helpful and versatile.

Wednesday, April 24, 2019

Deploy AWS Lambda functions with Terraform

I built a GitHub project to explore and document some basic Terraform scripts, both to learn Terraform, and to figure out how to deploy to AWS Lambda without using serverless or the web UI.

Tuesday, March 5, 2019

Quick Tip: Copy Files from LXC host to LXC Container

Today, I wanted to copy some files to the container filesystem of an lxc container I was spinning up.

There are a number of different approaches to achieve this, and they’re all great, but I wanted the simplest thing I could do, rather than grepping through fstab records, and copying into arcane folders, etc.

Tuesday, June 7, 2016

Quick Tip: Remove Query Param from URL in Go

How to easily remove query string parameters from a url.URL in Go.

Today’s short post shows how simple it is.

Wednesday, June 1, 2016

Powershell Scripts - from the Archives

Way back in the day - circa 2007 or 2008 I had a website that included some sample code and snippets that demonstrated things I’d learned at the time.

The content isn’t really that valuable any longer, but there are some nifty things.

Thursday, July 2, 2015

Mail Queue Dispatcher

When writing web applications, one often has to send email as a part of the notification or registration process.

Sending email through an SMTP server directly from your main web application thread can block for an unreasonable amount of time while serving a response page that is waiting for the email to be delivered.

Wednesday, July 1, 2015