Skip to content

Instantly share code, notes, and snippets.

@jdevera
jdevera / ecs.py
Created February 26, 2010 16:24
A replacement for pyaws's ecs.py to make it work with signed requests.
# Author: Kun Xi <kunxi@kunxi.org>
# License: Python Software Foundation License
#
# Note: This version, 0.3.1, supports the signed requests required
# by Amazon.
# The changes over 0.3.0 are based on a patch for 0.2.0 found here:
# http://blog.umlungu.co.uk/blog/2009/jul/12/pyaws-adding-request-authentication
# To make it work, just download pyaws from http://trac2.assembla.com/pyaws
# and replace the ecs.py file with this one.
@weaver
weaver / yaml-omap.py
Created February 28, 2010 03:44
Use Python OrderedDict as YAML omap
import yaml
### OrderedDict from <http://pypi.python.org/pypi/ordereddict/1.1>
# Copyright (c) 2009 Raymond Hettinger
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
@mathiasbynens
mathiasbynens / appify
Created November 12, 2010 13:46 — forked from subtleGradient/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
@enaeseth
enaeseth / yaml_ordered_dict.py
Created February 25, 2011 19:54
Load YAML mappings as ordered dictionaries
import yaml
import yaml.constructor
try:
# included in standard lib from Python 2.7
from collections import OrderedDict
except ImportError:
# try importing the backported drop-in replacement
# it's available on PyPI
from ordereddict import OrderedDict
@shnjp
shnjp / tunnel.py
Created March 5, 2011 06:29
ssh tunnel for Fabric
"""
Fabric tunneling utilities
by shn@glucose.jp
class ForwardServer and relates things are refere Robey Pointer's paramiko example.
(http://bazaar.launchpad.net/~robey/paramiko/trunk/annotate/head%3A/demos/forward.py)
usage::
with make_tunnel('user@192.168.0.2:10022') as t:
@goozbach
goozbach / ndb-local
Created May 19, 2011 18:49
Chaining PXELINUX bootloaders
ip=192.168.1.100 sys=laptop ether=001c25123456
dom=laptop.example.com
bootf=/386/syslinux/pxelinux.0
@thedod
thedod / README
Created May 29, 2011 08:31
Woof (one-time file exchange) + helper scripts
Woof is an amazingly simple and effective file exchange tool:
http://www.home.unix-ag.org/simon/woof.html
This distribution doesn't include simon Budig's original woof
(that started breaking for me), but Edward Samson's fork:
https://bitbucket.org/edu/woof
Desktop helper scripts:
filewoof and folderwoof "open with" actions for nautilus etc.
and woofget that runs "woof -U" in a terminal window in /tmp
(e.g. for a launcher button)
@zircote
zircote / ssh.sh
Created September 26, 2011 21:45
Convert a AWS PEM into a ssh pub key
ssh-keygen -y -f private_key1.pem > public_key1.pub
@rjshade
rjshade / grab_all_pages.sh
Created January 27, 2012 23:46
wget with https and cookie login
#!/bin/bash
# first login and store the cookie
wget --post-data='name=USERNAME&pass=PASSWORD&op=Log%20in' --save-cookies=my-cookies.txt --keep-session-cookies "https://private.site.com" > /dev/null 2>&1
# now we can scrape the site (353 pages)
for i in {0..353}
do
echo "grabbing page $i..."
wget --cookies=on --keep-session-cookies --load-cookies=my-cookies.txt "https://private.site.com/people?page=$i" > /dev/null 2>&1
@lowstz
lowstz / auto-ovpn.sh
Created February 8, 2012 15:22 — forked from xream/MacVPN.sh
Linux openvpn auto reconnect script
#!/bin/bash
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
### Thanks Xream's Work XD
# if you don't have several vpn servers to select, you can comment following line
# and use your openvpn config file name to replace "${host}.ovpn" in while loop.
read -p "Select the host: " host