Posts tagged with "guide"


Point Gnome 3 Contacts to SeaMonkey Address Book

A silly little hack I devised this afternoon if you run Gnome 3 and have the pretty (but unused) Contacts icon in your Applications menu. Open this as root:

/usr/share/applications/mozilla-seamonkey.desktop

And replace this:

Exec=gnome-contacts

With this:

Exec=seamonkey -addressbook

One of these days I'll fulfill my dream of writing an entirely XUL desktop environment. And it'll use the Walnut theme by default. Oh, you'd better believe it.


Additional plugins are required to display...

Additional plugins are required to display all the media on this page

I got this irritating message on Firefox and SeaMonkey constantly, mostly because I don't have Flash. Fortunately, it's easy enough to disable.

Go to about:config and set this option to true:

plugins.hide_infobar_for_missing_plugin


Preallocating qemu-img images

Icon from the Tango Desktop Project

To drastically improve virtual drive performance of qemu guests, create images with metadata preallocation:

% qemu-img create -f qcow2 -o size=2147483648,preallocate=metadata disk.qcow2

Then if you're on Linux, use fallocate to preallocate space:

% fallocate -l 2147483648 disk.qcow2

Passing this on for what it may be worth, they both saved me a lot of time copying files this morning. :)


Installing @PollyClient on Fedora 16 and 17

While Polly is understandably optimised for Ubuntu, it runs well enough on Fedora to still be my favourite multi-column Twitter client! Here's the quickest way to get it running.

Getting the source

Polly doesn't ship with an RPM, but we can install it ourselves without too much trouble. Head to their Launchpad download site and download the latest source tarball. As of writing, the latest is:

Polly-0.93.4 (pre-alpha 3.4).tar.gz

Dependencies

The tarball's README list dependencies for Ubuntu, but it didn't take long to find their Fedora equivilents.

Ubuntu Fedora
python-gtk2 pygtk2
python-dbus dbus-python
python-xdg pyxdg
python-notify notify-python
python-oauth2 python-oauth2
python-gconf gnome-python2-gconf
python-socksipy python-SocksiPy
python-httplib2 python-httplib2
python-pycurl python-pycurl
python-numpy numpy
python-keyring python-keyring
python-gtkspell gnome-python2-gtkspell

And here they are on a single line to make installing easier. Depending on which spin you're running, you may already have most of these.

# yum install pygtk2 dbus-python pyxdg notify-python python-oauth2 gnome-python2-gconf python-SocksiPy python-httplib2 python-pycurl numpy python-keyring gnome-python2-gtkspell

These also bring in several dependencies, including:

atlas, gnome-python2-extras, gtkspell, libgfortran, python-nose

Installing

Now it's just a matter of extracting the tarball, and running the install script.

% tar xzvf "Polly-0.93.4 (pre-alpha 3.4).tar.gz"
% cd "Polly-0.93.4 (pre-alpha 3.4)"
# ./install

Restarting gconfd-2

If Polly works now, you're done! Add your accounts, and tweet away!

Even with the latest alpha versions, Polly still refuses to load on any of my Fedora machines unless I restart gconfd-2 before I run it the first time. According to the GConf site, the safest way to do this (other than outright killing it) is:

gconftool-2 --shutdown

The friendly Polly developers I've talked to on Twitter expressed surprise that this was still needed. This leads me to believe it's a localised Fedora issue, which means when I research this further I'll be filing a support ticket with them, and not Polly. We'll see.


Make Qt applications match Gnome 3

Qt applications look acceptable in Gnome 3, but with the Qt4 Configure utility you can change the colours and fonts to match their GTK+ brethren!

Installing Qt4 Configure

This is a potential gotcha; depending on your distribution you may have to specify qt4, or not. For example, in Fedora:

# yum install qt-config

And FreeBSD:

# cd /usr/ports/misc/qt4-config
# make install clean

Once you've installed it, a beautifully large Qt4 Configure icon should appear in the "Other" category of your Gnome 3 Shell. Given many of my GTK+ applications still have crappy icons, having the Qt4 Configure app fit in so well was a pleasant surprise!

Colours

The default GTK+ theme for Qt looks passable, but Gnome 3 uses a whiter shade of pale. This is most noticeable between the title and menu bar in Qt applications.

You can correct this by clicking "Button Background" and "Window Background" under "Build Palette", and slotting in the following values:

  • Red: 239
  • Green: 235
  • Blue: 231

To get the right shade of blue for selected menu items, click "Tune Palette..." under "Build Palette", then choose "Highlight" under "Central color roles". Slot in the following values:

  • Red: 74
  • Green: 144
  • Blue: 217

I derived these colours from using the GColor2 utility, so they may be approximations. I can't tell the difference!

Fonts

For better or worse, Gnome 3 uses Cantarell for its default font. To get Qt applications to match, set the font to "Cantarell" on the "Family" dropdown box under the "Fonts" tab.

Update

Curiously, I had to go through this rigmarole on my Fedora 16 x86_64 tower, but on my MacBook Pro running Fedora 16 i686, Qt had the right colours set for Gnome 3 by default.

I've since discovered it has to do with installation order. If you install Qt4 Configure before any Qt applications such as VirtualBox, Amarok or Opera, the Gnome 3 colours will be included by default. Interesting!


