Skip to content

Instantly share code, notes, and snippets.

@apetrov
Created February 10, 2012 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apetrov/1789888 to your computer and use it in GitHub Desktop.
Save apetrov/1789888 to your computer and use it in GitHub Desktop.
Recipes
Gem list - to installable script
replace \((\d\.\d+\.\d+)\) with --version=$1
Remove blank lines
pbpaste | grep -v "^$" | pbcopy
html2haml
pbpaste | html2haml | pbcopy
format json
python -m json.tool
base64 (encode/decode):
pbpaste | base64
pbpaste | base64 -D
Simple HTTP Server
python -m SimpleHTTPServer
Block country by IP
http://www.linuxstall.com/block-country-iptables/
Render erg script
pbpaste | ruby -e "require 'erb';puts ERB.new(STDIN.read).result(nil);"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment