Skip to content

Instantly share code, notes, and snippets.

@1951FDG
1951FDG / new_gist_file.sh
Created October 18, 2013 10:27
Create gitignore_global
printf ".DS_Store\nTemplateIcon.icns\n*.swp\n*~.nib\nbuild/\n*.git/\n*.svn/\n*.pbxuser\n*.perspective\n*.perspectivev3\n*.mode1v3\n*.mode2v3\n" > .gitignore_global
printf ".hg*\n" >> .gitignore_global
git config --global core.excludesfile '~/.gitignore_global'
@1951FDG
1951FDG / new_gist_file.sh
Created October 18, 2013 10:30
Example using hg-fast-export
cd /Volumes/Untitled/Users/administrator/Developer
git clone git://repo.or.cz/fast-export.git
cd SixtyFour
git init
../fast-export/hg-fast-export.sh -r
git checkout -f
git status
git remote -v
git remote add origin [email protected]:1951FDG/sixtyfour.git
git push origin master
@1951FDG
1951FDG / new_gist_file.sh
Last active December 10, 2017 15:59
Use of nm
nm /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit | grep nsBeginNSPSupport
nm /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/LaunchServices | grep kLSItem | cut -c 21- | egrep -v "^kLSItemContentType$|^kLSItemDisplayKind$|^kLSItemDisplayName$|^kLSItemExtension$|^kLSItemExtensionIsHidden$|^kLSItemFileCreator$|^kLSItemFileType$|^kLSItemIsInvisible$|^kLSItemQuarantineProperties$|^kLSItemRoleHandlerDisplayName$" | egrep -v "^kLSItemCanRunInClassicEnvironment$|^kLSItemCanRunInNativeEnvironment$|^kLSItemCanSetExtensionHidden$|^kLSItemIsExecutable$|^kLSItemIsScriptable$|^kLSItemOriginalContentType$|^kLSItemPrefersClassicEnvironment$|^kLSItemPrefersNativeEnvironment$|^kLSItemProvidesPasteboardServices$|^kLSItemRoleHandlerFSRef$" | sed 's/.*/extern const CFStringRef &;/'
nm /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/LaunchServices | grep kLSItem | cut -c 21- | egrep -v "^kLSItemCanRunInClassicEnviron
@1951FDG
1951FDG / new_gist_file.sh
Created October 18, 2013 10:42
Bandwidth monitoring with vnstat on Linux
sudo nano /etc/init.d/vnstat
sudo vnstat -u
sudo vnstatd -d -s
vnstat -i ppp0 -l
vnstat --help
cd '/etc/init.d'
sudo nano
sudo chmod +x '/etc/init.d/vnstati'
sudo ln -s '/etc/init.d/vnstati' '/etc/rc0.d/K10vnstati'
@1951FDG
1951FDG / new_gist_file.sh
Created October 18, 2013 16:56
Usage of plutil
plutil -convert xml1 path/to/preferences.plist
plutil path/to/preferences.plist
@1951FDG
1951FDG / new_gist_file.sh
Created October 18, 2013 17:00
SHC install
shc -v -r -f
install -c -s shc /usr/local/bin/
install -c -m 644 shc.1 /usr/local/man/man1/
@1951FDG
1951FDG / new_gist_file.sh
Created October 18, 2013 17:07
Run Script Examples
ln -sf "/Applications" "$BUILT_PRODUCTS_DIR"
cd "$BUILT_PRODUCTS_DIR"; tar cjf "$PRODUCT_NAME.app.tar.bz2" "$PRODUCT_NAME.app"
@1951FDG
1951FDG / new_gist_file.sh
Created October 18, 2013 17:35
QL plugin management
qlmanage -r
defaults write -g QLEnableLogging YES
defaults delete -g QLEnableLogging
@1951FDG
1951FDG / new_gist_file.sh
Created October 18, 2013 17:47
Unistall Pianoteq PLAY
rm -rf /Applications/Pianoteq\ PLAY
rm -rf /Library/Audio/Plug-Ins/VST/Pianoteq\ PLAY.vst
rm -rf /Library/Application\ Support/Digidesign/Plug-Ins/Pianoteq\ PLAY.dpm
rm -rf /Library/Audio/Plug-Ins/Components/Pianoteq\ PLAY.component
rm -rf /Library/Receipts/Install\ Pianoteq\ PLAY*
@1951FDG
1951FDG / new_gist_file.sh
Created October 18, 2013 17:50
Remove VMware Fusion (after uninstall)
rm -rf ~/Library/Logs/VMware\ Fusion
rm -rf ~/Library/Preferences/VMware\ Fusion
rm -rf ~/Library/Preferences/com.vmware.fusion.plist
rm -rf ~/Library/Preferences/com.vmware.fusionDaemon.plist
rm -rf /Library/Contextual\ Menu\ Items/FusionVMDKPlugin.plugin
sudo rm -rf /Library/Application\ Support/VMware\ Fusion
rm: /Library/Application Support/VMware Fusion/license-fusion-30-e1-200902: Permission denied