lessons learned

Building a Balancing Scooter

People have always delighted in the petty failures of new methods of transportation, more than other kinds of inventions. The Greek legend of Icarus may be the oldest recorded example. [Recall, his father built him wings made of feathers bonded with beeswax to escape from prison. He flew too high and the sun melted the beeswax, plunging him to his death in the ocean.] I have to say that the legend of Icarus has always grated on me since I first heard it as a boy. I probably asked my dad hundreds of questions like, “Wouldn’t epoxy glue work better than beeswax? Why didn’t they try that? Or maybe he could just spritz water on the wings to keep them cool? Can we go buy some feathers?”

In the reality of the legend, the hero invented something revolutionary and tremendously important. He made a mistake in the details, and it caused a crash. The audience is meant to laugh and smugly reassure themselves that man was not meant to fly after all. By not learning from the experiment and fixing the small flaw, they set human-powered flight back more than 2000 years.

Something to think about when next we read or hear about someone reaching for the stars . . . .

And the stuff about buildind a Segway workalike is interesting too . . . .

working mind to mind

Channeling Cupertino

Even over shorter distances, people rarely think of phone calls as being so casually cheap that one would simply leave the connection open for ambient telepresence and occasional conversation. To create shared spaces that span the planet, and to do so whenever you feel like it, and to leave them unpurposefully in place for hours, is not something people have done very often before.

Read this and see where it takes you . . .

truth is at least as strange as fiction

eBay item 2450501898 (Ends Jan-05-04 04:38:41 PST) – Aircraft carrier (decommissioned ) for sale

This maybe the first ever aircraft carrier (decommissioned 2001) available for auction at EBAY !

This would be strange anyway, but it takes on a tad more strangeness since I just finished Snow Crash. As you may recall, a bajillionaire in the book buys the USS Enterprise as his private yacht . . . .

via MeFi.

command line samba/windows logins

The question came up on the FreeBSD Questions mailing list: how do you set up commandline/non-interactive logins or mounts of Windows shares, aka samba shares?

I had this working at my last job where I was running OS X in a Windows environment, so I could do things like web traffic reports, backups and the like unattended, and the key was the .nsmbrc file, a cousin of the .netrc file. Sadly, online documentation for the .nsmbrc file seems to be scanty, but there is an example file distributed with the samba source that’s actually more useful. Look for a dot.nsmbrc file with find(1) or locate(2).

This is an actual file, redacted to remove my network-specific stuff. There are three types of entries. The default stuff describes the network/workgroup, then you can specify servers/shares, and then user login details. Also, this all works for samba 3 clients against 2.2.8a servers, but not cleanly vice versa: I’m in the process of standardizing on 3.0 and will test again to see if it works.

NB: the only keyword is “default.” The other tokens are site-specific, so SERVER, USER, and SHARE are for you to replace with what you need at your site.

And of course there are a lot more options available: these are the barest minimum that I need to make things work.

[default]
workgroup=[your workgroup]

[SERVER]
addr=192.168.2.3

[SERVER:USERNAME]
password=[encrypted password]

[SERVER2]
addr=192.168.2.1

[SERVER2:USERNAME:SHARE1]
password=[encrypted password]

[SERVER2:USERNAME:SHARE2]
password=[encrypted password]

Note that you can login to different servers as different user names as well as specify different shares.

To encrypt passwords, use smbutil: smbutil crypt and either enter the password there or at the prompt. The encryption is trivial, but as we say, a lock keeps honest people honest. Between that and the 0600 permissions on the file, you’re reasonably secure.

Test it thusly:
white:~ paul$ smbutil view //paul@red
kextload: extension /System/Library/Extensions/smbfs.kext is already loaded
Share Type Comment

weird file descriptor problem in FreeBSD

First, some context. I was finding that the box that houses this weblog and other stuff was locking up, for most services, in a matter of hours. There was a slow but steady decay in usability and I had no idea what it was. There were cryptic messages in the logs about processes using up all the file descriptors on the system, directing me to the tuning man page.

I finally figured it out last night but not before I had one additional spell of catatonia on my system.

I used mrtg to graph the increase in file descriptor usage and it made a nice straight line at about 45°, not a curve, no movement that would be consistent with things happening on the system. That looked suspicious.

MRTG graph of file descriptor weirdness

I also set up a simple while loop in my shell to keep an eye on this. (while [ 1 ] ; do sysctl kern.openfiles; sleep 60; done ). When that stopped updating at about 6600 files (the max is set at 16384 or so), I rebooted (console was dead).

In the process of looking at this, I had noticed that there were a few nmbd (samba) processes in the process table: I expect to see one or two, but not 10 or more. I watched this after rebooting, and sure enough, new processes were spawning ever couple of minutes, and this with no logins to the samba shares.

I killed the samba processes, deinstalled samba, refreshed from cvs and, noting that the version was the same (2.2.8a), I reinstalled with portinstall -P.

That seemed to do it. Now openfiles are sitting in the low 200s . . . .

tipping point?

The IT industry is shifting away from Microsoft

I was talking to a high level person in charge of security at the Intel Developer Forum last fall, and we chatted about what Microsoft could do to fix things. He asked the right questions, and I told him the right answers, trust. Plus, throw everything you have out and start again. He didn’t get it. No, more than that, he was impervious to the things I was saying to him, the culture is so ingrained that the truth can’t penetrate it. Microsoft cannot fix the ‘bugs’ that lead to security problems because they are not bugs, they are design choices. [emphasis mine]

