disable spotlight in mountain lion

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

convert an ISO file to DMG format in terminal

hdiutil convert /path/imagefile.iso -format UDRW -o /path/convertedimage.dmg

convert a DMG file to ISO in terminal

hdiutil convert /path/imagefile.dmg -format UDTO -o /path/convertedimage.iso

formatting a drive as fat32 in mac os

diskutil partitionDisk /Volumes/leozera 1 MBRFormat "MS-DOS FAT32" "leozera" 100%

rmagick install on leopard

sudo port install tiff -macosx
sudo port install jpeg
sudo port install libpng
sudo port install libwmf
sudo port install lcms
sudo port install freetype
sudo port install ghostscript
sudo port install GraphicsMagick
sudo port install ImageMagick
sudo gem install rmagick

ffmpeg on mac os leopard

source: http://www.haykranen.nl/2007/11/21/howto-install-and-use-ffmpeg-on-mac-os-x-leopard/
sudo port install ffmpeg +gpl +lame +x264 +xvid

spotlight commands

disable spotlight
sudo mdutil -i off 

clean spotlight index
sudo mdutil -E 

enable spotlight
sudo mdutil -i on 

uninstall cooliris for safari

cooliris is a nice app, but has no utility. source: http://discussions.apple.com/thread.jspa?threadID=1730494&tstart=0
tell application "Safari" to quit
do shell script "rm -rf ~/Library/Preferences/com.cooliris.safariplugin.plist" with administrator privileges
do shell script "rm -rf ~/Library/Application\\ Support/Cooliris/" with administrator privileges and password
do shell script "rm -rf /Library/Receipts/cooliriswebkitplugin.pkg" with administrator privileges and password
do shell script "rm -rf /Library/Receipts/cooliris.pkg" with administrator privileges and password
do shell script "rm -rf /Library/Internet\\ Plug-Ins/CoolirisWebKitPlugin.plugin" with administrator privileges and password
do shell script "rm -rf /Library/InputManagers/Cooliris/" with administrator privileges and password
display dialog "Cooliris files are deleted." buttons {"Quit"} default button 1 cancel button "Quit"

disable spotlight on a fat32 external drive

cd /Volumes/your_drive
touch .metadata_never_index

remove the mac os x glowing blue outline for input fields

input:focus { outline: none; }

alias sample

the alias command makes it possible to launch any command using a pre-set string. i love it!
$ alias mypassword="echo '123456'"

$ mypassword # return '123456'

stop/start mysql via terminal

sudo launchctl unload -w /Library/LaunchDaemons/com.mysql.mysqld.plist
sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysqld.plis

lock/unlock icons in dock

defaults write com.apple.dock contents-immutable -bool true

color your os x shell

open your ~/.bash_profile, paste and be happy!
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad  

screenshot file format in mac os

defaults write com.apple.screencapture type jpg

get your mac's serial code

/usr/sbin/system_profiler SPHardwareDataType | /usr/bin/awk '/Serial Number/ {print $3}'

disable shadow in screen window captures

defaults write com.apple.screencapture disable-shadow -bool true
killall SystemUIServer

Add recent application menu to your dock

source: http://brunomiranda.com/past/2008/6/14/add_recent_application_menu_to/
defaults write com.apple.dock persistent-others -array-add '{ "tile-data"  = { "list-type" = 1; }; "tile-type" = "recents-tile"; }'
killall Dock

safari single window mode

defaults write com.apple.Safari TargetedClicksCreateTabs -bool true

mac os reading twitter updates

require 'rss/1.0'
require 'rss/2.0'
require 'open-uri'

content = ''
open('http://twitter.com/statuses/user_timeline/peepcode.rss').each { |i| content << i }
RSS::Parser.parse(content).items.each { |i| system "say \"#{i.title}\"" }
Displaying Code 1 - 20 of 22 in total