A ZSH theme optimized for people who use:
- Solarized
- Git
- Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)
For Mac users, I highly recommend iTerm 2 + Solarized Dark
import os | |
from PIL import Image | |
def extractFrames(inGif, outFolder): | |
frame = Image.open(inGif) | |
nframes = 0 | |
while frame: | |
frame.save( '%s/%s-%s.gif' % (outFolder, os.path.basename(inGif), nframes ) , 'GIF') | |
nframes += 1 |
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
from area53 import route53 | |
from boto.route53.exception import DNSServerError | |
import requests | |
import sys | |
from datetime import datetime | |
# Modified from https://markcaudill.me/blog/2012/07/dynamic-route53-dns-updating-with-python/ | |
domain = 'domain.tld' | |
subdomain = 'subdomain_name' |
This can reduce files to ~15% of their size (2.3M to 345K, in one case) with no obvious degradation of quality.
ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
Other options for PDFSETTINGS:
wget http://stedolan.github.io/jq/download/linux64/jq | |
aws ec2 describe-instances --filters "Name=tag:Name,Values=$NAME" \ | |
"Name=instance-state-name,Values=running" \ | |
| jq -r \ | |
".Reservations[] | .Instances[] | .InstanceId" \ | |
aws ec2 describe-volumes --filters \ | |
"Name=status,Values=available" \ | |
| jq -r ".Volumes[] | .VolumeId" \ |
library(ggplot2) | |
library(maps) | |
library(mapproj) | |
############################################################################### | |
# Step 1: Get data from Foursquare | |
# If you already have it, then great :) Otherwise, you can use RPI. The source | |
# is listed below, and there are instructions for getting keys in the readme. | |
# RPI: https://github.com/johnschrom/RPI |
Since 2008 or 2009 I work on Apple hardware and OS: back then I grew tired of Linux desktop (which is going to be MASSIVE NEXT YEAR, at least since 2001), and switched to something that Just Works. Six years later, it less and less Just Works, started turning into spyware and nagware, and doesn't need much less maintenance than Linux desktop — at least for my work, which is system administration and software development, probably it is better for the mythical End User person. Work needed to get software I need running is not less obscure than work I'd need to do on Linux or othe Unix-like system. I am finding myself turning away from GUI programs that I used to appreciate, and most of the time I use OSX to just run a terminal, Firefox, and Emacs. GUI that used to be nice and unintrusive, got annoying. Either I came full circle in the last 15 years of my computer usage, or the OSX experience degraded in last 5 years. Again, this is from a sysadmin/developer ki
# Last updated: 08/24/2916 | |
# | |
# Total instructions available: 18 | |
# | |
# https://docs.docker.com/engine/reference/builder/ | |
# | |
# You can use a .dockerignore file in the same context directory as | |
# your Dockerfile to ignore files in the context before sending them | |
# to the Docker daemon for building to speed up building. |