<?xml version="1.0" encoding="UTF-8" ?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Posteet</title> 
    <link>http://www.posteet.com/</link> 
    <description>Recent posteets posted to Posteet</description>
    <ttl>60</ttl>

    
    <item>
        <title>déconnecter sa session KDE à distance</title>
        <link>http://www.posteet.com/view/1044</link>
        <description>
        <![CDATA[<pre>dcop --user $USER --session `dcop --user $USER --list-sessions | grep DCOP`  ksmserver ksmserver logout 0 0 0</pre> <a href="http://www.posteet.com/tags/bash">[bash]</a>  <a href="http://www.posteet.com/tags/kde">[kde]</a>  <a href="http://www.posteet.com/tags/linux">[linux]</a> ]]>        </description>
        <dc:creator>bobuse</dc:creator>
        <pubDate>Fri, 04 Jul 2008 16:33:20 +0000</pubDate>

            <category>bash</category>
            <category>kde</category>
            <category>linux</category>
    
    </item>

  
    <item>
        <title>Enable SSL in apache2 on Debian Etch</title>
        <link>http://www.posteet.com/view/1037</link>
        <description>
        <![CDATA[<pre># Enable ssl
a2enmod ssl

# Edit /etc/apache2/ports.conf and add &quot;Listen 443&quot;

# Generate certs: use your domain as Common Name or *.domain.tld for multiple domains
openssl req -x509 -nodes -days 365 -newkey rsa:1024 -out /etc/apache2/server.crt -keyout /etc/apache2/server.key

# In the virtualhost, use the following code:
&lt;VirtualHost 192.168.0.1:443&gt;
        SSLEngine On
        SSLCertificateFile /etc/apache2/server.crt
        SSLCertificateKeyFile /etc/apache2/server.key
&lt;/VirtualHost&gt;

# Reload apache2
/etc/init.d/apache2 reload</pre> <a href="http://www.posteet.com/tags/apache2">[apache2]</a>  <a href="http://www.posteet.com/tags/debian">[debian]</a>  <a href="http://www.posteet.com/tags/openssl">[openssl]</a>  <a href="http://www.posteet.com/tags/ssl">[ssl]</a>  <a href="http://www.posteet.com/tags/virtualhost">[virtualhost]</a> ]]>        </description>
        <dc:creator>spirit</dc:creator>
        <pubDate>Thu, 03 Jul 2008 21:46:21 +0000</pubDate>

            <category>apache2</category>
            <category>debian</category>
            <category>openssl</category>
            <category>ssl</category>
            <category>virtualhost</category>
    
    </item>

  
    <item>
        <title>Moving the MySQL's datadir directory</title>
        <link>http://www.posteet.com/view/1035</link>
        <description>
        <![CDATA[<pre>Steps:
   1. Stop your mysql server before starting this operation
   2. Create the directories that will be new datadir
   3. chown the directory to the mysql:mysql user
   4. copy the files from the old datadir to the new location (cp -p : preserves ownership). However, make sure that the files
       named ib_arch_log_0000000000, ib_logfile0 etc. are not copied to the newer location
   5. Make sure that the files and directories are owned by mysql user
   6. Make changes in the my.cnf to point the new datadir (datadir = /my/new/dir/)
   7. Restart the MySQL database
   8. Create a new database and verify that the files for this database are getting created in the new datadir (create database test)
   9. After the server is running for a few days properly, get rid of the old data.</pre> <a href="http://www.posteet.com/tags/datadir">[datadir]</a>  <a href="http://www.posteet.com/tags/mysql">[mysql]</a> ]]>        </description>
        <dc:creator>spirit</dc:creator>
        <pubDate>Thu, 03 Jul 2008 11:13:28 +0000</pubDate>

            <category>datadir</category>
            <category>mysql</category>
    
    </item>

  
    <item>
        <title>Check if PHP is run from command-line (CLI)</title>
        <link>http://www.posteet.com/view/1034</link>
        <description>
        <![CDATA[<pre>if (PHP_SAPI === 'cli')
    // In CLI mode</pre> <a href="http://www.posteet.com/tags/cli">[cli]</a>  <a href="http://www.posteet.com/tags/php">[php]</a> ]]>        </description>
        <dc:creator>spirit</dc:creator>
        <pubDate>Wed, 02 Jul 2008 21:03:31 +0000</pubDate>

            <category>cli</category>
            <category>php</category>
    
    </item>

  
    <item>
        <title>Set password for Mysql root user</title>
        <link>http://www.posteet.com/view/1033</link>
        <description>
        <![CDATA[<pre># If you have never set a root password for MySQL
mysqladmin -u root password MYPASS

# if you want to change (or update) a user password
mysqladmin -u MYUSER -p OLDPASS NEWPASS</pre> <a href="http://www.posteet.com/tags/mysql">[mysql]</a>  <a href="http://www.posteet.com/tags/mysqladmin">[mysqladmin]</a>  <a href="http://www.posteet.com/tags/root">[root]</a> ]]>        </description>
        <dc:creator>spirit</dc:creator>
        <pubDate>Wed, 02 Jul 2008 21:00:29 +0000</pubDate>

            <category>mysql</category>
            <category>mysqladmin</category>
            <category>root</category>
    
    </item>

  
    <item>
        <title>Medir la velocidad de los scripts en PHP</title>
        <link>http://www.posteet.com/view/1029</link>
        <description>
        <![CDATA[<pre>$tiempo_inicio = microtime(true);

mifunciondelaostia();

$tiempo_final = microtime(true);
$tiempo = $tiempo_final - $tiempo_inicio;

echo &quot;Ha tardado &quot;,$tiempo,&quot; segundos&quot;;</pre> <a href="http://www.posteet.com/tags/desarrollo">[desarrollo]</a>  <a href="http://www.posteet.com/tags/optimizacion">[optimizacion]</a>  <a href="http://www.posteet.com/tags/php">[php]</a> ]]>        </description>
        <dc:creator>jacinmontava</dc:creator>
        <pubDate>Thu, 26 Jun 2008 10:16:03 +0000</pubDate>

            <category>desarrollo</category>
            <category>optimizacion</category>
            <category>php</category>
    
    </item>

  
    <item>
        <title>Shell : test sur les fichiers + operateurs de comparaison</title>
        <link>http://www.posteet.com/view/1028</link>
        <description>
        <![CDATA[<pre>-e filename
    True if filename exists.
-d filename
    True if filename exists and is a directory.
-f filename
    True if filename exists and is a plain file.
-h filename
    True if filename exists and is a symbolic link.
-r filename
    True if filename exists and is readable.
-w filename
    True if filename exists and is writable.
-n string
    True if the length of string is non-zero.
-z string
    True if the length of string is zero.
string
    True if string is not the empty string.
s1 = s2
    True if the strings s1 and s2 are identical.
s1 != s2
    True if the strings s1 and s2 are not identical.
n1 -eq n2
    True if the numbers n1 and n2 are equal.
n1 -ne n2
    True if the numbers n1 and n2 are not equal.
n1 -gt n2
    True if the number n1 is greater than n2.
n1 -ge n2
    True if the number n1 is greater than or equal to n2.
n1 -lt n2
    True if the number n1 is less than n2.
n1 -le n2
    True if the number n1 is less than or equal to n2.
! expression
    Negates expression, that is, returns true iff expression is false.
expr1 -a expr2
    True if both expressions, expr1 and expr2 are true.
expr1 -o expr2
    True if either expression, expr1 or expr2 is true.
( expression )
    True if expression is true. This allows one to nest expressions.</pre> <a href="http://www.posteet.com/tags/fichier">[fichier]</a>  <a href="http://www.posteet.com/tags/linux">[linux]</a>  <a href="http://www.posteet.com/tags/operateur">[operateur]</a>  <a href="http://www.posteet.com/tags/shell">[shell]</a> ]]>        </description>
        <dc:creator>matt</dc:creator>
        <pubDate>Thu, 26 Jun 2008 08:23:44 +0000</pubDate>

            <category>fichier</category>
            <category>linux</category>
            <category>operateur</category>
            <category>shell</category>
    
    </item>

  
    <item>
        <title>Recibe un email cuando el robot de Google visite tu página</title>
        <link>http://www.posteet.com/view/1025</link>
        <description>
        <![CDATA[<pre>&lt;?php

   if ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Googlebot' ) !== false )
   {
	 // Tu direccecion de correo
	 $email_address = 'tu@tudominio.com ';

	 // Enviate el email
	 mail($email_address,'Alerta de Googlebot',
	 'El Googlebot ha visitado tu pagina: '.$_SERVER['REQUEST_URI']);
   }
?&gt;</pre> <a href="http://www.posteet.com/tags/php robots google">[php robots google]</a> ]]>        </description>
        <dc:creator>jacinmontava</dc:creator>
        <pubDate>Mon, 23 Jun 2008 08:12:37 +0000</pubDate>

            <category>php robots google</category>
    
    </item>

  
    <item>
        <title>Ré-encodage d'une vidéo avi DV en XviD avec désentrelacement</title>
        <link>http://www.posteet.com/view/1023</link>
        <description>
        <![CDATA[<pre>mencoder -vf pp=ci -oac mp3lame -lameopts cbr:br=128 -ovc xvid -xvidencopts bitrate=1200 video_en_entree.avi -o video_en_sortie.avi</pre> <a href="http://www.posteet.com/tags/mencoder">[mencoder]</a> ]]>        </description>
        <dc:creator>benoitbalon</dc:creator>
        <pubDate>Wed, 18 Jun 2008 21:28:58 +0000</pubDate>

            <category>mencoder</category>
    
    </item>

  
    <item>
        <title>Renommer des photos avec l'aide de leurs informations EXIF</title>
        <link>http://www.posteet.com/view/1021</link>
        <description>
        <![CDATA[<pre>#!/bin/bash

repertoire=$1
nomsortie=$2

# Lancement de l'outil d'ImageMagick
traite_exif ()
{
	exif=`identify -verbose -quiet &quot;$i&quot; 2&gt;&gt; /dev/null | grep 'xif:DateTime:' | tr -d ' '`
	if test &quot;$exif&quot; = &quot;&quot;;then continue;fi
	annee=`echo $exif | cut -d ':' -f3`
	mois=`echo $exif | cut -d ':' -f4`
	jour=`echo $exif | cut -d ':' -f5 | cut -c1-2`
	heure=`echo $exif | cut -d ':' -f5 | cut -c3-4`
	minute=`echo $exif | cut -d ':' -f6`
	seconde=`echo $exif | cut -d ':' -f7`
	date_complete=`printf '%s_%s_%s_%sh%sm%s_%s.jpg' $annee $mois $jour $heure $minute $seconde &quot;$nomsortie&quot;`
	echo &quot;${date_complete}&quot;
	cp $i $repertoire/$nomsortie/$date_complete
}

# On verifie qu'un repertoire a ete entre
if test &quot;$repertoire&quot; = &quot;&quot;
then
	echo &quot;Veuillez preciser le repertoire de photos a traiter !&quot;
	exit 1
fi

# On verifie qu'un nom a ete entre
if test &quot;$nomsortie&quot; = &quot;&quot;
then
	echo &quot;Veuillez preciser un nom de fichier generique a donner a vos photos !&quot;
	exit 2
fi

# On verifie que le programme identify existe
which identify &gt;&gt; /dev/null 2&gt;&gt; /dev/null
identify_exists=`echo $?`
if test $identify_exists -ne 0
then
	echo &quot;Veuillez installer ImageMagick !&quot;
	exit 1
fi

mkdir $repertoire/$nomsortie

ls -b1 $repertoire/* | while read i
do
	nb_char=`echo -n &quot;$i&quot; | wc -c`
	prem_char=`expr $nb_char - 3`
	extension=`echo &quot;$i&quot; | cut -c${prem_char}-${nb_char} | tr a-z A-Z`
	if test &quot;JPEG&quot; = &quot;$extension&quot; || test &quot;.JPG&quot; = &quot;$extension&quot;
	then
		traite_exif &quot;$i&quot;
	fi
done</pre> <a href="http://www.posteet.com/tags/exif">[exif]</a>  <a href="http://www.posteet.com/tags/identify">[identify]</a>  <a href="http://www.posteet.com/tags/ImageMagick">[ImageMagick]</a>  <a href="http://www.posteet.com/tags/photos">[photos]</a> ]]>        </description>
        <dc:creator>benoitbalon</dc:creator>
        <pubDate>Wed, 18 Jun 2008 19:13:01 +0000</pubDate>

            <category>exif</category>
            <category>identify</category>
            <category>ImageMagick</category>
            <category>photos</category>
    
    </item>

  
    <item>
        <title>afficher arbre OID sous Linux</title>
        <link>http://www.posteet.com/view/1018</link>
        <description>
        <![CDATA[<pre>snmptranslate -Tp -IR system
# ou system est le nom de la branche à afficher</pre> <a href="http://www.posteet.com/tags/linux">[linux]</a>  <a href="http://www.posteet.com/tags/oid">[oid]</a>  <a href="http://www.posteet.com/tags/snmp">[snmp]</a>  <a href="http://www.posteet.com/tags/supervision">[supervision]</a> ]]>        </description>
        <dc:creator>neorom</dc:creator>
        <pubDate>Wed, 18 Jun 2008 16:40:57 +0000</pubDate>

            <category>linux</category>
            <category>oid</category>
            <category>snmp</category>
            <category>supervision</category>
    
    </item>

  
    <item>
        <title>Interdire le PHP dans un répertoire avec apache</title>
        <link>http://www.posteet.com/view/1014</link>
        <description>
        <![CDATA[<pre># ajouter la conf suivante dans votre VirtualHost

&lt;Location /upload/&gt;
   AddType text/plain .php .php4 .php5 .phtml .py .pl .cgi .rb
&lt;/Location&gt;</pre> <a href="http://www.posteet.com/tags/apache">[apache]</a>  <a href="http://www.posteet.com/tags/php">[php]</a>  <a href="http://www.posteet.com/tags/security">[security]</a>  <a href="http://www.posteet.com/tags/virtualhost">[virtualhost]</a> ]]>        </description>
        <dc:creator>spirit</dc:creator>
        <pubDate>Tue, 17 Jun 2008 15:52:30 +0000</pubDate>

            <category>apache</category>
            <category>php</category>
            <category>security</category>
            <category>virtualhost</category>
    
    </item>

  
    <item>
        <title>Catch SIGINT and SIGTERM in a shell script (CTRL-C)</title>
        <link>http://www.posteet.com/view/1013</link>
        <description>
        <![CDATA[<pre>trap &quot;/usr/bin/mycmd; exit 255&quot; SIGINT SIGTERM</pre> <a href="http://www.posteet.com/tags/bash">[bash]</a>  <a href="http://www.posteet.com/tags/script">[script]</a>  <a href="http://www.posteet.com/tags/shell">[shell]</a>  <a href="http://www.posteet.com/tags/sigint">[sigint]</a>  <a href="http://www.posteet.com/tags/sigterm">[sigterm]</a>  <a href="http://www.posteet.com/tags/trap">[trap]</a> ]]>        </description>
        <dc:creator>spirit</dc:creator>
        <pubDate>Tue, 17 Jun 2008 15:41:20 +0000</pubDate>

            <category>bash</category>
            <category>script</category>
            <category>shell</category>
            <category>sigint</category>
            <category>sigterm</category>
            <category>trap</category>
    
    </item>

  
    <item>
        <title>Cross-browser example of AJAX/XMLHttpRequest</title>
        <link>http://www.posteet.com/view/1012</link>
        <description>
        <![CDATA[<pre>function ajax(url, vars, callbackFunction) { var request = new XMLHttpRequest(); request.open(&quot;POST&quot;, url, true); request.setRequestHeader(&quot;Content-Type&quot;, &quot;application/x-www-form-urlencoded&quot;); request.onreadystatechange = function() { if (request.readyState == 4 &amp;&amp; request.status == 200) { if (request.responseText) { callbackFunction(request.responseText); } } }; request.send(vars); }</pre> <a href="http://www.posteet.com/tags/ajax">[ajax]</a>  <a href="http://www.posteet.com/tags/xmlhttprequest">[xmlhttprequest]</a> ]]>        </description>
        <dc:creator>fandelost</dc:creator>
        <pubDate>Tue, 17 Jun 2008 15:18:05 +0000</pubDate>

            <category>ajax</category>
            <category>xmlhttprequest</category>
    
    </item>

  
    <item>
        <title>cPanel Remote Bandwidth Script</title>
        <link>http://www.posteet.com/view/1011</link>
        <description>
        <![CDATA[<pre>&lt;?php 
class cpanel 
{ 
    /**  
    * @var        resource        contains curl resource for communication with cpanel  
    **/ 
    var $socket ; 
    /** 
    * @param    string            username          your cpanel username 
    * @param    string            password          your cpanel password 
    * @param    string            hostname          your cpanel hostname 
    * @param    bool            ssl                  indicate ssl availability 
    * @param    string            theme              indicate the theme being used 
    * @return    void 
    * 
    * This will give you the default settings of using ssl and X as the theme 
    * &lt;code&gt;&lt;?php $cpanel = new cpanel( 'username', 'password', 'hostname' ); ?&gt;&lt;/code&gt; 
    *  
    * This will allow you to disable SSL 
    * &lt;code&gt;&lt;?php $cpanel = new cpanel( 'username', 'password', 'hostname', false ); ?&gt;&lt;/code&gt; 
    *  
    * This will allow you to disable SSL and change the theme 
    * &lt;code&gt;&lt;?php $cpanel = new cpanel( 'username', 'password', 'hostname', false, 'mytheme' ); ?&gt;&lt;/code&gt; 
    **/ 
    function cpanel( $username, $password, $hostname, $ssl = true, $theme = 'x' ) 
    { 
        $this-&gt;ssl = $ssl ; 
        $this-&gt;username = $username ; 
        $this-&gt;password = $password ; 
        $this-&gt;hostname = $hostname ; 
        $this-&gt;request = $request ; 
        $this-&gt;theme = $theme ; 
         
        if( !( $this-&gt;socket = @curl_init( ) ) ): die('FATAL : Cannot initialize curl'); 
            return; 
        else:     
            if( $this-&gt;ssl ): 
                curl_setopt( $this-&gt;socket, CURLOPT_SSL_VERIFYPEER, 0 );                 
                curl_setopt( $this-&gt;socket, CURLOPT_SSL_VERIFYHOST, 0 ); 
            endif; 
             
            curl_setopt( $this-&gt;socket, CURLOPT_FOLLOWLOCATION, 1 ); 
            curl_setopt( $this-&gt;socket, CURLOPT_HEADER, 0 ); 
            curl_setopt( $this-&gt;socket, CURLOPT_RETURNTRANSFER, 1 ); 
            curl_setopt( $this-&gt;socket, CURLOPT_HTTPHEADER,  
            array( sprintf( &quot;Authorization: Basic %s&quot;, base64_encode( sprintf( '%s:%s', $this-&gt;username, $this-&gt;password ) ) ) ) 
            ); 
        endif;     
         
        if( ereg( 'Login Attempt Failed', $this-&gt;make_request( sprintf( '/frontend/%s/', $this-&gt;theme ) ) ) ) 
            die(&quot;Cannot login to cpanel&quot;); 
    } 
    /** 
    * @param    string            request            the page to retrieve from cpanel 
    * @return    string            returns raw data 
    * 
    * This would retrieve the index page from cpanel 
    * &lt;code&gt;&lt;?php $cpanel-&gt;make_request( &quot;/frontend/$cpanel-&gt;theme&quot; ); ?&gt; 
    **/ 
    function make_request( $request ) 
    { 
        if( $this-&gt;ssl ) 
            curl_setopt( $this-&gt;socket, CURLOPT_URL, sprintf( &quot;https://%s:2083%s&quot;,$this-&gt;hostname,  $request ) ); 
        else 
            curl_setopt( $this-&gt;socket, CURLOPT_URL, sprintf( &quot;http://%s:2082%s&quot;,$this-&gt;hostname,  $request ) ); 
         
        return curl_exec( $this-&gt;socket ); 
    } 
    /** 
    * @return    string            returns html tables of table from cpanel index 
    * 
    * This example method returns all your account information from cpanel index, unformatted 
    * &lt;code&gt;&lt;?php echo $cpanel-&gt;account_tables( ); ?&gt;&lt;/code&gt; 
    **/ 
    function account_tables( ) 
    { 
        preg_match_all( '#(&lt;table width=&quot;275&quot; border=&quot;0&quot; cellspacing=&quot;3&quot; cellpadding=&quot;4&quot;&gt;.*?[^&lt;]&lt;/table&gt;)#si',  
                        $this-&gt;make_request( sprintf( &quot;/frontend/%s/&quot;, $this-&gt;theme ) ),  
                        $return  
        ); 
        return implode( &quot;&lt;br /&gt;&quot;, $return[0] ); 
    } 
    /** 
    * This method closes the curl resource 
    * 
    * &lt;code&gt;&lt;?php $cpanel-&gt;_close( ); ?&gt;&lt;/code&gt; 
    **/     
    function _close( ) 
    { 
        return @curl_close( $this-&gt;socket ); 
    } 
} 
$cpanel = new cpanel( &quot;username&quot;, &quot;password&quot;, &quot;hostname&quot; ); 

echo $cpanel-&gt;account_tables( ); 

$cpanel-&gt;_close( ); 
?&gt;</pre> <a href="http://www.posteet.com/tags/bandwith">[bandwith]</a>  <a href="http://www.posteet.com/tags/cpanel">[cpanel]</a>  <a href="http://www.posteet.com/tags/curl">[curl]</a> ]]>        </description>
        <dc:creator>fandelost</dc:creator>
        <pubDate>Tue, 17 Jun 2008 14:35:50 +0000</pubDate>

            <category>bandwith</category>
            <category>cpanel</category>
            <category>curl</category>
    
    </item>


</channel>
</rss>
