Tuesday, October 17, 2006

How to verify the root user id on SUN?

If you program sometimes on Sun Solaris, you have probably noticed that the syntax is not always the same as the one of Linux, or HP-Unix... This time, before running my script I had to verify that it is root, who runs the script: after 30 minutes of headhache, I finally find a way: enjoy the aspirin

WHO=`id | cut -f1 -d" "`
if [ ! "$WHO" = "uid=0(root)" ]


echo "You must be super-user to run this script."

exit 1


How to get rid of output of your scripts?

Just add at the end of your command line: >/dev/null 2>&1 so you redirect fd1 to /dev/null, then dump it onto fd2:

Normally: fd1 -> stdout fd2 -> stderr

>/dev/null: fd1 -> /dev/null fd2 -> stdout

2>&1: fd1 -> /dev/null fd2 -> /dev/null

Now no more output, it is very interessant espscially for cronjob.

Monday, October 09, 2006

Google Calendar && Kontact

I only start to fill my Calendar by Google, but I have also my calendar on my portable with Kontact... The question which often arises in these cases, how to share information between the two (except if you are schizophrenic...) how to synchronize the two calendars??? Mr. Google once again thought to everything: it is simple: settings > calendars > share this calendar > calendar details.... There you will see small squares of color XML, iCal, HTML on the line private addresse. Select iCal and copy the address which is kindly given to you by Google. Now on Kontact: File > Import > Import Calendar... At this time there, instead of seeking on your computer a file, enter the address given by M.Google answer two or three questions... that is it. You finally could be more effective in your work, to optimize your life; -)

Sunday, October 08, 2006

Linux:: AmaroK

In the inuits legends, Amarok is the giant wolf which devours the imprudent hunters, who hunt alone the night. In the world of computers, Amarok is the application which could too devour the imprudent users of Windows which use the old old old Itunes... Amarok is an application of the free world which works exclusively under Linux or Unix.
AmaroK allows inter alia:
  • to manage advanced playlists
  • to develop new functionalities via scripts
  • to record statistical data of a song even if this one is renamed or moved
  • to use K3B (burning software for Kde) for the CD engraving
  • to use the data bases to store information of music
  • to use your iPod
  • to manually configure a generic reader with key format USB
  • to benefit from the crossfading
  • to use MusicBrainz to recover informations on your music
  • to recover the words of the songs
  • to recover the covers of albums on the Amazon site
  • to recover on Wikip├ędia the articles on the album, the artist or the song in the course of listening
  • to manage the support of radio operator flows of last.fm

Unfortunately for the users of Windows, Amarok will never be carried under Windows because of:
  • its licence LPG
  • KDE-libs (which it uses)
  • need somebody to do it...