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.

Thursday, 17 October 2002

Internap, Firewall, MT upgrade

darkness @ 05:42:53

Was awoken this morning by a call from some number I didn’t recognize. Then another call shortly after from my co-worker. I answered the second, and he was on the phone with the first. The first call was Internap NOC calling to tell me my circuit just dropped. This puzzled me a bit, as last I heard it was still with the installation coordinator and not passed over to the NOC yet. I was also pissed because I purposely avoided these people, and we weren’t even using the T1 yet, and it was early (like 1130), and now other people were calling me to see if I need to talk to the people I was trying to avoid in the first place ARGH ARGH ARGH.

After calming down a bit I first checked the firewall at work. It had been up 17m. The answer was obvious: it had been rebooted. I merely needed to catch the culprit, a person who took it upon themselves to understand what needs to be rebooted and what doesn’t, and what works and what doesn’t. I called my boss at the office and naively asked, “can you reboot the firewall for me?” Naturally, he said “I just did.” Busted! Tongue-lashing ensued. He agreed to call me next time. I found out that he needed to get to an online auction. My ass.

Then I checked my e-mail and found, while I slept and snored, the circuit had tested clean for 24 hours (Internap: we keep pinging until we go 24 hours without an error) and so had been passed over to the NOC without a call to me. I’m not really upset about this, just surprised. So I call the NOC, calm them down, and inform them of an outage later on in the evening. No problems.

I did switch out the firewall with the new Athlon system. Seems to be working fine thus far. BTW, old firewall that was rebooted (above story) locked up like it had been within about 30m of booting; prior to that it had probably been running 24h without incident. The S508/FT1 (ISA card) we were using is no longer in use, and has been replaced by another S514/FT1. So there are now two of those in use in that box. Noticed that several USB devices, ide2, ide3, and eth0 were all on IRQ 9, so I opted to change that: told the BIOS to move PCI slots 1/5 to IRQ 14 and disabled USB. Now that I look at /proc/interrupts, though:

[root@rand root]# cat /proc/interrupts 
           CPU0       
  0:   19391669          XT-PIC  timer
  1:        491          XT-PIC  keyboard
  2:          0          XT-PIC  cascade
  5:       5935          XT-PIC  wanpipe2
  8:          1          XT-PIC  rtc
 10:    6673503          XT-PIC  wanpipe1
 11:     929167          XT-PIC  eth1
 14:    4756336          XT-PIC  ide2, ide3, eth0
 15:          1          XT-PIC  ide1
NMI:          0 
ERR:          0

My Ethernet card is being stalked by ide2 and ide3. Maybe it’s Al Queda. (There we go, now I’m on Echelon. Hi, boys!)

Did a bit of rewriting of firewall rules, made sure some things that weren’t working worked, set up DHCP server. Need to work on pipt some still. It has things ranging from annoyances to bugs that probably should be fixed. Shouldn’t be too difficult, either.

Bad practice tonight. We have too many players to fit all on one team, so I got stuck on the opposing team a bunch. Nothing like getting ass raped by your friends. Lost hunted miserably, too, and I was the hunted. Terrible. Practice on that map needed.

I wasn’t real motivated to code tonight so I upgraded to Movable Type 2.5 instead. I guess I’m glad that I’m no longer “spam pinging” weblogs.com. The upgrade procedure wasn’t too bad, but the documentation I was reading seemed to imply no mod_perl stuff, which seems silly. Especially silly, since a bunch of things (trackback, xmlrpc) can now be run from mod_perl directly like the main CMS and comment modules were. (Note that I’m no mod_perl expert, so what I’ve just said might not make sense to you. Check out the mod_perl documentation in MT 2.5 and look at the Apache config changes from 2.21.)

I’ve changed time zone stuff yet again. I think it’s correct now, with help from the DateTags plugin for MT. If I ever change time zones I’ll have to go back and change the templates, since I’m just using the MTDaylightOrStandard tag, and in the process all my old entries will probably get fucked. So I can never leave EST/EDT.

Also had to do some upgrading of my RH 7.1 box for the MT upgrade. Needed Perl 5.6.1, Locale::Maketext, and I18N::LangTags. I took the Perl package from RH 7.3 and it (surprisingly) installed fine, but then I later found I would need to upgrade Apache from RH 7.3, db3, mod_perl, and install the perl-CGI and perl-DB_File packages. Surprisingly, though, this all installed without a message like “perl is required by <every fucking package on your system>”.

I went ahead and installed RPM::SpecFile too, since I wanted the cpanflute2 that comes with it. The cpanflute2 that shipped with older RPM RPMs doesn’t support --noarch or --buildall, I don’t believe. I bet it doesn’t do dependencies correctly either. (Or maybe dependencies are really a function of RPM and its scripts. I think this is the case, actually.)

Wednesday, 16 October 2002

Internap line problems, spinning, coding

darkness @ 08:01:31

Got a call from our install engineer at Internap. He said that last night (really this morning) the line tested for some errors. It sounded like a small number of errors to me, but he said they were going to submit the line for testing to the phone company; at least, I assumed the phone company. Someone is testing our line. To make a long story short, broken firewall is still in place, hopefully to be swapped out tomorrow if the testing runs clear. Amusingly broken firewall stayed up all last night and all of today.

