Macintosh

This category contains information related to Macintoshes, Mac OS X, and Mac-related products or technologies.

A Couple GeekTool Scripts

I’ve been experimenting with GeekTool, a nifty Mac OS X Preference Pane that allows you to display information on your desktop. This information can be static text, images, or the output of a script. The last option is the most useful one, in my opinion, and that’s where I’ve been putting GeekTool to use for me. This isn’t going to be some long post on how to use GeekTool or why you should install it; rather, I just wanted to share a couple of short scripts that I wrote that you might find useful.

I use Mac OS X’s network location support extensively. I have separate locations for home (where I have a proxy server) and when I’m out and about (where there generally is no proxy server). So it’s important for me to be able to tell, quickly, which location is active. If the wrong location is active, then network connectivity is impaired.

To help, I use this command with GeekTool to display the network location on my desktop:

echo "Location: `networksetup -getcurrentlocation 2>&1 | tail -n 1`"

Note that if you are running as an administrative user on your Mac (which I don’t in order to reduce potential security risks), then the networksetup command I use above will probably behave differently for you. Since I’m not running as an administrative user, networksetup would throw an error at the command line. Thus why I had to redirect STDERR to STDOUT and filter it using tail. Now, a quick F11 to show the desktop and I can immediately see which network location is active.

I also recently added a script to show me what proxy servers are currently active. This is in anticipation of starting my new job at EMC. I don’t know if they have proxy servers on their network, but in the event they do I thought this next command might be handy:

echo "HTTP Proxy: `scutil --proxy | grep HTTP | sort | sed -n '3,3p' | awk '{print $3}'`"

This command displays the HTTP proxy host configured in your network settings. So, again, a quick F11 allows me to see which proxy hosts are configured and active on my Mac.

I actually wrapped several of these commands together into a shell script that you can download here if you’d like. I’m sure there is probably some bash black magic that could produce this output in a more efficient way; feel free to post suggestions for improvement if you have any!

Of course, I also have a few other scripts running with GeekTool—one that displays system information, one that produces IP addresses and Airport (wireless LAN) information, etc.—but these two are probably most useful to me so far.

Tags: , ,

Like many Mac users, I use Growl to provide customizable, centralized notifications for events occurring on my system. Rather than use the Growl team’s GrowlMail plug-in, I use a custom AppleScript that I wrote that provide new message notifications via Growl. It’s not a terribly advanced script; it just provides per-message notifications for each message received, unless I receive more than 5 messages at a time in which case the script just provides a summary notification. It’s worked very well for me for quite some time.

Now, following my upgrade to a new MacBook Pro running Snow Leopard, I’m finding that the script has an interesting flaw: when new messages are received via my Exchange account at work, the script notifies me using information from the previous message received on that account rather than the information from the newly-received message. I know that it’s not the script because notifications for all other accounts work just fine. Only the Exchange account—which uses Snow Leopard’s new Exchange support for connectivity—is affected.

Has anyone else seen this? If so, does anyone have a fix?

UPDATE: I wasn’t able to make Growl notifications invoked from an AppleScript work properly with my Exchange account, so I tried switching to GrowlMail. Unfortunately, GrowlMail has problems with Snow Leopard 10.6.2 that can only be fixed using the Terminal commands in this article. After getting GrowlMail recognized by Mail.app, notifications started appearing correctly for all accounts including my Exchange account.

Tags: , ,

Chad Sakac of EMC (visit his weblog here) recently sent me an Iomega ix4-200d storage unit. Considering that I didn’t need it for my VMware lab—which runs both EMC and NetApp storage arrays—I pressed it into service at home. I can’t tell you how useful it’s been, especially the built-in Time Machine support. Making my three-year-old MacBook Pro running Leopard (Mac OS X 10.5) work with the Iomega’s Time Machine implementation was a piece of cake: point it at the ix4-200d and you’re all set. It’s been great.

Recently, though, I picked up a new MacBook Pro running Snow Leopard. Unfortunately, due to some “under the covers” changes from Leopard to Snow Leopard, making your Snow Leopard-based Mac use the ix4-200d for Time Machine backups isn’t quite so straightforward. Thankfully, due to these instructions, I was able to make it work without too much effort. Here’s how.

First, you’ll need to create a sparse disk image using the following command from Terminal.app:

hdiutil create -size 500G -fs HFS+J -volname 'Time Machine' -type SPARSEBUNDLE <filename>.sparsebundle

