Posts Tagged ‘Linux’

s2ram configuration with plasmoid battery monitor

March 23rd, 2009 Comments off

Some time ago I have writen a post about configuration of s2ram with kpowersave … now I faced the same problem with KDE4 plasmoid battery monitor, but with a bit different solution, in the file /usr/lib/pm-utils/defaults just update the line:


That should be enough to get You laptop/PC sleep without any plays with s2ram params.

why I chose openSuSE again and howto make updates faster

March 22nd, 2009 Comments off

Today I have tried few distros for my Wife laptop as replacement for Vist.

My first choice was gOS 3.1, screen-shots were very nice, but old kernel prevented it from booting on laptop, after few hours of googling and trying many tricks it still did not booted.

Next was SimpleMEPHIS 8.0, shown it as one of the distros for beginners, so i gave it a try, and I was quite surprised, everything worked fine, I was able to boot, install the os, wifi configuration took only few seconds, but after some time, it got some kernel panic, during next boot it got next kernel panic, it was enough.

Then I have gave a try to Kubuntu as recently I have possibility to play with another laptop with Kubuntu on board, but unfortunately it got the same issue as gOS – I was not surprised as both are Ubuntu based.

After this failures last try was with Knopix which recently got new release 6. Unfortuantelly it did not allowed me to work without swap, and I do not need it on machine with 1GB of RAM, so I droped it.

At the end I have returned to one of distros that I like because of its great management tools – openSuSE, setup was quite fast. There are problems with suse download site, but I already knew about nice trick which switches all the repos to quite fast mirror – from the root command line run:

zypper lr --uri | awk -F"|" '/http:\/\/download\.opensuse\.org\// {print $2}' | while read repo; do sed -i 's/\/pub\/opensuse/' /etc/zypp/repos.d/$repo.repo; done

This allowed very fast update of the system, it started to work during update time, which made me quite surprised.

Thats all for this tonight, time to get some sleep as soon is geting up shortly.

Categories: Linux Tags: , , ,

Linux did 1234567890 seconds past 1970′

February 14th, 2009 Comments off

That’s not so important for our development and live,  but as always interesting dates get our attention, todays date will have interesting representation as seconds since start of 1970 year.

1234567890, that showed to me when I have entered the following command and waited a while before  2009-02-14 00:20

while [ $((1234567890 – $(date +%s))) -ge 0 ]; do sleep 1s; clear; date +%s; done

Of course You need to know that Linux is counting time as seconds since begun of year 1970.

Thanks to polish linux blip community for remembering me this very important fact.

Quick update from polish rails blip community, the date for ruby was the same when converting to integer:


Good to hear that not only Linux is affected by this issue.

Categories: Linux Tags: , , ,

Preparing Ruby on Rails environment – using apache for development

February 6th, 2009 Comments off

In previous post we have created first rails application, it was tested using WEBrick which is part of rails environment. To have environment more similar to server environment and to get rid of keeping track of started projects we will switch to running applications with apache and passenger. There are some benefits of this configuration:

  1. Possibility to run all applications with only one server,
  2. Easy to share applications on local network or even to Internet,
  3. Fast detection of problems with compatibility to passenger,
  4. There are probably more benefits, If You know them leave me a comment.

So lets start with configuration, on beginning turn off apache:

/etc/init.d/apache2 stop

As a central point of configuration we will use ~/public in my case it is /home/mpapis/public, we need to create this directory:

mkdir /home/mpapis/public

Configure Your /etc/hosts to have some meaningful name for running it in the browser, so edit /etc/hosts and modify Your localhost line to look similar to this one (added rails):       localhost  rails

We need to configure apache to respond to our requests, first remove or backup default vhost configuration:

cd /etc/apache2/vhosts.d

mv 00_default_vhost.conf 00_default_vhost.conf.old

After getting rid of default configuration we can edit apache/passenger configuration file created in one of previous posts /etc/apache2/vhosts.d/01_passenger.conf:

LoadModule passenger_module /usr/lib64/ruby/gems/1.8/gems/passenger-2.0.6/ext/apache2/
PassengerRoot /usr/lib64/ruby/gems/1.8/gems/passenger-2.0.6
PassengerRuby /usr/bin/ruby18

UseCanonicalName Off
DocumentRoot /home/mpapis/public
ServerName rails
ServerAlias localhost
RailsEnv development
Include /home/mpapis/public/paths.conf
<Directory “/home/mpapis/NetBeansProjects”>
Options -Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
<Directory “/home/mpapis/public”>
Options -Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all

One of the lines defines that we will use /home/mpapis/public/paths.conf as part of the configuration, and this is the contents of this file:

RailsBaseURI /RailsApplication1

As we pointed /home/mpapis/public in previous file as document root and /RailsApplication1 as path of our application we need to create symbolic link to our application:

ln -s /home/mpapis/NetBeansProjects/RailsApplication1/public/ /home/mpapis/public/RailsApplication1

Last step is to notify our application that it will no more run from the / path, so we add the following entry to /home/mpapis/NetBeansProjects/RailsApplication1/config/environments/development.rb:

config.action_controller.relative_url_root = “/RailsApplication1”

That’s all, we can start appache now:

/etc/init.d/apache2 start

And if it is desired add it to autostart (to have our applications available just after system boot):

rc-update add apache2 default

Finally we can check work of our application by navigating in web browser window to the following path:


Looks pretty nice, in next step we will need to automate this a bit to avoid manual work each new project:

Rails try to follow DRY which stands for “don’t repeat yourself”.

Categories: Development, Linux Tags: , , , ,

Why You should use “cd .”

January 29th, 2009 Comments off

Lately more and more I catch myself on entering

cd .

This is needed if You have open Yours console on a path that changes via linking or mounting, using “cd .” allows very fast switch to the new location that You should be using.

Categories: Linux Tags: , ,