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

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

    
    <item>
        <title>Script d'import automatique d'un projet dans Subversion et création des rep trunk, branches et tags</title>
        <link>http://www.posteet.com/view/1257</link>
        <description>
        <![CDATA[<pre>#!/bin/bash

# Vous pouvez éditer ces variables selon vos besoins
SVN_ROOT=&quot;/var/svn&quot;
SVN_TMP_PATH=&quot;/tmp/svn&quot;
APACHE_USER=&quot;www-data&quot;
APAGE_GROUP=&quot;www-data&quot;
TRAC_ROOT=&quot;/var/trac&quot;
TRAC_SHARE=&quot;/usr/share/trac&quot;

# Ce script doit être executer avec les droits de superutilisateur
test -w /root; 
if [ ! &quot;$?&quot; -eq &quot;0&quot; ]; then 
	echo &quot;Vous devez executer ce script en tant que superutilisateur.&quot;
	exit 0
fi 

echo &quot;#######################################&quot;
echo &quot;Création d'un nouveau projet Subversion&quot;
echo &quot;#######################################&quot;
echo &quot;&quot;
echo &quot;Tapez le nom du nouveau projet :&quot;
read PROJECT_NAME

if [ -z &quot;$PROJECT_NAME&quot; ]; then
        echo &quot;$PROJECT_NAME n'est pas un nom de projet valide.&quot;;
        exit 0  
fi

echo &quot;Tapez maintenant le chemin du répertoire source :&quot;
echo &quot;(Note: les répertoires trunk, branches et tags seront créés automatiquement)&quot;
read PROJECT_SOURCE_PATH

if [ -z &quot;$PROJECT_SOURCE_PATH&quot; -o ! -d $PROJECT_SOURCE_PATH ]; then
	echo &quot;$PROJECT_SOURCE_PATH n'est pas un répertoire valide.&quot;;
	exit 0
fi

echo &quot;Création du projet $PROJECT_NAME depuis $PROJECT_SOURCE_PATH...&quot;

# Si le répertoire $SVN_ROOT n'existe pas, on le crée
if [ ! -d $SVN_ROOT ]; then
	mkdir $SVN_ROOT
fi

# Si le répertoire $SVN_TMP_PATH n'existe pas, on le crée
if [ ! -d $SVN_TMP_PATH ]; then
	mkdir $SVN_TMP_PATH
fi	

# Création du répertoire du dépôt
mkdir $SVN_ROOT/$PROJECT_NAME

# Création d'un répertoire temporaire de stockage avant import
mkdir $SVN_TMP_PATH/$PROJECT_NAME
mkdir $SVN_TMP_PATH/$PROJECT_NAME/branches
mkdir $SVN_TMP_PATH/$PROJECT_NAME/tags
mkdir $SVN_TMP_PATH/$PROJECT_NAME/trunk

# Copie des fichiers originaux dans le répertoire temporaire
cp -R $PROJECT_SOURCE_PATH/* $SVN_TMP_PATH/$PROJECT_NAME/trunk/

# Création du dépôt et import depuis le répertoire créé
svnadmin create $SVN_ROOT/$PROJECT_NAME
svn import $SVN_TMP_PATH/$PROJECT_NAME file://$SVN_ROOT/$PROJECT_NAME -m &quot;Initial import&quot;

# Attribution des permissions à Apache sur le repertoire du dépot
chown -R $APACHE_USER:$APACHE_GROUP $SVN_ROOT/$PROJECT_NAME

# Attribution de droits supplémentaires
sudo chown -R $APACHE_USER:$APACHE_GROUP $TRAC_SHARE

# Suppression du répertoire temporaire
rm -rf $SVN_TMP_PATH/$PROJECT_NAME	

# Done !
echo &quot;&quot;
echo &quot;Projet subversion $PROJECT_NAME créé avec succès dans $SVN_ROOT/$PROJECT_NAME !&quot;</pre> <a href="http://www.posteet.com/tags/import">[import]</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/svn">[svn]</a> ]]>        </description>
        <dc:creator>spirit</dc:creator>
        <pubDate>Wed, 10 Sep 2008 19:02:21 +0000</pubDate>

            <category>import</category>
            <category>script</category>
            <category>shell</category>
            <category>svn</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 13: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>Masquer l'execution en tache planifiée d'un fichier batch (.bat)</title>
        <link>http://www.posteet.com/view/447</link>
        <description>
        <![CDATA[<pre>Il faut créer un fichier VBS contenant ceci :

----8&lt;------8&lt;------8&lt;------8&lt;------8&lt;------8&lt;--
' *** Script start ***
Set oShell = CreateObject(&quot;WScript.Shell&quot;)

oShell.Run &quot;toto.bat&quot;, 0, True 
----8&lt;------8&lt;------8&lt;------8&lt;------8&lt;------8&lt;--

Cela permet d'exécuter toto.bat sans fenêtre de commande DOS.</pre> <a href="http://www.posteet.com/tags/batch">[batch]</a>  <a href="http://www.posteet.com/tags/script">[script]</a>  <a href="http://www.posteet.com/tags/vbscript">[vbscript]</a>  <a href="http://www.posteet.com/tags/windows">[windows]</a> ]]>        </description>
        <dc:creator>skymaxs</dc:creator>
        <pubDate>Thu, 15 Nov 2007 11:24:36 +0000</pubDate>

            <category>batch</category>
            <category>script</category>
            <category>vbscript</category>
            <category>windows</category>
    
    </item>

  
    <item>
        <title>Nettoyer une page HTML de ces balises</title>
        <link>http://www.posteet.com/view/411</link>
        <description>
        <![CDATA[<pre>function html2txt($document){
	$search = array('@&lt;script[^&gt;]*?&gt;.*?&lt;/script&gt;@si', // Strip out javascript
	'@&lt;style[^&gt;]*?&gt;.*?&lt;/style&gt;@siU', // Strip style tags properly
	'@&lt;[?]php[^&gt;].*?[?]&gt;@si', //scripts php
	'@&lt;[?][^&gt;].*?[?]&gt;@si', //scripts php
	'@&lt;[\/\!]*?[^&lt;&gt;]*?&gt;@si', // Strip out HTML tags
	'@&lt;![\s\S]*?--[ \t\n\r]*&gt;@', // Strip multi-line comments including CDATA
	);
	$text = preg_replace($search, '', $document);
	return $text;
}</pre> <a href="http://www.posteet.com/tags/balise">[balise]</a>  <a href="http://www.posteet.com/tags/css">[css]</a>  <a href="http://www.posteet.com/tags/html">[html]</a>  <a href="http://www.posteet.com/tags/php">[php]</a>  <a href="http://www.posteet.com/tags/script">[script]</a> ]]>        </description>
        <dc:creator>spawnrider</dc:creator>
        <pubDate>Tue, 13 Nov 2007 08:52:52 +0000</pubDate>

            <category>balise</category>
            <category>css</category>
            <category>html</category>
            <category>php</category>
            <category>script</category>
    
    </item>


</channel>
</rss>
