Archive for the ‘Mac’ Category

Mac tip of the week: Spotlight as a launcher

Since the 10.4 version OS X has had a search system called Spotlight. Among other things, Spotlight allows you to search your computer for files matching whatever criteria you enter. In addition to regular files, Spotlight will also show you any programs that match what you’ve typed in. In 10.5 or newer, the tip hit will also be highlighted first and you can simply press enter to select it.

You can access Spotlight in two ways, by click its icon () or pressing command+spacebar. Start typing the name of the application you want launch and press enter when it is highlighted.

This will launch the application. Over time you’ll find you can search for and launch applications very quickly using this method.

Of Keyboards and Mice

As a followup to my previous post I thought touching on how to get the most out of the Mac keyboard and mouse or trackpad would be a good idea. Although the keyboard and mouse are mostly the same between a Mac and a PC there are a few key differences that can really get a guy hung up.

Keyboard Shortcuts
Watch a long time Mac user and you’ll undoubtedly see them using a large number of keyboard shortcuts. Keyboard shortcuts let you perform actions that would normally require the use of a mouse but switching from the keyboard to mouse is a time consuming task.

If you’re coming from Windows then you probably know at least some keyboard shortcuts. Ctrl+c for copy, ctrl+v for paste. You know that most keyboard shortcuts using the ctrl key plus some other key to get something done. You might also know that the Windows key plus some other key on the keyboard will fire off something completely different. On the Mac the majority of the keyboard shortcuts are fired off using the command key. Below I have a list of some of the most common keyboard shortcuts on the Mac. It is not an exhaustive list

Shortcuts that work nearly anywhere

  • command+x, command+c, command+v: cut, copy, paste
  • command+space bar: spotlight search. Really useful for launching apps
  • command+left or right arrow: One area I’d fault the Mac on, poor use of home/end. This shortcut replicates home/end in most situations. In some apps they are remapped to change tabs, like in iTerm
  • fn+delete: On laptops, fn+delete will act like the delete key on a PC keyboard, deleting the character in front of the cursor.
  • command+tab: Switch between apps
  • command+~: Switch between windows of the current app
  • F3: On the newer Mac laptops and the aluminum keyboard, F3 initiates the all windows exposé.
  • option+e and then the letter: Gets you that thing above the e :)
  • ctrl+click: Right click
  • command+q: Closes all windows of the current app and quits the app
  • command+w: Closes the current window (or tab in some apps)
  • command+m: Minimize current window
  • command+h: Hide the current application. Similar to minimizing an app but doesn’t require Dock space
  • command+option+h: Hide all windows other than the current window
  • option+mute,volume up/down: Open audio preferences
  • option+F3: Exposé preferences

Discovering More
If you want to know about more keyboard shortcuts look no further than the menu bar. Just click a menu and look at the symbols shown to the right of a menu item. The ⌘ is the command key, ⇧ is shift, ⌥ is option, ⎋ is your power button and ⌫ is your backspace (delete) key. ⌥⌘T will usually bring up a special characters palette allowing you to find these symbols and more.

Also know that the option key serves as a modifier for a lot of things. For example, if you hold down the option key and then click the AirPort icon in the menu bar (by the clock) you’ll additional information about the wireless network you’re connected to. If you hold option while clicking the apple menu, the usual “About This Mac” will become a shortcut to the System Profiler.

The Trackpad
While the keyboard is fun and all, the trackpad is where the real magic is. Using the multi-touch trackpad found on the latest generation of Mac laptops will make any other trackpad nearly impossible to use. The trackpad, made of glass with the perfect texture, is large and also serves as the button. You can click using just about any part of the trackpad which actually comes in handy more often than you’d think.

A favorite sticking point of Windows users is that Macs don’t have mice or trackpads with multiple buttons. They then assume that OS X doesn’t understand the venerable right click. This couldn’t be further from the truth. OS X has supported context based right click menus from day one. Accessing them was just different, in the beginning. You’ll find that control+click will produce a right click menu, but so will clicking the trackpad with two fingers. If you’re a fan of tap to click as I am, then you’ll you can find that setting in System Preferences. Once enabled, tapping on the trackpad with two fingers will produce the right click menu. Over time, I’ve found this to be much more useful than a dedicated button because I can get the menu from anywhere on the trackpad.

Here’s a list of the other capabilities of the multi-touch trackpad:

  • Two fingers slid up or down: Scrolling, just like the wheel mouse
  • Four fingers slid up: Show desktop
  • Four fingers slid down: Exposé

