A Cardiac Adventure

I’m Jim Comeau, aka jimcooncat and similar names on the internet for a long time. The events shown date from Thursday, March 8, 2018 to Friday, March 16. I’m a Gulf War and NATO vet, at one time I was highly disciplined and in excellent shape for a smaller guy. I’ve had so many varied life experiences that few people really relate to me, and I really haven’t cared. Now I’m 56 years old, in a slow process of shifting careers, and have moved beyond the pain and fear of a heart attack I had seven years ago. This is a medical story, but I don’t think you’ll find it boring; it exposes my flaws, which I hate, but important for your understanding; it shows my strength, of which I’m not proud, yet I hope it inspires you.

I sat in my small office in Maine’s capital city, finally relaxed from a busy morning of stacking firewood and a long commute, and feel a dull ache under my armpit. I probably wrenched it a bit hurrying this morning. It’s still there when I get home, so I mention it to my wife. The next morning, a Friday that I don’t have to travel to work, my stomach doesn’t feel well. I take our new snowblower out for a spin, making a nice swath through the five inches of fluff that got deposited overnight. Though I’m just getting used to this machine, it doesn’t seem that I should be winded from just that bit of effort. We call the doctor’s office — closed because of the storm — and call his home number he had left on the machine. “Go in and get checked out.”

We live on one of the busiest highways in town, a US route that is well maintained by both the town and state road crews. Yet strangely, the road hadn’t been plowed this morning, giving my wife a real challenge driving the short two mile trip to the hospital. We make it in our little car with her skill and goading from me not to slow down before climbing a small hill. Blood work and some preliminary tests, they wish to have me take some medication. I call the doctor’s house with my cell as I’m wary of any new drugs that these people-I-don’t-know want to spring on me. The ER physician’s assistant can’t understand why I would question, almost seems personally affronted. I ask if he could contact the VA to see if this visit would be covered, and that bought a few minutes. My good doctor doesn’t answer but soon I get a message from him through the nurse, “You just do what they tell you.”

The tests progress through any external ones they can find for me to do. The blood work came back and luckily I haven’t had a heart attack. I get on the treadmill for a stress test, but I get winded before I reach my target heart rate. I knew I haven’t kept up with aerobic workouts, but I was surprised that I didn’t do much better on this test. Now the talk shifted, and the doctor suggested that I go through a heart catheterization in Lewiston, and was amenable to our suggestion of Bangor instead. Soon, there is a change of plans. The VA wants to do the procedure in East Roxbury, Mass., and I leave in one hour by ambulance. With no time to have my wife go home to gather any of my small comforts, we kiss and I get strapped to the gurney.

The driver gives me a choice as to which way to get out of town. I was quite surprised and happy that he would take the flatter river route than the shorter hilly one. They put some classic rock on the stereo and except for the occasional bump the ride didn’t seem too bad. After a while I grew a bit tired of entertaining myself with phone texting and trying to read the book I’d brought while it jostled in my hand. I tried to relax and guess where we might be on the map by the curves and bumps in the road, time elapsed, and lights coming through the back window. Once in a while the EMT would come back to check on me, and I’d be far off in my estimation. It didn’t matter, it was occupying my mind, and I became aware that I was slipping back into an old feeling of confident mental self-reliance that had proved so important in surviving my military and earlier life.

It’s getting to be a very long ride back here when I feel us going up an incline. Hey, I DO know where we are now, and lift my butt off the gurney a bit as we bounce over the Kittery bridge like a stagecoach on a Corduroy road. A good while later we arrive and I get checked into hospital, saying goodbye to my new great EMT friends that delivered me safely. It’s late Friday night and my procedure isn’t going to happen until Monday, so I’m set in my mind for a long boring weekend. I lie down in the bed and find out it has a mind of it’s own. It deflates under my upper back until it’s lower than the rest of my torso, then pumps back up halfway. Then it deflates under my butt, then pumps back up. It makes several more small adjustments then the air pump stops making noise. That’s strange.

I get a private room all weekend. I busy myself with every activity I can think off, and make good progress in reading my book, “Growing a Business” by Paul Hawken. This must be the fifth time I’ve read it and it gives fresh inspiration every time. “No, the WiFi connection is just for hospital staff, not patients.” I try make a few arrangements to tie up loose ends in my work life over a 1G connection and the too-small Android keyboard. A couple of my well-meaning friends message me that I should be resting and not thinking about work, but the alternative was to worry about my situation. Not an option. Late at night people wander in and out of my room for no apparent reason. I’m used to locked doors and warning, so I keep an eye open. A janitor enters to grab my trash. The main trash, the bathroom trash, and he starts to creep up the side of my bed to get the wastebasket I’d moved it there for tissues. He’s too close, too sneaky, I’m too vulnerable. I raise my hand up and command him to halt, point to the door and order him to leave. A look of horror goes over his face, and he avoids me for the rest of my stay.

I meet the cardiologist team, three quirky guys I nickname to myself, ‘Larry, Darryl, and Darryl‘. It amazes me how they work together, all three approach me at the same time with their expensive stethoscopes out. Like a choreographed dance, they each pick one quadrant of my torso to listen to, then move to another in rhythm with each other. Happy with what they don’t find they move to my back while I take deep breaths, and then all nod their head in agreement that my lungs are good and clear.