Leopard required that the name of the sparse disk image be a concatenation of the computer’s name and the MAC address of the Ethernet interface (en0) on the system. (By the way, you have to use the MAC address of en0 even if you are performing wireless backups over en1.) It appears that Snow Leopard does not have this restriction. I followed it anyway, just in case. hdiutil will create it in whatever directory you are in when you run the command. If you aren’t in the TimeMachine directory on your ix4-200d (which would have a path of /Volumes/TimeMachine on your local Mac), then you’ll need to copy the sparse disk image later. That’s OK.

Second, you’ll need to create a file named com.apple.TimeMachine.MachineID.plist and copy that into the sparse disk image. The contents of this file should look like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC “-//Apple//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd”>
<plist version=”1.0″>
<dict>
<key>com.apple.backupd.HostUUID</key>
<string>System UUID Here</string>
</dict>
</plist>

You’ll need to put your system’s UUID here; you can get this value from System Profiler. Once you’ve created this file with the appropriate values, copy it into the sparse disk image you created. I did this with the Finder and it works fine, but if you want to use Terminal.app you can use this command:

cp com.apple.TimeMachine.MachineID.plist <filename>.sparsebundle

Finally, copy—if necessary—the sparse disk image from wherever you created it to the TimeMachine share on the Iomega ix4-200d. Make sure you’ve mounted the TimeMachine share via AFP and then copy the sparsebundle over using this command:

cp -pfr <filename>.sparsebundle /Volumes/TimeMachine/<filename>.sparsebundle

After you’ve completed all these steps, you can go into the Time Machine preferences and activate Time Machine against the ix4-200d. It worked seamlessly for me on Mac OS X 10.6.2, but your mileage may vary.

I also found this site and this site helpful in confirming the necessary contents of the com.apple.TimeMachine.MachineID.plist file, which is really the key to making it work in Snow Leopard.

I hope someone finds this useful!

Tags: , , ,

My Number One Yojimbo Complaint

After a couple of weeks using Yojimbo from Bare Bones Software, I’m really liking the application. I’m finding it useful and helpful to have an “anything bucket” into which I can toss bits and tidbits of information on an as-needed basis. It’s become incredibly useful for quickly throwing in a URL from Camino or NetNewsWire that I can come back and review later.

However, I do have one major complaint with Yojimbo: it doesn’t honor default applications. I don’t use Preview for PDF files; I use Skim. I don’t use TextEdit for text files; I use TextMate. When I double-click a PDF file in the Finder, Skim opens. When I double-click a text file in the Finder, TextMate opens. Yet, I can’t open PDFs or text notes in Yojimbo in those applications. Instead, Yojimbo forces me to use Preview and TextEdit. C’mon, Bare Bones! Can’t you just add a feature that tells Yojimbo to honor the default apps?

Tags:

For a couple of different reasons—one of them being a desire to have Google Voice take over voicemail responsibilities—I needed to find a way to make my iPhone wait longer before sending an unanswered call to voicemail. As it turns out, this thread has the answer I needed. Here’s how it works. (Note: Do this at your own risk. I’m not responsible for any problems you might create as a result of this information.)

First, you’ll want to get the number to which your calls are transferred when they are transferred to voicemail. Just dial *#61# and dial it. Your iPhone screen will darken and then some text will appear that says something to the effect of “Service Interrogation Complete”. The voicemail number will be listed there. Write it down.

Next, you’ll dial another sequence to tell the iPhone to wait 30 seconds (the maximum delay that can be set) before transferring unanswered calls to voicemail. Dial *61*16787641234*11*30#, replacing the 11 digits between *61* and *11*30# with the voicemail number you wrote down in the previous step. When you dial this number, the iPhone screen will darken again and tell you that the setting was complete. Note that it won’t tell you the delay that was set.

Now you’ll have more time to get that iPhone out of your pocket, purse, or backpack before you miss the call. Or, as in my case, the iPhone delay will cause Google Voice to pick up the voicemail first. Enjoy!

Tags: ,

A Bit of an AppleScript Kick

I’ve been on a bit of an AppleScript kick recently. I’m not 100% sure exactly why, but I have. I’ve always been a bit of a fan of Apple’s “natural language” scripting engine, but I’ve also always been frustrated that more applications don’t support it. Even Apple’s own applications don’t support AppleScript as well as some other applications do.

In the event that you like using AppleScript, too, I thought I’d post my scripts here, along with a brief description of each one. You may need to modify them to suit your needs, and I’ll open deny any liability for anything that happens if you decide to use them. If you suddenly become more productive, it’s not my fault.

These scripts were written for use by/with the following applications, and all scripts (where applicable) offer support for notifications via Growl:

I wrote a couple of AppleScripts for Viscosity as well, but those are so ridiculously simple that I won’t even bother posting them. Just look at this link and you’ll see the extent of Viscosity’s AppleScript support.

Without any further delay, then, here are the scripts!

Send Headline to OmniFocus

Download Link

I think I got the basis for this script somewhere else, but honestly I can’t remember where. The idea behind this script is that when you see a headline in NetNewsWire that looks interesting, you invoke this script and it creates an action in OmniFocus for you. That way, you can quickly scan all the headlines in NetNewsWire, create OmniFocus actions for those that warrant further attention, and then get back to whatever it was you were doing previously. Like most—if not all—of the scripts here, I generally invoke this script using Quicksilver.

Send Tweet to OmniFocus

Download Link

This script was directly based on this blog entry, so I’m not due any of the credit. Once again, the idea is to support quick information aggregation. You see a tweet in Twitterrific that looks interesting, or perhaps it has a link in it that you want to investigate further. Invoke the script and it will add an action to OmniFocus with the contents of the tweet. Later, when it fits into your workflow, you can perform a more in-depth review of the information and process it appropriately.

Retweet Unmodified Post

Download Link

The current version of Twitterrific (version 3.2) lacks quite a bit of functionality, like retweeting, view the whole conversation, etc. So, to work around the lack of built-in retweet functionality, I wrote this script. It’s not the greatest in the world, but it helps a little bit. Select the tweet you want to retweet, invoke the script, and your Mac takes care of the rest.

Send URL to OmniFocus (Camino)

Download Link

You can probably guess the purpose behind this script: to take the information from the frontmost Camino window and create a task in OmniFocus. Yes, that’s right, I have very little imagination. I figure if you limit the amount of browsing you do to defined times (something I’m still working to perfect) then you can instead focus on more important things—you know, like getting your work done. Bosses like that. You only need to invoke the script and it will automatically pull the URL and the page title and push them into OmniFocus.

I also have a Safari version.

Send URL to Pukka (Camino)

Download Link

After mourning the loss of Cocoalicious for quite some time, I switched to Pukka. Pukka offers a built-in service accessible via the Services menu, but it wasn’t picking up enough information from the browser. So I wrote this script to retrieve the URL, page title, and selected text (if any) from the frontmost Camino window and feed them to Pukka. The user then adds any tags and posts the URL to Delicious.com.

Open Source in TextMate (Camino)

Download Link

This one was more challenging than I had anticipated. I suspected TextMate’s AppleScript support would be more than it was, which was—quite frankly—rather disappointing. In any case, invoke this script and the HTML source from the frontmost Camino browser window will be opened in TextMate.

Well, that’s it. If you have any useful AppleScript scripts, tips, tricks, or other trivia to share, please speak up in the comments.

Tags:

Here’s Virtualization Short Take #27, a collection of news, tidbits, thoughts, articles, and useless trivia I’ve gathered over the last week or so. Perhaps you’ll find a diamond in the rough among these items!

  • Interested in more information on how it is, exactly, that Cisco is going to provide so much memory in their UCS blades and rack mount servers to make them ideal virtualization hosts? This article from CommsDesign and this “Catalina” article by Rodos Haywood both provide some great information on how Cisco is working around the Intel reference architecture limitations introduced with the Xeon 5500 and Quick Path Interconnect (QPI).
  • This article provides a handy reference on how to unregister the Nexus 1000V vCenter Server plug-in. I wish I’d known this information several weeks ago…
  • Need to view some configuration files on an ESX host? Just browse to http://<IP address of ESX server>/host and you’re all set. I learned of this handy little trick via Virtual Foundry.
  • And speaking of handy little tips, here’s one Eric Sloof shared regarding the vCenter Ops Dashboard. Again, just browse over to http://<IP address of vCenter Server>/vod/index.html to view the vCenter Ops Dashboard.
  • Adam Leventhal describes using the latest version of VirtualBox—which now includes OVF support and host-only networking—to run the Sun Storage 7000 Simulator. This is pretty cool stuff. I hope Oracle doesn’t kill it like Virtual Iron…
  • I just mentioned Virtual Foundry a bit ago, but forgot to mention this great post on hardening the VMX file. Good stuff.
  • For others who are, like myself, pursuing the elusive VMware Certified Design Expert (VCDX) certification, Duncan’s recent post describing the VCDX design defense is a great resource. Thanks, Duncan!
  • The VMware networking team addresses some questions around using VMware for virtualized DMZs, and how to protect against Layer 2 attacks.
  • Want to do manual linked clones in VMware Fusion? Here’s how.
  • Via Matt Hensley, I found this VIOPS document on configuring a VMware vCenter Data Recovery dedupe store.
  • This article has more information on installing ESXi 4.0 to a flash drive, a process I have yet to try. (Instructions for burning ESXi 3.5 to a flash drive can be found here.) Anyone else done it yet? I’d be interested in how it went.
  • If you have any questions about SAN multipathing, Brent Ozar’s two part series on the topic may help straighten things out (here’s Part 1 and Part 2). I’m not sure that I agree with Brent’s statement regarding the ability of desktop-class SATA drives to saturate 4Gbps Fibre Channel, but I’m no storage expert so I could very well be wrong.
  • VMware SE and friend Aaron Sweemer provides a handy script that can help fix Service Console networking when performing automated builds of VMware ESX.

