Dedicated to my late brave, beautiful and silly mummy, Debra Ross. I love you mumster.

Skip navigation

Category archive for how-to

Because archives are so much easier than having just hundreds of posts on the home page. I learned that the hard way.

Tunneling X11 through SSH on Mac OS X

As I increasingly use and rely upon Unix-like operating systems such as FreeBSD (and GNU/Linux) on desktops, I tend to forget at times that I’m using a sophisticated server installed locally to generate my graphical environments, namely X11. And just as with any server I can call it up from another machine and use its services.

X11.app X11 was built specifically to serve graphical applications over networks, and can still be used in this way by employing SSH on the client, and installing the desired applications on the server. My primary desktop is a DIY running FreeBSD 7.0 (more on my debacle with Debian GNU/Linux in a later post!), and my primary mobile machine is an original generation MacBook Pro.

USELESS ASIDE: Given the fact it’s about time for my half-yearly move back to Adelaide, Australia I’ve been contemplating how best to access my desktop machines here in Singapore using my MacBook Pro which I’ll be taking with me. These are the things that keep my up at night.

To access desktop applications on a remote Unix-like machine on your Mac, fire up your Terminal and use the regular SSH command, but with the -X flag:

% ssh -X [USERNAME]@[HOST MACHINE]
% Password: [PASSWORD]

Provided you have installed X11.app from either your Tiger or Leopard install DVD; or better yet downloaded the latest community build of Xquartz from MacOSForge; you should now be able to enter in the name of a graphical application and have it appear!

Tunneled FreeBSD X11 apps on Mac OS X
Tunneled FreeBSD X11 apps running on Mac OS X through SSH

For example, I entered % xfce4-panel and used that to launch some of my favourite apps, as you can see above. Over my local home gigabit ethernet connection and even at Starbucks on the free Singapore public WiFi networks the applications felt like they were running on my local machine.

You may recognise the Xfce panel from my previous post on Xfce and Openbox. There’s a reason for that; I’m using the panel remotely from the same machine. Ain’t [computer] science wonderful?

Plus then you can do things like run local Mac applications and the remote X11 applications on the same screen:

Tunneled FreeBSD X11 apps on Mac OS X
Xfce’s Thunar file manager compared to Leopard’s Finder

Fun with Xfce part 4: Using Openbox

What started as a mini series on the Xfce Desktop Environment on my university intranet has evolved into an open ended exploration on my public blog, and I’m having lots of fun doing it! Scroll down to the end of this post to view links to the previous posts in the series.

Part of the Xfce desktop environment is Xfwm, the Xfce window manager. Xfwm provides sophisticated and pretty composting effects such as drop shadows and alpha transparency on windows and menus, while still using less memory and power than competing desktop window managers. Despite this, for much slower machines even Xfwm can be overkill.

ASIDE: "Window managers" draw the widgets, title bars, resize handles and other elements onto application windows. "Desktop environments" such as KDE, GNOME and Xfce bundle their own window managers along with software developed specifically for their environments, such as Thunar for Xfce.

Enter Openbox, again! Openbox is an extensible, standards compliant, very minimalistic window manager that can be used by itself or in place of a desktop environment’s default window manager to further reduce memory and processor resources. The separate obconf utility provides a nice graphical control panel you can use to switch themes and adjust settings.

The Obconf window and Xfce Settings menu entry
Openbox running in Xfce with the bundled "Mikachu" theme

Most reputable package managers carry both Openbox and obconf, check your distribution’s repositories. To install them on my favourite BSD flavours for example:

FreeBSD ports system or package
# cd /usr/ports/x11-wm/openbox && make install clean
# cd /usr/ports/x11-wm/obconf && make install clean
or:
# pkg_add -rv openbox
# pkg_add -rv obconf

NetBSD pkgsrc
# cd /usr/pkgsrc/wm/openbox && make install clean clean-depends
# cd /usr/pkgsrc/wm/obconf && make install clean clean-depends

Now we want to kill the active Xfwm process in Xfce and open our glorious Openbox replacement. Fire up your Terminal and enter:

% killall xfwm4 ; openbox & exit

It really is smaller in every sense of the word isn’t it? To make sure Openbox is used by default whenever you start Xfce, quit Xfce and check "Save sessions for future login".

The Obconf window and Xfce Settings menu entry
Don’t worry, CC looks pretty confused herself!

You’ll also notice that the "Openbox Configuration Manager" has added itself to the Xfce Settings menu! Click on it and have fun with all the different themes, button positions, font sizes and arrangement settings.

Related posts

Fun with Xfce, part three

This post is part of a series on Xfce, originally posted on my university blog. I’m republishing them here in the hopes that others might find them useful or interesting. Cheers!

In part one of my Fun with Xfce series I talked about why I like using Xfce to begin with, and in part two I explained how to install the complete desktop environment from scratch using FreeBSD ports and pkgsrc, as well as some free GNU/Linux distros that use it by default. In this post I’ll be showing you how I spruce up Xfce to look much more spiffy, learned from many hours of experimentation!

