<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>It&#039;s g33k</title>
	<atom:link href="http://www.itsg33k.ca/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.itsg33k.ca</link>
	<description>et j&#039;aime ça!</description>
	<lastBuildDate>Thu, 10 Nov 2011 22:09:44 +0000</lastBuildDate>
	<language>fr</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>127 Montréal &#8211; Un groupe de supporteurs Impact de Montréal</title>
		<link>http://www.itsg33k.ca/2011/11/10/127-montreal-un-groupe-de-supporteurs-impact-de-montreal/</link>
		<comments>http://www.itsg33k.ca/2011/11/10/127-montreal-un-groupe-de-supporteurs-impact-de-montreal/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 16:10:22 +0000</pubDate>
		<dc:creator>David Laperle</dc:creator>
				<category><![CDATA[Mes projets]]></category>

		<guid isPermaLink="false">http://www.itsg33k.ca/?p=532</guid>
		<description><![CDATA[Récemment, j&#8217;ai travaillé sur un nouveau projet [ http://www.127montreal.com ]. C&#8217;est le groupe de supporteurs de l&#8217;Impact de Montréal que j&#8217;ai joins pour l&#8217;an prochain en MLS. Technologies utilisées: PHP CSS MySQL WordPress]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.itsg33k.ca/wp-content/uploads/2011/11/logo.png"><img src="http://www.itsg33k.ca/wp-content/uploads/2011/11/logo.png" alt="" title="logo" width="237" height="175" class="aligncenter size-full wp-image-533" /></a></p>
<p>Récemment, j&#8217;ai travaillé sur un nouveau projet [ <a href="http://www.127montreal.com" title="127montreal.com" target="_blank">http://www.127montreal.com</a> ]. C&#8217;est le groupe de supporteurs de l&#8217;Impact de Montréal que j&#8217;ai joins pour l&#8217;an prochain en MLS.<span id="more-532"></span></p>
<p><strong>Technologies utilisées: </strong></p>
<ul>
<li><strong><em>PHP</em></strong></li>
<li><strong><em>CSS</em></strong></li>
<li><strong><em>MySQL</em></strong></li>
<li><strong><em>WordPress</em></strong></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.itsg33k.ca/2011/11/10/127-montreal-un-groupe-de-supporteurs-impact-de-montreal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuration Evolution pour Exchange 2010 en utilisant MAPI</title>
		<link>http://www.itsg33k.ca/2011/09/28/configuration-evolution-pour-exchange-2010-en-utilisant-mapi/</link>
		<comments>http://www.itsg33k.ca/2011/09/28/configuration-evolution-pour-exchange-2010-en-utilisant-mapi/#comments</comments>
		<pubDate>Wed, 28 Sep 2011 16:54:12 +0000</pubDate>
		<dc:creator>David Laperle</dc:creator>
				<category><![CDATA[Fedora]]></category>
		<category><![CDATA[15]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[evolution]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.itsg33k.ca/?p=502</guid>
		<description><![CDATA[Dans un monde parfait, nous pourrions connecter n&#8217;importe quel client mail sur Exchange 2010 en mode natif et ainsi recevoir nos emails/calendriers/tâches etc&#8230; et bien j&#8217;ai la solution pour vous si vous tentez de faire ceci sous Evolution dans Fedora 15, en utilisant MAPI. Installation des dépendances sudo yum install evolution-mapi Configuration Evolution Ajouter un [...]]]></description>
			<content:encoded><![CDATA[<p>Dans un monde parfait, nous pourrions connecter n&#8217;importe quel client mail sur Exchange 2010 en mode natif et ainsi recevoir nos emails/calendriers/tâches etc&#8230; et bien j&#8217;ai la solution pour vous si vous tentez de faire ceci sous Evolution dans Fedora 15, en utilisant MAPI.<br />
<span id="more-502"></span></p>
<p><strong>Installation des dépendances</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> yum <span style="color: #c20cb9; font-weight: bold;">install</span> evolution-mapi</pre></div></div>

<p><strong>Configuration Evolution</strong></p>
<ol>
<li>Ajouter un nouveau compte</li>
<li>Choisir le type &laquo;&nbsp;Exchange MAPI&nbsp;&raquo; dans la liste déroulante &laquo;&nbsp;Server Type&nbsp;&raquo;</li>
<li><strong>Server:</strong> Nom ou IP du serveur exchange 2010</li>
<li><strong>User Name:</strong> Votre &laquo;&nbsp;short&nbsp;&raquo; username</li>
<li><strong>Domain name:</strong> Habituellement votre nom de domaine (pas le FQDN) et en majuscule, si votre domaine est domain.internal, alors le Domain name est DOMAIN</li>
<li><strong>Use secure connection:</strong> Coché</li>
<li>Tester avec le bouton &laquo;&nbsp;Authenticate&nbsp;&raquo;</li>
</ol>
<p><strong>Problème avec le calendrier?</strong><br />
Pour une raison que j&#8217;ignore encore, le calendrier ne s&#8217;affiche pas, pourtant il devrait. J&#8217;ai fais quelques recherches, et voici la solution.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nohup</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>libexec<span style="color: #000000; font-weight: bold;">/</span>e-calendar-factory <span style="color: #000000; font-weight: bold;">&amp;</span></pre></div></div>

<p>Il semble que Evolution ne démarre pas ce process au démarrage et celui-ci est nécessaire pour gérer le calendrier, en le démarrant manuellement avant le démarrager d&#8217;Evolution on règle le problème. Pour bien faire, ajoutez-le à votre session manager pour que ca se fasse au login, comme ça plus besoin d&#8217;y penser.</p>
<p>Voilà, tout ceci devrait vous permettre d&#8217;avoir accès à votre compte à partir de votre Fedora Core 15. Les étapes sont différentes si vous utilisez Ubuntu ou autre distributions, donc vous pouvez utiliser ce guide même si vous n&#8217;êtes pas sous Fedora Core 15, mais ne vous attendez pas à des miracles.</p>
<p><a href="http://www.itsg33k.ca/wp-content/uploads/2011/05/Fedora-15-Logo.png"><img src="http://www.itsg33k.ca/wp-content/uploads/2011/05/Fedora-15-Logo-300x90.png" alt="" title="Fedora-15-Logo" width="300" height="90" class="aligncenter size-medium wp-image-270" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.itsg33k.ca/2011/09/28/configuration-evolution-pour-exchange-2010-en-utilisant-mapi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wallpaper Impact Montréal avec nouveau logo MLS 2012</title>
		<link>http://www.itsg33k.ca/2011/08/07/wallpaper-impact-montreal-avec-nouveau-logo-mls-2012/</link>
		<comments>http://www.itsg33k.ca/2011/08/07/wallpaper-impact-montreal-avec-nouveau-logo-mls-2012/#comments</comments>
		<pubDate>Mon, 08 Aug 2011 03:26:41 +0000</pubDate>
		<dc:creator>David Laperle</dc:creator>
				<category><![CDATA[Sports]]></category>
		<category><![CDATA[impact]]></category>
		<category><![CDATA[sport]]></category>

		<guid isPermaLink="false">http://www.itsg33k.ca/?p=490</guid>
		<description><![CDATA[Cliquez sur l&#8217;image pour avoir la version 1680&#215;1050]]></description>
			<content:encoded><![CDATA[<p><strong>Cliquez sur l&#8217;image pour avoir la version 1680&#215;1050</strong><br />
<a href="http://www.itsg33k.ca/wp-content/uploads/2011/08/impact_wallpaper.png"><img src="http://www.itsg33k.ca/wp-content/uploads/2011/08/impact_wallpaper-300x187.png" alt="" title="impact_wallpaper" width="300" height="187" class="aligncenter size-medium wp-image-491" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.itsg33k.ca/2011/08/07/wallpaper-impact-montreal-avec-nouveau-logo-mls-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configure un mirroir Ubuntu sur un serveur CentOS</title>
		<link>http://www.itsg33k.ca/2011/07/25/configure-un-mirroir-ubuntu-sur-un-serveur-centos/</link>
		<comments>http://www.itsg33k.ca/2011/07/25/configure-un-mirroir-ubuntu-sur-un-serveur-centos/#comments</comments>
		<pubDate>Mon, 25 Jul 2011 13:55:42 +0000</pubDate>
		<dc:creator>David Laperle</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.itsg33k.ca/?p=453</guid>
		<description><![CDATA[Comme on l&#8217;a vu dans un article précédent (http://www.itsg33k.ca/2011/07/08/configuration-dun-serveur-mirroir-yum-centos-local/) on peut facilement configurer un serveur CentOS pour qu&#8217;il puisse servir de mirroir local, qu&#8217;arrive-t-il si on désire conserver un seul serveur pour faire tout le travail de repository et on ne veut pas avoir à avoir un serveur par distribution à partager. Cette article démontrera [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.itsg33k.ca/wp-content/uploads/2011/07/centos.png"><img src="http://www.itsg33k.ca/wp-content/uploads/2011/07/centos-300x114.png" alt="" title="centos" width="300" height="114" class="aligncenter size-medium wp-image-401" /></a><br />
Comme on l&#8217;a vu dans un article précédent (<a href="http://www.itsg33k.ca/2011/07/08/configuration-dun-serveur-mirroir-yum-centos-local/">http://www.itsg33k.ca/2011/07/08/configuration-dun-serveur-mirroir-yum-centos-local/</a>) on peut facilement configurer un serveur CentOS pour qu&#8217;il puisse servir de mirroir local, qu&#8217;arrive-t-il si on désire conserver un seul serveur pour faire tout le travail de repository et on ne veut pas avoir à avoir un serveur par distribution à partager. Cette article démontrera comment configurer votre serveur CentOS pour qu&#8217;il puisse servir de mirroir local Ubuntu avec autant de flexibilité que si vous seriez sur une machine Ubuntu.<br />
<span id="more-453"></span><br />
<strong>Installation debmirror</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">yum <span style="color: #c20cb9; font-weight: bold;">install</span> perl-libwww-perl perl-Digest-SHA1 perl-Net<span style="color: #000000; font-weight: bold;">*</span> rsync
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>pkgs.repoforge.org<span style="color: #000000; font-weight: bold;">/</span>perl-LockFile-Simple<span style="color: #000000; font-weight: bold;">/</span>perl-LockFile-Simple-<span style="color: #000000;">0.207</span>-<span style="color: #000000;">1</span>.el5.rf.noarch.rpm
rpm <span style="color: #660033;">-ivh</span> perl-LockFile-Simple-<span style="color: #000000;">0.207</span>-<span style="color: #000000;">1</span>.el5.rf.noarch.rpm
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>archive.ubuntu.com<span style="color: #000000; font-weight: bold;">/</span>ubuntu<span style="color: #000000; font-weight: bold;">/</span>pool<span style="color: #000000; font-weight: bold;">/</span>universe<span style="color: #000000; font-weight: bold;">/</span>d<span style="color: #000000; font-weight: bold;">/</span>debmirror<span style="color: #000000; font-weight: bold;">/</span>debmirror_20070123ubuntu1.tar.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf debmirror_20070123ubuntu1.tar.gz
<span style="color: #c20cb9; font-weight: bold;">cp</span> debmirror_20070123<span style="color: #000000; font-weight: bold;">/</span>debmirror <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin
debmirror <span style="color: #666666; font-style: italic;"># Testons le programme, s'il manque des dépendances installez-les (principalement des modules Perl)</span></pre></div></div>

<p><strong>Répertoire mirroir</strong><br />
Ici je prends en compte que vous avez déjà un serveur web fonctionnel, il suffit donc de créer un nouveau répertoire à l&#8217;intérieur de votre environnement Apache pour recevoir les fichiers.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>html<span style="color: #000000; font-weight: bold;">/</span>ubuntu</pre></div></div>

<p><strong>Configuration keyring</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>mirrorkeyring
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>mirrorkeyring
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>ubuntu.mirror.iweb.ca<span style="color: #000000; font-weight: bold;">/</span>project<span style="color: #000000; font-weight: bold;">/</span>ubuntu-archive-keyring.gpg
gpg <span style="color: #660033;">--no-default-keyring</span> <span style="color: #660033;">--keyring</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>mirrorkeyring<span style="color: #000000; font-weight: bold;">/</span>trustedkeys.gpg <span style="color: #660033;">--import</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>mirrorkeyring<span style="color: #000000; font-weight: bold;">/</span>ubuntu-archive-keyring.gpg</pre></div></div>

<p><strong>Script de synchronisation</strong><br />
Vous pouvez le sauvegarder où vous voulez personellement c&#8217;est : /usr/local/bin/update_ubuntu</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">GNUPGHOME</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>mirrorkeyring
&nbsp;
<span style="color: #666666; font-style: italic;"># Arch=         -a	# Architecture. For Ubuntu can be i386, powerpc or amd64.</span>
<span style="color: #007800;">arch</span>=i386,amd64
<span style="color: #007800;">section</span>=main,restricted,universe,multiverse
&nbsp;
<span style="color: #666666; font-style: italic;"># Release=	-d	# Release of the system (Dapper, Edgy, Feisty, Gutsy, Hardy, Intrepid), and the -updates and -security ( -backports can be added if desired)</span>
<span style="color: #007800;">release</span>=maverick,maverick-updates,maverick-security,natty,natty-updates,natty-security
&nbsp;
<span style="color: #666666; font-style: italic;"># Server=	-h	# Server name, minus the protocol and the path at the end</span>
<span style="color: #007800;">server</span>=ubuntu.mirror.iweb.ca
&nbsp;
<span style="color: #666666; font-style: italic;"># Dir=          -r	# Path from the main server, so http://my.web.server/$dir, Server dependant</span>
<span style="color: #007800;">inPath</span>=<span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Proto=        -e	# Protocol to use for transfer (http, ftp, hftp)</span>
<span style="color: #007800;">proto</span>=http
&nbsp;
<span style="color: #666666; font-style: italic;"># Outpath=              # Directory to store the mirror in</span>
<span style="color: #007800;">outPath</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>html<span style="color: #000000; font-weight: bold;">/</span>ubuntu
&nbsp;
<span style="color: #666666; font-style: italic;"># The --nosource option only downloads debs and not deb-src's</span>
<span style="color: #666666; font-style: italic;"># The --progress option shows files as they are downloaded</span>
<span style="color: #666666; font-style: italic;"># --source \ in the place of --no-source \ if you want sources also.</span>
<span style="color: #666666; font-style: italic;"># --nocleanup  Do not clean up the local mirror after mirroring is complete. Use this option to keep older repository</span>
<span style="color: #666666; font-style: italic;"># Start script</span>
<span style="color: #666666; font-style: italic;">#</span>
debmirror	<span style="color: #660033;">-a</span> <span style="color: #007800;">$arch</span> \
                <span style="color: #660033;">--no-source</span> \
                <span style="color: #660033;">-s</span> <span style="color: #007800;">$section</span> \
                <span style="color: #660033;">-h</span> <span style="color: #007800;">$server</span> \
                <span style="color: #660033;">-d</span> <span style="color: #007800;">$release</span> \
                <span style="color: #660033;">-r</span> <span style="color: #007800;">$inPath</span> \
                <span style="color: #660033;">-e</span> <span style="color: #007800;">$proto</span> \
                <span style="color: #007800;">$outPath</span></pre></div></div>

<p><strong>Execution du script</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">update_ubuntu <span style="color: #000000; font-weight: bold;">&amp;</span> <span style="color: #666666; font-style: italic;">#On envoie en background vu que ça risque d'être long!</span></pre></div></div>

<p>Il vous suffit d&#8217;attendre maintenant, si vous avez des questions, utilisez les commentaires ci-bas!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itsg33k.ca/2011/07/25/configure-un-mirroir-ubuntu-sur-un-serveur-centos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cisco ASA et DNSSEC</title>
		<link>http://www.itsg33k.ca/2011/07/13/cisco-asa-et-dnssec/</link>
		<comments>http://www.itsg33k.ca/2011/07/13/cisco-asa-et-dnssec/#comments</comments>
		<pubDate>Wed, 13 Jul 2011 16:29:20 +0000</pubDate>
		<dc:creator>David Laperle</dc:creator>
				<category><![CDATA[Sécurité Informatique]]></category>
		<category><![CDATA[asa]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[securite]]></category>

		<guid isPermaLink="false">http://www.itsg33k.ca/?p=437</guid>
		<description><![CDATA[Depuis un certain temps (5 mai 2011) pour être exact, les root servers DNS ont ajoutés la feature de DNSSEC. Cet ajout, bien que nécessaire au niveau structurel et sécuritaire a pour effet d&#8217;avoir la possiblité de faire augmenter la grosseur des paquets DNS. Le défaut est 512 bytes dans le ASA, avec cette article [...]]]></description>
			<content:encoded><![CDATA[<h3 style="text-align: center;"><a href="http://www.itsg33k.ca/wp-content/uploads/2010/04/cisco-logo.gif"><img title="cisco-logo" src="http://www.itsg33k.ca/wp-content/uploads/2010/04/cisco-logo.gif" alt="" width="324" height="212" /></a></h3>
<p>Depuis un certain temps (5 mai 2011) pour être exact, les root servers DNS ont ajoutés la feature de DNSSEC. Cet ajout, bien que nécessaire au niveau structurel et sécuritaire a pour effet d&#8217;avoir la possiblité de faire augmenter la grosseur des paquets DNS. Le défaut est 512 bytes dans le ASA, avec cette article on va le changer à 4096, ce qui devrait être plus que nécessaire.</p>
<p><span id="more-437"></span><br />
<strong>Configuration par défaut</strong></p>
<pre lang=''>
policy-map type inspect dns preset_dns_map
 parameters
  message-length maximum 512
</pre>
<p><strong>Nouvelle configuration</strong></p>
<pre lang=''>
policy-map type inspect dns preset_dns_map
 parameters
  message-length maximum 4096
</pre>
<p>Ce changement devrait régler le problème de DNSSEC, et possiblement d&#8217;autres problèmes avec Windows 2008 R2 (DNS) qui a tendance à faire des paquets DNS volumineux!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itsg33k.ca/2011/07/13/cisco-asa-et-dnssec/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Comment utiliser Kickstart avec PXE et mirroir Yum local</title>
		<link>http://www.itsg33k.ca/2011/07/12/utilisation-kickstart-pxe-mirroir-yum-local/</link>
		<comments>http://www.itsg33k.ca/2011/07/12/utilisation-kickstart-pxe-mirroir-yum-local/#comments</comments>
		<pubDate>Tue, 12 Jul 2011 17:55:21 +0000</pubDate>
		<dc:creator>David Laperle</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.itsg33k.ca/?p=423</guid>
		<description><![CDATA[Dans deux articles précédents, on a vu comment configurer un serveur local pour servir les updates YUM et comment configurer le serveur pour agir en tant que server de démarrage PXE, et bien dans cette article, on verra comment configuer ce serveur pour servir des configurations Kickstart et pouvoir ainsi boucler la boucle de ce [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.itsg33k.ca/wp-content/uploads/2011/07/centos.png"><img src="http://www.itsg33k.ca/wp-content/uploads/2011/07/centos-300x114.png" alt="" title="centos" width="300" height="114" class="aligncenter size-medium wp-image-401" /></a><br />
Dans deux articles précédents, on a vu comment configurer un serveur local pour servir les updates YUM et comment configurer le serveur pour agir en tant que server de démarrage PXE, et bien dans cette article, on verra comment configuer ce serveur pour servir des configurations Kickstart et pouvoir ainsi boucler la boucle de ce projet et avoir une infrastructure de déploiement de machine rapide et efficace.<br />
<strong>Configuration du serveur de réplication CentOS</strong><br />
<a href="http://www.itsg33k.ca/2011/07/08/configuration-dun-serveur-mirroir-yum-centos-local/">http://www.itsg33k.ca/2011/07/08/configuration-dun-serveur-mirroir-yum-centos-local/</a></p>
<p><strong>Configuration du serveur PXE CentOS</strong><br />
<a href="http://www.itsg33k.ca/2011/07/11/configurer-un-serveur-pxe-sur-centos/">http://www.itsg33k.ca/2011/07/11/configurer-un-serveur-pxe-sur-centos/</a><br />
<span id="more-423"></span></p>
<p><strong>Dépendances</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">yum <span style="color: #c20cb9; font-weight: bold;">install</span> http</pre></div></div>

<p><strong>Création du répertoire de travail</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>html<span style="color: #000000; font-weight: bold;">/</span>ks</pre></div></div>

<p><strong>Modèle fichier Kickstart CentOS 5.6</strong></p>
<pre lang=''>
install
url --url http://<em>server</em>/DISTRIB/VERSION/os/ARCH
lang en_US
keyboard cf
network --device eth0 --bootproto static --ip NEWIP --netmask NEWMASK --gateway NEWGW --nameserver NEWNS --hostname NEWHOST
rootpw --iscrypted <em>encrypted password</em>
firewall --enabled
authconfig --enableshadow --enablemd5
selinux --disabled
timezone America/Montreal
bootloader --location=mbr
clearpart --all --initlabel
autopart
reboot

%packages --resolvedeps
@Core
@Base
ntp
</pre>
<p><strong>Modèle fichier Kickstart CentOS 6.0</strong></p>
<pre lang=''>
install
url --url http://<em>server</em>/DISTRIB/VERSION/os/ARCH
lang en_US
keyboard cf
network --device eth0 --bootproto static --ip NEWIP --netmask NEWMASK --gateway NEWGW --nameserver NEWNS --hostname NEWHOST
rootpw --iscrypted <em>encrypted password</em>
firewall --enabled
authconfig --enableshadow --enablemd5
selinux --disabled
timezone America/Montreal
bootloader --location=mbr
clearpart --all --initlabel
autopart
reboot

%packages
@Core
@Base
ntp
</pre>
<p><em>Pour utiliser rootpw &#8211;iscrypted vous devez générer un mot de passe valide pour /etc/shadow. Personellement, j&#8217;ai copier/coller le mot de passe déjà &laquo;&nbsp;hashé&nbsp;&raquo; dans /etc/shadow d&#8217;un autre système.</em></p>
<p>Ces deux fichiers Kickstart sont un peu différents, dans CentOS 6.0, certaines commandes sont désuètes et ne peuvent plus êtres utilisés, d&#8217;où l&#8217;importance d&#8217;avoir deux fichiers différents. Dans ces fichiers j&#8217;utilise des mots clefs, que je remplis avec un script. Quand je veux créer une nouvelle machine, j&#8217;utilise le script suivant pour générer un fichier Kickstart spécifique à partir de mes deux templates.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># ARG 1 = IP</span>
<span style="color: #666666; font-style: italic;"># ARG 2 = MASK</span>
<span style="color: #666666; font-style: italic;"># ARG 3 = GATEWAY</span>
<span style="color: #666666; font-style: italic;"># ARG 4 = NAMESERVER</span>
<span style="color: #666666; font-style: italic;"># ARG 5 = HOSTNAME</span>
<span style="color: #666666; font-style: italic;"># ARG 6 = MAC</span>
<span style="color: #666666; font-style: italic;"># ARG 7 = Distrib (centos)</span>
<span style="color: #666666; font-style: italic;"># ARG 8 = Version (5.6 / 6.0)</span>
<span style="color: #666666; font-style: italic;"># ARG 9 = Arch (x86_64)</span>
<span style="color: #666666; font-style: italic;">#</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$#</span> <span style="color: #660033;">-ne</span> <span style="color: #000000;">9</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>;
<span style="color: #000000; font-weight: bold;">then</span>
    	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;USAGE: $0 IP MASK GW NS HOSTNAME MAC DISTRIB {centos} VERSION {5.6 or 6.0} ARCH {x86_64}&quot;</span>;
        <span style="color: #7a0874; font-weight: bold;">exit</span>;
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;$1&quot;</span> = <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>;
<span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;$0  &quot;</span>;
  <span style="color: #7a0874; font-weight: bold;">exit</span>;
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># We modify the PXE file to customize for our install</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>tftpboot<span style="color: #000000; font-weight: bold;">/</span>pxelinux.cfg
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #007800;">$7</span><span style="color: #007800;">$8</span>.<span style="color: #007800;">$9</span>.template <span style="color: #007800;">$7</span><span style="color: #007800;">$8</span>.<span style="color: #007800;">$9</span>.<span style="color: #007800;">$1</span>
<span style="color: #666666; font-style: italic;">#cp default.template $7$8.$9.$1</span>
<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s/newhost/$1/g&quot;</span> <span style="color: #007800;">$7</span><span style="color: #007800;">$8</span>.<span style="color: #007800;">$9</span>.<span style="color: #007800;">$1</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$1</span>.tmp
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #007800;">$1</span>.tmp 01-<span style="color: #007800;">$6</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #007800;">$7</span><span style="color: #007800;">$8</span>.<span style="color: #007800;">$9</span>.<span style="color: #007800;">$1</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># We modify the KS file to customize for our install</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>html<span style="color: #000000; font-weight: bold;">/</span>ks
<span style="color: #c20cb9; font-weight: bold;">cp</span> template.<span style="color: #007800;">$7</span><span style="color: #007800;">$8</span>.<span style="color: #007800;">$9</span>.cfg <span style="color: #007800;">$1</span>.cfg
&nbsp;
<span style="color: #666666; font-style: italic;"># Change NEWIP to IP receive in arg</span>
<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s/NEWIP/$1/g&quot;</span> <span style="color: #007800;">$1</span>.cfg <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$1</span>.tmp
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #007800;">$1</span>.tmp <span style="color: #007800;">$1</span>.cfg
&nbsp;
<span style="color: #666666; font-style: italic;"># Change NEWMASK to MASK receive in arg</span>
<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s/NEWMASK/$2/g&quot;</span> <span style="color: #007800;">$1</span>.cfg <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$1</span>.tmp
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #007800;">$1</span>.tmp <span style="color: #007800;">$1</span>.cfg
&nbsp;
<span style="color: #666666; font-style: italic;"># Change NEWGW to GW receive in arg</span>
<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s/NEWGW/$3/g&quot;</span> <span style="color: #007800;">$1</span>.cfg <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$1</span>.tmp
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #007800;">$1</span>.tmp <span style="color: #007800;">$1</span>.cfg
&nbsp;
<span style="color: #666666; font-style: italic;"># Change NEWNS to NS receive in arg</span>
<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s/NEWNS/$4/g&quot;</span> <span style="color: #007800;">$1</span>.cfg <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$1</span>.tmp
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #007800;">$1</span>.tmp <span style="color: #007800;">$1</span>.cfg
&nbsp;
<span style="color: #666666; font-style: italic;"># Change NEWHOST to HOSTNAME receive in arg</span>
<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s/NEWHOST/$5/g&quot;</span> <span style="color: #007800;">$1</span>.cfg <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$1</span>.tmp
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #007800;">$1</span>.tmp <span style="color: #007800;">$1</span>.cfg
&nbsp;
<span style="color: #666666; font-style: italic;"># Change DISTRIB to Distrib arg</span>
<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s/DISTRIB/$7/g&quot;</span> <span style="color: #007800;">$1</span>.cfg <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$1</span>.tmp
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #007800;">$1</span>.tmp <span style="color: #007800;">$1</span>.cfg
&nbsp;
<span style="color: #666666; font-style: italic;"># Change VERSION to Version arg</span>
<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s/VERSION/$8/g&quot;</span> <span style="color: #007800;">$1</span>.cfg <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$1</span>.tmp
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #007800;">$1</span>.tmp <span style="color: #007800;">$1</span>.cfg
&nbsp;
<span style="color: #666666; font-style: italic;"># Change ARCH to Arch arg</span>
<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s/ARCH/$9/g&quot;</span> <span style="color: #007800;">$1</span>.cfg <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$1</span>.tmp
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #007800;">$1</span>.tmp <span style="color: #007800;">$1</span>.cfg</pre></div></div>

<p>Avant d&#8217;executer ce script veuillez faire les vérifications suivantes: </p>
<ul>
<li>Le fichier /var/www/html/ks/template.centos5.6.x86_64.cfg existe!</li>
<li>Le fichier /var/www/html/ks/template.centos6.0.x86_64.cfg existe!</li>
<li>Le fichier /tftpboot/pxelinux.cfg/centos5.6.x86_64.template existe! <a href="http://www.itsg33k.ca/2011/07/11/configurer-un-serveur-pxe-sur-centos/">(voir article PXE)</a></li>
<li>Le fichier /tftpboot/pxelinux.cfg/centos6.0.x86_64.template existe! <a href="http://www.itsg33k.ca/2011/07/11/configurer-un-serveur-pxe-sur-centos/">(voir article PXE)</a></li>
</ul>
<p>Le script ci-haut, va créer un fichier /var/www/html/ks/<em>IP</em>.cfg à partir des arguments passés au script! De plus il créera un fichier /tftpboot/pxelinux.cfg/01-<em>MAC</em> avec les mêmes info. Ce dernier est essentiel pour le PXE voit la configuration.</p>
<p>Le script ne modifera pas vos templates (tftp ou kickstart) &#8230; assurez-vous d&#8217;ajouter à votre template Kickstart les configurations nécessaires!</p>
<p><a href="http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Installation_Guide/ch-kickstart2.html">Voir les options Kickstart RHEL5.x</a><br />
<a href="http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Installation_Guide/ch-kickstart2.html">Voir les options Kickstart RHEL6.x</a></p>
<p>Notez que je n&#8217;utilise pas la fonction %post de Kickstart, tout simplement parce que j&#8217;utilise des scripts différents pour mes machines et qu&#8217;il trop complexe de les faires auto-détecter les versions etc&#8230; donc je préfère effecturer Kickstart pour faire l&#8217;installation, et après j&#8217;execute le bon script dépendant ma situation. Si vous avez des questions concernant les scripts d&#8217;automatisation, vous pouvez utiliser la section commentaire.</p>
<p>S&#8217;il manque des informations, ou vous avez des questions concernant cet article, veuillez utiliser les commentaires pour me rejoindre.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itsg33k.ca/2011/07/12/utilisation-kickstart-pxe-mirroir-yum-local/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configurer un serveur PXE sur CentOS</title>
		<link>http://www.itsg33k.ca/2011/07/11/configurer-un-serveur-pxe-sur-centos/</link>
		<comments>http://www.itsg33k.ca/2011/07/11/configurer-un-serveur-pxe-sur-centos/#comments</comments>
		<pubDate>Mon, 11 Jul 2011 19:43:27 +0000</pubDate>
		<dc:creator>David Laperle</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.itsg33k.ca/?p=416</guid>
		<description><![CDATA[Comme nous avons déjà vu récemment, on peut facilement avoir un serveur de mirroir CentOS local [ http://www.itsg33k.ca/2011/07/08/configuration-dun-serveur-mirroir-yum-centos-local/]. Maintenant, on va voir comment utiliser ce serveur pour effectuer un démarrage PXE. Dépendances yum install tftp-server syslinux Configuration TFTP /etc/xinetd.d/tftp service tftp &#123; socket_type = dgram protocol = udp wait = yes user = root server [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.itsg33k.ca/wp-content/uploads/2011/07/centos.png"><img src="http://www.itsg33k.ca/wp-content/uploads/2011/07/centos-300x114.png" alt="" title="centos" width="300" height="114" class="aligncenter size-medium wp-image-401" /></a></p>
<p>Comme nous avons déjà vu récemment, on peut facilement avoir un serveur de mirroir CentOS local [ <a href="http://www.itsg33k.ca/2011/07/08/configuration-dun-serveur-mirroir-yum-centos-local/">http://www.itsg33k.ca/2011/07/08/configuration-dun-serveur-mirroir-yum-centos-local/</a>]. Maintenant, on va voir comment utiliser ce serveur pour effectuer un démarrage PXE.<br />
<span id="more-416"></span></p>
<p><strong>Dépendances</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">yum <span style="color: #c20cb9; font-weight: bold;">install</span> tftp-server syslinux</pre></div></div>

<p><strong>Configuration TFTP</strong><br />
<em>/etc/xinetd.d/tftp</em></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">service tftp
<span style="color: #7a0874; font-weight: bold;">&#123;</span>
        socket_type             = dgram
        protocol                = udp
        <span style="color: #7a0874; font-weight: bold;">wait</span>                    = <span style="color: #c20cb9; font-weight: bold;">yes</span>
        user                    = root
        server                  = <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>in.tftpd
        server_args             = <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>tftpboot
        disable                 = no
        per_source              = <span style="color: #000000;">11</span>
        cps                     = <span style="color: #000000;">100</span> <span style="color: #000000;">2</span>
        flags                   = IPv4
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

<p><strong>Préparer le répertoire d&#8217;images</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">service xinetd restart
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>syslinux<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>pxelinux.0,menu.c32,memdisk,mboot.c32,chain.c32<span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #000000; font-weight: bold;">/</span>tftpboot
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>tftpboot<span style="color: #000000; font-weight: bold;">/</span>pxelinux.cfg
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>tftpboot<span style="color: #000000; font-weight: bold;">/</span>images
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>tftpboot<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>centos<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">5.6</span><span style="color: #000000; font-weight: bold;">/</span>x86_64
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>tftpboot<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>centos<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">5.6</span><span style="color: #000000; font-weight: bold;">/</span>x86_64
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>centos.mirror.iweb.ca<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">5.6</span><span style="color: #000000; font-weight: bold;">/</span>os<span style="color: #000000; font-weight: bold;">/</span>x86_64<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>pxeboot<span style="color: #000000; font-weight: bold;">/</span>initrd.img
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>centos.mirror.iweb.ca<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">5.6</span><span style="color: #000000; font-weight: bold;">/</span>os<span style="color: #000000; font-weight: bold;">/</span>x86_64<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>pxeboot<span style="color: #000000; font-weight: bold;">/</span>vmlinuz</pre></div></div>

<p><strong>Configurer le menu PXE</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">default menu.c32
prompt <span style="color: #000000;">0</span>
timeout <span style="color: #000000;">300</span>
ONTIMEOUT <span style="color: #7a0874; font-weight: bold;">local</span>
&nbsp;
MENU TITLE PXE Menu
&nbsp;
LABEL <span style="color: #7a0874; font-weight: bold;">local</span>
	MENU LABEL Boot <span style="color: #7a0874; font-weight: bold;">local</span> hard drive
        LOCALBOOT <span style="color: #000000;">0</span>
&nbsp;
LABEL CentOS <span style="color: #000000;">5.6</span> x86_64 KickStart
        MENU LABEL CentOS <span style="color: #000000;">5.6</span> x86_64 KickStart
        KERNEL images<span style="color: #000000; font-weight: bold;">/</span>centos<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">5.6</span><span style="color: #000000; font-weight: bold;">/</span>x86_64<span style="color: #000000; font-weight: bold;">/</span>vmlinuz
        APPEND <span style="color: #007800;">ks</span>=http:<span style="color: #000000; font-weight: bold;">//&lt;</span>server<span style="color: #000000; font-weight: bold;">&gt;/</span>ks<span style="color: #000000; font-weight: bold;">/</span>newhost.cfg <span style="color: #007800;">initrd</span>=images<span style="color: #000000; font-weight: bold;">/</span>centos<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">5.6</span><span style="color: #000000; font-weight: bold;">/</span>x86_64<span style="color: #000000; font-weight: bold;">/</span>initrd.img text
&nbsp;
LABEL CentOS <span style="color: #000000;">6.0</span> x86_64 KickStart
        MENU LABEL CentOS <span style="color: #000000;">6.0</span> x86_64 KickStart
        KERNEL images<span style="color: #000000; font-weight: bold;">/</span>centos<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">6.0</span><span style="color: #000000; font-weight: bold;">/</span>x86_64<span style="color: #000000; font-weight: bold;">/</span>vmlinuz
        APPEND <span style="color: #007800;">ks</span>=http:<span style="color: #000000; font-weight: bold;">//&lt;</span>server<span style="color: #000000; font-weight: bold;">&gt;/</span>ks<span style="color: #000000; font-weight: bold;">/</span>newhost.cfg <span style="color: #007800;">initrd</span>=images<span style="color: #000000; font-weight: bold;">/</span>centos<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">6.0</span><span style="color: #000000; font-weight: bold;">/</span>x86_64<span style="color: #000000; font-weight: bold;">/</span>initrd.img text</pre></div></div>

<p><em>Vous pouvez enlever le ks= si vous ne voulez pas utiliser un fichier Kickstart</em></p>
<p><strong>DHCP</strong><br />
Maintenant vous devez configurer votre serveur DHCP pour servir les options 066 (Boot Server Host Name) et 067 (Bootfile Name)</p>
<pre lang=''>
066 = <PXE server>
067 = /pxelinux.0
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.itsg33k.ca/2011/07/11/configurer-un-serveur-pxe-sur-centos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuration DMZ Cisco ASA Série 5500</title>
		<link>http://www.itsg33k.ca/2011/07/08/configuration-dmz-cisco-asa-serie-5500/</link>
		<comments>http://www.itsg33k.ca/2011/07/08/configuration-dmz-cisco-asa-serie-5500/#comments</comments>
		<pubDate>Fri, 08 Jul 2011 16:13:13 +0000</pubDate>
		<dc:creator>David Laperle</dc:creator>
				<category><![CDATA[Sécurité Informatique]]></category>
		<category><![CDATA[asa]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[dmz]]></category>
		<category><![CDATA[securite]]></category>

		<guid isPermaLink="false">http://www.itsg33k.ca/?p=404</guid>
		<description><![CDATA[L&#8217;objectif de cet article est de démontrer comment configurer correctement une zone DMZ dans votre ASA (ou PIX). Principalement, la logique demeure la même peu importe votre firewall, mais ici on parlera du Cisco ASA puisque c&#8217;est l&#8217;équipement que j&#8217;utilise au travail. Configuration de l&#8217;interface DMZ interface Ethernet0/3 speed 100 duplex full nameif dmz security-level [...]]]></description>
			<content:encoded><![CDATA[<h3 style="text-align: center;"><a href="http://www.itsg33k.ca/wp-content/uploads/2010/04/cisco-logo.gif"><img title="cisco-logo" src="http://www.itsg33k.ca/wp-content/uploads/2010/04/cisco-logo.gif" alt="" width="324" height="212" /></a></h3>
<p>L&#8217;objectif de cet article est de démontrer comment configurer correctement une zone DMZ dans votre ASA (ou PIX). Principalement, la logique demeure la même peu importe votre firewall, mais ici on parlera du Cisco ASA puisque c&#8217;est l&#8217;équipement que j&#8217;utilise au travail.<br />
<a href="http://www.itsg33k.ca/wp-content/uploads/2011/07/dmz.png"><img src="http://www.itsg33k.ca/wp-content/uploads/2011/07/dmz.png" alt="" title="dmz" width="587" height="281" class="aligncenter size-full wp-image-405" /></a><br />
<span id="more-404"></span><br />
<strong>Configuration de l&#8217;interface DMZ</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">interface Ethernet0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">3</span>
 speed <span style="color: #000000;">100</span>
 duplex full
 nameif dmz
 security-level <span style="color: #000000;">50</span>
 ip address 10.10.10.1 255.255.255.0
 no shut</pre></div></div>

<p><strong>Configuration des NAT</strong><br />
Lorsque l&#8217;on passe d&#8217;une interface ayant un &laquo;&nbsp;security-level&nbsp;&raquo; différent, on doit avoir un NAT pour faire fonctionner le tout, on doit donc définir le NAT pour notre DMZ.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># On ne veut pas NATTÉ l'inside vers la DMZ</span>
static <span style="color: #7a0874; font-weight: bold;">&#40;</span>inside,dmz<span style="color: #7a0874; font-weight: bold;">&#41;</span> 192.168.100.0 192.168.100.0 netmask 255.255.255.0
<span style="color: #666666; font-style: italic;"># L'adresse IP externe 1.1.1.1 équivaut à 10.10.10.10 dans la DMZ (vice-versa)</span>
static <span style="color: #7a0874; font-weight: bold;">&#40;</span>dmz,outside<span style="color: #7a0874; font-weight: bold;">&#41;</span> 1.1.1.1 10.10.10.10 netmask 255.255.255.255</pre></div></div>

<p><strong>Configuration des ACLs</strong><br />
Bien sûr, on ne veut pas laisser passer tout le traffic entre la DMZ et l&#8217;externe, ou de l&#8217;interne vers la DMZ etc&#8230; donc voici les ACLs à appliquer dans certaines situations.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># On permet l'interne d'accéder au serveur web dans la DMZ en http et https</span>
access-list i_a_out extended permit tcp any host 10.10.10.10 eq www
access-list i_a_out extended permit tcp any host 10.10.10.10 eq https
<span style="color: #666666; font-style: italic;"># On permet à l'externe d'accéder au serveur web dans la DMZ en http et https</span>
access-list o_a_in extended permit tcp any host 1.1.1.1 eq www
access-list o_a_in extended permit tcp any host 1.1.1.1 eq https
<span style="color: #666666; font-style: italic;"># On permet au serveur web d'aller en http/https sur Internet et  de faire la résolution DNS sur des serveurs internes</span>
<span style="color: #666666; font-style: italic;"># 192.168.100.10 et 100.11 sont les 2 DNS internes</span>
access-list dmz_int extended permit udp 10.10.10.0 255.255.255.0 host 192.168.100.10 eq domain
access-list dmz_int extended permit udp 10.10.10.0 255.255.255.0 host 192.168.100.11 eq domain
access-list dmz_int extended permit tcp host 10.10.10.10 any eq www
access-list dmz_int extended permit tcp host 10.10.10.10 any eq https</pre></div></div>

<p><strong>Configuration des access-groups</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">access-group i_a_out <span style="color: #000000; font-weight: bold;">in</span> interface inside
access-group o_a_in <span style="color: #000000; font-weight: bold;">in</span> interface outside
access-group dmz_int <span style="color: #000000; font-weight: bold;">in</span> interface dmz</pre></div></div>

<p>Voilà, une fois tout ceci configuré vous devriez avoir une DMZ fonctionnelle. Il suffit d&#8217;ajouter des ACLs au bon endroit pour vos besoins. Si vous avez des questions, utilisez les commentaires!</p>
<h3 style="text-align: center;"><a href="http://www.itsg33k.ca/wp-content/uploads/2010/04/cisco-logo.gif"><img title="cisco-logo" src="http://www.itsg33k.ca/wp-content/uploads/2010/04/cisco-logo.gif" alt="" width="324" height="212" /></a></h3>
]]></content:encoded>
			<wfw:commentRss>http://www.itsg33k.ca/2011/07/08/configuration-dmz-cisco-asa-serie-5500/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Configuration d&#8217;un serveur mirroir yum CentOS local</title>
		<link>http://www.itsg33k.ca/2011/07/08/configuration-dun-serveur-mirroir-yum-centos-local/</link>
		<comments>http://www.itsg33k.ca/2011/07/08/configuration-dun-serveur-mirroir-yum-centos-local/#comments</comments>
		<pubDate>Fri, 08 Jul 2011 13:04:50 +0000</pubDate>
		<dc:creator>David Laperle</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.itsg33k.ca/?p=400</guid>
		<description><![CDATA[Cet article sera la première étape d&#8217;une suite d&#8217;article qui portera sur la configuration d&#8217;un serveur PXE, et par la suite de la configuration de Kickstart pour effectuer des installations de serveurs CentOS rapide et efficaces. Ce premier article, vous montrera comment monter un serveur de réplication CentOS local, pour ne pas avoir à utiliser [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.itsg33k.ca/wp-content/uploads/2011/07/centos.png"><img src="http://www.itsg33k.ca/wp-content/uploads/2011/07/centos-300x114.png" alt="" title="centos" width="300" height="114" class="aligncenter size-medium wp-image-401" /></a><br />
Cet article sera la première étape d&#8217;une suite d&#8217;article qui portera sur la configuration d&#8217;un serveur PXE, et par la suite de la configuration de Kickstart pour effectuer des installations de serveurs CentOS rapide et efficaces. Ce premier article, vous montrera comment monter un serveur de réplication CentOS local, pour ne pas avoir à utiliser votre précieuse bande passante à chaque fois vous voulez configurer un nouveau serveur.<br />
<span id="more-400"></span><br />
Avant de commencer, il est important de comprendre que répliquer l&#8217;ensemble du répertoire CentOS (sans les ISOs) prendra environ 22Gb par version. Habituellement, il n&#8217;est pas nécessaire de garder toutes les versions, il est préférable de garder les dernières versions de chaque branche (4.x, 5.x et bientôt 6.x). Donc, si je fais un calcul rapide, cela donne environ 70Gb seulement pour le mirroir, donc assurez-vous d&#8217;avoir suffisamment d&#8217;espace.</p>
<p>Je ne passerai pas ici l&#8217;installation du serveur en tant que tel, vous devriez bien vous en sortir, je prends donc en compte que vous avez un serveur CentOS fonctionnel, sur lequel vous pouvez vous connecter en SSH et que vous avez déjà fais le &laquo;&nbsp;yum update&nbsp;&raquo; pour mettre à jour les packages.</p>
<p><strong>Configuration Apache</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># On installe apache et php</span>
yum <span style="color: #c20cb9; font-weight: bold;">install</span> http php
chkconfig <span style="color: #660033;">--level</span> <span style="color: #000000;">345</span> httpd on
service httpd start
<span style="color: #666666; font-style: italic;"># On crée le répertoire où sera storé les packages CentOS</span>
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>html<span style="color: #000000; font-weight: bold;">/</span>centos<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">5.6</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>html<span style="color: #000000; font-weight: bold;">/</span>centos
<span style="color: #666666; font-style: italic;"># On crée un lien symbolique entre la dernière version et le base, comme ça on peut référer à centos/5/... pour toujours être à la dernière version disponible</span>
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000;">5.6</span> <span style="color: #000000;">5</span></pre></div></div>

<p><em>Lors de l&#8217;écriture de ce post, la version 5.6 était la dernière version de CentOS, si vous êtes entrain de faire un repository pour 6.x, alors modifiez les lignes en conséquences</em></p>
<p><strong>Synchronization</strong></p>
<p>Utilisez ce script pour créer vos répertoires de base. De plus ce script peut fonctionner à chaque jour pour garder votre mirroir à jour!</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #007800;">rsync</span>=<span style="color: #ff0000;">&quot;/usr/bin/rsync -avSHP --delete &quot;</span>
<span style="color: #666666; font-style: italic;"># Changer votre mirroir si nécessaire</span>
<span style="color: #007800;">mirror</span>=centos.mirror.iweb.ca
&nbsp;
<span style="color: #666666; font-style: italic;"># Ajouter des versions si nécessaires</span>
<span style="color: #007800;">verlist</span>=<span style="color: #ff0000;">&quot;4.9 5.6&quot;</span>
<span style="color: #666666; font-style: italic;"># Ajouter des architectures si nécessaires</span>
<span style="color: #007800;">archlist</span>=<span style="color: #ff0000;">&quot;x86_64 i386&quot;</span>
<span style="color: #666666; font-style: italic;"># Ajouter des répertoires si nécessaires</span>
<span style="color: #007800;">baselist</span>=<span style="color: #ff0000;">&quot;os updates centosplus extras&quot;</span>
<span style="color: #007800;">local</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>html<span style="color: #000000; font-weight: bold;">/</span>centos
&nbsp;
<span style="color: #000000; font-weight: bold;">for</span> ver <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$verlist</span>
<span style="color: #000000; font-weight: bold;">do</span>
  <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #c20cb9; font-weight: bold;">arch</span> <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$archlist</span>
  <span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #000000; font-weight: bold;">for</span> base <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$baselist</span>
    <span style="color: #000000; font-weight: bold;">do</span>
      <span style="color: #007800;">remote</span>=<span style="color: #007800;">$mirror</span>::centos<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$ver</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$base</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$arch</span><span style="color: #000000; font-weight: bold;">/</span>
      <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">------------------</span>
      <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$ver</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$base</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$arch</span>
      <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">------------------</span>
      <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$rsync</span> <span style="color: #007800;">$remote</span> <span style="color: #007800;">$local</span>/<span style="color: #007800;">$ver</span>/<span style="color: #007800;">$base</span>/<span style="color: #007800;">$arch</span>/&quot;</span>
&nbsp;
      <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-e</span> <span style="color: #007800;">$local</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$ver</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$base</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$arch</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Directory does not exist, creating <span style="color: #007800;">$local</span>/<span style="color: #007800;">$ver</span>/<span style="color: #007800;">$base</span>/<span style="color: #007800;">$arch</span>&quot;</span>
        <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$local</span>/<span style="color: #007800;">$ver</span>/<span style="color: #007800;">$base</span>/<span style="color: #007800;">$arch</span>&quot;</span>
      <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
      <span style="color: #007800;">$rsync</span> <span style="color: #007800;">$remote</span> <span style="color: #007800;">$local</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$ver</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$base</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$arch</span><span style="color: #000000; font-weight: bold;">/</span>
    <span style="color: #000000; font-weight: bold;">done</span>
  <span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #000000; font-weight: bold;">done</span></pre></div></div>

<p><em>Encore ici modifiez pour correspondre à la version que vous voulez syncronizer et n&#8217;oubliez pas de changer de mirroir si vous &laquo;&nbsp;centos.mirror.iweb.ca&nbsp;&raquo; est trop loin de chez vous.</em></p>
<p>Maintenant que le serveur est prêt et qu&#8217;il se mettra à jour régulièrement, on doit configurer nos clients, c&#8217;est-à-dire que l&#8217;on dire à nos installations CentOS où aller chercher les updates, car de base ils iront sur le premier mirroir disponible, et le vôtre servira à rien. Voici donc un fichier de configuration yum.repos.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>base<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #007800;">name</span>=CentOS - Base
<span style="color: #007800;">baseurl</span>=http:<span style="color: #000000; font-weight: bold;">//</span>server<span style="color: #000000; font-weight: bold;">/</span>centos<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">5.6</span><span style="color: #000000; font-weight: bold;">/</span>os<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$basearch</span><span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #007800;">gpgcheck</span>=<span style="color: #000000;">1</span>
<span style="color: #007800;">gpgkey</span>=http:<span style="color: #000000; font-weight: bold;">//</span>server<span style="color: #000000; font-weight: bold;">/</span>centos<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">5.6</span><span style="color: #000000; font-weight: bold;">/</span>os<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$basearch</span><span style="color: #000000; font-weight: bold;">/</span>RPM-GPG-KEY-CentOS-<span style="color: #000000;">5</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#released updates</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>update<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #007800;">name</span>=CentOS - Updates
<span style="color: #007800;">baseurl</span>=http:<span style="color: #000000; font-weight: bold;">//</span>server<span style="color: #000000; font-weight: bold;">/</span>centos<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">5.6</span><span style="color: #000000; font-weight: bold;">/</span>updates<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$basearch</span><span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #007800;">gpgcheck</span>=<span style="color: #000000;">1</span>
<span style="color: #007800;">gpgkey</span>=http:<span style="color: #000000; font-weight: bold;">//</span>server<span style="color: #000000; font-weight: bold;">/</span>centos<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$releasever</span><span style="color: #000000; font-weight: bold;">/</span>os<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$basearch</span><span style="color: #000000; font-weight: bold;">/</span>RPM-GPG-KEY-CentOS-<span style="color: #000000;">5</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#released extras</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>extras<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #007800;">name</span>=CentOS - Extras
<span style="color: #007800;">baseurl</span>=http:<span style="color: #000000; font-weight: bold;">//</span>server<span style="color: #000000; font-weight: bold;">/</span>centos<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">5.6</span><span style="color: #000000; font-weight: bold;">/</span>extras<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$basearch</span><span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #007800;">gpgcheck</span>=<span style="color: #000000;">1</span>
<span style="color: #007800;">gpgkey</span>=http:<span style="color: #000000; font-weight: bold;">//</span>server<span style="color: #000000; font-weight: bold;">/</span>centos<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">5.6</span><span style="color: #000000; font-weight: bold;">/</span>os<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$basearch</span><span style="color: #000000; font-weight: bold;">/</span>RPM-GPG-KEY-CentOS-<span style="color: #000000;">5</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#released CentOSPlus</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>centosplus<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #007800;">name</span>=CentOS - CentOSPlus
<span style="color: #007800;">baseurl</span>=http:<span style="color: #000000; font-weight: bold;">//</span>server<span style="color: #000000; font-weight: bold;">/</span>centos<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">5.6</span><span style="color: #000000; font-weight: bold;">/</span>centosplus<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$basearch</span><span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #007800;">enabled</span>=<span style="color: #000000;">0</span>
<span style="color: #007800;">gpgcheck</span>=<span style="color: #000000;">1</span>
<span style="color: #007800;">gpgkey</span>=http:<span style="color: #000000; font-weight: bold;">//</span>server<span style="color: #000000; font-weight: bold;">/</span>centos<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">5.6</span><span style="color: #000000; font-weight: bold;">/</span>os<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$basearch</span><span style="color: #000000; font-weight: bold;">/</span>RPM-GPG-KEY-CentOS-<span style="color: #000000;">5</span></pre></div></div>

<p>Ce fichier doit remplacer le fichier CentOS-Base.repo et CentOS-Media.repo, voici ce que je fais en temps normal.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>yum.repos.d<span style="color: #000000; font-weight: bold;">/</span>bkp
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>yum.repos.d<span style="color: #000000; font-weight: bold;">/*</span>.repo <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>yum.repos.d<span style="color: #000000; font-weight: bold;">/</span>bkp
<span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>yum.repos.d<span style="color: #000000; font-weight: bold;">/</span>CentOS-local.repo</pre></div></div>

<p><em>Je copie ensuite le contenu du fichier de configuration ci-haut dans ce fichier</em></p>
<p>Voilà, le tout devrait s&#8217;updater localement et sans problème. Si vous avez des questions, utilisez les commentaires.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itsg33k.ca/2011/07/08/configuration-dun-serveur-mirroir-yum-centos-local/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Configurer FreeSwitch pour recevoir des Fax</title>
		<link>http://www.itsg33k.ca/2011/06/20/configurer-freeswitch-pour-recevoir-des-fax/</link>
		<comments>http://www.itsg33k.ca/2011/06/20/configurer-freeswitch-pour-recevoir-des-fax/#comments</comments>
		<pubDate>Mon, 20 Jun 2011 17:16:47 +0000</pubDate>
		<dc:creator>David Laperle</dc:creator>
				<category><![CDATA[Freeswitch]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[freeswitch]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.itsg33k.ca/?p=380</guid>
		<description><![CDATA[Recevoir des fax dans FreeSwitch est tout de même simple avec mod_spandsp, par-contre traîter ces fax et les interpréter peut s&#8217;avérer complexe lorsque l&#8217;on se bute pour la première fois aux fichiers de configurations. Pour vous aider, j&#8217;ai décidé de mettre ici les informations nécessaires à la configuration de FreeSwitch pour recevoir des Fax simplement [...]]]></description>
			<content:encoded><![CDATA[<p>Recevoir des fax dans FreeSwitch est tout de même simple avec <strong>mod_spandsp</strong>, par-contre traîter ces fax et les interpréter peut s&#8217;avérer complexe lorsque l&#8217;on se bute pour la première fois aux fichiers de configurations.</p>
<p>Pour vous aider, j&#8217;ai décidé de mettre ici les informations nécessaires à la configuration de FreeSwitch pour recevoir des Fax simplement et efficacement. Une fois ce tutoriel terminé, vous aurez entre les mains, un système FreeSwitch qui peut recevoir des Fax, les interpréter, gérer les erreurs et bâtir une base de donnée faxe pour références ultérieures.<br />
<span id="more-380"></span></p>
<h3><strong>ÉTAPE 1</strong></h3>
<p><em>La configuration de mod_spandsp</em><br />
${CONF}/autoload_configs/spandsp.conf.xml <strong>Vous ne devriez pas avoir à modifier ce fichier!</strong><br />
${CONF}/autoload_configs/fax.conf.xml</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;configuration</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;fax.conf&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;FAX application configuration&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;settings<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;use-ecm&quot;</span>       <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;verbose&quot;</span>       <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span> <span style="color: #808080; font-style: italic;">&lt;!-- Activé si vous voulez avoir le debug --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;disable-v17&quot;</span>   <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;ident&quot;</span>         <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;My FAX IDENT&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span> <span style="color: #808080; font-style: italic;">&lt;!-- Identification de votre machine FAX, surtout utilisé pour les outgoing fax --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;header&quot;</span>        <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;My FAX HEADER&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span> <span style="color: #808080; font-style: italic;">&lt;!-- Information Fax envoyé lors de l'envoi et de la négociation --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;spool-dir&quot;</span>     <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;/tmp&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span> <span style="color: #808080; font-style: italic;">&lt;!-- Répertoire de travail --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;file-prefix&quot;</span>   <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;faxrx&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span> <span style="color: #808080; font-style: italic;">&lt;!-- Sera ajouté au début du nom du fichier --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/settings<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p><em>La configuration de votre dialplan</em></p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;extension</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;inbound_t1_fax&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;condition</span> <span style="color: #000066;">field</span>=<span style="color: #ff0000;">&quot;destination_number&quot;</span> <span style="color: #000066;">expression</span>=<span style="color: #ff0000;">&quot;^0000$&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span> <span style="color: #808080; font-style: italic;">&lt;!-- Changer pour votre DID --&gt;</span>
       	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;action</span> <span style="color: #000066;">application</span>=<span style="color: #ff0000;">&quot;set&quot;</span> <span style="color: #000066;">data</span>=<span style="color: #ff0000;">&quot;session_in_hangup_hook=true&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span> <span style="color: #808080; font-style: italic;">&lt;!-- Permet de passer le contrôle à un script au hangup --&gt;</span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;action</span> <span style="color: #000066;">application</span>=<span style="color: #ff0000;">&quot;set&quot;</span> <span style="color: #000066;">data</span>=<span style="color: #ff0000;">&quot;api_hangup_hook=system ${base_dir}/scripts/process-fax.sh '\\\${fax_remote_station_id}' '\\\${fax_local_station_id}' '\\\${fax_document_transferred_pages}' '\\\${fax_document_total_pages}' '\\\${fax_result_text}' '${caller_id_number}' '${uuid}'&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span> <span style="color: #808080; font-style: italic;">&lt;!-- Script qui reçoit les headers fax à la réception --&gt;</span>
       	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;action</span> <span style="color: #000066;">application</span>=<span style="color: #ff0000;">&quot;python&quot;</span> <span style="color: #000066;">data</span>=<span style="color: #ff0000;">&quot;process-rxfax&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span> <span style="color: #808080; font-style: italic;">&lt;!-- Script de traîtement de réception --&gt;</span>
       	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;action</span> <span style="color: #000066;">application</span>=<span style="color: #ff0000;">&quot;hangup&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/condition<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/extension<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p><em>process-rxfax.py</em><br />
<em>Basé sur le travail de <a href="http://steffler.info/wp-content/uploads/2009/06/process-rxfax.py">steffler.info</a></em></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Fax reception Python</span>
<span style="color: #808080; font-style: italic;"># 2011-06-30</span>
<span style="color: #808080; font-style: italic;"># David Laperle @ RSS</span>
<span style="color: #808080; font-style: italic;">#</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>                            <span style="color: #808080; font-style: italic;"># import the sys module for argv</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span>                              <span style="color: #808080; font-style: italic;"># import the os modules</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">time</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">smtplib</span>, <span style="color: #dc143c;">email</span>, <span style="color: #dc143c;">datetime</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">glob</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">math</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">string</span>
<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">email</span>.<span style="color: black;">Encoders</span> <span style="color: #ff7700;font-weight:bold;">import</span> encode_base64
<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">email</span>.<span style="color: black;">MIMEMultipart</span> <span style="color: #ff7700;font-weight:bold;">import</span> MIMEMultipart
<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">email</span>.<span style="color: black;">MIMEAudio</span> <span style="color: #ff7700;font-weight:bold;">import</span> MIMEAudio
<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">email</span>.<span style="color: black;">Header</span> <span style="color: #ff7700;font-weight:bold;">import</span> Header
<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">email</span>.<span style="color: black;">MIMEText</span> <span style="color: #ff7700;font-weight:bold;">import</span> MIMEText
<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">datetime</span> <span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #66cc66;">*</span>
<span style="color: #ff7700;font-weight:bold;">from</span> freeswitch <span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #66cc66;">*</span>
&nbsp;
<span style="color: #808080; font-style: italic;">## EDIT THESE VARIABLES TO MATCH YOUR NEEDS:</span>
&nbsp;
tiff2pscmd = <span style="color: #483d8b;">'/usr/bin/tiff2ps'</span>      <span style="color: #808080; font-style: italic;"># location of tiff2ps</span>
tiff2pdfcmd = <span style="color: #483d8b;">'/usr/bin/tiff2pdf'</span>      <span style="color: #808080; font-style: italic;"># location of tiff2pdf</span>
ncftpputcmd = <span style="color: #483d8b;">'/usr/local/bin/ncftpput'</span> <span style="color: #808080; font-style: italic;"># location of ncftpput</span>
lprcmd = <span style="color: #483d8b;">'/usr/bin/lpr'</span>              <span style="color: #808080; font-style: italic;"># location of lpr</span>
convertcmd = <span style="color: #483d8b;">'/usr/bin/convert'</span>      <span style="color: #808080; font-style: italic;"># location of convert</span>
incomingfaxes = <span style="color: #483d8b;">'/tmp/'</span>              <span style="color: #808080; font-style: italic;"># change this to where your .tiffs are saved by mod_fax, trailing slash required</span>
ftphost = <span style="color: #483d8b;">'host'</span>
ftpuser = <span style="color: #483d8b;">'user'</span>
ftppass = <span style="color: #483d8b;">'pass'</span>
today = date.<span style="color: black;">today</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">strftime</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;%Y%m%d&quot;</span><span style="color: black;">&#41;</span>
tiff2psoptions = <span style="color: #483d8b;">'-a -O '</span>              <span style="color: #808080; font-style: italic;"># command line options go here </span>
logfile = <span style="color: #483d8b;">&quot;/usr/local/freeswitch/log/rxfax_&quot;</span> + today + <span style="color: #483d8b;">&quot;.log&quot;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> sendErrorToMail<span style="color: black;">&#40;</span>subject,reason<span style="color: black;">&#41;</span>:
    email_from = <span style="color: #483d8b;">&quot;from@domain.com&quot;</span>
    email_rcpt = <span style="color: #483d8b;">&quot;to@domain.com&quot;</span>
    msg = MIMEMultipart<span style="color: black;">&#40;</span><span style="color: #483d8b;">'alternative'</span><span style="color: black;">&#41;</span>
    msg.<span style="color: black;">set_charset</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'utf-8'</span><span style="color: black;">&#41;</span>
    sub = Header<span style="color: black;">&#40;</span>subject,<span style="color: #483d8b;">'utf-8'</span><span style="color: black;">&#41;</span>
    msg<span style="color: black;">&#91;</span><span style="color: #483d8b;">'Subject'</span><span style="color: black;">&#93;</span> = sub
    msg<span style="color: black;">&#91;</span><span style="color: #483d8b;">'From'</span><span style="color: black;">&#93;</span> = email_from
    msg<span style="color: black;">&#91;</span><span style="color: #483d8b;">'To'</span><span style="color: black;">&#93;</span> = email_rcpt
    textv = reason
    part1 = MIMEText<span style="color: black;">&#40;</span>textv,<span style="color: #483d8b;">'plain'</span>,<span style="color: #483d8b;">'utf-8'</span><span style="color: black;">&#41;</span>
    msg.<span style="color: black;">attach</span><span style="color: black;">&#40;</span>part1<span style="color: black;">&#41;</span>
    mailer = <span style="color: #dc143c;">smtplib</span>.<span style="color: black;">SMTP</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;server.smtp.com&quot;</span>,<span style="color: #ff4500;">25</span><span style="color: black;">&#41;</span>
    mailer.<span style="color: black;">sendmail</span><span style="color: black;">&#40;</span>email_from, email_rcpt, msg.<span style="color: black;">as_string</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    mailer.<span style="color: black;">quit</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> writeToLog<span style="color: black;">&#40;</span>session,msg<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">global</span> logfile
    now = <span style="color: #dc143c;">datetime</span>.<span style="color: black;">now</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">strftime</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;%Y-%m-%d %H:%M:%S&quot;</span><span style="color: black;">&#41;</span>
    uuid = session.<span style="color: black;">getVariable</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;uuid&quot;</span><span style="color: black;">&#41;</span>
    towrite = now + <span style="color: #483d8b;">&quot; &quot;</span> + uuid + <span style="color: #483d8b;">&quot; &quot;</span> + msg + <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
    fh = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span>logfile,<span style="color: #483d8b;">&quot;a&quot;</span><span style="color: black;">&#41;</span>
    fh.<span style="color: black;">write</span><span style="color: black;">&#40;</span>towrite<span style="color: black;">&#41;</span>
    fh.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> handler<span style="color: black;">&#40;</span>session, args<span style="color: black;">&#41;</span>:
&nbsp;
    <span style="color: #808080; font-style: italic;">#get required variables</span>
    the_uuid = session.<span style="color: black;">getVariable</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;uuid&quot;</span><span style="color: black;">&#41;</span>
    the_recipient = session.<span style="color: black;">getVariable</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;recipient&quot;</span><span style="color: black;">&#41;</span>
    the_caller = session.<span style="color: black;">getVariable</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;caller_id_number&quot;</span><span style="color: black;">&#41;</span>
    the_dest = session.<span style="color: black;">getVariable</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;destination_number&quot;</span><span style="color: black;">&#41;</span>
&nbsp;
    writeToLog<span style="color: black;">&#40;</span>session,<span style="color: #483d8b;">&quot;Incoming Fax from &quot;</span> + the_caller<span style="color: black;">&#41;</span>
    <span style="color: #808080; font-style: italic;">#test if FTP works before proceeding</span>
    error = <span style="color: #dc143c;">os</span>.<span style="color: black;">system</span><span style="color: black;">&#40;</span>ncftpputcmd + <span style="color: #483d8b;">&quot; -m -u &quot;</span> + ftpuser + <span style="color: #483d8b;">&quot; -p &quot;</span> + ftppass + <span style="color: #483d8b;">&quot; &quot;</span> + ftphost + <span style="color: #483d8b;">&quot; / /usr/local/freeswitch/scripts/testfile.txt &quot;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> error == <span style="color: #ff4500;">0</span>:
        writeToLog<span style="color: black;">&#40;</span>session,<span style="color: #483d8b;">&quot;Fax reception in progress ...&quot;</span><span style="color: black;">&#41;</span>
        <span style="color: #808080; font-style: italic;">#answer the phone, save the fax file in .tiff format.    </span>
        session.<span style="color: black;">answer</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        session.<span style="color: black;">execute</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;playback&quot;</span>, <span style="color: #483d8b;">&quot;silence_stream://2000&quot;</span><span style="color: black;">&#41;</span>
        session.<span style="color: black;">execute</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;rxfax&quot;</span>, incomingfaxes + <span style="color: #483d8b;">&quot;rxfax-&quot;</span> + the_uuid + <span style="color: #483d8b;">&quot;.tiff&quot;</span><span style="color: black;">&#41;</span>
        writeToLog<span style="color: black;">&#40;</span>session,<span style="color: #483d8b;">&quot;Fax reception done: &quot;</span> + incomingfaxes + <span style="color: #483d8b;">&quot;rxfax-&quot;</span> + the_uuid + <span style="color: #483d8b;">&quot;.tiff&quot;</span><span style="color: black;">&#41;</span>
        <span style="color: #808080; font-style: italic;"># We split the TIFF so we can have different page size within the same fax</span>
        writeToLog<span style="color: black;">&#40;</span>session,<span style="color: #483d8b;">&quot;Splitting TIFF&quot;</span><span style="color: black;">&#41;</span>
        <span style="color: #dc143c;">os</span>.<span style="color: black;">system</span><span style="color: black;">&#40;</span>convertcmd + <span style="color: #483d8b;">&quot; &quot;</span> + incomingfaxes + <span style="color: #483d8b;">&quot;rxfax-&quot;</span> + the_uuid + <span style="color: #483d8b;">&quot;.tiff &quot;</span> + incomingfaxes + <span style="color: #483d8b;">&quot;rxfax-&quot;</span> + the_uuid + <span style="color: #483d8b;">&quot;_%04d.tiff&quot;</span><span style="color: black;">&#41;</span>
        <span style="color: #808080; font-style: italic;"># We send the TIFF to ps directly to the printer</span>
        writeToLog<span style="color: black;">&#40;</span>session,<span style="color: #483d8b;">&quot;Sending Fax to printer&quot;</span><span style="color: black;">&#41;</span>
        pages = <span style="color: #dc143c;">glob</span>.<span style="color: #dc143c;">glob</span><span style="color: black;">&#40;</span>incomingfaxes + <span style="color: #483d8b;">&quot;rxfax-&quot;</span> + the_uuid + <span style="color: #483d8b;">&quot;_*.tiff&quot;</span><span style="color: black;">&#41;</span>
        pages.<span style="color: black;">sort</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">for</span> page <span style="color: #ff7700;font-weight:bold;">in</span> pages:
            <span style="color: #808080; font-style: italic;"># For each page we want to be able to determine the height, but depending on the y-resolution, it can change a little, so we do a little math, to always put the height on the same resolution</span>
            val = <span style="color: #ff4500;">0</span>
            p = <span style="color: #dc143c;">os</span>.<span style="color: black;">popen</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'/usr/bin/identify -format <span style="color: #000099; font-weight: bold;">\&quot;</span>%h<span style="color: #000099; font-weight: bold;">\&quot;</span> '</span> + page<span style="color: black;">&#41;</span>
            height = p.<span style="color: #dc143c;">readline</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
            p.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
            r = <span style="color: #dc143c;">os</span>.<span style="color: black;">popen</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'/usr/bin/identify -format <span style="color: #000099; font-weight: bold;">\&quot;</span>%y<span style="color: #000099; font-weight: bold;">\&quot;</span> '</span> + page<span style="color: black;">&#41;</span>
            resolution = r.<span style="color: #dc143c;">readline</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
            r.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
            ardpi = <span style="color: #dc143c;">string</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span>resolution<span style="color: black;">&#41;</span>
            dpi = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span>ardpi<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">if</span> dpi <span style="color: #66cc66;">!</span>= <span style="color: #ff4500;">196</span>:
                <span style="color: #ff7700;font-weight:bold;">if</span> dpi <span style="color: #66cc66;">&gt;</span> <span style="color: #ff4500;">196</span>:
                    val = <span style="color: black;">&#40;</span>dpi/<span style="color: #ff4500;">196</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #008000;">int</span><span style="color: black;">&#40;</span>height<span style="color: black;">&#41;</span>
                <span style="color: #ff7700;font-weight:bold;">else</span>:
                    val = <span style="color: black;">&#40;</span><span style="color: #ff4500;">196</span>/dpi<span style="color: black;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #008000;">int</span><span style="color: black;">&#40;</span>height<span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">else</span>:
                val = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span>height<span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">int</span><span style="color: black;">&#40;</span>val<span style="color: black;">&#41;</span> <span style="color: #66cc66;">&gt;</span> <span style="color: #ff4500;">2300</span>:
                writeToLog<span style="color: black;">&#40;</span>session,page + <span style="color: #483d8b;">&quot; is LEGAL!&quot;</span><span style="color: black;">&#41;</span>
                <span style="color: #dc143c;">os</span>.<span style="color: black;">system</span><span style="color: black;">&#40;</span>tiff2pscmd + <span style="color: #483d8b;">&quot; -h14 &quot;</span> + page + <span style="color: #483d8b;">&quot; | &quot;</span> + lprcmd + <span style="color: #483d8b;">&quot; -P myprinter -o media=legal -o fitplot=true&quot;</span><span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">else</span>:
                writeToLog<span style="color: black;">&#40;</span>session,page + <span style="color: #483d8b;">&quot; is LETTER!&quot;</span><span style="color: black;">&#41;</span>
                <span style="color: #dc143c;">os</span>.<span style="color: black;">system</span><span style="color: black;">&#40;</span>tiff2pscmd + <span style="color: #483d8b;">&quot; -h11 &quot;</span> + page + <span style="color: #483d8b;">&quot; | &quot;</span> + lprcmd + <span style="color: #483d8b;">&quot; -P myprinter -o media=letter -o fitplot=true&quot;</span><span style="color: black;">&#41;</span>
        writeToLog<span style="color: black;">&#40;</span>session,<span style="color: #483d8b;">&quot;PDF creation in progress...&quot;</span><span style="color: black;">&#41;</span>
        error = <span style="color: #dc143c;">os</span>.<span style="color: black;">system</span><span style="color: black;">&#40;</span>tiff2pdfcmd + <span style="color: #483d8b;">&quot; &quot;</span> + incomingfaxes + <span style="color: #483d8b;">&quot;rxfax-&quot;</span> + the_uuid + <span style="color: #483d8b;">&quot;.tiff -o &quot;</span> + incomingfaxes + <span style="color: #483d8b;">&quot;rxfax-&quot;</span> + the_uuid + <span style="color: #483d8b;">&quot;.pdf&quot;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> error == <span style="color: #ff4500;">0</span>:
            <span style="color: #808080; font-style: italic;"># Generating JPG preview</span>
            writeToLog<span style="color: black;">&#40;</span>session,<span style="color: #483d8b;">&quot;Generating JPG preview file (continue on failure)...&quot;</span><span style="color: black;">&#41;</span>
            <span style="color: #dc143c;">os</span>.<span style="color: black;">system</span><span style="color: black;">&#40;</span>convertcmd + <span style="color: #483d8b;">&quot; -scale 500 &quot;</span> + incomingfaxes + <span style="color: #483d8b;">&quot;rxfax-&quot;</span> + the_uuid + <span style="color: #483d8b;">&quot;.tiff[0] &quot;</span> + incomingfaxes + <span style="color: #483d8b;">&quot;rxfax-&quot;</span> + the_uuid + <span style="color: #483d8b;">&quot;.jpg&quot;</span><span style="color: black;">&#41;</span>
            writeToLog<span style="color: black;">&#40;</span>session,<span style="color: #483d8b;">&quot;Sending PDF to FTP server...&quot;</span><span style="color: black;">&#41;</span>
            <span style="color: #808080; font-style: italic;"># We send the PDF on remote server</span>
            error = <span style="color: #dc143c;">os</span>.<span style="color: black;">system</span><span style="color: black;">&#40;</span>ncftpputcmd + <span style="color: #483d8b;">&quot; -m -u &quot;</span> + ftpuser + <span style="color: #483d8b;">&quot; -p &quot;</span> + ftppass + <span style="color: #483d8b;">&quot; &quot;</span> + ftphost + <span style="color: #483d8b;">&quot; / &quot;</span> + incomingfaxes + <span style="color: #483d8b;">&quot;rxfax-&quot;</span> + the_uuid + <span style="color: #483d8b;">&quot;.pdf &quot;</span><span style="color: black;">&#41;</span>
            <span style="color: #dc143c;">os</span>.<span style="color: black;">system</span><span style="color: black;">&#40;</span>ncftpputcmd + <span style="color: #483d8b;">&quot; -m -u &quot;</span> + ftpuser + <span style="color: #483d8b;">&quot; -p &quot;</span> + ftppass + <span style="color: #483d8b;">&quot; &quot;</span> + ftphost + <span style="color: #483d8b;">&quot; / &quot;</span> + incomingfaxes + <span style="color: #483d8b;">&quot;rxfax-&quot;</span> + the_uuid + <span style="color: #483d8b;">&quot;.jpg &quot;</span><span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">if</span> error == <span style="color: #ff4500;">0</span>:
                <span style="color: #808080; font-style: italic;"># Everything went fine, party time!</span>
                writeToLog<span style="color: black;">&#40;</span>session, <span style="color: #483d8b;">&quot;Everything went fine, cleaning up tmp files...&quot;</span><span style="color: black;">&#41;</span>
                <span style="color: #dc143c;">os</span>.<span style="color: black;">system</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'rm -f '</span> + incomingfaxes + <span style="color: #483d8b;">&quot;rxfax-&quot;</span> + the_uuid + <span style="color: #483d8b;">&quot;.pdf &quot;</span> + incomingfaxes + <span style="color: #483d8b;">&quot;rxfax-&quot;</span> + the_uuid + <span style="color: #483d8b;">&quot;.tiff &quot;</span> + incomingfaxes + <span style="color: #483d8b;">&quot;rxfax-&quot;</span> + the_uuid + <span style="color: #483d8b;">&quot;_*.tiff &quot;</span> + incomingfaxes + <span style="color: #483d8b;">&quot;rxfax-&quot;</span> + the_uuid + <span style="color: #483d8b;">&quot;.jpg&quot;</span><span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">else</span>:
                <span style="color: #808080; font-style: italic;"># FTP failed, we're fucked!</span>
                writeToLog<span style="color: black;">&#40;</span>session,<span style="color: #483d8b;">&quot;FTP upload failed, hanging up&quot;</span><span style="color: black;">&#41;</span>
                session.<span style="color: black;">hangup</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">else</span>:
            <span style="color: #808080; font-style: italic;"># PDF couldn't be created, we're fucked!</span>
            <span style="color: #808080; font-style: italic;">#writeToLog(session,&quot;PDF creation FAILED, hanging up&quot;)</span>
            mysub = <span style="color: #483d8b;">&quot;Fax en provenance de &quot;</span> + the_caller + <span style="color: #483d8b;">&quot; à ÉCHOUÉ&quot;</span>
            mytxt = <span style="color: #483d8b;">&quot;Raison: Création du fichier PDF à échoué! Fichier à récupérer: &quot;</span> + incomingfaxes + <span style="color: #483d8b;">&quot;rxfax-&quot;</span> + the_uuid + <span style="color: #483d8b;">&quot;.tiff&quot;</span>
            writeToLog<span style="color: black;">&#40;</span>session,mytxt<span style="color: black;">&#41;</span>
            sendErrorToEmail<span style="color: black;">&#40;</span>mysub,mytxt<span style="color: black;">&#41;</span>
            session.<span style="color: black;">hangup</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">else</span>:
    <span style="color: #808080; font-style: italic;"># FTP host is not working, we cancel right now!</span>
        mysub = <span style="color: #483d8b;">&quot;Fax en provenance de &quot;</span> + the_caller + <span style="color: #483d8b;">&quot; à ÉCHOUÉ&quot;</span>
        mytxt = <span style="color: #483d8b;">&quot;Raison: FTP sur &quot;</span> + ftphost + <span style="color: #483d8b;">&quot; est hors service! Erreur Fatal, impossible de récupérer!&quot;</span>
        writeToLog<span style="color: black;">&#40;</span>session,mytxt<span style="color: black;">&#41;</span>
        sendErrorToMail<span style="color: black;">&#40;</span>mysub,mytxt<span style="color: black;">&#41;</span>
        session.<span style="color: black;">hangup</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p><em>process-fax.sh</em></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Réception des arguments</span>
<span style="color: #007800;">REMOTE_STATION</span>=<span style="color: #007800;">$1</span>
<span style="color: #007800;">LOCAL_STATION</span>=<span style="color: #007800;">$2</span>
<span style="color: #007800;">PAGES</span>=<span style="color: #007800;">$3</span>
<span style="color: #007800;">TOTAL_PAGES</span>=<span style="color: #007800;">$4</span>
<span style="color: #007800;">CODE</span>=<span style="color: #007800;">$5</span>
<span style="color: #007800;">CALLER</span>=<span style="color: #007800;">$6</span>
<span style="color: #007800;">UUID</span>=<span style="color: #007800;">$7</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># On passe les variables à un script python qui fera le reste du travail</span>
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>python <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>freeswitch<span style="color: #000000; font-weight: bold;">/</span>scripts<span style="color: #000000; font-weight: bold;">/</span>process-rxfax-mysql.py <span style="color: #ff0000;">&quot;<span style="color: #007800;">$REMOTE_STATION</span>&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$LOCAL_STATION</span>&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$PAGES</span>&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$TOTAL_PAGES</span>&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$CODE</span>&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$CALLER</span>&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$UUID</span>&quot;</span></pre></div></div>

<p><em>process-rxfax-mysql.py </em></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
<span style="color: #ff7700;font-weight:bold;">import</span> MySQLdb 
&nbsp;
<span style="color: #808080; font-style: italic;"># Réception des paramètres</span>
remote_station = <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span>
local_station = <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span>
pages = <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">3</span><span style="color: black;">&#93;</span>
total_pages = <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">4</span><span style="color: black;">&#93;</span>
<span style="color: #dc143c;">code</span> = <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">5</span><span style="color: black;">&#93;</span>
caller = <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">6</span><span style="color: black;">&#93;</span>
uuid = <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">7</span><span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#Variables MySQL</span>
myHost = <span style="color: #483d8b;">&quot;mysqlhost&quot;</span>
myUser = <span style="color: #483d8b;">&quot;mysqluser&quot;</span>
myPass = <span style="color: #483d8b;">&quot;mysqlpass&quot;</span>
myDb = <span style="color: #483d8b;">&quot;mysqldb&quot;</span>
&nbsp;
conn = MySQLdb.<span style="color: black;">connect</span> <span style="color: black;">&#40;</span>host = myHost,
                           <span style="color: #dc143c;">user</span> = myUser,
                           passwd = myPass,
                           db = myDb<span style="color: black;">&#41;</span>
cursor = conn.<span style="color: black;">cursor</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
cursor.<span style="color: black;">execute</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;&quot;&quot;
    INSERT INTO rss_faxes(uuid,caller_id,remote_station,local_station,pages,pages_total,code,date_received)
    VALUES
    (%s,%s,%s,%s,%s,%s,%s,NOW())
&quot;&quot;&quot;</span>, <span style="color: black;">&#40;</span>uuid,caller,remote_station,local_station,pages,total_pages,<span style="color: #dc143c;">code</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></div></div>

<p><em>Structure de la DB MySQL</em></p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">-- ----------------------------</span>
<span style="color: #808080; font-style: italic;">-- Table structure for `rss_faxes`</span>
<span style="color: #808080; font-style: italic;">-- ----------------------------</span>
<span style="color: #993333; font-weight: bold;">DROP</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #993333; font-weight: bold;">IF</span> <span style="color: #993333; font-weight: bold;">EXISTS</span> <span style="color: #ff0000;">`rss_faxes`</span>;
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #ff0000;">`rss_faxes`</span> <span style="color: #66cc66;">&#40;</span>
  <span style="color: #ff0000;">`id_fax`</span> <span style="color: #993333; font-weight: bold;">INT</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">8</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #993333; font-weight: bold;">AUTO_INCREMENT</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`uuid`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`caller_id`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`remote_station`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`local_station`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`pages`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`pages_total`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`code`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`date_received`</span> datetime <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #993333; font-weight: bold;">PRIMARY</span> <span style="color: #993333; font-weight: bold;">KEY</span>  <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">`id_fax`</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#41;</span> ENGINE<span style="color: #66cc66;">=</span>MyISAM <span style="color: #993333; font-weight: bold;">AUTO_INCREMENT</span><span style="color: #66cc66;">=</span><span style="color: #cc66cc;">95</span> <span style="color: #993333; font-weight: bold;">DEFAULT</span> CHARSET<span style="color: #66cc66;">=</span>latin1;</pre></div></div>

<p>Par la suite, il ne vous reste qu&#8217;à faire une interface Web quelconque dans le langage de votre choix pour afficher tout ça, si vraiment vous êtes perdu là-aussi, utilisez la section commentaire, mais je crois que si vous êtes rendu ici, vous devriez être en mesure de faire l&#8217;interface par vous même, c&#8217;est seulement une petite DB que vous devez afficher en tableau et faire des liens vers les fichiers uploadés en FTP dans notre script python.</p>
<p>Comme d&#8217;habitude, utilisez les commentaires si vous avez des questions!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itsg33k.ca/2011/06/20/configurer-freeswitch-pour-recevoir-des-fax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

