Posts with the category Mac OS X 10.6 Snow Leopard
Find Out Why Your Mac OS X based Computer Doesn't Sleep
Running this command will show you if there is something preventing your computer to go to go to standby automatically:
pmset -g assertions
Resources
- http://blog.graceabundant.com/archives/2011/08/mac-osx-lion-not-sleeping/
- Mac OS X: Why your Mac might not sleep or stay in sleep mode: http://support.apple.com/kb/HT1776
Install Pandoc on Mac OS X
Installing Pandoc is easy when you have Homebrew installed:
brew install haskell-platform cabal update cabal install pandoc
Alternatively use the way described in its installation instructions.
Resources
...Colourful SVN Diff on Mac OS X
I do not particulary like SVN but sometimes I have to use it. The diff output on the Mac OS X command line usually is not colored which is annoying. The solution is to tell SVN it should use colordiff
instead. You can easily install colordiff using homebrew:
brew...
Downloading Picasa Web Albums
Picasa-Downloader – A simple Python script to get the normal size images
https://github.com/anoopjt/Picasa-Downloader
pip install BeautifulSoup cd ~/Downloads wget https://raw.github.com/anoopjt/Picasa-Downloader/master/picasa_downloader.py
Pycasa – capable of downloading full size images
http://code.google.com/p/pycasa-download/
This open source software includes a GUI. It relies on PyGTK and it is therefore difficult to get it to work with Mac OS...
IPython
IPython: Productive Interactive Computing
IPython provides a rich toolkit to help you make the most out of using Python interactively. Its main components are:
- Powerful interactive Python shells (terminal- and Qt-based).
- Support for interactive data visualization and use of GUI toolkits.
- Flexible, embeddable interpreters to load into your own projects.
- Tools for high level...
Use the Python Module MacFSEvents to Monitor Directories for Changes on Mac OS X
MacFSEvents is an up-to-date solution to monitor directories for changes on Mac OS X when using the scripting language Python. It is a binding to FSEvents, Mac OS X's filesystem monitoring framework.
Install MacFSEvents
pip install macfsevents
Quickstart
from fsevents import Observer, Stream <span...
Install matplotlib on Mac OS X
Installation of the pre-built binaries for OS X
Read Installing OSX binaries in the matplotlib Installation FAQ.
Installation via pip
This is a good way if you have an up-to-date Python installation on your computer and pip
installed. It takes, however, some time (~ 20 mins for me) to install as it...
Sniff Serial Connection
Windows
- My favorite: Advanced Serial Port Monitor v4.1.5 2011-03-28.
Works with Windows 7, somewhat limited in the free edition but good for me.
http://www.aggsoft.com/serial-port-monitor/serial-port-sniffer.htm - 232Analyzer has a free edition: http://www.232analyzer.com/232default.htm.
- Portmon
http://technet.microsoft.com/en-us/sysinternals/bb896644.aspx - Advanced Serial Port Monitor v3.00
http://www.kmint21.com/serial-port-monitor/
I don't know if this works with newer Windows versions. - SAL232 - RS-232...
Serial Port Terminal Applications
Mac OS X
- CoolTerm (Mac and Win): http://freeware.the-meiers.org/
- ZTerm: http://homepage.mac.com/dalverson/zterm/
- ZOC (costs money): http://www.emtec.com/zoc/features.html
- goSerial: http://www.furrysoft.de/?page=goserial
- SyncTERM: http://syncterm.bbsdev.net/
- Using the terminal app
screen
:
screen /dev/tty.usbserial 9600
- MacWise (costs money): http://www.macwise.com/
Windows
Putty works!
Linux
minicom
install minicom:
sudo apt-get install minicom
use minicom:
minicom -o -s
How it works:
-o
do not try to initialize a modem first-s
...
Adjust Spindown Time for HDDs on Mac OS X
If you want to adjust the spindown time of the hard disk drives of your Mac OS X based computer, you can simply run the following command (which will set the spindown from the default 10 minutes to 30 minutes for all HDDs on your system):
pmset -a spindown...
Use Middle Mouse Button in a Parallels 6 Virtual Machine running Linux on a MacBook Pro
Sometimes you have to use the middle mouse button, sometimes it's just convenient to do so. Either way, if you want to use it on a virtualised Linux machine on a Parallels 6 (or any other virtualisation software) you can't out-of-the box on a MacBook Pro as the touch pad...
Install and setup libusb 1.0 on Mac OS X
If you use Homebrew, installing libusb from the Formula is as simple as
brew install libusb
Usage in Xcode
Using libusb in an Xcode project is easy:
- Project Settings → Your Target → Build Phases → Link Binary with Libraries and add
libusb-1.0.dylib
. - Project Settings → The Project → Header Search...
SSHFS on Mac OS X 10.6.8 and 10.7.2 with Fuse4X
Fuse4X is a port of FUSE - The Filesystem in Userspace to Mac OS X and allows you to mount all different kinds of remote / local filesystems on you Mac computer. A very popular 'filesystem' is sshfs, which allows you to mount a directory of a remote...
PL-2303 Serial Adapter on Mac OS X
You can get the latest driver for PL2303 based USB to serial adapters from the Prolific download page: http://www.prolific.com.tw/US/supportindex.aspx?id=7 (Login as GUEST / GUEST).
More information about the use of a PL-2303 chip based USB-RS232 adapter can be found on http://www.planet-rcs.de/article/mac_serial_port/.
...Resize Images from Context Menu on Mac OS X
- Use the Freeware ThumbsUp (not from context menu but via drag and drop)
- or create your own services menu.
AppleScript
Language References
Applescript Language Guide PDF | HTML
Great Tools
The AppleScript Editor shipped with Mac OS X (or XCode...) PreFab UI Browser http://pfiddlesoft.com/uibrowser/ Script Debugger 4.5 http://www.latenightsw.com Smile http://www.satimage.fr/software/en/smile/index.html
Run a Terminal Command
http://developer.apple.com/library/mac/#technotes/tn2065/_index.html
set hostname to "www.apple.com" do shell script "ping -c1 " & hostname
Resources
- Wikipedia...
Python 2.7 on Mac OS X
Praveen Gollakota shed light on Installing Python 2.7, easy_install, pip, virtualenv and virtualenvwrapper on Mac OS X. He gives you all the information you need if you want to use an up-to-date Python on Mac OS X! Thx!
Alternative way of installing python using homebrew:
brew install python
Using Python to interact with the Google Spreadsheets API
update 2015-09-08: this is outdated, please refer to my new blog post instead.
Install the Google Data Library (you should consider installing it in an isolated virtualenv environment):
cd ~/Downloads curl -C - -O http://gdata-python-client.googlecode.com/files/gdata-2.0.14.tar.gz tar -xf gdata-2.0.14.tar.gz cd gdata-2.0.14 python setup.py install
Now you are ready to test the example...
Mount SSH filesystems on Mac OS X via SSHFS with or without a GUI / Programs for (S)FTP
Mount SSH filesystems
My personal favorite: Fuse4X
Use with this distribution of SSHFS: https://github.com/fuse4x/sshfs
See my dedicated blog post on SSHFS on Mac OS X 10.6.8 with Fuse4X!
Deprecated Option: MacFUSE sshfs using command line
http://code.google.com/p/macfuse/wiki/MACFUSE_FS_SSHFS
First install MacFUSE.
Then get the sshfs binaries:
cd ~/Downloads
svn co http://macfuse.googlecode.com/svn/trunk/filesystems/sshfs/binary sshfs-binaries
Now you...
IPv6 Privacy Extensions
The privacy extensions as defined in RFC4941 make your device change its IP every now and then.
Privacy addresses are not enabled by default. Their generation is activated via the sysctl
directive use_tempaddr
that can be set to one of the following values:
0
don't use privacy extensions.1
generate privacy addresses2
...
IPv6 6in4 Tunnel via Hurricane Electric (Tunnelbroker.net): Automatic IP Update on Mac OS X
Hurricane Electric provides free IPv6 tunnels via the 6in4 protocol on the website tunnelbroker.net. After signing up, one can create up to 5 tunnels. When settings up a standard tunnel, one has to provide one's endpoint IPv4 address which may change from time to time (moving around or 24-hour...
Install Python Library for WordPress XML-RPC integration
cd ~/Downloads git clone git://github.com/maxcutler/python-wordpress-xmlrpc.git cd python-wordpress-xmlrpc python setup.py install
Resources
...[fix] Wireshark error: There are no interfaces on which a capture can be done.
I got the following error message when trying to open a network interface for capture using Wireshark on Mac OS X (Wireshark 1.5.1 Intel 64 beta and 1.4.6 Intel 64 show this behaviour):
There are no interfaces on which a capture can be done.
To solve the problem open a Terminal and...
SSD Optimizations on Mac OS X
Firefox Cache
To disable the the Firefox cache on the disk (SSD) and move it to your RAM, follow these steps:
- Go to
about:config
and setbrowser.cache.disk.enable
tofalse
- as well as
browser.cache.memory.enable
totrue
.
You can check what the cache is doing by going to about:cache
Set the noatime
option on the root filesystem
<div...
Bind Multiple IPs To One Physical Interface on Mac OS X
Via the System Preferences: Network pane
- Go to System Preferences → Network.
- Click on Ethernet (or AirPort)
- Click on the Configuration Wheel → Duplicate Service...
You can now configure each instance with different settings, and you're done.
On the Terminal
If you just need to quickly assign an IP/subnet alias to an interface, you can do...
How to run a .sh script (or perl or python script) on Mac OS X by (double) clicking on the file
- Rename the shellscript from
.sh
to.command
, then associate it with Terminal.app - Use Platypus to create a .app from the shellscript
This is a great tool to turn scripts (shell, perl, python) into an OS X application. Many features supported!
resources
...Fix sshfs with MacFUSE on Mac OS X 10.6.7 and 10.6.8 Snow Leopard
update:...
Homebrew instead of MacPorts
I chose it because it seems to be more actively developed.
As explained on https://github.com/mxcl/homebrew/wiki/installation I installed Homebrew like this:
/usr/bin/ruby -e "$(/usr/bin/curl -fksSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
I had XCode already installed, but If you don't, you have to install it before following the next steps (in order to have...
Set up Vim for Python
resources
- Great overview (German): http://wiki.python.de/Python-Programmieren%20mit%20Vim
- Python setting tips: http://dancingpenguinsoflight.com/2009/02/python-and-vim-make-your-own-ide/
- latest (and elaborate) response on http://stackoverflow.com/questions/144201/has-anyone-found-a-good-set-of-python-plugins-for-vim-specifically-module-comp/3113907#3113907
Solve jittery Magic Mouse (MBP early 2011, WiFi interference)
I experienced a problem with my Apple Magic Mouse when I wanted to use it with my new MacBook Pro (early 2011, Core i5): The movements became "blurry", jittery. I have an external display connected via Mini Displayport but this does not seem to affect the problem. But when I...
Set the hostname on an Apple Computer with Mac OS X 10.6
The hostname can be changed with scutil
on Mac OS X. scutil
provides a command line interface to the “dynamic store” data maintained by configd. [from the scutil manual].
To set a new hostname run:
sudo scutil --set HostName newhostname[.domain]
Backup Google Contacts
Possible Choices
-
Funambol
https://www.forge.funambol.org/download/#start
(and http://en.wikipedia.org/wiki/SyncML) -
Synthesis SyncML-Client http://synthesis.ch/prod_client.php
-
Conduit, an open source Gnome program:
http://live.gnome.org/Conduit
Works well! I use it on Ubuntu Linux 10.10 maverick. -
Backup Goo, Works on Mac, Win, Linux; 14 days trial version, 10 EUR afterwards:
http://backupgoo.com -
Cloud based solution (using Amazon S3):
https://www.backupify.com
Whois for IP on the Command Line and Online
If you want to know who is behind an IP address (or a domain name) you should use the command line tool whois
, which Mac OS X, most Linux and BSD distributions ship. For example, if you want to get information on the IP 10.8.0.1:
whois 10.8.0.1
And the output...
Firewalls on Mac OS X - alternatives to Little Snitch
Little Snitch is the classic user interface for the Mac OS X firewall. But it has a drawback: it costs ~30 EUR for a single licence.
The three notable alternatives are:
- Hands Off! http://www.metakine.com/products/handsoff/ Costs 38.75 EUR
There are also some open source tools:
-
IceFloor
http://www.hanynet.com/icefloor/index.html
An interface to the new...
Prevent RSI – Enforce Breaks When Working With Your Mac
- AntiRSI. Donationware.
- MacBreakZ. Full version costs 24.95 EUR.
- Time Out Free. It can be found on the Mac App Store. Version 2 Pro (soon to be released) will not be for free.
resources
http://www.quora.com/What-is-the-best-RSI-break-software-for-Mac-OS-X
...Chinese OCR
OCR for Windows
- PenPower Chinese OCR (Chinese product website: http://www.pen-power.com/chinese/chineseocr.html)
OCR for Mac OS
- Readiris Pro Asian (English product website: http://www.irislink.com/c2-1685-189/Readiris-12-for-Mac.aspx)
- IRISPen Express Asian (English product website: http://www.irislink.com/c2-1099-189/IRISPen-Express-Asian---Pen-scanner-for-Asian-text-recognition-.aspx)
- Tesseract 3.0 (free, open source) (install via Homebrew formula tesseract.rb and install the Chinese training data file
chi_tra.traineddata.gz
orchi_sim.traineddata.gz
...
Clear inactive memory on Mac OS X
The purge
command clears the inactive memory on Mac OS X. Simply run the command with no parameters:
purge
resources
...Fix a problem with NX on Ubuntu 10.10 with the key d (inadvertently minimizing the current window)
Go to System → Preferences → Keyboard Shortcuts and set the shortcut for Hide all normal windows and set focus to desktop
to something sane like Alt + D
update 2011-07-13: This happened again when I used Ubuntu 11.04 inside a NX session on a Mac OS X host computer. :(
resources
<a...
Enable Syntax Highlighting etc. with the shipped version of vi (vim)
How to make vim more comfortable (the version shipped with Mac OS X 10.6):
cd /usr/share/vim
sudo vim vimrc
add set:
set ai " auto indenting set history=100 ...
Custom DNS entries per domain (nice feature for VPN setups)
OS X has a good feature built in: the dns resolver. It allows you to specify different DNS servers for different domains. After creating the /etc/resolver
directory, you can create a /etc/resolver/erdelynet.com
file with nameserver 192.168.25.10
in it to redirect DNS requests for this domain to that specific nameserver.
resources
...Working With EXIF Data
Correcting EXIF Date of Images
using shootShifter
http://www.maczentrisch.de/shootShifter/
This is my tool of choice! It does a great job!!!
using exiftool
http://www.sno.phy.queensu.ca/~phil/exiftool/#shift
If your timestamps are wrong by 5 years, 10 months, 2 days, 10 hours and 48 minutes, put all of the images in the same directory ("DIR") and run exiftool:
exiftool...
Get BT747 to work via Bluetooth with QStarz BT-Q1000P
Pair the device with Mac OS X and open BT747 then connect to the manually entered: /dev/tty.iBT-GPS-SPPSlave
resources
...Fix mapping of non-Apple keyboards
remapping the Command and Option key
If you use a non-Apple external USB keyboard you will notice that the Windows key represents the ⌘ Command Key and the Alt key represents the ⌥ Option key. To invert this key mapping, open the System Preferences → Keyboard → Modifier Keys → Unknown...
disassamble Mach-O (Mac OS) binaries
also check http://dl.dropbox.com/u/34351/NSConferenceNotes.txt (or google it, it's also gisted on github) for more ideas
- otool
- otx http://otx.osxninja.com/ (maybe also http://github.com/karstenBriksoft/Mach-O-Scope)
- on a linux machine: objdump
- gcc: compile C code with
-S
flag to output assembler
Show Folder Path In Finder Title
http://www.mactricksandtips.com/2008/02/top-50-terminal-commands.html
defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES
Auto refresh PDF as it is being changed
using Preview
http://www.macosxhints.com/article.php?story=2006010200141989
use the following AppleScript and save it as ReloadPreviewDocument.scpt
(* Reload Preview Document 1.0 By Trevor Harmon <trevor@vocaro.com> Based in part on the "Checking Accessibility Status" script by Apple. http://www.apple.com/applescript/uiscripting/01.html *) on UIscript_check() -- get the <span...
Shortcut to Access the Preview Application from Terminal using AppleScript
If you ever wanted to open PDF, JPEG, PNG files etc.
#!/bin/sh # A simple bash script that uses Applescript to # open multiple files in Preview. For example: # "preview hello.png world.gif *.jpg" if [ -z "$*" ]; then ...
Quick Look from Terminal
We as Mac users know that the space bar reveals "Quick Look" the fast preview for folders and files on Mac OS X. But how can you have a "quick look" at a file when using the terminal? The anser is the following command:
qlmanage -p the.file.in.question
resource
http://www.macosxhints.com/article.php?story=20100712090451517
...Bash Aliases ( bashrc , bash_profile and bash_login )
Edit your ~/.bashrc
:
#PATH=$PATH:$HOME/bin:/usr/local/bin alias firefox="open -a Firefox" alias l="ls -l" alias la="ls -la"
and reload the .bashrc file using . ~/.bashrc
or source ~/.bashrc
You might want to add the following line to your ~/.bash_profile
in order to get the ~/.bashrc
loaded at the start of an interactive bash session:
[[...
Terminal Shortcut for Firefox on Mac OS X
http://kb.mozillazine.org/Command_line_arguments
Create a terminal shortcut for Firefox:
sudo ln -s /Applications/Firefox.app/Contents/MacOS/firefox-bin /usr/local/bin/firefox
or simply use the open
tool with the application option -a Firefox
:
open -a Firefox http://google.de
Apache Webserver with PHP and MySQL
Mac OS X 10.6 ships with Apache as well as PHP5. This blog post describes how to activate it.
Apache
To run Apache: Enable Web Sharing in the System Preferences → Sharing.
Websites are stored in /Library/WebServer/Documents/
PHP
To activate PHP:
uncomment a line in /etc/apache2/httpd.conf
:
LoadModule php5_module ...
ssh Shortcuts using .ssh/config
To create an ssh shortcut, add the following text (adopted to your setup) to .ssh/config
:
# You can add multiple blocks like this to your .ssh/config Host rudolf Hostname rudolf-web.net Port 22 User rudolf Protocol 2 Compression yes ServerAliveInterval 15 ForwardX11 no #LocalForward 20001 8.8.8.8:80
To connect to that host via ssh you can now simply type the following...
Check contents and delete resource forks from the command line
Assume we have a file on Mac OS X on a HFS or HFS+ file system named XX
.
If you want to see the content of the resource fork for the file do:
cat XX/..namedfork/rsrc
If you want to delete its resource fork:
cat /dev/null >XX/..namedfork/rsrc
Show Hidden Files in Finder
If you want to see hidden system files (that have a dot at the beginning on UNIX systems) run:
defaults write com.apple.finder AppleShowAllFiles -bool true
use false to revert the change.
...Unmount a CD or Volume Via Command Line on Mac OS X 10.6
You can do this on the terminal via the full UNIX device descriptor:
hdiutil eject /dev/disk1s1
you might want to add -force
to the command to enforce the operation.
Context Menu
The context menu actions can be found in the folder ~/Library/Contextual Menu Items
Apple Remote / Advanced Configuration
Update 2011-12-20: As there is no update of iRedLite for OS X 10.7 Lion so far. You can still use it but the bindings for Preview.app are broken. A workaround is to set the buttons to actions such as Current App → Cursors Movement → Right to go one slide...
c't TriggerBackup
http://www.heise.de/ct/Software-Archiv-5462.html
Mac OS X TimeMachine is a great system to simplify backup and recovery on the desktop. But it failes if you have to backup your data after each change and not just every hour. So what you need sometimes is a triggered backup: have a look at c't TriggerBackup....
Check Open Ports on Mac OS X Using `lsof` (similar to `netstat` on Linux)
To list all ports where server software listens to on a computer running Mac OS X, run this in the terminal:
sudo lsof -i -P | grep -i "listen"
resources
...Convert FLAC files to ALAC
To convert the file input.flac (saved using the FLAC) to the file output.m4a (ALAC format) you can use this Terminal command:
ffmpeg -i "input.flac" -acodec alac "output.m4a" -map_meta_data input.flac:output.m4a
This needs the ffmpegX distribution for Mac OS X, which seems, however,...
Creation of ISO images, Burning of ISO images – Both on the Terminal using Mac OS X
Burning an ISO Image from Terminal
hdiutil burn image.iso
Creating an ISO Image from a Folder
hdiutil makehybrid -o ~/Desktop/[outfile] ~/Desktop/[source]
[source]
can be a folder or a disk image.
Creating an ISO Image from a CD
Determine the device that is you CD/DVD drive:
drutil status
Umount the disk:
diskutil...
Spotlight Search and Indexing
Terminal helpers (command line tools):
mdfind
: Search Spotlight metadata indices.mdimport
: Force Spotlight to import metadata for a specific directory.mdls
: List the metadata attributes of a specific file.mdutil
: A utility for managing Spotlight indices.
To erase and rebuild the index on the root partition /
do:
sudo...
Temporarily Disable Spotlight Indexing
Temporarily disable Spotlight indexing is especially useful when connecting a large external HDD for the first time to copy/move/access some files as the Sportlight scanning slows down the drive access a lot.
sudo mdutil -a -i off
to turn it back on:
sudo mdutil -a -i on
resources
...bumptunes.py - Use the Internal Accelerometer to Operate iTunes on MacBook
If you want to control iTunes by bumping on your MacBook then follow this advice:
Get amstracker and bumptunes.py and unpack them somewhere. Open a Terminal in that directory and run:
./amstracker -u 0.1 -s | python bumptunes.py
resources
...Change the Login Screen Wallpaper Image on Mac OS X
To change the login screen wallpaper on Mac OS X you can use the some commands on the terminal. They work on Leopard 10.5 and Snow Leopard 10.6:
cd /System/Library/CoreServices sudo mv DefaultDesktop.jpg DefaultDesktop_org.jpg sudo cp /path/of/image.jpg DefaultDesktop.jpg
Important OS X Software
Sites that list good mac software:
- http://www.opensourcemac.org/
- http://www.hongkiat.com/blog/100-free-useful-applications-for-mac-part-i/
Including paid applications:
Text Editors
My favorite text editor on Mac OS X is MacVim as I love both: vim and my Mac.
In order to use it more productively, copy the launcher mvim
from the MacVim bundle to an executable directory:
Mac OS X Resources
Apple List of keyboard shortcuts: http://support.apple.com/kb/HT1343
great tips'n'tricks
for Snow Leopard: Snow Leopard Tipps (It's the site of the author of the Growl based Version of TriggerBackup.)
important darwin commands
...Texas Instruments TI-89 Titanium Calculator
Original TI-89 packaging in French (see the full image here ):
Programming SDK for Windows
http://education.ti.com/educationportal/sites/DEUTSCHLAND/productDetail/de_sdk_89_92p.html
PedroM - An Alternative Operating System
There is a free OS: PedroM.
TiEmu
sudo aptitude install tiemu-skinedit tiemu
OS rom file download: TI-89 Titanium...
Look into a Mac OS X installer package
To open a Mac OS X installer package (.pkg) you can right click on the bundle and select Show Package Contents
. Inside you will find a packed file in the .zip or .gz format. When you unpack this file you get a pax file and you can unpack that too....
Symbolic Link to a Folder
For convenience I want a link shortcut
to my folder /home/philipp/something/deeply/stapled
in the root folder /
in order to have faster access to it (on the terminal):
sudo ln -s /home/philipp/something/deeply/stapled /shortcut
Now I can get to /home/philipp/something/deeply/stapled
using the short form /shortcut