When you run Xfce for the first time, it does look a bit bare. I revel in this; it’s like getting a blank but very flexible canvas to change as I see fit! Assuming you installed the complete desktop using a "meta" package or port, the first thing you can do is browse the built in themes and options. Right click your desktop or click the Xfce icon in the lower dock to bring up the Desktop Menu, then navigate to Settings and click Settings Manager. The control panels you’d be interested in are Desktop, User Interface and Window Manager. They’re extremely well laid out and very self explanatory.

If every computer system had configuration panels that were as intuitive as Xfce’s, I imagine the world would be in a much less stressed place!

Settings windows in Xfce 4.4.2
Settings windows with the default Xfce 4.4.2 themes & decorations

While Xfce does come with a beautiful collection of polished window manager decorations (aka title bar styles), personally I don’t like the built in themes as much and am not a big fan of the lone icon set. Fortunately because Xfce uses GTK+ you can use many of the same themes and icon sets developed for the much larger GNOME desktop with no problems. Kick arse!

First to the themes: personally I like using the Clearlooks theme engine that is used by Ubuntu. It looks very polished and doesn’t have as much of a chiseled look as some of the default themes. In the FreeBSD ports system there are two different versions available which caught me out the first time! Once you’ve installed them, go back to your User Interface settings screen and choose Clearlooks from the list box.

For the fancy version, as famously used in Ubuntu:
# cd /usr/ports/x11-themes/gtk-murrina-fancy-clearlooks
# make install clean
or: # pkg_add -rv gtk-murrina-fancy-clearlooks

For the older, Bluecurve inspired version:
# cd /usr/ports/x11-themes/clearlooks
# make install clean
or: # pkg_add -rv clearlooks

As for icons, I’m a huge fan of Tango Desktop Project who’s stated aim is to "help create a consistent graphical user interface experience for free and Open Source software". The icons they’ve developed look very swish, scale beautifully and use lots of green and blue which I prefer to the default Xfce brown iconset. On FreeBSD you’ll want to grab two Tango ports, then click the Icons tab in the User Interface settings window.

# cd /usr/ports/x11-themes/icons-tango
# make install clean
or: # pkg_add -rv icons-tango

# cd /usr/ports/x11-themes/icons-tango-extras
# make install clean
or: # pkg_add -rv icons-tango-extras

Just by installing Clearlooks and the Tango iconset, you’ll be rewarded with a much prettier desktop!

Before…
Xfce 4.4.2 with Xfce theme and Rodent iconset

After…
Settings windows in Xfce 4.4.2

Okay I cheated in that second shot, I set a desktop background and changed the window decoration to Katiola which blends the menu and title bar to make it look more OS X-ish.

Stay tuned for the next installment.

Fun with Xfce, part two

This post is part of a series on Xfce, originally posted on my university blog. I’m republishing them here in the hopes that others might find them useful or interesting. Cheers!

In my Fun with Xfce part one post I explained that I find Xfce such a pleasure to use because it’s fast, lightweight and has natural visually consistency with my GTK+ apps without the bloat of GNOME, while still providing a cohesive desktop experience with functional applications. In this post I’ll be explaining how to install it.

ASIDE: If you want to give Xfce a try without going through the process of using a package manager and configuring Xorg, the Zenwalk and Xubuntu GNU/Linux distributions have Xfce as their default desktops, plus they have very slick installers and are very newbie friendly.

What’s so liberating about using Xfce as opposed to GNOME or KDE is how lightweight it is and how few dependencies it has in comparison. This is especially noticeable on computers with less storage space, and slower machines which can literally take an entire day to build a desktop environment from source, if that’s your preferred installation method. Of course this means that Xfce is missing some features, but I don’t find myself missing any of them.

Xfce About dialog box, Terminal window showing FreeBSD uname

My experience with package managers are really limited to the FreeBSD ports system and NetBSD’s pkgsrc (on NetBSD and Slackware Linux), so these will be the systems I’ll talk about here. Most *nix package management systems have Xfce though, and most have an easy to install “meta” package that contains the whole desktop.

To install a complete Xfce desktop on FreeBSD (I’m assuming you already have X installed and configured), update your ports tree (visit the Using the Ports System chapter in the FreeBSD handbook if you need help) then compile and install. Alternatively you can install the pre-compiled package which is generally up to date with Xfce’s releases (currently at 4.4.2).

# cd /usr/ports/x11-wm/xfce4
# make install clean
or …
# pkg_add -rv xfce4

On NetBSD and/or if you’re using pkgsrc, the procedure is just as easy:

# cd /usr/ports/meta-pkgs/xfce4
# make install clean clean-depends

Then it’s simply a matter of adding exec startxfce4 to your .xinitrc file in your home directory; create it from scratch if it doesn’t exist. Make sure to comment out any other lines related to other desktops and/or window managers you might have installed (but obviously keep lines you may have added to have X11 applications start automatically when you launch X).

Typing startx at this point will start X and your new Xfce desktop!

