darkness

Friday, 18 October 2002

Printers give me RAGE

darkness @ 20:03:23

Got called at 0950 this morning (after missing a call or two 0.5h earlier) that the customer’s printing stuff I updated yesterday didn’t work. The “raw spool” mode or whatever it was called wasn’t ejecting the last page, for starters, and I didn’t see an option in printconf to send a form feed after the end of the job. I fixed that by switching them to text only printers and turning on the “send FF to printer” and “send EOT (end of transmission to printer” options or some such. That pacified them, until…

I got woken up again at about 1315 with them saying they couldn’t print from Windows. Windows was sending PCL, and the printer kept saying ERROR: job removal requested in lpq -a output. Giving -D1 to lpd didn’t do anything useful, and also spammed so much that if there was anything useful I could easily have missed it. (P.S.: if you want to use -D1 in the Red Hat setup, it would be wise just to run /usr/sbin/lpd -F -D1 on a tty and skip the init script. I think lpd just outputs to stdout/stderr, so I suspect messages after the initial startup of the daemon are not sent to syslog. -F runs lpd in the foreground, so you get the plethora of messages sent to your tty.) Eventually in /var/spool/lpd/lp0/mf.cfg, which is presumably configuration for “magicfilter”, I found:

define(PCLfilter, `reject')dnl
define(PJLfilter, `reject')dnl

among the lines. I changed the reject to text and voila, we’re printing from Windows again. This also fixed a problem with their SCO application and something called “UnForm” which basically prints things in nice little forms (such as invoices) with lines and everything.

After all this, we’re just “pretty sure” that the HP DeskJet 940C is now working. I should have run a test while I had the customer on the phone today, but I had already made him run back and forth to that printer so many times that I couldn’t bear to ask him to go over there once more to see if the printouts looked right.

BTW, why is /var/log/spooler always empty, anyway? Apparently that might just be for UUCP and NNTP stuff, as implied by /etc/syslog.conf (uucp,news.crit)?

I coded for a while. Refactored my CircularBufferTest and ended up collapsing all four of my test*() methods into one method, because they were all so similar. It’s prettier now. I have this BufferUtils utility class that just has a couple static methods, and I still feel bad about it. I should probably stop coding and read more about OO design and “code smell”-type-things for a few hours, just to get them fresh in the front of my mind. Then I can attack some refactoring.

I find myself extracting things that can be extracted, such as a few lines of code or a complex-looking calculation, into their own methods as prescribed by XP’s penchant for keeping things simple, and simple also meaning “easily understandable”. I have some really long method names sometime. I should put up CVSweb and stick the code in it so any actual readers can follow along in my pursuits.

Going to go to Mama Ricotta’s tonight hopefully, now that we know it’s moved. I almost walked into the Indian place that moved into their old place of business before my significant other caught my arm and pointed at the sign. Doh.

APT is my bitch

darkness @ 04:52:29

Had a problem printing simple text to an HP DeskJet 940C. I hate ink jet printers, primarily because they’re so cheap and they seem to have so many problems. I’d prefer a dot matrix, especially when I’m mostly printing text. Anyway, the printer was attached to a RH 7.0 box. I had APT on it, so I pointed it at the RH 7.3 repositories. A few apt-get install LPRng and apt-get install foomatic and such later, I had a printtool that listed a driver for the 940C. Everything seems to be working fine from this end, but it was a big upgrade. I’ll really find out if it worked correctly when the customer arrives in the morning and calls me to tell me their printers don’t work at all.

Been doing some coding tonight. Finished another unit test, unfortunately for a class which was already written (I extracted it and didn’t think to write the unit test first). Trying to get ChangeLog and CVS commit messages to play nice, too, but that’s next to impossible.

I think I just realized that ChangeLog shouldn’t be kept in CVS. Oh, duh. You can generate ChangeLog with things like rcs2log when you’re ready to make a release. I’ll have to try this later.

I’ll expound on what I did WRT ChangeLogs that didn’t work, anyway. I originally was trying to figure out how to keep a CVS commit from Emacs from giving me the last log message. (Incidentally, this requires using the C key (upper case) instead of the c key (lower case) in the *cvs* buffer.) In the process I found log-edit-done-hook, which runs when you’re done editing a log message. There then exists a function, log-edit-add-to-changelog which claims to add a message to the ChangeLog for you after you finish with the message. First, I’m noticing that the log edit window, which splits the frame with the *cvs* buffer, does not disappear when you accept the buffer (C-c C-c); I’m not sure if this is related to log-edit-add-to-changelog or not. Second, if I commit multiple files with the same message, it adds the message multiple times for each file. I can’t even figure out where it loops through each file being committed, though I didn’t look very hard.

Then I’m playing around with vc-update-change-log. It works well enough, but it inserts messages that have already been inserted! I find out later this is because of how rcs2log works: it reads the lines near the top of the change log, tries to figure out a date, then basically queries log entries for all dates greater then or equal to that date.

I’m pretty sure the way I thought of above is probably the better way: don’t keep the file in CVS, and when you make a release just rcs2cvs the whole thing from the first release on.

Set up web stats for this web server. I don’t really want to share the URL, especially since it’s not accessible under this domain. Maybe I’ll add an alias in Apache for the directory tomorrow. I’m getting hits from people that seem to be referred by Google, if I didn’t know better, but I can’t find my page by doing the same searches on Google. Additionally, site:www.codefu.org darkness doesn’t show any results for me. Huh. (BTW, I escaped the above query with the Perl code: use CGI::Util qw(encode); print encode ("..."). I can never remember where that damn URL-style encoding function is. Indeed, CGI::Util says it has no public functions.)

Firewall still up and looking good. No complaints from the office today, or anyone else for that matter. Still need to set up a customer outage notification list; didn’t get around to that today.

Powered by WordPress