—
Tue,
03
Jan
2006
—
How do I set up an HP printer on Debian Etch?
HP has led the printing industry in providing open source software to support its printers. This makes it really easy to access advanced features of an HP printer in Linux. The difficulty for me was with the terminology:
- CUPS: UNIX printing system. CUPS manages printers and print jobs. Software talks to CUPS, and CUPS talks to a printer.
- HPLIP: HP system for running HP devices. HPLIP creates a CUPS backend to talk with a specific printer. It can also manage scanning, faxing, and copy functions of those printers.
- HPIJS: HP printer driver. Despite the name, it runs some HP laser printers too.
- Foomatic: Connects CUPS to the printer driver (HPIJS in this case), using a PPD file.
- PPD file: A Postscript Printers Description file, which describes a postscript printer to CUPS. Despite the name, it appears that non-postscript printers also need PPD files to work with CUPS.
Before the printer will work, all these components need to be installed and working. These commands should pull in all the necessary packages:
aptitude install cupsys cupsys-bsd
aptitude install hplip hplip-ppds
aptitude install foomatic-db-hpijs
Then setup the printer using cups and the hplip backend:
- Go to http://localhost:631
- Select Manage Printers
- Select Add Printer
- Select the hp device backend for your printer, not the USB or parallel backends. The URI should start “hp:”.
- Select the HPIJS driver (PPD) for your printer. If you installed the hplip-ppds, your specific printer should be listed.
- Print a test page.
- Once CUPS sees your printer, you can use hp-toolbox to access your printers advanced features. hp-toolbox can not see your printer if CUPS can’t see it.
Tips for solving problems:
- Does “cat /proc/bus/usb/devices” show your printer? Check your USB connection.
- Does “hp-probe” show your printer?
- Does “hp-info” show correct information about your printer?
- Does “hp-toolbox” see your printer?
- Check that CUPS is set up to use the HPLIP queue.
- If you increase the log level to “debug” in /etc/cups/cupsd.conf and restart cupsys, do you get any better error messages in /var/log/cups/error_log?
- CUPS has the habit of outputting lines of useless messages after it describes the true cause of the error.
- Read /usr/share/doc/hplip/README.Debian.gz
—
Wed,
26
Jan
2005
—
pdfLatex fonts look like they are raster, instead of vector fonts
The symptoms here are that the Computer Modern Fonts look bad at most resolutions, though they print fine. The fonts in the DVI or PS files look fine when generated with latex and dvips, but ps2pdf or dvipdf both produce the same poor output that pdfLatex does.
I have only noticed this problem on my Debian Testing (Sarge) install.
As root, you need to run the command updmap. Then as your normal user, you need to run latex and dvips once. You might notice that dvips generates more output than it used to. Your fonts should look fine now.
Thanks go to Byron Clark for helping me figure this out.
—
Sun,
14
Mar
2004
—
How do I use Emacs without X?
To start Emacs without a GUI window, use the -nw (no window) flag on the command line.
To access the menus without the mouse, use M-`. In non-emacspeak, that means press Esc, let go, then press the backtick. You will get a list of the menu functions in the minibuffer that you can scroll and select with the Enter key.
—
Mon,
26
Jan
2004
—
How do I set up a Java development environment on Debian?
Sun does not allow redistribution of their JRE or SDK. The free VM’s for Java are behind by many versions. For that reason, some work has to be put in to get a usable Java development environment on Debian. I am using Debian Testing (Sarge).
There are two methods to get a Java environment set up: use the Blackdown Debian repository, and roll a .deb with Sun’s SDK.
Blackdown’s Debian repository is a hassle free way to install a Java SDK. The downside is that it lags behind Sun’s official SDK in fixes and features, and the repository is not always available or maintained. You can get information about the repository from www.blackdown.org. Using the repository takes three steps:
- Add
deb ftp://ftp.tux.org/java/debian/ sarge non-free to
/etc/apt/sources.list
- Run
aptitude update
- Run
aptitude install j2sdk1.4 to get the SDK and aptitude install j2re1.4 to get the JRE
Using the latest official release from Sun takes a bit more work, but Debian has made some tools to stream line it a bit:
- Make sure you have “unstable contrib” in
/etc/apt/sources.list
- Run
aptitude install java-package
- Download the J2SDK as a binary file from Sun’s web site. Be careful not to get the bin that unpacks into an RPM.
- Run
fakeroot make-jpkg <j2sdk package> to make a .deb package containing the SDK.
- Run
dpkg -i <SDK.deb> to install the package.
- Run
aptitude install sun-j2sdk1.4debian to get the Debian specific components.
That should give you a fully functional Java development environment. You might also want to install ant. I was impressed that Debian took care of installing the Java plugin for Mozilla for me.
Props go to Byron Clark for giving me these instructions.
—
Fri,
07
Nov
2003
—
Unison
I installed Unison to keep /home on my desktop and laptop synchronized. I am very happy with it, but I had some trouble getting it to work the way I wanted to. I wanted it to preserve permissions and ownership across my two systems, and this is not its default functionality. Here are some tips:
- Install Unison on both systems.
- Make sure that the user names, user numbers, group names, and group numbers are the same on both systems for any user or group who might own a file which you might synchronize. Edit /etc/group and /etc/passwd for this.
- Create a preferences file for each synchronization profile which you want to preserve ownership and permissions. The first one will be the default profile, called “default.prf” Put default.prf in “/root/.unison/ ” on the machine which will be initiating the synchronization. It’s contents should be:
# Unison preferences file
owner = true
group = true
perms = -1
- Run unison as root so that you have the necessary privileges to copy and edit files of any user.