Gedit- “Compile and Run C++” tool

If you  are new to programming (like me) and  are satisfied with gedit and g++… to write CLI programs in C++ for the time being… then im sure that you would be pretty annoyed with the stupid steps to compile and run it everytime using a seperate terminal window. Yep, annoying.

Cutting to the chase, there is an External Tools Plugin (link) for gedit.. and it supports shell scripting.. so i made a new “tool” in it.. the script will compile with g++ and then open up terminal – after that it proceeds to launch the newly compiled file:


gnome-terminal –working-directory=$GEDIT_CURRENT_DOCUMENT_DIR -e “./${GEDIT_CURRENT_DOCUMENT_NAME%.*}” &

credit 1>

UPDATE>> you might want to take a look at this: link .. I prefer to add a cin line to my code though…

maemo ssh- the lifesaver.

Messing around with the sudoers file in /etc/sudoers turned out for the worse when i messed up the editing, and saved + exited without realizing it. When i realized- it was too late… search and search- nothing except “flash it” came as an answer…

Its all good,  except, flashing was a time consuming job and i hate formatting PCs and i dont feel much like it in phones either… So I scratched my head when it came to me.. (honestly- this took me just 10mins of head scratching to figure out)…

When sudo gainroot.. and sudo su… and/or login command doesnt work without the sudoers file… I remembered that i installed an ssh server on the mobile a little while back.. (More Info) .. I took my trusty netbook and typed sudo su to gain root access in the machine.. then I issued rlogin commands…Only, it was to drop me straight to the root account on my phone: rlogin root@192.168.y.yy:xxxx … and viola! it works.. I edit the sudoer file back to the correct configurations and bam, no re-flash necessary… so be sure to keep an ssh port open while you edit the sudoers file… just in case… 😀 happy editing.

(NOTE: The y is the internal IP (LAN) of the n900.[or part of it :P], and the x is the SSH port)

Thaana Hardware Keyboard Layout – Maemo – N900

Yep,  I just couldn’t resist :D… its been a long day – It took me a whole 5-6 hours of dedicated work, searching, and piecing together little informations from the corners of the web..

before i start going on and on, THANKS GO OUT TO:

After downloading the modified rx-51 file at the bottom of this page, you need to copy it to /usr/share/X11/xkb/symbols/nokia_vndr/ and over-write the existing file. After that execute the command setxkbmap in the terminal. If there is no error, congrats… If there is no error, you have done it..(Backup the file JUST IN CASE)


  1. rx-51 (mirror) (mirror) (MD5: a92780d3de53b0677b26366a0a9469c5 [couldnt hurt to make sure, right?] )
  2. rx-51 Original <- File to get incase you screwed up… DO NOT RESTART N900.

PS>> I recommend checking out this:……..stcount=6

Note>> Dont screw your system, and/or blame me if that happens… I am going to add it to the maemo repos soon (insha allah)… So if you have knobbly hands, wait a little while.

Installing dhivehi fonts to n900 -> the primary source for online news in the maldives (advertising, uh? :p) yeah so how ever it maybe, they still havent started using the localized keyboard layout to write the website… instead, they insist on still using the same old mathod of writing as the 2000s days… Write in english and change to a local font.
The problem with this method is that not all the devices support additional fonts, and installing fonts to many handheld devices could be quite a tricky job… do i hear a get on with it out there? well- yeah so its not so hard to install custom fonts to the handheld computer- that is the N900….
First i downloaded the fonts required in the haveeru website. After that… i install unzip from the repositeries.. (belive me, the built-in app manager sucks bad)…. sudo gainroot and apt-get install unzip. Then issue some varient of the command like: unzip /whatever/wherever/ and it will be extracted (most probably to) your current folder. In normal cases where you havent changed directory (cd) that would be /home/user … So now to move the TTF and otf files from

