Archive for the ‘Research’ Category

Kindle Touch landscape mode – Ubuntu / Linux fix (my solution…)

December 5, 2011

I got my Kindle Touch Wi-Fi with special offers last week. More info on this nice device at the Amazon Kindle Touch page, the Kindle Wikipedia article page, and of course Google searches will do you lots of good.

Granted I’m busy so I’ve not been able to maximize its use yet but I’ve been able to play with it and organize my books and personal documents already. Overall I like the look and feel and functionality of the Kindle Touch (or KT) and I believe you can search reviews with Google, including this good Kindle Touch review by CNET. For reading novels in the native formats accepted by Kindle (e.g. .mobi, .azw files) the pinch-and-zoom as well as the swipe (or just tap) to go to the next/previous page, among other features of KT, are great.

As a researcher though I have lots of PDFs to read, many of which have text formatted in mathematical notation (such as those made using LaTeX). Of course KT can handle PDFs, and even though you could pinch-and-zoom as well as swipe to pan through a page or through pages, reading a PDF  file this way can be really cumbersome especially since the default orientation of viewing in KT is portrait mode. It would be nice if we can rotate the KT to landscape orientation to better read PDF files. However, according to an official statement from a Kindle Customer Support representative, landscape mode is not available on KT. Bummer. I immediately emailed Amazon at kindle-feedback@amazon.com (all of you should! 🙂 ) asking for future software/firmware update to automatically change orientation in KT, and when might this be.

Right now, a sort of “hack” is possible to allow Ubuntu (and other GNU/Linux distros) users like myself to read our PDF books and files in landscape mode in the KT. An answer is to use the pdftk commandline tool which I made a post about some time ago. You can also refer to the man page of your GNU/Linux distribution after installing pdftk. In Ubuntu, a simple and quick apt-get or Synaptic installation should  do the installation job for you (check my post about pdftk above, or search this blog). The “hack” goes like so:

Say you have a PDF file named mydoc.pdf. To rotate the entire PDF file (assuming it is in portrait orientation by default) 90 degrees counterclockwise (so now the mydoc.pdf is now in landscape orientation) fire up a terminal and type:

$ pdftk mydoc.pdf cat 1-endW output tmp.pdf

Where tmp.pdf is the desired output filename of the re-oriented (now in landscape) version of mydoc.pdf. Now you can copy or email the file tmp.pdf to your KT and read your PDF file in landscape mode. 🙂 I’ve yet to check if pdftk works in Mac OS (I won’t be surprised if it does) though I believe this pseudo-hack might turn out to be more “graphical” or point-and-click in nature than my commandline solution above. 🙂 A user from the Amazon KT support page above mentioned using a professional version of Adobe reader to graphically do this, perhaps in Windows and in Mac OS as well. I’d appreciate if somebody would post a link on how to do this graphically in Ubuntu (GNU/Linux), Mac OS, and even in….Windows… 😉 🙂

Happy hacking and Kindling. 🙂

Advertisements

Find files before/after/in between specific dates

February 14, 2011

Hello folks. \\//,

Well here I am, reading a technical research paper on membrane computing and Petri nets when I decided to download some of the reference materials, conference/journal technical papers, of the paper I’m currently reading.  So I download the reference materials from IEEE Xplore, plus other non-reference materials but still related to the topic I’m reading.

Eventually, I download around 10 PDF files, with filenames made up of purely integers and of course the .pdf extension. Problem is, I’m too lazy (not that much really, I just don’t want to keep doing this manually over and over) to specify each PDF filename, then add them to a compressed archive (this case a RAR file) and then send them to another machine or person or account of mine for archiving.  Essentially, I just want that: to get those PDF files I recently downloaded for this specific topic I’m currently in, not include other PDF files in the same directory, and then compress them into a single RAR file.

How to go over doing this?

Luckily there are for loops and the nifty find command in *nixes like my Ubuntu box. 🙂 So what I simply do is

for i in `find . -type f -cnewer startdate ! -cnewer enddate`; do rar a myrarfile.rar $i; done

which means given 2 reference points, files startdate and enddate, I loop over all files in between the modification times of these two files and then add them to the RAR file myrarfile.rar.

Presto. Problem solved, learned something new. Now, back to reading research papers. 🙂

\\//,

Reference/s:

http://unixhelp.ed.ac.uk/CGI/man-cgi?find