This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 [email protected] --prefix=lazybitch >/dev/null | |
zzz | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#=============================================================================== | |
# | |
# FILE: getgeo.sh | |
# | |
# USAGE: ./getgeo.sh | |
# | |
# DESCRIPTION: run the script so that the geodata will be downloaded and inserted into your | |
# database | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/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']" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# correct output is -03:00 | |
pip install --upgrade --verbose pytz | |
python -c "from pytz import timezone as z; from datetime import datetime as d; print str(z('America/Santiago').localize(d(2013, 03, 11)))" | |
# correct output is 07:00 | |
gem install tzinfo | |
ruby -e 'require "Date"; require "TZInfo"; t=DateTime.strptime("2013-03-11 10-00-00", "%Y-%m-%d %H-%M-%S"); t=TZInfo::Timezone.get("America/Santiago").utc_to_local(t); print(t, "\n")' | |
# Perl's DateTime data | |
# correct output is also 07:00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# by denis@ | |
import os | |
from subprocess import check_output as co, call | |
import time | |
def submit(value): | |
call("echo -n 'statsd.custom.cpuusage:{}|g' | nc -w 1 -u localhost 8125".format(value), shell=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -ve | |
lxc-create -n vpn -t ubuntu | |
# ln -s /var/lib/lxc/vpn/config /etc/lxc/auto/vpn.conf | |
perl -i -ple 's/#lxc.aa_profile = unconfined/lxc.aa_profile = unconfined/' /etc/lxc/auto/vpn.conf | |
perl -i -ple 's/^exit 0/# exit 0/' /etc/rc.local | |
cat >>/etc/rc.local <<hello | |
mkdir -p /var/lib/lxc/vpn/rootfs/dev/net/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -sL https://gist.github.com/overplumbum/4196574/raw/install.sh > tmp.sh && sudo sh tmp.sh |
NewerOlder