Osx
Shortcuts
- Hold down "d" on boot to do a hardware test
- Hold down alt/option on boot to boot into safe mode
- Hold down apple + "s" on boot for single user mode
- Hold down apple + "v" on boot for verbose mode
- Command + Control + Power also brings one into single user mode
dynamic_paging
I noticed on my MacBook Air that after a few weeks I would run out of diskspace, without downloading anything, forcing me to reboot. Before I did, I checked /tmp and nothing looked large enough. Bryan F from [yh] pointed out "man dynamic_pager"
$ ls -la /private/var/vm/swapfile $ sysctl vm.swapusage
I noticed gigs worth of files! At your own risk:
$ sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist
and reboot. After reboot, sysctl vm.swapusage shows 0 and /private/var/vm/swapfile is empty. replace "unload" with "load" above to revert to default.
Make application default
When trying to open video files, I noticed that it defaults to Quicktime, and I wanted it to default to VLC. With no obvious way to delete quicktime, I wasn't sure what to do. While I tried to setup "Always open with" and pick VLC, that didn't seem to work. In the end, I discovered you need to right click on the file then
Get Info -> Open With (Choose VLC) and then click "Change all..."
Re-install
Do this at your own risk, and after backups. These steps worked on a MacBook Air with OSX Lion 10.8!
- Install Diskmaker 2
- Using the App Store, download the InstallESD.dmg
- Follow the steps in Diskmaker 2 and install the image on an 8G USB stick
- Reboot holding down the ALT key, choose the USB stick as the boot device
- Choose Disk Utility, and Erase the main partition/image
- Close Disk Utility and Install OSX
Format a disk on the command line
In Terminal (Applications -> Utilities) on the command line type:
diskutil list
will show you all of the disks. In my case, disk1 is the one I want to erase and format:
diskutil eraseDisk HFS+ UntitledUFS disk1
dd an .iso
Instead of using Disk utility, I find it easier to simply dd your iso to a USB stick. Find out what your USB stick device is.
diskutil list
then I added the USB stick and ran the same command. Under the IDENTIFIER column it will show you the name, in my case disk1. Make sure it's unmounted:
diskutil umount /dev/disk1
then
sudo dd if="mydiskimage.iso" of=/dev/disk1
and then patiently wait. When it's done, if the numbers match for input and output, you should be good to go!
Wifi spots in range from the command line
Add airport to your path:
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport
To see a list of the nearby wifi spots from a broadcast scan:
airport -s
Your current wireless status:
airport -I