Gentoo
How to Speed up Booting Into GNOME – A Gentoo Wiki Tip
9While there are several ways to cut down the time it takes for a GNU/Linux system to boot up completely, the most popular way is to prevent any unnecessary services from being started at the boot time(if you don’t host web pages from your machine, for example, then disabling the apache server from starting at boot time will save some precious CPU cycles). There are several HOWTOs littered around the internet describing how to identify and disable the services that are not needed by a user. You can go to Desktop -> Administration -> Services in GNOME to have a look at the most important services; the commands ‘rc-status boot’ and ‘rc-status default’ will give you a complete list. Make sure that you understand what a service does before trying to disable them.
Gentoo Wiki has another trick to speed up the boot process of Gentoo OS: start loading GDM at boot time by adding ‘xdm’ to the boot runlevel instead of the default runlevel. I am reproducing the procedure here mainly because the boot time for my Gentoo system got reduced roughly by 40% after I implemented this tip, which by no means is insignificant.
Follow these steps.
Substitute the following line:
/sbin/telinit a &> /dev/null
with this line:
/etc/X11/startDM.sh &> /dev/null
(All the above names are case-sensitive.)
Now run the following two commands:sh# rc-update add xdm boot
That’s it. To immediately try it out, you can run ‘/etc/init.d/xdm restart’ command, or preferably, can do a full system reboot. The major gain for me after making this modification has been that the system no more gets stuck at the boot time for more than 10 seconds when it can’t find a DHCP server.
NOTE: This tip is meant only for the desktop machines. It’s not advisable for server machines for obvious reasons.
More information on Gentoo Wiki:
Moving A GNU/Linux Installation To A Different Partition
17When I had first installed the Gentoo GNU/Linux operating system, my initial plan was to use it just for a couple of weeks before overwriting it by installing some other new distribution from Distrowatch. But I started to like it so much in less than a month’s time that I replaced Debian Sid with Gentoo as the primary operating system on my personal desktop(the server still runs Debian Sarge). Almost an year now, I haven’t regretted the decision ever. What I did regret a few days ago, though, was the amount of disk space that I had allotted for Gentoo during its installation – a meagre 11GB partition! Mortals like me lack the foresight required in such situations.
I had never considered ‘moving’ an installed operating system to a different location until then – I thought it to be such a lousy way to lose the oppurtunity for a fresh installation of the OS from the scratch(avoiding the mistakes that were committed the last time). But installing a Gentoo system from the sratch! Heavens forbid. It had taken 3 days for me to get the a bare minimum Gentoo system up and running, nothing more than the GNOME desktop manager. Another 4-5 days to install the most basic applications. I was not prepared at all to go through similar 1 week of downloading, compiling and installing the packages again by starting from the scratch. I decided to move my existing Gentoo system to a new, bigger partition. Not just the data but the entire bootable operating system.
None of my reservations regarding moving an installed system to a new location turned out to be true after a quick google search about them: all one needs to accomplish this task is a new, empty partition and atleast a GNU/Linux Live CD to run the basic unix commands. I confirmed that this is indeed correct information and won’t result in an unusable system by getting help from folks on the linux IRC channels. I had only two things to confirm:
Thanks to the folks on the IRC channels, both my doubts were clarified to my satisfaction(one must appreciate the level of depth that they are ready to go to explain such stuff, I got more than what I had asked for :) ) and I was well set to finally begin the process of moving my Gentoo system from the 11GB partition(/dev/hdc7) to a 40GB one(/dev/hdc6, which I had earlier formatted with ext3 filesystem).
I booted into my Kubuntu system(can be done from any Live CD) and followed the procedure listed below to complete the process of moving my Gentoo Installation from /dev/hdc7 to /dev/hdc6:
sh# sudo mount /dev/hdc7 /media/gentoo -o ro
sh# sudo mount /dev/hdc6 /media/newgentoo
The ‘-a’ option tries to preserve as much structure of the filesystem as possible(ownerships, permissions, symbolic links etc). Consider if ‘-x’ is also required in your case.
Did one modification to the /etc/fstab file in /media/newgentoo(/ should now be /dev/hdc6).Earlier:
/dev/hdc7 / ext3 noatime 0 1
Now:
/dev/hdc6 / ext3 noatime 0 1
title Gentoo GNU/Linux(New)
root (hd0,7)
kernel /boot/kernel-genkernel-x86-2.6.14-gentoo-r5 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hdc6 udev
initrd /boot/initramfs-genkernel-x86-2.6.14-gentoo-r5
savedefault
boot
I actually made a copy of my previous entry and just changed the value of ‘real_root’ field from ‘/dev/hdc7 udev’ to ‘/dev/hdc6 udev’. The strange looking values of the rest of the fields owe to the fact that I have my kernel and initramfs images copied in /boot directory of my Ubuntu system(and hence needed no modifications). The Grub boot loader reads these files from there and then mounts /dev/hdc6 as the ‘real root’ device.
That’s it. I booted into the new Gentoo system by selecting its entry from the boot-loader menu, and soon the all familiar Gentoo desktop I had gotten used to for the past one year was ready to go. No hiccups, no troubleshooting and no tweaking was required. The only observable difference from my old Gentoo system was that I had a lot more free disk space now! I will continue to use the old system for some more time to do couple of testings(which I was afraid to do earlier) before erasing it to install another GNU/Linux operating system over it. With RC5 already available, Slackware 11.0 seems to be just around the corner ;)
For those who don’t have another GNU/Linux OS installed on their computers or don’t have the luxury to boot from a Live CD(for remote systems, for example) to perform the copying operations, the copying can be done from the running system(the OS you want to move) too – with a litttle more caution. A lot of information on this can be extracted from the Gentoo wiki pages(applies to all distributions, not just Gentoo) – Google search should take you there.
Create ASP.NET 1.0 & 2.0 Applications On GNU/Linux and Windows Using Mono XSP
6This post assumes that Mono is installed on your system. The following links should help if it is not installed.
Installing Mono on Gentoo and Ubuntu 5.10
Installing Mono and XSP on Ubuntu 6.06
Installing Mono and XSP on Fedora
Installing Mono XSP on Gentoo
Installing Mono XSP on Debian/(K)Ubuntu
Installing Complete Mono Environment(Mono, GTK#, XSP) on MS Windows
Go to the Mono menu in the Start menu(Start->All Programs->Mono[version]) to access all the applications installed as part of Mono.
Your First ASP.NET 1.0 Application Using Mono XSP
hello.aspx
[html]
Inherits="HelloApp.HelloPage" AutoEventWireup="true" %>
Welcome to my page!
Hello, World!
[/html]
hello.aspx.cs
[csharp]
using System;
using System.Web.UI.WebControls;
namespace HelloApp
{
public class HelloPage : System.Web.UI.Page
{
protected Label message;
protected Button greet;
protected TextBox name;
public void OnGreetClick(Object sender, EventArgs e)
{
message.Text = “Hello, ” + name.Text;
}
}
}
[/csharp]
(you can press ENTER to terminate the XSP server process)
Open a web browser, type the url http://localhost:8080/hello.aspx and press ENTER. You should see a web page with a text box and a message. Enter a name in the text box and click the “Greet” button to see the personalised greeting displayed.On MS Windows, go to the Mono menu in the Start menu(Start->All Programs->Mono[version]), select “Mono[version] Command Prompt” menu item. Create a directory(say ‘c:\programs\aspnet’), change to that directory and copy the above two files in that directory. From the same directory, run ‘xsp’ commad to start the XSP webserver. Open a web browser and access the url http://localhost:8080/hello.aspx.
Your First ASP.NET 2.0 Application Using Mono XSP
To develop ASP.NET 2.0 applications using Mono XSP server, start ‘xsp2′ webserver instead of ‘xsp’. Create a test ASP.NET 2.0 page(say ‘hello2.aspx’) and copy it in a folder. Run the following command from the same folder:
Go to http://localhost:8080/hello2.aspx to test the ASP.NET 2.0 page.
Installing Ruby on GNU/Linux(Gentoo, (K)Ubuntu, Fedora, SUSE) And MS Windows
7Installing Ruby on Gentoo:
To install Ruby on Gentoo, run the following command(as root) in a shell:
You can add a few ‘USE’ keywords if you want to install additional Ruby support(like database integration, CGI support etc). Add the following line to the /etc/portage/package.use file(keywords that are already present in ‘USE’ flag of /etc/make.conf file need not be added):
dev-lang/ruby docs examples fastcgi mysql
‘ruby-mode’ adds the ruby mode to the Emacs editor while editing .rb files. Use ‘ruby-modes’ to add similar support to XEmacs. You need to add some text to .emacs file from your home directory; see this to know how to do it.
Installing Ruby on (K)Ubuntu:
Preparation:
A little note before you start installing Ruby on (K)Ubuntu:
There are two versions of Ruby available in the Ubuntu repositories:
1.8.4 version can be installed by appending 1.8(Eg. ruby1.8, irb1.8 etc) to the respective package names. Similarly, 1.9 version can be installed by appending 1.9(Eg. ruby1.9, irb1.9 etc) to the respective package names. If nothing is appended(Eg. ruby, irb etc), what debian considers as default version of ruby(currently 1.8.4) will be installed.
Once Ruby is installed, the command to invoke the Ruby interpreter would depend on which version of it is installed. Like, if ruby1.8 is installed, ruby can be invoked using ‘ruby’ or ‘ruby1.8′ commands(‘ruby’ will be a symbolic link to ‘ruby1.8′):
sh# ruby first.rb
sh# ls -l `which ruby`
lrwxrwxrwx 1 root root 7 2006-07-18 18:47 /usr/bin/ruby -> ruby1.8
(the quotes in the third command are inverted quotes and not single quotes)
Use ‘ruby1.9′ if 1.9 version is installed.
If all this sounds confusing, just follow my recommended way of installing Ruby and skip the ‘Optional’ part.
My recommended way of installing Ruby on (K)Ubuntu:
To install Ruby on Ubuntu family of operating systems, type the following command in a shell:
(Or search and install these packages using Synaptic(on Ubuntu) or Adept(on Kubuntu) Package Manager.)
Running commands like ‘ruby’, ‘irb’ etc will invoke the latest stable versions:
ruby 1.8.4 (2005-12-24) [i486-linux]
Optional
To install the 1.9 version(which is not stable as of now), use the following command:
sh# ruby -v
ruby 1.9.0 (2006-04-21) [i486-linux]
Of course you can also have both 1.8.4 and 1.9 versions installed on the system at the same time. Run the following command to do so:
In this case, use ‘ruby’ to execute the 1.8.4 version of the interpreter and use ‘ruby1.9′ to run the 1.9 version.
ruby 1.8.4 (2005-12-24) [i486-linux]
sh# ruby1.9 -v
ruby 1.9.0 (2006-04-21) [i486-linux]
I don’t recommend installing additional Ruby packages using the ‘rubygems’ utility if you use a distribution specific package manager(apt, emerge etc) to manage the software on your system. Debain community strongly discourages its use to install the ruby packages(rightly so), as it doesn’t follow the package management conventions of Debian’s package manager(and hence can mess up with it and stop it from working properly). Same goes for Gentoo OS too. Go here to read more information on this. But if Ruby is (one of) the most important software for you, then ‘rubygems’ can make it very easy to install the latest versions of Ruby related software, long before they are added to the Debian or Gentoo repositories. In that case, follow the documentation on how to install ‘rubygems’ and how to install Ruby packages using it from this page.
In Gentoo, you can do this:
Installing Ruby on Fedora/SUSE/Mandriva etc:
Use RPMs! Hunt them down using google.com or rpmfind.net and then install them one by one in the order.
Or use the package manager of each distribution(‘yum’, ‘yast’ and ‘urpmi’ respectively) and hope for the best. I have tested with yum and yast and at least they did not create too many issues for me:
Ruby on Fedora using yum:
If the yum configuration files(fedora.repo etc) are properly setup, you can install Ruby using the following command:
sh# ruby -v
ruby 1.8.4 (2005-12-24) [i386-linux]
Above command will install ruby, irb, ri, rdoc commands and Ruby mode for Emacs. You need to add the following line to ‘.emacs’ file present in your home directory(create it otherwise) to enable Ruby mode in Emacs editor:
(require ‘ruby-mode)
On SUSE, use YaST to install ‘ruby’, ‘ruby-doc-ri’ and ‘rubygems’ packages by searching for them from the YaST interface(YaST->Software Management->Search).
ruby 1.8.2 (2004-12-25) [i586-linux]
‘ruby’ and ‘rubygems’ are available on the SUSE 10.1 DVD itself; you can add repositories from the Internet to install the other Ruby packages(ruby-docs-ri etc), or use ‘rubygems’ to install them.
Add the following in the YaST configuration (YaST->Installation Source) if you want to install ‘ruby-docs-ri’ from the Internet:
Protocol: FTP
Server Name: ftp.mirrorservice.org
Directory on Server: /distribution/SL-10.0-OSS/inst-source/
Authentication: Anonymous
Another way would be to simply download all the needed RPM files by manually searching for them on the web and installing them directly without bothering with yast. Same can be done for Mandriva and other RPM based distributions.
Installing Ruby on Microsoft Windows:
Download the Ruby Windows installer file from the following url: Ruby 1.8.4
(blog entries become outdated very soon; this is version 1.8.4, currently the latest stable version. Always Google for the latest stable version to check if this url still useful to compensate my laziness in updating the above link once a new version is released. 40+ words waster for the lack of Package Manager in Microsoft Windows.)
Click on the installer file and follow the wizard. Once finished, you have three ways to run your Ruby programs(assuming its Windows XP):
All the menu items are available at: Start->All Programs->Ruby-184-19, so first go there.

Then,
Select fxri-Interactive Ruby Help & Console menu item to load the interactive Ruby interpreter. Run your Ruby programs at the 'irb' prompt.

Select FreeRIDE menu item, which will open a minimal IDE to write, debug and run Ruby programs.

(Recommended)Use SciTE editor.
Select SciTE menu item. This will open the excellent editor called SciTE that supports many programming languages other than Ruby, and is also available for many other operating systems(including GNU/Linux). Its one of the best programming editors available today.

After finishing editing and saving the program with SciTE, go to the command prompt(Start->All Programs->Accessories->Command Prompt), change to the directory where you have saved the program and run it using the 'ruby' command.
C:\myprogs>ruby first.rbEnd Note:
This article describes the installation of basic Ruby software. There are many related packages that can be installed to get additional functionality, like database bindings for popular database software(mysql, postgre), email support, gui programming(gtk, qt), rails, soap etc. Hopefully, I will cover installation of these packages in a future article(also planning to post an article on using various popular IDEs(Eclipse, Komodo) to create Ruby programs in Windows and GNU/Linux OS), so check back if you are interested.
Two Applications For Easy Management Of ‘USE’ Flags In Gentoo
0
The feature I like the most in the Gentoo operating system is the flexibility available through the use of ‘USE’ flags while installing the software packages. Its one of the features which you feel fortunate to have found out, wondering how you could have lived without it in the other operating systems.
Many operating systems(Debian/Ubuntu, Gentoo) handle the first level of dependency quite efficiently – the dependencies which are essential for a package to work are automatically resolved and installed whenever you install the package with ‘apt’ in Debian/Ubuntu or ‘emerge’ in Gentoo. yum, urpmi, yast etc are trying to achieve the same but they are still not as robust as the earlier two. The second level of dependencies that are not essential for the package to work but can add to its core functionality are still managed by the users manually in every operating system(AFAIK) except in Gentoo. Its just one more thing to worry less about for the Gentoobies.
If you want every package that can provide functionality related to MySQL software to have such support included in it when it is installed, then just add the ‘mysql’ keyword to the ‘USE’ flag in the ‘/etc/make.conf’ file:
USE=’gtk gnome kde qt apache mysql‘
MySQL support will now be added to every application that has such bindings available for it. Now you can Install new applications or upgrade the entire system never bothering about missing MySQL support in any of the applications. Similarly you can chose to include support for Java, Apache, alsa etc for the applications that support them. Have a look at the Gentoo website for a complete list of USE flags that are supported by Gentoo or run the following command from a Gentoo system:
sh# less /usr/portage/profiles/use.descUSE flags can also be used to disable a certain optional functionality(if it will be installed by default but you don’t want it, for example) by prefixing the flag with a minus-sign(“-”):
media-sound/banshee ipod njb -aac real
In this case, aac support will NOT be installed for the Banshee application.
Adding a USE flag in the /etc/make.conf will globally enable it for the entire Gentoo system and will apply to every application that is installed on it. To enable/disable USE flags on an application to application basis(you want MySQL support in one application but not in the other), you can add a separate line for every application in /etc/portage/package.use file:
=dev-lang/php-5.0.5-r5 cli cgi apache apache2 mysql dba gd
These USE flags will be applied only to the PHP package and only for the version specified in the above line. To enable the use flags for any version of a package, drop the version number:
media-sound/banshee ipod njb aac real
This installs the optional support available for ipod, aac format, real media in the Banshee music player. For more infornation on USE flags, see this.
Two applications that simplify the management of USE flags in Gentoo are:
ufed profuseInstall them using the following command:
sh# emerge ufed profuseThe first one is console based and the second one uses a graphical interface. Though its not terribly difficult to manually add/remove the USE flags by directly editing the /etc/make.conf file, I find these two applications to provide a convenient interface to simply search through the list of flags available and enable/disable them with a single click/key press. Below are screenshots of these applications.
‘ufed’ console based USE flag editor

‘profuse’ graphical USE flag editor

Recent Commentslu on How to Speed up Booting Into GNOME – A Gentoo Wiki TipBalakrishnan B on Installing C++ Boost on Gentoo and Debian/UbuntuBeginner C++ – Installing an IDE on Six Popular IDEs For Developing Software in C/C++ on Windows Platformserpent403 on Develop Ruby Applications Using Eclipse IDENeis on Struts 2 Plugin for NetBeans IDE – nbstruts2support