Troels Kofoed Jacobsen’s blog


HP LaserJet 1020 on Fedora 10
December 15, 2008, 11:10 am
Filed under: linux | Tags: , , , ,

I have always struggled to get my HP LaserJet 1020 printer to work under linux. Furtunately this is always possible by manually installing the foo2zjs printerdriver and the firmware manually. However, I think this is a horrible solution, as I don’t like manually installed software (usually I make myself a rpm).

Today I then found the Right Solution(tm) (it has probably been there all the time): The hplip package provides a small HP setup utility named hp-setup, which will install the printerdrivers for you. (And set up the printer, but we really don’t want this, because Fedora does this on the fly, when the driver is there — I just removed the entry again). Afterwards I had to restart the printer to load the new firmware. It instantly popped up in Fedora and I were able to print. Tada.

So in other words:

yum install hplip hplip-gui
hp-setup

(You don’t really need the -gui part, only if you don’t like the cli)

Update:
I had some problems with this on Fedora 11. It seems that the correct .ppd file for the printer is not installed. However, it can be found in the package foo2zjs:
yum install foo2zjs

After installing this I got the printer working.
Maybe you have to select the .ppd manually during the hp-setup step. This is found here:
/usr/share/cups/model/HP-LaserJet_1020.ppd.gz

References:
http://hplipopensource.com/hplip-web/models/laserjet/hp_laserjet_1020.html



Configuring Xorg via HAL
December 4, 2008, 7:17 pm
Filed under: linux | Tags: ,

Back in the days you had to configure Xorg using xorg.conf. This had the drawback that it was very static and you had to restart Xorg when plugging new peripherals.

With the new xserver you can use HAL to do the job. In my case I just wanted to add two options to my synaptics touchpad driver. First I had to copy the .fdi file for the driver provided by my distribution (Fedora 10) to /etc/hal/fdi/policy. The original file is found here: /usr/share/hal/fdi/policy/20thirdparty/10-synaptics.fdi.

I edited it to look like the this:

<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
<device>
<match key="info.capabilities" contains="input.touchpad">
<match key="info.product" contains="Synaptics TouchPad">
<merge key="input.x11_driver" type="string">synaptics</merge>
<merge key="input.x11_options.MaxTapTime" type="string">0</merge>
<merge key="input.x11_options.HorizEdgeScroll" type="string">off</merge>
</match>
<match key="info.product" contains="AlpsPS/2 ALPS">
<merge key="input.x11_driver" type="string">synaptics</merge>
</match>
<match key="info.product" contains="appletouch">
<merge key="input.x11_driver" type="string">synaptics</merge>
</match>
<match key="info.product" contains="bcm5974">
<merge key="input.x11_driver" type="string">synaptics</merge>
</match>
</match>
</device>
</deviceinfo>

The changes from the original is just these two lines:

<merge key="input.x11_options.MaxTapTime" type="string">0</merge>
<merge key="input.x11_options.HorizEdgeScroll" type="string">off</merge>

This means that I set the MaxTapTime to 0 and HorizEdgeScroll to off. In an old xorg.conf it would look something like

Section "InputDevice"
Identifier "Touchpad"
Driver "synaptics"
Option "Protocol" "auto"
Option "Device" "/dev/input/mouse0"
Option "MaxTapTime" "0"
Option "HorizEdgeScroll" "off"
EndSection

Now I have both the wanted configuration and hotplugging.



using a ssh proxy with kde
December 1, 2008, 7:07 pm
Filed under: linux | Tags: ,

PROBLEM:
Use ssh socks proxy with kde.

SOLUTION:
Initiate a ssh connection to use for dynamic port forwarding:

ssh -T -D port username@sshserver

If your application supports socks proxies you can use this directly. Firefox can do this. If not, here is a solution: Use privoxy to forward the ssh socks proxy to a http proxy.
First install privoxy for your distribution.
Add the following line in the configfile (/etc/privoxy/config on archlinux)

forward-socks4 / localhost:port .

NOTE: the period, ‘.’, i important. The port should be the one specified when initiating the ssh connection.
Start privoxy and it will start the http proxy on port 8118 (default), which you can configure kde to use in the networking kcm module (and other apps that can use http proxies).

USAGE:
This can be used to secure your otherwise unsecure wifi connection when you are on the road. All you need is access to a ssh server.
This is much easier than using e.g. openvnp.