Orpheus Abspielprobleme

Posted on 10. Mai 2010 Comments

Kurz nachdem ich dachte, dass ich einen richtig coolen Mp3player für die commandline gefunden habe, hat orpheus rumgesponnen und nach einem fertig gespielten Lied alle anderen für ca. 1-2 Sekunden angespielt und ist dann weiter gesprungen bis zu Ende der Playlist.

Ich hab ein bisschen rumprobiert und mir nachher über

sudo apt-get install mpg321

ein alternatives Backend geholt. Was ich nun also probiert habe, ist dergleiche Befehl, nur mit mpg321 statt mpg123:

mpg321 -R -

spielt orpheus wie gewünscht alle Files der Playlist schön hintereinander ab, warum auch immer, aber es funktioniert:)

Cool things to do with ssh and Linux

Posted on 10. Mai 2010 Comments

Ich habe mich in den letzten paar Tagen mal mit SSH auseinandergesetzt und folgende „Projekte“ sind entstanden:

1. Webcamübertragung

2. VNC, also Remote Desktop Steuerung

3. Steuerung von mp3playern/Musik generell

1. Wie schon im anderen Artikel beschrieben, nutzt man hier das /dev/videoX – Device, welches – im Normalfall – eine Webcam enthalten sollte. Drauf achten, dass es nicht z.B. TV-Karte ist. Einige Tips zum Einrichten der Webcam gibt es hier

Um nicht potentiell seinen Webcam Stream anderen zugänglich zu machen, kann man also einen SSH Tunnel nutzen. Dazu muss zum WebcamPC mit einem Client mit folgendem Befehl ein Tunnel erstellt werden:

ssh -L 9091:localhost:9091 user@host

Natürlich kann man hier jeden beliebigen Port nehmen. Wenn man schonmal über SSH verbunden ist, kann man hier auch gleich den VLC Stream starten:

vlc v4l2:// :v4l2-dev=/dev/video0 :v4l2-adev=/dev/dsp :v4l2-standard=0 :sout="#transcode{vcodec=mp4v,vb=640,scale=0.9,acodec=mpga,ab=128, channels=2}:duplicate{dst=std{access=http,mux=ts,dst=localhost:9091}}"

Dieser ganze Kram gibt einen VCL Stream mit dem V4L2Framework aus und zwar mit der Ausflösung 640 und einer grösse von 0.9. Guckt euch die VLC Seite zu Streaming an:

Jetzt braucht man nur noch einen geeigneten Client um das alles anzugucken…wie wärs mit VLC? Also:

vlc http://localhost:9091

Fertig ist der Stream:) Das hab ich mir natürlich nicht komplett alleine zusammengebastelt also danke an Ben von MoBlog.

Wenn es hier Probleme mit der Webcam gibt, guckt doch einfach mal einen Beitrag tiefer😉

2. Ok, selbes Spiel hier, nehmen wir mal den Port 5900 für VNC, also Tunnel erstellen:

ssh -L 5900:localhost:5900 user@host

Selbes Spiel, jetzt sind wir schonmal da, starten wir doch x0vncserver(evtl über -PasswordFile ein Passwort angeben, lässt sich mit vncserver anlegen). Dann nur noch mit einem VNC Client auf localhost:0 connecten und das wars schon. Alternativ kann man natürlich auch :1 oder :2 connecten, jenachdem welchen Server man startet, dazu gibt es eine gute Seite aus dem Ubuntu Wiki: http://wiki.ubuntuusers.de/VNC

3. Ok, dieser Teil hat etwas länger gedauert. Ich wollte also über SSH, z.B. über ein Android/Iphone-Handy oder über einen anderen Rechner einen vollwertigen MP3/OGG-Player haben. VLC geht natürlich wieder über eine Standard SSH Verbindung:

ssh user@host
vlc -I ncurses

Irgendwie war ich damit aber nicht so zufrieden, also hab ich mal weiter gegoogelt und habe mp3blaster und orpheus gefunden. Beide eigentlich ganz zufriedenstellend, nur ist bei mp3blaster die Funktion „Select Files“ auf F1 gelegt und das ruft im gnome-terminal nunmal die Hilfe aus-.- Das lässt sich bestimmt umstellen, aber mit orpheus war ich eigentlich ganz zufrieden, also hab ich den genommen.

Alternative: audacious2 mit audtty, da gibt es nur ein kleines Problem mit d-bus. Man muss dann ein kleines Script ausführen und wenn ich über WOL den Rechner anmache, muss ich – soweit ich das verstanden habe – am eigentlichen Rechner sitzen, und das ist nunmal nicht der Fall und nervt. Ausserdem hat es bei mir nur einmal funktioniert. Klar, hier geht auch mplayer/mpd etc.

