Tuesday, December 11, 2007

Slab: A revamped Gnome Main Menu

I tried OpenSUSE for a while, and I could not like it for one reason: Package management is terrible. After you get used to "aptitude install", with mirrors of the repositories in nearly every country, it is hard to settle for anything less.

Among the things I did like about Novell's version of Linux is the Gnome main menu they use, called slab. It provides easy access to the most important things you expect of a main menu, but it's not as bloated as other menus like Gimmie.

Well, what better than to show a screenshot of it, no?

If you want to try it out, you just have to:

sudo aptitude install gnome-main-menu

Sunday, August 26, 2007

Make The Fsck Checks Un-annoying

There's one thing that is really annoying about the ext2/3 filesystem that Ubuntu uses by default, and it's that the partitions must be checked every 30 mounts. Unfortunately, these checks occur during the boot-up process. Now, it's not a good idea to disable the checks, but you can do is make the checks happen during the shut-down process instead. All you have to do is download and install Autofsk from here (link for version 2.0). Extract the file, and double click on the "Install" script. It will prompt for the root password and install. Autofsck will check when your partitions must be checked and will prompt you before you log out if you want it to happen.

Links of interest
Ubuntu Wiki/Autofsck

Tuesday, July 10, 2007

Firefox: "The connection was reset" on some sites

If it happens that on some websites you get "The connection was reset" (like this one), but the the websites work under Opera or Windows, it could be that you are running Firefox in Ubuntu Feisty. The fix is simple. Within Firefox go to the following address:
In the "Filter" text field type
Now, you should see a preference called "general.useragent.extra.firefoxComment". Right click on it, and change the value from
Now you are done.

This happens when the website you are trying to access blocks clients that have the string "ist" in their User Agent string, because the firewall thinks your computer is infected with the ISTbar adware.

Links of interest
Ubuntu Forums post
Launchpad bug report

Tuesday, May 8, 2007

Install a PDF printer

By default, CUPS-PDF is not installed, so grab it by using sudo apt-get install cups-pdf. You should then be able to add a fake printer that will convert print jobs to PDF files. Go to System -> Administration -> Printing to bring up the Printer configuration dialog. Select New Printer from the toolbar, and walk through the New Printer Wizard. You can give the printer pretty much any name you want. PDF seems like a logical choice. The Description and Location fields are optional.

On the next screen, when asked to select a connection, choose Virtual Printer, and leave the device URI as it is: cups-pdf:/. Next, on the screen where you can select a Printer from the database, choose Generic. On the next screen, choose PostScript as the Model and as the driver for the printer. Then you'll see a screen that says "Going to create a new printer PDF at cups-pdf:/." Click Apply and you should have a virtual PDF printer.

Links of Interest

Monday, May 7, 2007

Get NetworkManager working after suspend

After going into standby mode ("suspend") or hibernation, NetworkManager might refuse to connect to your network of choice. The trick is to restart NetworkManager after standby. You will need to create two files.
sudo touch /etc/acpi/suspend.d/07-network-manager.sh
gksudo gedit /etc/acpi/suspend.d/07-network-manager.sh

Now paste the following in Gedit, save and close.
/etc/dbus-1/event.d/25NetworkManager stop

sudo touch /etc/acpi/resume.d/63-network-manager.sh
gksudo gedit /etc/acpi/resume.d/63-network-manager.sh

Now paste the following in Gedit, save and close.
/etc/dbus-1/event.d/25NetworkManager start

Links of Interest
Ubuntu wiki's NetworkManager page

Thursday, May 3, 2007

Set Up Ruby on Rails with Postgresql

To set up Ruby on Rails to work with Postgresql, do the following:
Install Ruby:
sudo aptitude install ruby rdoc irb libyaml-ruby libzlib-ruby ri libopenssl-ruby

Install RubyGems (this is an aptitude/apt-get style utility that handles ruby programs)
Get the latest version from here
wget http://rubyforge.org/frs/download.php/17190/rubygems-0.9.2.tgz
tar xzvf rubygems-0.9.2.tgz
cd rubygems-0.9.2/
sudo ruby setup.rb
sudo gem update --system

Install Rails using RubyGems:
sudo gem install rails -y

Install PostgreSQL:
sudo aptitude install postgresql-8.2 postgresql-client-8.2 postgresql-client-common postgresql-common postgresql-doc-8.2

Now you have two choices. You can either install a pure Ruby PostgreSQL driver for Rails called postgresql-pr (slower) or you can install the native driver postgresql.

To install the postgresql-pr driver
sudo gem install postgres-pr

To install the postgresql driver
You need to install some more packages, or the installation will fail:
sudo aptitude install ruby1.8-dev libpq-dev
POSTGRES_INCLUDE=/usr/include/postgresql sudo gem install postgres

Enabling PostgreSQL
To start using PostgreSQL under your username, you first have to create a new PostgreSQL user. After a fresh installation of Postgres, the only (Linux) user that can create databases/users is the user "postgres", so we must "login" under its name.
sudo su postgres

Now we use the createuser script to create a new user.
createuser -P

(-P means "assign password") You will be asked some questions, just answer as follows, replacing YOUR_USER_NAME with your user name (BEEP cyclic redundancy check error BEEEEP)
Enter name of role to add: YOUR_USER_NAME
Enter password for new role:
Enter it again:
Shall the new role be a superuser? (y/n) y

Now type

to become yourself again.

Your First Rails Project
When you create your Rails projects, you have to tell Rails to use your PostgreSQL database, like this:
rails my_super_duper_project -d postgresql

Now, with your new super duper project created, you must modify the config/database.yml file so that Rails knows your username and password. In that file you will find THREE (3) "paragraphs" that look like this:
  adapter: postgresql
username: YOUR_USER_NAME

Just change the password fields to match your password. Also, you can notice that there are three databases, one that ends with "_development", another one with "_test" and another one with "_production". You create these databases using the createdb script:
createdb YOUR_PROJECT_development
createdb YOUR_PROJECT_production
createdb YOUR_PROJECT_test

Links of Interest
Ubuntu wiki's Rails Page
PostgreSQL in Ruby on Rails
RubyGems download page
Glom's initial Posgres configuration page