Many times I find myself needing to keep track of a host on a DHCP’d network where its IP address is subject to change. Here are a collection of command line methods for discovering your IP using both curl/http and dns lookups. HTTP based lookups curl icanhazip.com curl -s 'http://checkip.dyndns.org' […]
bash
There are a lot of interesting lectures on Youtube. Recently I’ve taken to adding these lectures to a playlist and processing them on my mac using the following script: youtube-dl -o '%(stitle)s.%(ext)s' $YOUR_YOUTUBE_PLAYLIST for file in ./*.mp4; do echo "processing $file" file = $(print '%q' "$file") ffmpeg -i "$file" -filter:a […]
A script to turn a Youtube playlist into mp3s

Here is a simple web scraping script I wrote for PhantomJS, the immensely useful headless browser, to load a page, inject jQuery into it, and then scrape the page using a user-supplied jQuery selector. page = require('webpage').create() system = require 'system' phantom.injectJs "static/js/underscore-min.js" page.onConsoleMessage = (msg) -> if not msg.match […]
Simple PhantomJS web scraping script
Recently I found the need to create an init.d script and since I had a hard time finding an example elsewhere1, here’s the overly simple script I came up with to get the job done: #!/bin/bash # myapp daemon # chkconfig: 345 20 80 # description: myapp daemon # processname: […]
Simple init.d script template
[HT Peter, commandlinefu] Query SVN log history and filter by username svn log | sed -n '/username/,/-----$/ p' Run the last command as root sudo !! Save a file you edited in vim without the needed permissions :w !sudo tee % Why is this command so awesome? Peter described it […]
A few helpful bash command-line one-liners

The Why: Preamble Working in the information technology sector, one of the most common questions I get asked by parents is about monitoring internet access of their children.1 Most parents want to know what their children are doing online but also recognize that most off-the-shelf products are just as easy to […]