Friday, October 7, 2011

damitr.org

I have switched to wordpress.

This blog will continue at its new address:

http://damitr.org
All the older posts are present at the new address and will continue to be present here, but no new posts will be added here.

D

Wednesday, June 8, 2011

Transparency Revolution

To quote A K Antony on the current state of affairs in the nation.
"Our country is passing through a transparency revolution. Walls of secrecy are crumbling gradually. But politicians, bureaucracy, judiciary, business people, armed forces, and journalists are still not ready for this transition to transparency," 
And then he adds:
 "But they will have to follow the transition and I don't think anybody can take any step in a different direction,"

Lets see how much of this comes through, within our life times.

D

Sunday, May 15, 2011

A self referential post for others

This post is for those who are reading this :Post!
When you read this post, you will know it is meant for you!

You can fool all people for some time.
You can fool some people for all the time.
But, you cannot fool all the people for all the time.

Hope that the message reaches those for whom it is meant!

That is for those poeple who are reading this post!!

You anyway are wasting your time by reading this sort of trash written by me!!!

Tuesday, May 10, 2011

Free Software Tools for scanning and making e-books

How to give a new life to books which are out of copyright!

When I used Mac OS X I used Adobe Acrobat for processing the raw files from the scanner. But with the shift to GNU/Linux I did not know what tools to use.
So here is a short summary of the tools that I have found useful for doing things in GNU/Linux!

Typically the making a soft-copy from a hard-copy involves following steps:

Step1:
Scan the Hard copy using a scanner / camera. This step generates image files
typically .tiff, .png or .jpeg. Some scanning programs also have option of directly generating to .pdf
Basically at this stage you have all the data, if you compress the folder into a comic book reader format .cbr or .cbz format you are good to go. But for a more professional touch read on. The main step to scan the books properly. Some do's and dont's

Align the pages to the sides of the scanner.
If the book is small size scan 2 pages at once.
  If the book is too large adjust the scan in the image preview side so that only one page is scanned.

If these steps are done properly there is a little that we have to do in the second step. And we can directly jump to Step 3.

Preferably scan in the binary form, unless there are colored images in the text. This will help reduce the final size of the file.

Scan at minimum 300 dpi, this is the optimum level that I have come to after trials and errors with different resolutions, their final results and the time taken for each scan. Of course this can differ depending on what is that you are scanning. Many people do the scanning at 600 dpi, but I am happy at 300 dpi.

First of all for the scanning itself. Most of the scanners come with an installation disk for M$-Windows or Mac-OSX. But for GNU/Linux there seems to be no 'installation disk'. The Xsane package allows quite a few scanners which are detected and are ready for use as soon as you plug them in.
The list of the scanners which are supported by Xsane can be found here:

http://www.sane-project.org/sane-mfgs.html

When we bought our scanner we had to search this list to get the compatible scanner.
What is the problem with the manufacturers, why do they not want to sell more, to people who are using Free Software?

If your scanner is not in the list, then you might have to do some R&D before your scanner is up and running like I had to do for my old HP 2400 Scanjet at my home.

Once your scanner is up and running.  You scan the images preferably in .tiff format as they can be processed and compressed without much loss of quality. This again I have found by trial and error.

Step2:
Crop the files and rotate them to remove unwanted white spaces or
 accidental entries of adjoining pages from the images that were obtained. When the pages are scanned as 2 pages in one image, we may need to separate the pages.

Initially I did it manually, it was the second most boring part after the scanning. But I have found a very wonderful tool for this work.

Imagemagick provides a set of tools which work like magick in images, hence the name I guess :)

This is one of the best tools for batch processing image files.

Then I found out the dream tool that I was looking for.
The is called Scan-Tailor, as the name suggests it is meant for processing of scanned images.

Scan Tailor can be found at http://scantailor.sourceforge.net/ or directly from Ubuntu Software Centre.

Step by step scan tailor cleans and creates amazingly good output files from relatively unclean images.