The time comes to be wheeled to surgery, where if find myself not in a traditional white operating room, but a huge industrial bay with big robotic cameras, very high ceilings and a strange slab for a bed that has one armrest. The idea is for them to put a catheter in my arm to look at my heart, and I make sure to ask them that if they find anything they would be able to fix it right then. They assured me that they would be ready to make whatever corrections are needed at the time, such as installing a stent. They do some busy work with IV’s and such and finally the large camera moves down to block my view. I really didn’t want to watch the procedure anyway, so I close my eyes.

I’m still on the greater side of consciousness though most of this procedure and listen to their progress. They are able to view an 85% blockage through the catheter, but aren’t able to place the stint that way. They retract it and puncture the top of my leg and put a larger diameter one in that way. Remarkably, I had no discomfort, unlike when I’d had this procedure seven years earlier.

Sounds like they’re doing all right, it’s getting to be a strain to hear what they’re saying and trying to put it in a context I can relate to. Guess what, you’re not in control of the situation right now anyway, buddy. And they’re supposed to tell you about what happens later. So you might as well think about a song while they do their stuff …. “in the year 2525” … Oh no, that’s the LAST song you need to be thinking about right now! Maybe something by Creedence


Bam Bam Bam big fist on my chest, sounds of people scurrying and barking orders … someone’s on top of me pushing me down bam bam bam… can’t see … lights flashing every time bam this guy must be big I can smell his sweat bam bam bam OK I think he’s stopped … oh I’m tired … what was I thinking about?

“You had us worried in there.” Look Mister, I didn’t do a DAMN thing to cause that. I look at the burn mark on my chest left from the paddles. Not bad, oh well, looks like French Toast. Really, you’re not supposed to find that funny, Mr. Comeau. I can’t help but smirk as they wheel me down the hall. They tell me they were able to install the stent then moved to the other side of the heart to view that, but when they were getting ready to retract the probe touched the muscular wall — and the heart stopped beating. I appreciate their honesty, but I’m less than impressed.

They wheel me to the cardiac care nurse. He looks just like Lennie Briscoe. Happy in his work, joking, we develop a rapport once I come around enough to talk sensibly. He plays with the leads and IV’s and defib pads that are stuck all over me and in me. A notice that one of my meds is being discontinued, and you could see a light of inspiration come over his face. He starts punching away at his computer and rattles off a tirade of jargon to himself, oblivious for a moment to his surroundings. “There!” He comes over and disconnects all my IV drips and rearranges them all to feed only one arm instead of two. “Now you can use your left hand!” Wow, man, thank you.

The echocardiogram man came to check me out. I had a difficult time with this normally mundane procedure, as he had to press the microphone deeply into my bruised chest. But he was able to get a good set of pictures, and later let me know that my heart function was fine.

So ‘Lenny’ is nervous about tonight’s storm. He’d had a bad accident during another recent storm and is not happy about his position of being forced to travel into work tomorrow. So he makes a huge deal out of it, joking with all the staff on the floor, eventually getting roars of laughter in response. He asks me what kind of pizza I like and orders enough delivery for the whole floor. I’m really impressed by this nut, I’ve already had supper but could still eat a horse. In very little time Alfredo and spinach and garlic tops a nice chewy crust, tastes like heaven.

Shift changes, the storm is just beginning to start. CRACK! We have Thunder Snow! For the next hour the lights blip on and off as it keeps switching from the grid to generator and back again. Every time the lights change over the staff goes, “OH!”. Really, does that jump you? I go back to sleep.

No one’s surprised the next morning when ‘Lenny’ doesn’t show up for his next shift. He calls in, living right on the coast line he had gone outside, and got met with a 60 mph blizzard. The whole place was short staffed and unhappy to double-shift, though all surgery had been postponed. I have them close the window shade. All I could see was the roof of the next building and the window building up with snow. It wasn’t doing anything positive for my outlook.

Later someone comes up from downstairs and says they have a bed available. They wheel me down and I climb into bed. The bed goes through it’s gyrations, but the motor doesn’t shut off, it continues to hum. I try staying still for about 20 minutes. I give up for the moment and rest in the recliner, and text my wife that the curtain halfway in the room is closed, and though I said “hi” to my coughing roommate I had got no reply. “He’s the Wizard,” she writes back.

Three more attempts to get the bed to work, and I report the malfunction to the nurse. Apparently these beds have been a sore spot for the staff, and she’s beside herself on how to handle the situation. I wrap myself in a blanket on the recliner and spend a couple hours napping. I start feeling a little cheated, that bed upstairs was really just fine, and if anyone needed some good rest — well, I felt entitled. Not really my style, but I’m trying to accomplish my mission to survive this trip with some self-respect intact.

Two young nurses finally show up with a replacement bed, expecting some extreme gratitude as they had been put out so very much by having to wheel it across the hospital. Yeah, thanks, I really need some sleep. Over the course of the next day, Mr. Wizard entertains me by exhibiting some strange behavior. Never acknowledging my presence, he goes from incomprehensible muttering and grunts when the staff addresses him, to eloquent paternal advice when his son calls on the phone, as well as a few other character manifestations. He does not sleep the next night, as he is full of mucus, and the cough syrup they’re giving isn’t helping. I mention to the nurse that he could use some lemon to cut through the phlegm, but he’s powerless to even make a suggestion. I just feel bad for Mr. Wizard, and I’m still exhausted.

