Dynamic Profile And Badge Switching Without Shell Integrations In iTerm2

I use iTerm2 for all my terminal work.  One very nice feature it has is dynamic profiles.  But I usually don’t want to install shell integrations on every server.  Instead, I use my dotfiles and an SSH config to change profiles.  While working across different local, development, and production systems, it’s helps my mental state to know when I’m on a dev or prod system.  I have my system setup so when I:

  • SSH to a local vagrant box, my terminal turns purple
  • SSH to a development host, my terminal turns blue
  • SSH to a production host, my terminal turns red

Continue reading “Dynamic Profile And Badge Switching Without Shell Integrations In iTerm2”

How To Create A Custom, Dynamic Inventory Script for Ansible

Writing a dynamic inventory script for Ansible can be useful for more than just getting a list of hosts to run a play against.  It can also function as a standalone command line utility for your infrastructure.

The first time I wrote one, I had a difficult time finding information on how to actually do it so I wanted to write about how to make one and then show an example of how it can be extended beyond a simple inventory script by adding additional flags to the scripts.

Let me set the scene, which may sound familiar: due to a lot of tech debt, there are thousands of servers–many of which are not tracked anywhere.  Continue reading “How To Create A Custom, Dynamic Inventory Script for Ansible”

Tame Your Patreon Shipping Problem With Ansible

My work on the Pi-hole project led me to a start a Patreon page.  Like many creators, I spent a while determining what rewards users would want.  But unlike most users, I did not have a problem fulfilling orders.

Apparently, this is a big problem: project creators spend more time shipping and fulfilling orders than actually working on their project.  But for me, fulfilling the orders my patrons took me all of 5 minutes.  In this post, I’ll explain how I did it using an API. Continue reading “Tame Your Patreon Shipping Problem With Ansible”

Batch Download All Of GarageBand’s Loops, Jingles, And Sound Effects

GarageBand has a lot of cool loops and sound effects.  If you are a systems administrator, you might be tasked with deploying these sounds and loops so you don’t need to download it onto each computer when GarageBand opens up.  Or maybe you just want to have these effects for your own personal movies or songs. Continue reading “Batch Download All Of GarageBand’s Loops, Jingles, And Sound Effects”

I Made My Own Script To Fill Out Tedious PDF Forms For Me

I often need to fill out a PDF form for requesting medical records.  I have typically done this using Preview since I can use it to digitally sign the form.  But requesting new records after every appointment started becoming tedious–even when doing it digitally.  I also did not want to wait for years and then request the records all at once (because it’s easier to handle large things like this via attrition rather than in bulk).  So I made a script that would fill out PDF forms for me using the information I specified. Continue reading “I Made My Own Script To Fill Out Tedious PDF Forms For Me”

Quickly Download Or Install Common Apps Without Going To The Website

While helping friends and family with their computers, I often need to download an app they don’t have or update it to the latest version–something I don’t really want to spend my time doing.  This is definitely a first-world annoyance for me, but I always have fun making the computer do my laborious tasks for me, which frees up more time to do the things I enjoy. Continue reading “Quickly Download Or Install Common Apps Without Going To The Website”

How I Went Paperless And Clutter-free For $32

Ever since I discovered Dropbox, I felt weighed down by the clutter of physical documents.  I use it for all of my digital documents.  After a while, physical documents and pieces of paper began to get on my nerves.  It was much easier to have searchable PDFs that I could access anywhere.  To that end, I wanted to be able to convert any physical document I received into a searchable PDF.  See the video below for the entire workflow in action. Continue reading “How I Went Paperless And Clutter-free For $32”

Batch Rotate Photo Files With Hazel and sips

If you have a ton of photos that are all facing the wrong direction and don’t want to do them individually, you can use Hazel to automatically go through a folder and rotate the images for you.  All it takes is a one-line bash script and a Hazel rule.

sips -r 90 "$f"

This rotates the image 90 degrees.  You can set it to 180 or whatever else you want. Continue reading “Batch Rotate Photo Files With Hazel and sips”

Trigger Scripts Via Dropbox And Hazel

I haven’t found a great use for this yet, but you can have your Mac automatically run a script by simply creating a file/folder in your Dropbox.  To do this, you need to set up Hazel to watch your Dropbox folder for a certain file/folder, and if it appears, trigger a script.  You could also use folder actions, or launchd, but it will be much more challenging.

In the example below, I simply play a sound byte of the Borg claiming that resistance is futile. Continue reading “Trigger Scripts Via Dropbox And Hazel”

OS X Mail: Create HTML-formatted Auto-response With AppleScript and Rules

Do you respond to a lot of emails with the same or similar content?  You can use Apple’s Mail app to do this for you automatically with some AppleScript and email rules.  Hopefully, you already know about the privacy glitch associated with Apple’s Mail program and Spotlight and have disabled the indexing of your emails.  If not, do that now.  Then, follow the instructions below. Continue reading “OS X Mail: Create HTML-formatted Auto-response With AppleScript and Rules”