There are a total of 6 steps in scan-tailor which produces the desired output.
You have to choose the folder in which your scanned images are. Scan-tailor produces a directory called out in the same folder by default. The steps are as follows
  1. Change the Orientation: This enables one to change the orientation of all the files in the directory. This is good option in case you have scanned the book in a different orientation.
  2. Split Pages: This step will tell whether the scans that we have made are single page scans, single page with some marginal text from other page or two page scans. Most of the times the auto detection works well with single page and two page scans. But it is a good idea to check manually whether all the pages have been divided correctly, so that it does not create problems later. If you find that a page has been divided incorrectly then we can slide the margin to correct it. In case of two page scans the two pages are shown with a semitransparent blue or red layer on top of them. After looking at all the pages we commit the result. 
  3. Deskew: After the pages have been split we need to change the orientation for better alignment of the text. Here in my experience most of the auto-orientation works fine. But still it is a good idea to check manually the pages, in case something is missed.
  4. Select Content: This is the one step that I have found as the most useful one in the scan-tailor. Here you can select the portion of the text that will appear in the final output. So that you can say goodbye to all the dark lines that come inevitably as part of scanning. Also some library marks can be removed easily by this step. The auto option works well when the text is in nice box shape, but it may leave wide areas open also. The box shape can be changed the way we want. If you want a blank page, remove the content box, by right clicking on the box.
  5. Page Layout: Here one can set the dimensions for the output page and how each page content will be on the page.
  6. Output: Produces the final output with all the above changes.
The output is stored in a directory called Out in the same folder. The original images are not changed, so that in case you want some changes or something goes wrong we can always go  back to the original files. Also numbering of the images is done.
So we have cleaned pages of same size from the scanned pages.


Step 3:
Collate the processed files in Step 2 to one single PDF. For this I have used the convert command.

Typical synatax is like this

convert *.tiff output.pdf

This command will take all the .tiff files in the given directory and collate these files into a pdf named output.pdf

http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/


Step 4: 
OCR the PDF file.
Now this is again tricky, I could not find a good application which would OCR the pdf file and embed the resulting text on the pdf file. But I have found a hack on the following link which seems to work fine :)

http://blog.konradvoelkel.de/2010/01/linux-ocr-and-pdf-problem-solved/


The hack is a bash script which does the required work.

Step 5:

Optimize the PDF file generated in Step 4.

Here there is a nautilus shell script which I have found in the link below which does optimization.
http://www.webupd8.org/2010/11/download-compress-pdf-12-nautilus.html

Step 6: 

In case you want to convert the .pdf to .djvu there is one step solution for that also

pdf2djvu -o output.djvu input.pdf
 

The tips and tricks here are by no means complete or the best. But this is what I have found to be useful. Some of the professional and non-free softwares can do all these, but the point of writing this article was to make a list of Free and Open Source Softwares for this purpose.

Comments and suggestions are welcome!



Monday, April 25, 2011

India would have been a better place without Sathya Sai Baba

Posting for a wider reading.




India would have been a better place without Sathya Sai Baba
Sanal Edamaruku
President
Indian Rationalist Association & Rationalist International

When Sathya Sai Baba died this morning (24 April 2011) at the age of
85 years, he proved once again that miracles and predictions fail. He
had predicted at a public gathering at his head quarters in
Puttaparthy, in 2000, and repeatedly many times, that he would die at
the age of 96 only. And till the last moment, many of his devotees
clung to his word and waited for a miracle. May it be an eye opener
for the millions of gullible people whom he misguided and deluded.

De mortuis nihil nisi bene, they say, say nothing but good of the
dead. But I think Sathya Sai Baba’s case qualifies for an exception.
Too great is the damage that he did to India. His devastating
influence on reason and scientific temper caused huge setback to the
country. At a time, when scientific progress led to great social and
economic leaps and scientific awakening started spreading all over
India, Sathya Sai Baba launched a “counter revolution” of
superstition, supported by irresponsible politicians and other public
figures who should have known better. In my judgment, this is his
greatest crime. I have succeeded again and again to expose him
publicly as a fraud, so did some other rationalists. But due to his
political protectors he was never held responsible for his crimes
against public reason. Nor was he ever booked for any other crime he
was accused of. Numerous cases of alleged sexual abuse and murder are
yet to be investigated, not to mention the financial secrets of his
empire.

Sathya Sai Baba insisted in all seriousness that he was god, the
creator of the universe, and “proved” his divinity with a couple of
small “miracles”. As son of a village tantric he was familiar with the
hand sleights and tricks of the trade. However, he did not only
fascinate poor and uneducated villagers with his fraudulent
performances. Over the years, he managed to attract a galaxy of
India’s rich and powerful, among them ministers, prime ministers,
presidents, chief justices, top industrialists and superstars.

Sathya Sai Baba had a special modus operandi that was the key for his
astonishing success and the root of his enormous clout. Many of his
high society devotees came to serve their own vested interests. Some
came to rub shoulders with the prominent. Many joined the club because
it was working as a powerful syndicate spreading its tentacles all
over the political system. It was a way to the top jobs and a way to
get things done. Others were seeking financial support or wanted to
get rid of ill-gotten black money: The empire, it is alleged, was
based on money laundering, using foreign devotees and branches. In
fact, the huge foreign donations to Sai Baba stood in contrast to the
comparatively modest number of active foreign devotees and the
sometimes quite weak foreign branches, some of them residing in
private homes. That is no great surprise, when one considers that Sai
Baba did not speak any other language than Telugu and traveled only
once in his whole life abroad – to visit his friend Idi Amin in
Uganda.

