Friday, May 26, 2006

Radio Benji !!


Here I'll explain how to transform your mp3 directory into a web radio (on a local network at least), on a Mandriva Linux box.

We'll be using icecast, and ices0. You'll need to have a plf media configured (see easyurpmi), since ices0 streams mp3 and that's such a nasty thing, ouch. (stream oggs if you don't want this).

Installation

# So, let's start with this good old urpmi. su and then,
[root@flanders bsergean]# urpmi icecast ices0

# Here's a 2 cents tips to have a nice emacs mode for xml.
[root@flanders bsergean]# (cd /etc/ices ; ln -s ices.conf ices.xml)

# some backup just in case
[root@flanders bsergean]# cp /etc/icecast.xml /etc/icecast.xml.dist
[root@flanders bsergean]# cp /etc/ices/ices.conf /etc/ices/ices.conf.dist

# And, then, the funky part, editing config files :(
[root@flanders bsergean]# emacs /etc/icecast.xml /etc/ices/ices.conf &

We create a dummy playlist for ices.
[root@flanders bsergean]# find /perso/mp3 -name '*.mp3' > /etc/ices/playlist.txt

icecast

Some infos on this /etc/icecast.xml here

The two things I'm gonna change are (1) the source password and (2) the hostname.


changemeplease

fully.qualified.hostname.here

Then we start it.

[root@flanders bsergean]# icecast -b -c /etc/icecast.xml
Changed groupid to 304.
Changed userid to 304.

icecast will log here:
[bsergean@flanders ~]$ tail -f /var/log/icecast/error.log
[2006-05-26 11:32:31] INFO main/main Icecast 2.1.0 server started
[2006-05-26 11:32:31] INFO stats/_stats_thread stats thread started
[2006-05-26 11:32:31] INFO fserve/fserv_thread_function file serving thread started
[2006-05-26 11:32:31] INFO yp/yp_update_thread YP update thread started


ices0

For ices0, infos can be found here

But since I cannot make it using the conf file, I use the command line arguments :)

I create a playlist, in the supported m3u format, using the brute force find method:
[root@flanders bsergean]# find /perso/mp3 -name '*.mp3' > /etc/ices/playlist.txt

[root@flanders bsergean]# ices0 -n 'My Stream Name' -r -F /etc/ices/playlist.txt -h fully.qualified.hostname.here -P changemeplease
Logfile opened
Playing /perso/mp3/gnocchi/iTunes/iTunes Music/Placebo - Sleeping with ghosts/03 This Picture.mp3
Mounted on http://fully.qualified.hostname.here:8000/ices

Security

The bad thing is that ps -ef shows the command lines and also show changemeplease

Daemon

Start icecast with option -b and ices0 with option -B to detach from the terminal.

Listening

