XTerm*metaSendsEscape: true
About a year ago I read Lars Ingrebritsen's blog post welcoming new Emacs developers, which gave step-by-step instructions on submitting Emacs patches, and decided to give it a go. I tackled bug #96, seven years old at that point, which asked for the grep commands to prompt to save buffers before running. A bit of digging around showed that there was a function ready for copy-pasta, so I submitted it. I got asked for a couple of improvements, which I'm ashamed to say I never submitted, and after a while it dropped off my radar.
Well, what do I find in my mailbox today but a note from Lars his own bad self saying that the patch had been committed (Github mirror; easier to link to than the official repo), along with the improvements requested. So, in a minor and somewhat undeserved way, I've added a small brick to that edifice of human knowledge, Emacs. (It would be possible for me to be more grandiose, but not easy.)
Some cool things I've come across recently:
TWiki mode for Emacs -- haven't checked, but I imagine it should be possible to get this work with Foswiki too. Uses orgtbl-mode for tables, hot damn.
This fork of Erin, a TWiki markup mode, adds connectivity through the url package. (I found this and the previous link through Thomas Fitzsimmon's blog post, which in turn came from Planet Emacsen.
Lisp at the speed of thought is in early development, but it looks incredible. A post to emacs-devel by Artur Malabarba (@amalabarba, also on StackExchange).
(aka "random words for titles, please")
$WORK: I've been working on OpenStack lately. It's been fun, despite its frustrations (which I won't list here because I tend to rant a lot, and I'm becoming less convinced its helpful or as funny as I think it is) (which drolly deserves its own bit of expansion...). Why fun? Because a) I've had the luxury of focusing on this for, like, a month now, pretty much to the exclusion of all else, and b) because I'm not on my own. One of my coworkers is doing this with me and he is really, really good. He's careful, his shell scripts make me cry with their beauty, and he's just a lot of fun. And it's amazing what a difference a great bunch of coworkers make (he's just one of a great gang of people).
This has been a real revelation, particularly after visiting my workplace to catch up with people. It was good to see everyone again, but it really reminded me how much all of us needed a change -- me to get the hell out of there, and them to get someone in who is enthusiastic about things again.
It has been quiet over the holidays, which is good; I was on call for NYE and hardly had anything happen at all. And the office was quiet with people being out for so much of it. But I'm looking forward to people being back in, conversations going on, HipChat having more traffic than just me asking Hubot to animate me a Christmas tree.
Holidays: not nearly as long as when I was at UBC, but it was still good. The kids had lots of school vacation, of course, and then there was COUNTDOWN TO XMAS OMGOMGOMG. They nearly lost their little minds with anticipation, but finally Xmas was here and...they loved what they got. Which was a relief; they had been pining for Xboxes and tablets and iPhone 99s and I don't know what all. None of that was going to be happening for so many reasons (money, they're 6 and 8, I have moral qualms about non-free computing) (which is ironic because I have an Apple laptop now for work); they knew that, but I wasn't sure how they'd actually handle it on the day. And it was a non-event: they got sketchbooks and books and toys and were happy as clams.
My wife and I continued our Xmas tradition of Watching Bad Movies on Xmas Eve with "The Christmas Cottage: The Thomas Kinkade" story ($5 in the grocery store bargain bin!). It's no Asylum joint (and what a concept that would be...), but it was still wonderful (by which I mean really odd: Peter O'Toole as Kinkade's mentor, and Chris Elliott as chair of the town's Chamber of Commerce). We didn't get a chance to go out on our own, but we'll fix that one night.
I've been spending time on the Stack Exchange Emacs beta; it's really shaping up. It's been fun to answer some of the questions, and really dig into Emacs; the digging (because it's rarely as straightforward as I think it's going to be) turns up a lot of stuff I never knew.
I sent off my first letters for Amnesty International last month; it's been something I've wanted to do for a while now, and I finally got off my ass and joined their Urgent Appeal network. It's easier to sign up than I thought it would be; I urge you to consider joining yourself.
Reading:
I've decided to have a go at building a proper package for Emacs; it's going to be some Orgmode and RT integration stuff that I've hacked together over the last few years. Mostly it's a learning experience, but there's the chance it might be useful for someone else too...
I decided to use Cask to manage dependencies and, more importantly, add tests. There are some things I've tripped over that I want to record.
Start by running "cask init --dev". This gives you a file named "Cask" that's ready for filling in. Here's mine:
(source gnu)
(source melpa)
(package "yogurty" "0.0.1" "Orgmode and RT integration.")
(package-file "yogurty.el")
(development
(depends-on "f")
(depends-on "ecukes")
(depends-on "ert-runner")
(depends-on "el-mock"))
Most of that is boilerplate, but the "package" and "package-file" stanzas were mine. Then I moved over the functions I had into yogurty.el, and ran "cask install --verbose". This gave me this error:
Packages lacks a file header
I couldn't find much on the Cask website about this, but I eventually tracked it down. First, the Emacs manual describes what's required for a "simple package", and how it has to conform to the Library Headers conventions. Second, there's a package named header2, available from ELPA, that automagically creates the headers you need. The EmacsWiki page shows an example of what you'll get. Fill in the "Version" header, and now you can run "cask install". Hurrah!
[3]: EmacsWiki page
Canada's CSEC tracked travellers at Canadian airports who used the free WiFi. Not only that, tracked 'em afterward and backward as they showed up at other public hotspots across Canada. Oh, lovely.
A TSA screener explains: Yes, we saw you naked and we laughed.
ESR writes about dragging Emacs forward -- switching to git, and away from Texinfo, all to keep Emacs relevant. There are about eleven thousand comments. Quote:
And if the idea of RMS and ESR cooperating to subvert Emacs's decades-old culture from within strikes you as both entertaining and bizarrely funny...yeah, it is. Ours has always been a more complex relationship than most people understand.
My wife takes out our younger son's stuffed dogs for the day, and gets all the space she needs at Costco. WIN.
Looks like the supernova in Ursa Major has peaked at magnitude 10.5 or so.
Have I mentioned Adlibre backup before? 'Cos it's really quite awesome. Written in shell, uses rsync and ZFS to back up hosts. Simple and good.
Maclean's sent a sketch artist to cover Justin Bieber getting booked. I'd like to sketch that well.
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:
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.
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.
I write these blog entries in Markdown mode, but markdown-mode in Emacs doesn't stick links at the end of the text the way God intended (and the way footnote-mode does). This is close, but not yet working:
(defun x-hugh-markdown-footnote (description)
"A Small but Useful(tm) function to add a footnote in Markdown mode.
FIXME: Not yet working, but close."
(interactive "sDescription: ")
(let ((current-line (line-number-at-pos))
(last-line (line-number-at-pos (point-max)))
(link (read-string "Link: "))
(link-number (x-hugh-get-next-link-number)))
(save-excursion
(if (> (- last-line current-line) 1)
()
(insert-string "\n"))
(goto-char (point-max))
(insert-string (format "\n[%d]: %s" link-number link)))
(insert-string (format "[%s][%d]" description link-number))))
(defun x-hugh-get-next-link ()
"Figure out the number for the next link."
(interactive)
(save-excursion
(goto-char (point-max))
(beginning-of-line)
(if (looking-at "\\[\\([0-9]\\)]:")
(eval (+ 1 (string-to-number (match-string 1))))
(eval 0))))
Right now it craps out with a "Wrong type argument: integer-or-marker-p, nil" when it runs x-hugh-get-next-link. Doubtless I'm doing a bad thing in my half-baked attempt to return a number. But still, close!
(UPDATE: I figured it out! To return a number, wrap it with
eval
. Fixed above. Working!)
(Believe it or not, I started out to write about Github and bioinformatics. Such is the life of the easily distracted.)
ObMusic: "The Balcony" by The Rumour Said Fire. Reminds me of 60s folk. I like it.
http://doc.norang.ca/org-mode.html is an excellent tutorial on customizing Org Mode to the nth degree. I keep trying to remember the link, so I'm writing it here to remember...but I highly recommend checking it out.
Here's my attempt at getting a working Foswiki/TWiki mode for Emacs based on Org-mode. I've started taking this good work and mangling it; my excuse is that I'm only just starting to program Emacs.
What works so far: cycling visibility with tabs and detecting levels. Hey, it's a start. :-) Next up is getting Meta-left/-right to work to promote/demote headings; I'm not sure if I should be doing this with Emacs advice, or if there's some other way to locally override a function's definition. Answers on a postcard to aardvark [ta] saintaardvarkthecarpeted [tod] com 'til I get comments sorted out.
When using magit, I came across errors that looked much like these:
Unpulled commits:
fatal: ambiguous argument 'HEAD..exoplanet/compute_server': unknown revision
or path not in the working tree.
Use '--' to separate paths from revisions
(Here, "exoplanet" is the name of a machine, and "compute_server" the name of a branch.)
The problem turned out to be that .git/config looked like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = exoplanet:~/dotfiles-git-master
[branch "compute_server"]
remote = exoplanet
Note how the branch lists the remote as "exoplanet", but there's no "exoplanet" remote config stanza -- only one called "origin". Changing the remote listed under the branch to be "origin" worked. Here's the working config:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = exoplanet:~/dotfiles-git-master
[branch "compute_server"]
remote = origin
Part of how I'm beginning to work with Org and RT:
(defun x-hugh-boxquote-yank-and-indent ()
"My attempt to combine boxquote-yank and indent.
The car/cdr bits are from the docstring for boxquote-points. It's a bit silly to run it twice, but it was simple."
(interactive)
(save-excursion
(boxquote-yank)
(next-line)
(indent-region (car (boxquote-points)) (cdr (boxquote-points)))))
(global-set-key (kbd "<f9> y") 'x-hugh-boxquote-yank-and-indent)
Today I gave some impromptu training at $WORK; the approximate topic was "Saving State in Linux". I've been meaning to do something like this for a while, but it was prompted by a conversation yesterday with one of the researchers who kept losing work state when shit happened -- Emacs window arrangements, SSH sessions to other machines, and so on. I found myself mentioning things like tmux, workgroups, and Emacs daemon mode...and after a while, I said "Let me talk to you about this tomorrow."
So today I found half an hour, decided to mention this to everyone in the lab, crowded into a meeting room, set up my laptop and the projector, and away I went. For a fly-by-the-seat-of-my-pants first attempt, I think it went relatively well. Best idea: asking people for questions. It hadn't occurred to me that people would want to know more basic stuff like "How do I split windows in Emacs?". I'm never sure what people already know, so I don't want to bore them...
Next time:
In other news: finally converted my SVN repos to Git yesterday in a fit of pique. The big three -- my org-mode stuff, and the two Cfengine repos (Cf2 and -3) -- are already in use, as in that's where I'm checking stuff into. The rest (Nagios configs, for example) are being done as I get to them. It's really, really wonderful.
Family: holy house o' plague, Batman!
Gah. We're getting the house boiled next week. (Update, March 13: too late; I puked on Friday night and spent Saturday moaning in bed; my wife did the same thing Saturday night/Sunday. FUCK.)
Also? There's a Planet Lisp. Who knew?
From the Emacs manual:
35.6 Mail Amusements
M-x spook adds a line of randomly chosen keywords to an outgoing mail message. The keywords are chosen from a list of words that suggest you are discussing something subversive.
The idea behind this feature is the suspicion that the NSA1 and other intelligence agencies snoop on all electronic mail messages that contain keywords suggesting they might find them interesting. (The agencies say that they don't, but that's what they would say.) The idea is that if lots of people add suspicious words to their messages, the agencies will get so busy with spurious input that they will have to give up reading it all. Whether or not this is true, it at least amuses some people.
Hee hee. And then there's the Jargon file:
NSA line eater: n.
The National Security Agency trawling program sometimes assumed to be reading the net for the U.S. Government's spooks. Most hackers used to think it was mythical but believed in acting as though existed just in case. Since the mid-1990s it has gradually become known that the NSA actually does this, quite illegally, through its Echelon program.
And now this:
The Department of Homeland Security monitors your updates on social networks, including Facebook and Twitter, to uncover "Items Of Interest" (IOI), according to an internal DHS document released by the EPIC. That document happens to include a list of the baseline terms for which the DHS -- or more specifically, a DHS subcontractor hired to monitor social networks -- use to generate real-time IOI reports. (Although the released PDF is generally all reader-selectable text, the list of names was curiously embedded as an image of text, preventing simple indexing. We've fixed that below.)
Epic.org info here. Some random keywords, thanks to Animal New York:
Here's hoping I never need this: a Tcl script that allows you to use Emacs as an editor for Outlook.
Last night was a rare semi-clear night (this month has been awful, grumble), so I was excited to see the Moon, Jupiter and Venus on my walk home from the bus stop after $WORK; it was kinda cloudy, but not completely, and anyhow the crecent moon was awful pretty through the haze. When I got home I asked my oldest son if he wanted to go out w/the telescope after supper. He was enthusiastic, so I put the 4.5" reflector outside to cool while we ate.
Forty minutes was enough to bring in more threatening clouds, but we could still see the three of them. I set up the scope and had a look at Theopilus. A couple years ago my son noticed its distinct appearance, and asked what its name was. I looked it up, and have been fond of it ever since. This time, though, he couldn't pick it out...but he was still interested, so that was good.
I'd looked on Heavens-Above to see if the ISS was due to fly overhead tonight, and it was -- just before 7pm, right when we were outside. Sweet! Sure enough, we watched closely and there it was, bright as anything and moving just past the moon. But wait, wasn't it supposed to go across the moon? What the...
...and then one minute later, there was the real ISS, and it was going across the Moon (very cool!). And there was the other satellite, almost as bright, moving on a different track. As far as I could tell, both stayed the same steady brightness -- so no tumbling for our mystery satellite. We watched both 'til they passed into the Earth's shadow, then headed inside for the night.
First thing I did, of course, was pull up Heavens-Above again to see what this other satellite was. And I couldn't find anything! There was simply nothing listed anywhere near the time the ISS flew over, let alone something that was supposed to be that bright. No Iridium flares either. Stumped, I reported to my son that I had no idea what it was.
But then I realized that I'd been looking at the listings that were supposed to be brighter than 3rd magnitude, rather than the fuller list that went down to 4.5. It was possible this thing was in the fuller list, but was brighter than predicted (because the predicted angle of reflection was wrong, say). So I pulled up the full list and started looking at tracks.
Sure enough, there were a bunch that were overhead at that time. The ISS was the most obvious one, but looking at the map tracks this Delta II rocket was the one we saw, which had launched the Globalstar 26. Here's the ISS pass:
And here's the Delta pass:
The times don't match up perfectly. The Delta was predicted to reach max altitude at 18:44 and enter shadow at 18:50; the ISS was predicted to reach 10 degrees altitude at 18:51, max at 18:54 and shadow at 18:57. I didn't note the time we saw the first one, since it was right around 18:50 and I thought it was the ISS.
I told my son about all this and -- being the son of a geek -- he thought it was pretty cool. :-)
Also -- and this is completely unrelated -- how did I not know about M-a in Emacs? Ordinarily it's "backward-sentence", but in programming modes, it moves to the beginning of non-whitespace on a line. ZOMG.
Random notes:
It's tedious setting Emacs' window layout just the way you like it -- splitting windows, adjusting their size, switching to the right buffers, etc. And even when it is set, it won't stay that way for long. On top of that, you can't save your window-configurations to disk, so you have to start over from scratch every time you restart Emacs.
There are solutions out there to parts of the problem -- elscreen, revive.el, window-configuration-to-register, etc. -- but none provide a complete solution. Workgroups does.
It is so choice. If you have the means, I highly recommend picking one up.
Samantha Wright is answering biology questions again on her Slashdot journal. She's smart, well-spoken (-written) and generous with her knowledge; it's well worth taking a look at all her entries.
A while back I brewed a double IPA that came in around 9% ABV. I used almost a pound (!) of hops, most of them Falconer's Flight. It turned out pretty well...but I made the mistake of bottling some of the sludge at the bottom with all the hop gunk. I thought it would settle out, but hop bits are surprisingly floaty, and I think I'm going to end up pouring it through a sieve of some kind. (Incidentally, I have not brewed at all this year. Yes, it's only 6 weeks in, but still.)
I am turning 40 tomorrow. (!!) I've taken the day off work, my wife and I are dropping off the kids at my in-laws' 'til tomorrow, and we're heading out for...well, an afternoon on the town :-), heading to Saint Augustine's to see what they've got on tap.
Okay, last micro-update today I swear: you can query Wikipedia over DNS. Here's the description, a short presentation on how it's done, and a bash function. Now to see if I can get something hacked up in Emacs.
Hah! Thanks to Teridon, I can now edit Foswiki files from the command line:
rcs -l TextFileName.txt
ci -mnone -t-none -wusername -u TextFileName.txt
Sweet! Now to automate it in Emacs...
Given the recent hoo-ha about abandoned blogs, and my own tendency to lose interest in writing about something the longer I put it off (I haven't graphed it, but I suspect it's a nice exponential decay), I figured I should finally write up what I've been doing the last week: the move at $WORK to our new server room.
So: construction finally got finished on our new server room. Our UPS was installed, our racks set up, and the keys handed over (though they were to be changed again twice). Our new netblock was assigned, the Internet access at the new location was in place, and movers were booked.
Things I did in advance which helped immensely:
Last Thursday morning, it all started. I got the machines shut down (thank you, SSH and ubiquitous wireless access at UBC) before the two volunteers who were helping me showed up. We started getting machines unracked; since it was only about 20 machines, I figured it wouldn't take too long. While that was true, I had not counted on the rat's nest of power cables (our power requirements were such that we had to connect machines to PDUs in adjacent racks), or the fact that we wouldn't be able to disassemble that 'til we'd got the machines out.
There was one heartstopping moment: a 1U server, while extended on its rails, came off one of the rails while no one was supporting it. Amazingly the other rail held on while it rotated quickly through 90 degrees to bang loudly against the rack. "You swear quickly," the movers remarked. (Doubly amazingly, the machine seems to be fine, though the rails for the thing are shot.)
The movers were big and burly, which was wonderful when it came to moving the Thumper. I weigh more than it does, but not by much, and I'd had the bad fortune to screw up my back a week before the move. It was tricky trying to figure out how to remove it from the rails, but the movers' trick of supporting it with a couple of big blankets, while fully extended from the rack, made such considerations less urgent. Eventually we got it figured out. I don't know how that could have gone smoother, since we'd got Sun to rack the thing and, frankly, it's not like you spend a lot of time un- and re-racking something like that. Anyhow, a minor point.
The new location was right around the corner, which was handy. The movers had put the servers in these big laundry-like carts on wheels; in the end, we only had four of em. We got the machines unloaded, racked the Thumper with the movers help, signed the paper, then went off for lunch where we picked up two more volunteers.
After that, we started racking servers. Having only one sysadmin around (me) proved to be a bottleneck; the volunteers had not worked with rackmounted machines before, and I kept having to stop what I was doing to explain something to them. It would have been a great help to have another admin around; in fact, I think this is the biggest move I'd want to make without some other admin around.
Problems we ran into:
Things that went well:
I'm going to post this now because if I don't, it'll never get done. I may come back and revise it later, but better this than nothing at all.
Another thing I'm trying to do at my new job is make/take more time for long-term planning. I've been dinged by mgt. for this in the past, and while it's not easy to hear I think there has been some validity to this. (My inclination is to concentrate hard on fixing the problems I'm faced with; giving up on something broken, even when doing so would make so much more sense and would free up resources to look for a replacement, just rankles and feels like...well, giving up.) Since the department I'm in is so new, it's even more important to pay attention to this.
Part of the problem is just recognizing that I need to make time. An hour a week to be isolated, and to (say) figure out what I'm going to need to do for the next month, is a habit I'm very conciously trying to adopt.
But another problem is how to keep track of all this. What I've done so far:
I'm a huge fan of Tom Limoncelli's Time Management for System Administrators, and his Cycle system has served me well. I've become a big fan of a paper organizer, so that's how I keep track of things. But it works est as a way of tracking day-to-day stuff; it's not so good at tracking a project that takes weeks, or months, or years.
I've read GTD, and that seems like a good system — but it's very different from The Cycle. I don't want to give up the Cycle, I want to graft on to it. And I'm not sure how well I can do that w/GTD.
I've tried org-mode in Emacs. I'm pretty happy with this, and in fact I switched to it for a while when I first started at this job back in July. It worked well for tracking day-to-day stuff, but I missed the flexibility and ubiquitousness of paper.
So where does that leave me? ATM, (paper planner Cycle)
attempting
some longer-term project tracking w/org-mode. I figure the TODO bits
from org-mode will fit well with the planner, and the flexibility of
Emacs and org-mode (different from paper...oh, how I wish I could grep
paper) will work well for projects...the records for which should,
ideally, be suitable for pasting into wiki-based documentation.
If anyone has any suggestions, please let me know. If I make it to LISA this year, I'll be looking for a BOF about this. (Or maybe I'll just tackle Tom Limoncelli to the ground and holler "I love you, man!" a la "Say Anything".)
Moving on:
I really like TrueType font support in Emacs 23, and ttf-inconsolata in particular. Thanks to Emacs-fu for both suggestions.
I and a co-worker picked up the servers that had, for the last two years or so, been racked at BC Women's hospital (of all places...my sons were both born there). We both had the same reaction when we saw them on a cart, ready to be loaded into our truck: "They're so small!" Seven little 1U servers plus one disk array...you start to think of them as larger-than-life when you're not looking at them all the time, and it's easy to forget just how small they are.
Some interesting discussion on the Cfengine mailing list about how Cfengine should handle packages.
And now it is time for bed.
I knew I didn't like Vaio's very much, but I had no idea they were so awful — to the point of requiring hacking on your goddamn BIOS to enable VMX.
The flash demo for Dell's ML6000 tape library boasts that it's "completely self-aware". Not sure I want SkyNet running my backups…
O'Reilly has an upcoming webcast on -- deep breath -- "Advanced Twitter for Business". (At least they didn't call it a webinar. When I told my wife about this, she said "So...you and O'Reilly break up yet?"
Obviously not, because I've just ordered Backup and Recovery and Linux Clusters with Oscar, Rocks, OpenMosix and MPI. I had purchased B&R at my last job, but this is for me.
And did I mention the dream I had a while back about a Sun laptop that looked like an X4200 server folded in half? In the dream it ran nearly perfectly, except when you tried to go to a web page with flash; then it would crash, and a movie of Matt Stone would play, apologizing on behalf of Jonathan Schwartz and everyone else at Sun.
I'm playing with the CVS version of Emacs after reading about some of the new features in what will become Emacs 23. It's nice, but the daemon mode isn't quite multi-tty — you can run Emacs server, detached from any TTY, but if you try connecting to it with multiple emacsclient instances, the first one is where all the TTY action goes. Not sure what I'm missing.
DNS and Emacs:
Some fun Emacs stuff:
I had a meeting with my boss at work last week (before a nice four-day weekend…the split schedule I've got means that sort of thing happens very rarely. But I digress) to set my priorities now that the upgrade has more or less been finished (lingering issues aside; see ahead).
One of the big things is getting Zimbra set up. This will be nice; we do not have a calendar for the office right now, and this is is getting to be a pain. My boss is open to the idea of something that's not Outlook/Exchange, and that's good.
The other thing is getting a bunch more Windows machines in. This is a small shop, so "a bunch" means another 15 or 20 -- which'll double the number we have. I'm not entirely happy about that, but because this is a longer-term project I've been given time to do this right. And to me, "right" means "using open-source tools whenever possible to manage Windows". Thus, I'll be getting the time to set up Unattended and wpkg, and possibly even digging up Windflower and seeing if it's worth continuing. I'm actually kind of excited about this.
It's a little strange having a manager take this much of a hand in setting priorities; I've worked in a series of small shops and, up 'til now, have been left more or less on my own nearly the whole time. It does feel good to get a bit of direction, though. I mean, I know what needs to be done and I'm doing it, but I've always felt a bit lost trying to decide what's most important for everyone once past the finger-in-the-dike stage.
Now to go try and get Multi-TTY working on this laptop…
Ack: Just realized I never described the lingering problems with
Solaris 10. Fairly simple to describe: LDAP lookups take 'way longer
than they should (ls -l /home/
can take 5 seconds per line
sometimes), and JDS on the SunRays is slower in parts than it should
be (click on the logout button, wait 60 seconds, message pops up
saying "Are you shure you want to log out?"). I'm hopeful I can track
those down without too much effort…
This entry, detailing the love that comes from XTerm's meta-sends-escape functionality, saved me from tearing my hair out today over why the Alt refused to send Meta to Emacs in a terminal. And hurray for this line in .Xresources:
XTerm*metaSendsEscape: true
Exciting times, I tell you.
For a while now I've been irritated with the behaviour of OpenRCS and
Emacs on my OpenBSD machines: every time I try to check out a file
kept in RCS, using C-x v v
(vc-next-action
), I still have to
toggle read-only status on the file. Then, when I try to check it in,
it asks if I want to steal the lock from myself, and never actually
checks it in.
Finally had some time to track this down, and this bug appears to be the cause. I may have to play around with Emacs a bit to get it to ignore the permissions, or I may just use the OpenBSD package for GNU rcs instead.
New emacs, woo! I've downloaded it and compiled it already, 'cos I am that l33+, thank you. But one thing: the tarball is signed by Chong Yidong, pgp/gpg key #BC40251C. I could not find any indication anywhere that this is the right key, or what the right key might be. A quick search turned up lots of posts on the Emacs mailing lists, bugzilla entries and such from him, so I presume it's okay…but it would be nice to make this explicit. (Even a search for the key number turned up nothing.)
This article about updating pkg-src makes me even happier I went with Debian. That is all.
Yesterday I got a new switch in at work. Good god, the 10/100 Procurves are getting cheap — $600 w/academic discount for a 2626. I was just going to rack it, but as always I couldn't stop once I got going; that server room needs a lot of cleaning up. Three hours later I emerged, bloody but triumphant: the network cables were cleaned up considerably, I'd identified the last of the mystery boxes (step-down transformer, not a UPS like I thought), and I'd figured out that the big UPS was only one-third loaded — plenty o' room. Once I get all the cleaning done, I'll post before-and-after pix, 'cos that will be one chunk of work I'll be damned proud of.
Gaw'bless you, Matt Johnson.
A year ago today I mentioned, almost in passing, that I had picked up a cheap wireless router and hoped to get Linux running on it shortly. Since then, I've learned an incredible amount about electronics, reverse-engineering, assembly language, compilers, the Linux kernel, and programming as I moved further up the abstraction ladder. I'm still no expert at any of this, but it astounds me how far I've managed to get along.
Currently I'm stuck at getting flash memory to work -- specifically, being able to erase and then program a chunk of flash memory. The trouble is that the magic numbers that the Linux drivers and the datasheet say are needed don't seem to be working. Previously, I was having the same sort of problem getting the kernel to detect the flash in the first place; the trick was figuring out that GPIO was involved in all this. But I'm doing that same trick now, and it's still not working. As always, I'm not sure what I'm doing wrong.
Still, though, I think I'm going to keep poking at it -- for a while, anyway. My interest is beginning to wane a bit (I flit a lot; a year is a long time to me), plus I got a kid on the way (ack!). I may move on to trying to make all the ethernet interfaces work, not to mention the wireless card, as a way of taking a bit of a break. And of course, I'm still aiming at making the world's first Beowulf cluster of wireless routers.
On another note: today's entry is brought to you by the fine, fine folks at the Free Software Foundation, to whom I've just paid my membership dues for another year. I owe these people a huge amount: not only do I get to use a staggering amount of world-class software, written by their members and with their support, for free (I'm writing this on Emacs right now), not only have I been able to earn a fucking living from what I've taught myself using GPL'd and BSD'd software, RMS has also given us the language to, I dunno, frame the whole question of why this is important: by starting the FSF, by naming the Free Software movement, by giving us the GPL. There are those who disagree, while still cherishing the freedom the FSF seeks -- but I think you'd be hard-pressed to deny the power that one pissed-off geek gained when he got pissed off about some closed-source printer drivers.
(Yes, that may be a big myth -- but that is not the same as being a lie, and the providing^Hsynthesis of motivating myths is important too.)
From their website:
Please support the work of the FSF bymaking a donation,joiningas anassociate member,ordering books and merchandise, or signing your organization up as acorporate patron.
Hate RMS? Fine by me. Give to others:
Do it. We owe them.
Currently writing this entry in emacs. Once upon a time, I stopped using emacs for fear of what loading a 20MB editor would do to the mail server I was working on, and learned to love vi. Prompted by ESR's Art of Unix Programming, I've decided to try pick up emacs again. It's interesting....Anyhow: Right now I'm trying to figure out why the hell writing to flash on the NWR04B is not working. First off, I've edited the map file for the flash devices (drivers/mtd/maps/cx84200-flash.c for those of you playing the home game) so that I've got two partitions declared:
static struct mtd_partition cx84200_partitions[] = {
{
name: "bootloader",
size: 0x00020000,
offset: 0x00000000,
mask_flags: MTD_WRITEABLE, /* force read-only */
}, {
name: "root_fs",
// Codeman's original:
// size: 0x000fa000,
// My efforts at making a root partition:
size: 0x00040000,
offset: 0x000f0000,
}
The first I'm not really doing anything with, but it could (as the title suggests) be turned into a bootloader partition someday. The second is where I'm concentrating my efforts. The read-only flag that was originally in there was removed once I figured out it might help matters. :-) Okay, so now what? Well, got a jffs2 image that I created, so let's try the obvious:
# cat test.jffs2 > /dev/mtd1
...and it just hangs. (I still haven't bothered to figure out how to
make CTRL-C interrupt a process yet...something to do with the
terminal, I think.) Up the debugging output and you see MTD_open
,
and then nothing. I had a look at the part of the driver
(drivers/mtd/chips/sst39vf080.c) to see what's going on here, and I
managed to figure it out a bit. The write operation tries to write one
byte at a time, then reads it back to make sure it got read. If so,
move on to the next byte; if not, try 256 more times (I guess waiting
to see if it just needs a moment) and see if that works. If yes, next
byte; if not, give up on the write entirely. I threw in some messages
to track that, and one that shows what value it's reading back from
flash after the write. After throwing in ridiculous amounts of
debugging info to track this, it seems that the write of the first
byte is simply not working. The write fails, and cat
just keeps on
trying (or something). A bunch of looking around finally turned up
the MTD-JFFS-HOWTO from (I think) the guy who wrote the MTD
driver. 'S full of all sorts of helpful hints, like:
cp test.jffs2 /dev/mtd1
to copy stuff to flash (but I got the same result as with cat),mount /dev/mtdblock1 /mnt && cp foo /mnt
), andWell, fuck. So I follow the directions for the 2.4 kernel
support, and figure out how to compile the flash_eraseall
utility. Wonderful! Ready to go! Just gotta erase this here partition,
and... Only no, that doesn't work: I get the same error re: the byte
not being written as before. I'm currently throwing in even more
unholy amounts of debugging than before, and teaching myself the
simplest bits of binary arithmetic you can image, in order to confirm
that, yes, write protection is being turned off...I think. This
little-endian thing still confuses the hell out of me. The datasheet
sez that, at the address the enable_write()
operation is accessing,
there are 32 bits set aside for controlling the first bank of flash
(which is what we're after here). The 26th bit is write-protect (1 for
on, 0 for off). enable_write()
reads all 32 bits at that address,
&'s it with 0x04000000
, and then WP should be off. So the unholy
debugging shows that the long int being read:
Okay, so that works. Maybe I'll give the flashcp
utility (part of
the MTD tree) a try and see how that goes.
My wife and I kinda made an impulse purchase on the weekend: a new 12" iBook G4. It was weird: I made a joke about buying a laptop. Then I explained that I was only joking, but if we were going to buy one it should be an iBook since I kept hearing how sweet they were. Then we were going to go to Stanley Park, hang out at the beach, but maybe go to London Drugs (I don't know about you Americans, but in Canada we go to the drugstore for everything...car insurance, furniture, computers, you name it. Oh, and occasionally prescriptions) to see what prices were like. Then we were buying one. It all happened so fast.
So far, it's pretty damned impressive. After all the trouble I had to go to get gphoto to work with our digital camera, my wife just plugged it in here and it worked with iPhoto right away. Not only that, but we were looking at a slideshow of the crack-induced photos we'd taken while Fur Elise played in the background. Fucking unreal, man.
It's weird: I do feel a bit like I've made a deal with the devil. I've come to agree more and more with RMS about Free-as-in-Freedom, and here I am with a closed-source OS. Yada-yada-Darwin, what about Aqua? But it's sooooo nice...well, mostly, anyway.
I'm trying to use MacStumbler at the moment to find a wireless network to hook up to, but no luck: it just sits there, looking like it's scanning but with no more feedback than a scrolling bar. Dammit, I thought W2K was the only culprit there...and dammit, if I can't blog from the steps of the Vancouver Art Gallery, this thing is going back to the store. I suspect a problem with MacStumbler, but it's hard to be sure; I managed to find five or six access points at the office with Knoppix and the work laptop, and (apparently) wasn't able to find a thing with MS. I need to find a command-line version.
So far, though, that's my only complaint. Pretty fucking sweet, if you ask me.
Had a problem at work with Debian and VNC: the alt keys wouldn't work,
for some reason. This was pretty annoying for the developer who
really, really wanted to use Emacs. It took me about an hour of
poring through Google -- Jesus Christ, the number of complaints about
ALT keys disappearing, and Good God the long uber-thread about the
change in keyboard behaviour between Debian versions -- to find the
solution: vncserver --compatiblekbd
A-ha!
Back to work and still no wireless access. Carousel is a LIE!!!
UPDATE: The VNC trick doesn't work. Details: The developer is running VNCViewer under VNC to connect to an X desktop on a Debian machine. On that machine, he's opening up an xterm and running User-Mode Linux. Alt-equals-meta works for Emacs when run on the Debian machine, but not for Emacs when run in the User-Mode Linux xterm. Fuck. UPDATE: Buddy found the trick: shift-left-click in the xterm to get the menu, then click "Meta sends escape". Double fuck!