2006-09-29

Upgrading frenzy

It's no secret, not that the stars are falling from the sky, but that updating your freeBSD box is a quasi trivial matter thanks to the fantastic port system and the non the less fantastic portupgrade command (ahhh portupgrade portupgrade, at least as good as man man, one of my favourite commands!!!).

But what to upgrade is another issue...
Fortunately the port and package systems provide us with nice tools for that. Especially pkg_version which gives us indications on if ports are older, newer or at the same "age" that the one on the root tree... Provided you update your tree dutifully with a good round of cvsup. You do that before trying to upgrade, don't you? It would be like not checking if you have gained 10 Kilos before going and buying a new pair of trousers...

The problem is that there is typically way to much ports and that way too much of them are in no need of upgrading... Once you played a little with pkg_version you know how to communicate with it, or more accurately how it communicates with you, meaning spiting out a > or a < a =" depending" style="font-style: italic;">pkg_version -v | grep \< | less and that should do it, allowing you to browse through the list of things that may need a good kick in the basement... (the \ before the < is to prevent the shell to interpret it as a feeding of file, of course...)

As I am approximately as lazy as longwei I am working on a script to compare for me the version numbers and tell me what *really* needs to be upgraded, but my coding/scripting is going down the drain at the moment due to a lack of free time (or an excess of activities, about the same in the end).

Don't forget to portugrade portugrade, heh!?

Portable carnivale ?

My ipaq rx3715 a great PDA but its screen is only 320x200. This is not a big problem nevertheless when I watch some Carnival episodes on it , as my files are encoded in divx 640x480 the rendering is too slow. Here is a minimalistic command line to reencode these video files. I am not fully satisfied of the options, but at least, it gives a 200Mo files for 1 hours of videa with a pretty good quality and smooth rendering.
    mencoder carnivale-1_09.avi -vf scale=320:-2 -sws 1 -oac mp3lame -lameopts cbr:br=128 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=600 -o carnivale-1_09_PDA.avi
It takes 5 to 10 minutes to process a file. For your information, shame on me, I am using windows mobile and TCPMP (The Core Pocket Media Player) as video player. I should be able soon to switch to linux, but that's another story.

2006-09-27

Use MapJon and move to Dijon !

Hmmm (this is the only meaningful introduction that I was able to find for this post),

I've heard that it seems that I am moving to dijon. It seems also that I have to look for a flat.
Last time I had this stupid idea was in 1999 and at this "age" only few adds were available on internet. But today, especially today, as I am back to Paris after some days away, my email is full of adds with obscure streets name such as "Rue le Gouz-Gerland" or "Rue Jacotot". It also seems that there are no metro stations in this city and consequently no ways to refer to these stations in order to decide whether or not the flat is in a nice place and it's usefull to have a look to the details.

Today, after three cut (mouse highlight) and paste (middle click) in the http://maps.google.fr I already feel tired.

That's why I have created (adapted from existing stuffs) the most useful "piece of software" of the day, which is called "MapJon" like Map Dijon !

  • What is it ?
It's a simple Mozilla firefow bookmarklet in javascript, the source is :

    javascript:q = "" + (window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text); if (!q) q = prompt("You didn't select street name in Dijon, please type it here:", ""); if (q!=null) window.open("
    http://maps.google.fr/maps?f=q&hl=fr&q=dijon+"+escape(q)+
    "&ie=UTF8&z=15&om=1&iwloc=A"); void 0

  • How to install it ?
You simply have to create a new bookmark in the mozilla-firefox bookmark toolbar and call it MapJon, then you edit its properties copy the source above and paste it as the bookmark url.

  • How to use it ?
You simply highlight the damn street name your looking for in dijon and then you click in the bookmark bar on the MapJon and then you will see in a new window a google map pointing to this street.

As I am lazy, the next step I'm sure will be to add a keyboard shortcut or a menu entry in the right click menu with a firefox extension.

2006-09-12

/me is getting a hell of a lot of trouble just to stay nerdy...

I am using (also) a MacBook. And today I'll talk about a newbie experience to figure out some of the Mac stuff.

I am heavily using ghoul (the name of this whitish stylish machine... don't ask...) as a *NIX box, mainly on terminal (but with nice real transparency, you become snobbish really fast when you have a real transparent terminal!) and using X11 and darwinports extensively to use as much as I can the same applications... That could be debated further but I am risking the stake if too many Mac user read that...

Adium is a nice counterpart for Gaim, nothing to say about that...
But real nerds use irc so irc-ing I was... And to do some irc-ing, I chose to try on Macirssi, which is a gui implementation of the console irssi (that I also installed through darwinports but I'll get to that later...). Who says "gui and Mac" says "good and thoughtful", usually... But not here, I mean, not completely...
Why not to use the port of Xchat is a good question, it is supposed to be quite buggy, that is what I was told, I didn't experience it myself (but maybe I'll try it soon)

Anyway I had to relearn all the console irc commands, so I guess I'll post them here in order to have the really useful ones at hand:
/CONNECT server (for example, irc.europnet.org where we lurk...)
/JOIN #channel (for example #BOP, where indeed we lurk...)
/NICK foo to change your nick from what it was to foo, or more probably for toto to toto_away or toto_eats

/AWAY I am gone to put some powder on my nose
/QUIT Arg here they come to get me!!!
are also quite useful...

and there is also
/ME is putting a finger up is nose
/MSG The_other Hi I want to talk to you without all the others to see that I will be making a fool of myself and try to invite you for a game of tic-tac-toe, wink wink...

All that is fair and square, but I also tried to send and receive some files, fool that I am!
That's a bit trickier, first because it is in the server tab and not in the channel tab, then because I never used before the command lines for that (I was sending the file from my freeBSD box cafetière, using Xchat2)
/DCC SEND nick_of_the_other foo.txt to, well, send foo.txt to the other guy way down there...
/DCC GET yournick to, err, get the offered file

Well, with all that, I can survive...
But there is another problem, the one of those funny characters, such as accents in French and å, ø and other thingies such as æ in Danish... Not that I use a lot of Danish but I don't have a lot of ways of trying to impress people, do I? Unfortunately the command /charset utf-8 seems to be inefficient in Macirssi and I still haven't found not what I am looking for but a way to get around that... It seems to be a bug because you can specify in the preferences your charset and putting it on utf-8 didn't solve anything. Damn it.
And trying the console version (I told you it would come) was a complete failure, I couldn't even start to connect to a server... I haven't said my last word on that!

And now for something completely different... Ciao.

2006-09-04

Me and a bottle of Wine.

Let's face it, running W2K on an old Celeron 1Ghz 256Mo to do some dev things (especially Java) is usually one of the best ways to summon my nemesis: Your system lacks virtua
l memory + infernal swapping mode ON. Damn it!

Phase One : Preserving the integrity (or trying to do so)
Damn Small Linux (DSL) saved my day a couple of time by allowing me to backup the MBR [1](turning on your office PC with the non bootable disk welcome message might be a stre
ssing situation the fact that this is entirely due to my own silliness is totally irrelevant here :) !).

