No EDID info from a monitor? Try replacing the cable.

After some upgrades (kernel and otherwise) to an Ubuntu 12 workstation, a user reported one of their monitors insisted on displaying at low resolution (800x600, instead of the 1920x1024 it had previously). I eventually figured out that X and/or the driver (both Radeon and proprietary ATI) could not get EDID info from the monitor anymore. This lead down a few rabbit holes, including a bug in Intel's driver and reflashing EDID info on the affected monitor.

In the end, though? Replacing the goram cable (analog, if that makes a difference) did the trick. I now have the cable, cut in half, hanging over my desk as a trophy.

Tags: sysadmin hardware

Oh, and did I mention the new scope?

I've wanted to upgrade from my 8" Dob for a while now: not aperture, but go-to or push-to. Since getting back into the hobby a few years ago, I've been starhopping quite happily...but the last few months have become more frustrating, and I've begun to feel "been there, done that" about finding my way along the skies manually every. Single. TIME. I admit it: I felt like I'd done my time, and I wanted something easier.

I've been keeping my eye on Craigslist, and a few weeks ago I saw an 8" Meade LX10, originally purchased in 1999, for sale for a decent price. It came with the Magellan I setting circles and controllers: push-to on a Cat. I quickly read everything I could find about this setup, and decided I could live with it. And hot dog, I was the first to email the seller! He invited me out to take it for a test spin, and I tell you, I was smitten the moment I saw it. That deep blue colour...oh, wow. I'd always wanted a Cat since I was a kid, and now I had one. (Always had an unexplained preference for Celestron -- nothing about the quality of the scopes, just the colour. And now I have a Meade I'm in love with. Funny old world, isn't it?) I tried the setting circles, and they seemed to work well -- really well, actually. The optics seemed as good as I knew how to look for. The field tripod took a while to stop vibrating when I tapped it, but I figured I could fix that. So I bought it. Still, it's one thing to find M13 and M57 when you already know where they are...how would it work, not just on Craigslist, but in real life?

Of course, the clouds rolled in; I'd've been nervous if they hadn't. I did get a chance to try out the mylar solar filter the seller threw in. I had never seen the daystar through one before, and I have just one word: NEATO! I'd tried out a SunFunnel before, and that was cool...but the crispness of the sunspots through the filter was amazing. And of course, I had my oldest son perform an indoor star test:

Indoor star test

As no stars were seen, everything seemed to be in order.

And as clouds do, eventually they rolled out. I went out to a dark(ish) site, did a middling polar alignment, and picked some stars to align on. Lessee, there's Arcturus and Vega -- easy enough, but the controller said "ALIGNMENT ERROR -- CHECK STARS" (which made me think of H.P. Lovecraft and Charles Stross -- anyone here read The Laundry Files?). Oh, right -- I remembered reading that the Magellan did badly if the stars were close to 90 degrees apart. Better to go for a pair around 45 degrees or thereabouts. Well, what about Vega and Albireo? Centre, confirm, centre, confirm, and it was happy. Now to try finding something.

The sequence when something like this:

  • M57: "Yep, it's right there. Cool!"
  • M13: "Noth--oh wait, there it is. Man, I love fine adjustment knobs."
  • M18: "Just a little...there! Holy cow, that's three for three."
  • M10: "M10? Arghh, meant to put in M20. Not even sure what that is. Oh well, let's look...oh my god, it's a glob! It was RIGHT THERE! "
  • M20: "Down? No, let's try along...there! It's there! How did this thing KNOW?"
  • M56: "This is awesome."
  • M11: "Dude! Seriously! "

Now, it was at this point that the battery died on the Magellan. Cue knowing nods about the value of starhopping...I went to manual and started hopping through Sagittarius looking at our galaxy's core. (Not that a lot of starhopping was involved; binos showed every Messier object in the area quite clearly -- a wonderful change from suburban skies with practically no southern horizon.) Despite a dew shield, the corrector plate misted up around 11:15pm, and I decided to pack it in early.

So: Man, I'm happy with this. The alignment was not dead-on every time, but everything I looked for was within an FOV or two (40mm Meade Plossl, so just shy of a degree) of where the controller said it should be. The battery died, sure, but it was the one that came with it -- who knows how long it's been in there. Clock drive: did I mention that it came with a clock drive? and how handy that is? I've been trying to improve the Dob's action for a while, but this is just lovely.

It's not ALL perfect. The dew was annoying, and I had assumed the dew shield would ward it off. The setup is much less easily portable than my Dob. (I never thought I would describe a 50-lb Dob as "portable", but a hand truck does wonders.) And just when I'd got used to one set of mental flips when translating atlas to eye, I have to learn another. (I just about broke down trying to figure out what I was looking at on the moon the other morning.) But oh...oh. This scope is wonderful.

(Cross-posted from Cloudy Nights.)

Tags: astronomy

mini-dinstall: \"File contains parsing errors\"

While setting up mini-dinstall today, I tripped over this error:

$ mini-dinstall -b
Traceback (most recent call last):
  File "/usr/bin/mini-dinstall", line 205, in <module>
configp.read(configfile_names)
  File "/usr/lib/python2.7/ConfigParser.py", line 305, in read
self._read(fp, filename)
  File "/usr/lib/python2.7/ConfigParser.py", line 546, in _read
raise e
ConfigParser.ParsingError: File contains parsing errors: /home/hugh/.mini-dinstall.conf
    [line  2]: '    mail_to = sysadmin@example.com\n'
    [line  3]: '    incoming_permissions = 0755\n'
    [line  4]: '    architectures = all, amd64\n'
    [line  5]: '    archive_style = simple-subdir\n'
    [line  6]: '    dynamic_reindex = 1\n'
    [line  7]: '    archivedir = /home/hugh/public_html/debian/\n'

Eventually, I figured out the reason: leading spaces in each line. I'd assumed I could write the config file like so:

[section]
    # Notice the indentation!
    key = value
    otherkey = othervalue

but that's incorrect; it needs to be like so:

[section]
# Indentation is for suckers and chumps.  Apparently.
key = value
otherkey = othervalue

Hopefully that saves someone half an hour...

Tags: debian sysadmin

Observing report -- August 31, 2013

