Skip to content

Instantly share code, notes, and snippets.

@chauncey
chauncey / st.rst
Last active October 9, 2015 10:27 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 - Useful Shortcuts

General

@chauncey
chauncey / python_mime_email.py
Created December 4, 2012 19:47
Python HTML email
# import smtplib for sending and MIMEText to handle html
import smtplib
from email.mime.text import MIMEText
# Create a MIMEText msg and specify html
msg = MIMEText(htmlstring, 'html')
# Add a subject, sender and recipient to the msg
msg['Subject'] = 'My Subject'
msg['From'] = 'from@domain.com'
@chauncey
chauncey / dupe.py
Created December 4, 2012 20:03
Apache Python dupe catcher
#!/usr/bin/env python
"Searches for KEY in GET request - combined Apache format (I think)"""
KEY = "GET /cgi-bin/blah?var=myvar"
LOG = "tmp.log"
def findDupes(log):
dupes = []
for l in log:
@chauncey
chauncey / gist:4208189
Created December 4, 2012 20:10
swap caps lock and escape

speedswapper script

! Swap caps lock and escape
remove Lock = Caps_Lock
keysym Escape = Caps_Lock
keysym Caps_Lock = Escape
add Lock = Caps_Lock

! Return caps lock and escape
@chauncey
chauncey / gist:4208298
Created December 4, 2012 20:23
linux dotfiles setup
## This assumes that these packages are installed already - git, zsh, gvim, exuberant ctags ##
# Create a ssh key
$ ssh-keygen
# Add public key to github
# Checkout dotfiles
$ git clone git@github.com:chauncey/dotfiles.git dotfiles/
$ cd dotfiles
@chauncey
chauncey / gist:6524655
Created September 11, 2013 14:45
Python Counter snippet
In[1]: from collections import Counter
In[2]: ports = ['33680',
'33680',
'33680',
'33677',
'33677',
'33677',
'33677',
'33677',
@chauncey
chauncey / 0_reuse_code.js
Created April 10, 2014 14:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@chauncey
chauncey / apache2.2_compile.sh
Last active August 29, 2015 13:58
AIX 5.3 configure for Apache 2.2 and 2.4
# with OpenSSL 0.9.7d
./configure --with-mpm=worker --enable-so --enable-layout=Apache --enable-mods-shared=most --enable-maintainer-mode --enable-static-support --prefix=/usr/local/apache2 --enable-ssl=shared --enable-proxy
# with OpenSSL 1.0.1g
./configure --with-mpm=worker --enable-so --enable-layout=Apache --enable-mods-shared=most --enable-static-support --prefix=/usr/local/apache2.2 --enable-ssl=shared --enable-proxy --with-ssl=/usr/local/openssl-1.0.1g --with-included-apr
# with OpenSSL 1.0.1j
./configure --with-mpm=worker --enable-so --enable-layout=Apache --enable-mods-shared=most --enable-static-support --prefix=/usr/local/apache2.2 --disable-lua --enable-ssl=shared --enable-proxy --with-included-apr LDFLAGS="-L/usr/local/openssl-1.0.1j/lib -lssl -lcrypto"
@chauncey
chauncey / svn.sh
Created April 15, 2014 18:28
AIX 5.3 compile subversion
# Subversion 1.6.9
./configure --prefix=/usr/local --disable-nls --with-apr=/usr/HTTPServer/bin \
--with-apr-util=/usr/HTTPServer/bin --without-berkeley-db --without-gnome-keyring --without-ssl --without-swig \
--with-sqlite=/usr/chris/src/subversion-1.6.9/sqlite-amalgamation/ --without-neon
@chauncey
chauncey / python2.6.sh
Last active December 18, 2015 13:31
AIX 5.3 compile Python
# Python 2.6
./configure --prefix=/usr/local --disable-ipv6