I was playing with the Internap line yesterday, doing some pings and traceroutes, and I can’t say the results were really that impressive. I may have hit Allegiance at a good point — indeed I had problems with them today — but at the time I was testing I was sometimes seeing lower latency from Allegiance than from Internap. I guess we’re really moving to Internap for reliability, though; it’ll just be a plus if we can get lower latency.

Since I didn’t have to go to work this evening to install the new firewall I was able to code. I couldn’t really concentrate on coding for a lot of the day. I ended up spinning about an hour set of all my trance-ish records, which turned out surprisingly good. I need to complete this project so I can have others listen to me play and tell me how much I suck.

Finally coding hit me in the early evening and I was able to crank out SimpleConsumer. I still have need to fix the interface between SimpleProducer and SimpleConsumer, since I feel like SimpleConsumer is checking the state of SimpleProducer with SimpleProducer.waitForMoreData (). To rectify this, I think I’m going to make a method on SimpleProducer that waits for data if none is immediately available, then returns whatever data is available. I thought about implementing a whole publish/subscribe model, since that seem to fit so obviously, but that would probably require a lot more work than I need to do for little or no benefit. This way is the simplest thing that could possibly work, I think. I hope. I will say that, due to all the work done in SimpleProducer and CircularBuffer, SimpleConsumer was really short.

Another potential problem is two methods that are useful to several test classes, but don’t necessarily belong in a parent class (”Y is a special type of X” doesn’t hold in this case, at least not in the terms I’m putting it to). Java Design seems to indicate that it’s OK to christen these “utility methods” and make them static methods of some utility class; its one restriction is that this utility class not be subclassed, which is fine. OTOH, I seem to recall reading somewhere on PPR that this was something like a code smell. I’ll probably end up sticking them in a utility class, but I wouldn’t mind at least coming up with an alternative first.

You know, for a “web log” I don’t have many links to the “web” here. They’re a bit cumbersome to make, admittedly. Maybe I should make a system whereby I can easily and quickly queue a page to be talked up when I make my web log entry. Yeah, I’ll Just C-x 4 f and load the buffer with the URLs up in Emacs, then make it so I can open them in Mozilla from Emacs…

[Delusions of grandeur proliferate in darky’s head before being squelched by a need for sleep.]

Tuesday, 15 October 2002

Fun with hardware

darkness @ 08:09:30

Got the new Internap T1 connected to a new Sangoma 514/FT1 (PCI T1 serial card with built-in CSU/DSU; in other words, straight from the demarc to the card). Working great, and though the firewall keeps locking up user space, I was able to power it off (no clean shutdown), stick the card in, boot it up, and basically it worked. I had a little oopsie where the card didn’t get an IRQ because I still had the BIOS — yes, the BIOS — configured to think there was a PCI IDE bus master controller in that slot. Another reboot, though, and we were off to the races.

After I got the Internap T1 up so they could test it (which I think means “ping your serial side IP really fast”) I started building a new firewall. I selected an Asus A7V266-E (IIRC; either A7V or A7M) and an Athlon which runs at 1600MHz. What really shocked me is that I was basically able to get this board to work on the first try. Usually I have to end up mucking with something, changing BIOS settings, fucking with jumpers, reseating processor, getting new memory, etc. The only thing I had to do on this board was download the manual so I could figure out where to plug in the LEDs and such. It’s still up and running, so I must not have screwed up too badly. Or so we hope; the real test will be when I stick the T1 cards in there and replace the old firewall with this new firewall tomorrow.

I did a Red Hat minimal install. It was something like 260 packages, 450MB. Included some things I felt were a bit questionable, like audiofile, but I presume it was used by some management/configuration tools they feel the need to include in a minimal configuration. I immediately put APT on the box and now I’m happily installing things as I come across them. All the Perl RPMs I built for pipt installed from my custom package repository, and their dependencies even worked. Seriously, if you need to package some Perl modules, use cpanflute2 (see yesterday’s entry).

Did some coding tonight. A last bit of refactoring on code created by my first engineering task, then went on to creating the test for my second task. The test code for the second task looks much nicer than the first test case I wrote. Indeed, they will likely end up sharing some code. I just realized, though, that this most recent test case assumes that the first (only other) test case I’ve written has already run and completely successfully. If the class that test case tests is not running correctly, this test will fail as well. Probably not bad. I could probably either use a method for specifying dependencies between tests (not likely) or maybe I should combine them into one TestCase class. XP leaves out a bit about how your test cases should actually be constructed. Somehow I got it in my head that every class has a corresponding TestCase class when using JUnit. Then I remember that I was reading about how ParallelInheritanceHierarchies are a code smell. Oops, just spotted ExpensiveSetUpSmell. Me thinks I have a bunch of refactoring ahead of me, not including what I think might be some broken interfaces I’ve based my Producer class on. Sigh.

Listening to “Romeo and Juliet” soundtrack. I love this album.

« Previous PageNext Page »

Powered by WordPress