Now, go on another machine (or yours, but it's less fun :), and enter fully.qualified.hostname.her:8000 into your browser and click on listen, or enter fully.qualified.hostname.her:8000 in your favorite music client (Open Location most time), click on listen and it works !!

fat faire foutre

Ce qui se passe au niveau des filesystem en ce moment est vraiment halucinant.
GmailFS, sshfs, ZFS, GoogleFS. Et puis il y a aussi le cousin LVM qui est bien sympa aussi. Le bon vieux fat qui nique toutes les données après un reboot malencontreux sera bientôt de l'histoire ancienne, esperons le tout du moins.

Tuesday, May 23, 2006

skype ass ou ça casse

Ouais.
Bon il va falloir arrêter de vouloir mettre un jeu de mot en carton dans tous mes titres.
Juste pour dire au monde (à moi en gros, dans le vide oui bon d'accord)
qu'une alternative à skype et autres qui a l'air pas mal est dispo.
C'est marrant, on sait jamais où le mettre le lien dans une page ouaib. Tiens on va essayer un truc bien con.

The wheel

There is this slashdot post about rewriting a soft from scratch. Lots of interesting things can be found, and also this, about why you should not rewrite everything. Hard to tell :)

Monday, May 22, 2006

HP-UX package installer

I have made a small script which download an Open Source depot package from the HP-UX porting center, and install it with its dependencies. Soon available for download.

Friday, May 19, 2006

Fetch and save a remote file in python

It's that simple :)

bash-3.00$ python
Python 2.4.1 (#2, Aug 25 2005, 18:20:57)
[GCC 4.0.1 (4.0.1-2mdk for Mandriva Linux release 2006.0)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib
>>> import urllib.ur
urllib.url2pathname urllib.urlencode urllib.urlretrieve
urllib.urlcleanup urllib.urlopen
>>> urllib.urlopen('http://hpux.connect.org.uk/hppd/auto/')
>
>>> fileobject = urllib.urlopen('http://hpux.connect.org.uk/hppd/auto/')
>>> file
file fileobject
>>> fileobject.
fileobject.__class__ fileobject.__repr__ fileobject.headers fileobject.readlines
fileobject.__doc__ fileobject.close fileobject.info fileobject.url
fileobject.__init__ fileobject.fileno fileobject.next
fileobject.__iter__ fileobject.fp fileobject.read
fileobject.__module__ fileobject.geturl fileobject.readline
>>> fileobject.rea
fileobject.read fileobject.readline fileobject.readlines
>>> str = fileobject.read()
>>> output = open('/tmp/toto32', 'w')
>>> output.write(str)
>>>

Sunday, May 14, 2006

hard links

http://www.mikerubel.org/computers/rsync_snapshots/#Incremental
Checkout rsnapshot too.
I just discovered there that hard links are a great feature to make backup, so I have to remember that for later :)

diaporamons

Le diaporama des cahiers du football c'est vraiment trop bon:
http://www.cahiersdufootball.com/diaporama.php?pageNum_rs=1&totalRows_rs=159&PHPSESSID=b79e475b22b371a7455b5fa69ec54038

Sur la page 1 yen a un bon sur un des chroniqueurs d'On refait le match également :)

Qui se ressemble s'assemble(ur)

Benjamin: Tu sais ce que c'est troff ?
Sandrine: Oh, c'est quoi encore ce truc. Vas-y ?
Benjamin: C'est pour écrire des pages de man.
Sandrine: Tu sais ce que vas faire, tu vas aller faire une lessive avec tous tes T-shirts sales.

Friday, May 05, 2006

mieux que Jean-Pierre Pernot

Pernod avec un t ou un d comme l'alcool ... hum, à vérifier.
En tout cas, si vous voulez voir ce qu'est de l'info je conseille chaudement
http://www.radiofrance.fr/chaines/france-culture2/emissions/matins/index.php
car ça messieux mesdames, c'est de la chronique. (moi j'ai un faible pour l'encyclopédique Alexandre Adler, mais il n'y a rien à jeter dans l'équipe).

Sur ce, bonsoir, vaste monde en équilibre instable sur TCP/IP.
(bon je suis un peu théatral aujourd'hui ...)

en avoir dans le slip

J'ai une grosse machine HP avec 8Gigas de RAM.
C'est la plus lente de toutes pour lancer Catia :)

Alors ca c'est du post !!

nfs benchmarking

I'm thinking about using a Solaris box as an NFS server (I currently use a Mandriva Linux).
I should have a look at some bench before thought ...
This one looks overkill http://www.spec.org/sfs97r1/ and it looks like you have to pay to get it.
Maybe something simpler exist ...

Thursday, May 04, 2006

plus on est de fous

My lamer open source program is called orm (http://orm.berlios.de); it's a podcatcher, a program to retrieve podcasts. Quickly I found out that it needed to be multi-threaded to fetch several podcast at a time. So I tried something with python, using the Python Cookbook ... it works, but there's a problem when I want to stop it... thread programming is hard, I need to improve in this field :)

Here are good reason to use threads ...
http://www.llnl.gov/computing/tutorials/pthreads/#Pthread

And this: mt-daapd is another program which is using those pthreads, and let you export your Music to an iTunes on your local network from a Unix box.

Tuesday, May 02, 2006

sécu

This looks like a very promising tool.
http://www.coverity.com/main.html

OpenBSD strlcpy and strlcat seems interesting too...