Wednesday, Sep 6th, 2017

Want the list of all Public IP addresses associated with your Amazon Web Services account? Install aws-cli, configure, then:

aws ec2 describe-network-interfaces --query NetworkInterfaces[].Association.PublicIp

The result is a JSON array, so you can sort numerically with jq:

aws ec2 describe-network-interfaces --query NetworkInterfaces[].Association.PublicIp | jq 'sort_by(.)'
Monday, Aug 1st, 2016

Use exiftool to add the needed EXIF data:

exiftool Photosphere.jpg -ProjectionType=equirectangular -UsePanoramaViewer=True

Now copy the file to your phone and it will be recognized as a photosphere.

Sunday, Feb 7th, 2016

The default/fallback/substitution fonts are those used when an application or webpage doesn't specify a specific font or when a character glyph is not available in the selected font. When the CSS contains "font-family: sans", which font is that? Note: I'm using an Ubuntu-based distribution, but the details should apply anywhere fontconfig is used.

Tools:

Tuesday, Dec 15th, 2015

I enjoy using the interactive Python console as a calculator, but typing python3 and then from math import * was annoying. So I scripted it into a simple command I've named cpy. Maybe someone else can use it.

Friday, Dec 4th, 2015

I just updated the design on this website (finally!) and needed to make image sprites for the github/twitter/linkedin icons. I know there's ways to create image sprite sets NodeJS and Gulp/Grunt, but what's the fun in that!?

Wednesday, Nov 25th, 2015

A list of Docker and Docker-related commands.

More to come! I'm adding as I find a need.

Delete the last run Docker Container:

docker ps -l -q | xargs docker rm -v

Delete all Docker Containers:

docker ps -a -q | xargs docker rm -v

Delete all Docker Volumes:

docker volume ls -q | xargs docker volume rm

Delete all unnamed Docker Images:

Tuesday, Nov 24th, 2015

The Jinja templating engine works well to create LaTeX templates for generating PDF files. The only issue is the default Jinja block, variable, and comment identification strings can conflict with the LaTeX commands. A solution is to change the Jinja environment to mimic the LaTeX environment.

Here is an example. This is the python file test.py:

Friday, Sep 11th, 2015

You need to pass some unknown number of values to a function (https://en.wikipedia.org/wiki/Variadic_function) which accepts unlimited arguments in golang? Put everything in a slice of interface{} and unpack that with "..."

Friday, Nov 14th, 2014

Here are a couple Upstart configuration options for waiting on process dependency.
These files go in your Upstart /etc/init directory. Not the best way? Let me know!

Wait for a port to open

Friday, Nov 14th, 2014

This is a method to run an ezstream icecast2 audio stream as a startup service within a Upstart init system. This method will also work for anything else which needs to run as a service.

I assume you have icecast2 installed and functioning: http://icecast.org/docs/icecast-2.2.0/basic-setup.html

Create a configuration file for ezstream in /etc/icecast2/ or in a project specific directory:

Pages

Subscribe to Front page feed