Mixing it Up

This is from my, “Really abstract thoughts” file…

Often you try to recruit leaders internally, because they’re familiar with your existing procedures. On some level this is good. But “familiar with your existing procedures” also means that they see things with blinders on. Sometimes I think you have to bring in someone without any of that institutional knowledge, to shake things up and move you in a new direction.

For example, there’ve been a rash of thefts from the library. People will sit there working with their laptop, get up to go the bathroom, and their laptop is stolen. (Part of this, of course, is their own negligence.) I couldn’t possibly know the full story, but it looks to me like CP is content with just writing reports for each theft and letting insurance handle it.

Why not set up a “sting” in the library? Put a few plainclothes cops (we have several!) in the library, “studying.” Get someone to leave their laptop unattended. Wait for the thief, who clearly is comfortable stealing things in public. And then, arrest him.

Similarly, there were two crimes this week where they caught the suspect on video camera. (Neither was exactly a major crime, though.) In both cases, though, they say they can’t identify who it is, and that’s the end of it. Why not show it to a student, who may well recognize it? Or why not publish it? The school newspaper is always desperate for material. We’d love to run a few stills from the tapes.

Too many people seem to assume that you need to master all the ‘cruft’ that existing leaders have. I don’t know nearly as much as the police chief, so far be it from me to have ideas. And yet I’m fairly certain my ideas would work. The “sting” might be a little over the top, but it beats the status quo of doing nothing!

Oh, another example! My digital SLR camera is basically a film SLR with a digital sensor instead of film. I never quite understood why you needed things like a complex mirror array or a shutter. Couldn’t you just take them out, and just sample the sensor for whatever time period you needed for the exposure?

It turns out, yes. There are a few little “gotchas” I wasn’t aware of, but mostly, they’re holdovers from the film world. People designing the cameras just still have that leftover baggage of the film era, so they keep making cameras with shutters and mirrors. A tiny little bit of R&D could probably eliminate the problems with simply removing them, and you’d end up with something with increased reliability, the ability to take faster exposures, and added versatility. But it looks like it’s going to take an “outsider” to get this done.

Yes, you need some existing knowledge to keep you in reality. But people seem to averse to letting ‘new’ people have ideas. And in my experience, they’re the best ideas. Getting the record industry to distribute music over the Internet took Shawn Fanning and, finally, a failing computer company in California. Why didn’t the record industry, with a multi-billion-dollar budget, think of it? (And, even now that lots of evidence shows that it’s doing well, many record companies are still digging in their heels!) Organizations get too big, crufty, and narrow-minded, which causes them to think that only the biggest, cruftiest, and most narrow-minded of them should be allowed to try out ideas. Why?! Do people like the “stability” of their old ways — selling CDs and booing the Internet, using unnecessary moving parts in cameras, and not catching criminals — even when the old ways are clearly the worst possibly way to do things? Are they so bent on sticking with what they know that they’re willing to lose?

Windows, Reviewed

Mr. T’s post jibed with something that was in the back of my head. I can’t sleep right now, and have sent my friends enough meandering e-mails, so I’ll post here.

For at least the past month, I’ve been in Linux exclusively. I have a 160 GB, 5400 RPM drive with Linux, and a 60 GB, 7200 RPM drive with Windows. (I also have a combination of network storage and external drives for moving/storing data.)

My roommates have been big into Orange Box lately, so I figured I’d give it a try. (It can apparently be made to run under Wine, actually, but I didn’t want to bother.) I swapped out disks, booting into Windows. And it was just one thing wrong after another after that. Admittedly, many of the problems weren’t directly the fault of Windows, but it was truly the worst experience I’ve had in a long time. (Steam was even more badly-behaved than Windows.)