So the doctors (Larry, Darryl, and a replacement, so Moe I guess) would be willing to have me on the way. Though the storm’s over in Massachusetts, it’s still a raging blizzard in Maine. No shuttle service so I will have to stay another night. I have a logistics problem in using the shuttle anyway, according to the schedule it will arrive late at Togus VA so my wife would have to travel in the dark. I’ve been commuting the road all winter, and have come close to driving off the road several evenings from misjudging the pot holes and frost heaves with the small car.

If I could just get to South Station by 1 pm tomorrow, I’d be able to get on a bus and arrive in Maine at a great place for my wife to pick my up by 4:30. I made a plan of action and told them I wouldn’t need the shuttle. All I would need to do is to jump in a cab for a one-mile trip to the Metro station, and ride a train into the city. It was going to cost me about $40 total, give me a shorter, comfortable ride, and I was going to be free of this place. What a smart move! Or was it…

Waiting this morning, IV tap is out of my arm, and once more I’m stripped of all the monitoring pads. I think I’m ready to go when I’m told to wait for the doctors. So I wait, it drags on another hour. Then they show up, all of Larry and his brothers and a couple of sister cardiologists. They pat me on the back and tell me not to come back soon. I check the time, and I don’t have much to spare. Out the door I go — the wrong door. There are no cabs around, and I can’t believe it. I check back with the front desk to be sure. I walk down the street for a few blocks and the street names don’t match up with the map on my phone. I stop in a gas station and ask, they have no idea where this train station is, and don’t even know the neighborhood they work in so I can get back over to the street. I go back to the hospital. By this time, I’m ready to hit the bathroom. I go back to the front desk and ask for the Spring street exit, and am taken completely through the complex to the other side. I look at the time and it’s not looking good. Oh, well, if I miss the train I just walk back, right?

One mile to the station and I take off in a brisk walk. I keep walking but ask people as I go by if the station is up ahead. I’m sensing that I’m going up a little incline, and that’s not helping much. This one mile is much farther than one mile used to be. I get up to the station which is nothing more than a full parking lot, overhang, and a bench. I sit on the bench to take stock of the situation, and see an LED clock. I’m five minutes late. I look around and there isn’t a soul in sight. I feel tired, but exposed and vulnerable. I get up an make my way back down to the main road, girding myself with the last of my determination. A little farther I get to a bus stop, and exhaustion overtakes me. After sitting on the bench for a bit with no relief (and the cold breeze is biting a bit), I ask an old man who to call for a cab. He tells me and the voice on the other end says, “we can’t come.” I google another cab company that answers, and they say, “we can’t get over there.” I’m more than discouraged, I’m desperate, and call 911. They pick me up, give me oxygen, and take me back to the hospital where I go through another battery of tests. I get my wind back in about an hour, and some of the cardiologists visit me to deliver a well deserved dressing-down. I’ve suffered no real injury, but am back in the shackles of an IV needle in my arm and monitor leads sprouting from my body once again.

I call my wife to tell her the bad news that I’m not on my way. I make plans to leave the next day on the official shuttle, with an option to stay overnight at Togus if I can’t get a ride. I get a nice roommate with drastic medical problems who falls asleep on his blaring TV remote, so I’m not resting well for another night. We take off in a small 9-seater van the next morning, and stop at the other VA medical facility to take on more riders. This van has no accessibility features, and a 300+ pound man shuffles up, weak from whatever’s ailing him. With a push and shove and teeter and recovery, he collapses into the back seat. One of the scariest part of this whole journey, the rest of the passengers are angry like I am at the situation. We ask the driver if this was the regular van and he said yes, he wishes that one or more of us would complain about not having a ramp, lift, or something more than a stepstool. We assured him we would.

I’m not a good traveler anymore, though I used to be. My depth perception has always been skewed from the Coke-bottle glasses I wear, and sometimes a particular view will make me nervous as I imagine myself dangling from the top of a structure up ahead. So I asked to move to a rear seat and kept my head down, texting and playing with my phone as the driver navigated our way through outer Boston. Sensing a lull in the traffic and a straight road, I look out at the coastline with some joy. I know the city is coming soon, so it’s back down to my position before too long. Some days I like to push through my silly projective fears. Today I don’t feel obligated to in the least.

Diagonal flashes of light played at the corner of my eye. I think I might know where I am even though I don’t think I’ve ever been here before. From the front, “Did you know the same firm that built that Florida bridge built this one?” I’m going to keep my head down for a while more. Lights go dark, the traffic noise changes. I sit up and am amused as we course our way through a tunnel. Wow, this is a long one! Feels good to sit upright, and chat some more with the other passengers. The dot of daylight up ahead forms into a rectangle and slowly gets larger. We must have passed through here when we came down in the ambulance. No wonder why things happened the way they did. Our van must be emerging from Bizzaro World.

We have a blissfully uneventful trip back to Togus. With a bummed ride across town from one of the vet passengers, I hang out at a donut shop while my wife navigates the bumpy road down to pick me up with plenty of daylight to make our way home safely. A joyous reunion, an uneventful ride home. A light supper and we’re all ready for bed on time.

We lie there and she says comfortingly, “Things are going to get back to normal.” I reply, “No, things are going to get better.” And finally, in a locked home outside of town on the main drag, I let the tight hold on my thoughts go.


Skirting the addition

