My Suse

What I have learn so far about Linux and Suse

Thursday, November 16, 2006

How to backup with rsync to a remote computer

Setup ssh without password:
  • Create a rsa key

  • Publish public key on remote server

  • Add key to authorized_keys

  • Test connection without password

Example how to backp the folder Documents, in the user's home to a server with loging 'edu'
rsync -auzv --delete-excluded ~/Documents edu@server:/home/edu/bkp

Tuesday, October 17, 2006

Learn how to open all ebooks of one subject at same time

You'll learn:
  • how to run async commands
  • how to find and open several documents at same time
Let's supose that you are studying Python, and you want to open all of your ebooks about python, here's the first ideia of how to do it:

find . -iname "*python*.pdf" -exec xpdf {} \& \;

But, as you can verify it will open all the documents but only one at time. So here's the complete solution:

find . -iname "*python*.pdf" -print0 | xargs -0 -i bash -c "xpdf \"{}\" &"

If you're playing with xargs try use it with -p to see what it is doing.

You could be asking "Why not just something like xpdf *.pdf?". Well, there are viewers that doesn't support multiple file arguments. It only opens one file at time, like the kchmviewer:

find . -iname "*python*.chm" -print0 | xargs -0 -i bash -c "kchmviewer \"{}\" &"

Saturday, September 16, 2006

How to save the name of the music that is playing in amaroK


Here's a bash script that reads and saves (appends) the title of current music to a file in the Desktop, this is useful if you're listenning to a radio and want to save the title for later downloading.

#!/bin/bash

dcop amarok player title >> ~/Desktop/musicas.txt


Save the file as ~/bin/savemusic and then chmod +x ~/bin/savemusic
After that, just run savemusic or create a icon in startmenu or set a keyboard command to call it.

Friday, July 21, 2006

How to build Sabbu in Linux

I'm writting this post becouse I had a few 'difficulties' trying to build the sabbu 0.3.0 in linux.

I'm not an expert in Linux, but I knew that it isn't easy to find the solution in the web. And please, you're welcome to comment or writte betters solutions. Here it goes.

1. My first error: missing gthread


edu@nami:~/programas/media/subtitle/sabbu3/sabbu-0.3.0> ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
(...)
checking for GTK+ - version >= 2.0.0... yes (version 2.8.10)
checking for pkg-config... (cached) /usr/bin/pkg-config
checking for GTK+ - version >= 2.6.0... yes (version 2.8.10)
checking for g_thread_init in -lgthread-2.0... no
configure: error: gthread is required to build sabbu.

The solution:


export LDFLAGS="-L/opt/gnome/lib64 -L/opt/gnome/lib -L/lib64 -L/usr/lib64"
./configure

2. Second error: ffmpeg


checking for GTK+ - version >= 2.6.0... yes (version 2.8.10)
checking for g_thread_init in -lgthread-2.0... yes
checking for avcodec_open in -lavcodec... no
configure: error: ffmpeg >= 0.4.9-pre1 is required for video features. You may specify --without-ffmpeg to disable video features.

Solution.


Even I having it installed I don't know how to build with it:
edu@nami:~/dvds/albuns-da-memoria/Legendas> rpm -q ffmpeg
ffmpeg-0.4.9-6.pm.svn20060701

But a ./configure --without-ffmpeg will pass without it.

3. The last error: libsndfile


checking for GTK+ - version >= 2.6.0... yes (version 2.8.10)
checking for g_thread_init in -lgthread-2.0... yes
checking whether the second parameter to iconv() must be const... no
checking for sf_open in -lsndfile... no

Solution


Again, I had the libsndfile installed:

edu@nami:~/programas/media/subtitle/sabbu3/sabbu-0.3.0> rpm -q libsndfile
libsndfile-1.0.12-13

But the error remained. So I downloaded the libsndfile. And ./configure and make install it. After that I was able to compile and install sabbu:
./configure --without-ffmpeg
make
su
make install
exit
sabbu


Tip: if you are running it in other language other then english, and the ALT_KEY + Underlined Menu Letter is replacing the defaults keyboard shutcut, you can execute it in english.
export LANG="en_US-UFT-8"
sabbu


I hope you enjoyed this post. Feel free to comment it.

Friday, March 03, 2006

How to create an ISO file from a cd-rom

dd if=/dev/hdc of=~/cd1.iso

This command will copy the cd (/dev/hdc) can be other for you, to a file cd1.iso in the user home directory.