ubuntu

Change the Default Print to File To PDF in Ubuntu Hardy Heron

In Ubuntu Hardy Heron there is a new printer driver that will print a webpage as a PDF file. It's pretty useful, but unfortunately it's set to print the page as post script format by default. While I appreciate post script, it's not that compatible for other people, so I usually want to make PDF documents instead.

To change that setting to PDF, navigate in Firefox to about:config, and search for the setting called "print.print_to_filename". Double click on it, and change the value to a more useful name than mozilla.ps, and change the extension to .pdf. I changed the setting to "Printed Page.pdf"

From there you should be all set.

Now, if anybody can figure out how to make the title of the webpage populate for the name of the saved file, we'll be all set.

Wake Your Computer by USB

I recently began using my laptop at my desk with a USB keyboard and mouse, and I thought I would explain how to set up Ubuntu so that USB peripherals will wake up your computer from sleep mode. This is convenient if you have your laptop set up such that the lid is closed and inaccessible.

In Ubuntu, the way to set this up is to edit the file located at /proc/acpi/wakeup. To see the current contents of this file do this:

% cat /proc/acpi/wakeup
Device S-state Status Sysfs node
P0P2 S4 disabled
P0P1 S4 disabled pci:0000:00:1e.0
MC97 S4 disabled
HDAC S4 disabled pci:0000:00:1b.0
P0P4 S4 disabled pci:0000:00:1c.0
P0P5 S4 disabled pci:0000:00:1c.1
P0P7 S4 disabled
P0P8 S4 disabled
P0P9 S4 disabled
USB0 S3 disabled pci:0000:00:1d.0
USB1 S3 disabled pci:0000:00:1d.1
USB2 S3 disabled pci:0000:00:1d.2
USB3 S3 disabled pci:0000:00:1d.3

EUSB S3 disabled pci:0000:00:1d.7
P0P6 S4 disabled pci:0000:00:1c.2
SLPB S4 *enabled

This shows you a number of devices, most of which I don't claim to understand. The ones to notice are the USB ones, which you will see are disabled by default.

Once these are toggled on, your computer will wake up from sleep when USB peripherals are used. To toggle one of these on, as root, run:

echo "USB0" > /proc/acpi/wakeup

This will toggle USB0 from disabled to enabled. To check this, run cat /proc/acpi/wakeup again. You should see that it's enabled, and you should be able to test this by suspending your computer.

This will set up your computer to wake up from USB...for now. To make it work after your computer has been restarted, you will need to write a short init script named wake.sh with the following contents:

#!/bin/bash
echo "USB0" > /proc/acpi/wakeup

Save this file to /etc/init.d, and make it executable by running:

chmod +x wake.sh

Finally, once this file is in /etc/init.d, and is executable, as root run:

update-rc.d wake.sh defaults

That will make init know about the file, and run it at startup. Happy awakenings!

source: http://ubuntuforums.org/showthread.php?t=711747

Install Citrix In Ubuntu Hardy Heron

For a while there, I was struggling to get the Citrix client installed on my computer. It was frustrating, and I put hours into debugging it, and trying to get it to work. In the end, I took a circuitous route, installing VirtualBox in Ubuntu, Windows in VirtualBox, Firefox in Windows, and finally Citrix in Firefox.

Last week, I took another stab at getting this done, and for some reason it went very smoothly. To install Citrix in Ubuntu Hardy Heron:

  • Begin by downloading the Citrix client as a .tar.gz.
  • Next, unpack the install file using the terminal by running:
    sudo tar xvfz en.linuxx86.tar.gz

  • Change into the Citrix directory, and run
    sudo ./setupwfc

    This will begin the install script. As it proceeds, simply allow the default settings, and you should be good.

  • The final step is to install the root certificates. To do this, attempt to start a Citrix program, and it may fail, reporting an error message. In the message, it will tell you what certificates it needs installed. Go to this website, and download the certificates the error message informed you that you need by right clicking their download links, and selecting "Save as..." Once those are downloaded, rename their extension so they are .crt files, and move them to
    /usr/lib/ICAClient/keystore/cacerts

  • Restart Firefox, and you should be good.

Thanks to Skarh for this how to.

Remap Caps Lock as Backspace in Windows and Linux

A while back my wrist started hurting from reaching for the cursed backspace key. I was making too many mistakes. My solution was to remap the caps lock key on all the computers I use to act as an additional backspace key. How did I do it? Well, I'm glad you asked. I'll tell you.

In Windows
EDIT: I noticed that the picture doesn't have all the detail you need. The easier way to do this, is to download the registry key attached to this post, and to right click it, selecting merge. After that, restart the computer, and you should be all set.

To remap the caps lock to function as a backspace key in Windows, one must edit the registry keys. To do that, go to Start > Run..., and type in regedit. In the editor that opens up, navigate to the key shown in the picture below, and create a new key named Scancode Map of the type REG_BINARY. Give it the value shown in the picture, restart, and you're set. If things get wacky, delete the key and try again.

In Linux
I have tested the following in Ubuntu 7.04, 7.10 and 8.04. Start by opening a terminal, and running the xev program. Once that is running, press the caps lock key, and it will tell you the numerical value of that key. For example, my output from that command looks like this:

mlissner@opal2% xev
KeyPress event, serial 28, synthetic NO, window 0x4800001,
    root 0x59, subw 0x0, time 2775892, (373,636), root:(376,685),
    state 0x0, keycode 66 (keysym 0xff08, Caps_Lock), same_screen YES,
    XKeysymToKeycode returns keycode: 22
    XLookupString gives 1 bytes: (08) "
    XmbLookupString gives 1 bytes: (08) "
    XFilterEvent returns: False

In there, you will see the keycode for the capslock key, in my case, number 66. Using that, create a file in your home directory called .Xmodmap, and put the following in it:

!
! Make the caps lock button a backspace button
!
remove Lock = Caps_Lock
keycode 66 = BackSpace

Once that is done, the next time you log in, your caps lock will function as a backspace. The only remaining problem is that it still does not have the auto-repeat function that backspace should have. To fix that, run:

xset r 66

That will make things work properly, but you need to run that every time you log in, or else it won't work properly. To fix that run:

sudo gedit /etc/X11/Xsession.d/50x11-common_determine-startup

And add xset r 66 to the bottom.

That should do it.

Source: http://ubuntuforums.org/showthread.php?t=369402