Skip to content

Instantly share code, notes, and snippets.

@ssp
ssp / Check Plist Syntax.sh
Created October 4, 2009 11:55
check syntax of .strings plist files
# check syntax of .strings plist files
find . -name "*.strings" -print0 | xargs -0 plutil | grep -v ": OK"
@ssp
ssp / nibtoxib.sh
Created December 11, 2009 11:57
nibtoxib
#! /bin/sh
find . -name "*.nib" -type d | awk '{sub(/.nib/,"");print}' | xargs -I % ibtool --write %.xib --upgrade %.nib
@ssp
ssp / xibtonib.sh
Created December 11, 2009 11:58
xibtonib
#! /bin/sh
find . -name "*.xib" -type f | awk '{sub(/.xib/,"");print}' | xargs -I % ibtool --compile %.nib %.xib
@ssp
ssp / lsregister
Created December 11, 2009 11:59
lsregister
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister
@ssp
ssp / gpsdownload.sh
Created December 11, 2009 12:00
download data from Bluetooth GPS device
# from strange Bluetooth GPS device that's already set up using gpsbabel
gpsbabel -t -w -i wbt -f /dev/tty.SPPslave -o kml -F ~/Desktop/route.kml
# in Mac OS X with Fast User Switching enabled
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend
# rather switch to a specific user ID:
#/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -switchToUserID 505
@ssp
ssp / change MAC address.sh
Created December 11, 2009 12:03
change MAC address
# for ethernet, use en1 for airport, replace 0s with desired address
sudo ifconfig en0 ether 00:00:00:00:00:00
@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
@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 / 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