So I didn't mention it, but a couple of weeks ago I bought a used Meade LX10 off Craigslist. It came with the Magellan I, a digital setting circles + computer that does push-to. Also came with a solar filter, a nice set of eyepieces, and two count'em TWO diagonals. This thing is beautiful. I've always had a soft spot for Celestron, for no particular reason, but man, this deep blue is really, really amazing. I've been playing with it at home, but this was the first time I've had to go out with it. Needless to say, I've been itching to go.

I went out to Boundary Bay; after a short detour along NorDel Way (motto: "Hey, at least it's not Whalley") I arrived and found another guy there with an 11" Celestron. "Is that a CPC?" I asked. "Naw, the CPC's a forkmount, not a GEM like this." "Oh yeah, right..." and pretty soon we were chatting away. His name was Doug, and he was extremely friendly. I asked if he minded company for the night; "Hell no, bring 'er up!"

Took a quick look at Venus and Saturn while waiting for Polaris to come out; showed it to a couple folks out for a walk, who were pretty tickled by it all. By then it ws darker, and I was able to do a polar alignment. First two-star alignment (Arcturus and Vega) gave "ALIGNMENT ERROR -- CHECK STARS", which always makes me think of Lovecraft and Stross. A second try with Vega and Albireo did much better, and when I asked it to show me M57 it was right there. And not only M57 but M13, M18, M20, M10 and M56. I had been really anxious to have the Magellan work...it was a big reason for picking up the scope in the first place. Just tired of hunting all the time, you know? But everything went about as smooth as could be.

I switched back to M8 to do a quick sketch, and see how it looked with the O3 filter; it brought out a lot of nebulosity I hadn't noticed before. M20, the Rosette Nebula, showed a hint of nebulosity around the double star, and maybe, MAYBE something like the dark lanes. But it was pretty faint, and I certainly wouldn't swear to it.

Doug showed me M57 through the C11, and wow -- bright and colourful, which was a first for me; the colour was faint but it was there. Maybe a hint of the central star with AV.

Just as I was looking for the star, Doug tapped me on the shoulder and said, "What the hell are THOSE?" He pointed at two orange lights gliding silently through the sky, maybe 10 degrees apart. I grabbed my binoculars quickly and looked. "Balloons -- balloons with candles in 'em," I said. He had a look and agreed. We'd heard party noises from the nearby golf course before, so we guessed they were having some fun. Those suckers were moving fast, too...some really strong wind there.

Over to M11, which is always pretty, then M16 and M17, which I found in binos and then directed the scope to...because the 9V battery in the Magellan handset had died! I hadn't replaced it since buying the scope, so I'm hoping it doesn't go through batteries quite that quickly. Found M22 and M25 in the neoughbourhood too, and then saw a spectacular fireball that left a glowing trail across the southern horizon. Doug showed me Neptune, which was nice to see.

About 11:30 we noticed we were getting dew on our corrector plates; we struggled gamely for a while while I looked up M15 and M31 (M32 visible, but no sign of M110 tonight), then decided to pack up. The Pleides were rising as we shook hands and said goodnight.

Post-mortem:

  • Oh, I love having a southern horizon.
  • Doug likes the Husky box a lot, recommends it, and says not to worry about collimation, etc.
  • Dew -- I guess I'll have to do something about this.
  • I am very, VERY happy with this scope. The clock drive is wonderful and the Magellan seems to work very well.

Tags: astronomy

Python, Virtualenv and Tkinter

A coworker was running into problems installing Matplotlib under virtualenv; while running "pip install", he saw this error:

/usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld:
cannot find -ltcl

A complication was that he was using Enthough Python; when he used that directly, rather than under virtualenv, it worked just fine.

In the end it turned out to be a long-standing bug in virtualenv. This StackExchange question produced the solution, which is to add these lines to the activate script in the virtualenv:

ENTHOUGHT=/path/to/enthought
TK_LIBRARY=${ENTHOUGHT}/lib/python2.7/lib-tk:${ENTHOUGHT}lib/python2.7/site-packages/PIL
TKPATH=${ENTHOUGHT}/lib/python2.7/lib-tk:${ENTHOUGHT}/lib/python2.7/lib-tk
TCL_LIBRARY=${ENTHOUGHT}/lib/tcl8.5/
export TCL_LIBRARY TK_LIBRARY TKKPATH

Re-source the activate script, and all is well.

Tags: python

Observing Report - August 4, 2013

Today I decided to take another stab at driving up to Mount Seymour, and whaddaya know it worked. Except I got to the top and realized that there were 4.2 x 10^8 biting insects around and I had no bug dope. Back to the bottom of the mountain, find a Safeway, buy bug dope, spray myself in the parking lot and back up just in time to see not only an 11" CPC (my heart's set on the 9"; if it's good enough for Commander Hadfield, it's good enough for me) but also a 20" f/5 Obsession being set up. Introduced myself, then waited for the sky to get dark.

I came to get down. And by "get down" I mean "pick up Messiers in Sagittarius", so I did. My god, I got a lot tonight. They were all sunk in Vancouver's skyglow, so nebulosity was nearly invisible, but: M8, M21, M25, M18 (Swan nebula), and M16. Coulda gone for M24 but I was just too tired by this point.

I took a break, because the Obsession owner was having trouble with the encoders on it and was pretty much too busy futzing with that to look through the scope...so he gave me a turn, and I took the chance to look at M13 (through a 13mm Ethos, no less). No finder on it -- Telrad and laser pointer only -- so it was tricker than I thought it would be to track down M13, particularly balanced at the top of a ladder and trying to find out where the Telrad viewer was. But then I found it and Oh. My. God, It's full of stars. It was incredible: bright as hell, resolved all the way to the core, and big looping chains of suns all through it. In fact, this comparison pretty much nails it.

He had a really slick setup: goto, a sliding canopy in the back of his truck, a million little improvements...it was a wonder to behold. But man, what a lot of work. And climbing up a ladder was a new one on me. I don't know that I'd want something like that without having a permanent setup.

After listening to some poor animal get murdered by another animal, and then verifying that the animals we could hear walking around were deer and not bear, I decided to have a look at M31, now rising. And damn me if I didn't find M32 and M110 both. Woohoo! Pretty sure that's six new Messiers for me...don't have the book I'm keeping track of close to hand, so a guess. But still. Add an ISS flyover, and it was a pretty excellent night.