Skirting the addition is not the same as skirting the issue. I’m using pre-painted roofing, cutting it with a Dual Saw and burying it 5 to 7 inches deep in the ground.

Some things that’s helped me do this project:
2×4 strongtie metal ledge hangers, 1 per three feet
Pressure treated 2×4 “stud”, mounted widthwise, 2 ” above ground level
Roofing screws with rubber washers, 1 1/2″ and 2″
Screened loam, John Deere tractor
sharp square loam spade, rake
8p short galvanized nails, palm nailer, compressor, hose


Installing Skirting

lots of clamps, sawhorse, extra 2×4’s to clamp to
tape, level, tri-square, sheet-stock square, pencil, marker
hammer, punch, drill, 1/4 ” hex driver bit

A graphical MD5 validator

Sometimes, in technology, you just go around in a circle. Back in 2007, I was cruising Ubuntu Forums and found this thread that intrigued me. A lady was looking for a gui that would give an MD5 hash for a file. I played with some code to help her then, and subsequently forgot about it as I started using the excellent Download Them All Firefox extension, which includes checking files downloaded from the Web against any number of verification codes, including MD5.

So last weekend I started looking at lightweight Debian-based distributions to load on my big USB stick to run as a Live USB. I found one I wanted to try (PureOSlight) but the website only gave an MD5 of the ISO image, and a link to a third party website where I could get  a torrent file so to download the image via BitTorrent. Playing with unknown software is risky enough, but in this situation the original author has no direct control over the ISO image I was going to fetch. So verifying against his MD5 hash was the only safe way I could work — and my BitTorrent client, Transmission, didn’t have a hash-checking feature as far as I could see.

So while Transmission was getting pieces of my image from four different unknown places, I thought, it would be nice to get some stand-alone hash checking software. I checked out GtkHash from Ubuntu’s repository and thought it was quite nice, but it was missing two features I wanted. First, I saw no place where I could paste the hash the author provided, so I was going to have to eyeball-compare it against the one calculated by GtkHash from the image file. Man, I’m just too picky sometimes. Also, GtkHash won’t take a filename as an argument, so I couldn’t use it from a file manager. I wanted to be able to use it directly from Nautilus by finding the image file, right-clicking, choosing the Open With feature, then give me a text box to paste the hash into. Then it would calculate the MD5 of the file, and have the computer do the comparison.

So someone must have done it, and Googling around didn’t show any packaged software like that, but I did find my old forum thread from years ago! Since I have a few days off, and am procrastinating on my tax return, I just could not leave this unfinished. Now that I’ve got it to a working point, though, I still haven’t got to play with what I originally downloaded.

I’m releasing this under the MIT license, so you can do what you want with it, except sue me about it, but I would appreciate your posting suggestions for improvement here. This is alpha-quality at this point, but it does do the job.  To install, paste the text below  it into a file named “md5compare” (/usr/local/bin is an appropriate place), and make it executable for all users (sudo chmod +x /usr/local/bin/md5compare). Technical notes from writing this little accessory appear after the code:

#! /bin/bash
# md5compare
# A graphical MD5 validator
# https://jimcooncat.wordpress.com/2011/03/09/a-graphical-md5-validator/
# Released under MIT license
# http://www.opensource.org/licenses/mit-license.html
# Usage: md5compare [filename]
# Can accept a filename for an argument, for
# example to use with a file manager's "Open with" feature,
# or will show a file selector if none is given.
Commandname=$(basename $0)
SupposedMD5=$(zenity --entry \
  --text "Enter MD5Sum that file is supposed to be" \
  --title $Commandname)
