2013-04-05

Ubuntu 12.04 LTS on a Thinkpad X1 Carbon

Very uninteresting install because everything just works by default, with no configuration: USB-to-ethernet dongle, wireless, audio, webcam, microphone, etc.


Specific machine is the i7/8GB RAM X1 Carbon:

$ sudo dmidecode -s system-version
ThinkPad X1 Carbon
$ sudo dmidecode -s system-product-name
3443CTO

Startup

Immediately on startup there's an error message relating to the display. After about 1 second, the message disappears and the system keeps booting. (I'm not sure if this is a UEFI vs. BIOS thing. If it kept me from booting, I'd look into it. But it doesn't.)

Trackpad

The trackpad is the only thing that's a little fiddly. There are discrete physical buttons only above the trackpad, and the trackpad has some hidden buttons you can access by pressing down on the trackpad itself, like the newer MacBooks. (You can also tap, but I've disabled that.) This means the cursor has a tendency to move around a little when you press down on the trackpad to click. I set HorizHysteresis=50 and VertHysteresis=50 with synaptics to settle it down a little. Full command line for synclient (run in my ~/.xsession):

synclient MaxTapTime=0 PalmDetect=1 
  PalmMinWidth=85 PalmMinZ=17298 VertEdgeScroll=0 \ 
  HorizHysteresis=50 VertHysteresis=50

(PalmMinWidth and PalmMinZ are cargo-culted from previous configs. They may not be necessary at all.)

Software

The non-hardware-related install notes from the Ubuntu 12.04 LTS on a Macbook apply here too. (Sections "Window Manager", "Networking", and "Power Management".)

Other

This part is just a rant:

The most infuriating thing about this laptop is the power supply -- the Thinkpad X1 Carbon uses a rectangular 90W 20V power connector, while other ultraportable Thinkpads (X201, etc) use a round 90W 20V connector. While it's understandable that the X1 Carbon uses differently-shaped connector for purely physical reasons (the round ones would be nearly as tall as the laptop itself), there is no good reason why Lenovo wouldn't make a pair of cheap dongles that convert between the two connector styles (one for each direction).

(If they were classy, they'd include a pair of converters with the X1 Carbon itself, but I'd never truly expect that from Lenovo. I'll settle for the converters existing.)

Mythical part # 0B47046 exists on third-party sites, but I haven't found one that claims to have it in stock, and lenovo.com knows nothing about it.

The sad truth is that while this is extremely frustrating, but not frustrating enough to make me buy something else. Apple, with whom Lenovo is obviously trying to compete, handled similar transitions much more gracefully.

[Updated at 2013-04-08 17:59 EDT.]

2013-03-14

Exporting OPML from NetVibes

I use NetVibes, and have recently tried to export my feeds as OPML, and noticed that it generates invalid OPML. The OPML 2.0 spec states:
A missing text attribute in any outline element is an error. 
NetVibes' <outline> elements look something like this:

<outline title="Netvibes Blog" type="rss" xmlUrl="http://feeds.feedburner.com/NetvibesDevBlog" htmlUrl="http://blog.netvibes.com"/>

It's very easy to fix -- just add a new "text" attribute with the contents of the existing "title" attribute. It trips up some other OPML importers, though.

[Edit: I wrote a little python script to fix this problem specifically: https://github.com/mjkelly/experiments/blob/master/opml-fix-text-attr.py]

2013-02-28

Side-by-side diffs with diff(1)

diff -y

That's it. (Fuck tkdiff, eh?)

[Learned here. I hated on tkdiff all on my own, though.]

2013-01-21

Android App Idea: Simple, Subway-Friendly Commute Timer

This is not a new idea.

There are already several "commute timer" apps available for Android: The usual pattern I see is that they track your location over your commute to and from work, and give you arbitrary statistics based on that. (Total time, plot your path on a map, best/worst time, slow parts, fast parts, etc.) From here, they add various conveniences like starting automatically based on time+motion. Someone mentioned wanting an app like this in a forum post.

I found iCommuteLess and a paid app simply called Commute Timer for Android. They're both right up the alley of location-based ubiquitous computing (shout-out to ActiveCampus!), which makes me feel warm and fuzzy inside, but they're not what I want.

The apps I've found seem to use the GPS extensively, which doesn't work if you're underground. (On, say, a subway.) They (or, at least, iCommuteLess) are also filled with bells and whistles (read: bugs). Phone screens are underpowered and small, and lots of features means a slow, clunky app unless you are very clever and very, very good at UI design.

What I'm imagining is similar to what the forum poster described: a glorified stopwatch. You can start the timer, mark a midpoint (just like the "split" function on a stopwatch), and stop. It saves the history for you in some easy-to-read format. You can do all the number-crunching you want on the file. I specifically would note when I leave my apartment, when I reach the train station near my apartment, when my train arrives, when I leave the train station near work, and when I'm at my desk (plus the reverse).

No GPS means you lose all ability to automatically start and stop, but it also means less battery life (and of course the ability to use the things on trains).

I'll keep looking for something, and if I don't find it, I might have a go at writing it myself. I've been looking for an intro-to-android-programming project for a while.

Of course, if someone reads this (ha), and implements it first (double-ha), that's even better. You can't own ideas, man...

[Edit, 2013-01-03 21:12 EST: This post is already the second hit on Google for "android commute timer app". This doesn't bode well for there being an already-existent gem out there, just waiting to be discovered. Dammit.]

2013-01-16

Git: Picking which diffs to stage

git add typically stages files on a file-by-file basis, but you can stage single diff pieces (hunks) of a file with the --patch (or -p) option to git add.

It will open an interactive console application to let you pick which hunks to stage.

Explained in more detail here: http://nuclearsquid.com/writings/git-add/

2012-12-03

Oh dear


I cannot imagine that the below is a good sign, when combined with a clunking sound coming from my hard drive, and long, long (seemingly random) delays:

[  113.164567] ata3.01: configured for UDMA/100
[  113.164584] sd 2:0:1:0: [sda] Unhandled sense code
[  113.164589] sd 2:0:1:0: [sda]  Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  113.164598] sd 2:0:1:0: [sda]  Sense Key : Medium Error [current] [descriptor]
[  113.164607] Descriptor sense data with sense descriptors (in hex):
[  113.164611]         72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00 
[  113.164631]         00 5e 30 e8 
[  113.164639] sd 2:0:1:0: [sda]  Add. Sense: Unrecovered read error - auto reallocate failed
[  113.164649] sd 2:0:1:0: [sda] CDB: Read(10): 28 00 00 5e 30 e8 00 00 08 00
[  113.164668] end_request: I/O error, dev sda, sector 6172904
[  113.164692] ata3: EH complete

#sixyearoldlaptop #inappropriatehashtags

2012-10-13

Burning CD images from the command line

Example:

$ sudo wodim -v -dao speed=4 dev=/dev/sg0 ubuntu-12.04-desktop-amd64+mac.iso