Duplex printing for HP Color printers in Ubuntu

In office we have this fast HP Color LaserJet CP3505 printer, that should be able to print on both sides. I installed the driver using some GUI (system-config-printer I think) and everything worked like a charm, except the duplex printing. Trying to enable duplex printing in kprinter, for example, resulted an error “Some options selected are in conflict” as the Duplex Unit was not installed.

The printer setup can be changed (as instructed in this thread) in the CUPS HTML interface, accessible via any browser:

http://localhost:631

1) Choose Manage Printers and Set Printer Options of the printer at hand.

2) In Options Installed change radio button to Duplex Unit : Installed.

3) Click Set Printer Options.
You may be asked for a user name and password. Type in your local login user name and password. Sometimes, as in my case, you may need to input root and the superuser password.

Presumably the same configuration can be done in the GUIs as well, for example:
sudo system-config-printer and tick Duplex Unit in Installable Options tab. (In KDE use kdesu instead of sudo.)

Floppy drive access in Ubuntu Hardy Heron

For those who still need to use floppies, it seems that floppy drives are not fully supported in Ubuntu anymore as there is no out-of-the-box solution that would work.

However, you can always mount the floppy manually:
1) Make sure that the floppy drive is properly connected to motherboard and that (internal) floppy access is enabled in system BIOS.
2) Start Ubuntu and create directory /media/floppy or something similar.
3) Mount the floppy by sudo mount /dev/fd0 -t auto /media/floppy.

You should be able to access the floppy either trough terminal or GUI programs.
Make sure to unmount manually when you’re done to prevent data loss: sudo umount /media/floppy.

Note that the GUI access *does not* work so do not try to access the floppy via Nautilus or Konqueror or such before mounting manually (step 2).

Recovering files from ext3 filesystem with foremost

So you accidentally removed some files on Linux ext3 partition and you want them back.
Here’s a procedure that worked for me:

1) Get foremost recovery tool. In Ubuntu it is in the universe repositories.
2) Unmount the partition where the files were. If it’s the root partition (say, /dev/sda1) , you cannot unmount it. In this case use Ubuntu Live CD or such to reboot into a system that does not mount the /dev/sda1.
3) Run (note that you must run with sudo):
sudo foremost -i /dev/sda3.

foremost will create a directory called output where all the recovered files are stored, separated in subdirectories according to filetype. If you need to recover only certain files, use the -t option:
sudo foremost -t jpeg,gif -i /dev/sda3
would only recover jpeg and gif files.