====== Mac Basic Setup ====== ===== Applications ===== ==== Basic ==== * [[http://www.mozilla.com/firefox/|Firefox]]: web browser * [[http://www.barebones.com/products/TextWrangler/|TextWrangler]]: text editor * [[http://filezilla-project.org/|FileZilla]]: ''sftp'' client * [[http://download.openoffice.org/|OpenOffice]] * MS Office available from the IPMB IT office (AS site license) ==== Optional ==== * gcc: C compiler, install using the Xcode Tools (under ''Download Software/Developer Tools'' on the [[http://developer.apple.com/|Apple Developer Connection]]). * [[http://perltidy.sourceforge.net/|Perltidy]]: utility to tidy up perl codes * [[http://www.gnu.org/software/wget//|Wget]]: command-line utility to fetch files * [[http://www.gelanalyzer.com/|GelAnalyzer]]: electrophoresis gel image analyzer (Java-based) * [[http://www.jalview.org/|Jalview]]: multiple sequence alignment viewer (Java-based) * [[http://tree.bio.ed.ac.uk/software/figtree/}FigTree]]: phylogenetic tree viewer * [[http://www.r-project.org/|R]]: software environment for statistical computing and graphics * [[http://www.macports.org/|MacPorts]] * [[http://www.finkproject.org/|Fink]] * [[http://www.videolan.org/vlc/download-macosx.html|VLC]]: media player. ===== System Preferences ===== * Energy Saver: Computer sleep = **never**, Display sleep = **10 min**, shutdown when UPS battery level is **below 20%**, **enable** start up automatically after a power failure. * Print & Fax: add lab printer * Network: set up lab intranet using DHCP. If using a desktop with ethernet connect, turn off Wi-Fi * Bluetooth: **off** (unless wireless keyboard/mouse is used) * Sharing: set **Computer Name**, enable **File Sharing** and **Remote Login** * Accounts: disable **Automatic login**, display login window as **Name and password**, enable **Show input menu in login window** ===== Backup ===== * Assign one external hard drive for each mac workstation as the Time Machine backup drive. ===== Network ===== * Use Terminal, type ''networksetup -listallnetworkservices'' to see the list of network services * e.g., ''Ethernet'' and ''Wi-Fi'' * IPv6; often cause problems * to disable: ''sudo networksetup -setv6off Ethernet'' and/or ''sudo networksetup -setv6off Wi-Fi'' * to enable: ''sudo networksetup -setv6automatic Ethernet'' and/or ''sudo networksetup -setv6automatic Wi-Fi'' ===== xcode ===== # Mac OS X 10.9.4 xcode-select --install ===== Extended Attributes ===== Some files may have extended attributes, for example: chkuo@mesquite[~]$ ls -l -rwxr-xr-x@ 1 chkuo staff 3454 Jan 22 11:11 file1* -rwxr-xr-x 1 chkuo staff 2628 Nov 2 2006 file2* The ''@'' symbol after the permission info of ''file1'' indicates that there are extended attributes. To find out more details: chkuo@mesquite[~]$ ls -@l * -rwxr-xr-x@ 1 chkuo staff 3454 Jan 22 11:11 file1* com.apple.FinderInfo 32 com.apple.TextEncoding 15 -rwxr-xr-x 1 chkuo staff 2628 Nov 2 2006 file2* To get rid of these extended attributes: chkuo@mesquite[~]$ xattr -d com.apple.FinderInfo file1 chkuo@mesquite[~]$ xattr -d com.apple.TextEncoding file1 ===== Newline characters ===== Mac OS X and Unix uses different characters to denote newline break. This can cause problem when you need to manipulate files in Finder and Terminal. To convert between the two, use: #!/bin/sh # change linefeed from unix to mac for x do echo "$x" tr '\012' '\015' < "$x" > "tmp.$x" mv "tmp.$x" "$x" done Or: #!/bin/sh # change linefeed from mac to unix for x do echo "$x" tr '\015' '\012' < "$x" > "tmp.$x" mv "tmp.$x" "$x" done ===== Job scheduling ===== In addition to the use of ''crontab'' for reoccurring jobs, you can also use the ''at'' utility to schedule a job to run at a pre-determined time. By default, this utility is disabled due to power management issue (need to read hard drive every minute). This is more of a problem for laptops, but not so for servers (or desktops that are being used as servers). To turn it on, use the command: sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.atrun.plist To turn it off again, use: sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.atrun.plist To check if the ''at'' utility is disabled or not, check preference file to see if ''Disabled'' is specified: cat /System/Library/LaunchDaemons/com.apple.atrun.plist Label com.apple.atrun ProgramArguments /usr/libexec/atrun StartInterval 30 Disabled For more details, read [[http://www.macosxhints.com/article.php?story=20050921214411382]] ===== Maintenance ===== ==== Check Time Stamps ==== Check when the maintenance scripts were run: ls -al /var/log/*.out Output should look like this: chkuo@mesquite[~]$ ls -al /var/log/*.out -rw-r--r-- 1 root wheel 91407 Jun 18 10:39 /var/log/daily.out -rw-r--r-- 1 root wheel 84 Jun 18 10:58 /var/log/monthly.out -rw-r--r-- 1 root wheel 3625 Jun 18 10:57 /var/log/weekly.out ==== Manual Execution ==== In case the computer was shut down when the scripts were scheduled to run. sudo periodic daily sudo periodic weekly sudo periodic monthly Or, to run all three at once: sudo periodic daily weekly monthly ==== More Info ==== * [[http://www.thexlab.com/faqs/maintscripts.html|http://www.thexlab.com/faqs/maintscripts.html]] * [[http://managingosx.wordpress.com/2008/06/18/launchd-vs-periodic/|http://managingosx.wordpress.com/2008/06/18/launchd-vs-periodic/]] ===== Troubleshooting ===== * [[http://support.apple.com/kb/HT3964|Resetting the System Management Controller (SMC)]] * [[http://support.apple.com/kb/HT1379|Resetting the PRAM and NVRAM]]