ASIDE: If you haven’t aliased your machine’s hostname to 127.0.0.1 in your /etc/hosts file, Xfce will give you a warning message. You can safely ignore it, but it can get irritating after a while! Edit your host file to fix this.

In the next post I’ll be explaining how I pretty up Xfce by adding new themes and icon sets, and how to make it look like other desktops. Stay tuned.

Recover forgotten passwords in Camino

AFTERWORD: I created this entry because I was frustrated that there were lots of guides to recover passwords in Safari (and Firefox, and Opera) on Mac, but not Camino. The procedure is about the same, but nobody had it shown anywhere as such.

One of the (many, many!) problems I encountered when I lost my phone recently was losing my password for Wireless@SG! When I signed up for the free public wifi system in Singapore I was issued a password in the form a text message on my phone. Of course, now that my phone and I have parted ways I don’t have that password.

ASIDE: I really should have written the credentials down somewhere safe besides my phone! Hindsight is a remarkably powerful and largely useless tool.

Keychain Access.app As it stands now though I can still log in to Wireless@SG because Camino remembers my password and enters it in for me automagically. What I wanted to know was, is there some way to retrieve the password from Camino in a form other than a string of asterisks? As it turns out, one of the primary reasons I still keep going back to Camino (greater Mac integration and consistent Mac interface) turned out to be my saviour, in the form of the Mac OS X Keychain.

If you have a password that Camino remembers but you don’t, you can retrieve it by opening Keychain Access.app in /Applications/Utilities/. You’ll be presented with a list of accounts that OS X has remembered the passwords for.

Double click the site that you can’t remember the password for, then click the Show Password checkbox at the bottom of the window that appears. You’ll be prompted to enter your Mac OS X login credentials. Voila, your password is presented:

Keychain Access.app

Of course, I changed my password shortly after!

Zip and rar archives in Gnome

It’s been a few days since I started using Gnome on my primary desktop, and I think I’m starting to get used to it. More on that will be in another post.

One problem I encountered after compiling gnome2 from ports on FreeBSD is that File Roller (labeled Archive Manager on the Gnome menu) has difficulty with zip and rar files. If you open one, it spits out an error message similar to this:

Could not open SpywareWriterForWindowsHehe.zip
Archive type not supported

The problem stems from File Roller not being able to find the right command line utilities. Others may work, but I’ve found success by installing the aptly-named unzip and unrar from ports:

# portsnap fetch update
# cd /usr/ports/archivers/unzip && make install clean
# cd /usr/ports/archivers/unrar && make install clean
% echo "Burchfield Nines was one of his best albums"

You can install the packages if you prefer, though honestly even my Pentium MMX machine was able to make light work of them.

# pkg_add -rv unzip
# pkg_add -rv unrar

For what it’s worth, you can just as easily use these command line tools on the… command line, to extract files from zip and rar archives:

% unzip -jv archive.zip
% unrar -ev archive.rar

Using Twhirl with Jaiku

I’ve been direct messaged on Twitter a few times by people wanting to know how to set up Twhirl to send tweets to Jaiku properly. They’ve already got Pownce set up just fine with their username and password, but their messages aren’t getting through to Jaiku.

The problem is, unlike the Pownce password field, Jaiku needs your API key, not your password. To find out what your API key is, login to Jaiku and click the API link at the bottom of the page. The page that appears will have your API key.

Enter your Jaiku username and the API key into the two text boxes in Twhirl, then enjoy having your tweets appearing on more than one site! This means you can keep in touch with people on three separate services, plus it makes you look like you’re putting even more effort into your Web 8.0 life, or whatever version the 1337 media people have decided to assign to the intertubes now.

These are my profiles if you’re interested on Twitter, Jaiku and Pownce.

Showing network drives on an OS X desktop

I have so many external hard disks, over time it became unfeasible to have them all connected to regular local ports (if by unfeasible I mean impossible!), so as of late I’ve been accumulating network drives. With gigabit switches, proper category 6 ethernet cables and gigabit enabled drives the speeds are surprisingly good.

The problem is in it’s default configuration, Mac OS X Leopard doesn’t display network mounted devices on the desktop along with your other drives. As someone who uses the icons on his desktop to keep track of what his machine is connected to, it can be very confusing!

Finder preferences window style=

The solution is:

  1. Click on the Finder menu and choose Preferences... or hit [Command] [,]
  2. In the General tab under "Show these items on the Desktop:", check Connected servers.

Low and behold, all the network drives you have mounted appear on the desktop, complete with the new cute little hand holding icons:

Mounted network shares on a Leopard Desktop

As you can see, the mounted network volumes shown in the Terminal window are now being mapped on the desktop automagically. Which brings up an inevitable security question: do I always have my icons that big? Heavens no, it’s just so you can see the icons more clearly! In fact I usually have my icons at a paltry 48px (that is small by KDE and Mac OS X standards!).

ASIDE: I refer specifically to Leopard hiding network drives on the desktop because I started using network drives after I upgraded to Tiger, so I haven’t ever used them with earlier versions of OS X. They might be in the same boat.