login
v2
v1

jmoiron.net

Welcome to my blog. You may view older entries via list navigation, view posts sorted by topic, or see them arranged by date.

Linux Software RAID-5: mdadm

posted November20th, 2008 @ 21:29:10

- tags: general tech , linux

- comments: 0

Setting up a new linux software raid tonight I noticed some new behavior from mdadm that I thought I might share quickly. It looks like, as of around version 2.6.4, mdadm has started creating new raid devices in auto-read-only mode. In this mode, the array flips to read/write after the first write attempt.

Johnny said that's a good idea, because a lot of people reboot right after creating the array (during an install), so this behavior could prevent aborted syncs. Unfortunately, the array must be writable for recovery to occur, and building up the parity blocks in RAID-5 is considered recovery, so to actually get your raid active and in a non-degraded state, you'll want to either:

mdadm --readwrite /dev/mdX

Or you can go ahead and start creating the filesystem.

Pimp your Pimpness

posted October27th, 2008 @ 00:31:49

- tags: development , general tech

- comments: 0

Unfortunately for those seeking pimps or the services of their employees, this is sadly about editors. Seriously.

Almost everything you do on a computer that is done via either the keyboard or the mouse. One of these things (protip: the mouse) is notoriously slow and error prone for some users. I know some of you can't imagine not being able to use the mouse as a veritable extension of your hand, but try to write in your sunday best handwriting using a mouse, or better yet, try using your non-dominant hand, and then you'll know how grandma might feel using the mouse.

The other one of these, the keyboard, is an instrument that were it not for it's age and ubiquity would have probably been replaced by some simplistic user interface by Apple Computer years ago. People's keyboarding speed varies dramatically, and just like playing Guitar, no amount of practice is going to make you any better if that practice is done incorrectly: I've been playing guitar for like 10 years and I still suck, my father has been typing for like 10 years and he really still sucks.

But if you are like me (or you were born after about 1987), you probably use both of these instruments very well. Congratulations, stories of your proficiency on the keyboard and mouse might very well be colorful stories for your grandchildren analogous to walking to school barefoot in the snow.

So where was I. Using the keyboard, most of the time you're typing. Your typing speed is going to be about what it is; most adults have probably been using computers for a while now, and they've probably settled into as fast as their fingers & muscle memory will allow them to. But just because you type at a certain speed doesn't mean you are necessarily limited by that speed when it comes to editing text. That's what this is about.

When you want to delete a word, do you highlight it and press backspace? Do you hit the backspace [number-of-letters] times? Do you hold the ctrl key and hit backspace? When you want to go to the beginning of a line, do you click there? Do you hit left until the cursor moves there, or do you use the home key? These are built-in keys or near-ubiquitous shortcuts for common editing tasks. They are listed in worst-to-best order, the criteria for 'goodness' being speed and the amount you need to think about them (lower is better). These editing shortcuts work well because words & lines are common primatives to all sorts of text editing, and their effects are easily visualizable without any counting. But what if there were other common primitives?

My grandparents generation took courses in writing shorthand. Learning shorthand is essentially learning how to shortcut common note-taking primitives such that you can "write" at incredible speeds. Remember, writing is merely describing tasks that you want to be recallable later via reading. If you develop a system to write in sounds (as many shorthand systems use), then you can perhaps create an expert system with many more sound primitives than letters, but that is far quicker to write in.

What's the point of all this? The point is that if you are in the business of editing things, and you don't use some kind of shorthand editing syntax, you have failed. The point is that if you are a programmer, your editor better be doing a lot for you, and if it isn't, you had better be in the process of making it do more for you. This is the appeal of IDEs; they allow programmers fast access to many repetitive tasks; the big ones are usually writing a variable correctly or viewing the documentation on a particular code object. But these are only good for programming.

So, you should use Vim or Emacs. Or a plugin that emulates one of those and emulates it well. If you don't already, you should pick one (either is fine) and learn it. They are not "normal" editors; they pack their own extensible "editing shorthand" for common editing tasks for all text, not just Java code, or C# code, or code in general. Once you are comfortable with the philosophies behind their shorthands, you can start to alter them as you see fit. While you are learning, concentrate on doing things via shorthand rather than the initially quicker long way. Delete words using dw, internalize what 'w', 'b', and 'e' do. or whatever control sequence it is in Emacs. Start changes with c.

Don't let people lie to you and tell you speed doesn't matter. Ideally, text would change as we identify and mentally solve problems with it, at which point we'd move on to the next problem. For now, we struggle with the keyboard.

Now that my public service announcement is complete, onto the real matter at hand. I discovered two things about vim tonight that scratch a few itches of mine! The first is mksession, which allows you to save editing sessions to a file. You can hook this up to an autocmd or a small script to have vim always save your sessions, if that's your poison. If you are editing a bunch of files but want them closed temporarily, save the session in a file and then source it when you're done!

The other is a modification to buftabs that I had read about a while ago but not incorporated into my work flow. Essentially, buffers always "exist", and even when I close them the number of subsequently created buffers is as large as the number of buffers that had existed previously + 1. That means that over the course of an editing session where I might edit 20 different files, my next file open command will result in a buffer with the number '21' even if I only have 2 buffers still open. Michele's patch was what I needed, but I figured I'd make an option out of it: you can get a similarly modified buftabs.vim that enables counting only visible buffers in the buffer tab list via a variable "g:buftabs_ordinal".

Oh, Happy 21st Birthday, Philip.

The day it ended

posted October24th, 2008 @ 01:12:21

- tags: politik

- comments: 0

sure thing right?

