Skip to content

Instantly share code, notes, and snippets.

/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | python -c "import sys; d = (l.split(':', 1) for l in sys.stdin); d = dict((k.lstrip(), v.strip()) for k, v in d); print d['SSID'] + '\t' + d['BSSID']"
#!/bin/bash
#===============================================================================
#
# FILE: getgeo.sh
#
# USAGE: ./getgeo.sh
#
# DESCRIPTION: run the script so that the geodata will be downloaded and inserted into your
# database
#
#!/usr/bin/env python
"""
Installation (Ubuntu <=12.04):
sudo apt-get install -y python-pip python-dev
sudo pip install -U psutil librato-metrics
cat > /etc/cron.d/librato <<zzz
* * * * * root /usr/local/bin/librato-monitoring --token=TOKEN --user=user@ex.org --prefix=lazybitch >/dev/null
zzz
"""
#!/bin/bash
set -e
## options
rvm_version=1.22.18
ruby_version=ruby-1.9.3-p448 # full qualified only
bundler_version=1.3.5
rvms_root=./rvms
## vars
rvm_dir=$rvms_root/rvm-$rvm_version
pip install https://www.dropbox.com/s/f1z9k0ym9bgamr9/pgmagick-0.5.8-cp27-none-macosx_10_9_x86_64.whl?dl=1
python -c 'import pgmagick'
brew uninstall -f boost graphicsmagick freetype libtool
brew install graphicsmagick freetype libtool
brew install boost --with-python
#pip install pgmagick==0.5.8 --download-cache=/tmp/
#time pip wheel -w pgwheel/ --download-cache=/tmp/ pgmagick==0.5.8
#!/usr/bin/python2.7 -u
from os.path import basename, join, dirname
from glob import glob
from pprint import pprint as pp
for proc in glob('/proc/*/status'):
try:
meta = dict(line.split(':\t', 1) for line in open(proc).read().splitlines())
except IOError:
continue