Here are some things that really bug me:

  • Performance. Windows has my ‘fast’ hard drive. I scan regularly for viruses and spyware. (But I’m so OCD that I’ve literally never had any viruses, or even any malware, on this machine.) I disable unnecessary crap from starting up. I run a lean, mean machine. And with a dual-core processor and 2 gigs of RAM, it should fly. Especially on the 7200 RPM drive. And yet I can be in Firefox browsing the web under Linux in less than it takes Windows to finish logging me in. I don’t really understand what’s going on, really.
  • Fragmentation. Maybe this partially explains the above point. Most operating systems don’t make a big deal about disk fragmentation. It’s (supposedly) just a non-issue on both Linux and MacOS filesystems. I suppose I wouldn’t know, not having a defrag tool. But my Windows drive is laughably fragmented. I have more fragmented files than non-fragmented. And, when I was using Windows regularly, I’d run a pull-out-all-the-stops defrag every week or so, scheduling a boot-time defrag to make sure it also got my paging file and the MFT. Having successfully “fixed” my heavily-fragmented paging file, I thought it a done deal. But it’s again in about 300 pieces. What the hell? I thought it was one file. Where did it go? I know it stays between sessions because I tried to get rid of it when shutting down and couldn’t. So what happened?! And really, shouldn’t that be permanently mapped out?
  • Bizarre errors. I never thought I’d see the day when I was criticizing Windows and not Linux for this. Linux still has its share of bad errors. But what’s with the “The memory cannot be ‘read'” errors? (BTW, Memtest finds nothing.) What’s with rtvscan.exe crashing?
  • Slow performance. Not just bootup, mentioned earlier. When I go to start an application, I usually sit there waiting for several seconds. Just sitting, waiting. I’ve never had this problem under Linux. Maybe it’s just that Linux isn’t a fan of big ‘suites’ of programs, preferring to have lots of little lean applications. But I click on the Firefox icon in Linux and Firefox pops up. I click on the IE icon in Windows and my disk churns and, five seconds later, it pops up. Why?!
  • Disk mounting. Again, I never thought I’d see the day when I thought Linux had this better than Windows. It used to be that you’ve have to pull up the command line and su to root and mount a device manually, specifying the device name and a mount path and the file format and various other parameters. Unplugging the device without unmounting it would usually lock up the system and/or cause a kernel panic. Now in Ubuntu I just plug in external devices and they show up on my desktop. They’re comparable that way. (Although Linux doesn’t give me five little bubble icons in a row about “Unknown device” and searching for drivers.) But what about when I want to remove something? In Linux, I right-click and select “Unmount,” and the icon disappears and I remove it. I forget periodically and nothing bad happens. I consider myself to be a very advanced ‘power user’ of Windows, and I’m still not sure. Do I click on that little icon in the system tray? Why is it so hard to use? I’ll find something that sounds like what I want, and I click on it, and it brings up this hierarchy of devices, ranging from the name of the physical disk to a ‘mass storage device,’ and asks which I want to stop. And honestly, I know a lot about Windows and I know all about the hardware, and I’m still never sure. Rusty informs me that Vista’s the same way.
  • Updating. I guess it’s not as practical since Windows has a whole different environment, but MacOS and Linux both have a centralized package manager. An automated daily check might inform me that my word processor and graphics editor have new versions, and let me choose what to do. In Windows, each application does this on its own. It’d be kind of nice if Windows had a central package manager, just so that I wouldn’t have constant headaches when running Windows for the first time in a month with everything I start going out and downloading new updates.
  • File copying sucks! I’ve long-complained about how copying a group of files shouldn’t abort completely when it hits one bad file. But I discovered something else. I was getting low on disk space, so I was moving things over to another drive. I had about 3 GB free, and was going to move a DVD ISO over to the external drive, too, for 7-8 GB free. But it wouldn’t work, due to insufficient disk space. I was confused, because there was plenty of space on the target disk (like 400 GB free). It’s apparently that the Windows drive didn’t have enough space. Which for a second almost made sense: it’s a big file, so it needs room to work. But wait… Why? It can move it, chunk-by-chunk, over to the new disk. I can’t think of any other way of doing it, in fact. And there’s enough room to copy it at least 75 times.

Half-jokingly, I pondered over e-mail, “Why do people ask if Linux is ready for the desktop? The question, I think, is ‘Is Windows ready for the desktop?’ And I’m not sure.” But really, if I have constant headaches, I can only imagine how the people with 75 IE toolbars and lots of spyware and viruses and no idea how computers work must feel. I think my computer is slow? I have bizarre, unexplained errors? I’m confused by technobabble messages that pop up?

Of course, in the interest of fairness, there are two things that I’m liking about Windows:

  • I can put my laptop into standby / suspend. It’s been possible under Linux for years, but doesn’t work properly out of the box for me, and I don’t feel like jumping through hoops to make it work.
  • There’s this one insidious bug (I’m running the “bleeding edge,” Ubuntu’s Gutsy Gibbon, so I suppose I can’t complain too loudly) where the logout/shutdown button locks up the machine for 30 seconds before it displays. This is apparently a known problem with several different causes, but it seems pretty pathetic that it’s still an issue.

Oh, see, this is exactly what I hate! As I’m writing this, I can hear my hard drive going. And the disk activity light is on solid. What’s going on? I have no clue! All I have open is Firefox. Some background process is apparently accessing my disk. What is it? I’m not quite sure!