For more visit the trackpad preferences in System Preferences. Apple also provides a lot of good information on this topic at http://www.apple.com/support/mac101/work/

Think I missed something? Leave it in the comments!

My Favorite Mac Apps

I know someone who just picked up a new Mac and it got me to thinking, I bet people new to the Mac platform don’t know about all of the great software you can find for the Mac. I thought I’d write up a post on some of my favorite free and paid apps.

  • Firefox
  • RipIt: DVD ripping made easy
  • Adium: Multi-protocol chat
  • Growl: Must have notification system
  • NetNewsWire: RSS reader that syncs with Google Reader
  • BootChamp: Simple menu for rebooting directly into your BootCamp OS installation
  • Tweetie: Twitter client
  • iTerm: I can’t let go of this great ssh client.
  • 1Password: Store all of your passwords. LastPass is free alternative that is more cross platform
  • Automator: Built in robot too useful not to mention
  • Caffeine: Sometimes you just don’t want your Mac to dim the display or go to sleep.
  • Colloquy: Decent IRC client
  • Cord: Remote Desktop Client for Mac.
  • CrashPlan: Time Machine is good but I just have to have a second way of backing up all of our photos. CrashPlan really does a good job and has saved me.
  • HandBrake: Very good video encoder and DVD ripper (requires VLC)
  • Loginox: Swap out that ridiculous login screen image.
  • MarcoPolo: Change preferences based on your location or “context.”
  • MacFusion: Mount/Map ssh/sftp servers in Finder allowing any app to directly access remote files
  • smcFanControl: The Mac generally does a good job with the fan but there are times when having it cranked up on high is a good thing, especially for your lap.
  • NTFS-3G: Mount NTFS drives as read/write
  • SmartSleep: Preference pane that allows you to adjust how your Mac sleeps or hibernates

I think that about covers it. There are far more applications in my applications directory but the apps I listed are must haves in my book. If there are any apps you think I missed leave a comment.

Encoding episodic DVDs to h264

My wife and I don’t watch a ton of TV but we do have a few TV series on DVD. Lately I’ve been taking the time to rip the DVDs to hard drive so we can travel with them more easily.

The problem of course is they take up a lot of space after awhile so I’ve started to compress some of them to the h264 format. I picked h264 because I like the quality and because newer Macs are able to decode h264 using hardware acceleration. One problem with the h264 format is that by itself it has no support chapter markers unlike say, the mkv container. To get around this, I wrote a couple of scripts. One of them determines how many chapters (episodes) are available on a disc and the other one does the encoding.

In order to put all of this to use you’ll need to have the HandBrakeCLI program installed on your computer. The HandBrake is site (http://handbrake.fr/) has information about how to get everything installed for your OS. This post assumes you are using Linux, Mac OS X or other UNIX like system.

Here is the script that retrieves the number of chapters on from a DVD that has been ripped to a hard drive. You’ll need to modify it for your environment. I called mine getchapters.sh but the name is arbitrary.

#!/bin/bash
HandBrakeCLI -i $1 -t 0 2>&1| grep "title 1 has" | grep chapters | awk '{print $
6}'

This script is called within another script that I called h264encode_episodic and looks like this

#!/bin/bash
chapters=`getchapters.sh $1`
if [ "$2" != "" ]; then
title=$2
else
title=$1
fi

for I in `seq 1 $chapters`
do
HandBrakeCLI -Z "High Profile" -i $1 -o ${title}E${I}.mp4 -c $I
done

Running this script in the same directory as the DVD iso or VIDEO_TS directory you will end up individual video files, one for each chapter or episode of your show. Here’s how it is called

h264encode_episodic Scrubs_S1D2.iso Scrubs_S1D2

Scrubs_S1D2.iso is the iso of the DVD I want to convert and Scrubs_S1D2 is part of how the resulting files will be named. The first episode will be named Scrubs_S1D2E1.mp4.

Windows 7 Review

A while back I installed Windows 7 on my work laptop so I could give it a real trial. Since installing it I’ve been using it to some capacity almost daily and now after a couple of months I thought I’d write out a few of the things Windows 7 gets right and a few of the things that could use some fixing.

What Windows 7 Gets Right

Windows 7 is a big improvement over Vista. It boots quicker, introduces a remixed taskbar, better window management, fixes a number of interfaces issues that Vista had like managing wireless networks and it makes Windows Explorer much more useful. And, while there are a lot of tests out there that show Windows 7 isn’t actually faster than Vista, Windows 7 certainly feels faster and that is arguably much more important.