That wraps it up for this edition of Virtualization Short Takes. Feel free to share thoughts, questions, or corrections in the comments, and thanks for reading!

Tags: , , , , , ,

Over the 2008-2009 holiday season, I rebuilt my home network. I included the notes and information from my home network rebuild in an article that described the Mac OS X-Ubuntu integration resulting from the rebuild. Since that time, I’ve added a larger hard drive to the home server to make more room for Time Machine backups, movies, music, and other files. Things seemed to be working very well. Until the other day…

My wife made an offhand comment that she couldn’t access the shared music library from her laptop. I tested the connection and, sure enough, every time I clicked the shared library icon it simply disappeared. No error, no warning, no entries in any log files…it just disappeared. I searched the Windows event logs, and I searched the log files on the Ubuntu server downstairs. Neither computer had any entries whatsoever that provided any insight as to why this one computer would not connect to the shared music library.

Being the geeky troubleshooter that I am, I attempted to replicate the problem on some of the other computers on the network. My MacBook Pro worked fine. Three other Windows laptops on the network, running the same version of Windows (Windows XP Professional) and the same Service Pack revision, also worked fine. The problem seemed to be isolated to her computer. Perhaps it was only when she was on the wireless network…nope, the same problem regardless of the network connection.

I upgraded iTunes to the latest version. That didn’t work. I disabled the Windows Firewall on her computer. That didn’t work. I made sure that no traffic was being blocked by the firewall on the Ubuntu server; no traffic was being blocked. In other words, that didn’t work. I was about to give up and just write it off as one of those strange aberrations that couldn’t be resolved and chalk it up to Windows.

Then I stumbled onto this site. I’d already created a daapd.service file for Avahi to use previously, but this site described some additional entries in the daapd.service file that I didn’t have. I made some edits, based on the information on the site, and here’s the daapd.service file I had for Avahi:

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM “avahi-service.dtd”>
<service-group>
<name replace-wildcards=”yes”>Home Media Server</name>
<service>
<type>_daap._tcp</type>
<port>3689</port>
<txt-record>txtvers=1</txt-record>
<txt-record>iTSh Version=131073</txt-record>
<txt-record>Version=196610</txt-record>
</service>
</service-group>

After changing the daapd.service file to the version listed above, I restarted Avahi. Upon the shared media server re-appearing in iTunes, I clicked on it and…drum roll please…it worked! The previous version I had been using did not have the txt-record entries, and I really have no idea why adding the txt-record entries suddenly made my wife’s iTunes connect properly. I suppose it doesn’t matter why it works, it just matters that I FIXED IT! (ePlus engineers who attended our NSM this year will get this joke.)

Still, in the event you’re running into the same issue—a Windows installation of iTunes that fails to connect to a shared music library running on Firefly Media Server—then perhaps updating your Avahi configuration will correct the problem.

Tags: , , , , , ,

New Folders with Quicksilver

Prompted by this Twitter status update, I started looking around for a way to create a new folder using Quicksilver. For those of you that aren’t familiar with Quicksilver, it’s a bit hard to describe. I think someone once described it as an “extensible interface for manipulating objects” or some such. In any case, it is an extremely powerful tool for streamlining many, many operations on your Mac.

So, in case you’re interested, there are two ways to do this. Here’s the first method:

  1. Invoke Quicksilver. On my Mac, I use Opt+Space to invoke Quicksilver.
  2. In the first pane, start typing to have Quicksilver try to find the object you’re seeking. In this case, we’re trying to select the parent folder for the new folder we are going to create. So, if we wanted to create a new folder in our personal Documents folder, we’d start by typing ~ (tilde). That would select our Home folder. Then start typing Documents until it matches that. Continue until you’ve found the parent folder of the new folder you are going to create.
  3. Press Tab to move the action pane and select New Folder. (Just start typing New Folder until it matches.)
  4. Press Tab to move to the object pane. You should be in a text entry field. Type in the name of the new folder you’d like to create. Press Enter when you’re done.
  5. Quicksilver creates the folder, and then places the new folder in the subject pane with a default action of Open. Press Enter and it will open the new folder you just created.