Updating your UTS transport concession sticker

UTS For those of you with existing student cards wishing to embark on a grand quest to update your transport concession sticker:

  1. Enrol into at least one semester of subjects.
  2. Go to this form site and enter your student details.
  3. Log into My Student Admin and click the ID Card tab.
  4. Click "Email my enrolment details for ID card".
  5. Wait five minutes or so, then check your student email.
  6. Print the PDF attachment, tick the boxes and sign your name.
  7. Hand the form into Student Services on campus and get your sticker.

Clear as mud!


Labelling an ext2, ext3 or ext4 file system

Icon from the Tango Desktop Project

The easiest method (from experimentation this evening!) is to use the e2label command. For example, to set the label of the first partition on the /dev/sdc drive:

# e2label /dev/sdc1 yournewlabel

At this rate, I'm thinking I should just start another site for just Linux tips. Nah ;D


The partition is misaligned by 3072 bytes?

Getting this error in Red Hat's Palimpsest (Disk Utility)? Use gdisk to define partitions first, then you'll have no problems :).

The problem

Starting with their larger capacity, multi-terabyte/tebibyte drives, Seagate and Western Digital have moved from a 512 byte sector size to 4 kb. The benefits and tradeoffs of this new low level format is beyond the scope of this post; suffice to say it wrecks havoc with certain drive formatting tools!

If you attempt to format one of these newer drives in Palimpsest, you may receive an error similar to this:

The partition is misaligned by 3072 bytes. This may result in very poor performance. Repartitioning is suggested.

Technically the drive is completely usable in this state, but you'll pay a hefty performance penalty.

The solution

At the time of writing this post, both GParted and Palimpsest have trouble with these drives, but gdisk can handle them. Gdisk is a command line based disk editor that works on GUID GPT drives.

I shouldn't need to tell you to back up your data and quadruple check you're performing operations on the right drive. Please be careful!

  1. Install from your package manager (no, really?)

  2. Launch gdisk as root with the device path of your new drive; you can find that out from Palimpsest's "Device" label. It'll look something like this:

    # gdisk /dev/sd[x]

  3. Type n for new partition, and accept the defaults, assuming you want a partition that takes the entire drive.

  4. Type "w" to write the changes.

Now you can format the drive with any tool you wish!


Exception in thread "main" java.lang.NoClassDefFoundError

Icon from the Tango Desktop Project

In response to my previous Java post, I got a DM on Twitter from another university student asking if I'd come across the above error before. Often I do, when I'm programming in a dazed stupor at 3am, and I've done this:

% javac Something.java
% java Something.class

Instead of this:

% javac Something.java
% java Something

The error can be caused by any number of factors, but 99% of the time it's because of this. Much hair ripping has resulted from it!

(It turns out this was the problem. Glad I could help ^^)


Tweaking the SeaMonkey UI

I've had a surprising number of emails and tweets from people asking about my move to SeaMonkey, so I've decided to write a few posts about how I tweaked it to work for me. This is the first, on messing around with the interface :).

Simplifying the interface

Despite its modern core based on Firefox, SeaMonkey's user interface is still derived largely from Netscape Communicator. It can be easily tweaked to resemble contemporary browsers such as Firefox and Chrome though if you prefer.

  1. Right click the Navigation toolbar and choose Customise...
  2. Click Use Small Icons
  3. Choose Icons from the Show listbox.
  4. Drag the Search button off the toolbar
  5. Drag on the Search box
  6. Boom!

If you're a Chrome user, you can skip step 5 and use SeaMonkey's shortcuts for search! You can either type "g [terms]" into the navigation box for a Google search, or enter any terms and choose the "Search Google for [terms]" that appears.

Modern theme

Aside from having retro appeal that you'd be a fool to not take advantage of, I think SeaMonkey Modern it still has real class, particularly in the mail application.

  1. Go to the View menu
  2. Choose SeaMonkey Modern under Apply Theme
  3. Restart, boom!

Using userChrome.css

Many of the userChrome.css tricks I blogged about for Firefox back in 2010 work with SeaMonkey too. If you haven't made a userChrome.css file yet and really want to customise SeaMonkey to an extreme:

  1. Open your SeaMonkey profile folder
  2. Create a folder called chrome (ironically enough!)
  3. Create a file within chrome called userChrome.css

Below is my file. I err on the side of minimalism, so you may want to adjust to your own tastes!

/* RENDER PRIMARY FONT MORE COMPACT */
* {
    font-size: 10px !important;
}

/* MONOSPACE FONT FOR LOCATION BOX */
#urlbar {
    font-family: monospace !important;
}

/* MERGE STOP AND RELOAD BUTTONS
   STOP MUST BE PLACED BEFORE RELOAD TO WORK */

#stop-button[disabled="true"],
#stop-button:not([disabled]) + #reload-button {
    display:none !important;
}

/* HIDE SUPERFLUOUS ELEMENTS */
.autocomplete-history-dropmarker,
.search-go-button,
#star-button,
.tabs-closebutton,
.tabs-newbutton,
.toolbarbutton-menubutton-dropmarker,
tooltip {
    display:none !important;
}

All done!

Part two I'll be tacking importing and extensions, stay tuned! ^_^