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

Connect a local pipe to a running Docker container:

echo test | docker exec -i container_name cat
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:

Sunday, Sep 21st, 2014

Some Adobe Flash projects require you to draw a lot of arrows. This can get tedious. So, many years ago, I wrote an Arrow drawing tool. It was written for CS2, but still works well enough in CS4.

You can:

  • Draw single sided arrrows
  • Draw double sided arrows
  • Draw curved line arrows
  • Adjust the width of the line
  • Adjust the ratio of the arrow head width to the line width

Tuesday, Jun 17th, 2014

If you are using subprocess.Popen to run an external process while running Python/Django with a virtual environment in Apache via mod_wsgi you'll discover the new processes run outside of your virtual environment. In my case, I need to set the PYTHONPATH environment variable to get everything straight. Rather than hardcode it or the sys.path in the external script, I'd like to set it to the same value as the existing environment.

Pages

Subscribe to Front page feed