Skip to content

Linux

Spotify for Linux RPM

I’ve taken the liberty of converting the “Spotify for Linux”-files located at from .deb to .rpm. For now it can only be used if you have a Premium account.

To install it on Fedora 13, do the following:

su -
rpm --nodeps -Uvh http://jorge.fbarr.net/files/spotify-client-gnome-support.noarch.rpm http://jorge.fbarr.net/files/spotify-client-qt.i386.rpm

And that’s it. Now you can run Spotify as a Linux-application instead of through Wine. :)

This post never gets old. I constantly keep finding new and useful addons for Firefox. Here’s the list of what I consider to be some of the best Firefox addons out there.

  • Adblock Plus
  • Ever been annoyed by all those ads and banners on the internet that often take longer to download than everything else on the page? Install Adblock Plus now and get rid of them.
  • MediaplayerConnectivity
  • Allow you to launch embed video of website in an external application with a simple click.
  • StartupMaster
  • Asks for the master password at startup (fixes multiple password prompt).
  • Tab Mix Plus
  • Tab Mix Plus enhances Firefox’s tab browsing capabilities. It includes such features as duplicating tabs, controlling tab focus, tab clicking options, undo closed tabs and windows, plus much more. It also includes a full-featured session manager.
  • Tiny Menu
  • Replace the standard menu bar with a tiny menu popup.
  • Tree Style Tab
  • Show tabs like a tree.
  • Xmarks
  • Xmarks is the #1 bookmarking add-on. Install it on all your computers to keep your bookmarks and (optionally) passwords backed up and synchronized. Xmarks also helps you uncover the best of the web based on what millions of people are bookmarking.
  • It’s all Text!
  • Right click on a text area, select “It’s All Text!” and edit the text in the editor of your choice.
  • Web Developer
  • The Web Developer extension adds a menu and a toolbar with various web developer tools.
  • BarTab
  • BarTab can intercept when tabs are loaded in the background or restored after a browser restart and will only load the content when the tab is actually visited. It also allows you to free memory by unloading already loaded tabs, either manually or automatically.

Nginx, PHP, MySQL and WordPress continued

So, my machine at home took the plunge. A couple of days ago while I was reorganising the livingroom (I was not bored, I actually love doing that stuff), I placed the server on the floor, as it usually was placed above the TV. Michael then decided to play a little ON/OFF-game with the server. The powersupply was fried, and I can’t really bother to buy a new one at this moment. So, it was finally time for me to buy a VPS from out there somewhere. My decision fell on , and they actually seem pretty good so far, so now to see if it will last.

My concern was though, VPS’ (Virtual Private Server) aren’t usually that good, they have limited diskspace and hardware. I don’t need much of diskspace, but after some experience with Apache, I know it’s a huge memory-hog. So what I basically needed was Apache, MySQL, PHP and WordPress. I didn’t think it was going to work out, until a nice co-worker of mine tipped me off about nginx.

This was supposedly a very good, and very lightweight webserver, according to him. So I decided to give it a shot. And so far, it’s working wonders.

Here I’ll try to explain how to set up your server with nginx, MySQL, PHP and WordPress.

FastCGI

FastCGI is what your webserver uses to interact with PHP-code, and this is not something that comes packaged with nginx.

There are two options you can use, and I have tested both. spawn-fcgi or php-fpm. I ended up using php-fpm, though spawn-fcgi is quicker to set up. I’ll try to explain how to set up both.

spawn-fcgi

spawn-fcgi, which came with the webserver lighttpd. You usually had to download lighttpd first, compile it, and then grab the program from there. But for your convenience, you can get the spawn-fcgi here, or just go to , and grab the source there to compile on your own (seems to be an own project now).

So basically, as root, do the following:

wget http://jorge.fbarr.net/files/spawn-fcgi
mv spawn-fcgi /usr/local/bin

Now, the next step is to make this program run at boot. For those of you using a RedHat’ish type of system, adding this to the end of /etc/rc.d/rc.local will do the trick. You can add it by running this command:

echo '/usr/local/bin/spawn-fcgi -f /usr/bin/php-cgi -a 127.0.0.1 -p 9000 -P /var/run/fastcgi-php.pid -u nginx -g nginx' >> /etc/rc.d/rc.local

php-cgi is the name of the fcgi-application, which is usually provided by your distribution’s PHP-package (I believe it’s php-common for CentOS/Fedora, so make sure you have it installed), and is referred to by the -f in the command. -a makes you specify which address to listen on, -p is the port (9000 in this case), and -P is the file to place the process ID in when the program is started, which makes it easier to kill the program if necessary.

Once placed in the rc.local-file, just run it manually to fire it up:

/usr/local/bin/spawn-fcgi -f /usr/bin/php-cgi -a 127.0.0.1 -p 9000 -P /var/run/fastcgi-php.pid -u nginx -g nginx

php-fpm

php-fpm is a patch for php4/5 to greatly improve FastCGI SAPI usage in production. This means that you don’t install php through your distribution’s package manager, but rather download the package from the PHP-website, and the patch from another site. You patch up the sourcecode, compile things, and get it started.

One of the dependencies for how we’re going to compile PHP is MySQL, so install that first by typing:

yum install mysql mysql-devel

Then get the PHP-sourcecode by typing:

cd /usr/local/src
wget http://no2.php.net/get/php-5.3.0.tar.bz2/from/no.php.net/mirror

And the patch itself:

wget http://php-fpm.org/downloads/php-5.3.0-fpm-0.5.12.diff.gz

Then execute the following command:

tar -jxvf php-5.3.0.tar.bz2

Now we patch the newly downloaded PHP:

gzip -cd php-5.3.0-fpm-0.5.12.diff.gz | patch -d php-5.3.0 -p1

And enter the new directory to start compiling things:

cd php-5.3.0/
./configure --enable-fpm --with-mcrypt --enable-mbstring --with-mysql=/usr/include/mysql --with-mysql-sock=/tmp/mysql.sock --with-curl --enable-sockets --with-gd --with-zlib --with-iconv --with-jpeg-dir=/usr/lib

