Archive for the ‘Mac OS X’ Category

GeekTool

Saturday, December 5th, 2009

I’ve been playing around with GeekTool for a couple of days and I’ve finally gotten everything I want on my desktop.

Here’s what my desktop looks like at the moment:

My GeekTool Desktop

My GeekTool Desktop

For reference, here’s my list of GeekTool Scripts:

  • Computer Name: hostname -s
  • Login Name: whoami
  • Day: date “+%A”
  • Month: date “+%b”
  • Day (numerical): date “+%e”
  • Time: date +”%I:%M”
  • AM/PM: date +”%p”
  • Mac OS X Version: sw_vers | awk -F’:\t’ ‘{print $2}’ | paste -d ‘ ‘ – - – ;
  • Disk Usage: df -H | grep disk0s2 | awk ‘{print “Disk:”, $3, “/”, $2, “-”, $4, “available”}’
  • Uptime: uptime | awk ‘{print “Up: ” $3 ” days”}’
  • Airport Network Name: airport -I | grep -e “\bSSID:” | awk ‘{print $2}’
  • Airport Channel: airport -I | grep -e “channel:” | awk ‘{print “Channel: ” $2}’
  • Airport Max Rate: airport -I | grep -e “maxRate:” | awk ‘{print “Max Rate: ” $2}’
  • Airport Link Authorisation: airport -I | grep -e “link auth:” | awk ‘{print “Auth: ” $3}’
  • External IP: echo `curl -s http://checkip.dyndns.org/ | sed ’s/[a-zA-Z<>/ :]//g’`
  • Running Processes: ps -c -U pmac -o command,%cpu,%mem -r
  • Airport IP: ipconfig getifaddr en1
  • Calendar: cal
  • Network Location: scselect 2>&1 | grep ‘^ \*’ | sed -e ’s:^[^(]*(\([^)]*\))$:\1:g’

Most of these commands were culled from various websites, while I came up with the rest myself.

“custom_domain is null” error message in Firefox

Thursday, July 9th, 2009

Problem: When opening a “localhost” address using Firefox, a JavaScript error message is displayed with the error message “current_domain is null”.

Description: Using Firefox version 3.0.11. Error message only appears when connecting to a site hosted on the local machine. Disabling all add-ons resolves the problem. Re-enabled add-ons one by one. Re-enabling LongURL Expander causes the problem to re-appear. Error message is known issue with version 2.0.0 of the add-on.

Solution: As per the comments on the the add-on page, edit the longurlmobileexpander.js file to make the requirement for the second part of the domain name optional.

  • On Mac OS X, open home folder and browse to Library/Application Support/Firefox/Profiles/[profile].default/extension/{a7101e54-830c-4d33-a3ed-bedc17ec44da}/content
  • Open longurlmobileexpander.js in TextEdit.
  • Edit line 78 to read:


var current_domain = document.location.href.match(/^https?:\/\/(?:www\.)?([^\.]+(\.[^\/]+)?)/i);

  • Save changes.

Thanks to Mathias Jansen for the solution.

Disabling Ethernet Prevents Mac OS X From Waking

Tuesday, July 7th, 2009

Problem: When MacBook lid is closed, fan continues to spin and MacBook becomes very hot.

Description: When in use the MacBook fan behaves as expected. On closing the lid to put the MacBook sleep, the fan continues to spin and the base of the machine becomes very hot.

Opening the lid displays a black screen. No mouse or login screen displayed. Fan continues to spin at what seems to be maximum RPM. Closing the lid again does not stop the fan from spinning.

Only available option is to hold the power button to shut down the system.

On pressing the power button to restart the system, the MacBook starts, displays grey start up screen for a second or two and then restarts automatically. MacBook then starts normally.

Once the user logins, the system works as normal again. Putting the system to sleep, causes the problem to reoccur.

Solution: The user deactivated the Ethernet interface within System Preferences -> Network. Reactivating the Ethernet interface and restarting the machine resolved the problem.

(Who’d have thought that disabling the Ethernet interface would prevent the system from sleeping? Certainly not me when I decided to do so.)

