Skip to content

Instantly share code, notes, and snippets.

extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar e $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
@jph
jph / gist:4489811
Created January 9, 2013 01:31
howdoi build errors
$ sudo python setup.py install
Password:
running install
running bdist_egg
running egg_info
creating howdoi.egg-info
writing requirements to howdoi.egg-info/requires.txt
writing howdoi.egg-info/PKG-INFO
writing top-level names to howdoi.egg-info/top_level.txt
writing dependency_links to howdoi.egg-info/dependency_links.txt
@jph
jph / gist:4114963
Created November 19, 2012 23:49
serial interface
require 'rubygems'
require 'serialport'
sp = SerialPort.new "/dev/my-modem", 9600 # baud rate
do
puts sp.read
while !sp.eof?
@jph
jph / .zshrc
Created January 31, 2012 22:48
zshrc
ZSH=$HOME/.oh-my-zsh
ZSH_THEME="fishy"
plugins=(git)
source $ZSH/oh-my-zsh.sh
export PATH=usr/local/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
#!/usr/bin/ruby
require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'ostruct'
class LineStatus
def initialize