Oct 30 2006

Making HP LaserJet-1020 work with Ubuntu 6.06

Tag: Linux, System Administration, UbuntuDan @ 8:33 pm

I inherited an HP LaserJet 1020 from the previous owner of my house. I found the drivers for Windows on the net and got it working fine, I really liked it (and so did my wife cause it prints quicker than my HP-PSC-1210). However, in June I migrated to Ubuntu 6.06 as my primary OS and couldn’t get it to work with the 1020.

My first attempt was to try the HPLIP drivers however, I noticed the 1020 listed in their unsupported devices page. On further investigation I found a note about it in their FAQ - apparently they consider the 1020 a “non-standard host based printer” and they don’t plan to support it.

Then I found a page on it on LinuxPrinting.org which pointed me to the foo2zjs project which is a linux printer driver for the ZjStream protocol which is what the 1020 uses apparently. Various posts on the Ubuntu forums also direct to this project for 1020 support. This post seems to be the best of the lot.

The process I followed in the end was to download the most current version of foo2zjs and compile and install it from source. This worked but I’m not 100% happy with this setup as it requires uninstallation of the ubuntu packaged version of foo2zjs which also forces uninstallation of the ubuntu-desktop meta package. I also tried to install it using checkinstall so that I could manage the installation using apt/synaptic but the dpkg installation process kept failing reporting that foo2zjs was

trying to overwrite
`/usr/share/foomatic/db/source/driver/foo2hp.xml’,
which is also in package foomatic-db

Here are the exact steps I took in the end, based on the instructions from various places:

  • Build and install foo2zjs
  1.  
  2. wget -O foo2zjs.tar.gz http://foo2zjs.rkkda.com/foo2zjs.tar.gz
  3. tar zxf foo2zjs.tar.gz
  4. cd foo2zjs
  5. ./getweb 1020
  6. sudo make install cups
  7.  
  • Run gnome-cups-manager (System > Adminstration > Printing) and add a new printer. It had already found my 1020 so I accepted the defaults all the way through the wizard.
  • Unplug (if not already) and then plug in the 1020
  • Print a test page (can be found from the gnome-cups-manager printer properties page).

Oct 27 2006

Prevent caching of static content using Apache config

Tag: System Administration, Web DevelopmentDan @ 10:51 am

Sometimes you have static content like a Flash SWF file which you want to prevent browsers from caching. Normally allowing clients to cache this type of content is useful however if you update it not all browsers will immediately fetch the new version.

To force a client to grab the new copy you can use the HTTP headers Cache-Control and Expires. It’s easy to do this in a dynamic page coded with PHP or similar. But how can you do this for static content?

Luckily the Apache server has an extension module called mod_expires which allows us to do this.

Basically mod_expires defines three directives: ExpiresActive, ExpiresByType, and ExpiresDefault.

ExpiresActive is required to switch on or off generation of the Expires and Cache-Control headers. ExpiresByType allows you to specify a expiration rule for a specific MIME type. ExpiresDefault allows you to set up a default expiration rule for all content within it’s scope.

Here’s a small example

  1.  
  2. # Switch on the Expires and Cache-Control headers
  3. ExpiresActive On
  4.  
  5. # Set a default rule: headers will report expiration
  6. # date as 4 weeks from when the page is accessed
  7. ExpiresDefault "access plus 4 weeks"
  8.  
  9. # Flash content is updated often so expiration is
  10. # immediate.
  11. ExpiresByType application/x-shockwave-flash "access plus 0 minutes"
  12.  

Oct 16 2006

Enabling CPU Frequency Scaling on Ubuntu

Tag: Linux, System Administration, UbuntuDan @ 9:01 am

Found an interesting blog entry about explicitly controlling CPU frequency on Ubuntu/Linux.

The system will by default automatically scale the CPU speed and does a good job, however some users may like to do this manually themselves.

Enabling CPU Frequency Scaling « Ubuntu Blog


Oct 09 2006

Ubuntu feature on More 4 News

Tag: Linux, Open Source, UbuntuDan @ 8:39 am

Found this via the Ubuntu forums. It’s a More 4 (UK Satellite/Cable TV channel) news feature on Ubuntu and Mark Shuttleworth:
TV interview with Mark ‘Ubuntu’ Shuttleworth


Oct 02 2006

My Must-Have Applications For Ubuntu

Here’s a list of some of my favourite or most relied-upon applications on Ubuntu. It’s not exhaustive but it’s a start. It doesn’t include extras like multi-media codecs or any of the sort of things you can get easily with something like EasyUbuntu. The lists arranged by purpose and are ordered alphabetically not by preference. Some things are not available in the Ubuntu repositories and are marked as such.

Desktop

  • deskbar-applet
  • gnome-keyring-manager
  • kde-style-polymer (from external source - makes QT apps look ok on gnome, see my post here)
  • MSTCoreFonts
  • nautilus-open-terminal
  • nautilus-scripts:
    • nautilus-script-collection-svn (subversion shortcuts)
    • nautilus-script-manager
  • skype (only beta 1.3 works, needs kde-style-polymer or looks ugly, get it from www.skype.com)
  • Tomboy (desktop notes tool)
  • xnest (for nested X logins)

Development

  • apache2
  • emacs-snapshot-gtk (emacs for the gnome desktop)
  • JEdit (from external jedit repo http://dl.sourceforge.net/sourceforge/jedit)
  • java:
    • ant
    • sun-java5-*
  • meld (visual/graphical diff tool)
  • mysql:
    • mysql-server
    • mysql-client
    • mysql-admin (note a wrapper script is needed as a bug workaround on this, can’t remember the bug link just now)
    • mysql-query
  • .Net (just listing the basic dev packages here)
    • mono-devel
    • monodoc-manual
  • php5:
    • php5 (basic setup for use with apache)
    • php5-* (choose whatever extra modules you need)
    • php5-cli (command line version)
  • python
  • ruby
    • ruby
    • irb
    • lib*-ruby (pickup any of the extra packages you need)
    • ri
    • rdoc
    • rails
  • subversion
  • vim-gnome (gvim)
  • vmware-server

Networking

  • Avahi (zeroconf/bonjour)
    • avahi-daemon
    • avahi-utils
    • libapache2-mod-dnssd (to auto-advertise apache2 sites available on your machine)
    • service-discovery-applet
    • libnss-mdns
  • ethereal
  • firestarter (basic firewall manager)
  • gftp (sftp and ftp client)
  • NetworkManager
  • rdesktop (Remote Desktop and Terminal Services Client)

Sound & Multimedia

  • banshee music player
  • f-spot photomanager
  • gnomebaker (cd-burner)
  • gxine (media player)

Oct 02 2006

Printing to a networked HP Color Laserjet from Linux

Tag: Linux, System Administration, UbuntuDan @ 10:32 am

At work we have a HP Color Laserjet 2840, here are some rather brief notes on how I got it setup with Ubuntu:

  1. Install hplip from the Ubuntu repos
  2. Install PyQT so the HP admin tool works
  3. Install SNMP package for network support (is this required?)
  4. Run the Gnome Cups Manager Tool (System > Administration > Printing)
  5. Select Add Printer, choose HP JetDirect in the Network Printer select list, in the text box marked ‘Host’ input the IP or hostname of your printer.
  6. Print a test page and everything should be fine

A helpful tutorial is available at http://hplip.sourceforge.net/ in the Installation Instructions section which guides through installation using the CUPS admin interface instead of the Gnome Cups Manager.