Tags: astronomy

Observing Report -- July 27 2013

Back to the park...the idea of driving to a darker place after insomnia the night before didn't seem safe. And as for actually staying in and sleeping, pshaw! Gotta get out while it's nice; we've got a cloud scheduled for next Friday.

Started off w/a look at Saturn before it disappared behind the trees...which took about 8 minutes. That's probably it for Saturn and me 'til next spring. Split the Double Double, which was a nice surprise -- but not as nice as being able to see M57 in twilight without a filter. That surprised the hell out of me. Two Iridium flares came and went.

I had intended to track down Bernard's Star tonight, but I left behind the S&T with the chart, and irritatingly Tri-Atlas did not have it. Brief search for NGC 6246 since I was in the area, but no luck. I flailed about, and decided to try and find M51 to compare it with a view from a dark site. Pretty sure I found it, but faint; averted vision only, and no sign of two components.

More flailing, this time about whether it would be possible to see any Sagitarrius/Scorpius objects through this tiny notch in the trees. As it happened, I managed to catch M23 quite by accident; got a quick sketch, noted time and alt/az, then checked it out when I got home. Another Messier, which brings me up to, um, get back to you later. Wait, 47.

Tried for M97 but no luck; tired, no filter, no patience. Then the moon came up, and that was lovely. I thought saw my tunnel between Catharina and Cyrillus. (Not really a tunnel, but it does look like one under the right lighting.) Then I thought it was Alphonsus, Arzachel and Ptolomeus. Then I checked when I got home, and it really was Catharina and Cyrillus.

Overall, it was a frustrating night; I kept wishing for a goto scope, because I was having a hard time hunting things down. I got bogged down, too, by trying to figure out what would be visible through that stupid notch in the tress. Oh, well...a CPC's years off, but I really, really look forward to it.

Tags: astronomy

Wordpress and Vagrant

I wanted to test a new version of Wordpress on $WORK's website, and ran into an interesting set of problems. I figured it would be worth setting them down here.

First: I set up a Vagrant box, got it to forward port 8000 to port 80 on the VM, told Cfengine to set it up as a webserver, then copied over the files and database. Turned out I'd forgotten a few things, like installation of modreverseproxy. I really need to make that into an RPM, especially since it should be pretty trivial, but for now I settled for documenting and scripting my instructions. There were a few other things like that; it's always a good exercise to do this and see what you've left out. Eventually I got it down to a Makefile that I could run on the box itself:

OLD=wordpress-3.4.2
NEW=wordpress-3.5.2

CF=/var/cfengine/bin/cf-agent -f /vagrant/cfengine/masterfiles/promises.cf -KI

go: /var/cfengine/bin /etc/firstrun /www/www.example.com-wordpress /usr/bin/mysql /var/lib/mysql/chibiwp /etc/httpd/modules/mod_proxy_html.so
    sudo $(CF)
/var/cfengine/bin:
    sudo rpm -ivh cfengine-community-3.3.0-1.x86_64.rpm
/etc/firstrun:
    sudo $(CF) -Dinstall_now_please
    sudo touch /etc/firstrun
/www/www.example.com-wordpress:
    sudo tar -C /www -xvzf /vagrant/wordpress.tgz
/var/lib/mysql/example-wordpress:
    mysql -u root -e"create database example-wordpress; grant all on example-wordpress.* to 'wordpress'@'localhost' identified by 's33kr1t'; flush privileges; use example-wordpress; source /vagrant/example-wordpresswp.sql;"
/usr/bin/mysql:
    sudo /var/cfengine/bin/cf-agent  -f /vagrant/cfengine/masterfiles/promises.cf -KI -Dinstall_now_please
/etc/httpd/modules/mod_proxy_html.so:
    tar -C /tmp -xvjf /vagrant/mod_proxy_html.tar.bz2
    sudo bash -c 'cd /tmp/mod_proxy_html ; /usr/sbin/apxs -I /usr/include/libxml2 -I . -c -i mod_proxy_html.c'
disable_plugins:
    mysql -B -u root chibiwp -e "select option_value from wp_options where option_name='active_plugins';" | sed -e's/^/update wp_options set option_value=QQQ/;s/$/QQQ where option_name="active_plugins";/;' | tail -1 | sed -e"s/QQQ/'/g" > /tmp/restore
    mysql -u root chibiwp -e'update wp_options set option_value="a:0:{}" where option_name="active_plugins";'
enable_plugins:
    mysql -u root chibiwp < /tmp/restore
unpack_wp:
    sudo tar -C /www/www.example.com-wordpress -xvzf /vagrant/wordpress-3.5.2.tar.gz
    sudo mv /www/www.example.com-wordpress/wordpress $(NEW)
    -sudo rm -r $(OLD)/wp-includes
    -sudo rm -r $(OLD)/wp-admin
    -sudo mv $(NEW)/wp-includes $(OLD)
    -sudo mv $(NEW)/wp-admin $(OLD)
    sudo find $(NEW) -type f -maxdepth 1 -exec cp -v {} $(OLD) \;
force_upgrade:
    wget "http://localhost/wp-admin/upgrade.php?step=1&backto=%2Fwp-admin%2F"
upgrade: disable_plugins unpack_wp force_upgrade enable_plugins


