Archive for the 'english' Category

Ubuntu vs AAC (round 1)

Saturday, June 7th, 2008

For better or for worse, (generally for worse) a lot of multimedia systems seem to like making peoples lives difficult.

This is painfully obvious with AAC and the formats that use it (think mp4).

Luckally, playback can be assured by using a nice arrangement of plugins that are downloaded just in time to play the offending file on your computer (thanks ubuntu).

This help doesn’t extend to re-encoding though, so for those of you lucky enough to have an mp4 capable phone (like the sony erricsons), you can find that putting the latest Bleach on your phone to be an exercise in frustration.

The reasons for this are numerous and complexe but come down to the simple fact that if cannonicle put aac encoders in Ubuntu they’d be sued to kingdom come in the states (thank god I don’t live there ;) ).

Help is at hand though, since even if the versions of the enncoding tools included with Ubuntu don’t come equiped, you can re-compile them so that they work as intended.

First up: ffmpeg

FFmpeg is one of the many swiss army knives used for video encoding available with Linux. It’s probably the easiest to use, and like it’s cousins, the ubuntu version comes cripled.

What to do?

First of all, make sure we have what’s needed to re-build it

sudo apt-get build-dep ffmpeg

Then add a few libraries (that add the magic support)

sudo apt-get install libfaac-dev libfaac0 libfaad-dev libfaad2-0 libfaad0

Finally, get the source code to ffmpeg

mkdir ffmpeg
cd ffmpeg
apt-get source ffmpeg

Now the fun starts, you should have 3 files and a directory before you.

Cd into the directory.

Now let’s move this thing arround a bit:

Open: debian/rules

This file tells dpkg how to build ffmpeg, we want to add a config flag so go to the lines that start with “confflags” and add on to one of them:

–enable-libfaad –enable-libfaac

Save, and quit, now all you have to do is re-build the package

dpkg-buildpackage

go have a coffee while it builds, and then install the result:

cd ..
dpkg -i ffmpeg*

To use, something like this is needed:

ffmpeg -i Source.avi -vcodec h263 -b 400 -s 352×288 -acodec aac -ab 64 -ar 48000 -ac 2 -f mp4 Dest.mp4

Update:

For the lazy, here are the debs that need installing:

-
ffmpeg_0.cvs20070307-5ubuntu7_i386.deb
libavcodec-dev_0.cvs20070307-5ubuntu7_i386.deb
libavcodec1d_0.cvs20070307-5ubuntu7_i386.deb
libavformat-dev_0.cvs20070307-5ubuntu7_i386.deb
libavformat1d_0.cvs20070307-5ubuntu7_i386.deb
libavutil-dev_0.cvs20070307-5ubuntu7_i386.deb
libavutil1d_0.cvs20070307-5ubuntu7_i386.deb
libpostproc-dev_0.cvs20070307-5ubuntu7_i386.deb
libpostproc1d_0.cvs20070307-5ubuntu7_i386.deb
libswscale-dev_0.cvs20070307-5ubuntu7_i386.deb
libswscale1d_0.cvs20070307-5ubuntu7_i386.deb

Bye bye Dapper, Welcome Hardy

Sunday, April 27th, 2008

I’ve just finished upgrading my server to Ubuntu Hardy, with virtual no trouble.

The only problem came from the kernel, which now calls  ide drives ’sd…’ instead of ‘hd…’ so hda1 becomes sda1.

Update grub or face the consequances.You have been warned!

Bye bye trackbacks

Thursday, April 10th, 2008

FYI, I’ve deactivated trackbacks since nobody seems to want to send me one :’(

And because spammers seem to love them :-[

Presenting ring_logger v0.1

Monday, February 25th, 2008

 Ring logger

This weekend, I had an urge to catch up on one of the umpteen projects that I’d like to start, so I attacked a ring logger.

Basically, a ring logger, keeps the log messages in a ring buffer, which can be dumped when interesting circumstances arrise.

The particularité of this one is that it’s pure javascript, and dumps as a ‘POST’ request to a url. This allows for much improved debugging of js-rich web pages, whilst not filling up the web browsers memory with useless logs.

It depends on ToutouJS but doesn’t have a lot of calls, so it should be easilly portable if anyone finds the need.

 Usage

First off, you have to include the relevent files:

<script src="js/toutou/toutou.js" type="text/javascript"></script>
<script src="ring_log.js" type="text/javascript"></script>

Then you just log away (the mores the better):

js.ring_log.log(js.ring_log.DEBUG,'Test','Test message');

Finally, to retrieve your log, ie dump the buffer:

js.ring_log.dump();

Et voila!

For testing purposes, the logger is pre-configured to call a script log.php in the same directory as it is in, and has a buffer size of 10, both parameters changeable in the source. The different parts of the log messages are seperated by a ’splitter’, by default ‘==|==’, this is also configurable.

js.ring_log.requestUri='log.php';
js.ring_log.log_data_size=10;
js.ring_log.splitter='==|==';

And that’s just about it, hope you find it usefull :)

Update: forgot to add the .tgz, oups :$

Zabbix

Thursday, February 7th, 2008

Sometimes things that seem completely harmless just come and hit you over the head…

That’s what happened to me with Zabbix yesterday. I was going through some items and cleaning up, when suddenly, 4 hosts went off-line. Except that they hadn’t.

I couldn’t understand why Zabbix refused to see them (the agents were responding fine).

I finally found out that it was because of the way that Zabbix calculates the ’status’ item, which has a value of 0 if alls well, and 2 if the host is off-line.

Zabbix looks at the first item to be taken of the host, if that item returns an empty string, Zabbix decides that the host is dead and raises the alarm, even if the host has 150 other items all working perfectly. This bizzar to say the least, but workable. If this happens, a quick fix is to deactivate the offending Item, so that the first Item checked returns a value, then the host comes back :)

