Il peut s’avérer intéressant de récupérer le code renvoyé dans la réponse HTTP dans un script.

Quelques codes comme exemples :

  • 200: OK
  • 302: Déplacé mais trouvé
  • 403: Accès interdit
  • 404: Page Introuvable
  • 500: Erreur serveur

Voici comment faire (je vous fourni un bout de code commenté, des explications plus complètes se trouvent en dessous de ce dernier) :

function ch_url($urlParam){
	// On récupère l'ancien level d'error reporting
	$levelBefore = error_reporting();
	//Le fopen d'une url sur un serveur qui n'existerait plus par exemple fait un très moche message d'erreur, on les déactive donc
	error_reporting(0);
	//Ouverture de la connexion
	if (!$fp = fopen($urlParam, 'r')) {
	    error_reporting($levelBefore);
	    return "404";
	}
	//On récupère les données du stream
	$meta = stream_get_meta_data($fp);
	//On prend la donnée qui nous intéressé dans l'objet et on la transforme comme on veut (voir si dessous pour l'explication)
	$return = explode(' ',$meta['wrapper_data'][0]);
	//On ferme proprement la connexion
	fclose($fp);
	//On replace le niveau d'erreur
	error_reporting($levelBefore);
	//Et on renvoie le résultat
	return $return[1];
}
/*On fait s'afficher la réponse de notre fonction pour une url étant passé par GET
 (script.php?url=http://www.helpcomputer.org/wpress/ par exemple)
*/
echo ch_url($_GET['url']);

Read the rest of this entry »

Written on February 14th, 2010 , Web Tags: , , , , , , , ,

I observed that people are looking for install rar on nautilus.

In fact, it’s very simple, first, we open rarlab page.

We have to choose between the ‘normal’ (x32) and ’64 bits’ (x64) version.

What is your architecture ?  You can know that by typing these command.

uname -i
x86_64

Here, is a 64 bits architecture and I will download the right file (x64) (32 bits version is here).

Open a CLI, and go to file. After that, you must extract and install.

$tar zxvf rarlinux-x64-3.9.2b1.tar.gz #extract

$cd rar/ #go into directorycreated

$su #switch in root mode

#make install #simply install

It finished, enjoy it.



Written on January 31st, 2010 , Linux Tags: , , , , , ,

I consider that we have 3 AC3 files :

  1. Sample1.ac3
  2. Sample2.ac3
  3. Sample3.ac3

Merge files

We want to merge these 3 files. Simply use the cat command :

cat *.ac3 > All.ac3
#normally *.ac3 tell
“Sample1.ac3 Sample2.ac3 Sample3.ac3” properly sorted. If you have a doubt, you will be allowed to use the full sentence.
cat Sample1.ac3 Sample2.ac3 Sample3.ac3 > All.ac3

The 3 files merged in one All.ac3.

Decode AC3 file

Lame doesn’t be able to read AC3 files, so we must convert them. a52dec is a decoder of ac3 file to a lot of format (oss, ossdolby, oss4, oss6, wav, wavdolby, aif, aifdolby, peak, peakdolby, null, null4, null6, float).
Here, we use “wav” type output. The program decodes specified file to stdout and we must use operator ‘>’ like that :

a52dec -o wav All.ac3 > All.wav

This command downmix the 5.1 stream into full stereo stream (with channel level adjustment (-3, 0, + 3dB for instance) based on output mode). You can disable this with add a ‘-a’, use man for the rest.

Read the rest of this entry »

Written on January 16th, 2010 , Vidéo & Audio Tags: , , , , , ,

When you have in options to a nautilus for instance :

–geometry=GEOMETRY
Create the initial window with the given geometry.


Read the rest of this entry »

Written on January 10th, 2010 , Linux Tags: , , ,

Don’t do like me. And install your KMod-Nvidia correctly :

Like that

Written on January 8th, 2010 , Fedora 12 Tags: , , , , ,

A very beautyfull (or not) but so funny gift for your girlfriend if she is a geek :

The fun ring for geek (click on for see the source of article)

For complement :

An other ring

Earrings wich are also fun

Earrings wich are also fun

Written on January 8th, 2010 , A voir Tags: , ,

Evil mum hit my dad because he sticked out his tong to my mother and she found that not very polite .

Me, Super Nounourse, who don’t like that, hit evil mum and told her Dont hit my daaaaad”.

My mother told me “If I can’t hit your dad, I will hit you then !” and me, after that, says “No, no don’t hit me, hit dad instead”

Dad who was dying, beat up, sent off Nounourse for punishment to the pillow in the corner.

Ceci est de la fiction et/ou du pur délire et n’a pour but que d’améliorer mon anglais.
This is fiction and/or pure madness and has just for goal to improve my english.

Written on January 8th, 2010 , Improve my english Tags: , ,

Geekeries diverses is proudly powered by WordPress and the Theme Adventure by Eric Schwarz
Entries (RSS) and Comments (RSS).

Geekeries diverses

El Gnap et ses geekeries