dd if=/dev/hda of=backup_mbr count=1 bs=512

Phase Two: Trying to be casual
Debian ('cause I'm not sufficiently desperate to opt for a FreeBSD distro right now ... but who knows !)
[Enter Sarge] The installation process ran smooth[3]. At least until I want to disable X at startup.

update-rc.d stop xdm 6 5 4 3 2 1. leads to nowhere for mysterious reasons. This is not the case with:

update-rc.d remove -f xdm
So much for X.

Phase Three: Did I miss something?
[Enter Boss] What's your opinion on the last mail from M.Yellow? [waiting for an immediate reaction]
[Me not so casual] Well ... [su reboot ... choosing the I'm on a really top urgent thing right now approach and looking annoyed ] I have not read it yet ...
[... 2' ... Enter W2K ... 2' ... Enter Lotus] ...

Phase Four: Bring me some Wine!
Yes I know, running Lotus Notes should be definitively prohibited. Unfortunately one must not rely too much on common sense here.

A quick glance at Wine puts me into a quantum state:
- Waouw this is it! Let's try it...
- No binary for Sarge. No time (nor skills) to do a backport myself. Let's transform my linux's partition into freespace for M$.

A few nano seconds later I was upgrading to the unstable distro [2] :)

Next, I changed the /etc/atpt/sources.list to include links to wine packages (no need to set the preference file as no prior packages was in conflict [4]). A cp -r of my M$ n
otes directory and I prostrate myself before my desk.

There is a god somewhere!

Final thoughts.
I'd wished I've been stealthy during all theses steps but with downloads exceending the Go the chance is that I won my place on a blacklist... (Just one week after having rec
eived a mail which politely reminds us of the network's good practices. How funny!)

Notes & References :
[1] Some people also backup the partition's table with :
sfdisk -d /dev/hda > backup_pt
[2] do not forget to install debian with kernel 2.6 BEFORE upgrading to unstable.
[3] In the initial installation process if you set up your clock with funny values do not forget the hwclock command (perfect with ntpdate).
[4] The first time I tried to install wine apt-get was unable to locate wine. I still don't know why so I downloaded the files manually and installed them with dpkg -i (good
luck with the dependencies :()

2006-09-02

About a script, chinesetape2ogg

Last year, during an attempt of ogg enconding of my father old Blues Vinyls I wrote a script in order to encode on the fly sound from the line in of my sound card.

It worked well until today when I tried again with some chinese lessons on a tape bought in Shanghai . Maybe because I am not a surfer, I gave my old aiwa walkman to a friend. Consequently, I have no other means than converting these lesson to ogg in order to enjoy mobile chinese lessons on my Iops !

Here was the old script :

    #!/bin/sh
    mkfifo lak7.wav

    oggenc -b 190 lak7.wav -o lak7.ogg &
    sox -t ossdsp -w -s -c 2 /dev/dsp -r 44100 -c 2 -f lak7.wav


The idea is to create a fifo file, then encode on the fly this file which is feeded by sox listening to the output of the mixer. You launch the script and do a CTRL + C to stop it.
It worked until now, but today, with short recordings, the results were awfull when I tried to listen to the resulting ogg file. Just like if it was played in low motion !

I found the solution and my mistake here.

In fact, there problem comes from the fact that I end the recording by sending SIGINT (CTRL+C). But, this is received by oggenc and then its parent (sox) is receiving a SIGPIPE and terminates. As a result, the end of stream marker of the off file is missing which seems to be a problem on my short chinese lessons. In order to solve this, the web site above propose to trap SIGINT in order to send it to sox.

Here is the proposed script (rec is the sox frontend)
    trap cleanup INT
    (
    trap "" INT

    exec rec -t raw -c 2 -w -r 44100 - | oggenc -r -B 16 -C 2 -R 44100 -q 5 -o "$file_name" - ;

    )

Toward FreeBSD Step #3

I had a long and strange day at work.

Some hard nerding back home should help me to get rid of it!

On my "light" & console mode freeBSD brand new installation I tried to mount my Linux partitions (ext3) where I have all my personnal data (140G).

It seems there is no native way of having read/write on a ext3 filesystem.

Seems I have to recompile the kernel with ext2fs option... but in this case I still won't have ext3 journalised behavior, my files will be mounted as ext2 without journal...

So what? Will there be a "Toward freeBSD #4" ?