Resize images using the command line in bash/zsh

sips zsh bash

Another command line script for sharing purpose. It’s a simple script that loops through the current directory and asks you for the new filenames, maximum width and height. I’ve used the OSX built in sips tool but you can rewrite that easily to Imagemagick if you prefer more options or a script that works on Linux as well. The original script is available through my Gist: Happy resizing! And to give some credits to Sips, it’s blazingly fast.

10 Sep 2016

Monitor disk space in your docker container

docker bash

A while ago I wrote a basic Bash script to check the disk space inside running Docker containers. As I couldn’t find much examples for this simple purpose, I’d thought I’d share mine. It’s available in my Github Gist: In essential it takes the following steps, made possible with default Docker commands and a set of string manipulations: List and loop through all running Docker containers Execute some “df” commands within the container with Docker exec Collect the values and email whenever something is more full then you want Of course, monitoring by email is not the best way but it’s fairly easy to move a script like this to be used in Zabbix, Nagios or other monitoring tools.

8 Apr 2016