Start Up and Shutdown
Improved start up and shutdown speeds have been a selling point of most Windows releases since Windows 95 but no release has ever really delivered on that promise. If anything, better start up and shutdown speeds have been because of hardware improvements over the years, not the OS. Vista promised to bring with it improved start up and shutdown as well but it would seem the engineers had trouble actually delivering on that promise once again. Instead, Vista cheated by using sleep and suspend to mask the amount of time it took the OS to start up and shutdown. So, once Vista had been booted up choosing shutdown would put the computer to sleep or suspend. To truly shutdown or reboot the computer the user had to visit a secondary menu.

Of course, Windows isn’t the only operating system promising better start up and shutdown speeds but it wasn’t until this year that someone was finally able to really deliver on the promise of faster start up and shutdown. When Ubuntu 9.04 arrived, it shattered the status quo delivering start up times that seemed much more inline with the amount of power modern computers offer. While Windows 7 doesn’t seem to quite match Ubuntu’s speed it does seem that Microsoft was able to actually improve things enough that they no longer had to rely on the tricks that they used in Vista. Clicking shutdown now causes the OS to actually shutdown.

The Taskbar
The Windows taskbar isn’t something I’ve felt was an issue. In fact, I’ve always thought it was just fine. I’d typically expand the bar so it was a bit taller and put the quick launch icons under the application buttons. In Windows 7 however Microsoft has dramatically changed how it works and the end result works very well. It is clearly superior to the taskbar model it replaces by offering real time previews of running apps or even Internet Explorer tabs by simply hovering over a running application’s icon. From there you can hover your mouse over a preview and Windows will make all other Windows transparent so you can see the full version where ever it might be on your monitor. You can easily pin new applications to the taskbar by dragging them or right clicking the icon of a running application and choosing “pin to taskbar.”

There are however a couple of issues worth pointing out, both of which could probably be fixed in an update or service pack. Installing an updated version of an application will break the icon on the taskbar. It simply won’t work until you remove the old icon and place it there again. The other problem is that using the taskbar beyond it’s obvious functions is difficult to discover. Clicking the application icon always displays the running application, but what if you want a new window? The secret is to hold down the shift key while clicking the application icon. This will cause a new instance or window of the application to launch instead of simply showing the running version. If you want to launch an application and run it as Administrator, hold control and shift while clicking the application icon. Microsoft would do well by providing some way to educate the user on how to use the new taskbar.

Window Management
Microsoft is always being accused of stealing features and ideas from Apple and sometimes I believe they do. The new taskbar for instance is very dock like but does add an innovative new twist to the idea. But in the case of window management Microsoft has, for once, truly one upped Apple and Apple should really consider implementing a similar if not exactly the same set of features.

Windows 7 introduces several new ways of sizing windows automatically. A user has always been able to resize a window by dragging it bigger on any corner or side of the application window. Windows 7 however now allows you to simply drag the entire window to a sort of hot spot to resize it. Drag a window to the top of the screen and Windows 7 will maximize the window. Drag it to the left or right and Windows will resize it to the full height of the screen but only 50% of the width. This makes it extremely easy get two applications side by side on a single monitor.

Interface Tweaks
One of the things I simply couldn’t get over in Windows Vista was how poorly implemented the wireless network interface was. In fact, the entire networking interface was overly complicated. While most of the networking interface is just complicated as it was in Vista, the part that you’ll use the most is much improved and now works exactly as it does under OS X or Linux. You simply click the icon and choose an available wireless network.

The Explorer was another item in Vista I found awful. It was cluttered and confusing. Windows 7 again seems to have taken one from the Apple playbook and Explorer is now much more usable. A number of sensible default shortcuts are available on the left side and you can easily add more. Over all, Explorer feels much less confusing and cluttered.

What Windows 7 Gets Wrong
Despite all of the things Windows 7 gets right, there are a few things that simply don’t work or just aren’t useful. Below I’ve listed a couple of my biggest Windows 7 gripes.

Aero Peek and Show Desktop
Of all the new features of Windows 7, Aero Peek is arguably the most pointless. Placing the mouse in the lower right corner causes Windows to make all of the windows translucent so that you can see through them and see the desktop. This is great, except now that I can see the desktop I want to be able to access what is there. Moving your mouse away from the bottom right causes all of the windows to become opaque again. In order to actually access what is on the desktop you have to click the bottom right corner. This causes all application windows to simply go away, as if they’re minimized. Why bother with Aero Peek at all?

