I recently came up against a bit of an issue whilst working on my MacBook Pro in the office, due to the environment we work in access to the outside world is tightly controlled by our firewall, and although I love to spend countless hours adding and tweaking rules (not strictly true) – I wanted to find a better solution for routing traffic to certain sources over certain connections.

Now – there’s a couple of fairly major caveats on this ‘how-to’ and that is that a second network needs to be available and that the gateway addresses are different.

For the purposes of this tutorial, my wired lan connections IP address is 10.0.0.1 and my wireless connections IP address 192.168.2.2.

The tutorial was born from my laptop’s need to communicate with Stanford Universities Folding@Home client, which needed to communicate with its job server 171.67.103.160* to upload and download new work packages. (*This is one IP address of many used)

Knowing I had my unrestricted wireless connection available I knew I wouldn’t have any issues, however as my MacBook’s service order is always set to use the cabled connection first – the client would always try sending over that and then fail.

Working around this is however, fairly straight forward and easy to achieve. All I needed to do was to direct all the network traffic to Stanford’s servers over my wireless connections gateway.

To do this, all you need to do is fire up a terminal session and type the following:

Sudo route add 171.67.103.160 192.168.2.1

Upon hitting return you should be prompted for your ‘sudo’ password, once added the route will then be added to the routing table. Thus forcing all traffic to that address to ignore my service order, and default to the wireless connection to send/receive traffic. Obviously – this is a pretty unique situation, and outside of that network traffic will then start failing. To rectify that, and remove the entry from the routing table you will again need a terminal session, and to type the following:

Sudo route delete 171.67.103.160

Obviously you will need to replace the IP Addresses where appropriate.

If you’ve a better way of dealing with such issues I would really be interested to hear them – let me know using the comments section below.

Tagged with:  

By default the ‘Library’ folder is a hidden folder in OS X Finder. However, if you need temporary (GUI) access you can use this simple AppleScript below to remove the ‘hidden’ flag from the folder.

tell application "System Events"
	set libvis to (get visible of folder "~/Library")
end tell

if libvis = false then --~/Library is currently invisible
	tell application "System Events" to set visible of folder "~/Library/" to true
else --~/Library is visible
	tell application "System Events" to set visible of folder "~/Library/" to false
end if

This script could also be easily amended to show and hide any folder of your choice, simply by replacing the ~/Library/ with the path of the folder you’d like to toggle.

Tagged with:  

By default the library menu option in the go menu is hidden. Although I’ve never quite understood why it needs hiding, this quick tip will show you how to unhide it with just a quick keyboard click.

  1. Make sure you have a finder window active and focused
  2. Click on the Go menu at the top of the screen
  3. Press and hold the ‘Option/Alt’ key on your Mac’s keyboard
  4. The library icon should now appear. Upon releasing the keyboard key the icon will disappear again
Tagged with:  

Associate your Twitter account in Mountain Lion

On August 2, 2012, in Blog, Mountain Lion, by Mike Hudson

Twitter Logo

One of Mountain Lion’s most talked about feature is the introduction of the tight social integration with the 140 character site ‘Twitter”. Unless you’re like me and spent the first few days of using Mountain Lion wandering around the system preferences you may find it difficult to locate a position where you type in your twitter credentials.

The following blog post hopes to rectify that, it may not seem immediately obvious that you have to enter your details and send them as your email address and calendar contacts in the system preferences pane.

First of all you need to load up System Preferences, to do this open a new Finder window, and navigate to your Applications folder, once you are there, you should see an icon which looks like a cog, and is labelled System Preferences. Double click on this and the System Preferences pane should appear.

Now under the heading of ‘Internet & Wireless’ click on the icon highlighted below:

System Preferences - Mail, Contacts & Calendars

In the pane on the right hand side you will see a list of all the account types Mountain Lion supports by default. Some of which have been migrated over from Lion. However most are new.

Mail, Contacts & Calendars

From the list select the Twitter icon, and enter your username and password in the boxes provided:

Mountain Lion Twitter username and Password box

Once done your twitter account will become associated with your Mountain Lion user account, and you will be able to do things like tweet direct from the ‘sharing’ button in apps such as Safari:

It really is as simple as that! So happy tweeting readers… :)

Tagged with:  

Grab OS X login screen graphics

On July 26, 2012, in Blog, OSX Tips, by Mike Hudson

Last night one of my twitter friends (Ben Casablancas) asked me an interesting question, he wanted to grab his OS X login screen ‘avatar’ for use on twitter. Now, on first appearances the image file seemed to be well hidden away in the deep dark depths of the OS X file system.

However using this little snippet of code in a terminal window made it much easier to find:

dscl . -read /Users/`id -un` JPEGPhoto | tail -1 | xxd -r -p > ~/Desktop/MyAccountPic.jpg

Now if you check your desktop, you should see a JPG labelled MyAccountPic.jpg. That’s right… That’s the picture seen in the login window. But wait… I hear you cry, what about the ‘halo’ ring! Well don’t you worry, we’ve got that covered too!

Back in terminal, paste in this line:

cp /System/Library/PrivateFrameworks/LoginUIKit.framework/Versions/A/Frameworks/LoginUICore.framework/Versions/A/Resources/avatarWhiteRing.png ~/Desktop/MyRing.png

You should now find another image on your desktop – this one labelled MyRing.png. This is the ‘halo’ circle from around your avatar. Now last but not least, you’ll be wanting the mask to go with that:

Back in terminal, paste in this line:

cp /System/Library/PrivateFrameworks/LoginUIKit.framework/Versions/A/Frameworks/LoginUICore.framework/Versions/A/Resources/avatarMask.png ~/Desktop/MyMask.png

You’ve guessed it! You will now also have an image on your desktop labelled MyMask.png.

So although it’s hidden away, using the extremely powerful terminal it can easily be retrieved.

For reference, all the code above does is create copies of the graphics, and is in no way dangerous. If your stuck looking for something in OS X drop me a line and maybe I can help you too.

Tagged with:  

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!