December 2008
12 posts
1 tag
Set Dock switching mode to 'hide others' →
To enable this switching mode, open Terminal and type these commands:
$ defaults write com.apple.dock single-app -bool TRUE $ killall Dock
From now on, clicking on an application in the Dock will hide all other open apps while switching to the selected application. You will not see this behavior if you use Command-Tab to switch, or click directly on another application’s windows.
1 tag
The C Standard Library →
Short and sweet.
1 tag
re-using SSH connections →
The ssh ControlMaster setting “allows you to re-use an existing SSH connection whenever you connect to a host you are already connected to.”
In your ~/.ssh/config file, add:
Host *
ControlMaster auto
ControlPath /tmp/%r@%h:%p
Whenever you connect to server.example.com as user joeuser, SSH will create a named pipe at /tmp/joeuser@server.example.com:22. If you open another...
2 tags
sweet ass-regex
My tribute to xkcd #37 — this regular expression changes “sweet-ass x” to “sweet ass-x”.
s/(\bsweet)[- ](ass)\s(\w)/$1 $2-$3/i
1 tag
retry the previous command with sudo →
$ shutdown -c
shutdown: Need to be root
$ sudo !!
shutdown: Shutdown cancelled
3 tags
> cd to ... →
For OS X. Open a Terminal window from Finder.
2 tags
Breakdown of the 'scpr' alias
As a follow-up to ‘making rsync easy’, here’s a breakdown of what the options do.
-P — Shows the progress of the transfer, and keeps partially transferred files. Useful if you’re on an unstable connection, as you can just run the same command again if the transfer fails.
-h — Outputs numbers in a human-readable format.
-a — ‘Archive mode’.
-v — Verbose...
4 tags
Making rsync easy
rsync is an invaluable tool for copying or uploading files. From the manual:
It can copy locally, to/from another host over any remote shell, or to/from a remote rsync daemon. … It is famous for its delta-transfer algorithm, which reduces the amount of data sent over the network by sending only the differences between the source files and the existing files in the destination. Rsync is...
1 tag
Disable the OS X dashboard
$ defaults write com.apple.dashboard mcx-disabled -bool YES
$ killall Dock
2 tags
⌘C ⌘V
⌘ cmd
⌥ option/alt
⇧ shift
⌃ ctrl
⌫ delete
⎋ esc
↑ ↓ ← →
⇥ tab
⏎ ↩ return
⏏ eject
⇪ caps lock
2 tags
timestamped ZFS snapshots
function zshot() { [ -n "$1" ] \
&& zfs snapshot "$1@`date +%Y%m%d-%H%M`" \
|| zfs list -t snapshot; }
21:44 $ zshot mypool/mydata/stuff # make a snapshot
21:45 $ zshot # list snapshots
NAME USED AVAIL REFER MOUNTPOINT
mypool/mydata/stuff@20081228-2144 0 - 10.2G -
2 tags
bash aliases for ZFS
alias zlist='zfs list -t filesystem'
alias zim='zpool import' zex='zpool export -f'