Notice: If you are using a 64-bit system you have to add in an –with-libdir=64 for it to compile correctly. According to Raja Varma you need to use –with-libdir=lib64 for it to compile properly in a CentOS 64 bit installation. Thanks for the tip Raja!

At this point the compile failed quite a bit, as I had to install several more packages. The packages I had to install were the following (a snippet taken from yum.log):

Apr 23 08:34:44 Installed: zlib-devel-1.2.3-3.i386
Apr 23 08:34:50 Installed: libxml2-devel-2.6.26-2.1.2.7.i386
Apr 23 08:37:10 Installed: keyutils-libs-devel-1.2-1.el5.i386
Apr 23 08:37:18 Installed: libsepol-devel-1.15.2-1.el5.i386
Apr 23 08:37:23 Installed: libselinux-devel-1.33.4-5.1.el5.i386
Apr 23 08:37:30 Installed: e2fsprogs-devel-1.39-20.el5.i386
Apr 23 08:37:35 Installed: libidn-devel-0.6.5-1.1.i386
Apr 23 08:37:40 Installed: krb5-devel-1.6.1-31.el5_3.3.i386
Apr 23 08:37:46 Installed: openssl-devel-0.9.8e-7.el5.i386
Apr 23 08:38:07 Installed: curl-devel-7.15.5-2.1.el5_3.4.i386
Apr 23 08:40:15 Installed: libjpeg-devel-6b-37.i386
Apr 23 08:41:54 Installed: 2:libpng-devel-1.2.10-7.1.el5_3.2.i386
Apr 23 08:43:38 Installed: libmcrypt-2.5.8-4.el5.centos.i386
Apr 23 08:44:37 Installed: libmcrypt-devel-2.5.8-4.el5.centos.i386

Once everything compiles successfully, we continue with:

make all
make install

Now that everything is ready to go, we only need to modify two lines in the file /usr/local/etc/php-fpm.conf. Simply replace nobody with nginx, and remove the comments, making the lines look like this:

            Unix user of processes
            nginx               

            Unix group of processes
            nginx

And that should be it. Fire up php-fpm with:

/usr/local/bin/php-cgi --fpm

Making an init-script for php-fpm is pretty easy – simply make a symlink that points to /usr/local/php/sbin/php-fpm:

cd /etc/rc.d/init.d
ln -s /usr/local/sbin/php-fpm php-fpm

Now add the following line to /etc/rc.d/rc.local to make php-fpm start up at boot:

/usr/local/sbin/php-fpm

And you’re done!

Now to the next item on the list, nginx.

nginx

nginx (pronounced as “engine X”) is a lightweight, high performance web server/reverse proxy and e-mail (IMAP/POP3) proxy HTTP server and mail proxy server written by Igor Sysoev.

So based on that we’re using CentOS now, we are going to get the necessary package from the EPEL-repository. Run these commands to fetch the package, and to install it:

wget http://download.fedora.redhat.com/pub/epel/testing/5/i386/nginx-0.6.38-1.el5.i386.rpm
yum --nogpgcheck localinstall nginx-0.6.38-1.el5.i386.rpm

Once installed, we need to configure three files, mainly. /etc/nginx/fastcgi_params, /etc/nginx/nginx.conf and /etc/nginx/conf.d/virtual.conf (if you want to have several virtual domains). The first file, fastcgi_params, we just need to add a little something. Open up the file and add the following line to it, right under SCRIPT_NAME:

fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;

Save and close the file.

This is what my nginx.conf pretty much looks like:

Notice: According to :

…do not use the given nginx,conf, it is malicious point your server to his site.

Let me just say again, this is what MY configuration file looks like. I’ve simply pasted it so that you can see how a working configuration looks. So if you want it to work for you, you need to modify the values to suit your setup. I thought that was needless to say, but guess not. :)

#######################################################################
#
# This is the main Nginx configuration file.  
#
# More information about the configuration options is available on 
#   * the English wiki - http://wiki.codemongers.com/Main
#   * the Russian documentation - http://sysoev.ru/nginx/
#
#######################################################################

#----------------------------------------------------------------------
# Main Module - directives that cover basic functionality
#
#   http://wiki.codemongers.com/NginxMainModule
#
#----------------------------------------------------------------------

user              nginx;
worker_processes  1;

error_log         /var/log/nginx/error.log;
#error_log        /var/log/nginx/error.log  notice;
#error_log        /var/log/nginx/error.log  info;

pid               /var/run/nginx.pid;

#----------------------------------------------------------------------
# Events Module 
#
#   http://wiki.codemongers.com/NginxEventsModule
#
#----------------------------------------------------------------------

events {
    worker_connections  1024;
}

