Skip to content

Instantly share code, notes, and snippets.

@ssp
ssp / sparklesign.sh
Created May 11, 2010 16:38
Create signature which Sparkle likes in an appcast.
# create signature to be used in appcast
openssl dgst -sha1 -binary < !:1 | openssl dgst -dss1 -sign /path/to/private/key.pem | openssl enc -base64
@ssp
ssp / turn off spindumps
Created March 7, 2010 15:35
Turn off spindump in MacOS X. This can improve the performance of the whole system in some situations.
launchctl unload -w /System/Library/LaunchDaemons/com.apple.spindump.plist
@ssp
ssp / cookiekiller.py
Created March 7, 2010 15:30
Kill bad cookies in WebKit. Uses poor and incomplete heuristics to achieve its goal. Includes a LaunchAgent to run the script every night (path in that must be adapted for your account).
#!/usr/bin/env python
"""
COOKIE KILLER
2010 by Sven-S. Porst <[email protected]>
Script with simple heuristics to kill the most obviously crap cookies in WebKit.
Available at http://gist.github.com/324414
Better quit cookie users before running the script.
@ssp
ssp / TMSleep
Created February 19, 2010 22:14
Toggle Time Machine using the defaults command. It may (or may not) be a good idea to run backupd-helper in some way afterwards. See http://github.com/ssp/TMSwitch for slightly more elaborate Time Machine fiddling.
defaults write /Library/Preferences/com.apple.TimeMachine AutoBackup -bool NO
@ssp
ssp / tmstop.sh
Created February 15, 2010 09:53 — forked from nriley/tmstop.sh
#!/bin/zsh -ef
# Stop Time Machine & AppleFileServer
export PATH=/bin:/usr/bin:/usr/sbin:/usr/libexec
setopt extendedglob
diskutil mount $(diskutil list | awk '/MaryBackup\+ A/ { print $NF }')
[[ $(id -u) == 0 ]] || { print "$0: must be running as root" >&2 ; exit 1 }
@ssp
ssp / gist:258369
Created December 17, 2009 00:20
Fix subpixel anti-aliasing in x.6
# x.6 likes to not use it on some displays and removes the ui for setting it manually
# see http://www.macosxhints.com/article.php?story=20090828224632809
defaults -currentHost write -globalDomain AppleFontSmoothing -int 2
@ssp
ssp / Find ISO CSS files
Created December 16, 2009 23:27
find ISO-8889-* encoded files
find . -name "*.css" -print0 | xargs -0 file | grep 8859
@ssp
ssp / executable architecture scan.sh
Created December 11, 2009 12:11
scan typical binary folders for architecture types
#!/bin/sh
# Find our architechture information from binaries on the mac
find /Applications -type f -perm -00100 -print0 | xargs -0 -n 1 lipo -i > ~/Desktop/lipodata
find /Developer -type f -perm -00100 -print0 | xargs -0 -n 1 lipo -i >> ~/Desktop/lipodata
find /Library -type f -perm -00100 -print0 | xargs -0 -n 1 lipo -i >> ~/Desktop/lipodata
find /System -type f -perm -00100 -print0 | xargs -0 -n 1 lipo -i >> ~/Desktop/lipodata
find /private -type f -perm -00100 -print0 | xargs -0 -n 1 lipo -i >> ~/Desktop/lipodata
find /bin -type f -perm -00100 -print0 | xargs -0 -n 1 lipo -i >> ~/Desktop/lipodata
find /sbin -type f -perm -00100 -print0 | xargs -0 -n 1 lipo -i >> ~/Desktop/lipodata
@ssp
ssp / fix keyboard equivalents.sh
Created December 11, 2009 12:10
find keyboard equivalents in application preference files
#!/bin/sh
defaults find NSUserKeyEquivalents | grep Found | sed "s/.*domain .\(.*\).:.*/'\1'/g" | tr "\n" "," | sed "s/\(.*\),/(\1)/g" | sed "s/Apple Global Domain/NSGlobalDomain/g" | xargs -t -J appnames defaults write com.apple.universalaccess com.apple.custommenu.apps appnames
# If Mac OS X's keyboard preference pane forgot your custom keyboard equivalents, this may be able to restore them
# see http://earthlingsoft.net/ssp/blog/2009/07/keyboard_equivalents
@ssp
ssp / tcshrc settings.sh
Created December 11, 2009 12:04
.tcshrc stuff for a more tolerable shell
# not exactly comprehensive but making the terminal more tolerable
# load magic stuff
source /usr/share/tcsh/examples/rc
# from http://bonk.nu/blog/archives/000080.html
set complete=enhance
bindkey -k up history-search-backward
bindkey -k down history-search-forward
#set histdup=all