Archive for GNU/Linux

Installing C++ Boost on Gentoo and Debian/Ubuntu

C++ Boost on Gentoo:

on the shell prompt, type:

$ emerge boost

this should install the latest version of boost available for Gentoo. Currently, the latest version of boost, version 1.33.1, is available for Gentoo. synchronise('emerge –sync') with the gentoo portage if your 'emerge -p boost' shows an earlier version.

C++ Boost on Debian/Ubuntu:

$ apt-get install libboost-date-time1.33.0 libboost-doc libboost-filesystem1.33.0 libboost-graph1.33.0 libboost-program-options1.33 libboost-python1.33.0 libboost-regex1.33.0 libboost-signals1.33.0 libboost-test1.33.0 libboost-thread1.22.0

you can use the following simple command to install every library present in boost that matches a pattern, if you don't want to be selective about which libraries to install:

$ apt-get install libboost.*1.33.*

once the boost package is installed, the C++ programs that make use of boost libraries can be built simply like this:

$ g++ -o first first.cpp

if the program needs to be linked to a library(for eg: filesystem library), then specify the name of the library using the -l switch:

$ g++ -o second second.cpp -lboost-filesystem

will follow up with the installation procedure for Slackware and RPM based distributions.


Comments (1)

C# on Gentoo

.NET developers looking for a similar development framework on gnu/linux operating system should check out the Mono project. its fairly simple to install Mono on most of the gnu/linux environments and start developing applications using the C# language. but beginner programmers would love to have an easy to use IDE which could integrate all the tools required for C# based development in one place. one such tool is MonoDevelop which is fast developing into a useful product. installing it on rpm based distribution was not a satisfactory experience for me however. but i knew it should be easy to install it on Ubuntu and Gentoo operating systems. if you have included Mutliverse and Universe repositories in the apt source list, then MonoDevelop is just one 'apt-get install' away on Ubuntu. it required only a bit more effort on a Gentoo system, so i am documenting it here.

