I moved my pages about publications and projects into the blog. The contents of the publications are still at the old place (and therefore in the same style as when I wrote them). I have not decided yet if I will import the contents of the publications into the blog or not. Importing the contents means everything would have a consistent style, not importing it would mean the content is as “original” as possible.
Month: October 2009
More problems with CUPS (passing env variables)
Saturday I had to print a postscript file. The file was generated out of a template which I wrote myself by hand several years ago. There I use a non-standard PS font which can not be changed. The font is not embedded, and I can print it via ghostscript by telling it the location where the font files are located (export GS_LIB=/path/to/dir1/path/to/dir2). Now that I switched to use CUPS as my printserver software, I had to teach it to set this for the call to gs (via foomatic). Unfortunately I failed to get it working via the CUPS config.
I added “SetEnv GS_LIB /path/to/dir1:/path/to/dir2” to cups.conf and restarted CUPS. This did not work. I added “PassEnv GS_LIB” to cups.conf, added an appropriate export of GS_LIB to /etc/rc.conf (just to make sure… I still had the SetEnv in cups.conf) and restarted CUPS. This did not work either.
As I just wanted to print out something and did not want to spend my time debugging this, I put a workaround into place: I moved gsc to gsc.bin and created a little shell script as gsc which sets the variable and starts gsc.bin.
At the next update of ghostscript this will break my printing (if I forget that I have this workaround in place), so I should try to get some time to fix this. Maybe I can fix this by adding “env GS_LIB=…” to the call of gs in the ppd, but this seems more like another workaround to me, than a real fix.
The documentation of CUPS is not very good (CUPS client setup)
Yesterday evening I did setup a CUPS server at home. It was on my TODO list since years. Before I just went downstairs and connected the printer via USB to the laptop/netbook for printing (to pickup the printout I have to go there anyway). It is not the first time that I setup the server side of CUPS, but it was the first time that I wanted to use the CUPS command line utilities instead of the FreeBSD/Solaris printspooler and the native lpr/lp commands.
First I just had a look at some man-pages of the CUPS utilities, in the hope to find some command to tell that any printing should be done via a remote CUPS server. As I did not find anything, I went to the documentation page of CUPS to search there. To me this is some simple config part if you want to print from more than one machine, so I had a look at the “Getting Started” part. This was a total failure. I found nothing related to my problem. After that I went to the “Man Pages” part to search for a command which I may have overlooked. Again, a total failure. The FAQ also does not contain any useful information when you search for “client” or “remote”. In the end I stumbled over the client.conf entry in the References part. After I found this it was easy (and fast, I just added a line in client.conf with “ServerName <server>” and everything worked as I wanted it to work).
The setup in Windows XP to use the CUPS server is easy, just add a network printer via http://<server>:631/printers/<printer> and use the correct printer driver for your printer model. Do not forget to make the application/object-stream in the mime* config files and allow remote printing in the server. No, I do not want to integrate it into Samba, the number of Windows systems is very limited (2 Windows against 2 Unix machines with 14 lightweight virtual Unix machines), so I do not need this.
New food related idea added
Yesterday I had the chance to see an Android phone (the German G2) in action. Part of the demonstration was the scanning of a barcode and the display of what it is and how much it costs in various shops.
Based upon this I had an idea. I added it to my ideas page, see there for more info. In short: scan some product and get similar no-name products (if it is a branded one), or the branded product this is based upon (if it is a no-name product).