Interesting piece, but as the site I found it on said, I wonder if the facts bear it out. $50 billion is considerable cushion . . . and they’re pretty resourceful.

system monitoring with mrtg/snmp

Someone emailed me thusly:

I saw your email to the mailing list (http://www.ee.ethz.ch/~slist/mrtg/msg23710.html), that you have a rather successful install of MRTG and SNMP on OS X. 

I am quite jelous.
http://www.paulbeard.org/mrtg/pink/

I got SNMP installed OK (from Darwinports via opendarwin), and gor MRTG installed.  I’ve been plotting Ethernet connection for sometime.  I wanted to get CPU and Disk (like you have)

I tried snmpwalk, but see nothing of the sort.  Any assistance would be greatly apprciated.

I decided to take a look at this as a new install (my move from Jaguar to Panther on the host he saw being graphed worked without a hitch . . . ) I have a new iBook and am starting from scratch.

First off, the factory version of snmp seems to be OK. So he could have saved himself some work there.

Next, run snmpconf and make sure you can actually access your snmp daemon. You need to set a community name and define a version for security purposes.

The next thing to look at is the hrStorageTable. (The Cw 100 syntax wraps output to 100 characters.)

snmptable -v[your version] -c[your community name] -Cw 100 localhost hrStorageTable

This should spit out a table of all the storage devices you have mounted:

SNMP table: HOST-RESOURCES-MIB::hrStorageTable

hrStorageIndex hrStorageType hrStorageDescr
1 HOST-RESOURCES-TYPES::hrStorageFixedDisk /
2 HOST-RESOURCES-TYPES::hrStorageFixedDisk /dev
3 HOST-RESOURCES-TYPES::hrStorageFixedDisk /dev
4 HOST-RESOURCES-TYPES::hrStorageFixedDisk /.vol
5 HOST-RESOURCES-TYPES::hrStorageFixedDisk /Network
6 HOST-RESOURCES-TYPES::hrStorageFixedDisk /automount/Servers
7 HOST-RESOURCES-TYPES::hrStorageFixedDisk /automount/static
8 HOST-RESOURCES-TYPES::hrStorageFixedDisk /Volumes/paulbeard
101 HOST-RESOURCES-TYPES::hrStorageRam Real Memory
102 HOST-RESOURCES-TYPES::hrStorageVirtualMemory Swap Space
103 HOST-RESOURCES-TYPES::hrStorageOther Memory Buffers

SNMP table HOST-RESOURCES-MIB::hrStorageTable, part 2

hrStorageAllocationUnits hrStorageSize hrStorageUsed hrStorageAllocationFailures
4096 Bytes 7324800 4095758 0
512 Bytes 2 2 0
512 Bytes 2 2 0
512 Bytes 1024 1024 0
512 Bytes 0 0 0
512 Bytes 0 0 0
512 Bytes 0 0 0
512 Bytes 204800 25819 0
4096 Bytes 0 761696 ?
4096 Bytes 761640 -1073746560 ?
256 Bytes ? 48 ?

From this you can get the variable you want to report on:

white:~ paul$ snmpget -v[your version] -c[your community name] localhost hrStorageSize.1 hrStorageUsed.1
HOST-RESOURCES-MIB::hrStorageSize.1 = INTEGER: 7324800
HOST-RESOURCES-MIB::hrStorageUsed.1 = INTEGER: 4095757

Once you have that in hand, you can initialize mrtg with it’s cfgmaker command and then add additional stanzas to suit your needs.

when a prank backfires

National Post

Mr. [Andrew] Ironside, who had his own page in the yearbook, had been elected valedictorian in a vote carefully orchestrated by his peers and designed to embarrass him.

But when graduation night arrived, he gave a speech that transformed a malicious high school joke into an ad libbed sequel to Revenge of the Nerds.

In my high school, I remember there was similar event where a girl on the cheerleading squad was elected to homecoming queen or some such “honor.” I think it started as a prank, but the prankiness of it all fell away. I remember the victim as a nice, sweet kid who didn’t do anything to deserve being set up like that. Perhaps that dawned on some of the organizers of the stunt; I can’t remember for sure, but that’s how I’d like to remember it.

Of course, this fine film came out during my high school years . . . . kind of a worst case scenario.

and some people think McDonalds makes good food . . .

So I had the misfortune of working in Windows XP for a bit today and I have to say, I have no idea how it is so popular, other than the fact it’s just there, pre-installed.

I have a PC running XP here at Thistle Dew to support some Windows-specific stuff, and I had to power the machine on today for the first time in a while. I decided to install the requisite bajillion software updates and hotfixes that had been released since the box was last used. Hoo boy, 13 of ’em.

Oh well, no matter, we’ll just get the process started and do something else . . . . maybe. Does no one else find the constant focus shifting to be a nuisance? I’m in a browser window (hmm, you can still find a browser that doesn’t support tabbed browsing? How innovative.) and I’m typing when, the menubar dims and my keystrokes aren’t picked up. Apparently part of the Windows update process felt the need to focus the interface on itself. It didn’t need any user input or intervention: it just wanted me to know it was there.

This happened a couple more times, and I found myself getting really irritated with it. How is this a feature?
Continue reading “and some people think McDonalds makes good food . . .”