if [ $# -gt 0 ]; then
  Filename=$(zenity --file-selection  --title $Commandname)
Tempfile=$(tempfile --prefix="md5-" --suffix=".list")
SpaceChar=" "
echo "$SupposedMD5$SpaceChar$SpaceChar$Filename" > $Tempfile
Result=$(md5sum -c $Tempfile 2>&1 | \
  tee >(zenity --progress --text "Calculating MD5sum" \
    --title $Commandname --pulsate --auto-close) )
rm $Tempfile
zenity --info --text "$SupposedMD5\n $Result " --title $Commandname

Some things I ran into while writing this:

  1. $0 is the full pathname to this script, so I set each window’s title to $(basename $0) in case you come up with a better name for it than md5compare.
  2. I have no real error checking in this script, it would be smart to verify that the hash pasted in by the user is verified to be the correct format before going continuing.
  3. In a full-featured version, it would be nice if the file-picker (displayed if no filename is passed to the script) defaulted to the directory where the user normally downloads their files. We’d need to store that preference in their /home.
  4. The tempfile command is very nice to use to give a unique name to a temporary file. I’m using it here for input to the md5sum command. Initially, I wanted to use a prefix of “md5command”, however it truncated my prefix after the fifth character. That’s kinda lame.
  5. The md5sum input file format is strange. It takes a file formatted with two spaces between the hash and the filename. For some reason (I am a bash noob), when I generated the file using the echo command initially, my two spaces in the script became only one in the file. So I assigned a space character to a variable and it worked properly with the code above.
  6. When running the md5sum command I wanted to show the user any error messages produced by it, so I used the “2>&1” phrase. This redirects stderr to stdout, so the final dialog will show any error messages. The message isn’t really pretty, but it is informative.
  7. While md5sum is churning against a large ISO image file, I piped the output to zenity’s progress dialog using tee. Otherwise, the user thinks that nothing is going on or the script aborted as the last dialog box would be closed. The pulsate feature doesn’t work though, since md5sum doesn’t generate any output while it’s crunching through a single large file. However, it serves the purpose, as the progress box closes when the md5sum command finishes.
  8. The final dialog box could be a bit more informative, especially for a new user.

Your thoughts and suggestions, please!

Packaging Configuration Files?

Dear lazyweb, I have a question about Debian Packaging (which also extends to Ubuntu and related distros) that would allow me to install a server with custom configurations. Here’s an example of what I’d like to do with the venerable openssh-server package, where I want to install an ssh server on a non-standard port.

custom-openssh-server (metapackage)
depends: custom-openssh-server-config, openssh-server

custom-openssh-server-config (adds non-standard port)
contains: /etc/ssh/sshd_config

openssh-server (straight from the official repo)

The idea here is to install our custom config before installing the package we want. Good packages are not supposed to overwrite configuration files.

So when we add our metapackage to a preseed (building a computer from scratch), it would automatically do the right thing. If openssh gets a security update, version numbering would work correctly.

Since we could have some sensitive information in the config files, we could use an ssh repository with apt, or at a minimum only make our personal repository only available on the local network.

Can anyone explain the downsides to this approach?

Attempting to remove U3 with Linux

A friend found a 2 GB SanDisk Cruzer left in a Walmart shopping cart. There wasn’t anything fun on it, but it did have an annoying auto-run program on it called U3.

I’m trying this method from a post at:


Peter wrote at 21 January, 2009 05:21…
So hopefully someone will find this useful. After lots of googling I found that there weren’t any instructions for removing U3 under linux. Truth be told, it’s really easy, but the solution is as obscure as it is easy.

1)Mount the U3 “cd” partition
2)Run Mount to find out the name of the device that U3 is on. It should be some thing like scd#, the important part is the number there.
2.5) Just to be sure you’ve got the right device check that /dev/sr# is a symlink to /dev/scd# that you just found.
3) Now that you know which device you’re looking for you can start the actual removal. cd to /sys/class/block/sr#/device/
4)In this directory is a file named delete, it’s write only by root, and if you write to it (I’ve only ever tried with “1″) the U3 partition will be removed. With root privileges ‘echo “1″ > delete’ removes it quite nicely.

Here was my results:

1) I just plugged it in, it automounted
2) jim@mickey:~$ mount
… /dev/sdb1 on /media/disk type vfat (rw,nosuid,nodev,shortname=mixed,uid=1000,utf8,umask=077)
2.5) jim@mickey:~$ ls -l /dev/sr0
lrwxrwxrwx 1 root root 4 2009-05-12 07:04 /dev/sr0 -> scd0
3) jim@mickey:~$ cd /sys/block/sr0/device/
jim@mickey:/sys/block/sr0/device$ ls -l delete
–w——- 1 root root 4096 2009-05-14 11:32 delete
jim@mickey:/sys/block/sr0/device$ sudo -i
root@mickey:~# cd /sys/block/sr0/device
root@mickey:/sys/block/sr0/device# echo “1″ > delete
root@mickey:/sys/block/sr0/device# exit

After all that, it didn’t appear to do anything. I must be missing a step. I plugged it into a Win2k machine, and the U3 launchpad came up. I removed the software using the uninstall feature of U3.

So I guess that was a bust, but I’ll have more drives in the future to try this with.

Server Wishlist

I wrote these comments in response to Søren Hansen’s post about the future direction of Ubuntu Server development. I’m thankful for the recent discussion started by Thierry Carrez.

My wishlist:

Automatic installation. I’m using network preseeding to install servers and desktops, and it works like a charm. I’ve got apt-cacher in the mix, and when I install a new machine, it pulls only the updates from the Internet. I keep a custom repository, and have been successful in setting things like /etc/network/interfaces by making a small .deb packages to make these customizations. Setting up and adding to the custom repository is a pain, because I don’t understand the tools well enough yet — especially signing the packages so I don’t get security warnings.

Ability to review updates. I’d like a simple way, either through a chroot or virtualization, to subject updates to a vetting process before making it available for installation. Again, repository management tools are needed.

High Availability. Even in a small office, downtime is expensive. I’d like to see packages like drbd-primary and drbd-secondary, where you install each on a different machine, and you have simple redundant storage. Same for essential services like dns, dhcp, internet gateways, font servers, etc.

Guided networking schemes. When setting up a local network, there should be sensible defaults and alternatives to a standardized addressing scheme. IP addresses to use 192.168… or 10.0…? Internal services available at gateway.lan, dns.lan, printers.lan?

File-based LAN configuration. The underpinnings of configuration could be based on files, which can be altered and administered through custom .debs. A database-driven front-end could be used to help define the network, which spews out custom .debs to be distributed through the dpkg updating already in place. If you want to migrate to LDAP or some other “registry” type scheme, have it read from existing files like dnsmasq reads /etc/hosts as a starting point. Don’t force complexity on the network, offer it as alternatives to a simple, robust default.

Bulk deleting Gmail contacts

I’m migrating from a hosted Zimbra email setup to Gmail. When importing my contact data I had some glitches, and wanted an easy way to delete all the Gmail contacts. But no! Gmail only allows you to delete 500 at a time. And to do that, you have to click-click 500 times to select the contacts you want deleted. That wasn’t good for me.