I feel pretty confident now, 11 days before the 2008 US Presidential Election, that Barack Obama will win and I won't have to flee the country in search of sanity and mental health. This is presuming that the recent polls are within their stated margin of error and that massive voter fraud the likes of which likely happened in 2004 and 2000 does not make up for McCain's current deficit.

When all is said and done, the world-scale economic meltdown of the past month will be the "October Surprise" that shifted a close race (leaning McCain, by many counts) to a comfortable Obama victory. There's still the matter of actually voting for the candidate, so please, if you are registered, even in a state like New York where recent polls show a +20 point lead for Obama.

FiveThirtyEight currently shows McCain with a < 4% chance of electoral victory, and has Obama leading in Virginia, Ohio, Indiana, North Carolina, Colorado, Florida, Pennsylvania, and Michigan.

Electoral-vote has 260 electoral votes for Obama in "strong democrat" states, with another 26 in "weak democrat", giving Obama the magic number even if he loses all states currently in contention.

A lot is made of the way the candidates play the political game these days. In serious gaming journalism, the term 'meta-game' has been co-opted to mean roughly a game that exists outside the conventional definitions of success & failure within the game. Although the original meta-game might be bluffing in poker, the tense interplay of poking & parrying in SF3:3s or the attempt to fully chain or 1-life a shmup are also examples: the meta-game in the latter goes beyond a mere attempt to complete "the game", but rather to maximize ancillary (and practically useless) subsystems within the game. Swordless Zelda 1 is possibly another good example.

The way that politics is played as a game that almost eclipses the very real importance of guiding a country of 300m people should be shocking. It's the elevation of public relations, which is essentially propaganda (in it's original uncorrupted usage), to be the defining element of political discourse. The truth of Joe the Plumber does not matter except insomuch as it alters or shapes the narrative of the campaign.

There's a lot of utility in this for the major players in US politics. Meta-games are usually far more conducive to specialization; it's difficult to 1-credit Ikaruga, but it's an impossibly rare skill to 1-credit it controlling both players with near-full combos. Thus, meta-games generally offer more opportunity for the punditry to take a roll (of cash money). Today, when something happens, a "senior republican strategist" and a "senior democratic strategist" are invited onto a show, they deliver carefully crafted talking points in order to shape narrative (writing these must be almost a meta-meta-game!), and they amicably sign off and are reinvited regardless of how ridiculous and contradictory they've made themselves. This election cycle, this has gone beyond mere meta status. Outside of precious little detail offered about the economy (McCain's knee-jerk STOP THE PRESSES moments), this election has been entirely about the meta-game with little if no actual game. Even so, it's a game Obama will win.

ˈʃaːdənˌfʁɔʏ̯də

posted September 30th, 2008 @ 23:00:09

- tags: politik

- comments: 0

I remarked to Amit the other day that my titles rarely make sense. In this case, it's probably illegible to you, although I've shown a tendency to title posts in IPA in the past. This time, the title of the post is very much relevant to the concept contained within. Unfortunately, you (the reader) has a homework assignment: you must read this nymag article first.

read the rest of "ˈʃaːdənˌfʁɔʏ̯də"

Picanic Baskets

posted September 22nd, 2008 @ 22:59:30

- tags: life

- comments: 0

I've been trying some self-improvement recently. This is my favorite time of year in the north-eastern United States, weather wise; I feel very comfortable in cooler weather and I like wearing light jackets so it's a win/win scenario. Usually around this time of year, I try to pre-empt new years resolutions. This has always felt like the real "new years" to me, since it is the the start of the pedagogic year.

read the rest of "Picanic Baskets"

django 1.0 enhanced reverse generic admin view

posted September 14th, 2008 @ 17:05:47

- tags: development , web design

- comments: 0

Django 1.0 has some nice new features and some better ways of doing things we used to do manually. The admin app getting decoupled from the ORM has really paved the way for a lot of customization to go into the admin app; so much so that the last 10% it used to be missing for most CMS needs is now probably easily realized via small decoupled customizations.

read the rest of "django 1.0 enhanced reverse generic admin view"

Running for September 11th

posted September 11th, 2008 @ 22:31:38

- tags: politik

- comments: 0

running for 9/11

I always feel like I should write something on this day. I started this blog about 6 months after 9/11/01, and I've been outspoken in my political beliefs since then. The shenanigans going on in the current election mimic the outright shambles our entire society has become in the years following the attacks on WTC and the pentagon. Instead of a day for quiet contemplation and commemoration of innocent lives that were lost that day, September 11th is merely a reminder of how horribly we, the people of the United States, handle disaster.

read the rest of "Running for September 11th"

Not Alltogether Unpainful

posted September 10th, 2008 @ 19:07:42

- tags: development , site news , web design

- comments: 0

From some talks with Greg Deangelis, who seems to have taken Jeremy's design aesthetic to heart, I have decided that I should fix this broken site. Fixing it means a lot of things:

read the rest of "Not Alltogether Unpainful"

Mistakes on a Plane

posted August 15th, 2008 @ 20:00:00

- tags: development , travel , web design

- comments: 0

Editors Note: This entry was published late due to laziness and technical difficulties, and first appeared here on September 7th, 2008.

read the rest of "Mistakes on a Plane"

Good ny-times op ed

posted July 27th, 2008 @ 11:09:33

- tags: politik

- comments: 0

It's not often that I read something that is so dead on I feel compelled to write almost exclusively about it, but this Op-Ed by Frank Rich in the NY Times today is one of those times. It's about the rise of Obama in world politics and how his trip was perfectly timed to reap the maximum benefit. Two particularly salient points from the article:

read the rest of "Good ny-times op ed"