#----------------------------------------------------------------------
# HTTP Core Module
#
#   http://wiki.codemongers.com/NginxHttpCoreModule 
#
#----------------------------------------------------------------------

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] $request '
                      '"$status" $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    proxy_read_timeout 300;

    #gzip  on;

    # Load config files from the /etc/nginx/conf.d directory
    include /etc/nginx/conf.d/*.conf;

    #
    # The default server
    #
    server {
        listen       80;
        server_name  chihiro.fbarr.net;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   /usr/share/nginx/html;
            index  index.html index.htm;
        }

        error_page  404              /404.html;
        location = /404.html {
            root   /usr/share/nginx/html;
        }

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /usr/share/nginx/html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:20080
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
        #    include        fastcgi_params;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }
}

The only thing I’ve changed here is server_name, which I’ve set to chihiro.fbarr.net. This is like the main server we’re working with. Now I’m going to want to set up the virtual host jorge.fbarr.net on this machine as well. For that we need to configure the file /etc/nginx/conf.d/virtual.conf. This is what mine looks like:

#
# A virtual host using mix of IP-, name-, and port-based configuration
#

## jorge.fbarr.net
server {
    listen       80;
    server_name  jorge.fbarr.net;

    port_in_redirect off;

    root   /var/www/jorge.fbarr.net;

    proxy_redirect     off;
    proxy_redirect     http://jorge.fbarr.net:80/  /;

    access_log /var/log/nginx/jorge.fbarr.net-access.log;
    error_log  /var/log/nginx/jorge.fbarr.net-error.log;

    include /etc/nginx/fastcgi_params;

    index   index.php;

    if (!-e $request_filename) {
        rewrite ^(.+)$ /index.php?q=$1 last;
    }

    location ~ .*\.php$ {
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
    }
}

## jorge.ulver.no redirect

server {
    listen      80;
    server_name jorge.ulver.no;

    rewrite ^(.*) http://jorge.fbarr.net$1 permanent;
}

That’s pretty much it. Everything should be working just fine by now. :) But we are lacking two things, MySQL and WordPress.

MySQL and WordPress

To install MySQL, type up the following:

yum install mysql-server

As for how to set up MySQL, if you follow these instructions, it will tell you how you need to set up your database to work with WordPress, so I won’t be posting details about that here.

For PHP to be able to work with MySQL (if you have chosen to use spawn-fcgi and not php-fpm), you need to install a package called php-mysql. Install the package with yum, kill php-cgi, and start it again by doing these following things:

yum install php-mysql
pgrep php-cgi | xargs kill
/usr/bin/spawn-fcgi -f /usr/bin/php-cgi -a 127.0.0.1 -p 9000 -P /var/run/fastcgi-php.pid -u nginx -g nginx

Once everything is done, voila! You should now have nginx, PHP, MySQL and WordPress working together. And as you probably notice, nginx is taking a LOT less resources than Apache would have.

Issues with PHP

If you notice that errors such as the following are popping up on your site:

It is not safe to rely on the system’s
timezone settings. Please use the date.timezone setting, the TZ
environment variable or the date_default_timezone_set() function.

You can do the following:

cp /usr/local/src/php-5.3.0/php.ini-production /usr/local/lib/

Then open up the file php.ini and change:

;date.timezone =

to

date.timezone = "Europe/Oslo"

If you happen to live in Oslo. Change it to whatever is right for you really. Also, find the line that says something like:

error_reporting = E_ALL & ~E_NOTICE

And change it to:

error_reporting = E_ALL & ~E_DEPRECATED

Restart php-fpm and nginx and things should be back to normal.

Introduction to irssi

There are a load of IRC clients for UNIX-based systems out there, but I personally feel that irssi suits me best. Incredibly flexible, adjustable for every user, and doesn’t depend on X to be able to run it. Haven’t really found a guide out there that explains things in an easy and understandable manner, aimed particularly at new users. So here’s my attempt at it.

Getting started

What we need, of course, is irssi itself. You can get it at http://www.irssi.org/download, or use your system’s package manager to download it.

yum install irssi

..for RPM-based systems.

sudo aptitude install irssi

..for Debian/Ubuntu type of distributions.

Now, once installed, you can fire up irssi by typing

irssi

..in the commandline. You should now be running irssi, whoo!

Customizing the settings

Now that irssi is up and going, you can change the settings, adjust it so that if suits you. By typing:

/SET 

you will get a list of settings. For instance, let’s try out /SET nick. This is what pops up:

 [completion]
 completion_nicks_lowercase = OFF
 [lookandfeel]
 hilight_nick_matches = ON
 query_track_nick_changes = ON
 show_nickmode = ON
 show_nickmode_empty = ON
 show_own_nickchange_once = OFF
 [misc]
 netjoin_max_nicks = 10
 netsplit_max_nicks = 10
 netsplit_nicks_hide_threshold = 15
 [server]
 alternate_nick = joenba7_
 nick = joenba7

Here you see the various settings containing the word nick. irssi will automatically set your nick based on your account name. So if your username on your machine is foo, irssi will set your nick to foo. You can of course change this:

/SET nick joenba7
/SET alternate_nick joenba7_

..followed up by a /SAVE and /RELOAD to save and reload the settings.

Note: Every time you change a default setting, you will have to use /SAVE to save the configuration.

Connecting to an IRC-network

/SERVER powertech.no.eu.dal.net

This will then connect me to the server powertech.no.eu.dal.net on the DALnet network. At the same time though, I’d like to be on the EFnet network. You can connect to multiple networks by typing:

/CONNECT irc.homelien.no

This connects you to the EFnet network as well. You are perhaps wondering how you can change from one network to the other? Look at your status-window. This is usually window number 1. Use ALT-1 or ESC-1 to change to that window. Right now my active network is EFnet, on the server irc.homelien.no. Which means that I’m seeing this:

[08:38] [joenba7(+i)] [1:homelien (change with ^X)]

«Change with ^X» – As you’ve probably guessed, ^X means Ctrl-X, so upon pressing it, you will change your active network. You will see something like this in your status window:

08:38 -!- Irssi: Changed to server powertech.no.eu.dal.net

To disconnect from one of the servers, or stop irssi’s attempt at reconnecting, use:

  • /DISCONNECT – Disconnects server with tag network.
  • /DISCONNECT recon-1 – Cancels an attempt to connect to the server named recon-1.
  • /RMRECONNS – Cancels all attempts to reconnect.
  • /RECONNECT recon-1 – Will attempt to reconnect you to recon-1.
  • /RECONNECT ALL – Will attempt to reconnect to all the servers in the reconnection queue.

You can scroll upwards/downwards with the Page Up / Page Down keys. If they aren’t working for you, you can use Meta-p / Meta-n, where Meta can be ESC and/or ALT.

Default behavior is that irssi pretty much creates hidden windows for just about everything. Hidden windows are created every time you join a channel or start a conversation. There are different ways to switch between them:

  • Meta-1 .. Meta-0 – Switch between window 1-10.
  • Meta-q .. Meta-o – Switch between window 11-19.
  • /WINDOW – Switch to window number .
  • Ctrl-p / Ctrl-n – Switch to the previous/next window.

Adding networks, servers and channels

On the network DALnet you have a function called Nickserv, which lets you register a nick, so that you can become the owner of it. To be able to use this nick you will have to identify to it when logging on to the IRC network. It’s a bit tiresome having to type /nickserv identify every time you connect. I’m assuming you want this a bit more automated? I at least do. :) But before we do this we have to do a couple of things. Like adding a network:

Note: use /IRCNET with version 0.8.9 and older.

/NETWORK ADD 

For example:

/NETWORK ADD DALnet

To remove the network, use:

/NETWORK REMOVE 

If you’d like to execute a command when logging on, like identifying to your nick, use -autosendcmd:

/NETWORK ADD -autosendcmd "/nickserv identify  ;wait -DALnet 2000" DALnet

The command above automatically sends the identify-command to Nickserv when you log on. The -wait 2000 tells irssi to wait two seconds after having logged on to the server before sending the command.

Now that we’ve added a network, we need servers to go along with it. The command to do so is:

/SERVER ADD -network DALnet powertech.no.eu.dal.net 6667

If you’d like to automatically connect to this server when you start irssi, simply add an -auto right after ADD. Specifying the port is optional.

So, first network, then server, now for a channel:

/CHANNEL ADD -auto #linuxhjelp DALnet [password]

[password] is optional, use of it depends on if the channel you’re trying to join needs a password to be accessed.

Logging

irssi has the ability to log both away-messages and regular conversations in channels. Logging for away messages is enabled by default, but not regular logging. First, it’s possible to define what the away-log should log:

  • /SET awaylog_level MSGS HILIGHT – Defines what kind of messages to log.
  • /SET awaylog_file ~/.irssi/away.log – Defines the file the log should write to.

The easiest way of enabling logging, and not just away messages, is to execute:

/SET autolog ON

Per default irssi logs to ~/irclogs/something.log. This can be defined by:

/SET autolog_path ~/irclogs/$tag/$0.log

That is the default value. The path will automatically be created if it doesn’t exist. $0 points to the target (channel/nick). You can make irssi to automatically rotate the logs by adding a time/date stamp to the filename. You find more about the formatting used by typing man strftime in your commandline. Example:

/SET autolog_path ~/irclogs/%Y/$tag/$0.%m-%d.log

%Y for year, %m for month and %d for day.

For more information about logging have a look at:

/HELP LOG

Scripts

If you’ve used other IRC clients, you’ve probably encountered the possibility to use scripts. Scripts can be used for various things, from showing a channel what song you’re currently playing to flaunting your machine’s hardware specs. A good site for scripts is http://scripts.irssi.org.

The scripts you download should be placed in ~/.irssi/scripts/. If the folder doesn’t exist, create it yourself. Once the script is placed there, you can load it in your irssi by doing a:

/SCRIPT LOAD ~/.irssi/scripts/TheScript.pl

This is a good approach if you don’t want certain scripts to load when irssi starts. If you do however want them to load when starting irssi, create a symlink in the folder ~/.irssi/scripts/autorun, just create the folder if it doesn’t exist. symlink, what’s that? Well, it’s a special type of file that contains a reference to another file or directory in the form of an absolute or relative path. So in other words:

cd ~/
wget http://scripts.irssi.org/scripts/splitlong.pl
mkdir -p ~/.irssi/scripts/autorun
mv ~/splitlong.pl ~/.irssi/scripts
cd ~/.irssi/scripts/autorun
ln -s ../splitlong.pl

So the file is really in ~/.irssi/scripts, but you’ve made a shortcut to it from ~/.irssi/scripts/autorun. Pretty neat if you ask me.

To unload a script simply use:

/SCRIPT UNLOAD 

Minor adjustments

It’s not just what I’ve mentioned above that you can adjust and customize to your own liking. Another thing is the use of themes. You’re probably using the default blue theme that irssi comes with, which is just fine for my use, but perhaps not for you. I do however like the minor modification just for kicks.

Every time you use /SAVE, a message like this will appear in your status window:

08:38 -!- Irssi: Saved configuration to file /home/jorge/.irssi/config
08:38 -!- Irssi: Theme saved to /home/jorge/.irssi/default.theme

Settings are stored in the configuration file named config and the theme in default.theme. Both files are editable through a text editor. I’ve never really changed things manually in the config-file, but I’ve tampered with default.theme a bit, like what my own nick appears to me. Default appearance of your nick is like so:


Where YourNick is in bold white, while the inequality signs are in gray.

Open the file ~/.irssi/default.theme and find the line that says something like:

ownmsgnick = "{msgnick $0 $1-}";

Change this to:

ownmsgnick = "%R%n %|";

This will make the inequality signs turn red. Your nick will still be in white bold. But you can always change the inequality signs to something else. For instance:

ownmsgnick = "%Y(%n$0$1-%Y)%n %|";

Will make the parenthesis turn yellow. If you want to change the color of your nick, from default white to something else, find this line:

ownnick = "%W$*%n";

..and replace it with the color you want:

ownnick = "%G$*%n";

For a nice overview of colors, check out http://irssi.org/documentation/formats, and for more information about irssi, visit http://www.irssi.org/.

Fedora 13 on the Acer Aspire One

Back in the game after a while, I proudly present to you a little tale of Fedora 13 on the Acer Aspire One. Some important additions to the system are:

  • Automatic print driver installation
  • Automatic language pack installation
  • Redesigned user account tool
  • Color management to calibrate monitors and scanners
  • Experimental 3D support for NVIDIA video cards

You can check out further details at http://docs.fedoraproject.org/en-US/Fedora/13/html/Release_Notes/index.html#sect-Release_Notes-Fedora_Overview.

Time to start installing Fedora 13.

Contents

  • -

    • -
  • -
  • -

Preparing your USB-pen

Prepare your USB-pen! This time around we don’t have to download the XFCE-spin through torrents, it seems they’ve made the ISO-file available!

What we need to do is to install the Live CD to a USB-pen/drive. To do that download the ISO from here. With me having a stationary machine using Fedora 12, I’ll assume that you do as well. :D su to root and install the package livecd-tools:

yum install livecd-tools

Once the package is installed, and the iso has been downloaded, plug in your USB-pen/drive. I will also assume that your USB-pen/drive has been given the name sdb1. You can check it with the command dmesg, just look at the bottom of output if it has detected it. It should look something like this:

sd 9:0:0:0: [sdb] 1974272 512-byte logical blocks: (1.01 GB/964 MiB)
sd 9:0:0:0: [sdb] Write Protect is off
sd 9:0:0:0: [sdb] Mode Sense: 00 00 00 00
sd 9:0:0:0: [sdb] Assuming drive cache: write through
sd 9:0:0:0: [sdb] Assuming drive cache: write through
 sdb: sdb1
sd 9:0:0:0: [sdb] Assuming drive cache: write through
sd 9:0:0:0: [sdb] Attached SCSI removable disk

If your USB-pen has previously had another operating system running on it, the Master Boot Record (MBR) might already have some data on it that crashes with what we’re about to do. So to clear the MBR (excluding the partition table), you can do one of the two following things; Use the flag –reset-mbr when running livecd-iso-to-disk or using the dd command. I recommend using the first option, and if that fails, try the second one.

With your iso downloaded, execute the following command:

livecd-iso-to-disk --reset-mbr /home/jorge/downloads/Fedora-13-i686-Live-XFCE.iso /dev/sdb1

Fedora-13-i686-Live-XFCE.iso being the Live CD iso we just downloaded. This command will copy the Live CD iso to your USB-pen, making that your bootable device.

Now, if the MBR is still causing problems (like the USB-pen not booting), try the following:

Warning: This command can render your system useless, so be CAUTIOUS and sure before you use it. Make sure that /dev/sdb is in fact your USB-pen, and not some other device. You have been warned!

dd if=/dev/zero of=/dev/sdb bs=446 count=1

And run the livecd-iso-to-disk-command above again.

For more information about how to create and use a Live USB device, check out .

Installing Fedora 13

Now that the USB-pen is ready to go, reboot your Acer Aspire One, and at boot press F13 to be able to select what boot device to boot from. Your device should pop up in that list. Log in as usual, and double-click the icon that says Install to Hard Drive. Follow the process as normal, and just select Basic Storage Devices when you get to that option. When you get at the screen that asks you to check the drive you’d like to install the operating system on, check the one that says ATA (should be around 7.5GB big). If you can’t uncheck your USB-device, don’t worry.

When selecting what type of installation you’d like, select Use All Space, and check the box at the bottom that says Review and modify partition layout. Click Next.

Next select the Acer’s drive, and click the arrow to the right to move it to Install Target Devices, leaving the USB-device under Data Storage Devices (to be mounted only). Click Next.

We’ll be using the ext4 filesystem on our Acer Aspire One.

Now we should be in a new screen. We don’t want LVM on an SSD-disk, so we remove it.

Click on the line that says vol_MACHINENAME and click Delete. In my case it’s called vg_howl, since I named my machine howl.

Now click on the line that says /dev/sda2 and click Edit. Change the File System Type to ext4 and then change the Mount Point to /. Make sure that you have checked the box sda (and ONLY sda) in Allowable Drives and selected Fill to maximum allowable size. When done, press OK, and then click Next. A question will pop up, telling you that you haven’t selected a swap partition, and if you still want to continue with this partitioning scheme. Select Yes, and then select Write changes to disk. When a question about a boot loader comes up, simply press Next.

When the formatting and installation is done, you can reboot your Acer, answer a few questions, and your system should be up and going.

Disabling SELinux

Things haven’t changed, SELinux will haunt us forever.

Once you’re in the system, press Alt-F2, type terminal, su to root, and edit the file /etc/selinux/config and set the variable SELINUX to disabled. Save and close the file.

Optimizing Fedora 13

I assume that by now you are actually using the Fedora 13 installation. Here’s how to improve the system performance a bit.

Optimizing your disk

Quoting the Ubuntu wikipages:

Frequent writes to the SSD will cause failure eventually. We can reduce the number of writes to the SSD by moving our logs to a temporary filesystem in RAM that gets destroyed at ever reboot. Now this means your logs will not be persistent across reboots making debugging difficult in some cases. This step is optional of course, so if you need the logs for an extended period of time do not follow these steps.

Let’s assume that you want to do this. su to root, and open up the file /etc/fstab, and place these following lines there:

tmpfs      /var/log        tmpfs        defaults           0    0
tmpfs      /tmp            tmpfs        defaults           0    0
tmpfs      /var/tmp        tmpfs        defaults           0    0

Also, modify the first line in /etc/fstab to include the options noatime and nodiratime. When done, your /etc/fstab should look something like this:

UUID=0dbcdea1-3f91-477a-b730-ea6033c45b5c /                       ext4    defaults,noatime,nodiratime        1 1
UUID=6f651dc4-3d50-4a28-b3d0-fc91b41f737c /boot                   ext4    defaults,noatime,nodiratime        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  defaults        0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
tmpfs      /var/log        tmpfs        defaults           0    0
tmpfs      /tmp            tmpfs        defaults           0    0
tmpfs      /var/tmp        tmpfs        defaults           0    0

Save the file, and close it. The next thing we can do is to place the following into your /etc/sysctl.conf-file:

# Economize the SSD
# Strongly discourage swapping (default 60)
vm.swappiness = 1

# Don't shrink the inode cache aggressively (default 100)
vm.vfs_cache_pressure = 50

# (default 499)
vm.dirty_writeback_centisecs = 1500

# (default 10)
vm.dirty_ratio = 20

# (default 5)
vm.dirty_background_ratio = 10

# (default 0)
vm.laptop_mode = 5

..and this to your /etc/rc.d/rc.local:

# As in the rc.last.ctrl of Linpus
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo ondemand > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
cat /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate_max > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate

echo 1 > /sys/devices/system/cpu/sched_smt_power_savings
echo 10 > /sys/module/snd_hda_intel/parameters/power_save

#Decrease power usage of USB while idle
[ -w /sys/bus/usb/devices/1-5/power/level ] && echo auto > /sys/bus/usb/devices/1-5/power/level
[ -w /sys/bus/usb/devices/5-5/power/level ] && echo auto > /sys/bus/usb/devices/5-5/power/level

Open up the file /boot/grub/grub.conf and add elevator=noop to the kernel-line, making this:

kernel /vmlinuz-2.6.31.6-145.fc12.i686 ro root=UUID=0dbcdea1-3f91-477a-b730-ea6033c45b5c noiswmd LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=no rhgb quiet

Look like this:

kernel /vmlinuz-2.6.31.5-127.fc12.i686 ro root=UUID=0dbcdea1-3f91-477a-b730-ea6033c45b5c noiswmd LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=no rhgb quiet elevator=noop

Proceed with rebooting your machine, and everything should be working fine. :)

Removing journaling

Another thing you can do to increase the speed of your disk is disabling journaling of the ext4 filesystem. I sure hope you have your USB-pen/drive in hand, because we’re going to need it. Reboot your machine, with your USB-thingie plugged in, and again press F12 at boot, selecting your USB-device as the boot device. When done booting to the Live CD, press Alt-F2 and type terminal, and su to root. Find out what the partition with Linux is named. If you’ve partitioned things according to this guide, it should be /dev/sdb2. It’s basically the partition that holds the root of your Linux.

What we first need to do is to edit the file /etc/fstab on your disk. Why? Some tools have yet to catch up. In particular, the version of e2fsprogs currently in Fedora 13 won’t read the UUIDs from such filesystems. And because the Fedora installer generates an /etc/fstab which identifies filesystems by UUID, if you just run the tune2fs-command we’ll be using, the system can’t find its root filesystem and so doesn’t get very far through the boot process.

So, in order to edit the /etc/fstab-file, we first mount up the partition /dev/sda2. So remember, Fedora 13 is now installed, but you boot on the LiveCD/LiveUSB, and have a terminal up and going. As root, execute the following commands:

mkdir /mnt/disk
mount /dev/sda2 /mnt/disk
mount /dev/sda1 /mnt/disk/boot
cd /mnt/disk/etc

Now open up the file named fstab. The two lines that currently look like this:

UUID=6f651dc4-3d50-4a28-b3d0-fc91b41f737c /                   ext4    defaults,noatime,nodiratime        1 1
UUID=0dbcdea1-3f91-477a-b730-ea6033c45b5c /boot                       ext4    defaults,noatime,nodiratime        1 2

Should look like this:

/dev/sda2 /                   ext4    defaults,noatime,nodiratime        1 1
/dev/sda1 /boot            ext4    defaults,noatime,nodiratime        1 2

We simply replaced the UUID-strings with the partitions /dev/sda2 and /dev/sda1. Once you’ve edited the file, save it, and close it.

Now we need to update /boot/grub/grub.conf.

Execute this command:

cd /mnt/disk/boot/grub/

And open up the file grub.conf. What used to look like this:

kernel /vmlinuz-2.6.33.3-85.fc13.i686 ro root=UUID=0dbcdea1-3f91-477a-b730-ea6033c45b5c noiswmd LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=no rhgb quiet elevator=noop

Should now look like this:

kernel /vmlinuz-2.6.33.3-85.fc13.i686 ro root=/dev/sda2 noiswmd LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=no rhgb quiet elevator=noop

Save the file, close it, and unmount the partitions like this:

cd ~/
umount /mnt/disk/boot/
umount /mnt/disk/

Now that they both are unmounted, all we have to do is run the tune2fs-command to disable journaling from the ext4-partition:

tune2fs -O ^has_journal /dev/sda2

Reboot your machine, and you should now have an ext4 filesystem with journaling disabled.

Now should be the time to update all of your packages before proceeding. So when you are logged back into your system again, open up a terminal, su to root, and do a:

yum update

Brace yourself, this might take a while. :)

Optimizing Firefox

There are quite a few ways to make your Firefox go faster, one of them being to disable caching completely. Try these out, and let me know how they work. In your Firefox, type about:config as your URL, and press enter. Search for these values, and change them to what I’ve written up here:

Select all text when click on the URL bar

In Windows and Mac, Firefox highlights all text when you click on the URL bar. In Linux, it does not select all the text. Instead, it places the cursor at the insertion point. Regardless which platform you are using, you can now tweak it to either select all or place cursor at insertion point.

  • browser.urlbar.clickSelectsAll: true
Caching

When a page is loaded, Firefox will cache it into the hard disk so that it doesn’t need to be download again for redisplaying. The bigger the storage size you cater for Firefox, the more pages it can cache.

  • browser.cache.disk.enable: false

false disabled caching completely, true enables it. If you want to modify the amount of cache used (instead of disabling it), have a look at browser.cache.disk.capacity.

Network

Config name: network.http.pipelining Default: False Modified value: True

Config name: network.http.proxy.pipelining Default: False Modified value: True

Config name: network.http.pipelining.maxrequests Default: 4 Modified value: any value higher than 4, but not more than 8

Config name: network.http.max-connections Default: 30 Modified value: 96

Config name: network.http.max-connections-per-server Default: 15 Modified value: 32

Enabling auto-login

As of Fedora 13, enabling automatic login on XFCE is a LOT easier. First, we need to have the packages accountsdialog and accountsservice installed. So execute the following command as root:

yum -y install accountsdialog accountsservice

Once the packages are installed, press Alt-F2 to get the run-dialog, and enter accounts-dialog.

You will get up a little box with your current user listed. Click on the shield-icon to the bottom left to allow changes to details. Enter your root-password, and proceed to click Login Options.

Now you have a new box up. Click on the shield again, enter the root-password again, and select the user you want to automatically log in as under Automatic login.

That is pretty much it. Exit the program, reboot, and you should be able to log in automatically as the user you specified. :)

That is one method you can use. The other one is as follows.

First, a huge thanks to the user mjc for this great tip which allows you to enable auto-login as well!

Edit the file /etc/gdm/custom.conf to make it look something like:

[daemon]
TimedLoginEnable=true
AutomaticLoginEnable=true
AutomaticLogin=jorge
TimedLogin=jorge
TimedLoginDelay=0

Replacing jorge with the username you want to automatically log in as. When done, save and exit the file.

Now you have to remove the keyring password. Yes, that does mean that your keys and passwords will be unprotected.

To change/remove the keyring password:

  1. Open Passwords and Encryption Keys in Accessories
  2. Go to the Passwords-tab
  3. Right-click the Passwords:login-keyring and select Change Password.

Enter in your password in the top field and leave the new password fields (Password and Confirm password) empty to remove the keyring password. Click Change. Reboot your machine and you should log in automatically!

Thanks again mjc!

Ways to extend your battery life

There are several things you can do to extend the battery life on your Acer Aspire One.

  • Turn the screen brightness down – your screen is the most power-intensive component in your laptop, and why turn the brightness all the way up if you already can see well enough?
  • When not in use, turn of the wireless and bluetooth functions.
  • If you have enough memory on your laptop, disable swapping (we’ve done it in this case). I would suggest putting in more memory, as swapping writes to virtual memory.
  • Journaling-filesystem on a SSD-disk = baaad. More writing to disk means more power used. In this howto we’re using ext4 without journaling, but just wanted to remind you. :)
  • Disable all services that aren’t used. A lot of distributions come with say httpd enabled at start up. If you don’t need it, get rid of it.
  • When you’re in no need of sound – mute it!

Jason Farrel has these following tips to apply as well:

  • Use powertop to eliminate more power hogs.
  • If using mplayer to play video, and you see nasty horizontal tearing, it’s because the fast overlay isn’t being used by default. Edit ~/.mplayer/config and gui.conf to use vo=xv:port=XX where XX is the port returned from the xvinfo util for the overlay adaptor – this should be 79.
  • To cut the bootup time almost in half (down to 25 seconds here), disable uneeded services. Here’s a bit of code to disable the services (run it as root): for s in atd auditd avahi-daemon bluetooth cups ip6tables \ mdmonitor sendmail livesys livesys-late; \ do echo “chkconfig $s off”; chkconfig $s off; done
  • This one makes a big difference: don’t forget to disable Firefox’s disk cache or you’ll grind to death.

Thanks for the tips Jason (from the Fedora 10 post). :)

Now this next bit is VERY important, if you want your Acer Aspire One to perform as best as it can. Keep in mind that this applied to Fedora 11, and applies to Fedora 12 as well as Fedora 13:

I installed FC10 like you described. It works fine. I was a bit surprised the AAO appeared rather slow compared to my EEE 1000H. So I ran cat /proc/cpuinfo. It appeared the CPU ran at 800 Mhz. I first looked at the BIOS, but the CPU ran at 1600 Mhz over there. Then I looked at services and found cpuspeed running. This is for scaling the CPU speed. After disabling this service the cat /proc/cpuinfo reported 1600 Mhz CPU speed and the system runs much smoother (and most probably consumes more power!).

So start/stop the service:

service cpuspeed [start|stop]

Throw in a:

chkconfig cpuspeed [on|off]

To disable the service at boot-time.

Thanks to Jaap (from the Fedora 10 post) for the tip. :)

Minor troubleshooting

Make the sound work properly

When checking the initial volume-settings, you’ll notice that you can hear a little bit of sound, but not much, even if you’ve cranked up the volume to the max. Thing is, we need to specify a little something, just a line really, to make it work properly. Create a file named /etc/modprobe.d/sound.conf with the following in it:

options snd-hda-intel model=acer-aspire

Thanks to Bruno Malone (from the Fedora 10 post) for the tip. :)

In my case, I’ve removed pulseaudio because I tend to play movies over NFS quite a bit, and pulseaudio always makes the sound turn choppy. So after having executed a:

yum remove pulseaudio

I add a volume-icon on my taskbar by right-clicking on it, selecting Add New Items.. and adding the application Mixer.

Reboot, and your sound should be working perfectly fine, even after you’ve resumed from suspend. :)

Why is everything so big?

This is easily fixed. Press the tiny Fedora-icon on your menu, and go to Preferences, Appearance, go to the tab Fonts and click the Custom DPI Setting, and type 80. Done!

Double tap and scrolling doesn’t work on my Touchpad!

Quoting :

Beginning with Fedora 13, the X server uses udev instead of HAL for input device detection and xorg.conf InputClass configuration. Thus, any HAL-specific configuration is deprecated and users with custom configurations in fdi files need to change these configurations to conform to the new format.

This means that the HAL-configuration we used in Fedora 12 no longer applies for Fedora 13. Instead we have to create configuration-files in /etc/X11/xorg.conf.d/. Go to that directory, create a file named 01-system-setup-mouse.conf, and place the following in it:

# Enables tapping on the Acer Aspire One

Section "InputClass"
       Identifier "tap-by-default"
       MatchIsTouchpad "on"
       Option "TapButton1" "1"
EndSection

Save the file, reboot, and the tapping should be working. :)

Making suspend work when closing the lid

It seems that XFCE 4.6 comes with a native Suspend and Hibernate function, so this should work out of the box! Unfortunately, it doesn’t quite. Suspend works great, but I haven’t had success with Hibernate, yet. And thanks to EasyTarget, who commented on this post, I finally know why. Quoting EasyTarget:

Jorge, I think the reason your Hibernate fails is that the Swap has been removed (for good reasons, I don’t have swap on my A110 either).. IIRC linux uses the swapfile for it’s hibernate functions, and not having a swapfile (or not having enough free space on the swap for your system ram+currently swapped data!) causes this to fail. Strangely this means you need a Huge swapfile to reliably hibernate your system.. I think it’s simply a no-go for SSD based systems at the moment. https://lists.linux-foundation.org/pipermail/linux-pm/2007-July/013971.html You might also be interested in.. http://wiki.debian.org/Hibernation/Hibernate_Without_Swap_Partition

Thanks for the information. :)

To enable suspend upon closing the lid, go to the XFCE-menu, Preferences -> XFCE 4 Power Manager -> On AC, and select Suspend on When the laptop lid is closed.

Other tips and tricks

Here are a few other minor tips and tricks.

Enabling the rpmfusion-repository

Easily done. su to root, and execute the following command:

rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

And that’s it! Search for a package by executing:

yum search 
Disabling yum-presto

The presto plugin for yum adds support for downloading deltarpms and using them to generate new packages. If user enables this plugin, it will make a substantial dent in the amount of data having to be downloaded for updates. In other words, normally if you need to upgrade a package, yum will remove the complete package, and download the complete new package, even if a lot of the content is just the same. By enabling yum-presto it will only download the difference between those packages, making it faster and goes easier on the bandwidth by up to 80%, in some cases. The downside to this is that the disk has to work a LOT, which means a lot of write operations, which again means that SSD is not the best thing to have. I personally disable the plugin, and would recommend you to do it as well if you have a good internet connection. Do it by executing the following command as root:

yum remove yum-presto

And you’re set.

Installing Flash

As always, we need Flash for our browser. Thing is though, there’s an Adobe-repository we can use. If someone is bound to release a new version of Flash first, it’s them. So do the following as root:

rpm -Uvh http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm
yum -y install flash-plugin

That’s it. Restart your browser, and you should now have Flash enabled.

Final words

Tada! That’s pretty much it. If you have any comments or suggestions to this post, feel free to post a comment, I’ll look it over! Good luck enjoying Fedora 13 with your Acer Aspire One!

And once again, we can’t end this post without a screenshot of Fedora 13, and my always-charming smile. ;)

Rapidshare Linux script

Update: Seems this procedure isn’t working anymore, as Rapidshare has switched some things around. Have a look at Rapidshare Linux Script Revisited for updated information.

A friend tipped me about Rapidshare, and has been working great ever since I bought a premium account. Thing is though, most addons/download clients are specifically for Windows, and I use Fedora Linux. I searched quite a while before I found an option that makes downloading through a Rapidshare Premium Account damn simple; namely making a script. And it’s really easy!

What we first need to do is to grab and save your Rapidshare cookie. This is luckily something you only need to do once. Execute the following command to do so:

wget --save-cookies /home/jorge/.cookies/rapidshare --post-data "login=USERNAME&password=PASSWORD" -O - https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi > /dev/null

..replacing USERNAME and PASSWORD with your Rapidshare account details, and /home/jorge with whatever suits you.

Once that is done, we proceed with the script itself. Now, most pages will recommend using wget for this, but I personally prefer aria2. This is because aria2 supports multiple files download and it also splits each file in multiple parts for faster downloading. Moreover you can resume the download any time you want just by typing the same command again.

Either way I will paste two scripts, one with wget and the other one with aria2, and you can then make your pick.

wget

#!/bin/bash
LIST="/home/jorge/Downloads/.url"
cd ~/Downloads
for url in `cat $LIST`
do
    wget -c --load-cookies /home/jorge/.cookies/rapidshare $url
done

Save this file as wrsd.sh and make it executable by doing a:

chmod +x wrsd.sh

aria2

#!/bin/bash
cd ~/Downloads
aria2c -j 5 -c --load-cookies=/home/jorge/.cookies/rapidshare -i /home/jorge/Downloads/.url

Save this as arsd.sh and make it executable just like above. Now the file containing the various URLs to download is in my case located in the file ~/Downloads/.url. One URL in each line should do the trick. Open the file, paste a few URLs, save and close it, and run either wrsd.sh or arsd.sh, depending on if you want to use wget or aria2.

Enjoy!

Firefox 3.6 and Java on Linux

Finding that you’re lacking Java in Firefox 3.6 on Linux? The steps to install it are easy, but you have to do things a bit differently than you have in previous Firefox-versions.

First head over to the Download-section at http://www.java.com. Select to download the file named Linux RPM (self-extracting file) (if you’re using an RPM-based distribution like Fedora). Once it’s downloaded, and assuming it has been downloaded to the folder Downloads, do the following:

su -
chmod +x /home/jorge/Downloads/jre-6u18-linux-i586-rpm.bin
/home/jorge/Downloads/jre-6u18-linux-i586-rpm.bin

After agreeing to the license terms, just type Yes and press enter. Now making the plugin work with Firefox. I mentioned earlier that you have to do things a bit differently. Whereas we used the file libjavaplugin.so before, now we have to use the next generation Java plugin, namely libnpjp2.so. So execute the following command to make things work:

ln -s /usr/java/latest/lib/i386/libnpjp2.so /usr/lib/mozilla/plugins/

Restart your browser, and you should have Java. Verify it at http://java.com/en/download/installed.jsp?detect=jre&try;=1.

Enjoy!

Firefox 3.6 on Fedora 12

Easy peasy:

yum --enablerepo=rawhide install firefox

And that should upgrade Firefox for the newest available in the repositories.

Rhythmbox equalizer revisited

June 30th 2009 I wrote about an equalizer-plugin for Rhythmbox which then was just about the only decent thing available. It now seems that that plugin isn’t being worked on anymore. Luckily we have people like Christopher Kruse from . :) He has now released version 1.3 of his Rhythmbox equalizer-plugin, which you can find at .

The installation:

wget http://rbeq.googlecode.com/files/rbeq-1.3.tar.gz
tar -zxvf rbeq-1.3.tar.gz -C ~/.gnome2/

Head on over to for the main post. Thanks Christopher!

And of course, a screenshot of the plugin:

rbeq