OLPC India Experience

Indian Children exploring OLPC XO laptop

OLPC learning consultant Carla Gomez Monroy writes about the OLPC experience in Khairat school, Maharashtra (India). The site for OLPC pilot project in India.

At the entrance, there was a black dog taking a rest. Beside the dog was Rajiv, in first standard, working on his XO while it was charging, plugged to the outlet on the wall. At the foot of the wall, on a long mat, there were some XOs, being charged.

On the other side of the door, sitting on long, thin mats on the floor, there was a small group of girls and boys working on eToys. Some were trying out all the sample projects while others were making their own.

Read the Complete Khairat Chronicle on OLPC wiki.

OLPC (one laptop per child) XO Laptop Explained

OPLC XO laptop case and motherboard with labels BBC takes a comprehensive look at the hardware, software and design of the MIT's $100 OLPC XO laptop. The smart design of this machine is going to make the computer industry sit up and take notice.

RIP Greenphone, Welcome OpenMoko's Neo1973 (FIC GTA01)

Trolltech discontinued Greenphone booting linux I had long given up hope on open platform for mobile phones until Trolltech's Greenphone. It offered a glimmer of hope that hacker friendly devices powered by GNU/Linux would be a reality in otherwise closed source mobile platforms.

However the party didn't last long, within one year of hitting the retail market Trolltech announced its decision to the end of Greenphone productions and but keep supporting the now popular Qtopia Greenphone community with yet another another device from OpenMoko project.

Openmoko.com's Neo 1973

The Neo1973 produced by FIC can also run Qtopia.
The Neo 1973 boasts the following hardware specifications

  • 2.8" VGA TFT color display
  • Touchscreen, usable with stylus or fingers
  • 266MHz Samsung System on a Chip (SOC)
  • USB 1.1, switchable between Client and Host (unpowered)
  • Integrated AGPS
  • 2.5G GSM – quad band, voice, CSD, GPRS
  • Bluetooth 2.0
  • Micro SD slot
  • High Quality audio codec

I reckon we have now come a long way from scrogging flea markets for used hardware and creating custom boards. Now you can buy a "Neo Hacker's Dream Box" off the shelf!! that is, if you have enough money to buy these devices.

Running automated package updates with Cron

LinuxLove.org's recent post about automatically running apt-get upgrades daily with cron using a simple bash script can be easily done using Cron-Apt package itself.

Please do note that such automated package upgrades in apt based distro's is a very bad idea. Joe had rewritten a detailed account about the problems and security issues involved in Debian-Administration.org few years back.

By default, cron-apt will only download updates -- it will not install them. I know other packages for other distributions like up2date will automatically install the updates for you, but I've learned to like this and that in the long run, automatically installing updates is a Bad Thing. Why? Well when I was experimenting with auto-installs, I ran into problems:

  • Even though I told apt to say Yes to everything, it still prompted me for input on config file conflicts (was I doing something wrong?). This caused the script to hang indefinitely in the background until it was killed.
  • Auto-accepting configuration changes can ruin your day. With Debian, it's fairly easy to back out of a change and hopefully you have a backup copy of the config file, but that's not the point. Good System Administration means you should never be in that position in the first place. "OK, what if I just deny all configuration changes and leave my copy?", you ask. Well, what if the upgraded program uses new syntax in its config file. Your program is now broke and you're in the exact opposite position as you were with auto-accepting.
  • Just as you should always review configuration file changes, always review what packages are being installed. If you know that installing that new version of Samba will mean some extra work in other places, don't install it yet.

Bottom line: Yes, it can be very tedious to manually review each update batch -- especially if you have several servers -- but that is part of your job when you are running a server. Deal with it!

cowsay: a configurable talking and thinking cow

Today's Debian Package of the day Cowsay reminds me of a dull day few years back when I wrote this 'cowwords' script to amuse myself.Even a useless tool like cowsay can be interesting with creative use, CrunchBang has another cool hack using vrms and cowssay Happy Hacking! :) .

Cowsay is a useless but very fun text filter written in Perl. If you send some text into cowsay, you get an ASCII cow saying your text. For example, cowsay Hello, World! prints


_______________
< Hello, World! >
 ---------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||


Script in public domain originally posted on FSUG-Bangalore Mailing-list