After searching the net and trying a couple of things from posts, I was going to do some major bash scripting. I went out and plowed the driveway, and got a good idea. I’ll just make a little GreaseMonkey script to check off the boxes for me.

I signed into the Gmail account, and clicked the link at the bottom of the page marked “basic HTML”. Then I clicked “Contacts”, then “All Contacts”. I loaded the greasemonkey script shown below, and refreshed the page. The first 400 checkboxes were checked off, so all I had to do was press the Delete button. The page reloads automatically with the next 400 boxes checked. In about a minute, all the contacts were deleted!

Note: I’m using Google Apps for Gmail, your “namespace” below might be different for regular Gmail, I’m not sure.

// ==UserScript==
// @name           Select 400 Checkboxes
// @namespace      https://mail.google.com/a/
// @description    Checks off the first 400 checkboxes; good for removing Gmail contacts
// @include        https://addons.mozilla.org/en-US/firefox/addon/748
// ==/UserScript==

var allCheckboxes, thisCheckbox;
allCheckboxes = document.evaluate(

for (var i = 0; i < 400; i++) {
    thisCheckbox = allCheckboxes.snapshotItem(i);

Learn Technology with Monit

Over the past few days I’ve been playing with software called Monit.

Monit is a utility for managing and monitoring, processes, files, directories and filesystems on a UNIX system. Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations.

Translated to a simpler phrasing, Monit sits in the background and runs tests that you tell it to on your computer, and sends you an email about the results of those tests. Optionally, it can restart programs that stop working, or do any kind of trick you can dream up based on the results of the tests.

Monit comes with it’s own email sender, so you don’t have to set up anything extra to get it to send you an alert. You will need to specify an email server, though.

Getting Monit to run is very simple. Thanks to no-names.biz, I’ve modified their howto posting to show you how to just get it running on Ubuntu 8.04 (Hardy), and I’ve used nano instead of vim as an easy-to-use editor for the configuration files. Before using this, get familiar with nano. I’ve highlighted any portion where you need to substitute anything unique to you, like your email address:

#sudo aptitude install monit

#sudo cp /etc/monit/monitrc /etc/monit/monitrc_orginal

#sudo nano -w /etc/default/monit


Ctrl-O to save the file, Ctrl-X to exit nano.

#sudo nano -w /etc/monit/monitrc

set daemon 60
set logfile syslog facility log_daemon

# If you run your own mailserver (use this or the next entry):
set mailserver mail.mycompany.com

#For gmail instead of your own mailserver (all on one line):
set mailserver smtp.gmail.com port 587 username “you@gmail.com” password “password” using tlsv1 with timeout 30 seconds

set mail-format { from: monit@$HOST.mycompany.com }
set alert you@mycompany.com
set httpd port 2812
use address localhost
allow localhost
allow you:password
## Services
## You put your tests here.

Ctrl-O to save the file, Ctrl-X to exit nano.

#sudo invoke-rc.d monit start

If all goes right, you should get an email shortly with the subject “monit alert — Monit instance changed localhost”. Because we used the $HOST variable in the mail-format section, you can tell which computer sent you this by looking at the from: address of the email. If you don’t get an email within a few minutes, well, the aggravation can start now while you fix the /etc/monit/monitrc file, probably by monkeying with the mailserver line.

# tail /var/log/daemon.log

The above command will give you some clues if it’s not working right, as monit will log the errors.

Now the fun begins, as we add tests to the end of the /etc/monit/monitrc file.

#sudo nano -w /etc/monit/monitrc
Scroll down to the end of the file, you can just mash the down-arrow button until you get there.
## Services
## You put your tests here.
check host mycompany.com with address mycompany.com
if failed port 80 proto http for 3 times within 5 cycles then alert
check host example.com with address example.com
if failed port 80 proto http for 3 times within 5 cycles then alert

Ctrl-O to save the file, Ctrl-X to exit nano.

#sudo invoke-rc.d monit restart
What this will do is check your remotely-hosted website, as well as the little website at example.com. If your website isn’t up in three out of five minutes, monit will email you an alert. I’m also including a check against example.com, because there’s the possibility that your computer might not be connecting to the internet properly. So if you get an email that both are failing, then it’s a good chance your website is still up, but your internal network’s got a boo-boo.

A huge amount of tests are available, and many different technologies have tests written for them. By playing these tests and researching what they do, you will get a huge dose of technology learning across many different topics. Guaranteed.

Configuration examples from the monit wiki
Service test documentation

I’m currently running this one and trying to figure out how best to tweak it to my in-house server:

## Check the general system resources such as load average,
## cpu and memory usage. Each rule specifies the tested resource,
## the limit and the action which will be performed in the case
## that the test failed.
check system localhost
if loadavg (1min) > 4 then alert
if loadavg (5min) > 2 then alert
if memory usage > 75% then alert
if cpu usage (user) > 70% then alert
if cpu usage (system) > 30% then alert
if cpu usage (wait) > 20% then alert

Hi, Ubuntu Users!

I’m excited to have my blog listed on Ubuntu Weblogs, aka Planet Ubuntu Users. I haven’t missed a day of reading your entries for a few months now, after I discovered my favorite newsreader, Liferea.

I’m a private accountant in Maine U.S.A., and have been working with computers since 1986. I have many interests, and am enthusiastic about Ubuntu — especially the LTS releases. I run Ubuntu exclusively at home, and leverage it just as much as possible at work, though I do have to use Windows for several applications.

My past blogging has been long diatribes about the experiences I’ve had with projects I’ve taken on. I’ll try to put a few special, shorter tips in for you from time to time as I run across them. You’ll see me around on Ubuntu Forums and IRC as jimcooncat.

My current project at work is setting up a two-server system with a shared data partition (drbd), and I’ll be adding a healthy dose of KVM virtualization.

At home, I’m learning to build associative databases using SqLite and Tcl/tk to use for automated publishing. I plan on opening a very small business called “Cooncat Publishing”. I’ll be mostly repurposing publicly available data in a wide variety of formats and media.

Here’s some of my earlier Ubuntu related entries I’ve made before getting on this Planet:

Almost everthing has purpose, including Microsoft Windows

I work with two computer operating systems every day, Ubuntu Linux and Microsoft Windows. I post new things I find on web forums, both problems I’m having and tips for others. Whenever I get help from someone for my problems, I try to help at least one other. Once in a while, I hang out in IRC channels for a quicker fix of my community addiction….

A grand computing scheme

The plan

A few years in the planning, with several false starts, the dream of a smarter computing environment is taking shape. Like many small businesses, ours has a central point of data that is crucial to the business’s survival. Financial data, correspondence, photos, the publications we generate, and contact databases are our office’s lifeblood, and reside on a shared drive on a Windows computer….

Agonizing’s over, accept success when you can

When you don’t know where to start, attack everything at once.

I’d say the heading speaks for itself, yet a new project of this magnitude always seems to boggle me. Other things it my personal life were also in flux, as much as they are now I’m settled. So instead of setting real goals, I had to come to terms with all the relationships that are involved in a reliable, robust computer network….


Thanks for listing my blog!

Agonizing’s over, accept success when you can

When you don’t know where to start, attack everything at once.

I’d say the heading speaks for itself, yet a new project of this magnitude always seems to boggle me. Other things it my personal life were also in flux, as much as they are now I’m settled. So instead of setting real goals, I had to come to terms with all the relationships that are involved in a reliable, robust computer network.

So, mulling over what I’ve learned about technology over the last umpteen years, I agonized. Over stupid stuff: users, groups, hard drives, network cards, virtualization, file systems, updating, customizations, preferences, and so many more things.

Don’t bite off more than you can chew at a time. Especially if it’s not appropriate to spit chunks.

Well, I rechecked the preseed setup I had installed on my computer to start with. Now preseeding, when it’s set up well, is a magical beast. But like most magic, it has some serious problems with fixes when things don’t happen as you expect. To explain, preseeding involves setting up a computer automatically, so if you have to reinstall everything on the computer you can do so quickly without remembering complicated steps. Or referring to half-assed notes you took before.

Therefore I set up two of the big computers to automatically load the Ubuntu Hardy Server operating system. In it’s current state, it’s a very open, stable, practical system with the option of easily adding fancier features that make it robust. But the most advantageous feature is what it inherited from the Debian project; the apt package management system.

So I got the computers to be able to be wiped clean and reloaded with a basic operating system in about seven minutes. I played with this over and over again, adding a few tweaks as I went. When things went well, I’d hit the backup button I installed to make sure my work wouldn’t be in vain if a hard drive failed. Looks like I was in sight of my goal, to be able to install a new server with a minimum of steps that a non-tech would be able to follow by purchasing the right equipment, plugging it in, and not have to make any decisions to get to a working state.

I hit a big snag when I installed two more network cards into the computer, which only had the one attached to the motherboard. I had searched for hours trying to find good cards that would work with Linux and give me the most bang I could out of the office wiring. It was my plan that I was to use one of these to install from, yet during the installation process there was a problem. The card tries to connect to the network twice during the process, and the second time through it couldn’t connect. It was maddening!

Network card Russian Roulette.

Fortunately, the Ubuntu installer has some very nice features, and I found that pressing Alt-F2 I could log into the system at the point it was hung up; and Alt-F4 to see all the messages the installer had spit out. It took me a while, but I realized that it was switching network cards on me between the first and second connection. I googled for hours to find the right answers — I couldn’t have the computer switching network cards on me in some random manner. If I rebooted, or the power went out so long it had to shut down, then I would be the only one able to get it back running correctly. So much for reliability — I felt I was falling back into the hole I’d been spending all this time, and the boss’s money, to dig out of.

After many reboots, I discovered that the computer would assign the network cards at random. Usually, the one on the motherboard would get named “eth0”, but occasionally it would end up as “eth2”. And the other two cards posed a problem as well, in that all I could see was their make and model; since I’d bought them at the same time from the same place, they were indistinguishable.

So as I googled my fortieth page to find some answers, I discovered that the nice folks that provide Ubuntu had solved this problem with some more magic called udev, but it only kicks in after the system is installed. That’s great, but I do wish that it had been more obvious; the configuration file is buried deep in the system. I do have to remember that if I change out cards that I have to find that file again, or the new card will be mounted in a new place, rather than the system automatically replacing the one I’ve taken out.

As much as I hated to, I resigned myself to installing from the original network card that came with the machine. It did have me rethink my security plan, and after agonizing over that for a while I realized that I just had to document plugging a cable in here to start, there when it’s ready to become a second router. No biggie, and it’s embarrassing to worry too much about such a minor thing. But if you know me, that’s not my nature; I cogitate on puzzles until they are solved or something else forces me to abandon it. Then I realized that this whole situation was forcing me to unplug the computer from the jack that goes to the internet while the installation was taking place.

Computers have no soul, and much as you’d like to be friends with them and assign human characteristics, they’ll never watch your back. Yet, this whole project has developed some life of its own; or it seems that way to me. Resolving this problem forced me back to what was smart, and made me realize that the one thing I’d always done during Windows installations — unplugging from the public network — was always a smart thing to do. Even for an operating system that we may feel secure with once it’s up and running.

Hacking is fun, and will cause you much heartache.

So now I had a good basic system going, and it was time to decide what my next move would be. Well, slick as a new Ubuntu installation is, it doesn’t make much of a server out of the box. That’s because any software that talks to the network, that is any process that uses outgoing ports, is disabled even after installation. That’s a very smart move on their part, as the liability of opening a port to the outside world can potentially be huge — or at least screw up your week.

But server software isn’t very useful if it’s not serving, and it’s left to the admin to figure and configure it out. Normally, the process goes like this: you install software, configure it and all the related pieces, it doesn’t work as you expect, you try some features in it you think you may want, you find out you don’t need all that junk, you get it working, and you make some comments along the way if you think you need to do it again.

It works for now. A year later, you install a new computer or some software that changes how things are set up. You go back to what you’ve done before, and remember how clever you were at the time. When you look again, you find you can’t get back to the mindset you were at before. What seemed obvious at the time when you had originally installed the software you’d left out of your comments is now coming back to bite you. And some of the relationships to other software are no longer applicable. Almost always, it ends up feeling simpler just to start from scratch again, so you do.

You know that putting in good comments and achieving a consistent state for others to follow is the right thing to do, but at that point you feel as if you’ve wasted your time. If you’re taking over someone else’s work, its much worse unless they wrote an entire step-by-step how-to document. It’s much better to configure software as an installable package, and keep consistency with the rest of the system. Keep commenting and provide a list of changes you’ve made to it over time, but you really only need to fully explain what makes your customized version different from the default. So, when it comes time for someone else (or you at a later stage in your life) to consider whether to use this version or go back to the drawing board, they only need to evaluate if your package does what they want it to do; and you make it easy for them to make that decision by keeping your notes very simple.

Enjoy the nice things that are right in front of you.

Ubuntu inherited something very nice from the Debian project; it’s not only an operating system, it’s a software publishing platform. Much thought and care has been put into the publishing tools, and hundreds of little helper programs are available to round out your setup. You can list these programs as “dependencies” to your software, and call on them to provide services so you don’t have to write the functionality yourself. That’s great if you’re the official maintainer of the software package, and it works extremely well for their developers.

Now I want to make packages for myself, to set up this new network automatically to a custom configuration. It turns out that the huge effort to develop the operating system does not support this well with how-to documents; or rather that these documents are huge and unwieldy as they address things such as how to submit new work to the society for inclusion in the distribution.

Here’s the choice I was facing: either do things the old fashioned hacking way, or learn how to apply what was already available. I thought some more about how things are normally done by system administrators to maintain and distribute custom configurations. I was looking at developing my own way of pulling down a custom configuration, applying it to the software, restarting the software if needed, etc. Or I could use tools others had developed to do similar things, having to learn their arcane nomenclature and understand their mindset. As I looked at this hard, I could see very clearly that a different system would require much more work on my part than just learning how to do it right in the first place.

Old dog learns new tricks.

So after poring over more how-to documents and bugging the nice people at the Freenode’s #ubuntu-motu chat room, I’ve realized a very simple way to make and distribute software configured to my needs. Note that this is just a starting point, I’ll be refining and better documenting this method as I learn more.

  • Start with a clean working system.
  • Install the official package you want to customize.
  • Tweak the configuration as desired, making comments along the way.
  • Test, re-tweak, and test again until all bugs are resolved or acceptable.
  • In an empty directory, run “sudo dpkg-repack –generate”. This will make the guts of a .deb package with all your configuration changes intact.
  • Edit the DEBIAN/control file to bump the version number up higher than the original software.
  • Run “sudo dpkg-deb -b <your directory>”. This makes a file called “.deb”, which is a hidden file.
  • Rename the .deb file to a standardized package name with your new version.
  • Copy the renamed file to your repository.
  • In your repository, run “dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz”.
  • On the computers you want to install or update, make sure your repository is listed in “/etc/apt/sources.list” or “/etc/apt/sources.list.d/”.
  • Run “sudo aptitude update”. This will make your new package available.
  • Run “sudo aptitude purge <your package>” if there’s an older version of the software installed. This wipes out any configuration files on the target system as well.
  • Run “sudo aptitude install <your package>”. That’s it!

If this looks complex, of course it is. The method has many advantages to it though:

  • You can install the custom configuration on as many computers as you want simply once this process is done.
  • If you want to share your customized package with others, you make a publicly assessable repository and upload/update it.
  • You can include your customized package in a preseeded, hands-off install.

I’m missing some steps I’ll want to include once I learn how, mainly how to proper document the changes. That looks very simple, I just haven’t gotten that far yet. And I’ll be automating this process along the way so I won’t have to copy and paste the somewhat arcane commands. Thank you for reading, I’ll look forward to writing another overly-long post on some irregular date in the future.

« Older entries