Most of the packages required to get MonoDevelop working on a Gentoo system are in the masked state. put the following lines in the /etc/portage/package.keywords file(create it if it already doesn't exist):

>=dev-dotnet/gtkhtml-sharp-2.4.0 ~x86
>=dev-dotnet/glade-sharp-2.4.0 ~x86
>=dev-dotnet/gconf-sharp-2.4.0 ~x86
>=dev-dotnet/art-sharp-2.4.0 ~x86
>=dev-dotnet/gnome-sharp-2.4.0 ~x86
>=dev-dotnet/vte-sharp-2.4.0 ~x86
>=dev-dotnet/gnomevfs-sharp-2.4.0 ~x86
dev-dotnet/gtksourceview-sharp ~x86
dev-dotnet/gecko-sharp ~x86
dev-dotnet/libgdiplus ~x86
dev-util/monodevelop ~x86
dev-lang/mono ~x86

you can drop ">=" in front of some of the lines above by dropping the version numbers in the same lines.
eg: dev-dotnet/gtkhtml-sharp ~x86
now run 'emerge monodevelop' to get everything installed:
#emerge monodevelop
'emerge mono' will get only the mono environment and all development can be carried out using your favourite editor and command shell.

if you get any problems, first try 'emerge sync' to get everything synchronised, and then rerun 'emerge monodevelop'. if you still get any errors, see if still there are any dependency problems left that are in the masked state. if so, add them too to the '/etc/portage/package.keywords' file and repeat the process.
let me know how this works out for you, as i haven't found much information regarding this on the internet.

Comments (5)

K3B and amaroK: Only KDE applications I use

Whatever Linus Torvalds might have to say, i am happy with the GNOME desktop manager. i have used KDE for far too long, before i switched to GNOME, and i had never liked KDE very much – for whatever reasons. i liked a lot of applications in KDE though, like KDevelop, Kate etc. but i could always install and use these applications from GNOME too, albiet they might load a little bit slowly in GNOME. the number of KDE applications that i would use in GNOME started to decrease everyday, and very quickly i found that i was not using a single KDE application any more. that is the reason why i never felt any discomfort while using the Ubuntu operating system, which is completely a GNOME based distribution(the kde version of it is called Kubuntu). but the situation did not last for too long…and i came to know about atleast two killer KDE applications, which have compelling enuogh features to make them must-haves even for a GNOME user: K3B and amaroK. whereas GnomeBaker has a simple interface, K3B makes it extremely easy to do a lot of operations, like making a cd-to-cd copy, multisession burning etc, that are difficult to do in other cd burning apps, or are not yet supported. K3B is a combination of ease of use and a great feature set. when it comes to amaroK, it simply rocks! its interface allows so much to be done and yet it is so simple to use. it allows searching and saving album covers over the internet, has features for digging up song lyrics and for looking up artists in Wikipedia. it can transform to a smaller window while it is playing aka xmms or can just play from the notification area. got good skins and presets too. so even if you are a GNOME user, you definitely need atleast these two applications from the KDE stable.

Comments (2)

Another system rescue story, using Ubuntu LiveCD

Adding to what i had written in one of my earlier posts about the rescue act using a gnu/linux live cd , here is a related story posted on the ubuntu-users mailing list:
(this is a trimmed version, full story here)

A horror story with a potentially happy ending.

So, I use PartitionMagic 8.0 to move a few things around for the
ever-expanding Ubuntu portion of my hard disk. Then the god-awful happens: in the middle of applying my changes, Partition magic gives one of its ever-helpful error messages (“Error #705 applying changes.”) and stops.
Now since I am primarily a Windows user (and all my software and work sits under Windows as a result), my natural reflex was to pull out my Windows recovery disk to see what I could do. What a damned joke. Apparently, to Sony, “recovery” means “erase everything on the whole disk and put back in the vanilla install”. There was no option of any kind to try and restore the MBR or any such thing. Just a snide “it is advised to back up your critical data before proceeding”-style message. Bastards!

Luckily I have Ubuntu. And, more specifically, I have my Ubuntu LiveCD. Which I booted and fired up GParted in. To see that I have…. nopartitions. Time to go hunting.

Having a fully-functional system despite not having a functional hard drive has its advantages. Sure it may be slow as all Hell on a CD, but it works. And it lets me surf the net to find possible solutions before giving up and losing literally years of data. Ordinarily I’d have to go to another computer (say in my classroom) to research solutions and download things and even mess with the hard drive (after removing it), but the Ubuntu LiveCD rendered that unnecessary. On the same crippled machine I could do whatever I needed to do.
So here’s where things stand now. GRUB is saved. Ubuntu works (with a few annoying glitches — I may just reinstall the system and restore my /home, taking the opportunity afforded to modify my partitioning scheme […]
‘ll do Sony’s version of “recovery”, restore my vital data (which is sitting on that handy external disk — the partition can’t be booted, but it reads just fine!), and then uninstall everything under Windows but for the few applications left which don’t have a suitable Linux alternative. (That list shrinks regularly and consists now of mostly games.) I’ll wind up with 5-10GB devoted to Windows and 30GB devoted to Linux. And Linux — Ubuntu — will be the OS I use most of the time now.

Ubuntu Live CD can be downloaded here.
You can also get it shipped to anywhere around the world, free of cost, from here.

Leave a Comment

GNU/Linux Users vs Rest of the world :)

i was satisfied to some extent with my internet connection but was never too happy about it. i had always thought that it could have been better. so when i got a chance to test out  another provider, i latched up the oppurtunity with both hands. but there was a glitch in it – they had a bizarre assumption about their users that all of them would be using the windows os. you need a client to first login into your account to be able to access the internet; and the client was available only for windows. in short: no windows, no internet.

i had already paid the the amount in advance and so was in a complete mess now. i spend more than 90% of my time in gnu/linux and can’t do without internet there. the sales person assured me that he will find out what he can do about my situation and get back to me, but ever since, i had been having a tough time finding him.

i could have fought to get my advance payment back but my gut feeling was that there should be a way out of my problem. i found out that the client for windows is 24Online Client used with the Cyberoam servers. i knew the open source versions of these clients are available both for windows and gnu/linux, so i downloaded the gnu/linux version of it and tried to login using it. unfortunately, there was no success here.

i thought i can always open the source code and see what exactly is not working, but already being neck-deep in other works, i postponed it to some other day and got back to my earlier internet connection. few days after that, my brother came to me  describing about another open source client for the same cyberoam network, and how it claims to handle all the versions of its protocols. it took some time for me before i could understand it all – there is a program called ‘linc’ which is a gnu/linux client for cyberoam. i downloaded it, built it, edited its configuration file and finally gave it a go. it just connected me to the internet right away, no fuss at all!
what more, i can ask it to send any MAC address of my choice in the request, which enables me to connect to the internet from any machine at my home, circumventing the restriction that i should connect only through the computer which was configured by the sales person. what a ridiculous resriction that was! but not for the gnu/linux users 🙂

the hero of the story resides here:  and its written in beautiful C++ code, making the entire source code very readable.

Leave a Comment

System rescue act using GNU/Linux Live CD

It happened like this: i once rebooted my machine and got back a grub call-whatever-you-like error at the boot prompt, with the consequence of no gnu/linuxes and no windows for the time being. i had so many operating systems installed on my computer, but i cannot boot into atleast one of them, as the boot loader itself had deserted me. what to do? reinstall all the operating systems again? reinstall one gnu/linux os and recover the others through it? or recover the entire hard disk from the backup drives? the last option looks like the most sensible one, provided that i had taken such a backup in the first place.
i keep the Live CD of Knoppix OS just for such occassions. it conveniently allows me to boot into the gnu/linux environment right from the CD, without having anything to do with the hard disk(s) present on my computer. once there, i could connect to the internet and ask for help. but i had my recipe to recover from such situations, written safely in a corner of my mind and i decided to make use of it on this occassion. i opened the terminal emulator and got on with the job:

#fdisk -l

this listed all my disks and their partitions, inducing a sigh of relief in me, and i started mumbling to myself “Everything is fine mate, everything is fine!”
then it was time to see if i had lost any data.

#mkdir /mnt/tmp && mount -t ext3 /dev/hda9 /mnt/tmp

i panicked for a moment as the mount failed with an error. i knew i need to run ‘fsck’ now, so headed straight to that step:

#fsck /dev/hda9

and accepted all the suggestions from it(pressed ‘yes’ to all the questions). my filesystem was ‘apparently’ fixed, but i wanted to confirm it. i tried to mount it again:

#mount /dev/hda9 /mnt/tmp

celebration time! the partition was successfully mounted, and i could browse through all the data in it. i happily repeated the procedure with other gnu/linuxes and then turned my attention to the boot loader.

i quickly chroot‘ed to the root partition of the Ubuntu OS(whose boot loader was installed on my MBR) and entered the following commands at the command shell:

#chroot /mnt/tmp
#grub-install /dev/hda

That’s it! my system was back to its normal state, with the familiar grub bootloader greeting me with all the operating systems that were installed on my computer.

in related but different situations, there are variations of the above procedure which i had to follow to get my system working again. after a hard disk failure, for example, ‘fsck’ refused to work with my filesystem, and i had to first run ‘badblocks’ to scan for any possible bad blocks on the disk, and then run e2fsck with an alternate block number, as the main super-block was corrupted.

#badblocks -svn /dev/hda9
#dumpe2fs /dev/hda8
(use a partition here whose super-block is not corrupted)
#e2fsck -b alternate-super-block-from-above-command> /dev/hda9

if there is currently no partition that has a valid super-block, then the trick is to make a new file with an equal number of blocks as the corrupted partition, and then finding an alternate super block by applying the above procedure to this newly created file.

Anyway, there is atleast one way to get out of the trouble if you have one GNU/Linux Live CD handy with you. If you don’t have one already, go and grab it right now.

A list of popular gnu/linux live cd’s is here.

Comments (1)

Which is my favourite OS?

suddenly people have started to publish their favourite operating systems in their blogs and i thought i too should have some fun by doing the same. currently i have these operating systems installed on my computer:

  • Ubuntu (Debian based)
  • Zenwalk (Slackware based)
  • Fedora
  • Microsoft Windows XP

my favourite, as must be evident by the above list, is Debian. because i use Debian OS as the main server for my network, i thought i should install a different flavour of it on my pc. i may try Mepis os the next time.

the best thing i like about Debian based distros is its package manager called ‘apt.’ also there is a huge repository of packages ready to be downloaded and installed for debian. two dvd full of software can be kept handy by those who need to install them on multiple systems or have a slow internet connection. two step installation process of debian, where you can install only the base system in the first tier and then continue with the additional packages once the first part is successfully installed, gives lot of flexibility to the user. debian is also very secure and stable, more than any other gnu/linux distribution. this is also the reason why latest versions of many softwares are not available in debian but the tradeoff has been utilised by the ubuntu os and you get the latest, cutting-edge versions of all the software by sacrificing a bit on security and stability in ubuntu. because ubuntu is generally meant to be used on desktop only(all kinds of server applications can be installed on it, but you don’t use it as a public server machine), the security issue is not critical. but ubuntu comes with a single dvd worth of software and additionaly packages have to be installed from the internet. for KDE users, there is Kubuntu.

Slackware is another interesting distribution that is best known for its simpilicity and efficiency. the operating system, as well as its packages, get installed in real quick time. its package manager is also extremely simple to use but the repository of packages for slackware is not as big as debian’s. because i use it for development purposes, it suits me perfectly and i have found it as the fastest of all the popular gnu/linux distros. Zenwalk is a flavour of Slackware and installs only one software per every category – one browser, one word processor, one email client only saving a lot of disk space for me. its default desktop XFCE is also sleek and stylish. though the first thing that i installed on Zenwalk was the KDE package, which took less than one minute, i still spend most of my time in xfce.

i installed Fedora to check out the Core 4 version of it, but i am already thinking about installing PCLinuxOS or some thing else over it.

i use Windows XP primarily for development on .NET platform, and then for heavy printing jobs. i also keep most of my partitions meant for storing data under windows file system and manage them from windows xp because its easy to access windows partitions from gnu/linux than the other way round. my testbed machine contains 6-8 operating systems at once and the list keeps changing every 3-4 days. my brother is fond of Gentoo OS.
Final word? Debian as a server, Ubuntu for most of the desktop jobs(multimedia, internet etc), Zenwalk for development work and Windows XP for .NET and data storage.

Comments (3)

« Newer Posts · Older Posts »