a hello world introduction to internationalization in Linux using C

Hello, world!
i was thinking to read/write some do-it-yourself code for internationalization. This Awesome link explains it all. what is i18n and everything of how to do that in your code. Now obviously i tried the whole process, changed my LANG variable by bn_IN but no change in output. it was old “hello, world!” 😦
i searched a bit and then come up with the fact that i’ll have to first select the locale for using.

The steps are:

0. See the supported locales by : $ cat /usr/share/i18n/SUPPORTED (you can see, for bangla, it is bn_IN UTF-8 (see te space between bn_IN and UTF-8 .. it’s not ‘.’ it’s a space))
1. $ sudo gedit /var/lib/locales/supported.d/local

2. for Bengali, you add bn_IN UTF-8

3.$ sudo dpkg-reconfigure locales

4. if all goes well, export the environment variables LANG and LANGUAGE as:
$ export LANG=bn_IN
$ export LANGUAGE=bn_IN:bn

5. run your program. 🙂 hopefully it’ll work. worked for me!

Configuring GTK+ 2.x in Netbeans

Well, hello after a long time. Blogging needs time and that is the thisng I do not seem to have much these days. 😦  I even can’t remember the last time i took a photo. really busy over making the unique file browser for Sahaj Linux.

As I am working in GTK+ 2 and the main lot of programmers (except me) sees Netbeans as their wordprocessor (!) … A friend and fellow programmer insistemd me to try Netbeans once.  Thus I begun.

Well, if you don’t have the entire package of Netbeans, you will have to download the C/C++ Development Pack. After this, the netbeans will be able to detect and debug general C/C++ code. However, one have to configure Netbeans to include support for external libraries like GTK. Her’s how to do it:

Open a project in netbeans. right click onto it and get into Properties. In the Build menu (probably the 2nd menu in the tree), click “C compilers”.

Here you’ll see the option “Include Directories under “General” Tab. Click on browse (at left a small button) and include all the dependecy for gtk like cairo, gtk, glib, pango, atk, libpng, libjpg, etc.. detailed picture given below !

Screenshot for including necessary libs for gtk+ 2

Now again We have to configure the Linker of Netbeans. We go to Linker > Libraries > Add Library. Here you’ll have to choose the libgtk xxxx.so file from “/usr/lib/” .. so go in the folder /usr/lib. Now select the File type to  “.so” (dynamic library) from the default “.a” (static library). unless this you’ll not find libgtk.so ! Again the following picture explains all this!
Linker configuration for GTK+2 in Netbeans

Now you are done. Enjoy writing GTK code with Netbeans.

P.S: Though I was referred to write code on Netbeans, I am back to GEdit again! I’ll let you know How and Why in the next post where i’ll show you how to make GEdit a really cool code editor.


Getting Linux back after Windows reinstallation

Many of us have dual-boot system which have Linux and Windows( or any other, say, Mac OSX etc… ) both installed. We have a operating-system-choice screen just after BIOS gets checked, by which we can choose, which OS to load in a session.
This is the Boot Loader (usually GRUB or LiLo). It has some commands (editable) by which it just gets the control from Master Boot Record (MBR) and chainloads the volume boot record (VBR) of the active (primary) partition where the bootable system image resides.

During Linux installation, we have GRUB installed in our system, so it can directly detects the other already installed operating systems in the HDD. Thus it produces the OS-Choice screen at the startup and we can choose which OS to load.

But the problem arises, if we have to reinstall/repair the previous OS in the same partition it was before.
i.e : s’ppose, windows was in C:\ and we’re trying to reinstall windows again on same partition C:\

During installation, every OS overwrites the MBR and keeps it’s fresh copy. So, if you have previously installed the Bootloader (e.g : GRUB ), then it’ll dessapear and you’ll not be able to boot into Linux. After startup, system will directly boot into Windows.

Now, get one point clear that the Linux OS is still intact. you just have lost the pointer how and from where to load it. Because, it was the job of your bootloader installed in MBR and you’ve overwritten the MBR, your bootloader is now history! 😛

Clearly, the solution is to install the bootloader once again so that it can detect both ( even more than 2 ) the OS and give you the sweet OS-Choice screen once again! 😀

Here’s how to do it :
step 1) put your Linux CD/DVD and boot from it in restore mode. After that, if all goes right, it’ll give you a command console.
step 2) type
chroot /mnt/sysimage
it loads the system image and present the root console.

step 3) reinstall GRUB into your MBR by typing
/sbin/grub-install /dev/hda (for ATA hard drive )
/sbin/grub-install /dev/sda (for SATA harddrives )

After this reboot the system and you’re done! 😀

I have a complication regarding the correct partition of the system images of Linux. I solved it by correcting the GRUB command. Here’s how I did it. 🙂

I went into edit command. there I saw 3 commands. The first command was for selecting the proper partition, the second was for lading the system image, and the third was initrd command.

The first command looked like,
root (hd0,1)
I just edited it to
root (hd0,2)
and everything fell perfectly into place. 🙂

One more thing… The above mentioned procedure will not work if you install windows in any other partitions other than the previous partition in which it originally was. in that case, GRUB will not be able to detect that. 😛

Hope you’ll find this tutorial useful. Wishing you people a smooth sail.

Be wise, Use Linux

Counter Strike in Linux… :)

Hey all you Counter Strike 1.6 fR3/\ks out there… 🙂
Good news! You don’t have to depend on Windows anymore for playing your favourite game, “Counter Strike 1.6”. :p It’s right here in our very own, Linux! 😀