http://www.videolan.org/doc/streaming-howto/en/streaming-howto-en.html

/dev/video0: Permission denied

Posted on 9. Mai 2010 Comments

Für alle die das auch bekommen, wenn sie mit einem Programm und User Rechten auf die Webcam zugreifen möchten, auch nachdem man tausend Sachen versucht hat, von chown user /dev/video0 bis chmod 777 /dev/video0, es hat alles nichts genützt, weil der Fehler dort garnicht lag, sondern an einer ganz anderen Datei. Alternativ geht das alles mit sudo, also Root Rechten, aber das ist ja nicht wirklich das wahre und hilft in einigen Sachen(Webcam Streaming) auch nicht weiter. Abhilft schafft

$ sudo chown user.group /dev/shm/usb-*

Jetzt kann ich endlich beruhigt schlafen:)

pam_face_authentication with Ubuntu 9.10(Karmic Koala) + GDM + Speedlink Webcam

Posted on 3. Mai 2010 Comments

There are probably several ways to install OpenCV. I decided to compile it by myself, because the .deb-package(found here) collided with lib-…something and that was definitely necessary for pam_face_authentication, though that happened on my Toshiba M10 with Lucid Lynx 10.04 and not on the Karmic Laptop.

Anyway, even if it works for you, this definitely doesn’t hurt. Download the latest version of OpenCV(2.1.0 at the time) here and follow the very same Installation Guide:

cd ~/projects/OpenCV-2.1.0
mkdir release
cd release
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_PYTHON_SUPPORT=ON ..
make
make install
export LD_LIBRARY_PATH=~/projects/OpenCV-2.1.0/release/lib:$LD_LIBRARY_PATH
sudo ldconfig

This should work without any error messages, which – of course – it didn’t. For example, I had to install libqt4-dev and qt4-make and a couple of others, just have a look at synaptic or apt-cache and try to google the error message. Also took quite a while.

Now download the source code from http://code.google.com/p/pam-face-authentication/ , my version is 0.3. Then follow the video instructions:

cd pam_face_authentication-0.3
mkdir build
cd build
cmake -D CMAKE_INSTALL_PREFIX=/usr ..
make
sudo make install

Same thing, should work perfectly fine. Try to google error messages, if you get any. On my Toshiba with Lucid I got loads of error messages, don’t know what went wrong, but the cmake command just doesn’t work. On Karmic however no problem at all.

Next thing was nearly more difficult: installing a webcam. As I posted before, my Speedlink SL-6810 worked out of the box with camorama, but somehow I couldn’t get it to work. Turns out you need sudo(root privilege) to open /dev/video0, duh!. Same thing with cheese or other programs for webcams. These programs are designed to use libv4l libraries. qt-facetrainer, the program you need to capture a couple of sets for the recognition of your face, however has to be told to use these for this specific webcam.
Try

sudo LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so qt-facetrainer

(Thanks to rohan.anil and mystercoco)

So once you got your camera working, we’ll try to implement the whole thing into GDM, which I thought is pretty complicated but is actually quite easy. Thanks again to Rohan’s Blog:
Just add this line:

auth sufficient pam_face_authentication.so enableX

to /etc/pam.d/gdm, as it is said in his blog. Works fine for Karmic, can’t say anything about Lucid.
For my webcam, you’ll also need the libv4l for login, so create a /etc/ld.so.preload and just write

/usr/lib/libv4l/v4l1compat.so

in it. This will provide GDM with any information required to login by face authentication.

That’s it. Leave comments if there are any questions:)

Weblinks

Fibonacci Folge in C

Posted on 19. April 2010 Comments

Um mal wieder wegen dem Studium ein bisschen reinzukommen (C diese Semester), hier die Fibonacci Folge in C. Das Ganze wurde eben grade mal schnell zusammengehackt, ist jetzt nicht das beste Programm, was ich je geschrieben habe. Quelltext zum Download.

/* quickly coded by repat, 19/04/2010, way too late in the evening;) */

#include <stdio.h>

