I like to be able to lock my computer with a password, however, I don't like to have the screensaver require a password every time it is turned on. I have found the Lock Screen from the Keychain menu item to be buggy, and I don't like the extra clutter in my menu bar for just the one function.
Hunting around, I couldn't find anything that did quite what I wanted to, so I wrote this AppleScript to allow you to lock the screen. Then, when you come back from that locked session, it returns to normal screensaver functionality. Simply paste this code into Script Editor and save it as a Stay Open application.
Here's a quick and painless way to regain some drive space. When iTunes downloads a new firmware for your iPod or iPhone, the older ones do not get deleted. Since they are quite big (for the iPhone, at least -- about 250MB each for my 2G iPhone), you can easily free up more than 1GB of drive space by deleting the older ones (which you usually won't need anyway).
Just check the file names for the version numbers, and delete the older ones. If you're unsure, you can delete all of them, as iTunes will then re-download the newest one only when it's needed (i.e. a restore of an iPhone).
I'm fairly new to the OS X world, and noticed that I kept forgetting to empty my trash. That's because, with Windows, I got used to using Shift-Delete, which deletes immediately. I figured that it's better to hold on to those files a few more days before throwing them out, though, so I found my self in need of a script to do this.
I started to look around and found two scripts here on this site:
Although these are very useful scripts, I wanted a script that deleted on the basis of time (like the first one), but does not need to run (the first one needs a cron job) when it's not needed (it's fast, but still..). The limitation of not running unnecessarily rules out these two applications as well:
I recently found myself wanting to securely delete a non-encrypted copy of my home directory. No big deal, I thought: I moved the copy to the trash and chose Finder » Secure Empty Trash. After that, I left my MacBook running and returned after a while ... only to find 96,000 files still left. I watched the progress for a bit, and counted roughly one file per second. I did the math and found ... too long!
So I chose the following route: I deleted the file in the Finder, emptied the trash the usual way, and then erased empty disk space with Disk Utility. This did the trick in half an hour.
I chose the fastest method in Disk Utility, i. e. overwriting only once. But frankly, except for the most paranoid this should be safe enough. (Wright, Kleiman and Sundhar have thoroughly debunked the myth about having to overwrite files several times).
It might not even be that the Finder is really inefficient in what it does, but that its default is possibly overwriting seven or 35 times. So changing that default (hidden prefs, anyone?) could then actually make the Finder faster for that purpose than Disk Utility.
OS X has long supported disk quotas to limit how much drive space each user is allowed. Way back in 2003, we ran this hint which explained how to set up and use disk quotas. Back then, the process seemed a bit scary to me, given the complexity of some of the Terminal commands.
Fast-forward five years, though, and things have gotten much simpler. While reading some messages on a mailing list, I found a pointer to Eric Crist's write-up on HFS+ disk quotas, which makes things look much simpler. While working through the instructions, though, I had an issue early on -- the repquota command listed in the third step failed to run. I managed to get it working by taking one command from our prior hint; below is an executive summary version of Eric's instructions, with my fix to get repquota working:
Create a root shell session in Terminal with sudo -s, providing your admin password when asked.
Create an empty quota options file with touch /.quota.ops.user.
Run quotacheck -a to generate a list of drive space used by user. This is the step I had to add.
Run repquota -a to list the drive space used by each user. The previous command creates the list, and this command displays it. I don't know why this command alone didn't work on my system, but it didn't.
Enable quotas by typing quotaon /. (You can turn them off again with quotaoff /.)
Set quota limits for a given use by typing edquota -u username. This will put you in a vi editing session, where you can set both hard (cannot be exceeded) and soft (can be exceeded for a certain period of time) limits on drive space and inodes (files).
Eric's writeup goes into greater detail, including an explanation on how to change the default one week grace period on soft limits.
I've created a simple three-line startup item that silences the Mac OS X boot chime, colloquially known as the "bong" sound, on Intel-based Macs. PowerPC-based Macs use another method for changing the startup chime's volume, so this tip won't work for them.
So why not just run sudo nvram SystemAudioVolume=" " and be done with it? Because of my normal volume settings, my MacBook keeps resetting the chime volume automagically. Until a simpler solution is found (and honestly, three lines is pretty simple), this should work fine. TinkerTool System can silence the startup chime, but it is shareware. StartupSound.Prefpane can do this, too, but DebongIntel is a simpler solution if all you want is to silence the chime. You can also modify the script to set the volume to a non-silent level.
The solution involves making a directory, then two files, then modifying the permissions slightly.
When you use optical audio on your Mac, OS X locks the volume level to the highest setting, forcing you to adjust the volume level with your receiver. This "feature" is both annoying and unneeded. To get around this lock, you can simply install a free utility called Soundflower, which includes Soundflowerbed available in the link below.
After installing Soundflower, launch Soundflowerbed. This application runs as a menu extra, allowing you to quickly change your audio settings. Simply make Soundflower (2ch) your default output, and within Soundflowerbed, set the 2ch to output to your built-in output. Now you can change your volume with your keyboard or Apple Remote, instead of using your receiver's remote.
Note: you have to adjust the volume and select Built-in Output on Soundflowerbed before you will get output; this is probably a simple bug with the audio settings, and it takes a small change to take effect. Also, Soundflower needs a reboot before it will work.
Here's an interesting Dock modification, though to be honest, I'm not sure exactly when it might prove useful. In Terminal, enter these two commands:
$ defaults write com.apple.dock static-only -bool TRUE
$ killall Dock
As soon as you kill the Dock, when it respawns you'll notice that only your running applications are listed -- in other words, any program you've added to the Dock won't be shown unless it's running. You can obviously accomplish the same end result by simply dragging all your static applications out of the Dock while nothing other than the Finder is running; so that's why I'm not sure how useful this command really is.
The only potential use I can see for it is if you've got a really crowded Dock, and you wanted to temporarily simplify it, you can use this command -- because when you reverse the preferences setting by repeating the above command with FALSE at the end, all your static icons will come back, so you don't have to manually re-add them. I should add that's how it worked for me, but proceed at your own risk -- if you try it, there's a chance you may end up adding back your static items by hand.
So are there other uses for this Dock alteration that I'm just not seeing?
I recently had a problem where the keys on my MacBook Pro keyboard did not work. The modifier keys and arrow keys worked, but the letters did not. Using an external keyboard worked fine.
It turned out that the problem arose from accidentally enabling mouse keys. It seems I had somehow pressed the Option key five times in a row. To fix, press the Option key five times in a row again, or go to the Universal Access System Preferences panel and disable Mouse Keys. You might also want to disable the check box to enable Mouse Keys by pressing Option five times.
I hate switching off the power on a hung system. As a last resort before doing that, when logging out or even Force Quit won't work, I've had some success with this method. Invoke Spotlight with Command-Space. Even if you don't see the search box appear, keep following these steps. Type Terminal and hit Return. With a bit of luck, you'll see a Terminal window open.
Log into Terminal as an administrator, for example: ssh firstname.lastname@example.org (replace admin with the short name of an administrator account, and mycomputername.local with your computer's Bonjour name (see the Sharing preference pane).
Enter the admin password when prompted. If you get a message that the system can't verify the identity of the computer and asking you if you want to proceed, type yes. Once logged in, you can try any Terminal command and see if it works. Usually, I just type sudo reboot and enter the admin password when prompted.
It's worth a try when it seems that nothing but a cold, hard, power-off restart will work.