Also, show desktop is still a broken feature when compared to Exposé on OS X. Clicking show desktop causes all application windows to go away. If you click it again all application windows will, usually, appear back where they were with the right application in focus. If you click an application icon before clicking show desktop again, the whole “set” is lost. You can’t return your desktop they way it was unless you now manually click each application icon.

Aero Shake
Another new feature is Aero Shake. Aero Shake mimics an OS X feature that allows you to hide all other Applications. The problem with Aero Shake is that it is an awkward gesture. You activate Aero Shake by clicking and holding on the Window you want and then shaking it for a bit. In theory it seems sound and simple, in practice it feels awkward.

Another issue with Aero Shake is that it reveals a key difference between Windows and OS X. Under OS X, an application is NOT the same as the window. It’s entirely possible (and very useful) for an application to be running but not have any visible windows. When an application has focus in OS X you can hide that application by pressing command+H or by choosing “Hide ApplicationName” from the application menu where ApplicationName is the name of the application. The opposite of that is similar to Aero Shake does. From the same menu you have the option to hide all other applications, leaving any windows that belong to that application still visible.

Windows however doesn’t differentiate between a window and an application because in Windows, the window IS the application. This makes Aero Shake, aside from the goofy gesture, less useful in my opinion.

Conclusion
Windows 7 is what Windows Vista should have been. If you’re Windows fan then Windows 7 is something to truly be excited about. If you’re an XP user and you’ve been hanging on to it because of all the bad things you heard about Vista, wait no more. Especially if you bought a Vista “capable” or “ready” machine and then downgraded to XP. If you truly need XP for compatibility be sure to pick up at least the professional version and then download the XP mode package from Microsoft. XP mode is a preconfigured Windows XP system running in Microsofts VirtualPC and the end result is fantastic. You can upgrade to a modern Windows system and still run apps or hardware that will only work under XP.

Ubuntu, Netatalk and OS X

Recently I removed Fedora 10 from my Linux server at home and installed Ubuntu 9.10 Server. I did this partly because I was tired of finding packages that weren’t available on Fedora but were available in Ubuntu. Ironically I ended up trading one mess for another. Under Fedora I was compiling software that simply wasn’t available, but under Ubuntu I need to recompile the provided netatalk package in order to enable support for newer versions of OS X.

Netatalk is the Linux package for providing the native file sharing protocol to Macs and also provides better performance than Samba under most conditions. The missing feature in this case seems like quite the over site considering it makes the software virtually useless on networks with modern Macs as it prevents them from authenticating. Lucky for me, someone else has gone through the work of figuring out what it takes to get things working again.

The information is Debian/Ubuntu centric but you should be able to apply the same fix on other distributions. Here’s the link http://www.kremalicious.com/2008/06/ubuntu-as-mac-file-server-and-time-machine-volume/

Fixing an incorrectly set home directory on 10.5

I recently tried to change my home directory on my Macbook to less than stellar results. In the end I couldn’t sign in to my one and only user account. Had I had another account I could have more easily fixed it, but without a second account here is one method you can follow.

Reboot your Mac and before the tone sounds press and hold command+s. This will tell OS X to load in single user mode, dropping you to a root shell. Next, type the following

DirectoryService &

and press enter. This will start a necessary service. Next, type the following

chfn

where username is the username you need to fix. An editor (vi) will load allowing you to change the home directory for that user. Edit the file and save the changes (search google if you’ve never used vi) and reboot the Mac by issuing the ‘reboot’ command. You should now be able to sign in to your once broken account.

Time Machine saves me again

Lately I’ve been talking a lot of talk about how great the Mac platform is. At work I go back and forth with a coworker on the merits of Linux and OS X. Of course he claims that Linux is all you need and I’m confident that the Mac is where it’s at. The reality is that OS X suffers its own set of issues which I have talked about in the past. No OS is perfect, just a matter of which one best fits your needs.

Anyway, through no fault of my own I managed to royally screw up my iTunes library to the point where some of the files were pointing to random objects in my backup drive. I have no idea how. At the same time my iPod Touch would simply not cooperate. Many files that I normally sync were listed as missing including over half of my largest play list which is still just a small subset of my entire collection.

So anyway, what’s my point right? My point is that I was able to save myself a ton of work simply because I turned on Time Machine.

Everybody says, “make sure you make a backup” but lets be serious, who actually does? This is one of the many reasons I claim OS X to be one of the best operating systems available for “normal” people. No other system that I am aware of provides such a simple, easy to use and surprisingly robust backup AND restore system. It is so easy you might actually forget it is there.