Conversations, Poor

A conversation I had yesterday.

What I thought was said:

Me: *picks up a bag of Cheez-Its he brought to meeting*
Them: “Where did you get those?”
Me: “I got it over in Adamian, at the vending machines.”
Them: [incredulous look]
Me: “I was going to go to Einstein’s for a bagel, but the line was too long.”

What was actually said:

Them: “Oh, nice haircut!”
Me: “I got it at the vending machines in Adamian!”
Them: [incredulous look]
Me: [discusses attempt at dinner]

Jobs I’ve Overlooked

Kyle has a book called Gigs that I’ve been reading. Basically they interview hundreds of people with various jobs about what they do. “We feel that the world hears too much from ‘experts’ of all political stripes, and not enough from the people for and about whom they presume to speak,” one of the editors writes. Reading just a bit of the book so far, I’ve realized a few things:

  • People are people. So many people view people at work as just a human embodiment of a company, or merely as an ‘object’ with which they’re forced to interact. (Sidenote: spending some time in customer service should be mandatory for everyone.) A bus driver talks about the abuse she takes when the bus is late. A flight attendant complains about the time someone threw a hamburger in her face because he didn’t want it. The world would be a much better place if people could see that people were people.
  • I’ve narrowed my horizons far too much. I never considered that I could be:
    • A train engineer. He apparently makes about $90,000 a year and gets to see the country. The hours aren’t great, though, and I’d probably get bored.
    • A member of the paparazzi. I love photography anyway. This guy has a wild job. He doesn’t mention his salary (he works for a magazine), only that one of his photos got him into the “six-figure club,” referring to his revenues from a single photograph. He does claim to have been punched by Alec Baldwin, and mentions that he goes to the bathroom in his car because he has to remain vigilant. Those aren’t the working conditions I look forward to.
    • A porn star, although he makes the job sound less appealing than I’d have imagined.
    • Fisherman. It’s intense work, and risky, but he makes good money.
    • Casino surveillance officer. Watching hundreds of cameras. It actually sounds fun, though I’m not sure I’d be making the $40,000+ that jobs out of college are supposed to pay.
    • Drug dealer. He made good money!

There are so many more I haven’t read. Slaughterhouse human resources director? Chief Executive Officer? (I’ll do it!) Clutter consultant? Crime scene cleaner? Taxidermist? Bar owner? Buffalo rancher? Food stylist? Anchorwoman? (Err, man, in my case.) Television station receptionist? Carnival worker? Squash instructor? Transvestite prostitute? Mother? The possibilities are endless for me! College professor! Bounty hunter! Prisoner! Town manager! Psychiatric rehabilitation therapist!

Grand Central

I signed up for an account with Grand Central. It’s a limited beta, but they eventually had a slot for me.

Essentially, I give out my GrandCentral number, which rings in multiple locations. (Currently, my cell phone and my school desk phone.) But it treats calls more like e-mail: I can set up ‘rules’ on what calls get through and what calls don’t. There’s voicemail which I can listen to via the Web.

I have a few invites, if anyone is interested.

Getting Familiar with the CLI

As long as you’re doing lots of work in Linux, there are some more things you’ll want to get used to. I spent a lot of time in the command line. (It’s kind of hard to avoid when you’re working on a headless server.) These tips are useless if you don’t have a basic familiarity, but for people with a relatively basic knowledge, here are tips that might come in handy:

Very often in less, I want to jump to the end of a file and work my way up. I can hit space over and over. One day I thought I was clever, when I realized it would tell you how many lines were in the file, and I began telling it jump to line 123 by typing :123 within less. But it turns out it’s even easier. G takes you to the last line. g takes you to the first line. There are many more handy tips here.

Of course, I spent even more time in vi. Search and replace is handy. But keep in mind that the :s/old/new command will only work on one occurrence. You can append a g, ending up with :s/old/new/g, but it’s only going to work on one line. This is usually not desirable. You can specify a line range. Generally, though, you want the whole file. $ denotes the end of the file, so you can do it as “1,$,” denoting “From line 1 to the end of the file.” But it’s even easier: % means “the whole file.” So I end up with…. :%s/old/new/g to replace all “old” with “new”. And if this isn’t what you want, press u to undo. The “G” trick to jump to the end works in vi, too. Turns out you can replace :wq with ZZ, which is essentially the same.

