Wednesday, March 25, 2009

pdfinfo in centimeters

pdfinfo is one of the utility programs bundled with xpdf that gives useful information about PDF files, including its size. However, the size is written in Postscript points, and I can't say I'm that fluent in this unit to actually know how big that is. So here is a shell function that converts the output of pdfinfo into centimeters. Enjoy !

pdfinfom () {
    pdfinfo "$@" | perl -p -e \
 's#(\d+)\s*x\s*(\d+)\s*pts#(sprintf "%.2f", ($1*2.54/72))." x ".(sprintf "%.2f", ($2*2.54/72))." cm"#e'
}

Tuesday, March 3, 2009

Weird crash with linux 2.6.26

I've had a rather funny crash for the second time now. It goes like this: the interface is freezing (processing event extremely slowly), it is nearly impossible to do anything (but apparently, everything works, just extremely slowly !). Kernel keep on saying this:

Mar  3 18:56:50 tanyaivinco kernel: [ 2385.443069] hdd: status timeout: status=0xd0 { Busy }
Mar  3 18:56:50 tanyaivinco kernel: [ 2385.443069] ide: failed opcode was: unknown
Mar  3 18:56:56 tanyaivinco kernel: [ 2393.777714] hdd: status timeout: status=0xd0 { Busy }
Mar  3 18:56:56 tanyaivinco kernel: [ 2393.777714] ide: failed opcode was: unknown
Mar  3 18:57:01 tanyaivinco kernel: [ 2398.982260] hdd: status timeout: status=0xd0 { Busy }
Mar  3 18:57:01 tanyaivinco kernel: [ 2398.982260] ide: failed opcode was: unknown

One of the funny things is that this time like the previous one, at the beginning of the problem, there is always this kernel message, for which I could find no documentation:

Mar  3 18:56:35 tanyaivinco kernel: [ 2367.012218] Clocksource tsc unstable (delta = 4686267423 ns)

If anyone ever came across this, or has clue, I'm interested !