#!/bin/sh # # SCRIPT: cow-words.sh # AUTHOR: Rakesh 'arky' Ambati (http://www.linuxgazette.com/blog/4864) # DATE: 17 January 2005 # VERSION: you_must_be_kidding # # CREDITS: I Thank Karma_Police for the 'cow file randomizer code' # # PURPOSE: Retrieves the Dictionary.com 'Word of the Day" RSS Feed and # a random character teaches them. # # DEPENDS: 'xmlstarlet' # 'cowsay' # Both are available packages in Debian (Sid) repository. # To install them just type 'apt-get install xmlstarlet cowsay' # # # set -x # Uncomment this for debugging. # # ##################################### # Use 'cowsay -l' to the full list of cow files in your system # # (Sorry fellas I removed possible offensive 'sodomized*, head-in,telebears, # # kiss' cow files # ###################################### cows=(apt beavis.zen bong bud-frogs bunny cheese cower daemon default dragon dragon-and-cow elephant elephant-in-snake eyes flaming-sheep ghostbusters hellokitty kitty koala kosh luke-koala mech-and-cow meow milk moofasa moose mutilated ren satanic sheep skeleton small stegosaurus stimpy supermilker surgery three-eyes turkey turtle tux udder vader vader-koala www) random=RANDOM%44 ######################################### ## Get the XML feed and do the selection ## ######################################## /usr/bin/xmlstarlet sel --net -t -m "/rss/channel/item/description" -v "." "http://dictionary.reference.com/wordoftheday/wotd.rss" | /usr/bin/cowsay -n -f ${cows[random]} # End of the script

Load Balancing Apache Servers on Debian with HAProxy/Keepalived

A fine article shows you how to set up a two-node load balancer in an active/passive configuration with HAProxy and keepalived on Debian Etch.

Not only does the load balancer distribute the requests to the two backend Apache servers, it also checks the health of the backend servers. If one of them is down, all requests will automatically be redirected to the remaining backend server. In addition to that, the two load balancer nodes monitor each other using keepalived, and if the master fails, the slave becomes the master, which means the users will not notice any disruption of the service. HAProxy is session-aware, which means you can use it with any web application that makes use of sessions (such as forums, shopping carts, etc.)

From the HAProxy web site: "HAProxy is a free, very fast and reliable solution offering high availability, load balancing, and proxying for TCP and HTTP-based applications. It is particularly suited for web sites crawling under very high loads while needing persistence or Layer7 processing. Supporting tens of thousands of connections is clearly realistic with todays hardware. Its mode of operation makes its integration into existing architectures very easy and riskless, while still offering the possibility not to expose fragile web servers to the Net." http://www.howtoforge.com/haproxy_loadbalancer_debian_etch

Indian Debian Repositories (sources.list for sid)

Here is a very basic Apt sources.list configuration example for my GNU/Debian Sid/Unstable machine. The Indian IITM Debian Mirror is the first entry the sources.list file given below, I'll call it my primary repository. It is geographically close (just few hundred miles from here) and only few network hops away.

The Indian GNU/ Debian Linux Mirror is not always fresh so I use another second repository entry which I keep changing according to the Debian Mirror Checker results.

The idea behind having a primary and secondary repository is for added redundancy and also I'll get the latest uploaded version of the (certain) package from the fresh secondary repository. Thus limiting much of the bandwidth traffic to my primary Debian mirror.

The last entry is Christan Marillat's Debian-Multimedia.org which provides the mplayer and its non-free codec's

############################################ ## GNU/Debian Linux Sid (Primary Repo) ## ############################################ deb http://ftp.iitm.ac.in/debian sid main non-free contrib deb-src http://ftp.iitm.ac.in/debian sid main non-free contrib ############################################ ## GNU/Debian Linux Sid (Secondary Repo) ## ############################################ deb http://debian.yorku.ca/debian unstable main non-free contrib deb-src http://debian.yorku.ca/debian unstable main non-free contrib ####################################################### ## Debian-Multimedia.org (Christan Marillat's Repo) ## ####################################################### deb http://mirror.home-dn.net/debian-multimedia unstable main

Ripping Radio Streams With Mplayer

Here is my response to the shane's great post introducing streamripper.

Nay, Do I need to use another tool just to rip a radio stream, when I can do it with my favorite mplayer itself.

/usr/bin/mplayer -dumpstream -playlist http://www.bbc.co.uk/worldservice/meta/tx/nb/live_news_au_nb.ram