int main(void)
{
	//zaehlvariable und endvariable wird deklariert (max. 4.294.967.295)
	unsigned int i,ende;

	//endvariable wird eingelesen, ob der maximale wert dann tatsächlich berechnet in unsigend long passt, ist eine andere sache.
	printf("Bitte Anzahl der zu berechnenden Zahlen eingeben: ");
	scanf("%u",&ende);
	
	//dynamisches array wird anhand der eingabe erschaffen
	unsigned long folge[ende];	
	
	//werte werden laut definition vorgegeben a.k.a. initialisieren
	folge[0]=0;
	folge[1]=1;	

	//wenn nur 0 oder 1 eingeben wurde, eine dementsprechende Meldung ausgeben, sonst anfang schonmal ausgeben.
	if (ende kleiner 2)
	{
		printf("Die vorgegebenen Werte sind %d und %d\n",0,1);
	}
	else
	{
		printf("%d, %d",0,1);
	}

	//array mit der fibonacci folge fuellen und ausgeben, letzte zahl mit einem .
	for ( i=2; i kleiner= ende ;i++)
	{
		folge[i]=folge[i-1]+folge[i-2];		

		if (i==ende)
		{
			printf(", %lu.\n",folge[i]);
		}
			
		else
		{
			printf(", %lu",folge[i]);
		}
	}
	return 0;
}
	

Wiimote Whiteboard Deutsche Untertitel

Posted on 19. April 2010 Comments

Es gibt schon einige Übersetzungen aber ich hab auf Anhieb keine Deutsche gefunden. Jetzt habe ich zwar nicht das Problem mit Englisch aber vielleicht andere und ich hatte noch keine Lust schlafen zu gehen und wollte ausserdem schon immer mal wissen wie man Untertitel schreibt:

w3.org hat Probleme mit dem Code angezeigt, deswegen hier ein Link zu youtube: Wiimote Whiteboard Deutsch

X10 Pollin Funk Fernbedienung Ubuntu

Posted on 3. April 2010 Comments

So, nach einer doch nicht einfachen Recherche, bei denen ich mir aus jedem Tutorial das passende raussuchen musste, hier mal eine eindeutige Anleitung zum Anschluss und Betrieb der Pollin (bzw. Aldi soll es die wohl auch geben, ein bisschen anders) X10 Funk Fernbedienung unter Ubuntu 9.10
Was definitiv geholfen hat war diese Anleitung(auf jeden Fall wegen der Screenshots angucken!):

lsusb gibt folgendes aus:

Bus 004 Device 006: ID 0bc7:0006 X10 Wireless Technology, Inc. Wireless Transceiver (ACPI-compliant)

Jetzt lirc installieren und in der Installation ATI/Nvidia X10 RF(userspace) auswählen.
Wie auch im anderen Tutorial erwähnt:

$ sudo rmmod ati_remote
$ sudo /etc/init.d/lirc stop

stop anstatt restart, weil man jetzt erstmal die lircd.conf erstellen muss(alte verschieben->mv Befehl):

$ sudo mv /etc/lirc/lirc.conf /etc/lirc/lirc.conf.old
$ sudo irrecord -H atilibusb /etc/lirc/lirc.conf

Da irrecords kein Zugriff auf die USB Geräte erlaubt ist, brauch man hier ein sudo davor! Mal abgesehen vom Ort(/etc). Der vorgeschlagene Befehl, das ganze ins home-Verzeichnis zu packen und dann zu verschieben, klappt zwar auch, aber auch nur mit einem sudo, also kann man die Datei ja gleich dort erstellen:)

Was bei mir anders war, als in diesem Tutorial, ist, dass die Namen nicht frei wählbar sind, man bekommt folgende Fehlermeldung. Man könnte jetzt natürlich wie vorgeschlagen –disable-namespace benutzen, das hab ich beim ersten Mal überlesen, also falls einer denselben Fehler macht…:

xxx is not in name space (use --disable-namespace to disable checks)
Use 'irrecord --list-namespace' to see a full list of valid button names
Please try again.

Genau das solle man also machen: neue Konsole auf und

$ irrecords --list-namespace

Damit man nicht alles durchscrollen muss um z.B. den passenden Namen für die Play Taste(Alle Tastennamen sind groß geschrieben) zu finden, benutzt man grep:

$ irrecords --list-namespace |grep PLAY

Man könnte natürlich auch beliebige nehmen, aber für die lircd.conf ist es später einfacher, wenn man die Tasten nach ihren Funktionen benannt hat;) Jetzt nochmal in die lircd.conf gucken und evtl. bei name etwas eintragen, dass einfacher zu behalten/tippen ist, weiss nicht mehr, was da bei mir stand. Jetzt steht da x10, das ist dann der Name der Fernbedienung, den man evtl. in der ~/.lircrc braucht. Apropos, das kommt als nächstes, s. dazu diesen Artikel.

Meine sieht z.B. folgendermaßen aus:

#Musik mit audacious
begin
prog   = irexec
button = KEY_PROG1
config = audacious2
remote = x10
repeat = 0
end
include ~/.lirc/audacious

#Runterfahren
begin
prog   = irexec
button = KEY_EXIT
config = gnome-session-save --shutdown-dialog --gui
mode   = gnome-session-save
repeat = 0
end
include ~/.lirc/gnome-session-save