I’ve known about the uniq command for quite some time: its goal is to weed out duplicate lines. This is handy far more often than you might imagine: say you strung a ton of commands together to pull out a list of all e-mail addresses that your mailserver has rejected. There are bound to be many, many duplicates, because apparently bumttwagnerfor@domain is commonly-spammed (?!).

But uniq has a peculiar quirk that I missed. They call it a feature, although I’m not sure I agree. It’s for filtering out sequential duplicate lines. If the duplicate lines aren’t in order, it will merrily pass them on. I suppose there may be scenarios when this is desirable, although I’m at a loss to think of any. In a nutshell, whenever you want uniq, you probably want to run it through sort first. grep something /var/log/messages | sort | uniq, for example, will pull out all lines with “something” in them, but omit all duplicates.

And note that use of grep. For some reason people seem to think that echo filename | grep search_pattern is the way to do it… There’s no reason for echo. Just do grep search_pattern filename.

Fun with Shell Commands

I’m now running a mailserver, and I was trying to set up Mailman to handle a mailing list. I was having some odd behavior causing Mailman to barf up a fatal error, so I used a trailing monitor on the log file with tail -f.

In the course of doing that, I noticed several hosts connect attempting to deliver mail (presumably spam) to “bumttwagnerfor@domain…”, a bizarre address that definitely doesn’t exist.

It’s not a big deal, because the mail’s just bouncing. But it got irritating watching them all in the log file.

I wanted to ban them. It turns out that Linux makes this easy: there’s a hosts.deny file, and anyone in it is banned from connecting. I already have a script that watches for repeat failed login attempts on ssh and bans them. (And I have something like 200 IPs banned, although I suspect that it’s not purging them appropriately.)

All the log entries are in a common format, and look like this:


Oct 8 05:41:31 oxygen postfix/smtpd[23212]: NOQUEUE: reject: RCPT from unknown[62.233.163.250]: 550 5.1.1 <bumttwagnerfor@ttwagner.com>: Recipient address rejected: User unknown in local recipient table; from=<kqcwglupoqb@bonairenews.com> to=<bumttwagnerfor@ttwagner.com> proto=ESMTP helo=<250.248/30.163.233.62.in-addr.arpa>

We can see (actually, guess, in my case) that the IP is the 10th ‘column’ (using a ‘space’ as a delimiter). So we can begin a rudimentary script to print out just that:

# grep bumttwagnerfor /var/log/messages  | awk '{ print $10}' | head
unknown[211.49.17.175]:
81.202.185.36.dyn.user.ono.com[81.202.185.36]:
host-89-228-234-224.kalisz.mm.pl[89.228.234.224]:
LSt-Amand-152-32-14-78.w82-127.abo.wanadoo.fr[82.127.29.78]:

But there’s an obvious problem: the hostname is rammed up against the IP. I want to just ban the IP, and strip out the hostname. The correct way is to write a lengthy regular expression to match just whatever’s between the [ and ]. (Note that you can’t just write a regular expression to match IPs: the very first one has an IP in its hostname, for example, which would throw you off.)

The quick and easy solution is to replace the [ with a space and the ] with a space, which gives you “hostname IP “. And then you use awk again to print it:

grep bumttwagnerfor /var/log/messages | awk '{ print $10}' | sed "s/[/ /g" | sed "s/]/ /g" | awk '{print $2}'

This is a pretty ugly command. Just the way I like it. 😉

But we’re not quite done! The format for hosts.deny is “Service: Address.” We’re just getting addresses here. I want the output to be something like ALL: 1.2.3.4 for each entry. (If they’re spamming me, I don’t want to allow them access to any other services.)

When it’s all said and done, here’s the command:

grep bumttwagnerfor /var/log/messages | awk '{ print $10}' | sed "s/[/ /g" | sed "s/]/ /g" | awk '{print "ALL", $2}'

You can just append a >> hosts.deny to deny them right away, or parse it through head or less to review first.

And viola. 440 IPs banned.

Seriously, though. wtf is going on? 440 different people have tried spamming this address that has definitely never existed.

Unwritten Rule of the Internet

All questions asked must receive a bunch of completely pointless answers.

Most recent example: I discussed how my camera was massively overexposing pictures. I explained that I shot in aperture-priority mode, meaning that I set the camera’s aperture and the camera will select an appropriate shutter speed. Shooting a bright white sign in direct sunlight, with an f/4.5 aperture, it selected a 1/45 second shutter speed. This was wildly inaccurate. I also walked through a, “You might think what I first thought” thing where I debunked a few of the answers I knew I’d get: that I’d maybe shot at ISO1600 or something, and that I had maybe switched to Manual mode by accident. I explained that neither was the case. I also explained that I ended up switching over to full-manual mode, where I got some great shots, so that it seems to be a problem with metering.