However, when I browsed to localhost:8000 it tried to redirect me to the actual URL for the work website (http://work.example.com), rather than simply showing me the page and serving it all locally. Turns out this is a known problem, and the solution is to use one of Wordpress' many ways to set the site URL. The original poster used the RELOCATE method, but I had better luck setting the URL manually:

define('WP_HOME','http://localhost:8000');
define('WP_SITEURL','http://localhost:8000');

I can do this manually, but it's better to get Cfengine to do this. First, we have an agent bundle to edit the file:

bundle agent configure_wp_for_vagrant_testing {
  files:
vagrantup_com::
  "/var/www/wordpress/wp-config.php"
    edit_line => vagrant_testing_wpconfig;
}

We specify the lines to add. Rather than install the lines in two passes, which is non-convergent, we add just one line that happens to have an embedded newline:

bundle edit_line vagrant_testing_wpconfig {
  insert_lines:
"define('WP_HOME','http://localhost:8000');
define('WP_SITEURL','http://localhost:8000');" location => wp_config_thatsallfolks;
}

(I found that on the Cfengine mailing list, but I've lost the link.) And finally, we specify the location. This depends on having the default comment in wp-config that indicates the end of user-settable vars, but it seems a safe bet:

body location wp_config_thatsallfolks {
  select_line_matching => "^/\* That's all, stop editing. Happy blogging. \*\/.*$";
  before_after => "before";
}

Second, the production webserver actually hosts a bunch of different sites, and we have separate config files for each of them. Since I was getting Cf3 to configure the VM just as if it was production, the VM got all these config files too. Turned out that browsing to http://localhost:8000 gave me what Apache thought was the default site -- which is the VirtualHost config listed first, which in our case was not our main site. I got around that by renaming our main site's config file to 000-www.example.com.conf (a trick I stole from Debian). Now I could see our main website at http://localhost:8000.

Third, testing: normally I rely on Nagios to do this sort of thing, but it's kind of hard to point it at a VM that might be only around for a few minutes. I could add tests to Cfengine, and that's probably a good idea; however, right now I wanted to try out serverspec, a Ruby-based test suite that lets you verify server attributes.

The serverspec docs say they can run tests on a Vagrant machine, and that all you have to do is tell it so when running "serverspec init." However, I had problems with this; it asked me for a VM name, and I didn't have one...there was only one machine set up, and it didn't seem to like "default". I didn't spend a lot of time on this, but instead went to running the serverspec tests on the Vagrant box itself. That brought its own problems, sinc installing gems in CentOS 5 via the default Ruby (1.8.5) causes buffer overflows. A better person would build a newer RPM, rather than complain about non-schedule repos. However, this Gist does the trick rather nicely (though I also removed the stock Ruby and didn't bother installing Chef).

Okay, so: running "serverspec init" on the Vagrant box created a nice set of default tests for a website. I modified the test for the website config file to look for the right config file and server name:

describe file('/etc/httpd/conf.d/000-www.example.com.conf') do
  it { should be_file }
  it { should contain "ServerName www.example.com }
end


Tags: vagrant cfengine

Observing Report -- July 17, 2013

I wasn't gonna go out, and then I did. As a result, it was kind of a mellow night and a mixed bag for observing.

Saturn was up first; it was low in the sky, and it simply did not support 200X like last time. Noted Titan and moved on to the Moon, which was lovely; saw the Montes Riphaeus mountain range, which is very pretty.

M14 took me a long time to track down; in the end, it was barely visible at 100X. Not only that, the whole star field around here is sparse and faint, and it was so much longer to find than I epxected. I looked up M27 -- another one that took a long time -- and found HD189733. No sign of HD 189733b.

Nearly finally, I tackled Sue French's column in S&T for August 2013: stuff in Auriga. Success: V Aurigae (carbon star), Strue 2547. Sorta success: Struve 2545 (split into two, not three). Failure: Teusch, NGCZ 6751, all the Bernard dark nebulae, NGC 6814.

Final look at M11 -- oh man, that's pretty -- and it was home for me.

Tags: astronomy

Ritter (verb, intransitive)

Today was a battle of wills. My younger son did not want to do something, and his mother and I did. We've been hemming and hawing over what to do about this for a while now. "He's holding on to his independence," she said, "in the only way he knows how." "He's being bloody-minded," I said, "and he needs to learn that we're serious." After a lot of argument, we agreed to try things my way.

So we spent the day, she and I and he, inside, butting heads, in as kind a way as we could manage. Our older son would wander through the room occasionally, curious about what we were doing but bored, bored out of his skull. We were all inside on a beautiful day, inside at two when we're usually out and about by nine.

We made it, but it was not victory; far from it. Our son was stubborn and tearful, just as Clara had predicted. I had an uneasy, growing sense that I'd been overconfident, but didn't know how to say so. So I declared victory early to save face, to keep the progress we'd made, and my wife did her best to explain it to our son: that we wanted him to improve; that we'd made a mistake, and would not do it this way again; that we did not know what we were doing, and that all we had on our side was good intentions.

We went out for ice cream, a reward for staying home all day. The kids loved it, and I think the adults enjoyed it as well. We went to a park and wondered at how they could run around enjoying it so much after being bored or dunned all day. We came home, had supper, watched TV. I took my older son to karate class; he went in barefoot but walking there and back he wore flip-flops. He doesn't often wear them, and he was constantly stumbling and then recovering with a shocking grace, like John Ritter being caught by paramedics. We put them to bed then sat on the patio, drinking a beer, shaking our heads at our luck: our children's patience and forbearing, and our privilege to screw up and still make out.

Tags: geekdad

Observing Report -- July 8, 2013

Originally I was planning to head up to Seymour Mountain...but events intervened, as they say, and I spent the night at the local park. Moonless night, but that doesn't matter much...I can almost read by the streetlights and headlights.

First up, my usual confusion of Saturn and Arcturus. Surprise, this time it's Saturn! Quick look tonight; Cassini Division easy, but did not spend a lot of time on the rest. Four satellites in view; turns out Tethys and Enceladus were quite close when I looked, so no idea which of the two I saw.

I found the top half of Libra (alpha, beta, gamma) through a crack in the trees. Have I mentioned the lack of a southern horizon where I observe? True. So being able to see this was kind of a big deal. Tried finding M80, but no luck; might possibly have been visible standing, but not sitting with the scope.

M13 was lovely, as always; it stood up to 200X tonight. Tried looking for NGC 6207 there as well, but can't be certain I saw anything. Split Rasalgethi at 200X as well. (That combo of the Vixen 12mm and my cheap Barlow seems to work quite well.) Saw an Iridium flare by chance at 11.42pm, which was nice.

Saw M56, which was a first for me. Maybe a slight hint of elongation; certainly no hint of resolution. Found M31 in binos; something faintly depressing about this; are we done with summer already? Found M102, which was a first. Tried for NGC 5907. but no luck at all. Found M25 through a gap in the trees, so at least that worked.

Tags: astronomy

Summer Ale

There are days when I can't see the end of the TODO list. Patch the laptops; add SSL to Postfix, to try and keep the NSA away for one more year; take down the recycling, and the composting, and the garbage; take the empties back to Safeway; pick up the caulking for the bathtup, and a switchplate to replace the one the kids broke. Oh, and we're going to the in-laws too (they live just across town and they're wonderful, generous, loving people, so that is in no way a complaint). I wanted to brew, so I have to pick out a recipe and then some ingredients. I want to go out with the scope, so I need to pick some targets. And it's Saturday, so I'm taking the kids out for the morning (again, not a complaint).

In the middle of that, having to play with Eli, my younger son, can seem like a chore, like something that's taking away from The Things that Have to be Done. He senses that, too; he's five but he's no idiot. I'm mad, but I've got a secret weapon: while we were out this morning buying donuts (one each; their money, their afternoon treat) I bought myself a 10X magnifying glass (a loupe, basically). Now's the time to take it out. Sitting down on the front step, I see a sowbug exoskeleton. I pick it up, put it under the loupe and look. "Oh, wow."

"What is it?" He's cautious, but interested; he's pretty much over a phase where he was Not Interested in the things I wanted to show him. That was probably my fault as much as his. I wanted to show him things, all the wonders of the universe, and at some point he had enough, and he didn't hesitate to tell me so. We're both stubborn, a fact my parents grinned at knowingly when they were visiting a few weeks ago. At the time, Eli and I spent a certain amount of time glaring at each other. But now, he's watching me squat ungracefully on the sidewalk, trying to see what I see.

"It's a dead sowbug. Have a look."

He does, and it's cool, it's interesting. We look for other things: snails, ants, crystal rocks (defined as anything shiny). Eventually his brother comes home and they run upstairs to play together.

Later on I bribe him into helping me take back the empties to Safeway by promising him the deposit. On our way back we find a caterpillar on the sidewalk. He's yellow and black and fuzzy and looks like a toothbrush. We take him home, picking leaves from random trees along the way so he'll have something to east. One of the leaves we pick has the ladybug equivalent of a cocoon on it, and we decide that we should watch for it to hatch.

An hour later, I look at the leaves and realize the ladybug has hatched -- and there it is, bright yellow and looking like a tiny lemon. I call Eli over and we stare at it. There are no spots on it; they come in later, I explain, and Eli says "Huh!" in that way he has when he's actually interested in something. An hour after that we check again. The ladybug has spread its wings to dry, and its shell is showing a couple of green spots.

Despite the desperation, shit got done. The recycling went down. The cat did not vomit on the floor. I got an SSL certificate for the mail server. I watched a movie with my wife and kids. I picked up the ingredients for my next homebrew, a summer ale, and it's mashing now; it'll sit overnight, waiting for me to finish it tomorrow.

Tags: beer geekdad

Check in to an RT ticket with Mutt, Emacs and Orgmode

I keep track of different things I'm working on using a combination of Orgmode for Emacs and Request Tracker (or RT). Although Orgmode can track things like attachments and email, I find it easiest to leave that sort of thing for RT; I use Orgmode to track completion and the time spent on a task. The result of all of this is that I'll often create a ticket for something even when I'm the only one who's involved. RT makes that easy, of course: just send an email, and you've got a new ticket; send an email with a subject line that has the ticket number, and RT attaches it to the ticket. As a result of all this, I've got a fair number of functions and shortcuts in Emacs and Mutt to help speed things up.

One of the things I use is an Emacs package called RT-liberation, which uses the rt CLI tool to search, browse and examine tickets. Here's a function which adds a ticket at point to my Org file:

(defun x-hugh-insert-rt-ticket-into-org (&optional point arg)
  "A Small but Useful(tm) function to insert an RT ticket into Org.

If POINT is nil then called on (point).  If called with arg, check in
as well."
  (interactive "P")
  (when (not point)
(setq point (point)))
  (setq point (point))
  (let ((ticket (get-text-property point 'rt-ticket)))
(setq subject (cdr (assoc "Subject" ticket)))
(setq id (rt-liber-browser-ticket-id-at-point))
(save-excursion
  (set-buffer (find-file-noselect "/home/hugh/all.org"))
  (goto-char (point-min))
  (if (search-forward-regexp  (format "^\\*\\* .*RT #%s.*$" id)
  (point-max) t)
      (message "Already in org!")
    (progn
      (goto-char (point-max))
      (if (bolp)
      ()
    (insert "\n"))
      (insert (format "** RT #%s -- %s\n" id subject))))
  (if arg
      (org-clock-in)))))

It's not wonderful, but it does the trick. It does have some important assumptions, though:

  • my one-and-only org file is at "/home/hugh/all.org" (I really should be using a variable here)
  • tickets are listed in that file in the format "RT #1234" (which is my personal preference)
  • the text-properties for RT-liberation won't change any time soon

Okay, so now I've added a ticket to Org and I've clocked in. Let's say I'm going to make a change to a Cfengine file and commit in Git. I want to include a reference to the ticket, so I use this Emacs function:

(defun x-hugh-insert-rt-ticket-commit-comment ()
  "A Small but Useful(tm) function to insert a comment referencing an
  RT ticket.

Uses the currently-clocked in task as default."
  (interactive)
  (insert-string (format "see %s for details."
  (x-hugh-clocked-into-rt-ticket))))

I've got that bound to a keyboard shortcut, so I'll type something like:

Get Cf3 to check that foo is set;

then type my shortcut (C-cos), and I get:

Get Cf3 to check that foo is set; see RT #1234 for details.

The Emacs functions to see what ticket I'm checked into:

(defun x-hugh-clocked-into-rt-ticket ()
  "A Small but Useful(tm) function to see if I'm clocked into an RT
  ticket.

Depends on regular expressions, which of course puts me in a state of
sin."
  (interactive)
  (if (equal nil org-clock-current-task)
  ()
(when (string-match "\\(RT #[0-9]+\\)" org-clock-current-task)
 (eval (format "%s" (match-string 1 org-clock-current-task))))))

As it says, it depends on regular expressions -- but that works okay for now.

(defun x-hugh-insert-rt-ticket-into-org-from-rt-email (&optional arg)
  "Insert an RT ticket into Org while editing a reply to that email.

Faster than waiting for rt-browser to update."
  (interactive "P")
  (save-excursion
(goto-char (point-min))
(search-forward "Subject: ")
(if (search-forward-regexp "\\[rt.example.com #\\([0-9]+\\)\\]\\(.*\\)$" (line-end-position) t)
    (progn
      (let ((id (match-string 1))
        (subject (match-string 2)))
      (save-excursion
    (set-buffer (find-file-noselect "/home/hugh/all.org"))
    (goto-char (point-min))
    (if (search-forward-regexp  (format "^\\*\\* .*RT #%s.*$" id) (point-max) t)
        (message "Already in org!")
      (progn
        (goto-char (point-max))
        (if (bolp)
        ()
          (insert "\n"))
        (insert (format "** RT #%s --%s\n" id subject))))
    (unless arg
      (org-clock-in))))))))

So all that's good, but I have to be editing an email in Emacs to do this -- say, by hitting "Reply" to check in. Which is fine, but I'd like it to be faster. I can take advantage of the fact that I have Emacs running in daemon mode all the time, and that it loads my Org file on startup, to try checking in just by piping the email to emacsclient. So here's the shell script:

#!/bin/bash

# We have to save to a temp file because, unlike the main "emacs"
# binary, "emacsclient" will *not* deal with stdin.
T=$(/bin/mktemp /tmp/org-clockin.XXXXX)

cat - | tee $T >/dev/null

emacsclient \
 --eval "(progn
 (add-to-list 'load-path (expand-file-name \"~/.emacs.d/org/lisp/\"))
 (add-to-list 'load-path (expand-file-name \"~/.emacs.d/org/contrib/lisp/\" t))
 (require 'org)
 (load-file (expand-file-name \"~/.emacs.d/x-hugh-org.el\"))
 (find-file \"$T\")
 (x-hugh-insert-rt-ticket-into-org-from-rt-email)
 (kill-buffer))"
rm $T

Finally, the Mutt macro:

macro index ,a "|/home/hugh/bin/org-clockin.sh\n"

And now I can clock in right from the Mutt index view.

Tags: emacs orgmode

A couple of handy Emacs functions

First, a short function to attach a file when editing a Markdown page in ikiwiki:

(defun x-hugh-wiki-attach-file-to-wiki-page (filename)
  "This is my way of doing things."
  (interactive "fAttach file: ")
  ;; doubled slash, but this makes it clear
  (let* ((page-name (file-name-nondirectory (file-name-sans-extension (buffer-file-name))))
         (local-attachments-dir (format "%s/attachments/%s" (file-name-directory (buffer-file-name)) page-name))
     (attachment-file (file-name-nondirectory filename))
     (attachment-url (format "https://wiki.example.org/wiki/attachments/%s/%s" page-name attachment-file)))
(make-directory local-attachments-dir 1)
(copy-file filename local-attachments-dir 1)
(insert-string (format "[[%s|%s]]" attachment-file attachment-url))))

Note the way I'm organizing things: there's a directory in the wiki/tree called "attachments"; a subdirectory is created for each page; and the file is dumped there.

Second, a stupid copy-file-template function for Cfengine:

(defun x-hugh-cf3-insert-file-template (file)
  "Insert a copy-file template."
  (interactive "sFile to copy: ")
  (newline-and-indent)
  (insert-string (format "\"%s\"" file))
  (newline-and-indent)
  (insert-string (format "  comment => \"Copy %s into place.\"," file))
  (newline-and-indent)
  (insert-string (format "  perms   => mog(\"0755\", \"root\", \"wheel\"),"))
  (newline-and-indent)
  (insert-string (format "  copy_from => secure_cp(\"$(g.masterfiles)/centos/5%s\", \"$(g.masterserver)\";" file)))

Both are mostly learning exercises and excuses to post.

Tags: emacs ikiwiki cfengine

Observing Report -- June 22, 2013

This is the first time I've been out in a while, and the first clear skies too -- and I almost didn't bother: it's a full moon right after the summer solstice, so what's the point of going out when it's not going to be dark? Two things changed my mind. One was catching up on Uncle Rod and reading this bit:

When I hit the field, I was a little surprised to be playing Lone Astronomer once again, but some folks will choose to sit in front of the cotton-picking boob tube if the weather forecast ain't perfect. Hell, I've been known to do that myself, but the problem is that we don't get many "perfects" in the summer down in The Swamp, so you have to take what you can get if you want to see anything. I am back to my old mantra: "If it ain't raining, head to the dark site."

Another was running into a friend of mine at a local park (the one I observe at, coincidentally); while our kids were playing he asked me how long I'd been interested in astronomy, and what it meant to me. That's a comprehensive question, and my answer was: the beauty, stamp collecting (challenge of starhopping, thrill of completing a catalogue) and the science. All that was off the top of my head, but I think that's a pretty close answer. Without further ado, then.

The sky was clear, just gorgeously so. I headed out about 10:30pm and the moon was already visible not just above the horizon but above the trees where I observe. This week's wedding reception was finishing The Proclaimer's "500 Miles" just as I caught an Iridium flash -- not the brightest I've ever seen, but still.

After that, it was time to start in on Saturn...and man, what a treat. I experimented with my Barlow, and found that the 12mm Vixen behaved quite nicely in it; the generic 7.5mm Plossl, by contrast, shows a lot of fringing, makes things look smeary and is hard to focus. So, stuck at 200X rather than 320X...but wow, what a sight. Cassini's Division came easily, and the C ring was visible intermittently in the elbows (yeah, that'll work) of the rings. I could see one band of clouds on Saturn itself, maybe two...hard to be sure. The A ring was noticeably darker and seemed textured, which is something I haven't noticed before. I saw four moons: Titan, Rhea, Tethys and Dione; no sign of Enceladus, though I wasn't searching for it.

Eventually Saturn disappeared behind a tree, so it wsa time to move on. I moved to Cor Caroli, which is just a lovely double. And then for fun I looked for M94...and found it! Neat to think what was going on when that light started out. Wandered over to La Superba, a carbon star, and it was pretty too. Tried for M63 but no luck whatsoever. Looked up M11, the wild duck cluster, and was utterly taken with how the bright sky from the full moon made a veery appealing sight: it was harder to see because of the lower contrast, but the joy of seeing it at last was thus the greater.

Finally had a look at Xi Bootis, a double star that's close (only 22 light years) and a candidate for having its own Kuiper Belt. The colours were reported to be blue and yellow, but I couldn't get much blue out of it...

Home again at 1am, making for an amazingly fun few hours. I'm glad I went, and I'll never feel reluctant to go out on a full moon again.

Tags: astronomy

Observing report -- May 6, 2013

After a clusterfuck of a weekend (about which more later), it was time to go astronomizing. But to do that, I'd have to take Tuesday off -- so I did. And what with the nearly new moon and the XOMG weather, I decided I'd go to Boundary Bay. After the last time I went, I got an email from a guy named Scott saying I should invite him along the next time I go. I admire a man who's direct, so I did. And wonder of wonders, he showed up, bringing his 120mm (I think) Skywatcher refractor. We arrived just after sundown and chatted while the ducks and herons dive-bombed us. It was his first time out at the Bay, and my 3rd.

We checked out Jupiter and caught it shortly before it set, low in the sky. We tried looking for the GRS (due to transit at 10.06pm, not 9pm like I thought) but didn't see it. After that it was Saturn, rising in the east. I couldn't see the Cassini Division then (9.30pm, maybe?), but I did see it fleetingly around midnight.

While Scott took pictures of Saturn, I looked up M35 before it set, and found it relatively easily -- much easier than the last time I'd tried to find it. I can nearly persuade myself that I saw NGC 2158.

And by now, M13 was up; I showed it to Scott, and he found it in his scope. "That's the first non-planet I've seen with this scope," he said. Wonderful, beautiful, and lovely to see after the winter. M57 was another reminder of last summer, and so was Albireo. Gorgeous in Scott's scope.

Markarian's Chain -- would you believe I saw part of this? True: M84, M86 and NGC 4438/4435, which may have been split. Barely. And M87 again, as I starhopped over. And but so after that it was time to head home, where I'm typing this now and am tired enough that I'm going to just post this and go.

Tags: astronomy

There and back again

So Saturday I get an email from Noah, a sysadmin I met at LISA (in 2006. Whoah. Anyway:) saying he was going to be in Bellingham for Linux Fest Northwest, and did I want to meet up? Talked it over with Clara, and she was up for it, so sure, why not?

We headed through the Aldergrove border crossing after hearing that the Peace Arch was on fire or some such, and got through in about five minutes. And after four hundred questions from the kids about were we there yet? is this America? why are you turning around here? we found where we needed to be quite by accident, a good two hours earlier than we figured we'd be. Met up with Noah who's sporting the most awesome 70s Mountain Man look, and agreed to meet up again for lunch -- we had kids to maintain, and figured we'd hit a park or something to run them for a bit.

Walked around the vendor area for a bit first, which showed that someone had managed to get my number: not only the FSF and the EFF, but a guy with an automated homebrewing setup controlled by Linux and the local astronomer's club. The kids got lots of stickers, and someone gave my wife a Pear Linux install CD. ("Why do I want this? I've got Ubuntu.")

We drove off looking for a park but couldn't find one; instead, we went to Trader Joe's. Clara took my oldest son inside while I stayed out minding my youngest, who'd managed to fall asleep on the way. There was also a toy store beside it, and when the youngest woke up he and his brother headed in there to spend their one American dollar each while I walked through TJ's. And holy crap: America's alcohol selection is incredible. A box of wine for $9. Lots of beer I had not seen, and for damn good prices too. I bought up a bunch, threw it in the trunk of the car and then met up with the kids who were just about to buy a big bag of army men. "I love America," sighed the youngest.

We drove down to Boundary Bay Brewing for lunch with Noah and Sarah. Clara had the ESB (okay, but we agreed that Central City's was better), Noah and I had the single-hopped Amarillo Pale Ale (wonderful) and Sarah got the Tripel (which was awesome; a light version with noticeable coriander, not like the dark/fruity dubbel's I've brewed). Oh, and the food was pretty good, too. We caught up with each other, talked about life in small hick towns, and just had a grand old time.

Finally it was time to go. I thought I'd brought down a growler, but no such luck, and we decided we'd stick with the beer we got at TJ's. I gave Noah and Sarah the two bottles of homebrew (#46, a dubbel, and #47, an IPA) we'd brought them, and we said goodbye. The drive back was completely uneventful except for paying duty at the border, which basically doubled the amount we paid for the alcohol.

All in all, a damn good time. Next year I may even go to the actual talks...

Tags:

Random Reading

Oh, what a week. I'll write about that later. Inna meantime:

Tags:

Week of DOOOOOOOOM

Wednesday: A very important fileserver panicked and rebooted, apropos of nothing. I can't figure out why.

Thursday: Around 1.30am, a disk array at $WORK noticed one of its driveswas likely to fail shortly. It got very excited and sent me one hundred and fifty (150) (not exaggerating) text messages. When I got to work I failed the drive, put the spare into the array, the array started rebuilding, and I called Dell about 10am to arrange for a replacement to be sent out the next day (that is, Friday -- today).

When the rebuild was done it complained that another drive was likely to fail shortly. I contacted Dell and was told that the complaint about the second drive was a) misguided (it wasn't really failing) and b) really meant that the array (that is, /share/networkscratch) was likely to fail entirely. They called this a punctured stripe and there are more than a few complaints about this terminology. Anyhow. The only solution was to back up the data, delete the array, recreate it and restore from backup. "Everybody out of the pool!"

About 6pm last night the process was finally done, but the array still complained that the drive was going to fail soon. I contacted Dell again, and after looking at the array they decided that the second drive really was failing after all -- in fact, it had probably failed first, the array had been compensating for it all this time, and its problem only became evident when the other drive failed. A second replacement drive is due to arrive Monday; it was too late by this time to have it arrive today.

I brought up the server, restored the 2am backup to some spare space, and went home; this was about 9.15pm.

Friday: a long-running (ie, monthlong) rsync process decided to suck up all the memory on our webserver. It had to be forcibly rebooted.

And now I want a beer.

Tags: sysadmin

Observing Report -- March 31, 2013

Last night, after a beautifully clear day spent with family, I drove out to Boundary Bay to observe. It's near a small airport south of Vancouver, and it's far enough away that you can see the light dome of the city rather than be enveloped in it. I've been there once or twice before for the star parties that the local RAC chapter has here (last Saturday of the month; check Twitter for updates), but not to observe. I've only been out of the city once a year or so for semi-dark skies, so I thought it was the right time: a four-day weekend with an unconscionably gorgeous stretch of weather.

I'd packed up earlier, so after saying goodnight to the family (and making a note to try for some of the Virgo Messiers) I hopped in the car and drove off. Even with a wrong turn it was only half an hour there (35km), and I arrived about twenty minutes past sunset. I parked, finished up my tea and set up the scope and table (plus a cardboard flat from Costco that had held coffee to use as a dew shield, which worked amazingly well). I don't usually drive to observe, and I was pleasantly surprised at how quickly everything was going. The only downside was that by the time I remembered I'd wanted to collimate (something I don't do nearly often enough), it was too dark for me to see in the eyepiece...a laser collimator would definitely be nice. I'd also forgotten the dew shield for the scope, but it turned out not to be a problem.

Twilight deepened; I listened to the wildlife. There are a ton of birds there -- I saw a heron not five meters away -- and it was enchanting to think "What's that weird sound?" and realize it was the hissing of a flock of birds going by. The stars came out, and I was surprised at how high Sirius was: enough to see the whole of Canis Major, and Crater and Corvus -- constellations I never saw before. The horizon there is flat nearly all the way around, and that is such a change from my usual location. More than that, though, it was darker (even a half hour before twilight was over) than I ever see at my usual place (a suburban park with no shield from the many streetlights). I resolved to come back in the summer to look at Sagittarius and Scorpius.

Finally it was dark enough to look for Comet PANSTARRS. I hadn't prepared much, but I knew that it was near M31. A short pan around in the binos, and there it was about 6 degrees below the galaxy -- almost in the same FOV. I was just able to make it out the tail with direct vision, and it became an obvious fan in averted vision. Viewing it in the scope at 48X brought out more of the fan and made it brighter, but it was still better in AV. In both the binos and the scope, the nucleus was obvious and pointlike.

By this time twilight was over. I took a moment to see how dark it was (mag 5 with AV), then for fun pointed the binos at Sirius. Could I see...yes, I could: M41 (below the trees where I usually observe), M46 and M47 (which I'd had the devil's own time trying to find this winter). I took a look at them through the scope, too. I don't remember much about M41, but it was pretty enough. M47 was sparse, stars in obvious chains and arcs. M46, though...wow: a cloudy scattering (obtypo: scattery, which I think sounds really cool) of faint stars, almost glob-like in the way it was just on the verge of resolving. Almost as good as M11, the Wild Duck cluster, and that's saying something.

A couple had parked earlier to go for a walk, and at this point they came back. I asked if they wanted a look through the scope, and they were happy to do so. I showed them Jupiter, M42 and the Pleides; they were amazed. We talked for a while longer, and I told them about the observing parties the RASC puts on. Hopefully they'll make it out the next tme.

It was 10pm by this point, and I decided it was time to try for M65 and M66. These pretty much skunked me the last two times I tried for them, and I was trying not to get my hopes up about seeing them here. But YES: in the binos, if I held them steady, they showed up with AV, and through the scope at 30X with AV. Awesome! Bumped up the power to 48X and saw them both with DV, faint but there. Not only that, but I was just able to pick out NGC 3628 at 100X with AV and complete the Leo Triplet. At 160X I could see a definite nucleus to M66, but no features on M65. Man, I was happy about this.

Well, if I can get those three, let's move on, right? I went for M51 next. It might have shown up with AV in steadied binos, but it was obvious (and obviously two parts) at 30X in the scope. At 100X a satellite went through the FOV, which always makes me smile. At 160X it almost seemed like one of the parts -- the main galaxy, I think -- had a starlike nucleus. The two parts were definitely separated by now, but I could not see any spirals or any sign of the bridge between them. Still, this was another galaxy that had skunked me the last time I'd tried for it, and I was really pumped about finally seeing it. (BTW, this sketch of M51 through a 28" reflector is incredible.)

Saturn was up, though still very low, and I took the chance to see it. Lovely; no sign of the Cassini division, which was not surprising.

At this point I realized that M63 was close to M51. Should I try for it? Why the hell not? And again, obvious at 30X; 48X showed a slight brightening on one side, I think.

It was getting late, and the caffeine was starting to wear out, but I wanted to try one more thing: I'd printed out setting circle locations for M84, and I wanted to try dialing it in. I didn't hold out much hope for it, since I'd had such mixed results with setting cirlcles previously. But what the hell...140 degrees azimuth, 47.8 degrees altitude...look through the 40mm eyepiece, move it around a bit -- and holy shit it's there: a dim but obvious elliptical. Success!

Now at this point I ran into difficulties: yes, I'd found a galaxy. But confirming that it was M84 was tough. (I was happy to have seen anything, but I wanted to know what it was I was looking at. Plus, I was hoping to see more of Markarian's chain.) Have you ever looked at a chart for the Virgo area? I had, but I hadn't paid attention. It's a mass of galaxies and labels, with a handful of faint stars thrown in. It was extremely difficult to see what I was looking at. I sketched the area as best I could, then closed up shop at midnight and headed home; I took the wrong turn but still made the trip in a reasonable time.

Looking more closely at this today, I'm fairly sure that what I actually saw was M87, not M84; there's a slight J of three stars due south in my sketch, and a rectangle of stars to the east. And M87 is only a degree off from M84, so I was definitely in the right neighbourhood. I'm going to call it M87. Too bad it wasn't part of Markarian's chain. I really need to start making these tough observations earlier in the night.

So: it was an amazing night. The dew wasn't a problem thanks to the shield; the horizon was simply incredible to see; I did my good deed for the day with some sidewalk astronomy; I found a comet; the setting circles worked; and I saw an assortment of galaxies and clusters that I haven't been able to see at home. I feel bad about using the car, but it really was wonderful to see all these things. My lovely wife ran interference with the kids this morning and let me sleep in 'til 9am. I had a great time with the kids despite the messed-up sleep (us old folks need their rest), and when I got cranky and stupid later in the day I held my tongue and did not lose my temper. (Now that I'm proud of.) Only thing missing is an observing partner...it would be smart to go there with someone else.

I've added seven Messier objects to my list: M41, M46, M51 (which I'd checked off before, but I don't think that's right), M65, M66, M63 and M87. That brings me up to 40 out of the list -- not bad at all.

Tags: astronomy