It’s Coming…

Friday, February 13th, 2009

1234567890[1]

  1. Not valid after Friday 13th 21:31:30 []

Enable Bash History in Terminal

Friday, January 30th, 2009

If you use Terminal and are having issues with losing your bash history, then you might want to try this hint.

Open Terminal and type the following command:

sudo chown [username] .bash_history

Type your password when prompted.

That it’s. Now when you close and re-open Terminal your bash history should be saved.

Mac OS Password Assistant

Wednesday, December 31st, 2008

Mac OS has a useful utility for generating secure passwords – Password Assistant. While it’s certainly useful, it’s only accessible from within preference panes that require you to enter a password.

I spent some time with Activity Monitor to see if I could determine if Password Assistant was a separate program being called. No joy there, so I turned to my old friend Google.

That’s how I found a utility from codepoetry that calls Password Assistant directly. It’s small, it works and best of all it’s free.

Copying Mac Address Book to LG Viewty (LG-KU990)

Monday, December 29th, 2008

My phone contract was up recently, and as an incentive to sign on for another year, my provider offered me a free upgrade. So I took the LG Viewty also known as the LG-KU990.[1] I’ll do a full review later, but for the moment, I want to talk about one issue I’ve experienced with it.

LG Viewty (LG-KU990)

LG Viewty (LG-KU990)

I go through so many phones that I like to keep my address book on my MacBook and sync it with my phone. While the Viewty does have Bluetooth, it’s not supported by iSync. Even worse, Bluetooth File Exchange couldn’t see any of the files or folders on the phone[2].

I had the same problem with my Nokia 3120, so I was somewhat hopeful that I’d find an iSync plugin to get me up and running.

After a lot of searching, I discovered that LG use their own OS on the phone which is overlaid with Flash screens to enable interactivity. Worse still, LG don’t implement the SyncML protocol used by the other major manufacturers, and by iSync. So there’s no way to sync my brand new phone with my MacBook.

My only concern is the phone book, I don’t use iCal, and I really don’t want to have to manually enter every name in my Address Book. Luckily, there is a work-around, and here’s how:

  • Open Address Book,
  • Use CMD-A to select all the entries in your Address Book,
  • Navigate to “File” -> “Export” -> “Export vCard…”,
  • When prompted save the vCard.

The next step involves connecting to the Viewty via Bluetooth. If you have not paired the devices before, then you should do so now.[3]

  • Click the Bluetooth icon in the Menu Bar and navigate to “Browse Device”,
  • Select your phone name from the list and click “Browse”,
  • Tap “Yes” on the Viewty to accept the incoming connection request,
  • On your Mac, click the “Send…” button in Bluetooth File Exchange,
  • Locate the vCards file that you saved earlier, and click “Send”,
  • Once the transfer has completed, the Viewty should prompt you to “Restore Contact backup file”, tap “Yes”.

And that’s it. Your Address Book has now been copied to your phone.

  1. I’d usually link to the official site, but it’s flash based and doesn’t work on Mac OS X – and there doesn’t seem to be a text based version available []
  2. Even though Bluetooth File Exchange won’t display any files or folders, the phone is still connected via Bluetooth and files can still be transferred in the normal manner. []
  3. Short and simple explanation: Turn on Bluetooth on your Mac, turn on Bluetooth on your phone, click the Bluetooth icon in the Menu Bar, select “Set Up Bluetooth Device” and follow the Setup Assistant. []

Using GIMP Brushes with Seashore

Sunday, November 30th, 2008

I use Seashore as my main image editor on Mac OS. I’m not a graphics designer so I don’t need an uber-powerful, all singing, all dancing graphics editor.

While Seahorse fits my needs, one thing it does lack is a comprehensive set of brushes. However, because it is based around GIMP, you can use brushes created for GIMP.

To add brushes to Seashore you need to do the following:

  • Locate Seashore in your Applications Folder,
  • Cmd-Click on the Seashore.app and select “Show Package Contents”,
  • Browse to “Contents -> Resources -> brushes”,
  • Drag and drop your GIMP brush set into this folder.