A few people gave helpful answers. But I also got a lot of replies like, “Your shutter speed was far too low. It should have been 1/1,000th of a second.” (Thanks, Sherlock. Do you understand aperture-priority?) Someone else suggests that I was maybe in manual mode by accident. Despite having already stated that I wasn’t, I explained that I had last been doing night exposures, so manual mode was set for a 30-second exposure. “I’d definitely have noticed,” I explained. Another helpful person suggested that I could have just switched to manual mode and set an appropriate shutter speed myself.  Thanks for not answering the question of what was wrong and not even reading the whole thing, where I mention that I did just that in the end.

And I started a huge argument in another thread by pondering aloud why no one ever made a zoom lens faster than f/2.8. I wondered if it was some physical limit that I didn’t understand. People are now talking about how on the 5D you can use ISO6400 which offsets the need for a fast lens, and arguing over whether or not an f/2.0 zoom for a non-35mm body is the same as if it were for a 35mm body, and whether f/2 really means f/4. And then someone argues about, “What is ISO, really?”

Seriously, be careful about asking questions on the Internet. Most of the answers you get probably won’t answer your question at all.

Software or Hardware?

For a long time I collected Motorola radios. I soon realized a “trick” — a lot of them had the same ‘guts’ and just had different software controlling them. If you cut the little “stopper” off of the channel knob on the channel knob and changed 2 bytes in the firmware, you had a 16-channel radio.

The higher-end radios were even more seriously software-dependent. The price of a radio could go up hundreds of dollars (thousands when new) depending on the features it has. But it turns out that the whole series had the same hardware, and various features were loaded via software. (This was actually publicly-known.) Soon, people realized how to suck the software out of one radio and drop it into another radio, and suddenly most hobbyist-owned radios had just about every feature possible.

I’m getting out of the radio trade, though. I began by getting a lot of two Canon digital SLRs off of eBay. The two cameras were very similar: both, in fact, had the same sensor. I kept the 10D, which was bigger and had a solid-metal casing, and sold the 300D, which was smaller and had a silly silver plastic case. Mine has a bunch of features that the 300D didn’t: ISO3200, the ability to control flash brightness, and a whole mess of “Custom Functions” that let you fine-tune things, to name a few.

It turns out that I was more right than I realized about them being closely related, though. There’s a firmware hack that brings a lot of the 10D functionality to the 300D. (All the ones I mentioned and then some!) Of course some features are missing: you can’t select autofocus points, for example.

But it’s interesting to learn that model differentiation via ‘crippling’ features in software is more prevalent than I’d once believed.

Wung Fah

We looked into the cost of hiring a coach bus for the day. $1,300.

Multiply that by 5 and you can buy a used coach bus. (Granted, they’re easily $200,000 new, but there are a ton of used ones, and they’re the type of things that are usually driven until 1,000,000 miles or so.)

Assume 200 miles. (This is actually way, way more than we need.) 8 miles to the gallon. (You may do better.) $3/gallon. That’s $75 in fuel.

Assume you pay the driver very well: $20 an hour, and that we have the bus for 8 hours. (He surely makes less, and we don’t need 8 hours.) $160 in labor.

I want to start my own bus company. (More for being hired out for the day than anything than being a Greyhound / Fung Wah, though.) I think I could do it for a lot less.

Buy something like this, spruce up the interior (carpeting?), and re-install the seats, and you’ve got one heck of a bus with 750,000 miles of life left. And, apparently, 100 gallons of fuel already in it…  $10-15,000 buys a nice, complete bus.

$750 a day… Assuming $20,000 fixed costs, you break even after 26 days. You have variable costs (fuel, labor, insurance), too, but really, I think that if you could book the bus regularly, you’d do well.

Oh, and there are lots of little “extras” you could do. Replace those huge old TVs with a few LCDs. Probably under $1,000 total cost if you do it yourself? And, in lieu of showing a movie / TV, you could always do an airplane-style display of where you are or something… Or show ads! No direct value, but I think it’d raise the perceived “value” of the bus.

You could invest your profits into a budget limo service. You compete in the taxi market, not the limo market. If I had the choice in riding in a 12-year-old limo (after removing the garbage from the floor?!) or riding in a taxi, I’d pick the limo. Although I wager most of the costs there are variable costs: labor, insurance, maintenance (probably big on a really old American car?), etc. But really, you’re paying less than it’d cost to buy a used taxi. And this one is even less!