diving into python

I decided Mark Pilgrim’s “further reading” program was intriguing enough to take a whack at building one.

To add to the fun, why not do it in python?

So the most basic step is to look at the logfile and pull out referers (yes, it’s spelt wrong but it looks right: usage and habit).

To that end, I found a script that purports to do what tail -f does.
ASPN : Python Cookbook : tail -f in Python

Description:A simple implementation of the standard UNIX utility tail -f in Python.


import time
while 1:
where = file.tell()
line = file.readline()
if not line:
time.sleep(1)
file.seek(where)
else:
print line, # already has newline

Looks simple, alright. It doesn’t work.

For one thing, there’s nothing to open a file in there. file = open(“/usr/local/weblogs/httpd-access.log”) would be useful. And we need to do that outside the while block: we open the file, seek to the end, then wait for new stuff to appear (for while not line to be false), then print or do whatever to what we find there.

I’m still trying to figure it out: what seems most worth figuring out is how to delimit a file on newlines instead of by characters since I am going to examine the file line by line.

When will I ever learn that most of the “helpful” scripts and code fragments rarely are?

filling the missing PCI devices

PCI Vendor and Device Lists

This page is primarily intended as an engineering resource for people who need to deal with computers built around the PCI bus. It’s reason for being is that there is no other centralized database of PCI device IDs. This database is entirely user-supported; all the data has been, and continues to be, furnished by those working in the PCI market. Feel free to add info for the use of others!

This is one of those things you find and you’re just glad someone took the time to do it. If you have any “unknown card” messages in your dmesg output, you can find out what they are.
Continue reading “filling the missing PCI devices”

find out about missing PCI bus entries

PCI Vendor and Device Lists

This page is primarily intended as an engineering resource for people who need to deal with computers built around the PCI bus. It’s reason for being is that there is no other centralized database of PCI device IDs. This database is entirely user-supported; all the data has been, and continues to be, furnished by those working in the PCI market. Feel free to add info for the use of others!

screening potential employers

We’ve all heard about how a single typo can knock you out of the running for a job, before anyone even reads anything about you. So what to do when a consulting firm goes to the trouble and expense of designing a website and then misspells “efficiency” and “innovation” in a graphic?

<sigh>

new feature: related pages/sites

Google Web APIs – Home

Develop Your Own Applications Using Google

With the Google Web APIs service, software developers can query more than 2 billion web documents directly from their own computer programs. Google uses the SOAP and WSDL standards so a developer can program in his or her favorite environment – such as Java, Perl, or Visual Studio .NET.

I added a list of pages similar to this one, as defined by Google, on the righthand column. I used the Google API, but this is just a static include for now. When I get more time, I’ll work on something dynamic. And ideally, it would use SOAP instead of java to fetch the data and perl to prep it for display as I do now. That will come later, as well. I just installed the SOAP stuff. That’s as far as I am going tonight.

bsdpak for package/port management

SourceForge.net: Project Info – BSDPak

I was reminded of this tool tonight and was glad to see I had kept a copy of it. It’s similar to portupgrade but it seems to work faster and is less confusing (to me, anyway).

Here’s what it offers:

BSDPak 0.51 - A package management helper for FreeBSD and NetBSD
Copyright (C) 2000-2001 Rodney "meff" Gordon II

Usage: bsdpak-0.51/bsdpak.pl [options]

Where options are one of the below:
--help Help. (What you're reading now.)
--findpackage= Find a package, and its path in ports.
--installpackage= Find a package in ports, and install it.
(IN DEVELEOPMENT)
--upgradepackages Print commands to update your packages to
index versions.
--compare Compare currently installed packages with
the ports index.
Compare options:
--all Print comparison of all packages.
--needupdate Print packages that need updated.
--exceedindex Print packages that exceed the ports index.
--uptodate Print up to date packages.
--index=
Specify a path or url to use for the index file.

By default this program uses /usr/ports/INDEX or /usr/pkgsrc/INDEX
for the index packages, and pkg_info output for current packages.
Current info is not yet customizable (you shouldn't have to change
it.) However, the index path is, by using the previously mentioned
--index option, which may specify a path or URL.

Continue reading “bsdpak for package/port management”