There’s plenty of free GIMP brushes available on the net, but deviantART is a good place to start.

“The connection was refused” Error Message When Using Leopard’s Web Sharing

Monday, November 24th, 2008

I came across this problem when trying to enable Web Sharing on my Macbook:

Connection Refused Error

Connection Refused Error

Seems that even if the Sharing Preferences Pane shows that Apache is running, it’s not. A simple Terminal command will show you:


$ ps aux | grep httpd
pmac 1796 0.0 0.0 599820 464 s001 R+ 12:52pm 0:00.00 grep httpd

After a lot of searching, I found the solution. There’s an issue with the Leopard Apache upgrade that somehow forgets to create the log files that Apache needs to start. To fix the problem, type the following commands into Terminal:


sudo touch /var/log/apache2/access_log

sudo touch /var/log/apache2/error_log

sudo chmod 600 /var/log/apache2/access_log

sudo chmod 600 /var/log/apache2/error_log

Restart the Web Sharing Service by unticking and ticking the box is System Preferences or by running the following command in Terminal:


sudo apachectl restart

Apache should be up and running and you can test this by clicking this link: http://localhost. If everything goes to plan you should see the following page:

Apache Start Page

Apache Start Page

Using iSync to Connect to a Nokia 3120 Classic

Tuesday, September 16th, 2008

Update 9th November 2009: This is my last attempt at trying to get the Nokia 3120 classic working with iSync in Snow Leopard (Mac OS 10.6).

  • Download the modified iSync plugin here.
  • Unzip the plugin.
  • Open your Applications folder and locate iSync.
  • Right click iSync and select “Show Package Contents” from the menu.
  • In the new Finder window navigate to:

Contents/PlugIns/ApplePhoneConduit.syncdevice/Contents/PlugIns/

  • Copy the Nokia-3120c.phoneplugin that you download from this site into this folder.
  • When prompted that the plugins folder cannot be modified, click “Authenticate”.
  • Enter your password.

I have no idea if this will work or not, but it’s the best that I can do.

Update 29th October 2009: I’ve had a look at the plist file format for iSync on Snow Leopard (Mac OS 10.6), and there have been some changes. I’ve updated the 3120c.plist file to reflect these changes, but I’m unable to test the new file. If you’d like to test the new file, you can download it here and please let me know how it goes in the comments. Thanks, Paul.

Update 19th October 2009: As posted in the comments below, this plugin no longer works with Mac OS 10.6 (Snow Leopard). As I no longer have a Nokia 3120c to test with, so I’m afraid I have no way to update the plugin. If anyone does have a working plugin for Snow Leopard, let me know and I’ll link to it from here. Thanks. Paul.

I lost my phone a couple of weeks ago, so I went out and bought a new one. I plumped for a Nokia 3120, because it had what I wanted – a basic camera, bluetooth, and a memory slot – and was cheap.

As with all Nokia’s connecting it to your PC is achieved by using Nokia’s PC Suite, however, connecting it to my Mac via iSync didn’t seem to be possible. I could browse the device via Bluetooth, but iSync would report that it could not use the device.

Thanks to James Lloyd, I was eventually able to get it working. James has a great post about using iSync to connect to Nokia’s Series 40 phones, and helpfully provides plugin’s for nearly 40 models.

While the 3120 classic is not listed, I was able to modify one of the plugins to get it to work. You can grab the 3120 iSync plugin here. Just follow James’ instructions and iSync will happily connect to your 3120.

Edit: The original instructions on James’ blog have disappeared, so you can now find the installation instructions here.

  • Right click iSync from the with applications in the finder and “show package contents”
  • Navigate to: Contents\Plugins\ApplePhoneConduit.syncdevice\Contents\Plugins\Nokia-6131.phoneplugin\Contents\Resources

!!! make a backup of MetaClasses.plist !!!

  • replace contents of MetaClasses.plist with the iSync plugin (text file downloaded from here) for your nokia mobile!