Category Archives: Snow Leopard
I’ve been a long time user of TechSmith’s Camtasia screen capture software, primarily for two reasons: ease of use combined with a rich set of editing features. Camtasia for Mac 2 strengthens this product in a number of significant ways although there are still some usability issues that need addressing, as well as room for further improvements in the feature set. In this review, I’ll walk you through what Camtasia has to offer as well as indicate the kind of uses where it excels as an aid to the technical communicator. Read the review…
If you see a screen with a progress bar (something like the shot above), your Mac is starting up in Safe Mode. This shouldn’t happen unless the user intentionally wants to do so for troubleshooting purposes. However, if you find that your Mac is defaulting to Safe Mode when you try to start up normally, try the following tips.
1. Stuck Shift key
Check that the Shift key is not accidentally being pressed down or stuck. If you suspect the keyboard may be faulty, plug in a different keyboard.
2. Use Terminal to reset boot-args
Allow the machine to finish booting into Safe Mode, then open Terminal (Applications/Utilities/Terminal.app) and copy this command into the Terminal window:
sudo nvram boot-args=""
press ‘return’ on your keyboard. Enter an Admin password (type carefully as it will not be echoed to the screen) and restart the Mac.
3. Do a PRAM reset.
In this case, a PRAM reset effectively does the same as No.2 above. However, if No.2 didn’t work, it’s worth trying this way of doing it in case for some reason the boot memory failed to hold the preference setting. You can also do this step instead of Step 2 if you are not comfortable with using the Terminal.
The PRAM reset is done like this:
1. Power down the machine.
2. Locate the following keys on your keyboard in preparation for Step 4:
3. Press the ‘power on’ button.
4. Immediately – and before the grey screen appears – hold down ‘command-option-P-R’ all together.
5. Keep them held down until you’ve heard the start-up chime twice. After you release them you should hear it again, and hopefully your Mac will boot up as it should normally.
If you need to flush the DNS cache in Mac OS X, be aware that the commands for this have changed through successive OSs, including Lion.
Flushing the cache is sometimes a good idea if you are unable to reach a site that you know is live but keeps returning an error (you can check whether a site is live for others by typing its address here: Down for everyone or just me?).
You can download my free app FastTasks that will do this (and a whole lot more! ) for you without you needing to mess around on the command line. However, if you want to do it manually, then open Terminal (Applications > Utilities > Terminal.app) and use the appropriate command for your operating system:
In Leopard / Snow Leopard
In Lion and Mountain Lion
sudo killall -HUP mDNSResponder
With Lion, you’ll have to follow the command with your Admin password, which will be invisible when you type it.
FastTasks – a utility for common terminal tasks
In the last post, we learned how to see all the contents of a folder – invisible and visible files – in the Terminal. However, most of us prefer working in the GUI, so this post is going to show you how to work a bit of Terminal magic to easily turn on and off your invisible files and folders in Finder and the desktop.
Open Terminal, and type or copy/paste the following to the command prompt:
defaults write com.apple.finder AppleShowAllFiles TRUE; killall Finder
(note that all commands in these posts should always be assumed to be case-sensitive).
Now switch out of Terminal and have a look at Finder or your desktop. You should see some ‘hidden’ files now in a sort of greyed-out 50% opacity (files like .DS_Store). If you can’t see such files, go back and check that you typed or copied the entire command correctly.
Assuming you can now see your invisible files in Finder, switch back to Terminal. Press the up arrow key on your keyboard. Notice that the last command you typed reappears.
That’s a handy trick to remember. You can move between your previous commands with the up arrow and down arrow keys to save time re-typing or modifying commands.
In this case, we want to use the last command again, but we also want to modify it. Use the left arrow key to move the cursor back to “True” and then use delete to remove “True”. Leave the cursor where the letter ‘T” was and type FALSE. Make sure the semi-colon ; is still there.
Press Return — you don’t need to move the cursor to the end of the line as you would with a word processor. You can hit Return no matter where the cursor is in the command line and it will execute (or try to) whatever is typed on the whole of the command line.
Now, if you switch back to Finder or the desktop, you should see that all your hidden files have disappeared again.
OK, now that we have tested these commands to check that they work, let’s do something a bit more useful with them.
Switch back to Terminal. Type
and press Return.
Wow! Did you see what just happened? You substituted the word “FALSE” from the last command with the word “TRUE” and executed the entire command. In other words, you just made your hidden files visible again! Go and look at the desktop and you’ll see that your invisible files just returned. Try it again. Switch back to Finder and type
to replace the word “TRUE” in the last command with the word “FALSE”. Hit Return to execute it.
Using the pattern ^error^correction is a great way to both correct commands you type incorrectly and to run two commands one after the other that have only one term or option different.
Back in Terminal, hit the up arrow to bring the last command back onto the command line. This time, I want you to hit control-A on your keyboard. Notice that this brings the cursor to the start of the command line, which is what we want as we’re going to type in a new command before the “defaults…” part.
With the cursor at the beginning of the line, type
and a space. Then type a double quotation mark right next to the ‘d’ of ‘defaults, so the beginning part looks like this
(the ellipsis or ‘…’ is used here just to show that the command continues and should not be in your actual command line)
On the keyboard, press control-E.
This takes the cursor to the end of the command line (remember: control-A to go to the start, control-E to go to the end).
Type another double-quotation mark right after the word ‘Finder’ so the ending looks like this
… ; killall Finder”
Now hit the spacebar once, and type a double right angle-bracket
Hit the spacebar again and type
The entire command should look like this:
echo “defaults write com.apple.finder AppleShowAllFiles FALSE; killall Finder” >> .bash_profile
Now press Return. Type
and press Return one more time.
What did we just do?
To see what you did, type
As you can see, after testing those two commands on the command line, we’ve now sent them to the .bash_profile file, saving us the job of typing them out again (and possibly making an error when we do so). However, we can’t leave the commands like that – if we do, then they will run every time we log into the Terminal. Rather, we want to use these commands to define functions, just like we did last time with ‘show’ and ‘up’.
To do that, press control-L on the keyboard, then use the down arrow key to bring the cursor to the beginning of the first line with a ‘defaults’ command on it.
Press Return. Press the up arrow once, then type
Press Return and in the new line created type
Use the down arrow key to move the cursor down to the line below the “Defaults…FALSE” line and press Return.
In the new line created type
Then press Return. Type
Press Return and type
Use the down arrow key to move the cursor below the “Defaults…TRUE” command. (If you can’t go below the last typed line, then on the keyboard press control-E to move the cursor to the end of the line, the press Return).
Check that the whole thing looks like this:
to logout. Then press command-W and command-N to close and reopen Terminal.
What did we do this time?
We just made some new, easy-to-remember commands to show and hide our hidden files in Finder and the desktop. On the way, we learned how to append commands to files using the >> function, as well as how to move the cursor to the beginning and end of a line using ‘control-A’ and ‘control-E’ respectively. We also learned how to recall previous commands on the command line using the arrow keys and how to correct or modify previous commands using the ^error^correction pattern.
Wow, you’ve come a long way in two short tutorials!
To test out what you just did, type
then press Return.
Switch to Finder and there’s all your hidden files! To make them invisible again, switch back to Terminal and type
From now on, whenever you want to see your hidden files, just use the show_all command in Terminal. Hide them again with hide_all.
control-A – places the cursor at the beginning of the command line (also works in emacs editor)
control-E – places the cursor at the end of the command line (also works in emacs editor)
control-L – on the command line, this clears the screen (equivalent to the ‘clear’ command); in emacs, this places the caret inside the editor allowing you to edit (=insert point)
up & down keyboard arrows – moves through history of commands
^error^correction – replaces the term after the first ^ with the term given after the second ^ in the previous command, then executes the entire command
echo – sends the following string or command to the specified file (if no file is specified, the string will output back to your terminal screen. In other words, if you type echo hello, the Terminal will print “Hello” on the next line; hence the term ‘echo’! )
This is the first in a series of planned tutorials for anyone who wants to find out what Terminal can do and how they can use it to increase the usability of their computer. Unlike other Terminal tutorials, I’m going to assume that you’re not interested in giving up the desktop for the command line to do things like move and copy files that you can do more easily in Finder. Rather, I’m only going to focus on those things that it’s generally more difficult (or impossible!) to do in the GUI than it is in Terminal.
Let’s get started. Open Spotlight (try the hotkey command + spacebar or click the spy glass in the top right corner) , then type term and press Return.
When Terminal opens, the first thing you may want to do is make the text a bit easier to see in the Terminal window.
Hold down command-shift-+ to increase the size. Try it a couple of times till the text is a comfortable size. If you overshoot, just use command- - (minus key) to reduce text size.
Now you’re sitting comfortably in your Terminal window, let’s learn our first spell. Actually, we’re not going to learn one so much as make our own!
In order to do that, we want to open a hidden file and edit it. In Terminal, type
(There’s a space after ‘emacs’, and, don’t forget that . dot right before the ‘b’)
What you see after this screen may vary depending on whether .bash_profile has any pre-existing content or not. If there is anything in the file already, ignore it and use the arrow key to move the cursor to a clean line at the bottom. If the file is empty, then just start typing. The first line we want to type is
Now press Return and enter a single, left curly bracket
Press Return again and type (or copy and paste) this:
There’s a space between the ‘s’ and the dash, and all the letters are lowercase except the ‘F’, which must be uppercase.
Press Return and provide the closing curly bracket
It should look like the area inside the orange rectangle:
Now hold down the control key on your keyboard while you first press x and then c. Notice at the bottom of the screen you get a ‘save’ warning.
Press the y key on your keyboard, and you should find yourself returned back to the Terminal prompt.
Type exit at the prompt to logout of the Terminal, and then on the keyboard press Command-W to close the window, and Command-N to open a new Terminal session.
What did we just do?
We defined and saved a new Terminal command called show which we can now use whenever we enter Terminal to easily see all the files and folders – including all the hidden ones – in any given directory. To see what we just did, type show at the command line. You should get an output that is formatted something like this:
As you can see I’ve annotated the screenshot to show some of the features that the show command gives us. First of all, notice the file and folder names that begin with a . dot. These are your hidden files and folders (Remember: they are usually hidden for a reason, so don’t go messing with them unless you know what you’re doing!). The show command also helps us distinguish between files and folders by appending a / slash to the end of folder names. Although not shown here, you may also see some names with an * at the end. That means it’s an executable file — in other words, its purpose is to run some programme or command.
The show command is very useful for seeing exactly what is in a folder, but of course we need to know how to move between folders in order to see anything other than our own home directory.
Suppose I want to have a look in that folder called ‘Shared’. Then what I do is I type
then press the tab key on the keyboard. The rest of the name is filled in for me by Terminal:
The tab key is a very useful trick for moving around in Terminal when you are faced with long names. Generally, you only have to type in enough to make the file or folder name unique and hitting tab will complete the rest of the name for you. However, if I only type
and then press tab, nothing happens. Terminal can’t complete the name because there’s more than one choice. However, if I press tab again, Terminal will give me a list of the all names that begin with S:
pressing tab twice gives:
Now I can see all the options, and how much I have to type to make a unique choice. In this case, I only have to type either ‘cd Sh’ or ‘cd Sn’ to allow Terminal to know which one I want when I press the tab key. Pressing Return after the tab completion will take me to the folder.
Try it with a folder from your own list.
After changing to a new folder, perhaps your screen is getting a bit messy. Let’s clean it up before doing show again. On the keyboard, press control-L to get a clear screen (notice that all your previous commands and outputs are still available if you scroll up!).
Now type show again to see your files and folders, pick a folder (if there is one), and type cd plus the first few letters of the name. Fill it out with the tab key and then press Return.
Again, type show to find out what’s inside. You can keep going deeper into the directory tree by using cd and show on any folders you find.
The last thing we need to know for today is how to go back up the tree, or to move back to the parent folder. Again we’re going to use the ‘cd’ command, but this time you don’t need to type any names. Just a space and then two dots
(don’t forget there’s a space between the ‘d’ and the two dots). This will always take you to the parent folder of the folder you’re currently in, all the way up to your hard disk’s parent directory. If you want, you can make a new up command (just like we made show) as a shortcut for ‘cd ..’. Have a look at the smallest of the screenshots above and see if you can do it.
So now you know how to move around and see all the hidden and un-hidden contents of your drive, go and explore and get yourself used to these first basic commands.
When you’ve finished with your Terminal session, type exit and press Return. You can then close the window and go back to GUI land!
. at the beginning of a name means ‘hidden’
/ at the end of a name means ‘Folder’
* at the end of a name means ‘executable file’
cd – move in to that folder
cd .. – move back to the parent folder
emacs – opens the Terminal textfile editor
show – shows a complete list of a directory, including hidden files
control-L – clears the Terminal screen
tab – will try to complete file or folder names
tab (twice) – will offer choices
learning the Terminal – Part Two
If you have reverted your mac to Snow Leopard from Lion, its important that you also remove the Recovery HD, as it can compromise the security of your Snow Leopard installation (for security issues with Lion, see here). Reverting to SL via Time Machine or restoring from a clone will leave the Recovery partition in place, meaning anyone can boot into it and reset your Snow Leopard passwords merely by restarting your mac while holding down the ‘option’ key.
To remove the Recovery disk follow this procedure:
1. Revert back to Snow Leopard using Time Machine or a clone.
2. Once you’re up and running and have confirmed everything is good, go to Terminal (Applications > Utilities > Terminal) and paste/type this command to confirm the presence of the Recovery HD:
then press ‘Return’. If you see a partition labelled something like this
Apple_Boot Recovery HD (see image above)
then you will need to continue with the rest of the procedure. If the Recovery HD is not listed here, you do not have the Recovery partition and need not worry further.
3. If you find the Recovery HD in the list, paste the following command into Terminal:
defaults write com.apple.DiskUtility DUDebugMenuEnabled 1
Now open Disk Utility (Applications > Utilities > Disk Utility). In the menubar at the top, choose Debug > ‘Show every partition’
On the left in the main Disk Utility window, you’ll be able to see ‘Recovery HD’ (it’ll be greyed out). You can click ‘Mount’ in the taskbar to make it active, and you can now delete it using control-click/right click – erase or by using the ‘erase’ tab in DU’s window.
If you want to confirm that the Recovery disk is no longer present, go back to Terminal and type the command from step 2.
how to secure your mac (OS X Lion)
I’ve previously covered one issue here about overheating macs, but kernel_task is not the only process that can get out of hand. For example, there’s a known issue with some releases of Parallels that can cause a process called prl_disp_service to run up to 99% too, leaving your mac sweating on the desktop even on a cold Winter’s eve!
In general, ‘hot’ issues can be found by looking at what’s going on in your Activity monitor, and solved by quitting (or force quitting) the process. Also, don’t wait to discover these by how hot your mac feels to the touch. Download and install a free copy of smcFanControl and have it running in the menubar. Now you’ll have a reliable means of seeing exactly how hot your mac is.
However, some processes may not re-start correctly after being quit in Activity monitor unless you reboot the machine or work a bit of Terminal magic. In the case of Parallels, for example, if you’ve identified prl-disp_service as the culprit, the correct solution is to first stop your VM and quit Parallels. Then, open Terminal.app and follow this procedure:
1. Paste this command into Terminal
sudo launchctl stop com.parallels.desktop.launchdaemon
Press ‘Return’. You will be prompted for your password. Note that when you type it in, your typing will be invisible. Press ‘Return’ again.
2. Now paste this command:
sudo launchctl start com.parallels.desktop.launchdaemon
and press ‘Return’.
3. You need to check that the process has correctly restarted before trying to start up Parallels, so one last command:
sudo launchctl list | grep com.parallels.desktop.launchdaemon
The output should look something like this:
36468 - com.parallels.desktop.launchdaemon
The number on the left will be different, but so long as it is anything except 0, you are good to go!
4. Finally, in Terminal, hold down the ‘control‘ key and press the ‘c‘ key at the same time. Now you can quit Terminal and get back to a cool Mac and your Parallels VM.
You can use these same ‘stop’, ‘start’, and ‘grep’ commands for other errant processes, but you need to find the correct name of the process. You can do this by first noting its name in Activity monitor, then in Terminal, paste:
sudo launchctl list
Look for a launchdaemon that corresponds with the name you found in Activity monitor. Then use the commands above but replace ‘com.parallels.destkop.launchdaemon’ with the name of the process you want to kill.**
**Warning: The sudo command gives you root privileges to the computer and can cause irreparable harm to your OS if used incorrectly. Never mess around with the sudo command unless you have a recent bootable clone of your system.
We all like to take happy snaps at Christmas , but there’s no need to buy expensive software to snap the wonders you or your family produce on your Mac computer screen. Mac OS X has a number of built-in ways to take screenshots. The simplest is to use the universal hotkey combination:
This will immediately take a snapshot of your entire screen and dump it on your desktop as .png file. Try it now and have a look!
If you want to select only a specific region, try this
Move your cursor, and you’ll see it’s turned into a cross-hairs by which you can select any part of the screen you want. You can also press the spacebar after you invoke this command, and the cursor will turn into a camera icon. This lets you accurately select individual windows for the shot, instead of drawing round them.
If you are taking the screenshot to immediately paste it into a post, email or document and you don’t particularly want to keep a saved copy of it, then add the control key to either of the previous commands (e.g., command-control-shift-3). This will dump the screenshot into the clipboard rather than save it as a file. All you do next is go to the window you want to paste it in, and hit Command-V.
Finally, if all these hotkeys are too much to remember for the occasional screenshot, remember you can always access screenshots through the Preview.app menu (see main image above).
Happy snapping folks!