Yes, CS 1.6 is duly available for Linux also.
I’ll now guide you through the procedure to install official “Steam” in your Linux Box.

Firstly, we’ll start by creating a directory ( in your home folder, preferably ) called hlds.

mkdir hlds

Now we’ll go to the directory created (cd hlds) and there we’ll download a file named, hldsupdatetool.bin

wget http://www.cstrike-planet.com/dls/hldsupdatetool.bin

after downloading, we’ll change it’s permission to executable by,

chmod +x hldsupdatetool.bin

and then run hldsupdatetool.bin


After agreeing the conditions 😛 by hitting yes, if all goes well, you’ll have a file named “steam” in that folder. If you get any error message ( Like me :p ) like
'uncompress: command not found'
take heart… don’t get frustrated mann…
just uncompress it by

ln -s /bin/gunzip /bin/uncompress

after you finally got the file named steam, you again change the permission of it to executable by,

chmod +x steam

and run it by

./steam -command update -game cstrike -dir .

Yay, you’re done….

now just sit back for a considerable amount of time leaving it all for the installer to download and install CS 1.6 for you.
A word of caution though : This process will take about 11/2 – 2 Hrs. So, just make sure, you have enough time for it… 🙂

Best of luck at the Arena…

And, do tell me how this helped you if we meet somewhere… be it Dust 2, Train, Cbble, inferno or Nuke… 😉
I’ll be as /i/ VooDoo Child ~ozh in there… 🙂

Best of luck, Happy Hunting dudes… 🙂

Writing in Bengali in Fedora 9…! ফেডোরা ৯ লিনাক্সে বাংলা লেখা।

Yes buddies, I know that this is a pretty cliche topic and there are maybe many sites explaining the same. I also took help from specilaly অঙ্কুর বাংলা Website and some more sites which I forgot to bookmark 😦 . Specially, Project has many activities which ranges from Localisation to creating a fantastic বাংলা বানান নিরিক্ষক অভিধান for Firefox.

Well, I’m telling you *My* Procedure! It’s simple like hell.

I went into ” System > Preferences > Hardware > Keyboard ”

Then, I selected, Layouts in there. After that, I clicked “Add” and found out বাংলাদেশ প্রভাত and  ইন্ডিয়া বাংলা keyboard layouts. I added them and set the USA Layout to the defaults. There are other layouts for other Indic languages also. You can Try out that if you know them!

Now I right clicked into my gnome panel and selected, “Keyboard Layout Indicator” such that I can switch to any desired keyboard Layout when I want to.

Whoa, I’m done. Now Selecting the indic layouts, I can write in bengali in anywhere… 🙂

But now, one problem arised. I wasn’t being able to write composite letters in bengali. that is যুক্তাক্ষর . Fortunately, Kushal da was online ( who is also in অঙ্কুর বাংলা Project among his many activities and busy schedulle ) and I mailed him my problem. The response was instant, to-the-point and a complete breeze. He just said, ” use ‘/’  ” … That is, k / t = ক্ট ! 😀

More support about the layout and writing যুক্তাক্ষর can be found in here.

Whoa. I’m done fianly and chatted for almost 4 hours with her in bengali… 😀

Hope, This will be a little help to all those, who still stumbles writing in Indic font. This’s also a reason among a thousand, why one should switch into Linux… and trash Windoze 😛

Everything is sooo cool in this OS. I just Love it… 😀

Trouble with “/etc/X11/xorg.conf”

Heya… It’s been a long long time since my last post in here. I’m sorry, I went totally haywire from the Linux world… Only Academics and all that Master’s Degree plans… 😛

Well, Since 2 weeks, I’m back with my Linux box tweaks. Tonight, At very early hours, I was trying to install the new nVidia Driver into my machine. They have closed the rpm repository so the installation is a complex procedure now… You’ve to configure the xorg.conf file, then close the X server, and then, another problem may arise if you don’t have any precompiled kernel but only the binary image of it. I had, unfortunately nVidia installation software stopped me right there and as it was very late, I was gearing up for bed, then the bolt came from the blue.

I tried to restore my X server back by [ALT+F7] and it failed, giving a quick and scrolled error message. What I guessed that, It has something to do with what I’ve changed.


I just checked, what was wrong with that, ( I had my command line shell 🙂 )and I found I’ve left the server name in

Section “Device”
Identifier  “Videocard0”
Driver      “nvidia”
EndSection ,

The root of the problem was the word, nvidia. Which I recalled, earlier was, nv. Actually what happened, HAL didn’t find any device named nvidia… that’s it so X server failed.

I changed that. and restarted.

Everything worked fine, until the login screen. I was shocked to see that my keyboard is not working! 😦

I logged into my root accnt by help of on-screen keyboard and again oened the xorg.conf file. There I found,

# keyboard added by rhpxl
Identifier  “Keyboard0”
Driver      “nvidia”
Option        “XkbModel” “pc105”
Option        “XkbLayout” “us”

How silly of me… 😦 I’ve mistakenly put the keyboard driver also as nvidia which was earlier, intuitively, “kbd”

I changed that and restarted again.. and Whoa… Life is peaceful once again.. ! 😀

Motto of the text : Always have a backup file while tweaking with system files !

Hope this experience will someday be a help to you… 🙂 Signing off… Need a sleep seriously… 😀 … Good Night… or rather, mornin’.. 🙂

Love you sweetheart… 🙂