There, you see it action ripping BBC Live News realmedia stream with mplayers's -dumpstream option. The mplayer merely dumps the radio stream to a file named "stream.dump" in the current directory.

Firefox Annoyances: Download Resume Problems

"When it comes to heavy duty download jobs, Firefox's default Downloads manager just doesn't cut the mustard" wrote Gina Trapani on the popular Lifehacker.com site. Do I need to say more? . Apart for a lousy download manager my firefox/iceweasel browser has trouble continuing active downloads between network failures or router problems. Perhaps this is the most annoying problem, coming right next only to memory hogging and the dreaded browser freezes .

There is a page on mozilla wiki discussing this issue and some possible solutions at length. And I guess its been there for a while now just by looking at the last modified date of the page( 18:04, 20 October 2006). Would any developer (anyone!!!) fix this issue in the next release?

A short excerpt from the above mentioned page on Mozilla wiki.
I recently started several larger downloads in Firefox and had to reboot my router while downloading. After this, I got to see several Firefox inadequacies or bugs, which I'll tell you about here:

0: After the temporary network connectivity disruption, my downloads were left in limbo, with Firefox only giving me the option to Pause or Cancel; with the progress bar still showing, but not increasing, and the numbers (rate of transfer, ETA) not showing. At this point I could not get Firefox to resume the downloads, not even by clicking Pause and Resume. However, looking at the Desktop, I could see that the partial files where there. I then found that I could resume the downloads with wget -c from the command line. If I can resume from the command line, why can't I resume from Firefox?

OLPC XO Production Delays, Microsoft Monster Catches Up

OLPC XO is on my mind, the OLPC's Children's machine XO is up for grabs with its Give 1 Get 1 program from November 12. The low power consuming XO laptop with its open hardware specifications running Fedora Linux OS is on many geeks wish-list including mine for a while now. The news of production delays mean shortages, Aieee.

Elsewhere the Microsoft Corp seems to be "spending a non-trivial amount of money" into the works to make its Windows XP run on OLPC XO's hardware. Its Corporate Vice President Will Poole comments "We're spending a non-trivial amount of money on it, We're working hard. But we're still at least a few months away. We've made progress"

Yeah right, I guess a thousand slaves are working in dark dungeons trying to squeeze the Windows XP white elephant into the XO. :0)

Update: Mary Lou Jepsen, chief technology officer at the One Laptop Per Child organization here in Cambridge. Jepsen says that a Reuters report yesterday asserting that production delays will cause the organization to miss promised delivery dates for its famous (to some infamous) XO-1 Laptop was misleading.Complete Story here

Bittorrent Mainline Port Randomizer / Custom Settings script

Here is a quick and dirty bash script that I used when Bittorrent Mainline removed the random port option.

  • The script uses a random port to listen from a given range
  • Sets custom upload limits,refresh intervals and client address(IP)
  • Disables Linux uPnP
  • Changes the default data directory (default is ~/Desktop/Bittorrent)
  • Saves the downloaded file to current directory

Copy the code to text file and save it as Bitty.sh and set execute permission with 'chmod a+x Bitty.sh' and launch with ./Bitty.sh <torrentfile>.torrent

You may need to change the values to suit your needs. Also note that the You the /usr/bin/bittorrent-console is commandline client from the bittorrent Mainline for GNU/Linux and change the location on your Linux distro.


#!/bin/sh
#
#
#set -n
# Bitty.sh - a port randomizer for bittorrent mainline
#set -x 
#
MAXPORT=25000
MINPORT=20000

number=0

while [ "$number" -le $MINPORT ]

do 
  number=$RANDOM
  let "number %= $MAXPORT" 
done 


exec /usr/bin/bittorrent-console  --ip debbox.no-ip.org  --display_interval 30 
--no_upnp --minport $number  --maxport 25000 --max_upload_rate 5120 
--max_initiate 70  --save_incomplete_in /mnt/BigMaMa/.bittorrent/incomplete
 --data_dir /mnt/bigMaMa/.bittorrent  --save_in . "$1"


Please feel free to improve the script !

Disown, nohup : Bash Commands

Life of a geek is not without its temptations, they come sometimes in the guise of friends asking me to join for a steaming hot cup of coffee or the company of a sweet young thing :o)

