Adding Google Chrome (Chromium) in Mint/Ubuntu

This tip was tested in Linux Mint 7 and Ubuntu 9.04

Open source.list file as root:

sudo vi /etc/apt/sources.list

Add the following lines at the end of file:

# Chromium
deb http://ppa.launchpad.net/chromium-daily/ppa/ubuntu jaunty main
deb-src http://ppa.launchpad.net/chromium-daily/ppa/ubuntu jaunty main

Now update apt-get database and install Google Chrome (Chromium)

sudo apt-get update
sudo apt-get install chromium-browser

How to append a string to the end of each line ?

I’ve got a SQL script file with no “;” in end of lines. This file has 500k lines.
Googling to find some help I’ve found two ways to solve:

1) using ’sed’

sed -i ’s/$/;/’ filename

2) using ‘vi’

:%s/$/;/g

I also found other ways to do same thing using Perl, Java, ….. but sed/vi is more quick and simple.

Using Python to test e-mail sending

The are times when you do not want your application to send e-mails at all. For example, while developing a website, you probably don’t want to send out thousands of e-mails just for tests.

The easiest way to test your project’s use of e-mail is to use a “dumb” e-mail server that receives the e-mails locally and displays them to the terminal, but does not actually send anything. Python has a built-in way to accomplish this with a single command:

python -m smtpd -n -c DebuggingServer localhost:1025

This command will start a simple SMTP server listening on port 1025 of localhost. This server simply prints to standard output all email headers and the email body. You then only need to set the SMTP host and port on your application.

For more entailed testing and processing of e-mails locally, see the Python documentation on the SMTP Server. http://docs.python.org/library/smtpd.html

I’ve got this tip on Django documentation
http://docs.djangoproject.com/en/dev/topics/email/#testing-e-mail-sending

Upgrading to Firefox 3.5 in Mint/Ubuntu

It’s very simple upgrade from Firefox 3.0.xx to the brand new and stable version Firefox 3.5.

Just run:

sudo apt-get update
sudo apt-get install firefox-3.5

Done … installed!  ;)

If you want make FF 3.5 default browser follow these aditional steps:

1) Run “Preferred Applications” and choose custom. Type: “firefox-3.5 %u”.
2) sudo update-alternatives –config x-www-browser

Some considerations:

The Firefox 3.5 was appear named as “Shiretoko Web browser – Firefox 3.5 Beta” in your menu, but ignore the “Beta” mention. That is the stable version of Firefox 3.5. And don’t mind the Shiretoko name… it’s like a nickname of Firefox 3.5

How to disable PC Speaker Beep in Ubuntu 9.04

I hate the annoying pc speaker beep (system beep). But different from others Ubuntu versions, I didn’t find any option in Jaunty Jackalope to disable pc speaker. So, let’s do it in a “classic way”:

Open a console, edit blacklist.conf file located in /etc/modproble.d/ (as root)

sudo vi /etc/modprobe.d/blacklist.conf

Go to last line and add 2 lines:

# remove pc speaker beep
blacklist pcspkr

Bye bye beep ;)

Adding Microsoft True Type Fonts in Linux

Quick post: to add some microsoft true type fonts in your linux, and use them on OpenOffice, just type:

sudo apt-get install msttcorefonts

The apt will download a script and download several fonts using wget. All automagically ;)
This tip was performed in Ubuntu. For other distros just search in google for msttcorefonts

How to generate Locales in Linux (Ubuntu)

I was needing ‘pt_BR’ locale on a linux machine running Ubuntu, but on my system there’s only ‘en_XX’ locales.
With “locale -a” command you can view all locales installed on your system.
So, searching in Google I found this tip to generate a locale:

$ sudo locale-gen pt_BR.UTF-8
Generating locales…
pt_BR.UTF-8… done
Generation complete.

$ sudo dpkg-reconfigure locales
Generating locales…
en_AU.UTF-8… done

en_ZW.UTF-8… done
pt_BR.UTF-8… up-to-date
Generation complete.

I also needed pt_BR-ISO-8859-1 locale, but it didn’t was generated with “locale-gen” command. Looking for which locales was supported in /var/lib/locales/supported.d/SUPPORTED file, I found ISO8859-1 there.

So, I’ve opened the /var/lib/locales/supported.d/local file and added this line:
pt_BR.ISO-8859-1 ISO-8859-1

My file is looking like this:
$ sudo vi /var/lib/locales/supported.d/local

en_US.UTF-8 UTF-8
pt_BR.UTF-8 UTF-8
pt_BR.ISO-8859-1 ISO-8859-1

After all these steps I run (again):
$ sudo dpkg-reconfigure locales
$ locale -a

This tip can be adapted to other distros. I don’t know how the dpkg-reconfigure locales equivalent in opensuse. If you know leave a comment ;)

How to remove desktop Trash Icon in Gnome 2.6 (openSUSE 11.1)

I’ve installed Gnome 2.6 in openSUSE 11.1 and the default installation comes with Trash icon in desktop.
I like a clean desktop (“iconless”), so I’ve added the trash icon in lower panel but I didn’t find where to get rid of trash icon in desktop.

Searching in google I found a solution: Open gconf-editor and go to:  ‘app’ -> ‘nautilus’ -> ‘desktop’.
In the right frame, deselect ‘trash_icon_visible’.
gconf-editor
Done!

How to solve a problem with keyboard and touchpad in Dell Vostro 1510 with Ubuntu 9.04

I’ve installed Ubuntu 9.04 on Dell Vostro 1510 and the installation was completed with no error. But I’ve experienced a strange behavior: every time I turned my laptop on, the keyboard and touchpad didn’t work. Making some tests I’ve discovered that if I reboot the laptop the keyboard and touchpad starts working normally. But to reboot you will need plug an external USB mouse. As expected, this also happens with Xubuntu 9.04.

An important detail: the laptop keyboard works normally in Grub menu but something during the first boot cause this problem and on second boot this problem go away. Strange  =)

“Solution”

I’ve searched on Internet and found a partial solution: boot the kernel passing i8042.reset as parameter. This works perfectly, but I consider as a partial solution because every time you upgrade a kernel through Update Manager, you will loose this modification.

Let’s go: Edit menu.lst file located in /boot/grub/ as root (or with sudo command) and be careful. It’s highly recommended make a backup copy. Go around line number 130 (here is line 135) and you will find the kernel line. Go to the end of this line and add “i8042.reset” (without quotes). Look my partial menu.lst file.

grub-menu1

Xfce 4.6 slow problem solved

I was using Xfce 4.4 on my openSUSE 11.1 and there’s nothing wrong. It is amazing, very fast, I recommend ;)

Last week I’ve added Xfce openSUSE repository[1] to get latest stable version of Xfce and upgrade to brand new Xfce 4.6.

All the installation, done with Yast, went with no problem. But on my first login on my new desktop I had a bad surprise: the xfce splash screen (that with a mouse) was very , very very very slow. With Xfce 4.4 it took less than 5 seconds to load Xfce. Now, with 4.6 it took about 2 minutes with a lot hard disk activities.

So, I’ve dropped a mail to Pavol Rusnak, Xfce SUSE Maintainer[2], and he gave me a tip: remove Xfce session directory and login again. This directory lives in “cache” hidden directory on user home: ~/.cache/sessions

And it works. Problem solved and I have Xfce loading very fast again!

About this error there’s a ticket on Xfce Bugzilla going on.

[1]: http://download.opensuse.org/repositories/X11:/xfce/openSUSE_11.1/
[2]: http://en.opensuse.org/X11:xfce

Next Page »