#Uhrzeit
begin
prog = irexec
button = KEY_INFO
config = spktime
repeat = 0
remote = x10
end

#Globale Laustaerke
begin
prog = irexec
button = KEY_VOLUMEUP
config = amixer -q sset 'Master' 1+ unmute
repeat = 1
remote = x10
end

begin
prog = irexec
button = KEY_VOLUMEDOWN
config = amixer -q sset 'Master' 1- unmute
repeat = 1
remote = x10
end

begin
prog = irexec
button = KEY_MUTE
config = amixer -q sset 'Master' mute
repeat = 0
remote = x10
end

Jetzt brauch man noch ~/.lirc/audacious:

begin
     prog = audacious
     button = KEY_PLAY
     config = PLAY
     repeat = 0
end

begin
     prog = audacious
     button = KEY_PAUSE
     config = PAUSE
     repeat = 0
end

begin
     prog = audacious
     button = KEY_STOP
     config = STOP
     repeat = 0
end

begin
     prog = audacious
     button = KEY_NEXTSONG
     config = NEXT
     repeat = 0
end

begin
     prog = audacious
     button = KEY_PREVIOUSSONG
     config = PREV
     repeat = 0
end

~/.lirc/gnome-session-save:

begin gnome-session-save
        begin
                prog = irxevent
                button = KEY_UP
                config = Key Up CurrentWindow
        end
        begin
                prog = irxevent
                button = KEY_DOWN
                config = Key Down CurrentWindow
        end
        begin
                prog = irxevent
                button = KEY_OK
                config = Key Return CurrentWindow
        end
end gnome-session-save

und spktime, ich muss zugeben, dass ich mir den Code ein bisschen aus verschiedenen Sachen im Internet zusammengeschnippelt hab, aber es funktioniert. Für diese Funktion muss noch das Paket festival, ein Sprach-Synthesizer, installiert werden. Die Datei liegt in /usr/local/bin.

So, das wars auch eigentlich. Ich hab mir dann 2 Dateien erstellt, die startlirc und stoplirc, mit chmod +x file ausführbar gemacht und in /usr/local/bin verschoben, damit man sich die Tipparbeit bei kleinen Änderungen erspart:
/usr/local/bin/startlirc:

sudo /etc/init.d/lirc start &&
irexec -d &&
irxevent -d

/usr/local/bin/stoplirc:

sudo /etc/init.d/lirc stop

Ich benutz tilda als Drop Down Shell auf F3, und bin damit schneller als zur Maus zu greifen und ein Icon anzuklicken. Wer das gerne grafisch haben möchte kann statt sudo das graphische Pendent gksu verwenden oder das ganze im Terminal starten. Hier also der Text der als Command in die Verlinkung z.B. in der Startleiste, kommt:

gnome-terminal -e "startlirc"

Wie gesagt, es gibt zwar schon ein ganzes Tutorial, aber das hier sind halt meine Erfahrungen dazu, ein bisschen anders ist es doch:)

26C3: Dragons Everywhere in Adelaide, SA, Australia

Posted on 19. November 2009 Comments

If you are a traveler or a local in Adelaide, SA and you are interested in watching the streams(most of them in english I think) of the 26C3, the 26th Chaos Communication Congress of the German Hacker Organisation Chaos Computer Club (CCC) please contact me. We probably need a projector and definitely a good Internet connection with unlimited(!) traffic in a place that’s not too hot;)

It will take place from the 27th through to the 30th of December 2009.

update: With 2 people, this was probably the smallest Dragons Everywhere in the world, held in a (A/C) 6-Bed-Hostel Room with 39°C outside and a veeery slow WiFi Connection over the city-wide free Internode Network. Thanks to UniSA though, for …unlimited… traffic/downloads, so we could at least watch the (torrent) downloaded videos, if not the streams;)

Katherine, NT – WiFi and Internet

Posted on 8. Oktober 2009 Comments

For those of you who don’t wanna pay an ridiculous amount of money for just one hour of internet/WiFi, just go to this little arcade café on the right side of the westpac branch, WiFi(+power!) is just $3/hour. Computers are available too, just $3/0,5 hour.

I mean, it’s not for free but it’s better than $9/hour at the public(city council sponsored – wtf?!) library or the visitor centre. There is also a little café on the little street right from the library, but the owner just randomly takes days off and it is $6/hour.

Anyway, there will be a McDonalds in December which will most likely have free WiFi.

update: The Coffee Club got a free Wifi, just have a sit in the corner(pool/power plug too) and buy a drink or so. Then ask for the code; you will get a little piece of paper with username/password and the WEP-Password. The BLT is delicious btw;) You got 100MB but a guy told me that you can just ask for another one.