<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tarh̯untaš</title>
	<atom:link href="http://edgard.bikelis.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://edgard.bikelis.com/blog</link>
	<description></description>
	<lastBuildDate>Thu, 17 May 2012 01:47:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Sânscrito na Wikipédia</title>
		<link>http://edgard.bikelis.com/blog/?p=459</link>
		<comments>http://edgard.bikelis.com/blog/?p=459#comments</comments>
		<pubDate>Thu, 17 May 2012 01:46:11 +0000</pubDate>
		<dc:creator>Edgard</dc:creator>
				<category><![CDATA[in portuguese]]></category>
		<category><![CDATA[sanskrit]]></category>
		<category><![CDATA[wikipedia]]></category>

		<guid isPermaLink="false">http://edgard.bikelis.com/blog/?p=459</guid>
		<description><![CDATA[Quem for no artigo atual da Wikipédia sobre Sânscrito vai ler, na seção de pronúncia: Com o advento da internet e o ressurgimento do sânscrito como língua falada, têm surgido cada vez mais sites que ensinam a pronúncia do sânscrito. O uso do som torna desnecessário recorrer a complicados sistemas de transliteração, que costumam gerar [...]]]></description>
			<content:encoded><![CDATA[<p>Quem for no artigo atual da Wikipédia sobre Sânscrito vai ler, na <a href="http://pt.wikipedia.org/w/index.php?title=S%C3%A2nscrito&amp;oldid=30049114#Pron.C3.BAncia">seção de pronúncia</a>:</p>
<blockquote><p>Com o advento da internet e o ressurgimento do sânscrito como língua falada, têm surgido cada vez mais sites que ensinam a pronúncia do sânscrito. O uso do som torna desnecessário recorrer a complicados sistemas de transliteração, que costumam gerar <strong>discussões bizantinas e prosopopéias trogloditas e poliglotas sobre prosódia e ortoépia</strong>, já que se pode aprender a pronunciar cada letra ouvindo-a.</p></blockquote>
<p>(O trecho em negrito é quase poético, não?)</p>
<p>Esse é um parágrafo bastante infeliz, porque superestima muito o sânscrito como língua falada, ignora as diferenças de pronúncia que há na Índia, a impossibilidade de se usar o devanāgarī <em>sempre</em>, e confunde as noções de letra e som; mas o pior é o desrespeito pela tradição lingüística da Índia antiga, graças a quê restaram-nos os textos e os meios por que podem ser interpretados.</p>
<p>Mas quem terá escrito isso? Ao ler as versões anteriores do artigo, vi que o texto foi piorando com o tempo. <a href="http://pt.wikipedia.org/w/index.php?title=S%C3%A2nscrito&amp;diff=27130757&amp;oldid=26941228">No dia 3 de outubro de 2011</a> foi adicionado o que marquei em vermelho e entre colchetes:</p>
<blockquote><p>Com o advento da internet e o ressurgimento do sânscrito como língua falada, têm surgido cada vez mais sites que ensinam a pronúncia do sânscrito. O uso do som torna desnecessário recorrer a complicados sistemas de transliteração, que costumam gerar discussões bizantinas <span style="color: red;"> [e prosopopéias trogloditas e poliglotas]</span> sobre prosódia e ortoépia, já que se pode aprender a pronunciar cada letra ouvindo-a.</p></blockquote>
<p>Alguém parece ter tido um mau 3 de outubro.</p>
<p>Mas e o resto? O resto é de 12 de abril de 2005. <em>Essa vergonha de parágrafo tem sete anos</em>, e ninguém consertou ainda. Na Wikipédia em inglês nunca vi nada tão absurdo, mas que pese que eu não costumo ler os artigos controversos. Bem, sobre isso só me resta editar e torcer para que a edição permaneça.</p>
<p>Dessa safra de 2005 havia outro parágrafo, que felizmente foi expurgado:</p>
<blockquote><p>A prática de transcrever os caractéres sânscritos para a escrita em alfabeto latino chamase transliteração. Contudo, não devemos utilizar a transliteração acadêmica para o português. Ela não é correta e ainda induz o leitor ao erro de pronúncia, como é o caso do &#8220;ç&#8221; usado para representar um som que não é dessa letra, por exemplo na palavra Shiva, cuja sonoridade chiada do primeiro fonema fica irreconhecível na grafia &#8220;Çiva&#8221;, proposta pela transliteração portuguesa. Devemos utilizar a inglesa, que é mais lógica, é usada na Índia e serve perfeitamente para o português.</p></blockquote>
<p>Todo livro decente que vi com transliteração de qualquer língua tem uma pequena introdução no começo, explicando a pronúncia. Como a fricativa palatal surda, a mesma do &#8216;ch&#8217; em &#8216;chá&#8217;, pode ser melhor transcrita por &#8216;sh&#8217;, se esse dígrafo nem existe em português? A transliteração acadêmica é &#8216;lossless&#8217;, feita para que não se perca nada na transcrição, e não para que se possa ler pronunciar direito sem consultar mais nada. Há mais sons em sânscrito do que há em português: o nome disso seria milagre, não transcrição.</p>
]]></content:encoded>
			<wfw:commentRss>http://edgard.bikelis.com/blog/?feed=rss2&#038;p=459</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DLI Books to DJVU</title>
		<link>http://edgard.bikelis.com/blog/?p=450</link>
		<comments>http://edgard.bikelis.com/blog/?p=450#comments</comments>
		<pubDate>Tue, 06 Jul 2010 02:18:46 +0000</pubDate>
		<dc:creator>Edgard</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[sanskrit]]></category>

		<guid isPermaLink="false">http://blog.bikelis.com/?p=450</guid>
		<description><![CDATA[As I&#8217;m also one of those reading books from DLI, and not particularly liking to fetch one by one the pages in TIF format, I&#8217;ve been tinkering this script for about a year, and I think it&#8217;s fairly decent by now. It expects you to give links from the search results. Perhaps it might be [...]]]></description>
			<content:encoded><![CDATA[<p>As I&#8217;m also one of those reading books from <a href="http://www.new.dli.ernet.in/">DLI</a>, and not particularly liking to fetch one by one the pages in TIF format, I&#8217;ve been tinkering this script for about a year, and I think it&#8217;s fairly decent by now. It expects you to give links from the search results.</p>
<p>Perhaps it might be useful to someone else. Please do tell about how it fared, if you try it.</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar" style="right: 15px;" ><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple"style=" height: 252px;"><table class="bash"><tbody><tr class="li1"><td class="ln"><pre class="de1">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
</pre></td><td class="de1"><pre class="de1"><span class="co0">#!/bin/bash</span>
&nbsp;
<span class="co0"># test if anything was given to the script</span>
<span class="kw1">if</span> <span class="br0">&#91;</span><span class="br0">&#91;</span> <span class="re4">$1</span> = <span class="st0">&quot;&quot;</span> <span class="br0">&#93;</span><span class="br0">&#93;</span>; <span class="kw1">then</span>
&nbsp; &nbsp; <span class="kw3">echo</span> <span class="st0">&quot;You must give the URL to be processed.&quot;</span>
&nbsp; &nbsp; <span class="kw3">echo</span> <span class="st0">&quot;Enter 'ocr' as second argument to use ocrodjvu.&quot;</span>
&nbsp; &nbsp; <span class="kw3">exit</span> <span class="nu0">1</span>
<span class="kw1">fi</span>
&nbsp;
<span class="re2">url</span>=<span class="re4">$1</span>
&nbsp;
<span class="co0"># converts % codes</span>
<span class="re2">url</span>=<span class="sy0">`</span><span class="kw3">echo</span> <span class="st0">&quot;<span class="es2">$url</span>&quot;</span> <span class="sy0">|</span> <span class="kw2">sed</span> <span class="st0">&quot;s/%20/ /g&quot;</span><span class="sy0">`</span>
<span class="re2">url</span>=<span class="sy0">`</span><span class="kw3">echo</span> <span class="st0">&quot;<span class="es2">$url</span>&quot;</span> <span class="sy0">|</span> <span class="kw2">sed</span> <span class="st0">&quot;s/%27/'/g&quot;</span><span class="sy0">`</span>
<span class="re2">url</span>=<span class="sy0">`</span><span class="kw3">echo</span> <span class="st0">&quot;<span class="es2">$url</span>&quot;</span> <span class="sy0">|</span> <span class="kw2">sed</span> <span class="st0">&quot;s/%28/(/g&quot;</span><span class="sy0">`</span>
<span class="re2">url</span>=<span class="sy0">`</span><span class="kw3">echo</span> <span class="st0">&quot;<span class="es2">$url</span>&quot;</span> <span class="sy0">|</span> <span class="kw2">sed</span> <span class="st0">&quot;s/%29/)/g&quot;</span><span class="sy0">`</span>
&nbsp;
<span class="co0"># gets the variables</span>
&nbsp;<span class="re2">title</span>=<span class="sy0">`</span><span class="kw3">echo</span> <span class="st0">&quot;<span class="es2">$url</span>&quot;</span> <span class="sy0">|</span> <span class="kw2">sed</span> <span class="re5">-r</span> <span class="st0">&quot;s/.*title1=([^&amp;]*)&amp;.*/1/g&quot;</span><span class="sy0">`</span>
<span class="re2">author</span>=<span class="sy0">`</span><span class="kw3">echo</span> <span class="st0">&quot;<span class="es2">$url</span>&quot;</span> <span class="sy0">|</span> <span class="kw2">sed</span> <span class="re5">-r</span> <span class="st0">&quot;s/.*author1=([^&amp;]*)&amp;.*/1/g&quot;</span><span class="sy0">`</span>
&nbsp;<span class="re2">pages</span>=<span class="sy0">`</span><span class="kw3">echo</span> <span class="st0">&quot;<span class="es2">$url</span>&quot;</span> <span class="sy0">|</span> <span class="kw2">sed</span> <span class="re5">-r</span> <span class="st0">&quot;s/.*pages=([^&amp;]*)&amp;.*/1/g&quot;</span><span class="sy0">`</span>
&nbsp; <span class="re2">path</span>=<span class="sy0">`</span><span class="kw3">echo</span> <span class="st0">&quot;<span class="es2">$url</span>&quot;</span> <span class="sy0">|</span> <span class="kw2">sed</span> <span class="re5">-r</span> <span class="st0">&quot;s/.*url=([^&amp;]*)/1/g&quot;</span><span class="sy0">`</span>
&nbsp;
<span class="co0"># shows them</span>
<span class="kw3">echo</span> <span class="st0">&quot;&quot;</span>
<span class="kw3">echo</span> <span class="re5">-e</span> <span class="st0">&quot;Author:t<span class="es2">$author</span>&quot;</span>
<span class="kw3">echo</span> <span class="re5">-e</span> <span class="st0">&quot;Title:t<span class="es2">$title</span>&quot;</span>
<span class="kw3">echo</span> <span class="re5">-e</span> <span class="st0">&quot;Pages:t<span class="es2">$pages</span>&quot;</span>
<span class="kw3">echo</span> <span class="re5">-e</span> <span class="st0">&quot;Path:t<span class="es2">$path</span>&quot;</span>
&nbsp;
<span class="co0"># assembles the filename</span>
<span class="re2">filename</span>=<span class="sy0">`</span><span class="kw3">echo</span> <span class="st0">&quot;<span class="es2">$author</span>&quot;</span> - <span class="st0">&quot;<span class="es2">$title</span>&quot;</span><span class="sy0">`</span>
&nbsp;
<span class="co0"># tests if the directory named $filename already exists,</span>
<span class="co0"># if not, it's created, then changes to its path</span>
<span class="kw1">if</span> <span class="br0">&#91;</span> <span class="re5">-d</span> <span class="st0">&quot;<span class="es2">$filename</span>&quot;</span> <span class="br0">&#93;</span>; <span class="kw1">then</span>
&nbsp; &nbsp; <span class="kw3">echo</span> <span class="re5">-n</span> <span class="st0">&quot;The directory '&quot;</span><span class="re1">$filename</span><span class="st0">&quot;' already exists. &quot;</span>
<span class="kw1">else</span>
&nbsp; &nbsp; <span class="kw2">mkdir</span> <span class="st0">&quot;<span class="es2">$filename</span>&quot;</span>
<span class="kw1">fi</span>
&nbsp;
<span class="kw3">cd</span> <span class="st0">&quot;<span class="es2">$filename</span>&quot;</span>
&nbsp;
<span class="co0"># creates directories to hold the .tif and .djvu files</span>
<span class="kw1">if</span> <span class="br0">&#91;</span> <span class="sy0">!</span> <span class="re5">-d</span> tif &nbsp;<span class="br0">&#93;</span>; <span class="kw1">then</span>
&nbsp; &nbsp; <span class="kw2">mkdir</span> tif
<span class="kw1">fi</span>
&nbsp;
<span class="kw1">if</span> <span class="br0">&#91;</span> <span class="sy0">!</span> <span class="re5">-d</span> djvu <span class="br0">&#93;</span>; <span class="kw1">then</span>
&nbsp; &nbsp; <span class="kw2">mkdir</span> djvu
<span class="kw1">fi</span>
&nbsp;
<span class="kw3">cd</span> tif
&nbsp;
<span class="co0"># if there is a 'last' file, makes the script continue</span>
<span class="co0"># from that; otherwise, starts from 1</span>
<span class="kw1">if</span> <span class="br0">&#91;</span> <span class="re5">-f</span> <span class="kw2">last</span> <span class="br0">&#93;</span>; <span class="kw1">then</span>
&nbsp; &nbsp; <span class="re2">firstpage</span>=<span class="sy0">`</span><span class="kw2">cat</span> <span class="kw2">last</span><span class="sy0">`</span>
&nbsp; &nbsp; <span class="kw3">echo</span> <span class="st0">&quot;Resuming from page <span class="es2">$firstpage</span>...&quot;</span>
&nbsp; &nbsp; <span class="re2">firstpage</span>=<span class="sy0">`</span><span class="kw3">echo</span> <span class="st0">&quot;<span class="es2">$firstpage</span>+1&quot;</span> <span class="sy0">|</span> <span class="kw2">bc</span><span class="sy0">`</span>
<span class="kw1">else</span>
&nbsp; &nbsp; <span class="re2">firstpage</span>=<span class="nu0">1</span>
<span class="kw1">fi</span>
&nbsp;
<span class="kw3">echo</span> <span class="st0">&quot;&quot;</span>
tput sc
&nbsp;
<span class="co0"># iterates the download for each file</span>
<span class="co0"># the exact path is a hack that happens to work...</span>
<span class="co0"># it avoids downloading files again by checking the</span>
<span class="co0"># timestamp of each file, that is the &quot;-N&quot; option</span>
<span class="kw1">for</span> i <span class="kw1">in</span> $<span class="br0">&#40;</span><span class="kw2">seq</span> <span class="re1">$firstpage</span> <span class="re1">$pages</span><span class="br0">&#41;</span>; <span class="kw1">do</span>
&nbsp;
&nbsp; &nbsp; <span class="kw3">echo</span> <span class="re5">-n</span> Page $<span class="br0">&#40;</span><span class="kw3">printf</span> <span class="st0">&quot;%08d&quot;</span> <span class="re1">$i</span><span class="br0">&#41;</span>...
&nbsp;
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#91;</span><span class="br0">&#91;</span> <span class="re1">$path</span> == <span class="sy0">*</span>data1<span class="sy0">*</span> <span class="br0">&#93;</span><span class="br0">&#93;</span>; <span class="kw1">then</span>
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">wget</span> <span class="re5">-N</span> <span class="re5">-q</span> <span class="re5">--random-wait</span> http:<span class="sy0">//</span>www.new1.dli.ernet.in<span class="sy0">/</span><span class="re1">$path</span><span class="sy0">/</span>PTIFF<span class="sy0">/</span>$<span class="br0">&#40;</span><span class="kw3">printf</span> <span class="st0">&quot;%08d&quot;</span> <span class="re1">$i</span><span class="br0">&#41;</span>.tif
&nbsp; &nbsp; <span class="kw1">elif</span> <span class="br0">&#91;</span><span class="br0">&#91;</span> <span class="re1">$path</span> == <span class="sy0">*</span>data2<span class="sy0">*</span> <span class="br0">&#93;</span><span class="br0">&#93;</span>; <span class="kw1">then</span>
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">wget</span> <span class="re5">-N</span> <span class="re5">-q</span> <span class="re5">--random-wait</span> http:<span class="sy0">//</span>www.new1.dli.ernet.in<span class="sy0">/</span><span class="re1">$path</span><span class="sy0">/</span>PTIFF<span class="sy0">/</span>$<span class="br0">&#40;</span><span class="kw3">printf</span> <span class="st0">&quot;%08d&quot;</span> <span class="re1">$i</span><span class="br0">&#41;</span>.tif
&nbsp; &nbsp; <span class="kw1">elif</span> <span class="br0">&#91;</span><span class="br0">&#91;</span> <span class="re1">$path</span> == <span class="sy0">*</span>data3<span class="sy0">*</span> <span class="br0">&#93;</span><span class="br0">&#93;</span>; <span class="kw1">then</span>
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">wget</span> <span class="re5">-N</span> <span class="re5">-q</span> <span class="re5">--random-wait</span> http:<span class="sy0">//</span>www.new1.dli.ernet.in<span class="sy0">/</span><span class="re1">$path</span><span class="sy0">/</span>PTIFF<span class="sy0">/</span>$<span class="br0">&#40;</span><span class="kw3">printf</span> <span class="st0">&quot;%08d&quot;</span> <span class="re1">$i</span><span class="br0">&#41;</span>.tif
&nbsp; &nbsp; <span class="kw1">else</span>
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">wget</span> <span class="re5">-N</span> <span class="re5">-q</span> <span class="re5">--random-wait</span> http:<span class="sy0">//</span>www.new.dli.ernet.in<span class="sy0">/</span><span class="re1">$path</span><span class="sy0">/</span>PTIFF<span class="sy0">/</span>$<span class="br0">&#40;</span><span class="kw3">printf</span> <span class="st0">&quot;%08d&quot;</span> <span class="re1">$i</span><span class="br0">&#41;</span>.tif
&nbsp; &nbsp; <span class="kw1">fi</span>
&nbsp;
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#91;</span> <span class="re4">$?</span> = <span class="nu0">0</span> <span class="br0">&#93;</span>; <span class="kw1">then</span>
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">echo</span> <span class="re5">-n</span> <span class="st0">&quot; done.&quot;</span>
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">echo</span> <span class="st0">&quot;<span class="es4">$(printf &quot;%08d&quot; $i)</span>&quot;</span> <span class="sy0">&gt;</span> <span class="kw2">last</span>
&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co0"># converts to djvu</span>
&nbsp; &nbsp; &nbsp; &nbsp; cjb2 $<span class="br0">&#40;</span><span class="kw3">printf</span> <span class="st0">&quot;%08d&quot;</span> <span class="re1">$i</span><span class="br0">&#41;</span>.tif ..<span class="sy0">/</span>djvu<span class="sy0">/</span>$<span class="br0">&#40;</span><span class="kw3">printf</span> <span class="st0">&quot;%08d&quot;</span> <span class="re1">$i</span><span class="br0">&#41;</span>.djvu <span class="sy0">&gt;</span> <span class="sy0">/</span>dev<span class="sy0">/</span>null <span class="nu0">2</span><span class="sy0">&gt;&amp;</span><span class="nu0">1</span>
&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; tput el1
&nbsp; &nbsp; &nbsp; &nbsp; tput rc
&nbsp;
&nbsp; &nbsp; <span class="kw1">else</span>
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">echo</span> <span class="st0">&quot;error!&quot;</span>
&nbsp; &nbsp; <span class="kw1">fi</span>
&nbsp;
<span class="kw1">done</span>
&nbsp;
<span class="kw3">cd</span> ..
&nbsp;
<span class="co0"># assembles the djvu pages in one bundle</span>
djvm <span class="re5">-c</span> ..<span class="sy0">/</span><span class="st0">&quot;<span class="es2">$filename</span>&quot;</span>.djvu djvu<span class="sy0">/*</span>djvu
&nbsp;
<span class="co0"># ocr</span>
&nbsp;
<span class="kw1">if</span> <span class="br0">&#91;</span> <span class="st0">&quot;$2&quot;</span> = <span class="st0">&quot;ocr&quot;</span> <span class="br0">&#93;</span>; <span class="kw1">then</span>
&nbsp; &nbsp; ocrodjvu <span class="re5">-o</span> <span class="st0">&quot;<span class="es2">$filename</span> (ocr)&quot;</span>.djvu <span class="st0">&quot;<span class="es2">$filename</span>&quot;</span>.djvu
<span class="kw1">fi</span></pre></td></tr></tbody></table></div>
<div class="bwp-syntax-source"><pre class="no-parse">#!/bin/bash

# test if anything was given to the script
if [[ $1 = "" ]]; then
	echo "You must give the URL to be processed."
	echo "Enter 'ocr' as second argument to use ocrodjvu."
	exit 1
fi

url=$1

# converts % codes
url=`echo "$url" | sed "s/%20/ /g"`
url=`echo "$url" | sed "s/%27/'/g"`
url=`echo "$url" | sed "s/%28/(/g"`
url=`echo "$url" | sed "s/%29/)/g"`

# gets the variables
 title=`echo "$url" | sed -r "s/.*title1=([^&amp;]*)&amp;.*/1/g"`
author=`echo "$url" | sed -r "s/.*author1=([^&amp;]*)&amp;.*/1/g"`
 pages=`echo "$url" | sed -r "s/.*pages=([^&amp;]*)&amp;.*/1/g"`
  path=`echo "$url" | sed -r "s/.*url=([^&amp;]*)/1/g"`

# shows them
echo ""
echo -e "Author:t$author"
echo -e "Title:t$title"
echo -e "Pages:t$pages"
echo -e "Path:t$path"

# assembles the filename
filename=`echo "$author" - "$title"`

# tests if the directory named $filename already exists,
# if not, it's created, then changes to its path
if [ -d "$filename" ]; then
	echo -n "The directory '"$filename"' already exists. "
else
	mkdir "$filename"
fi

cd "$filename"

# creates directories to hold the .tif and .djvu files
if [ ! -d tif  ]; then
	mkdir tif
fi

if [ ! -d djvu ]; then
	mkdir djvu
fi

cd tif

# if there is a 'last' file, makes the script continue
# from that; otherwise, starts from 1
if [ -f last ]; then
	firstpage=`cat last`
	echo "Resuming from page $firstpage..."
	firstpage=`echo "$firstpage+1" | bc`
else
	firstpage=1
fi

echo ""
tput sc

# iterates the download for each file
# the exact path is a hack that happens to work...
# it avoids downloading files again by checking the
# timestamp of each file, that is the "-N" option
for i in $(seq $firstpage $pages); do

	echo -n Page $(printf "%08d" $i)...

	if [[ $path == *data1* ]]; then
		wget -N -q --random-wait http://www.new1.dli.ernet.in/$path/PTIFF/$(printf "%08d" $i).tif
	elif [[ $path == *data2* ]]; then
		wget -N -q --random-wait http://www.new1.dli.ernet.in/$path/PTIFF/$(printf "%08d" $i).tif
	elif [[ $path == *data3* ]]; then
		wget -N -q --random-wait http://www.new1.dli.ernet.in/$path/PTIFF/$(printf "%08d" $i).tif
	else
		wget -N -q --random-wait http://www.new.dli.ernet.in/$path/PTIFF/$(printf "%08d" $i).tif
	fi

	if [ $? = 0 ]; then
		echo -n " done."
		echo "$(printf "%08d" $i)" &gt; last

		# converts to djvu
		cjb2 $(printf "%08d" $i).tif ../djvu/$(printf "%08d" $i).djvu &gt; /dev/null 2&gt;&amp;1

		tput el1
		tput rc

	else
		echo "error!"
	fi

done

cd ..

# assembles the djvu pages in one bundle
djvm -c ../"$filename".djvu djvu/*djvu

# ocr

if [ "$2" = "ocr" ]; then
	ocrodjvu -o "$filename (ocr)".djvu "$filename".djvu
fi</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://edgard.bikelis.com/blog/?feed=rss2&#038;p=450</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A Collatz Conjecture&#8217;s Bonsai</title>
		<link>http://edgard.bikelis.com/blog/?p=435</link>
		<comments>http://edgard.bikelis.com/blog/?p=435#comments</comments>
		<pubDate>Tue, 01 Jun 2010 07:14:41 +0000</pubDate>
		<dc:creator>Edgard</dc:creator>
				<category><![CDATA[in english]]></category>
		<category><![CDATA[mathematics]]></category>
		<category><![CDATA[collatz conjecture]]></category>
		<category><![CDATA[image]]></category>

		<guid isPermaLink="false">http://blog.bikelis.com/?p=435</guid>
		<description><![CDATA[I&#8217;ve recently made this, after seeing xkcd&#8216;s cartoon about the Collatz Conjecture. May be just me, but I rather like it. It was made iterating from 1 to 10000, and calculating the possible paths of each number. If it leads only to its double, then it&#8217;s blue; if it leads also to an odd number, [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://edgard.bikelis.com/blog/wp-content/uploads/2010/06/collatz_10000_700px.png" alt="A Collatz Conjecture&#039;s Bonsai" title="collatz_10000_700px" width="700" height="511" class="aligncenter size-full wp-image-437" /></p>
<p>I&#8217;ve recently made this, after seeing <a href="http://xkcd.com/710/">xkcd</a>&#8216;s cartoon about the <a href="http://en.wikipedia.org/wiki/Collatz_conjecture">Collatz Conjecture</a>. May be just me, but I rather like it. It was made iterating from 1 to 10000, and calculating the possible paths of each number. If it leads only to its double, then it&#8217;s blue; if it leads also to an odd number, red; the grey ones didn&#8217;t get iterated, but were calculated implicitly by doubling the previous ones. <em>Et voilà!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://edgard.bikelis.com/blog/?feed=rss2&#038;p=435</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BASH Miscellanea</title>
		<link>http://edgard.bikelis.com/blog/?p=368</link>
		<comments>http://edgard.bikelis.com/blog/?p=368#comments</comments>
		<pubDate>Tue, 15 Dec 2009 13:05:57 +0000</pubDate>
		<dc:creator>Edgard</dc:creator>
				<category><![CDATA[in english]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://blog.bikelis.com/?p=368</guid>
		<description><![CDATA[How to read a $file line by $line: cat $file &#124; while read line; do echo $line; done How to extract URLs from a file (from here): Grab this sed script, make it executable (chmod +x list_urls.sed), then: cat * &#124; ../list_urls.sed How to count the number of files inside a $directory (from here): ls [...]]]></description>
			<content:encoded><![CDATA[<p>How to read a <code>$file</code> line by <code>$line</code>:</p>
<pre lang="bash" line="1">cat $file | while read line; do echo $line; done</pre>
<p>How to extract URLs from a file (<a href="http://forums.macosxhints.com/archive/index.php/t-13457.html">from here</a>): Grab <a href="http://sed.sourceforge.net/local/scripts/list_urls.sed.html">this</a> sed script, make it executable (<code>chmod +x list_urls.sed</code>), then:</p>
<pre lang="bash" line="1">cat * | ../list_urls.sed</pre>
<p>How to count the number of files inside a <code>$directory</code> (<a href="http://linuxcommando.blogspot.com/2008/07/how-to-count-number-of-files-in.html">from here</a>):</p>
<pre lang="bash" line="1">ls -1 $directory | wc -l</pre>
]]></content:encoded>
			<wfw:commentRss>http://edgard.bikelis.com/blog/?feed=rss2&#038;p=368</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BWV 912</title>
		<link>http://edgard.bikelis.com/blog/?p=352</link>
		<comments>http://edgard.bikelis.com/blog/?p=352#comments</comments>
		<pubDate>Fri, 04 Dec 2009 06:45:39 +0000</pubDate>
		<dc:creator>Edgard</dc:creator>
				<category><![CDATA[in portuguese]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[bach]]></category>

		<guid isPermaLink="false">http://blog.bikelis.com/?p=352</guid>
		<description><![CDATA[Consta que ouço as tocatas de Bach desde os nove anos. Até aqui tive tempo de gostar delas sem saber direito o que eram, enjoar delas e as esquecer, lembrar que existem de volta, enjoar de novo, lembrar delas no surto de ouvir todo o BWV, enjoar de novo, e voltar a gostar delas. Nos [...]]]></description>
			<content:encoded><![CDATA[<p>Consta que ouço as tocatas de Bach desde os nove anos. Até aqui tive tempo de gostar delas sem saber direito o que eram, enjoar delas e as esquecer, lembrar que existem de volta, enjoar de novo, lembrar delas no surto de ouvir todo o <a href="http://pt.wikipedia.org/wiki/BWV">BWV</a>, enjoar de novo, e voltar a gostar delas. Nos primeiros surtos eu ouvia todo o CD esperando pela fuga da toccata em Cm, BWV 911, que era a minha predileta. Seguindo a tendência do meu humor pelos anos, que é de, espero ; ), ser cada vez menos caquético e sério, agora prefiro a seguinte, em D. A fuga é o que lembro quando meu humor está excepcionalmente bom, e parece ser, aqui, o caso:</p>
<p><center><object width="480" height="385"><param name="movie" value="http://www.youtube-nocookie.com/v/vI48tHJddIw&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube-nocookie.com/v/vI48tHJddIw&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></center></p>
]]></content:encoded>
			<wfw:commentRss>http://edgard.bikelis.com/blog/?feed=rss2&#038;p=352</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lingua Avium</title>
		<link>http://edgard.bikelis.com/blog/?p=347</link>
		<comments>http://edgard.bikelis.com/blog/?p=347#comments</comments>
		<pubDate>Thu, 03 Dec 2009 06:15:07 +0000</pubDate>
		<dc:creator>Edgard</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[in portuguese]]></category>
		<category><![CDATA[latin]]></category>
		<category><![CDATA[charles cotton]]></category>
		<category><![CDATA[cicero]]></category>
		<category><![CDATA[language of the birds]]></category>
		<category><![CDATA[pacuvius]]></category>

		<guid isPermaLink="false">http://blog.bikelis.com/?p=347</guid>
		<description><![CDATA[Pacúvio, no De Divinatiōne de Cícero: istis qui linguam avium intelligunt Plusque ex alieno iecore sapiunt quam ex suo, Magis audiendum quam auscultandum censeo. Esses que entendem a língua das aves, e que mais sabem do fígado alheio que do seu, são mais para ouvir que para escutar, eu creio. Montaigne citou isso nalgum lugar, [...]]]></description>
			<content:encoded><![CDATA[<p>Pacúvio, no De <em>Divinatiōne</em> de Cícero:</p>
<blockquote><p>istis qui linguam avium intelligunt<br />
Plusque ex alieno iecore sapiunt quam ex suo,<br />
Magis audiendum quam auscultandum censeo.</p></blockquote>
<p>Esses que entendem a língua das aves,<br />
e que mais sabem do fígado alheio que do seu,<br />
são mais para ouvir que para escutar, eu creio.</p>
<p>Montaigne citou isso nalgum lugar, e <a href="http://en.wikipedia.org/wiki/Charles_Cotton">Charles Cotton</a>, cuja peruca certamente poderia me fazer supor seu sobrenome, traduziu-o para o inglês, em 1680 e lá vai pedrada, assim:</p>
<blockquote><p>Who understand what language birds expresse,<br />
By their owne than beasts-livers knowing lesse,<br />
They may be heard, not hearkned to, I guesse.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://edgard.bikelis.com/blog/?feed=rss2&#038;p=347</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chorus</title>
		<link>http://edgard.bikelis.com/blog/?p=334</link>
		<comments>http://edgard.bikelis.com/blog/?p=334#comments</comments>
		<pubDate>Thu, 03 Dec 2009 01:54:49 +0000</pubDate>
		<dc:creator>Edgard</dc:creator>
				<category><![CDATA[greek]]></category>
		<category><![CDATA[in english]]></category>
		<category><![CDATA[aristophanes]]></category>
		<category><![CDATA[chorus]]></category>
		<category><![CDATA[frogs]]></category>
		<category><![CDATA[muses]]></category>

		<guid isPermaLink="false">http://blog.bikelis.com/?p=334</guid>
		<description><![CDATA[From the preface of Aulus Gelius&#8217; Noctes Atticae, Aristophanes&#8217; Frogs, 354-9: All evil thoughts and profane be still: far hence, far hence from our choirs depart, Who knows not well what the Mystics tell, or is not holy and pure of heart; Who ne&#8217;er has the noble revelry learned, or danced the dance of the [...]]]></description>
			<content:encoded><![CDATA[<p>From the preface of Aulus Gelius&#8217; <em>Noctes Atticae</em>, Aristophanes&#8217; <em>Frogs</em>, 354-9:</p>
<p><center><a href="http://books.google.com/books?id=4rJuz4cXrgYC&#038;dq=arist%C3%B3fanes%20r%C3%A3s&#038;client=iceweasel-a&#038;pg=PA104&#038;ci=209%2C845%2C716%2C176&#038;source=bookclip"><img src="http://books.google.com/books?id=4rJuz4cXrgYC&#038;pg=PA104&#038;img=1&#038;zoom=3&#038;hl=en&#038;sig=ACfU3U2pD9AxF9RUHBG-Nr8TwBZrsEDhmA&#038;ci=209%2C845%2C716%2C176&#038;edge=0"/></a></center></p>
<blockquote><p>All evil thoughts and profane be still:<br />
far hence, far hence from our choirs depart,<br />
Who knows not well what the Mystics tell,<br />
or is not holy and pure of heart;<br />
Who ne&#8217;er has the noble revelry learned,<br />
or danced the dance of the Muses high;</p>
<p>(&#8230;)</p>
<p>I charge them once, I charge them twice,<br />
I charge them thrice, that they draw not nigh<br />
To the sacred dance of the Mystic choir.<br />
But ye, my comrades, awake the song,<br />
The night-long revels of joy and mirth<br />
which ever of right to our feast belong.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://edgard.bikelis.com/blog/?feed=rss2&#038;p=334</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Prefaces</title>
		<link>http://edgard.bikelis.com/blog/?p=327</link>
		<comments>http://edgard.bikelis.com/blog/?p=327#comments</comments>
		<pubDate>Tue, 01 Dec 2009 20:32:00 +0000</pubDate>
		<dc:creator>Edgard</dc:creator>
				<category><![CDATA[in english]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[patience]]></category>

		<guid isPermaLink="false">http://blog.bikelis.com/?p=327</guid>
		<description><![CDATA[I tend to hate prefaces, like one of full hundred pages out of a book of just two. Maybe I am just not polite enough to let the author say whatever he wants before saying what I want, but still&#8230; I just can&#8217;t help it. Specially the damned baroque prefaces in italics, never read even [...]]]></description>
			<content:encoded><![CDATA[<p>I tend to hate prefaces, like one of full hundred pages out of a book of just two. Maybe I am just not polite enough to let the author say whatever he wants before saying what <em>I</em> want, but still&#8230; I just can&#8217;t help it. Specially the damned baroque prefaces in italics, never read even one worth the time. An example? <a href="http://books.google.com/books?id=Ci9dAAAAMAAJ&#038;pg=RA5-PA23&#038;dq=preface+illustrious&#038;as_brr=4&#038;ei=FNEWS9bcHI-SNuaS8e8K&#038;client=iceweasel-a#v=onepage&#038;q=&#038;f=false">This</a> is a very short one, with a typeface legible enough.</p>
<p>Now, I&#8217;ve just stumbled upon this one, by a certain Morleigh (?), <em><a href="http://www.archive.org/details/lifeinwestbackwo00morl">Life in the west: back-wood leaves and prairie flowers</a></em>:</p>
<blockquote><p>I consider a Preface to be a work of supererogation, and never read one with common patience in my life. Nevertheless, I think it right to inform the reader, that three of the following papers have already met the public eye, in the pages of a leading London periodical.</p></blockquote>
<p>Agreed. But he could at least give his name somewhere, it tends to be important.</p>
]]></content:encoded>
			<wfw:commentRss>http://edgard.bikelis.com/blog/?feed=rss2&#038;p=327</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Etymologia Nova I</title>
		<link>http://edgard.bikelis.com/blog/?p=259</link>
		<comments>http://edgard.bikelis.com/blog/?p=259#comments</comments>
		<pubDate>Sun, 04 Oct 2009 03:13:50 +0000</pubDate>
		<dc:creator>Edgard</dc:creator>
				<category><![CDATA[in latin]]></category>
		<category><![CDATA[etymology]]></category>
		<category><![CDATA[whiskey]]></category>

		<guid isPermaLink="false">http://blog.bikelis.com/?p=259</guid>
		<description><![CDATA[whiskey dicitur quia saepe viscerās dolēre facit.]]></description>
			<content:encoded><![CDATA[<p><em>whiskey</em> dicitur quia saepe viscerās dolēre facit.</p>
]]></content:encoded>
			<wfw:commentRss>http://edgard.bikelis.com/blog/?feed=rss2&#038;p=259</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to activate wake-on-lan</title>
		<link>http://edgard.bikelis.com/blog/?p=250</link>
		<comments>http://edgard.bikelis.com/blog/?p=250#comments</comments>
		<pubDate>Sat, 03 Oct 2009 13:13:39 +0000</pubDate>
		<dc:creator>Edgard</dc:creator>
				<category><![CDATA[computing]]></category>
		<category><![CDATA[in english]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[wake on lan]]></category>

		<guid isPermaLink="false">http://blog.bikelis.com/?p=250</guid>
		<description><![CDATA[First you need to see if the network card supports it. I had to flash a newer version of a fairly ancient computer to get this to work (you need the ethtool package): #ethtool eth0 &#124; grep "Wake" If it spits something like Supports Wake-on: g Wake-on: d then we are good to go : [...]]]></description>
			<content:encoded><![CDATA[<p>First you need to see if the network card supports it. I had to flash a newer version of a fairly ancient computer to get this to work (you need the ethtool package):</p>
<p><code>#ethtool eth0 | grep "Wake"</code></p>
<p>If it spits something like</p>
<p><code>Supports Wake-on: g<br />
Wake-on: d</code></p>
<p>then we are good to go : ). To activate it:</p>
<p><code>#ethtool -s eth0 wol g</code></p>
<p>To find out the MAC address:</p>
<p><code>#ifconfig</code></p>
<p>Lets test it now. Halt the computer, then (you will need the wakeonlan package):</p>
<p><code>#wakeonlan [the machine's MAC adress]</code></p>
<p><em>Et voilà!</em> &#8230; but, you find out, later, that it only works if you use the ethtool command at each boot. Instead like editing <tt>/init.d/networking</tt> like you did before ; ), you find that it is easier to edit <tt>/etc/network/interfaces</tt>, and add these two last lines:</p>
<p><code>iface eth0 inet dhcp<br />
post-up /usr/sbin/ethtool -s $IFACE wol g<br />
post-down /usr/sbin/ethtool -s $IFACE wol g</code></p>
<p>Only then it really works.</p>
]]></content:encoded>
			<wfw:commentRss>http://edgard.bikelis.com/blog/?feed=rss2&#038;p=250</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