mv /home/user/*.TTF /usr/share/fonts/
mv /home/user/*.otf /usr/share/fonts/

Note: Careful- Linux is case sensitive (this means otf is NOT equal to OtF [or any variation])
So there.. In somecases, eg:when some applications are to load the fonts a device reboot is required. Thankfully, its not required for the built-in maemo browser (forgot name)… so should work now.

Edit>> oops i forgot to mention that these same fonts can be called by sites like and etc etc… so pretty good i suppose…. (especially for boasting :p bragging rights…)

Edit>>> I have successfully added the hardware layout to maemo. Search around the blog if you are interested…

Dhiraagu + Maemo = One cool balance widget

This is a little script to echo Balance, expiry and free SMS + expiry. It uses ussd4all and i have so far been unable to get the dialogue to not show.

In addition, it also logs the queries in a neat form in /home/user/MyDocs/Dt/balance.log

Balance Log

The output can also be passed to the desktop command execution widget and displayed on desktop.. The echo has a slightly different format from the log:


bal=`/usr/bin/ *142#`
fir=`echo $bal | cut -d \; -f 1`
RF=`echo $fir | cut -d \  -f 3`
echo Balance\: $RF
echo ===\ `date` === >> /home/user/MyDocs/Dt/balance.log
RFEX=`echo $fir | cut -d \  -f 6`
echo Bal.Exp\: $RFEX
SMS=`echo $bal | cut -d \  -f 8`
echo F.SMS\: $SMS
SMSEX=`echo $bal | cut -d \  -f 13`
echo SMS.Exp:\ $SMSEX
echo Balance:\ $RF \($RFEX\) SMS:\ $SMS \($SMSEX\)>> /home/user/MyDocs/Dt/balance.log

End Note: This little plain script is known to misbehave… anyone feel free to add/cut/modify/append/throw/ this script in any way you like.. though it would be nice if you can drop a copy of noteworthy improvements over here..

Truecrypt- MMC card encryption

Maemo is great. except – ooops, no built in security for data.
Its not so hard to change this in the open-source device though.

sudo gainroot
sfdisk -l

According to the output /dev/mmcblk1p1 seems to be the mmc card on my device. So proceeding… i install the power kernal and truecrypt. It seems a hassle to load sudo modprobe dm-crypt manually each time i restart the device. So adding it to /etc/modules seems to be the best way. So its apt-get install nano and nano /etc/modules that did just the trick. (edit>> just add “dm-crypt” to the very end of the file in a new line)
Proceeding, I format the mmc card the geeky terminal way (trust me, hook it upto your computer… format the card there…[makes life easire than in a 600Mhz processor] ) … and hello truecrypt /dev/mmcblk1p1 /media/mmc1…. It works… It immediatly shows up on the file manager.
So to dismount the volume: truecrypt -d… Well its a whole lotta commands to mount and dismount even after setting up… huh ryte?… The tiny keyboard (thank god that much is there though) is a pain in the ass fingers..
So i did what anyone else would do… being lazy, i didnt want to write all those commands just to get my baby up and running, and accidently leaving it open would be the worst thing that could happen [figuratively].. Uh oh- yeah as i was saying….  i wrote a little script…

echo Enter password:
stty -echo
read n1
stty echo
echo Loading…
truecrypt /dev/mmcblk1p1 /media/mmc1 -p $n1 –non-interactive
echo “Done…”
sleep 2 && clear
echo “Press [ENTER] key to continue… “
read n1
truecrypt -d
echo Action successfully completed!
echo … exiting

there… so muh easire…. chmod+x /whatever/wherever/ once and ./whatever/wherever/ would run the script. But look at all that writing ./blah/blah/ again…. all effort wasted? eh- noway. Where there is a way there will be a way… so i decide to make a little desktop shortcut to link to this script..
In the terminal: nano /usr/share/applications/hildon/MMCrypt.desktop

[Desktop Entry]
Name: MMCrypt
Comment: MMC Encryption

Note: The text in RED require some brain to workout… alter to your need before use.
So thats it.. voila. I now have the safe/vault icon on my device which when pressed opens the container after i supply the password (note:its not echoed… just like sudo passwords).. and when it tells me done, i know the safe is open… and hence i minimize the terminal and do what i want in there before i press [Enter] which closes the safe..
PS:its not foolproof.. sometimes the mmc1 folder isnt available, still the script continues, etc etc, but it covers my needs… EoF.
PPS: I am not responsible for upset stomaches due to this..(though its quite safe.)