Skip to content

Instantly share code, notes, and snippets.

@mrabbitt
mrabbitt / gist:4180565
Created December 1, 2012 04:33
Backup iTunes 10.x before upgrading to iTunes 11 (Mac OS X)
tar czvf ~/Desktop/iTunes-backup-$(date +%Y%m%d_%H%M%S).tgz -C / \
/System/Library/PrivateFrameworks/CoreFP.framework \
/Applications/iTunes.app \
/Library/Documentation/Applications/iTunes \
/Library/Documentation/iPod \
/Library/Frameworks/iTunesLibrary.framework \
/System/Library/PrivateFrameworks/iTunesAccess.framework
@mrabbitt
mrabbitt / download_splunk_pdf_docs.py
Created November 20, 2012 21:26
Script to download all PDF files for a particular version of Splunk documentation.
#!/usr/bin/env python
'''
Script to download all PDF files for a particular version of Splunk documentation.
Requirements:
requests: http://docs.python-requests.org
beautifulsoup4: http://www.crummy.com/software/BeautifulSoup/
(pip install -U requests beautifulsoup4)
@mrabbitt
mrabbitt / gist:3789992
Created September 26, 2012 19:22
Update GrowlMail.plugin for compatibility with the latest version of Mail and Message framework
defaults write ~/Library/Mail/Bundles/GrowlMail.mailbundle/Contents/Info.plist SupportedPluginCompatibilityUUIDs -array-add $(defaults read /System/Library/Frameworks/Message.framework/Versions/Current/Resources/Info.plist PluginCompatibilityUUID)
defaults write ~/Library/Mail/Bundles/GrowlMail.mailbundle/Contents/Info.plist SupportedPluginCompatibilityUUIDs -array-add $(defaults read /Applications/Mail.app/Contents/Info.plist PluginCompatibilityUUID)
@mrabbitt
mrabbitt / stree-wrapper.bash
Created July 5, 2012 03:41
Wrapper for SourceTree "stree" command which works on any file or directory nested inside inside a Git or Mercurial repo.
#!/bin/bash -e
getRepoRoot()
{
local target=$1
if [ -d "${target}" ] ; then
cd "${target}"
elif [ -f "${target}" ] ; then
cd "$(dirname ${target})"
fi
@mrabbitt
mrabbitt / get_keychain_pass.py
Last active July 26, 2024 18:17
Command line access to the Mac OS X Keychain (based on post: http://blog.macromates.com/2006/keychain-access-from-shell/#comment-979)
#!/usr/bin/env python3
import sys
import subprocess
import re
import logging
import argparse
# https://github.com/wooster/biplist (pip install biplist)
# FIXME Replace biplist with standard library `plistlib` which supports binary format in 3.4+
import biplist
@mrabbitt
mrabbitt / gist:1545455
Created December 31, 2011 21:53 — forked from anonymous/gist:1545449
Narrow Google's New Top Bar
#gb,
#gbqlw {
height: 42px !important;
}
#gbv,
#gbn,
#gbx1,
#gbx2 {
height: 41px !important;