On his 80th birthday, Sai Baba’s supporters announced that he would
turn from a miracle man to a philanthropist. That was, after I had
demonstrated his miracles so often in TV shows that many kids in the
streets could imitate them. That he since spent a part of the great
fortunes, swindled out of the gullible, for social development around
his ancestral village, is highlighted now to present him as a saint.
But as useful and welcome hospitals, schools and drinking water
projects for the poor always may be: this kind of alibi-philanthropy
is well known even from mafia-bosses. It cannot be weighed against his
crimes and the damage he has done to the Indian society.

In December 2005, I wrote a letter to then President Dr. Abdul Kalam,
one of Sai Baba’s ardent supporters, which was never answered. I
demanded criminal investigations against Sai Baba. If his social
development projects are meant to be indulgence to nullify his crimes,
this procedure is unprecedented and unacceptable, I wrote. It is a
shame for India that well-founded accusations and numerous reputed
witnesses against Sai Baba are ignored without any investigation. Do
saffron clothes make an offender untouchable for the law? Do we have
to tolerate that political protectionism raises its head so boldly,
mocking India's democracy?

Sathya Sai Baba caused great damage to India. His irresponsible
political patrons corrupted the political culture of India. Encouraged
by the clout of Sathya sai Baba, a new clan of miracle mongers
imitated him. India would have been a better place without Sathya Sai
Baba.

(This or other articles from the  Rationalist International Bulletin
may be reproduced by journals, blogs or web sites without change or
alteration in its content, and with due acknowledgment.)

Rationalist International: rationalistinternational@gmail.com

Tuesday, April 12, 2011

WikiLeaks and India


Now that Julian Assange's WikiLeaks is causing some people sleepless nights in the West, the effect is slowly being felt in India. With the expose, exposing the incumbent Congress and the opposition BJP every now and then. The counter accusations follow from the parties. Some things that I have noted when an expose happens is as follows:

  1.  Typically the party in the soup tries to downplay WikiLeaks itself, saying that this is what has been said by the US diplomats and is nothing more than office gossip.
  2. At the same time the other party mounts an attack on the party in soup, trying to tell us "Isn't it the same thing that we were saying from so many years?" And they will tell you how the other party is bad to its core. In this case they never question the authenticity of WikiLeaks. 
  3. The cycle repeats. Only the role of the parties are changed!

So WikiLeaks is like a hot potato, which none of our political parties have courage to handle. As soon as they land with one, they try to throw it away as soon as possible. When it is in someone else's hand they will try to make some brownie points out of it.

Indian media with some exceptions is trying to play down the damage done by WikiLeaks to the political and the civil system. They may be hand-in-glove with those accused, or may be afraid that their own names may appear in the future issues of WikiLeaks.










Monday, April 11, 2011

Sibal Vs Hazare

Apparently Kapil Sibbal the person who negotiated with the Anti-corruption rally activists cannot make simple deductions about the state in which the country is in. Being the HRD minister he should know better.



Sibal said this in a public meeting 


I ask this question, if a poor child does not have any means for education, then how will Lokpal Bill help? If a poor man needs help for medical services then he will call up a politician. How will Lokpal Bill help.

When Mr. Hazare responded by saying that Mr, Sibal should not be in the committee if he thinks Lokpal bill is useless, then Sibal clarified his position by saying:


the scope of the Bill is different. The problems of the common man are different. ...
I said that if you want to educate children, then this has no connection to Lokpal. If there is no convenience of water...Lokpal is only connected to corruption and we will bring a good bill that will stop corruption.

To get to what I am saying you do not even have to read between the lines. The very fact that there are problems in the Indian system, the likes of which Sibal mentions, viz. poor child not having means for education, poor man needing medical services and others at least in part are linked to India being a very corrupt  state. Since we are a corrupt state, that is the reason people cannot get access to basic needs of a good life, like education for their children and medical services, without clout of some politician, as Mr. Sibal puts it. And this is accepted, by saying that going through a politican will perhaps help a poor person, than cleaning the system itself.

How can a bad governing system which is corrupt as deep as it can be, and public inconvenience it causes and a strong anti-corruption bill be not related? The Lokpal Bill is in every related to problems of common man,  and that is the reason why it gathered such a wide support.