When I save a screenshot on my systems, it doesn’t try to automatically crush/minify the PNG. Here’s how on a Mac I’ve added a context menu item for images to crush them. This can help save storage space or make web pages load faster.
Ensure you have pngquant installed. Other tools may work for you, but this post is pngquant-specific. I got it via Homebrew.
In the Service Receives drop-down, select image files.
In the left pane, select Utilities under Library.
From the middle pane, drag Run Shell Script to the right pane.
On the top of the box that was just created, use /bin/bash as the shell and pass input as arguments.
Paste in the following code for the shell script:
Choose a name to save the script as which is how you’d like to see in when right-clicking to get the context menu. I named mine png_crush.
Now when you right-click a PNG in Finder, go to Services, and click on the entry for png_crush. Works for multiple-selected files as well.
Most of the time when I insert an SD card into the slot on my mid-2014 Macbook Pro, it mounts in read-only mode and I don’t notice until I try to delete a file. When that happens, the option to “Move to Trash” is missing. After checking that the tiny sliding switch on the side is, in fact, set to the unlocked position, I consulted the Googs.
I found a page suggesting that when inserting the card, pressing in the card on the side closest to me rather than the display helped. But still after several tries I couldn’t get it work. One part of that possible solution piqued my interest, though. It was the phrase “bad tolerances.”
On a whim, I pushed the card’s lock button only one or two millimeters down towards the locked position and tried again. It worked! Wooo!
Tunnelblick is an awesome OpenVPN client, which I have been using a lot lately on my Mac. I had a problem where it would connect the first time just fine, but then would never reconnect; it would seem to hang while trying to handshake with the server. I could get it to work again if I rebooted my machine, but that’s powerfully inconvenient.
TL;DR temporary fix: On disconnect, Tunnelblick fails to remove a static route it used while active. I created a script that I run after disconnecting which drops the static route. It basically just does this:
The 192 address makes an assumption that you didn’t customize that part of the config, so YMMV.
I would really like to rid myself of Dropbox, but all the alternatives I’ve tried are too bloated, beta- or alpha-quality stage, too complicated to set up, or just plain don’t do what Dropbox does (minus the sharing stuff, which I don’t care about). I don’t want btsync, it’s closed-source. Seafile is too complicated, and makes dubious security claims. Owncloud is a cool project, but their file sync is slow, error prone, and has other limitations. There are some good services, but they don’t run on all the platforms I need, including Mac OSX, Linux x86 (32 and 64-bit), Linux ARMv6 (my Raspberry Pi B) and Android. I ran Syncthing for a while, but the continuous memory usage is pretty steep for the Pi, and I’ve experienced random silent file truncation in my shared directories with it. So I needed something else. Continue reading “Unison dependency hell”
I’ve written about Locamatic before, and while it’s good at what it does, there are some definite drawbacks. For one, the most recent version is alpha quality and stated for use on Mountain Lion since prior versions won’t work anymore on a newer system. But as of this writing, Mountain Lion was two major releases ago. I think it’s safe to say that development has stalled, and that’s OK. Continue reading “Long Live ControlPlane!”
Seil is a very cool utility for key re-mapping / enabling international keys on a Mac. I wanted to re-map the mostly useless Caps Lock key to Esc, which I use constantly in vi. If you’re a regular vi user, you know exactly what I’m talking about. Now I just have to develop the muscle memory to start using it regularly instead of reaching way up for the usual Esc key.