Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / 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 / 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 / vlc transcoding to H.264.sh
Created May 19, 2010 15:25
Use VLC to convert to H.264/MP4 and Ogg in one go.
# convert to MP4/H.264 and Ogg simultaneously
/Incoming/VLC.app/Contents/MacOS/VLC -I dummy ~/Dropbox/Public/VLC/Original.dv --sout='#duplicate{dst="transcode{vcodec=h264,venc=x264{profile=main,level=3},vb=800,scale=1,acodec=mp4a,ab=128,channels=2,samplerate=32000}:standard{access=file,mux=mp4,dst=/tmp/test.mp4}",dst="transcode{vcodec=theora,vb=800,scale=1,acodec=vorb,ab=128,channels=2,samplerate=32000}:standard{access=file,mux=ogg,dst=/tmp/test.ogg}"}' vlc://quit
@ssp
ssp / posterImageFromMovie.py
Created June 5, 2010 12:20
Use QTKit and PyObjC to get a JPEG for an image's poster frame.
#!/usr/bin/env python
#coding=utf-8
"""
posterImageFromMovie.py, 2010 by Sven-S. Porst <ssp-web@earthlingsoft.net>
Uses PyObjC to extract the poster frame from a movie file and save it as a JPEG next to the movie. An existing file moviename.jpeg will be overwritten.
"""
from QTKit import *
import sys
import os
@ssp
ssp / DV sound fix
Created June 5, 2010 12:25
VLC has troubles with 32KHz audio in DV files. ffmpeg can fix that.
ffmpeg -i Original.dv -y -target dv Target.dv
# Original.dv: 2 stereo channels of 32kHz audio
# Target.dv will have one stereo channel of 48KHz audio.
# -y overwrites the target file
@ssp
ssp / Safari.css
Created June 10, 2010 21:42
Custom Style Sheet for Safari, includes Reader fix, Spiegel Online crap removal, improved legibility and vanity stuff.
/* SPIEGEL ONLINE **************/
div.spArticleImageBox, div.spMultimediaLeiste, div.spForumBoxBig, div.spRessortTeaserBox.panorama, div.spRessortTeaserBox.sport, div.spRessortTeaserBox.einestages, div.spRessortTeaserBox.auto, div.spRessortTeaserBox.reise, div.spRessortTeaserBox.spam {
display:none;
}
/* TWITTER **************/
.tab .doing, #side #currently {
word-wrap: break-word;
}