Skip to content

Instantly share code, notes, and snippets.

curiousstranger / gist:309035
Created Feb 19, 2010
Unlock osx keychain from the command line. Must approve access via 'Keychain Access' before using
View gist:309035
security unlock-keychain; security find-generic-password -ga /Users/mruser/.ssh/id_dsa 2>&1 > /dev/null

Keybase proof

I hereby claim:

  • I am curiousstranger on github.
  • I am curiousstranger ( on keybase.
  • I have a public key ASC2juss3BGloYtC_2rOQy7Ynvr6nYidKXnyZCdaJTlDVQo

To claim this, I am signing this object:

#!/usr/bin/env zsh
# ------------------------------------------------------------------------------
# Fish style live command coloring.
# ------------------------------------------------------------------------------
# Token types styles.
# See
curiousstranger / gist:339011
Created Mar 21, 2010
Search for a pattern in a file with python
View gist:339011
# Open file
f = open('test.txt', 'r')
# Feed the file text into findall(); it returns a list of all the found strings
strings = re.findall(r'some pattern',
curiousstranger / mac3to1
Created Feb 4, 2010
Script to convert mac address on clipboard between formats
View mac3to1
# Grabs MAC addresses in xxxx.xxxx.xxxx form from the clipboard and transforms it to XXXXXXXXXXXX
pbpaste -Prefer txt | perl -pe 's/(\w{4}).(\w{4}).(\w{4})/\U\1\2\3/;' | pbcopy
curiousstranger / mac1to3
Created Feb 4, 2010
On OS X, transform MAC format
View mac1to3
# Grabs MAC addresses in XXXXXXXXXXXX form from the clipboard and transforms it to xxxx.xxxx.xxxx
pbpaste -Prefer txt | perl -pe 's/(\w{4})(\w{4})(\w{4})/\1.\2.\3/;' | pbcopy
View Evolution of a Python
#Newbie programmer
def factorial(x):
if x == 0:
return 1
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal
from evesrp.killmail import ZKillmail
import gdata.spreadsheets.client
from decimal import Decimal
# patch the spreadsheet's client to use the public feeds
gdata.spreadsheets.client.PRIVATE_WORKSHEETS_URL = \
gdata.spreadsheets.client.WORKSHEETS_URL = (''