Pretty handy, eh?

Here’s the second method. This method assumes you have a Finder window open and can select the parent folder of the new folder you want to create. For example, let’s say that I have a folder in my personal Documents folder named Customers, and within that I want to create a folder named XYZCorp.

  1. Use Finder to navigate to the parent folder of the new folder that you want to create. Click once to select it.
  2. Invoke Quicksilver and press Cmd+G to take the object selected in Finder and put it in the subject pane.
  3. Press Tab to move the action pane and select New Folder. (Just start typing New Folder until it matches.)
  4. Press Tab to move to the object pane. You should be in a text entry field. Type in the name of the new folder you’d like to create. Press Enter when you’re done.
  5. Quicksilver creates the folder, and then places the new folder in the subject pane with a default action of Open. Press Enter and it will open the new folder you just created.

I think I like the first method better, but both approaches are pretty good.

Feel free to share other Quicksilver tips you may have in the comments. Thanks!

Tags:

No, I haven’t found it yet. Sorry, I hope I didn’t get your hopes up with that headline. I’ve been testing a bunch of different Mac clients for Twitter, and I just can’t seem to find the client that has the right mix of features. So, in the hopes that some of the developers of these various applications are reading, here are some of the applications I’ve tested and what I like about each one. Now I just need someone to take all these features and roll them into the perfect Mac Twitter client…

  • Lounge: The Mac beta of Lounge takes the cake for the most complete integration with Twitter. From within this application, you can view user details, see who’s following who and who’s being followed, view another user’s timeline, view Twitter search results, private messages, retweets, view the tweet in a Web browser, copy the tweet’s URL…well, you get the picture. So what’s wrong with Lounge? Primarily speed. I’d also appreciate the ability to customize the display a little bit more than I can currently. Granted, Lounge is still early (0.4.1) beta, so I guess we have to cut them a little bit of slack.
  • NatsuLion: NatsuLion feels the most Cocoa-native here, with full support for transparency (which is a feature I like). I can adjust the display quite extensively, and it has a minimal desktop footprint. There are some trade-offs for that minimal desktop footprint, though, and NatsuLion seems the most susceptible to Twitter brown-outs and outages. Sometimes it will just…not work.
  • Canary: This is a brand-new app I just found earlier today. My #1 complaint about Canary is the display of the tweets—it’s just awful. They need a more streamlined and dynamic display of the timeline, like Lounge and Nambu (see below). Otherwise, I absolutely love the solid integration with a variety of URL shorteners—including credentials for those URL shortening services. Right now, though, Canary is seriously buggy. Switching between views sometimes doesn’t work, and applying a filter then removing the filter causes problems as well. Again, this is an early beta (Beta 2), so I suppose some bugginess is to be expected.
  • Nambu: Nambu is supposed to be more than just a Twitter client, but in current builds only the Twitter functionality works. It’s a pretty decent client, fairly quick and responsive. I like that it automatically contacts URL shorteners to expand out the full URL; this lets you know where you’re headed before you click on it (a good thing these days given all the web exploits that are available). It’s supposed to offer integration with tr.im, a URL shortening service, but it doesn’t really work. It will shorten the URL but won’t use your credentials (in fact, it won’t even save your credentials between launches).
  • Twitterific: It wouldn’t be complete to talk about Twitter clients for the Mac without talking about Twitterific. The only thing I like about Twitterific is the AppleScript support. Otherwise, I absolutely cannot stand the user interface. I just don’t like it. Some people swear by it; it’s just not for me.
  • Bluebird: Bluebird is another application that’s just popped up in the last few days. The first time I tried it, it wouldn’t even launch (said that themes were missing); the second time I tried it, it worked. The themes are supposedly the big thing; you can use standard CSS/XHTML to style the appearance of the tweet timeline. Otherwise, it’s a very early build (Beta 1, I think) and it shows.
  • EventBox: I received a free build of EventBox from MacHeist, but I couldn’t get it to work. It would never even connect to Twitter.

So that’s where things stand. What would the perfect Mac Twitter client possess?

  • The extensive Twitter integration of Lounge
  • The smooth UI of NatsuLion blended with Lounge and Nambu
  • The URL shortening services integration of Canary
  • The AppleScript support of Twitterific

That would, in my opinion, create the perfect Mac Twitter client.

Tags: ,

« Older entries