Restoring my iTunes library to normality was as easy as entering the Time Machine interface, going to the previous point in time, clicking the iTunes library files in my Music folder and clicking the restore button. Done deal. I plugged my iPod in and all of my files were copied back to it as if nothing had happened.

My outrage for the Macbooks lack of firewire was newsworthy

Some comments I made on the an apple discussion website has made the geek news. http://tinyurl.com/4ueslk The comments by miniconvert are from me.

A number of people have pointed out that newer camcorders don’t use firewire anymore. That’s cool, but the issue isn’t just camcorders (though for me it primarily is). Others have pointed out that Apple likes to lead the way, they dropped the floppy first as well as PS2. At the time, very viable solutions existed, it was time for these interfaces to go away. When Apple introduced the iMac it lacked PS2 ports (or really, the Apple keyboard/mouse ports) but it didn’t really matter. That new computer came with a USB keyboard and mouse. By removing firewire they’ve left a lot of potential customers in a bit of a conundrum. What to do with those peripherals that are based on firewire?

How Apple reacts to this backlash will be very interesting. I’ve always understood why people dislike Apple products, this is one of those reasons but in this case I think they’ve gone too far too fast. I do of course realize nobody is forcing anybody into buying a Macbook. It’s just that, when you want to live in the Apple world you choices are already limited.

Adding high speed storage to that Macbook lacking firewire

Here is a copy/paste of a post I did on a forum. It describes in very light detail how to add iSCSI based storage to a Mac. With the new Macbook lacking firewire, this might actually become a more popular method.

In the last couple of weeks I’ve been playing around with a few different bits of technology, one of them being iSCSI. iSCSI is a relatively cheap and efficient method of adding storage to a computer that uses your existing network infrastructure. If you have a gigabit network and a Linux server (I haven’t tested other solutions) you can add as much storage to your Mac as you can fit in your Linux system.

You might be thinking, “I have a 2TB USB/FW drive why would I want iSCSI?” USB and FireWire drives are a fine thing but lets look at some of their disadvantages.

* USB2 is actually slower than many FW400 devices
* If you have a mac with just one FW port and your external drive doesn’t include a FW port, you can’t attach anything else to that FW port AND use your drive
* External drives add noise
* External drives must be located close to the computer, not ideal in a HTPC setup

Here a really quick overview of how it is done, I can certainly provide more detailed information however. Here is a list of what you need to get the job done.

1. Linux server with gigabit ethernet
2. A hard drive or RAID set that you want to share to your Mac
3. gigabit switch
4. Mac with gigabit, the more recent the better
5. GlobalSAN iSCSI initiator for Mac
6. iSCSI Enterprise Target for Linux

Setup your Linux system and install IET. If you’re using Ubuntu, IET might be available in apt. I use Fedora so I compiled IET from source. Edit the /etc/ietd.conf file to point to your disk or RAID set (or even a file that was made using dd if=/dev/zero of=filename bs=1024 count=1 seek=n where n is the size of file you want in bytes). Start the ietd service, /etc/init.d/iscsi-target under Fedora.

Install the GlobalSAN iSCSI initiator on your Mac. Enter System Preferences and click the new GlobalSAN button. Add your Linux server’s IP address to the Discovery screen. Click on the target tab and your disk should be shown, click it and logon to it without a username or password UNLESS you configured one in IET. Be sure to check the persistent tab if you want this drive to appear each time you boot your Mac.

Open Disk Utility and format the iSCSI disk. Your Mac will format the new drive and it’ll soon appear on your desktop. You can use it like any other disk you’ve ever used. You can partition it, copy/delete files, whatever. As far as the Mac is concerned it is a normal hard drive.

In my setup I have an Intel Mac mini, 1.83Ghz C2D and a Linux server built in late January, 2.2Ghz C2D. The disk being shared to my mini is a single 120GB PATA drive. I am able to copy files to the drive with a top speed of 44MB/s. Reading is actually slow but I attribute that to a limitation with the mini’s internal drive. I haven’t been able to test using OpenSolaris as the iSCSI target though OpenSolaris would be a fantastic choice as a storage server.

To be fair, there are some negatives to this setup. The biggest one being you can’t have multiple Macs using the same disk at the same time. You can unmount the disk on one mac and mount it with another one, but having two macs connected at the same time risks your data.

Return top

About

Systems Administrator by trade, opinionated by nature.