Here are some tips for my macbook pro.
-
using
Command+Shift+.to toggle hidden files in file dialog, this shortcut will not work in Finder. -
use
hdiutil attach -nomount ram://$((2 * 1024 * SIZE_IN_MB))to create a ramdisk anddiskutil eraseVolume HFS+ RAMDisk NAME_OF_DISKto format and mount it. -
To use X11 forword in
OS Xserver, you need to do the following steps:#edit '/etc/sshd_config' as following X11Forwarding yes XauthLocation /where/is/your/xauth # default /opt/X11/bin/xauth X11DisplayOffset 10 X11UseLocalhost no # then reload the daemons cd /System/Library/LaunchDaemons launchctl unload ssh.plist launchctl load ssh.plist # test whether it works ssh -Y ssh.server xeye #a test X11 program show two eyes -
Itunes keep running itself when
Fn+F8pressed. To disable this, just openquicktime(which consume less cpu) and then close it or more easily, run commandlaunchctl unload -w /System/Library/LaunchAgents/com.apple.rcd.plist, which learned from this post. Another very neat way is to disable iTunes withsudo chmod -x /Applications/iTunes.app/. -
Add
mount_name -fstype=afp afp://username:password@server_address/share_nameto file/etc/auto_homeand thensudo automount -vcto enable the automount AFP filesystem at/home/mount_name. Addmount_name -fstype=smbfs ://user:passwd@samba.server/share.nameto enable SAMBA file system. -
use command
textutil -convert html file.webarchiveto extract all figures in a web archive generated by Safari. -
The
cpcommand have a GNU versiongcpprovided by MacPorts which support-loption. Using commandgcp -v -P -R -l -n src/ dst/can create a hard link(-l) for every destination not exist file(-n) while not following symlink(-P) in verbose(-v) mode, this can be very useful to merge files in multiple folder together, especially when you want to have all the newest historical files exist in your time machine backup. -
To run a program inside sandbox to restrict resource access permission (like forbiden network access):
/Applications/Beyond Compare.app/Contents/MacOS/$ cat BCompare #!/bin/bash CWD=$(dirname "$0") exec sandbox-exec -n no-network "${CWD}/BCompare.bin" "$@"
The following are some good softwares:
ncduCLI du to show the disk usage.iTerma very cool terminal liketerminator. An nice configure file.