tag:blogger.com,1999:blog-152833312024-03-14T06:54:56.619+05:30Anuradha's Diaryof shoes and ships and sealing wax, of cabbages and kings, and why the sea is boiling hot, and whether pigs have wingsAnuradhahttp://www.blogger.com/profile/00372329240504481682noreply@blogger.comBlogger51125tag:blogger.com,1999:blog-15283331.post-81769458101433490682010-01-04T22:46:00.005+05:302010-01-04T23:54:54.048+05:30Using GIT to Manage Config Files<p>One thing I like about <a href="http://git-scm.com/">GIT</a>, among others, is that it creates a repository locally. This makes simple things easy, still not disallowing complex things.</p><p>A good use of GIT is to manage the configuration files in a GNU/Linux system. This article describes the way I do it.</p><p>In this example, I will use the <a href="http://www.squid-cache.org/">Squid</a> proxy/cache server configuration as an example, but the principles apply to any configuration.</p><p>Ok, so here are the steps.</p><p>Zeroth step is to install GIT. ;-) On Debian/Ubuntu systems, install the "git-core" package.
</p><p>First create a git repository in /etc/. On Ubuntu systems, you may have to use "sudo", or become root with "sudo -s" before running the following commands.</p><pre># cd /etc
# git init
</pre><p>This will create a GIT repository in /etc/.git/. This step needs to be done only once. Any recent version of GIT should accept the "init" command, otherwise run "git init-db".</p><p>Now add and commit a file, so GIT will create the "master" branch. We add the "hostname" file in this example.</p><pre># git add hostname
# git commit -m "Initial commit." hostname</pre><p>If you don't use the "-m" option, GIT will start an editor to enter a comment.</p><p>I prefer to use three branches.</p><ul><li>master: This is the branch that holds the working configuration of the running system.
</li><li>stock: This branch contains the "default" configuration files as installed.</li><li>play: This branch is used for experimenting.</li></ul>Now that the "master" branch is already created, let's create the other two.<pre># git branch stock
# git branch play</pre><p>You can always use "git branch" command to see available branches with active branch highlighted.</p><p>In this example, we install Squid, and manage its configuration file /etc/squid/squid.conf using GIT.</p><p>Let us switch to the "stock" branch, install Squid, add the config file, commit it, and switch back to the "master" branch. Switching to a branch is called "checking out".
</p><pre># git checkout stock
# apt-get install squid
# git add squid/squid.conf
# git commit -m "Adding stock config file." squid/squid.conf
# git checkout master</pre><p>It is always a good idea to switch back quickly to the "master" branch, as we need to keep the "stock" branch clean without any of our changes going there accidentally.
</p><p>Now you will notice that the "squid/squid.conf" file has gone missing, because we added it in the "stock" branch, not in "master".</p><p>To get the config file to the "master" branch, we need to merge it with the "stock" branch.</p><pre># git merge stock</pre><p>I do all my experimenting, however small, in the "play" branch. Before starting an experiment, I switch to the "play" branch and merge it with "master", so both "master" and "play" will be identical at the beginning.</p><pre># git checkout play
# git merge master</pre><p>Now the experimenting begins. I would change the config file, start/restart Squid, and 1001 other things.</p><p>During experimenting, it is very useful to view the changes I have done by using the "git diff" command.</p><p>Even if the experiments are not successful, I would still commit any partial work to continue later. There is nothing to worry as we are in the "play" branch. Use the "git branch" command to verify this.</p><pre># git commit -m "Partially finished experiment." squid/squid.conf</pre><p>To get the system back to its previous state, we can always switch to the "master" branch.</p><pre># git checkout master</pre><p>Make sure to commit the changes in the "play" branch before checking out the "master" branch. Otherwise, those changes will be lost.</p><p>Once the experimenting is successful in the "play" branch, we can merge them to the master branch.</p><pre># git checkout master
# git merge play</pre><p>When backing up the system, make sure you include /etc/.git/ to save the history of your configurations.</p><p>Use "git log" to view the history of commits.</p><p>Happy gitting!</p>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com2tag:blogger.com,1999:blog-15283331.post-51951899160924371872009-05-24T13:17:00.005+05:302009-05-24T14:37:34.575+05:30A Rare Video of SWRD<p>In this recent <a href="http://unprotectedthoughts.com/2009/03/tamil-struggle-vs-black-struggle-reply.cfm">blog post</a>, Sam reminds how S W R D Bandaranaike changed national language in 1956, something most people in the present generation [wrongly] call a "Sinhala-only" policy.</p>
<blockquote>
English was the Language in Sri Lanka until Bandaranayaka changed it in to Sinhala “with reasonable use of Tamil” (the part everyone forget to mention when they talk about this), and later on, Tamil also considered as national language.
</blockquote>
<p>This rare <a href="http://www.youtube.com/watch?v=rbL5E5naR6s">video on youtube</a> is an interview with SWRD, where he states the "reasonable use of Tamil" part. He also admires Tamil as a "rich language with literature and so on".</p>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com1tag:blogger.com,1999:blog-15283331.post-35200163095247415162008-05-23T21:18:00.004+05:302008-05-23T22:38:13.518+05:30Congratulations Shilpa Sayura<p>Sri Lanka's <a href="http://shilpasayura.org/" target="_blank">Shilpa Sayura</a> project has won the <a href="http://stockholmchallenge.se" target="_blank">Stockholm Challenge</a> 2008.</p>
<p>The Jury had studies 400 projects from around the globe and selected 145 finalists in six categories. Shilpa Sayura won the first place in the Education category.</p>
<p>Congratulations Niranjan and the team for this great achievement!</p>
<span class="fullpost"><p>I once had the opportunity to see a Shilpa Sayura event at Kandiyapitawewa village. Pictures from that event <a href="http://www.flickr.com/photos/anuradha/sets/72157602123087620/detail/" target="_blank">are here</a>.</p></span>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com1tag:blogger.com,1999:blog-15283331.post-69912890463220331792008-05-06T15:44:00.005+05:302008-05-06T16:44:38.030+05:30Mr Donald, Please Correct the Alphabet First!<p>I have <a href="http://anuradha.sayura.net/2006/03/is-sinhala-unicode-incomplete.html" target="_blank">already replied</a> to Mr Donald Gaminitillake's mudslinging campaign against Sinhala Unicode, which he wields through <a href="http://www.akuru.org" target="_blank">akuru.org</a> web site and by hijacking discussions on various blogs and forums.</p>
<p>Mr Donald's motives are quite clear. He claims that every Sinhala character shape needs an individual "code point", and has applied for a patent for this "invention". With Sinhala Unicode becoming mainstream, avenues for making money with his pending patent are going thin.</p>
<p>So he is doing what any desperate human being (or animal for that matter) would do; try everything to remove the "opponent".</p>
<span class="fullpost">
<p>One of the examples Mr Donald always uses is the absence of character "du" in the Sinhala Unicode codepage.</p>
<p>Of course he conveniently forgets to mention that "da" and "papilla" are in fact available. Well, it requires a bit of brains to put them together. ;-)</p>
<p><b>Mr Donald, there are lots of missing characters in the Sinhala Hodiya (alphabet), including your infamous "du", let alone "yansaya" and "rakaransaya". If you love the Sinhala language so much as you claim, please start a campaign to "fix" Hodiya!</b></p>
<p>I have <a href="http://anuradha.sayura.net/2007/05/unicode-and-sinhala-alphabet.html">previously pointed out</a> this similarity between Hodiya and Sinhala Unicode, and why "du" + "papilla" is as good as "du". <a href="http://anuradha.sayura.net/2006/03/is-sinhala-unicode-incomplete.html">This blog post</a> discusses technicalities in detail including the matter of "yansaya" and "rakaransaya".</p>
<p>Unfortunately for Mr Donald, his "opponent", namely Sinhala Unicode, is growing stronger day by day. Implementations are maturing, more standards compliant fonts are beginning to appear, and as I <a href="http://anuradha.sayura.net/2008/03/more-sinhala-web-sites-using-sinhala.html">wrote earlier</a>, more web sites and blogs are now Unicode compliant (e.g.: <a href="http://www.sinhalabloggers.com" target="_blank">Sinhala Bloggers</a>, <a href="http://si.wikipedia.org" target="_blank">Sinhala Wikipedia</a>, <a href="http://www.sinhalablogs.com" target="_blank">Sinhala Blogs</a> and of course our own <a href="http://sinhala.linux.lk" target="_blank">Sinhala GNU/Linux</a>).</p>
</span>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com13tag:blogger.com,1999:blog-15283331.post-9918927475127101982008-05-03T12:12:00.007+05:302008-05-06T06:59:52.867+05:30External Projectors and GNU/Linux<p>Some GNU/Linux computers seem to have problems connecting to projectors. While my earlier <a href="http://www.thinkwiki.org/wiki/Category:R51" target="_blank">ThinkPad R51</a> always obeyed Fn+F7 combination to turn on output to an external projector, recently acquired <a href="http://www.thinkwiki.org/wiki/Category:R52" target="_blank">R52</a> did not.</p>
<p>After some research I found that <a href="http://www.x.org/wiki/Projects/XRandR" target="_blank">XRandR</a> has good support for output hotplugging. Although graphical tools are available to do this, I found the following commands useful.</p>
<span class="fullpost">
<pre>
% xrandr --auto
% xrandr --output --auto
</pre>
<p>The first one usually works, and it has to be issued as the same user running X, and not root.</p>
<p>In rare cases when parts of the screen is cropped due to the projector having a smaller resolution, use the -s option to reset the resolution:</p>
<pre>
% xrandr -s 1024x768
</pre>
<p>Running xrandr without options would show what is going on with the screen modes.</p>
</span>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com1tag:blogger.com,1999:blog-15283331.post-20881957925400589532008-04-21T19:02:00.004+05:302008-04-21T19:37:14.277+05:30Why Native Language is Important for Web<p>After reading <a href="http://rumblinglankan.com/whats-the-point-of-blogging-in-sinhala/" target="_blank">this blog post</a> about blogging Sinhala, I felt like writing my thoughts about the topic.</p>
<p>There are very few "yes" or "no" answers in life, so I don't think it is correct to rule "blogging in Sinhala is a good idea" or vice versa. Most answers can begin with an "it depends", and I think it is true here, too.</p>
<span class="fullpost"><p>In certain circumstances, using in English on the Web is a good idea. When addressing a global audience, or selling to a product on the Web to the global market, not using English will definitely not serve the purpose.</p>
<p>A key argument for using Sinhala is about addressing certain audiences who are not fluent in other languages.</p>
<p>I think there is a more important reason. Certain things can <em>only</em> be done in Sinhala, and this argument holds for any other language.</p>
<p>A blog post is not always a piece of information to be transmitted to a maximum audience. Sometimes it is a work of art. Works of art are diverse, and this diversity is not only limited to language.</p>
<p>Sinhala is not only a communication medium. It also has a very rich literature: poetry, writings and what not. Being a living language, new Sinhala literature is made every day. And if Web is the medium for such literature, obviously, Sinhala has to be the language.</p>
<p>Check out <a href="http://suonline.blogspot.com/2008/04/blog-post_4020.html" target="_blank">this blog post</a> for example. (You may need to <a href="http://www.siyabas.lk/sinhala_how_to_install.html" target="_blank">enable Unicode support</a>). It is a collection of Sinhala poetry from an online "hitiwana kavi maduwa", where people used poetry to communicate. I am sure there are lots of readers who appreciate such work. I can hardly imagine how such a blog post can be in English.</p>
<p>So I think the answer to most questions of life applies here as well: <em>it depends</em>. ;-)</p></span>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com4tag:blogger.com,1999:blog-15283331.post-3877346719031757852008-04-20T18:00:00.005+05:302008-04-21T16:50:36.163+05:30LaTeX and Sinhala Unicode<p>When we <a href="http://mail.lug.lk/lurker/thread/20080417.161404.4759eb85.html" target="_blank">met at Excel World</a> on last 17th, <a href="http://www.geekaholic.org/" target="_blank">Bud</a>, Srimal and myself started talking about using Sinhala Unicode in <a href="http://en.wikipedia.org/wiki/TeX" target="_blank">TeX</a> / <a href="http://www.latex-project.org/" target="_blank">LaTeX</a>.</p>
<p>It didn't occur to me that <a href="http://www.ucsc.cmb.ac.lk/People/cik/" target="_blank">Chamath</a>, who also created one of the first Sinhala FOSS keyboard drivers, has already created a preprocessor for LaTeX called sintex which reads Sinhala files in Unicode/UTF-8. In fact, not only had I replied to <a href="http://mail.lug.lk/lurker/thread/20060503.023257.e7bd4af3.html" target="_blank">his announcement</a>, but also sent a patch to Debianize it! Life is too complex, and I am too human to keep track of all these.</p>
<p>But that forgetfulness turned out to be a lucky incident, as our pursuit lead to something more useful!</p>
<span class="fullpost"><p>So we started creating a preprocessor for Vasantha Saparamadu's <a href="http://www.ocs.mq.edu.au/~vsaparam/sinhala.html" target="_blank">Sinhala TeX</a> package which uses Samanala transliteration scheme.</p>
<p>However, Bud pointed out that the generated PDF files will have ASCII characters instead of Unicode, making it a problem for search engines that index them, and convert them for "HTML view" pages.</p>
<p>After some research, we found <a href="scripts.sil.org/xetex" target="_blank">XeTeX</a>, a Unicode enabled version of LaTeX.</p>
<p>XeTeX uses <a href="http://www.icu-project.org/" target="_blank">ICU</a> for text layout, and ICU versions after 3.6 supports Sinhala out of the box. However, latest stable version 0.996 of XeTeX uses statically linked ICU 3.4. I managed to patch the "tetex-xetex" package that comes with <a href="http://www.debian.org" target="_blank">Debian</a> and make it recognize Sinhala. The patches <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=476957" target="_blank">were also submitted</a> to Debian.</p>
<p>XeTeX font changes are always manual, which made the source look ugly. After a bit of research, I found <a href="http://code.google.com/p/zhspacing/" target="_blank">zhspacing</a> package, which among other things automatically sets fonts for Chinese characters. But it is a complicated package, but I managed to get an idea of how it uses character class feature in the latest XeTeX version 0.997.</p>
<p>Downloading the latest version of XeTeX from <a href="http://scripts.sil.org/svn-view/xetex/TRUNK" target="_blank">SVN repository</a> and building for Debian was not difficult, except I had to edit debian/control files to replace tetex-base and tetex-bin dependency to their texlive counterparts. I had to first get <a href="http://scripts.sil.org/svn-view/xdvipdfmx/TRUNK/" target="_blank">xdvipdfmx</a>. Here is a rough sketch of the work.</p>
<pre>
% mkdir xdvipdfmx
% cd xdvipdfmx
% svn co http://scripts.sil.org/svn-view/xdvipdfmx/TRUNK
% cd TRUNK
% chmod +x debian/rules
# dpkg-buildpackage -b
# cd ..
# dpkg --purge dvipdfmx
# dpkg -i xdvipdfmx...deb
% cd ..
% mkdir xetex
% cd xetex
% svn co http://scripts.sil.org/svn-view/xetex/TRUNK
% cd TRUNK
% vi debian/control
% chmod +x debian/rules
# dpkg-buildpackage -b
# cd ..
# dpkg --purge texlive-xetex
# dpkg -i xetex...deb
</pre>
<p>As the XeTeX web site had warned, the Debian build files provided by vanilla XeTeX were not up to date. After installing I had to create a /etc/texmf/fmt.d/10local.cnf with the following two lines:</p>
<pre>
xetex xetex - *xetex.ini
xelatex xetex language.dat *xelatex.ini
</pre>
<p>and then run the following commands:</p>
<pre>
# update-fmutil
# fmutil-sys --enablefmt xetex
# fmutil-sys --enablefmt xelatex
</pre>
<p>to make "xelatex" command to work properly.</p>
<p>After getting latest version of XeTeX working, the last remaining step was to create a small style file, which I called "sinhala.sty", to make automatic font switching for Sinhala.</p>
<pre>
% sinhala.sty version 20080420
% Typesetting mixed Sinhala documents in XeTeX
%
% Copyright (C) 2008 by Anuradha Ratnaweera
%
\ifx\XeTeXrevision\@undefined
\errmessage{XeTeX is required to use sinhala}
\fi
\ifx\XeTeXinterchartokenstate\@undefined
\errmessage{XeTeX 0.997 or above required to use sinhala}
\fi
\ProvidesPackage{sinhala}[2008/04/20]
\RequirePackage{fontspec}
\newfontinstance{\sifont}[Script=Sinhala]{LKLUG}
\newcommand\latinfont{\fontfamily{lmr}\selectfont}
\XeTeXinterchartokenstate = 1
\newcount\cnt\cnt="0D80
\loop
\XeTeXcharclass\cnt=10 \ifnum\cnt<"0DFF \advance\cnt1
\repeat
\XeTeXcharclass "200C = 10
\XeTeXcharclass "200D = 10
\XeTeXinterchartoks 0 10 = {\sifont}
\XeTeXinterchartoks 255 10 = {\sifont}
\XeTeXinterchartoks 10 0 = {\latinfont}
\XeTeXinterchartoks 10 255 = {\latinfont}
</pre>
<p>So, all you need is XeTeX 0.997 and sinhala.sty to write LaTeX files using Sinhala Unicode.</p></span>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com0tag:blogger.com,1999:blog-15283331.post-83150277222833612432008-04-15T07:40:00.002+05:302008-04-16T07:34:50.091+05:30Goodbye xorg.conf!<p>After reading <a href="http://wiki.debian.org/XStrikeForce/HowToRandR12">this article</a> on <a href="http://www.x.org/wiki/Projects/XRandR" target="_blank">xrandr</a>, I wanted to see how total autoconfiguration works on <a href="http://en.wikipedia.org/wiki/X_Window_System" target="_blank">X Windows</a>.</p>
<p>As a start, I tried removing xorg.conf file completely and restart X. The sky didn't fall down! In fact, I didn't notice any change. Everything from USB hotplug to OpenGL continued to work as before.</p>
<span class="fullpost"><p>The only tweak needed was to the old font system. Unlike fontconfig, the old X font system seems to depend on the "font path" set in xorg.conf. This was a problem for using my custom SUN22x12 font in xterm. After adding the following lines to ~/.fvwm/preferences/Startup, this problem was gone, too.</p>
<pre>
AddToFunc InitFunction
+ I Exec exec /usr/bin/xset +fp /usr/local/share/fonts
</pre>
<p>Yes, I use <a href="http://fvwm-crystal.org/" target="_blank">fvwm-crystal</a>, a "polished" version of <a href="http://www.fvwm.org/" target="_blank">FVWM</a>. Old school, so what?</p></span>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com1tag:blogger.com,1999:blog-15283331.post-46634868283386705332008-04-14T22:20:00.007+05:302008-04-16T07:36:08.426+05:30Simplifying Digital Camera Access on GNU/Linux<p>Digital camera access is simple enough on GNU/Linux, but with a couple of tweaks here and there, it can be made even simpler.</p>
<p><it>Summary</it>: I keep my photos in directories named "yyyy-mm-dd" by the date taken. When I plug in the camera, photos are automatically downloaded and sent to correct directories. If you like to know how I did it, please read on!</p>
<span class="fullpost"><p>Accessing digital cameras has always been simple on GNU/Linux. A large number of digital cameras are supported out of the box. When using the shell, arguably <a href="http://www.gphoto.org/" target="_blank">gphoto</a> is the most convenient. Running gphoto with the "P" option autodetects the camera and downloads all the photos in it.</p>
<pre>
% gphoto2 -P
</pre>
<p>I keep all my photos in a "photos" directory with subdirectories in the "yyyy-dd-mm" format indicating the date taken.</p>
<p>First step of simplification is to automatically put each image into the correct location. Digital cameras put a lot of <a href="http://en.wikipedia.org/wiki/Exif" target="_blank">Exif information</a> into each image, so extracting the date taken is quite straightforward. I use a simple tool called <a href="http://sourceforge.net/projects/libexif" target="_blank">exif</a> to do this.</p>
<p>Both gphoto2 and exif are available on <a href="http://www.debian.org" target="_blank">Debian</a>.</p>
<pre>
# apt-get install gphoto2 exif
</pre>
<p>
After some trial and error, I figured that the images taken with my <a href="http://en.wikipedia.org/wiki/Canon_PowerShot_S3_IS" target="_blank">Canon PowerShot S3 IS</a> have a tag 0x132 indicating the date each photo was taken.
</p>
<pre>
% exif -t 0x132 IMG_0416.JPG
EXIF entry 'Date and Time' (0x132, 'Date and Time')...
Tag: 0x132 ('DateTime')
Format: 2 ('Ascii')
Components: 20
Size: 20
Value: 2007:10:22 06:05:49
</pre>
<p>What we want is in the "Value:" line. After filtering that line with grep, and using sed a couple of times, we can get the date in yyyy-dd-mm format.</p>
<pre>
% exif -t 0x132 IMG_0416.JPG | \
grep 'Value: ' | \ # Filter the line with "Value:"
sed 's/.*Value: \(....:..:..\) .*/\1/' | \ # Get the yyyy:mm:dd part of the value line
sed 's/:/-/g' # convert ":" to "-"
2007-10-22
</pre>
<p>If you want to understand exactly what each step is doing, try the above pipeline by adding one filter at a time.</p>
<p>Then I put together a small script to move each image in the current directory to ~/pictures/yyyy-mm-dd/ subdirectories where I want them.</p>
<pre>
gphoto2 -P
for i in *.JPG
do
date=$(exif -t 0x132 $i | \
grep 'Value: ' | \
sed 's/.*Value: \(....:..:..\) .*/\1/' | \
sed 's/:/-/g')
dir="/home/anuradha/pictures/test/$date"
mkdir -p "$dir"
mv -f "$i" "$dir"
done
</pre>
<p>Notice that I use a test directory. I saved this in ~/bin/, and made it executable.</p>
<p>Now comes the fun part. After connecting the camera to the computer, I used "lsusb" to find out its vendor ID and product ID are 04a9:311a. The following <a href="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html" target="_blank">udev</a> rule in /etc/udev/rules.d/010_local.rules invokes the above script whenever this camera is plugged in.</p>
<pre>
ACTION=="add", BUS=="usb", \
SYSFS{idVendor}=="04a9", SYSFS{idProduct}=="311a", \
RUN+="/home/anuradha/bin/pictures.sh"
</pre>
<p>Well, matters are a little more complicated. Udev seems to invoke the script <em>multiple</em> times. So I added two extra "features" to stop that.</p>
<ul>
<li>Adding a lock file to prevent multiple simultaneous running of the script.</li>
<li>Use a "timestamp" file at the end of the script, and not run again "too soon" (60 seconds turned out to be ok).</li>
</ul>
<p>These made sure that the script is run only once when the camera is plugged in.</p>
<p>I used the number of seconds since the <a href="http://en.wikipedia.org/wiki/Unix_time" target="_blank">Unix Epoch</a> given by the stat and date commands. If the timestamp file was created less than 60 seconds ago, the script aborts.</p>
<p>So here is the complete script:</p>
<pre>
#!/bin/bash
set -e
user=anuradha
group=users
pictures="/home/$user/Pictures"
download="$pictures/.download"
logdir="$pictures/log"
log=$(date +"$logdir/%Y-%m-%d");
cooldown=60
lock=/tmp/.pictures.download
lasttime=$lock.time
# Avoid multiple simultaneous runs
ln -s $lock $lock || exit 0
# Abort if we had run less than $cooldown seconds ago
if [ -f "$lasttime" ]
then
t1=$(stat -c '%Z' $lasttime)
t2=$(date +'%s');
dt=$((t2 - t1))
if [ $dt -lt $cooldown ]
then
rm -f $lock
exit 0
fi
fi
# Take it slowly ;-)
sleep 3
mkdir -p $download
mkdir -p $logdir
rm -f $download/*
# Get the photos, all of them
cd $download
gphoto2 -P
for i in *.JPG
do
date=$(exif -t 0x132 $i | \
grep 'Value: ' | \
sed 's/.*Value: \(....:..:..\) .*/\1/' | \
sed 's/:/-/g')
dir="$pictures/$date"
if [ ! -f "$dir/$i" ]
then
[ -d $dir ] || mkdir -p $dir
chown $user:$group $i
chmod 644 $i
chown $user:$group $dir
mv -f $i $dir
echo "$date/$i" >> $log
fi
done
cd
rmdir $download
# Add a timestamp
touch $lasttime
rm -f $lock
exit 0
</pre></span>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com3tag:blogger.com,1999:blog-15283331.post-21768858677684183182008-04-09T23:36:00.005+05:302008-04-16T07:37:41.352+05:30Network Traffic Accounting<p>After <a href="http://anuradha-ratnaweera.blogspot.com/2008/04/mobitel-3g-with-huawei-e220-on-debian.html">totally automating</a> my Mobitel 3G connection, the next natural step was to setup some kind of a traffic accounting system. I wanted to avoid tools that monitor individual packets, because that was an unnecessary overhead. <a href="http://www.humdi.net/vnstat/" target="_blank">vnStat</a> turned out to be a perfect match.</p>
<span class="fullpost"><p>Here are the steps in setting up vnstat on <a href="http://www.debian.org" target="_blank">Debian</a>. Good news is that vnstat in Debian comes with proper crontab entries and network up/down hooks already in place.</p>
<ul>
<li>First step, obviously is to install vnstat:
<pre>
# apt-get install vnstat
</pre>
</li>
<li>Create a new configuration:
<pre>
# vnstat --showconfig > /etc/vnstat.conf
</pre>
</li>
<li>Edit /etc/vnstat.conf and set the default interface to "ppp0".</li>
<li>Create an empty database for ppp0:
<pre>
# vnstat -u -i ppp0
</pre>
</li>
</ul>
<p>Now vnstat starts counting network traffic. The default crontab seems to run "vnstat -u" every 5 minutes.</p>
<p>Then I installed this simple web based frontend called <a href="http://www.sqweek.com/sqweek/index.php?p=1" target="_blank">vnStat PHP frontend</a>. Installation is just a matter of unpacking:</p>
<pre>
# cd /usr/local/src/
# wget http://www.sqweek.com/sqweek/files/vnstat_php_frontend-1.3.tar.gz
# cd /var/www
# tar -xzvf /usr/local/src/vnstat_php_frontend-1.3.tar.gz
# mv vnstat_php_frontend-1.3 vnstat
</pre>
<p>Then I had to edit /var/www/vnstat/config.php and set the following values.</p>
<pre>
$iface_list = array('ppp0');
$iface_title['ppp0'] = 'Mobitel 3G';
$vnstat_bin = '/usr/bin/vnstat';
</pre>
<p>Pointing a browser to http://localhost/vmstat/ showed that everything is working fine.</p>
<p>I also have the following .htaccess file in vnstat directory to avoid access from remote hosts:</p>
<pre>
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</pre></span>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com1tag:blogger.com,1999:blog-15283331.post-79447209237634719962008-04-09T10:30:00.012+05:302008-04-16T07:38:04.402+05:30Mobitel 3G with Huawei E220 on Debian<p>Finally I decided to shift my mobile Internet connectivity from <a href="http://en.wikipedia.org/wiki/General_Packet_Radio_Service" target="_blank">GPRS</a> to <a href="http://en.wikipedia.org/wiki/High-Speed_Downlink_Packet_Access" target="_blank">HSDPA</a> by getting a <a href="http://www.mobitel.lk/m3/broadband/broadband.html" target="_blank">Mobitel 3G broadband</a> connection.</p>
<p>The package includes a <a href="http://www.huawei.com/mobileweb/en/products/view.do?id=282" target="_blank">Huawei E220 HSDPA USB modem</a> (<a href="http://en.wikipedia.org/wiki/Huawei_E220" target="_blank">Wikipedia article</a>), SIM card and connection, connection fee and first month's bill waived, a Rs 5k deposit which shall be refunded after an year.</p>
<span class="fullpost"><p>Huawai E220 is known to work out of the box on Linux after 2.6.20. However, some of the most recent kernels <a href="http://lkml.org/lkml/2007/10/30/348" target="_blank">seems to have a conflict</a> with the USB mass storage driver. It means, the disk drive in the modem with Windows drivers get detected, but not the modem. I am presently running Linux 2.6.24.4, which also exhibits this behavior.</p>
<p><a href="http://www.geekaholic.org/" target="_blank">Bud</a> suggested a quick workaround: to start the computer while the USB dongle is plugged in. This worked, and the modem was autodetected as /dev/ttyUSB0.</p>
<p>The sales person at Excel World Mobitel outlet told me that the APN has to be statically set to "mobitel3g" and the number is "*99***1#". It was easy to find the <a href="http://en.wikipedia.org/wiki/Hayes_command_set" target="_blank">AT commands</a> to do this. I created the following /etc/wvdial.conf file and running "wvdial" afterwards took me to the Internet. Username and password was just to stop wvdial complaining.</p>
<pre>
[Dialer Defaults]
Modem = /dev/ttyUSB0
Baud = 1843200
Modem Type = Analog Modem
Init2 = ATZ
Init3 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init4 = AT+CGDCONT=1,"IP","mobitel3g"
Dial Command = ATDT
Phone = *99***1#
Username = foo
Password = bar
Stupid Mode = yes
</pre>
<p>Going with the "get it working, then make it better" philosophy, then I looked at the conflict with the USB disk. There are couple of suggestions to the kernel usb-storage driver discussed on the above thread - which didn't work for me unfortunately, but just running this <a href="http://www.kanoistika.sk/bobovsky/archiv/umts/huaweiAktBbo.c" target="_blank">huaweiAktBbo utility</a> did the trick. So I copied the binary to a standard location.</p>
<pre>
# apt-get install build-essential libusb-dev # just to be sure
# cc -o huaweiAktBbo -lusb huaweiAktBbo.c
# cp huaweiAktBbo /usr/local/sbin/
</pre>
<p>Then I created a small script to initiate the connection:</p>
<pre>
#!/bin/sh
lock=/tmp/.mobitel.lock
if ln -s $lock $lock
then
[ -c /dev/ttyUSB0 ] || /usr/local/sbin/huaweiAktBbo
sleep 3
if [ -c /dev/ttyUSB0 ]
then
cp -f /etc/wvdial.conf.mobitel /etc/wvdial
/usr/bin/wvdial
fi
rm -f $lock
fi
exit 0
</pre>
<p>Lock can also be created in /var/run, and notice that I have <em>not</em> done a "set -e", because if wvdial stops with an error, we still need to remove the lock. The lock is there to avoid multiple invocations of the script.</p>
<p>Then I created a simple <a href="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html" target="_blank">udev</a> rule to automatically connect whenever the E220 is plugged in. You can use "lsusb", among others, to find the vendor ID and product ID. I created a new /etc/udev/rules.d/010_local.rules file with the following line.</p>
<pre>
ACTION=="add", BUS=="usb", SYSFS{idVendor}=="12d1", \
SYSFS{idProduct}=="1003", RUN+="/usr/local/sbin/mobitel.sh"
</pre>
<p>That's it! Now I am on the Internet automatically whenever the device is connected to the computer!</p>
<p>The only remaining "problem" was <a href="http://www.freedesktop.org/wiki/Software/hal" target="_blank">hal</a> which was still trying to automount the USB disk. As <a href="http://wiki.archlinux.org/index.php/Huawei_E220" target="_blank">suggested in ArchLinux wiki</a>, creating a file /usr/share/hal/fdi/preprobe/20thirdparty/10-huawei-e220.fdi with the following fixes this:</p>
<pre>
<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
<device>
<match key="usb.vendor_id" int="0x12d1">
<match key="usb.product_id" int="0x1003">
<merge key="info.ignore" type="bool">true</merge>
</match>
</match>
</device>
</deviceinfo>
</pre>
<p>The connection is fast and way cheaper than GPRS when it comes to volume. HSDPA costs one rupee per MB, while GPRS costs 20!</p>
<p><b>Update</b>: I noticed that udev runs the script multiple times, so as a quick fix I have added a test for /dev/ttyUSB0 in a couple of places in the script to make matters better.</p></span>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com14tag:blogger.com,1999:blog-15283331.post-44916599521245818992008-03-30T14:33:00.004+05:302008-04-16T07:38:26.260+05:30HDR Imaging on FOSS<p><a href="http://en.wikipedia.org/wiki/High_dynamic_range_imaging" target="_blank">High dynamic range (HDR) imaging</a> is an interesting aspect of modern photography.</p><p>Today I demonstrated HDR imaging and panoramas at <a href="http://www.agschool.edu.lk/" target="_blank">AG School of Business and Computer Studies</a>, Negambo. Here are some resources I listed during this session.</p><span class="fullpost"><ul><li><a href="http://en.wikipedia.org/wiki/High_dynamic_range_imaging" target="_blank">Wikipedia HDR imaging article</a></li><li><a href="http://qtpfsgui.sourceforge.net/" target="_blank">Home page of qtpfsgui</a></li><li><a href="http://hugin.sourceforge.net/" target="_blank">Home page of Hugin</a></li><li><a href="http://www.gimp.org/" target="_blank">Home page of GIMP</a></li><li><a href="http://www.flickr.com/groups/hdr/" target="_blank">HDR group</a> on <a href="http://www.flickr.com/" target="_blank">Flickr</a></li><li><a href="http://www.flickr.com/photos/tags/qtpfsgui/" target="_blank">Photos tagged qtpfsgui</a> on Flickr (hint: click on "<a href="http://www.flickr.com/photos/tags/qtpfsgui/interesting/" target="_blank">Most interesting</a>" to see good images)</li><li><a href="http://www.flickr.com/photos/tags/hdr/" target="_blank">Photos tagged HDR</a> on Flickr (hint: click on "<a href="http://www.flickr.com/photos/tags/hdr/interesting/" target="_blank">Most interesting</a>" to see good images)</li><li><a href="http://www.flickr.com/photos/tags/panorama/" target="_blank">Photos tagged Panorama</a> on Flickr (hint: click on "<a href="http://www.flickr.com/photos/tags/panorama/interesting/" target="_blank">Most interesting</a>" to see good images)</li></ul></span>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com0tag:blogger.com,1999:blog-15283331.post-45448762185312152342008-03-07T17:53:00.007+05:302008-04-16T07:39:45.570+05:30More Sinhala Web Sites Using Unicode<p>Use of of Sinhala Unicode on the Web is slowly, but steadily, growing.</p><p>Two years ago, our good friend Niranjan Meegammana started <a href="http://groups.google.com/group/Sinhala-Unicode">the Sinhala Unicode group</a> to bring together all those who are involved in the development of Sinhala Unicode to communicate, and to use Sinhala itself to do so. Today the group has become one of the very active forums on the topic, and provides a living example for the success of the standard.</p><span class="fullpost"><p>Although some newspapers are still reluctant to move from legacy font tricks to Sinhala Unicode, <a href="http://www.dinamina.lk">Dinamina</a> and <a href="http://www.ethalaya.com">e-thalaya</a> online newspapers made a bold move by using only Unicode in their web sites, providing fine examples that the implementations are mature.</p><p>This <a href="http://www.sinhalablogs.com/">Sinhala blog sindicator</a> aggregates dozens of blogs written in Sinhala.</ap><p>My previous posts on this topic are <a href="http://anuradha-ratnaweera.blogspot.com/2007/05/unicode-and-sinhala-alphabet.html" target="_blank">here</a>, <a href="http://anuradha-ratnaweera.blogspot.com/2006/03/is-sinhala-unicode-incomplete.html" target="_blank">here</a> and <a href="http://anuradha-ratnaweera.blogspot.com/2006/03/sinhala-unicode-on-gnulinux.html" target="_blank">here</a>.</p></span>Anuradhahttp://www.blogger.com/profile/00372329240504481682noreply@blogger.com4tag:blogger.com,1999:blog-15283331.post-89207717249446628792008-02-06T21:50:00.003+05:302008-05-03T20:16:41.803+05:30The Old Order Changeth<blockquote>
"The old order changeth, yielding place to new" [said King Arthur]
-- From <a href="http://charon.sfsu.edu/TENNYSON/poems/mortedarthur.shtml" target="_blank">Morte D'Arthur</a> by Lord Tennyson
</blockquote>
<p>And so again the time has come for a change. I decided to spend more time in the wilderness where I came from, and move away from this city life, to which I will never get used to. ;-)</p><span class="fullpost"><p>I started working as a freelance consultant starting 1st of February, 2008. Initially I am focusing on software/IT, but hoping to expand to <a href="http://en.wikipedia.org/wiki/CNC" target="_blank">CNC</a> sooner or later.</p><p>I will also continue to work for <a href="http://www.virtusa.com" target="_blank">Virtusa</a> as an external consultant.<p><p>You can reach me at anuradha at taprobane dot org. If you forget it or loose it, searching Google for "anuradha" or "anuradha ratnaweera" should find <a href="http://www.sayura.net/anuradha/" target="_blank">my home page</a> with contact details and links.</p></span>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com1tag:blogger.com,1999:blog-15283331.post-90487478109037555262008-01-11T18:55:00.000+05:302008-01-11T19:09:11.500+05:30FBI on LTTEThe <a href="http://www.fbi.gov">FBI site</a> has <a href="http://www.fbi.gov/page2/jan08/tamil_tigers011008.html">this article</a> on how to stop helping terrorism while living in the US. It is also the top story on the site as of today.Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com0tag:blogger.com,1999:blog-15283331.post-30797882438920617702007-10-16T07:53:00.000+05:302007-10-16T11:55:42.087+05:30My Photo BlogI'm featuring selected photos in my <a href="http://www.flickr.com/photos/anuradha/">photo gallery</a> on a <a href="http://photos-by-anuradha.blogspot.com/">photo blog</a>.Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com0tag:blogger.com,1999:blog-15283331.post-78327602260527956472007-07-22T13:07:00.001+05:302008-04-16T07:40:54.386+05:30FVWM-Crystal Windows Manager<p>I always liked to have <a href="http://www.fvwm.org/">FVWM</a> as my <a href="http://xwinman.org/">window manager</a>. However, it lacks three important features I need on my desktop:</u>
<ul><li>Taskbar</li><li>Notification area (AKA system tray)</li><li>Application launcher</li></ul>
<p>The <a href="http://www.fvwm-crystal.org">FVWM-Crystal</a> window manager adds exactly these features to vanilla FVWM, along with other subtle goodies all over.</p>
<span class="fullpost"><p>Lack of desktop icons has never been a problem to me. Launchers are best left in a corner, so there is no need to "show desktop" or "hide windows" in order to use icons.</p>
<p>Another nice thing about FVWM-Crystal is the ability to start a terminal just by right-clicking anywhere on the desktop. Even blank areas between launcher, workarea switcher and notification area would do, so there is no need to resize a maximized window to do this. Another nice thing is the ability to start a small terminal by pressing Alt + grave(`).</p>
<p>I know several users who have switched to FWVM-Crystal and are happy. :-)</p></span>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com1tag:blogger.com,1999:blog-15283331.post-26595858061439101032007-05-29T16:34:00.002+05:302008-04-16T07:50:32.691+05:30Unicode and Sinhala Alphabet<p>There is a great deal of similarity between Sinhala Unicode (~ SLS 1134) and Sinhala Hodiya (alphabet).</p>
<p>Sidath Sangarawa, one of the oldest texts on Sinhala grammar written over 2000 years ago, lists 10 vowels and 20 consonants (see footnote 1), but the book also uses two unlisted vowels ඇ and ඈ (see footnote 2).</p>
<p>Sanskrit influence increased the number of characters to over 50.</p>
<span class="fullpost"><p>Actual number of shapes, known as "glyphs" in modern typographic terminology, needed to write in Sinhala is in the range of thousands, due to derived and joint forms of basic characters.</p>
<p>Listing all these thousands of glyphs was never a popular practice. Students learn basic characters and modifiers, and common sense takes care of generating the thousands of other shapes. For example, after learning "ispilla", you can add it to basic consonants and generate all the "i" forms such as "ki", "gi", "ji" etc.</p>
<p>Hodiya doesn't have any of these extra characters such as "ki" or "du". Hodiya doesn't have rakaransaya nor yansaya. But nobody complained. Everybody knew, and still know, that the Hodiya is only a basic guide to generate more complex glypls.</p>
<p>However, this didn't work when Sinhala texts started to be printed on printing machines. These machines don't have brains and couldn't learn how to "generate". Therefore every possible glyph had to be given.</p>
<p>Walk into an old press to see a large "matrix" or such glyphs.</p>
<p>Then came the age of computer based typography. Computers can be taught to do things, and that is exactly how standards like Unicode and SLS 1134 generate shapes. We can teach computers to generate thousands of glyphs using less than a hundred of basic shapes. For example, we can generate "du" by adding "da" and "papilla", so a seperate "du" is not necessary.</p>
<p>How about "yansaya" and "rakaransaya"? They are generated by sequences including the <a href="http://en.wikipedia.org/wiki/Zero-width_joiner">zero-width joiner</a> (ZWJ). For example, "pra" is represented as "pa", "hal kireema", ZWJ and "ra". ZWJ also is used to represent joint and touching letters.</p>
<p>Gone are the days of brainless matrix-based printing machines.</p>
<p>We need two things to view Sinhala on a computer. A font containing Sinhala glyphs, and the computer programs should knows how to generate glyphs using sequences of basic characters. Let me explain using an example.</p>
<p><em>Step 0.</em> Here is how a sample web page looks on a browser when it cannot find a Sinhala Unicode font. The "boxes" indicate unavailable character numbers:</p>
<p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcwNRqkDeN9vPwiOFcrlntkX6qfSn_pfAQe5TtXU7WdJUtWZQ4duOy8EaIt97-EzeWhEdI7q4xhklQyFdX724TeXZ-GszEtcAurIiWOCkyQJknzG-e8s2q2kgZe1QNniJLbH72/s1600-h/sinhala-0.gif"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcwNRqkDeN9vPwiOFcrlntkX6qfSn_pfAQe5TtXU7WdJUtWZQ4duOy8EaIt97-EzeWhEdI7q4xhklQyFdX724TeXZ-GszEtcAurIiWOCkyQJknzG-e8s2q2kgZe1QNniJLbH72/s400/sinhala-0.gif" alt="" id="BLOGGER_PHOTO_ID_5069937616198420690" border="0" /></a></p>
<p><em>Step 1.</em> After installing a font, the browser will show some Sinhala, but if it hasn't "learned" how to generate glyphs, only basic characters and modifiers are shown independently:</p>
<p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNRS4ABSKMbQ03DGuxw7BpgwGROjmOvvqd3Rb5wdnzxIID3IRRU938LGdJ9N-uD11vVQkBPGdjQB6lrq6l-PQm358T96gmAclHNU-6GCx6i2hr8he7yY5zxI8tJujBiKCA6XM1/s1600-h/sinhala-1.gif"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNRS4ABSKMbQ03DGuxw7BpgwGROjmOvvqd3Rb5wdnzxIID3IRRU938LGdJ9N-uD11vVQkBPGdjQB6lrq6l-PQm358T96gmAclHNU-6GCx6i2hr8he7yY5zxI8tJujBiKCA6XM1/s400/sinhala-1.gif" alt="" id="BLOGGER_PHOTO_ID_5069937620493388002" border="0" /></a></p>
<p><em>Step 2.</em> Now I have enabled the "shaper" in the browser, which is the part that knows how to generate Sinhala glyphs using basic characters:</p>
<p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYL8fr6rdvftcidA4XBWVKPsgf_dVK7D0ymNX4o4Ip7a54aCWDljfNlR27QP5fexPsTaT4zzs_B_AVp7a7Z4vH7J2KPIYwp3tsJVkalQrv2q7SIJOG3oTuRNP95J0Z2QXfYZe8/s1600-h/sinhala-2.gif"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYL8fr6rdvftcidA4XBWVKPsgf_dVK7D0ymNX4o4Ip7a54aCWDljfNlR27QP5fexPsTaT4zzs_B_AVp7a7Z4vH7J2KPIYwp3tsJVkalQrv2q7SIJOG3oTuRNP95J0Z2QXfYZe8/s400/sinhala-2.gif" alt="" id="BLOGGER_PHOTO_ID_5069937620493388018" border="0" /></a></p>
<p>All is well!</p>
<p>So where exactly is the similarity?</p>
<p>Students learn less than 100 basic characters in the alphabet and modifiers, and use their brains with some support from teachers to generate the rest of the 1000+ shapes.</p>
<p>Computers can be programmed - and some computers have already been programmed - to generate 1000+ Sinhala glyphs using less than 100 basic shapes in Sinhala Unicode / SLS 1134 standard.</p>
<p>As the standard is platform independent, we use it to communicate with people using diverse platforms in the <a href="http://groups.google.com/group/Sinhala-Unicode">Sinhala Unicode Group</a> among others.</p>
<p><em>Footnote 1.</em> පණකුරු පසෙක් එද ලුහු ගුරු බෙයින් දසවේ, ගතකුරුද වේ විස්සෙක්, වහරට යුහු හෙළ බස</p>
<p><em>Footnote 2.</em> Notice the use of ඇ and ඈ, both independently and in consonants: පසැස් ඈ සරලොප් නැතද සර ගතට පැමිණවූ බැවින් සර සඳ නම්.</p></span>Anuradhahttp://www.blogger.com/profile/00372329240504481682noreply@blogger.com6tag:blogger.com,1999:blog-15283331.post-37396892098647977122007-05-25T20:53:00.001+05:302008-04-16T07:51:37.569+05:30Ages of life<p>While chilling out at home a few weeks ago, a colorful "Dothulu" tree caught my eye. After clicking some photographs I totally forgot about it.</p>
<p>When I later checked the photos on a PC, the tree turned out to contain <em>five</em> different types of seeds at five different stages of life! Six if you count the one inside the next branch about to come out.</p>
<p><div align="center"><a href="http://www.flickr.com/photos/anuradha/513238700/"><img src="http://farm1.static.flickr.com/209/513238700_a8a6550b89_m.jpg"></a></div></p>
<span class="fullpost"><p>Manifestations of <a href="http://en.wikipedia.org/wiki/Impermanence">impermanence</a> are everywhere, but I find this one fascinating, because it fitted into just one colorful photograph.</p></span>Anuradha Ratnaweerahttp://www.blogger.com/profile/05946021964208733442noreply@blogger.com6tag:blogger.com,1999:blog-15283331.post-45975468521126589322007-05-23T11:15:00.001+05:302008-04-16T07:52:55.132+05:30Orbitrek vs Orbitrak<p>Recently I wanted to buy an aerobic exercising machine.</p>
<p>After doing a lot of research on the Internet and reading user reviews, I finally settled to buy an <a href="http://www.thane.com/products/fitness/orbitrek/orbitrek.php">Orbitrek Platinum</a>. One of the key decision factors was that it's yet another implementation of well known <a href="http://en.wikipedia.org/wiki/Elliptical_trainer">Ellipical Trainer</a>.</p>
<span class="fullpost"><p>The original Orbitrek had some scary reviews: that it is falling apart. Probably this may be due to poor assembling, but still good enough reason for me to be doubtful. However the newer version known as the Orbitrek Platinum, which also has been around for a while, didn't seem to have this problem and the reviews were good.</p>
<p>So here I am, looking around to buy an Orbitrek Platinum.</p>
<p>First I went to Teleseen Marketing in Majestic City. They were offering the Orbitrek Platinum, but the old one was also available. Then I checked with Himalayas, which was only a few blocks away on the same floor, and to my surprise they also were offering both the old one and the Platinum, but the price of the latter was several thousand rupees lower (about 60% of the one at Teleseen)!</p>
<p>The cheaper one at Himalayas didn't have any reference to "Thane", the company that made the Orbitrek. By some luck I happened to notice a subtle difference. It was <em>not</em> Orbitrek, but "Orbitrak"!</p>
<p>I didn't buy either and did some more research to find out that the "Orbitrek" is the real one and "Orbitrak" was probably a fake.</p>
<p>So I went ahead and bought the Orbitrek Platinum from Teleseen.</p>
<p>Later I noticed so many advertisements and signboards selling the "Orbitrak"!!!</p>
<p>If cost was a problem to buy the "real" product, and if I have a choice between a fake product and a lower quality product, I would go for the latter. Why? Because the fake product developers try to get the <em>looks</em> right to match the real one without much attention to the inner workings, while the low quality product may have done <em>some</em> research to get the inner workings right.</p></span>Anuradhahttp://www.blogger.com/profile/00372329240504481682noreply@blogger.com9tag:blogger.com,1999:blog-15283331.post-61444120314273615032007-05-16T10:26:00.001+05:302008-04-16T07:53:19.469+05:30FWDC web site goes mobile<p>Finally managed to get the mobile version of our Four Wheel Drive Club (FWDC) web site done. The mobile site, <a href="http://m.4x4.lk/">m.4x4.lk</a>, has a very lightweight theme, smaller thumbnails, and most external links point to mobile versions of relevant sites.</p>
<p>The difference is best seen by comparing similar pages on the two sites. E.g.: <a href="http://www.4x4.lk/node/29">www.4x4.lk/node/29</a> and <a href="http://m.4x4.lk/node/29">m.4x4.lk/node/29</a>.</p>
<span class="fullpost"><p>We would like the new site to be tested on as many mobile devices as possible. Please send your feedback to info@4x4.lk. Thanks in advance!</p></span>Anuradhahttp://www.blogger.com/profile/00372329240504481682noreply@blogger.com0tag:blogger.com,1999:blog-15283331.post-425590324879309422006-12-12T14:57:00.000+05:302006-12-12T15:43:48.161+05:30Running AIGLX and Beryl on DebianAfter seeing some eye candy on <a href="http://budlite.blogspot.com/">Bud</a>'s desktop last Sunday, I wanted to try <a href="http://fedoraproject.org/wiki/RenderingProject/aiglx">AIGLX</a> and <a href="http://www.beryl-project.org/">Beryl</a> on my <a href="http://www.debian.org/">Debian</a> <a href="http://www.debian.org/releases/etch/">Etch</a> notebook.
To get a preview of what this is all about, try searching for "aiglx" and/or "beryl" on <a href="http://www.youtube.com/">YouTube</a> or <a href="http://video.google.com/">Google Video</a>.
Debian Etch now has xorg 7.1 with built in AIGLX, so there was no need to install anything. I "enabled" AIGLX by following "Prerequists", "xorg.conf" and "AIGLX" sections of <a href="http://wizah.blogspot.com/2006/10/debian-how-to-aiglx-compiz.html">this blog entry</a>. Just that easy!
Here are some important sections of my xorg.conf file. My video adapter is a Radeon Mobility 7500 on an IBM (not Lenovo) <a href="http://www.thinkwiki.org/wiki/Category:R50">Thinkpad R50</a>.
IMPORTANT: This is <em>not</em> the complete xorg.conf file!
<pre>
Section "Module"
Load "bitmap"
Load "dbe"
Load "ddc"
Load "dri"
Load "extmod"
Load "freetype"
Load "glcore"
Load "glx"
Load "int10"
Load "record"
Load "type1"
Load "v4l"
Load "vbe"
EndSection
Section "Device"
Identifier "Radeon Mobility 7500"
Driver "radeon"
Option "RenderAccel" "true"
Option "backingstore" "true"
Option "EnablePageFlip" "true"
Option "AGPMode" "8"
Option "AGPFastWrite" "true"
Option "XAANoOffscreenPixmaps" "true"
Option "AllowGLXWithComposite" "true"
EndSection
Section "Screen"
Identifier "Default Screen"
Device "Radeon Mobility 7500"
Monitor "Generic Monitor"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1280x1024" "1024x768"
EndSubSection
Option "AddARGBGLXVisuals" "True"
Option "DisableGLXRootClipping" "True"
EndSection
Section "DRI"
Mode 0666
EndSection
Section "Extensions"
Option "Composite" "true"
EndSection
</pre>
Then I installed Beryl 0.1.2 by using the DEB packages by following <a href="http://wiki.beryl-project.org/index.php/Install/Debian">this link</a>, started KDE and ran "beryl-manager". Everything started working as expected!
Then I wanted to upgrade to 0.1.3, but couldn't find any DEBs around. So I built some myself using the distro specific build files provided by the good Beryl developers. Thanks!
You can get my Beryl/Emerald 0.1.3 packages for Debian Etch (without XGL support) by adding this line to your sources.list file:
<pre>
deb http://www.linux.lk/~anuradha/beryl/etch/ ./
</pre>
and installing "beryl" and "emerald-themes" packages. The latter is <em>not</em> installed automatically when installing the "beryl" package.
Here are some insteresting things to try:
<ul><li>Press left/right arrow keys with ctrl and alt.</li><li>Press ctrl and alt and drag the mouse.</li><li>Open few windows and move the mouse to the top right corner (Mac users will scream at this ;-)).</li></ul>
The sad part is that none of these work on my <a href="http://fvwm-crystal.org/">FVWM Crystal</a> desktop. :-(Anuradhahttp://www.blogger.com/profile/00372329240504481682noreply@blogger.com4tag:blogger.com,1999:blog-15283331.post-1156758076894823322006-08-28T14:52:00.000+05:302006-08-28T15:14:45.280+05:30Sri Lankan Photography Group<a href="http://www.flickr.com">Flickr</a> photostreams with tags `lanka' (<a href="http://www.flickr.com/photos/tags/srilanka/">latest</a> / <a href="http://www.flickr.com/photos/tags/srilanka/interesting/">interesting</a>) and `sri lanka' (<a href="http://www.flickr.com/photos/tags/srilanka/">latest</a> / <a href="http://www.flickr.com/photos/tags/srilanka/interesting/">interesting</a>) indicate that the tropical island has always been a heaven for photographers.
Now there is a <a href="http://groups.google.com/group/photography-in-sl/about">Google Group</a> to "discuss photography in Sri Lanka (locations, tips, equipment etc) and share pictures".Anuradhahttp://www.blogger.com/profile/00372329240504481682noreply@blogger.com1tag:blogger.com,1999:blog-15283331.post-1156508034606519802006-08-25T17:42:00.000+05:302006-08-25T18:06:57.456+05:30Canon announces EOS D400Canon yesterday <a href="http://www.dpreview.com/news/0608/06082416canoneos400drebelxti.asp">announced</a> the successor to its popular <a href="http://www.dpreview.com/reviews/specs/Canon/canon_eos350d.asp">EOS 350D</a> consumer SLR, commonly knows as the `Digital Rebel XT'. It is likely to compete with Nikon's recently announced <a href="http://www.dpreview.com/reviews/specs/Nikon/nikon_d80.asp">D80</a>. However, Canon's pricing of the new camera at 800$ is more attractive when compared to 1000$ of the Nikon D80.
See <a href="http://en.wikipedia.org/wiki/Canon_EOS">Canon EOS article</a> on Wikipedia for more details on the EOS series.Anuradhahttp://www.blogger.com/profile/00372329240504481682noreply@blogger.com0tag:blogger.com,1999:blog-15283331.post-1156256880956344882006-08-22T19:07:00.000+05:302006-08-22T20:00:18.493+05:30FOSSSL 2006Last year, we organized a successful <a href="http://www.foss.lk/events/2005/foss-week/index.html">week of FOSS activities</a>, and we decided to make it an annual event. This year, we named the whole week to be `FOSSSL 2006', as opposed to FOSSSL being one of the events during the 2005 FOSS Week. The events of the week were
<a href="http://www.foss.lk/events/2006/fosssl/fosscode">FossCode</a>, <a href="http://www.foss.lk/events/2006/fosssl/fossschool">FOSSSchool</a>, <a href="http://www.foss.lk/events/2006/fosssl/apachecon">ApacheCon</a>, <a href="http://www.foss.lk/events/2006/fosssl/fossenterprise">FOSSEnterprise</a> and <a href="http://www.foss.lk/events/2006/fosssl/geekout">Geekout</a>.
FOSSCode was organized in a similar manner to <a href="http://code.google.com/soc/">Google Summer of Code</a>. I was mentoring Mahangu's project for Taprobane. Five more students took part implementing various projects.
FOSSSchool, held at the <a href="http://www.mrt.ac.lk">University of Moratuwa</a>, was for introducing FOSS to students. Morning session was for schools and the evening session for university students. I did an introductory session in each. Interestingly, I had to make the one in the evening more `serious' as the students already had a good understanding of what FOSS is. <a href="http://ken.coar.org">Ken Coar</a> had already arrived, but as a bomb off targetting a Pakistani diplomat, we suggested him to stay at the hotel. However, all the other speakers turned up as planned.
The ApacheCon was the first of its kind in Asia. The participation was over expectations. A `Hackerthon' also was held along the conference.
The last confernce-like event was the FOSSEnterprice held at <a href="http://www.watersedge.lk/">WatersEdge</a>. The sessions were moderated, 15 minutes each, and a panel discussion followed each 3 sessions. I followed <a href="http://www.jclark.com/">James Clark</a> on FOSS evaluation, and <a href="http://budlite.blogspot.com/">Bud</a> was the other panelist in our group moderated by Ken Coar.
On Friday evening, we left Colombo for the Geekout. I will post seperately on that. :-)Anuradhahttp://www.blogger.com/profile/00372329240504481682noreply@blogger.com0