Printing to a remote printer

Every now and then I’ll enter the computer lab only to find that all the computers are being used – this usually happens when I urgently need to print something before I miss the bus.

Thankfully, the system admins have allowed me the wonders of ssh access. So, printing is relatively simple:

Copy the file to be printed to the server.

scp filename.pdf username@server:.

List all available printers.
lpstat -a

Send your document to the printer.
lpr -Pprinter filename.pdf

Optionally, to save paper, you may print multiple pdf pages on one sheet.
The process is simple: convert the pdf to ps (postscript), use the psnup utility to increase the number of pages placed on each sheet, then convert the pdf to ps.

pdf2ps filename.pdf
psnup -n2 filename.ps (or 2up filename.ps to get two pages per sheet)
ps2pdf filename.ps

KDE DPI Issue

Simple fix:

in /usr/share/config/kdm/kdmrc

Add the “-dpi ” argument to ServerArgsLocal in [X-:*-Core].

Not sure what this does to dual monitor setups.

Sony NWZ-E438F + Video

I recently purchases a Song Walkman which has great video capabilities – provided you know how to encode the video.

It’s not very hard, simply chuck the video into handbrake and let it churn out a Sony Walkman compatible video:
handbrake -i $input_name -o $output_name.mp4 -f mp4 -e ffmpeg -E faac -w 320 -l 240 -b 500

If you don’t have this program, use the following options in any video converter program:
width: 320px
height: 240px
audio encoder: faac
video encoder: ffmpeg
output format: mp4
video bitrate: 500 kb/s

Movies for August 2009

  • District 9
  • I like the science fiction premisis but I don’t like what the trailers hint at: it’s gonna be a long movie (> 2h).

  • Time Traveler’s Wife
  • I think it’s time to give in and watch a sci-fi(ish) romance for a change.

  • The Final Destination
  • Final Destination™ movies have always been fun to watch (if not a bit cliche+silly).

  • Inglourius Basterds
  • No particular reason apart from that it looks like a good action flick (with good acting [hopefully]).

Readline

Just a quick post but the readline library keybindings are very interesting -
you just don’t need the home|end keys anymore. For the uninformed, here’s the
excerpt I’m talking about (man readline):

Emacs Mode
Emacs Standard bindings

“C-@” set-mark
“C-A” beginning-of-line
“C-B” backward-char
“C-D” delete-char
“C-E” end-of-line
“C-F” forward-char
“C-G” abort
“C-H” backward-delete-char
“C-I” complete
“C-J” accept-line
“C-K” kill-line
“C-L” clear-screen
“C-M” accept-line
“C-N” next-history
“C-P” previous-history
“C-Q” quoted-insert
“C-R” reverse-search-history
“C-S” forward-search-history
“C-T” transpose-chars
“C-U” unix-line-discard
“C-V” quoted-insert
“C-W” unix-word-rubout
“C-Y” yank
“C-]” character-search
“C-_” undo
” ” to “/” self-insert
“0″ to “9″ self-insert
“:” to “~” self-insert
“C-?” backward-delete-char

Installing Windows XP in VirtualBox

Not too difficult, here are a few tips to make sure that your experience is flawless.

When configuring the virtual machine, make sure that you

  • enable APIC and ACPI in Settings –> System.
  • create a fixed sized harddisk to improve disk I/O speeds.

After installing Windows XP, make sure that you

  • download the driver for the Intel Pro 1000 network adapater and change the default adapter from PCNet to Intel Pro 1000 in Settings –> Network. For me, this improved network access speed and reduced DNS lookup delays.
  • install VirtualBox Guest Editions which enables seamless mouse integration and experimental Direct3D support by mounting the Guest Editions ISO.
  • if, in the event that Windows Update fails to work, register the Wups2.dll as outlined in the Microsoft Knowledge Base <http://support.microsoft.com/kb/943144>

I extend my thanks to the VirtualBox team for making this so effortless. By the way, anything between 5G – 10G is a good size for your virtual harddisc.

Looking Good…Minimally

Even though my virtual workspace is pretty minimal: dwm+urxvt+screen+irssi+firefox, that doesn’t mean that it can’t look good. Here’s what I’ve done to make my setup visually appealing without adding bloat.

- Change default cursor [http://antonyjepson.wordpress.com/2008/07/07/changing-the-default-x-cursor/]
- Change default icon theme (I choose Tango).
- Change system font (by editing gtkrc-2.0):

#include “/usr/share/themes/Dust/gtk-2.0/gtkrc”
gtk-icon-theme-name = “Tango”
gtk-font-name = “Sans Serif 12″

style “user-font” {
font-name = “Sans Serif 12″
}

Change the background (plenty of sites to choose from)
Add a compositing manager (lightweight xcompmgr+transset or heavy-weight compiz fusion). Of course, I choose xcompmgr.
Change Firefox theme (I choose Dustfox to match my Ubuntu dust gtk theme).
Finally, change terminal defaults (I added a bit of pseudo transparency).

FreeBSD and Arch Linux

I’m still looking for a good distribution for my new desktop and I’m becoming increasingly attracted to FreeBSD. I like the ports system and how integrated it is. I think I will like the community so I’m going to keep my eye on the forums, mailing lists, and IRC for a bit.

Using your Gmail contacts in Mutt

I really enjoy using Mutt as my email client. However, sometimes I have to log
into my Gmail account to view my contacts. Tired of this, I exported my Gmail
contacts and imported them into abook.

Now I can view my Gmail contacts in Mutt.

Here’s how I did it:

(Sorry, no cut and paste instructions.)

* Export your Gmail contacts in the vcard format

* Download the abook source and patch it with the vcard diff (available on the abook website). NOTE: you can also use the vcard2abook.pl script available in the contrib/ dir in the source.

* Import your contacts by invoking abook with the following options: ‘–convert –informat vcard –infile INPUT.vcf –outformat abook –outfile ~/.abook/addressbook’

* Configure your abook (see `man abookrc`). abook has sane defaults so your config file can be very minimal:

set www_command=elinks
set add_email_prevent_duplicates=true

* Next, configure mutt to interact with abook. I added the following lines to my muttrc
set query_command=”abook –mutt-query ‘%s’”
macro index,pager A “abook –add-email-query” “add the sender to the address book”

That’s all :) . Press A while in Mutt to add a contact and Q to query the address book.

Recent Microsoft Developments

Microsoft has been hard at working preparing for the Windows 7 RTM release in October.

Their latest build of Windows 7 is Build 7232. This build was quickly leaked to torrent sites as a VHD (Virtual Hard Disk), just like the previous iterations: build 7201, 7227, 7229, and 7231.

Another important development is the ‘Microsoft Security Essentials Public Beta.’ Although the beta period is over the reception was generally positive and it is something you can look forward to in the near future (~ late 2009).

I look forward to the RTM release of Windows 7 as well as the next beta of Microsoft Security Essentials.