how to play ram files under linux x86_64

realplay.bash

This script is intended to play ram files with vlc instead of using proprietary
software « realplay » that run only on 32bit systems.
(You can replace vlc by any other player).

Now, we are able to play www.amazon.* samples =)
Next step is to configure your browser to open ram(ra) files whith this script.

requirement :
– vlc
– curl
– GNU grep (if you lack the -oP version, replace grep by pcregrep instead)

How to detect keyboard and mouse idle time under Linux…

Hi,

I was searching to do this today. My first aproach was to code something in C with XScreenSaver (man 3 XScreenSaver) but the straightforward way IMHO is this one in perl :
# cpan -i X11::IdleTime; sleep 2; perl -MX11::IdleTime -e 'print GetIdleTime(), $/;'

how to create an outline on text or digits with gd and php

Like this simple example : gd outline

Sample code :




<?php
$string = "10€";
$font = "./arial.ttf";

// Adapted from http://www.phpbuilder.com/columns/cash20030526.php3?print_mode=1
// &
// http://www.php.net/manual/fr/function.imagettftext.php

header('Content-type: image/png');

// Image building
$im = imagecreatetruecolor(70, 70);

// Colors definitions
$white = imagecolorallocate($im, 255, 255, 255);
$yellow = imagecolorallocate($im, 255, 255, 0);
$purple =  imagecolorallocate($im, 89, 3, 255);
//$grey = imagecolorallocate($im, 128, 128, 128);
//$black = imagecolorallocate($im, 0, 0, 0);
//$red = imagecolorallocate($im, 255, 22, 5);

imagefilledrectangle($im, 0, 0, 70, 70, $white);

function imagettftextoutline(&$im,$size,$angle,$x,$y,&$col,
            &$outlinecol,$fontfile,$text,$width) {
    // For every X pixel to the left and the right
    for ($xc=$x-abs($width);$xc<=$x+abs($width);$xc++) {
        // For every Y pixel to the top and the bottom
        for ($yc=$y-abs($width);$yc<=$y+abs($width);$yc++) {
            // Draw the text in the outline color
            $text1 = imagettftext($im,$size,$angle,$xc,$yc,$outlinecol,$fontfile,$text);
        }
    }
    // Draw the main text
    $text2 = imagettftext($im,$size,$angle,$x,$y,$col,$fontfile,$text);
}

imagettftextoutline(
        $im,           // image location ( you should use a variable )
        20,            // font size
        0,             // angle in °
        0,             // x
        25,            // y
        $yellow,
        $purple,
        $font,
        $string,       // pattern
        2              // outline width
);

imagepng($im);
imagedestroy($im);
?>


MyWi under Linux

For you guys want to use this ( best application ever ) cool application from iPhone, don’t waste your time to configure manually or with wicd, wifi-radar or such. Your best bet is to use networkmanager. Most of modern ( all ?! ) distro have this in packages manager.
For debian/ubuntu :

aptitude install network-manager network-manager-kde

( last package is for kde, but there’s interfaces to xfce4, gnome… too )

That use the simpleness of wifi stuff on Window$ on your Linux boxes.

Enjoy !

Edit:for people using Android phones, since version 2.2 Froyo, it’s implemented by default ( see tethering in your network settings )

Acceder aux tty des guests dans VMware

Pour faire ça, il faut taper sur son clavier avec ses p’tits doigts musclés :
ctrl+alt+espace
garder ctrl+alt enfoncé, relâcher espace, appuyer sur la touche fn désirée et puis on lâche tout :)
Pour passer d’un tty à un autre, pas la peine d’appuyer sur ctrl, donc alt+fn.

Walla !

Perl : Changer le mirroir CPAN dans sa conf

Salut,

aujourd’hui j’essayais d’installer WWW::Search::Pagesjaunes mais cpan.perl.org était « down ».
J’ai donc cherché dans quel fichier les dépots étaient renseignés, et c’est plus difficile qu’il n’y parrait.
Voici donc ma méthode :

Nécessite strace, awk et cpan

Ceci va vous retourner le fichier à éditer :

strace -f -e trace=file cpan -i WWW::Search::Pagesjaunes 2>&1 |
awk -F'"' '($0 ~ "CPAN/(My)?Config.pm.*0$") {print $2; exit}'

( On peux mettre n’importe quel module à la place )

Changer

'urllist' => [q[]],

par

'urllist' => [q[http://cpan.shadowcatprojects.net/]],

Vous pouvez remplacer l’URL du dépot par un de cette liste :
www.cpan.org et aussi mettre plusieurs dépots :

urllist' => qw[http://foo/ftp.cpan.org/ ftp://bar/ftp.cpan.org/ http://base/],

Walla, si ca vous est utile, tant mieux ;)

fax4free, envoi de fax via freebox en CLI ou via menu contextuel

Tutoriel http://redmine.sputnick-area.net/wiki/cups2freefax

Le sous projet fax4free a été regroupé dans le projet plus complet cups2freefax : http://redmine.sputnick-area.net/wiki/cups2freefax

voici un script perl qui permet d’envoyer des fax gratuitement via sa freebox ( voir ancien article http://www.sputnick-area.net/wordpress/?p=32 ). Cela prends en compte les modifications apportées sur le site de free en 2009.

wlassistant installation for kde4

Hi,

I’ve found a workaround to install wlassistant on debian likes (debian, ubuntu…) with kde4.
Follow this 2 few steps :

wget "http://ftp.fr.debian.org/debian/pool/main/w/\
wlassistant/wlassistant_0.5.7-2_i386.deb"
dpkg --ignore-depends=kicker -i wlassistant_0.5.7-2_i386.deb

Regards, sputnick.

java.lang.OutOfMemoryError: Java heap space

If you are encountering this problem, the JVM size is too small.

Change value of Xms & Xmx to a higher value.

DEPRECATED proof of concept: Download mp3 stuff from www.deezer.com / PERIME preuve de concept: telecharger les mp3 de www.deezer.com

English speakers:
Hi.

the following bash script extract mp3 right from the flash files from www.deezer.com.

The script need to be executed once (daemon mode) before browsing www.deezer.com, or instead, need to be executed each times you want to add a track (one shot mode).

En Francais :

Salut,

le script bash que voilà, permet de récuperer les mp3 en provenance des flash de www.deezer.com. Il suffit soit de le lancer une fois (mode daemon) avant de naviguer sur www.deezer.com, ou bien au contraire de le lancer a chaque fois que l’on veux ajouter un track (mode one-shot).

	Syntaxe :
	./deezer-colector.bash [-d --direct h]

	Aide :
	--direct -d ne demandent pas pour jouer le son avec mplayer,
	on assume qu'on recupere a la volee direct sur deezer
	et on ne quitte pas quand tous les tracks ont été encodés,
	mais on lance $SCRIPT en mode daemon.
	Dans ce dernier cas, il faut donc quitter avec ^C.

	-h ou --help affiche cette aide

	Divers :
	Le script n'extrait pas deux fois les memes tracks
	sauf si ~/.deezer-collector.bash.log est efface.

Download :
download deezer-collector.bash here