Mostly I give in to temptations and allow myself to be drawn away from my computer terminal. Being a little paranoid about security I don't leave my console unattended instead I prefer to log off completely. But that's not always possible since I have quite a few jobs running in background, now what is fastest and the best way to get rid of them so that I can log off and leave them running after I am gone? disown is the answer. This bash specific command allows us to unbind various jobs from the current login session. I use 'disown <jobid>' to get rid of the job(s) running on my console login session. Volia now I can logoff and run.

But wait why not use some computing time while I am gone, perhaps I can compile a new kernel or download a package with wget. Using the nohup command is apt here since I am planning to logoff leaving the computer to do the tasks. Just prefix nohup before any command and run it in the background by placing "&" at the end of the command, that's it.

How does disown and nohup commands work? What they do is that they connect all your process to the parent process of the computer which happens to init (the granddaddy of all process running on the computer). Viewing all the process on the computer help us understand it better, Look a the the output of the pstree command below. The init is first (root of the inverted tree) process which radiates all the other process in the computer. Here you can see various daemons like cron,dbus etc, and also various programs like emacs, iceweasel (firefox), pidgin, xterm, xpdf.

$ pstree init-+-cron |-daemon |-another-daemon |-emacs |-getty |-login---bash---links |-login---bash---startx---xinit-+-Xorg | `-fluxbox-+-bash-+-firefox-bin---7*[{firef+ | | `-pidgin | `-xterm---bash-+-pstree | `-xpdf.bin |-preload |-syslogd `-udevd

You might ask me why I don't use screen instead of nohup ? Well, I tend not to use screen for those commands that don't need my supervision. I might run my rss reader raggle under screen but not commands like updating locate databases, downloading packages or files using bittorrent I leave it to nohup.

Booting GNU / Debian Linux in Verbose Mode

Nobody with a sane mind watch their computer boot up, its not very interesting to watch messages of kernel being loaded and services started flashing by.

If you read my last nights post on understanding the GNU / Debian Linux boot process then you have a fairly good idea of the importance of learning about the GNU / Debian Linux booting process. This knowledge will aid you in troubleshooting Linux boot problems.

The GNU/Debian Linux by default boots in a quiet mode with very few messages printing to the computer console (as you can see in the video). Let's make the computer be more verbose by turning on the VERBOSE variable in /etc/default/rcS file .

# Set VERBOSE to "no" if you would like a more quiet bootup. VERBOSE=yes

Save the file and reboot the machine. Watch and learn what goes on when the machine boots up. What next ? if you are done understanding how it works its time to hack the system find ways to speedup the boot process and try to free some system resources by getting rid of unused services and kernel modules. Happy Hacking !!!

Understanding the GNU / Debian Linux Boot Process

Learning a Unix-like operating system is like a Herculean task for most of us. Most people even those working in the IT industry break into cold sweats on hearing words like Unix, Linux and Debian. Such aura of mystery and wizardry commonly associated with it is perhaps much to do with fear is unknown rather than the difficulty of learning the operating system(s).

One of the important advantage of learning a Unix-like operating system is in its transparency. If you want to understanding the intrusive details of how an operating system works you can dig right into the bowls of the operating system and to its source code. A closed source Operating system like Microsoft Windows NT XP or Vista will not allow you do that thus a very bad choice for learning OS concepts.

The boot process starts the moment you power up your PC and until the time the computer is able allow you to log on. Understanding this booting process of a GNU/ Debian Linux is an essential part of mastering the OS, the From Power Up To Bash Prompt HOWTO written a decade ago provides a detailed look at the boot process from Power up to the bash prompt . Even the experienced Linux users will learn from this HOWTO.

The author(s) of the HOWTO document sums it up as thus.

I find it frustrating that many things happen inside my Linux machine that I do not understand. If, like me, you want to really understand your system rather than just knowing how to use it, this document should be a good place to start. This kind of background knowledge is also needed if you want to be a top notch Linux problem solver.

This HOWTO is can be found in doc-linux package on GNU/Debian in text and html formats.The Debian Documentation page has an extensive list of manuals that are available to aid the learning the OS. Also visit the The Linux Documentation Project(TLDP) for more such HOWTO's , Guides and FAQ's.

Install Debian In Window (Video)

Sometime back I wrote about new official method for installing Debian from Microsoft Windows using the latest Debian Win32 Installer.

Here is the videos(two videos!!) of the debian windows (win32) installer in action.

The Second video, bit incomplete since it doesn't seems to show loading of the Debian installer after reboot.

Using Transmission Bittorrent client on console

Update: A change in package since this post was published, read the update here
Here is an another light-weight bittorrent client Transmission which really works well. One of the highlight of this program is that its easy to use even for those who are new to Bittorrent P2P system and the bittorrent old hands would like Transmission because it stays out of their way and integrates nicely with your environment. I primarily work on command line console and like to run my bittorrent downloads in a screen session in the background and this bittorrent clients fits the bill for me.

You can learn more about this program from its features page.
Transmission runs natively on over five operating systems. Seamless configuration of your network, intelligent banning of peers who send corrupted data, and built in Peer Exchange are some of the features which enable Transmission to download your files as quickly as possible. All this is done in the background, without the user having to worry about complicated settings.

So, lets get started with transmission shall we, We will download the latest GNU/Linux Debian (Stable) CD ISO from the Internet. I already downloaded the torrent file of the first CD in my current directory. And installed transmission-cli package which provides the transmission-cli program on Debian Sid. This is a command-line only version of transmission, if you are interesting GUI version use the GTK version which is also available on Debian Sid or from the project page.

Here we launch the transmission with screen, the -p tells transmission to listen on port 25000. You can stop the program by pressing Ctrl+C .

screen -a -S 'Bittorrent' /usr/bin/transmission-cli -p 25000 debian-40r1-i386-CD-1.iso.torrent

Happy Torrenting !!!!

To learn about screen read the One minute Screen tutorial .

One minute Screen Tutorial

For those of you who love the command line screen provides a definitive way of organizing your work into a set detachable console sessions called screens which can be added and removed on demand. This removes the limitation of the number of virtual consoles(tty) you can have. Think of screen as a virtual windowing system for the console. ;o)

$ screen -a -S 'New Screen Session' $ sleep 60 #Press Ctrl+A+D for detaching the screen [detached] $ screen -list Your inventory: 4660.New Screen Session (Detached) 1 Socket in /var/run/screen/S-arky. $ screen -r 4660 $ sleep 60 $ #Press Ctrl+D for terminating the screen [screen is terminating]

Here we first started a new screen and ran a command 'sleep 60' then detached the screen session. Later we listed out (all) the current screens running on this system along with the their process ID's and re-attached our old screen session. Once the sleep command is completed we terminated the session. Also you can try pressing keys for command completion whenever possible.

  • screen -a Starts a new screen, -S add a title to the screen session, you can use either the process ID or the screen title with '-r'
  • screen -list Lists the currents screen sessions
  • screen -r Reattaches a existing screen with the given process ID

Clock skew error

Have you ever tried fixing acomputer problem while talking to your friend or co-worker over the phone?
Hold on before you start rolling your eyes muttering "Hell yeah" and skip reading this post here is my geek survival tip. Don't even try to fix the problem, postpone it until you can get to that computer yourself. Meanwhile provide a quick fix so that the person on the other end of the line can get back to whatever he or she is doing quickly.

Now watch my tip action, I received a frantic call (it *was* frantic, the phone kept on ringing and I kept ignoring it until I lost the content and picked it up) from a friend who was getting these 'clock skew' error messages.

I assured him it was just another harmless message. 'It means what is says brother' I said 'your system clock is screwed and it must have set the timestamps on your files to sometime in 2029'.

That didn't seems to satisfy him, so I asked him what was he doing when he noticed this message(s) (Tip two: Ask very specific and pointed question, avoid using big technical words). It seems he was using sudo to run some commands. That gave me a clue, so now for my quick fix, I asked him to type sudo -k or sudo -K couple of times, that seemed to get rid of the messages and thus ended the call happily (no sparks flying and no curses exchanged, whew ).
Later in the evening I went over his place and found out that the BIOS battery on the PC motherboard was running weak and got it replaced. That seems to fix the problem. If you got any similar stories or tips to share, please do post a comment.

Recovering a runaway console

Sometimes a program dies leaving your console in a totally unusable state. All you see is a bunch of random numbers and unreadable characters like this.
a normal Linux console Instead of seeing a normal console with a blinking cursor and bash prompt like this.
linux console with random characters

Don't worry, the solution is rather very simple. So, the next time your console goes haywire like this, just type reset (the console won't display what you are typing, since its still in an abnormal state) and press enter. Voila, the console is reinitialized and back in its normal state.

The reset command is the little brother of tset (terminal settings) command and is provided by ncurses-bin package.