Any how, I thought I’d just document this in case anyone else starts loosing hair over the issue :)

Rate cuts and what they mean to the rest of us

Thursday, January 24th, 2008

No, I haven’t got a multi paged analyses lined up, I’ll leave that to Mark and others like him who can put it much much better than I can.

OTOH, here’s a couple of quotes for the day:

A banker is a fellow who lends you his umbrella when the sun is shining and wants it back the minute it begins to rain.

- Mark Twain (attributed)

OCTOBER: This is one of the peculiarly dangerous months to speculate in stocks in. The others are July, January, September, April, November, May, March, June, December, August, and February.

- Mark Twain, Pudd’nhead Wilson’s Calendar

Geek’s dream…

Tuesday, December 11th, 2007

Or mabey not, anyhow, here’s a quick counter to tell you how far away KDE4 is… :)

KDE 4.0 Release Counter

XKCD Rocks

Wednesday, December 5th, 2007

Just a quick link to a couple of xkcd webizodes…

Philippe, you were right, Python is the best thing since sliced bread!

And on a more sentimental note:

Dedicated to everyone who’re just to far away ;)

VMware Server +nat -dhcp?

Saturday, November 10th, 2007

I’ve just been testing an install CD for enkix, our custom Debian installer, to make sure it works next week when I re-install some servers in Paris.

The problem is that our datacenter lacks a dhcp server (everythings static), whereas I had never tested enkix using static IPs before (all installs were done at the office).

Vmware was my poison of choice for this task, since it offers sevral network parameters: Bridged networking using the offices DHCP, net using it’s own DHCP, and a host only network using…. it’s own DHCP. Hmm… and what happens if you just don’t like DHCP? What if you want everything static? Or if you prefer Avahi? Or, as is in my case, you’re testing for a DHCP-less environment and DHCP is the last thing you want?

After a few fruitless searches on the web, the solution was revealed by probing /etc/vmware. In the network sub directories (vmnet0-vmnet8), those which have a DHCP server have a dhcp sub directory, the others don’t.

Solution: Just create a natted vmnet, then pop into the corresponding directory, rm -rf dhcp and /etc/init.d/vmware restart, problem solved.

One last thing: if you do this, please make a note of the network parameters before hand, since it’s always some funny value like 192.168.28.x

The day the routers died

Tuesday, October 30th, 2007

A quick post to share a find someone sent me today on the necessity to go IPV6

And for those interested, I also managed to gat ahold of the lyrics:

A long long time ago
i can still remeber
when my labtop could connect elswhere
and i tell you all there was a day
the network card i threw away
had a purpose - and worked for you and me
But 18 years complety wasted

with each adress we´ve aggregated
the tables overflowing
the traffic just stopped flowing

And now we´re bearing all the scars
and all the traceroutes showing stars
the packets would travel faster in cars…
the day… the routers died

————-
Chorus ( ALL )
So bye bye , folks at RIPE 55
be persuaded zo upgrade it or your network will die

Ipv6 just makes me let out a sight
But i spose we´d better give it a try
I suppose we´d better give it a try

———

Now did you write an RFC
That dictated how we all should be
Did we listen like we should that day
Now were you back at RIPE fifty-four
Where we heard the same things month before
And people knew they´d have to change their ways…
And we - knew that all ISPs
Could be - future proof for centuries
But that was then not now
Spend too much time playing WOW
ooh there was time we sat on IRC
making jokes on how this day would be
Now there´s no more use for TCP
they day the routers died

————-
Chorus ( chime in now )
So bye bye , folks at RIPE 55
be persuaded zo upgrade it or your network will die
Ipv6 just makes me let out a sight
But i spose we´d better give it a try
I suppose we´d better give it a try

———

i remember those old days i mourn
Sitting in my room , downloading porn
Yeah that´s how it used to be…
When the packets flowed from A to B
via routers that could talk IP
there was data… that could be exchanged
between you and me…

Oh but- i could see you all ignore
The fact - we´d fill up IPv4
But we all lost the nerve
And we goz what we deserved !
And while… we threw our network kit away
And wished we´d heard the things they say
Put all our lives in disarray
the day … the routers died

————-
Chorus ( those silent will be shot )
So bye bye , folks at RIPE 55
be persuaded zo upgrade it or your network will die
Ipv6 just makes me let out a sight
But i spose we´d better give it a try
I suppose we´d better give it a try

———

Saw a man with whom i used to peer
Asked him to rescue my career
He just sighed and turned away
I went down to the net cafe
that I used to visit everyday
But the man there said i might as well just leave

And now we´ve all lost our purpose
my cisco shares completely worthless
No future meetings for me
At Hotel Krasnapolsky
and me that make us push and push
Like Geoff Huston and Rady Bush
Should´ve listened to what they told us….
The day… the routers. died

————-
Chorus ( time to loose your voice )
So bye bye , folks at RIPE 55
be persuaded zo upgrade it or your network will die
Ipv6 just makes me let out a sight
But i spose we´d better give it a try
I suppose we´d better give it a try

Finally, for those who want to know more:

Words and performance by Gary Feldman

http://www.youtube.com/watch?v=_y36fG2Oba0

seriouly its about this:

http://www.ripe.net/news/community-statement.html