<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss 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" version="2.0">

<channel>
	<title>Luca's forge</title>
	
	<link>http://lucasforge.2bopen.org</link>
	<description>Experiments from the land of open source</description>
	<pubDate>Mon, 24 Nov 2008 19:10:42 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/lucasforge" type="application/rss+xml" /><item>
		<title>Ortro 1.3.3 Relesed!</title>
		<link>http://lucasforge.2bopen.org/2008/11/ortro-133-relesed/</link>
		<comments>http://lucasforge.2bopen.org/2008/11/ortro-133-relesed/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 19:10:42 +0000</pubDate>
		<dc:creator>Luca Corbo</dc:creator>
		
		<category><![CDATA[Ortro]]></category>

		<category><![CDATA[monitoring]]></category>

		<category><![CDATA[php5]]></category>

		<category><![CDATA[scheduler]]></category>

		<guid isPermaLink="false">http://lucasforge.2bopen.org/?p=11</guid>
		<description><![CDATA[This version includes some enhancements and fixes.
In evidence the capability to lock a host or a system so to lock all jobs at once such as the possibility to receive notification on job event (i.e. start and end).
In addition the File Watch plugin was added and the Service Check plugin now is able to check [...]]]></description>
			<content:encoded><![CDATA[<p>This version includes some enhancements and fixes.</p>
<p>In evidence the capability to lock a host or a system so to lock all jobs at once such as the possibility to receive notification on job event (i.e. start and end).</p>
<p>In addition the File Watch plugin was added and the Service Check plugin now is able to check multiple services at once allowing to select the most commonly used service directly from a default list.</p>
<p>Help and comments are always welcome, see http://www.ortro.net for full changelog and details.</p>
<p>Ortro 1.3.3 and the plugins may be downloaded as usual from:<br />
http://www.ortro.net/download</p>
]]></content:encoded>
			<wfw:commentRss>http://lucasforge.2bopen.org/2008/11/ortro-133-relesed/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ortro 1.3.2a available</title>
		<link>http://lucasforge.2bopen.org/2008/07/ortro-132a-available/</link>
		<comments>http://lucasforge.2bopen.org/2008/07/ortro-132a-available/#comments</comments>
		<pubDate>Mon, 14 Jul 2008 08:41:47 +0000</pubDate>
		<dc:creator>Luca Corbo</dc:creator>
		
		<category><![CDATA[Ortro]]></category>

		<category><![CDATA[monitoring]]></category>

		<category><![CDATA[pear]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[scheduling]]></category>

		<guid isPermaLink="false">http://lucasforge.2bopen.org/?p=10</guid>
		<description><![CDATA[This version includes some enhancements and fixes.
Now the Pear::Auth package is used for authentication and the timeout for long running jobs was added.
The memory free and mysql database table check plugins were added.
In addition the installer was improved and FCKeditor library was updated.
Help and comments are always welcome, see http://www.ortro.net for full changelog and details.
]]></description>
			<content:encoded><![CDATA[<p>This version includes some enhancements and fixes.</p>
<p>Now the Pear::Auth package is used for authentication and the timeout for long running jobs was added.<br />
The memory free and mysql database table check plugins were added.<br />
In addition the installer was improved and FCKeditor library was updated.</p>
<p>Help and comments are always welcome, see <a href="http://www.ortro.net/" target="_new">http://www.ortro.net</a> for full changelog and details.</p>
]]></content:encoded>
			<wfw:commentRss>http://lucasforge.2bopen.org/2008/07/ortro-132a-available/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Enabling fingerprint scanner on ThinkPad running Ubuntu Hardy in four steps</title>
		<link>http://lucasforge.2bopen.org/2008/06/enabling-fingerprint-scanner-on-thinkpad-running-ubuntu-hardy-in-four-steps/</link>
		<comments>http://lucasforge.2bopen.org/2008/06/enabling-fingerprint-scanner-on-thinkpad-running-ubuntu-hardy-in-four-steps/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 22:42:54 +0000</pubDate>
		<dc:creator>Luca Corbo</dc:creator>
		
		<category><![CDATA[Linux/Unix]]></category>

		<category><![CDATA[Tips]]></category>

		<category><![CDATA[fingerprint]]></category>

		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://lucasforge.2bopen.org/?p=9</guid>
		<description><![CDATA[Install the ThinkFinger utilities and the relative PAM module:

~$ sudo apt-get install thinkfinger-tools libpam-thinkfinger

Acquire and test your fingerprint:

~$ sudo tf-tool --acquire
~$ sudo tf-tool --verify

Enable the PAM module:

~$ sudo /usr/lib/pam-thinkfinger/pam-thinkfinger-enable

Enjoy  
Resources
- wiki.ubuntu.com/ThinkFinger
- Bug #203973 in thinkfinger (Ubuntu)
]]></description>
			<content:encoded><![CDATA[<p>Install the ThinkFinger utilities and the relative PAM module:</p>
<pre>
~$ sudo apt-get install thinkfinger-tools libpam-thinkfinger
</pre>
<p>Acquire and test your fingerprint:</p>
<pre>
~$ sudo tf-tool --acquire
~$ sudo tf-tool --verify
</pre>
<p>Enable the PAM module:</p>
<pre>
~$ sudo /usr/lib/pam-thinkfinger/pam-thinkfinger-enable
</pre>
<p>Enjoy <img src='http://lucasforge.2bopen.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Resources<br />
- <a href="https://wiki.ubuntu.com/ThinkFinger">wiki.ubuntu.com/ThinkFinger</a><br />
- <a href="https://bugs.launchpad.net/ubuntu/+source/thinkfinger/+bug/203973">Bug #203973 in thinkfinger (Ubuntu)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://lucasforge.2bopen.org/2008/06/enabling-fingerprint-scanner-on-thinkpad-running-ubuntu-hardy-in-four-steps/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Discovery hosts and services with PHP and Nmap</title>
		<link>http://lucasforge.2bopen.org/2008/06/discovery-hosts-and-services-with-php-and-nmap/</link>
		<comments>http://lucasforge.2bopen.org/2008/06/discovery-hosts-and-services-with-php-and-nmap/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 21:39:38 +0000</pubDate>
		<dc:creator>Luca Corbo</dc:creator>
		
		<category><![CDATA[Net_Nmap]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[nmap]]></category>

		<category><![CDATA[pear]]></category>

		<guid isPermaLink="false">http://lucasforge.2bopen.org/?p=8</guid>
		<description><![CDATA[Requirements:
- PHP5
- PEAR::Net_Nmap
- nmap

&#60;?php

/**
 * Scan network to retrieve hosts and services information.
 */

require_once &#039;Net/Nmap.php&#039;;

//Define the target to scan
$target = array(&#039;127.0.0.1&#039;,&#039;www.yourserver.com&#039;);

$options = array(&#039;nmap_binary&#039; =&#62; &#039;/usr/local/bin/nmap&#039;);

try {
    $nmap = new Net_Nmap($options);

    //Enable nmap options
    $nmap_options = array(&#039;os_detection&#039; =&#62; true,
         [...]]]></description>
			<content:encoded><![CDATA[<p>Requirements:</p>
<p>- <a title="PHP.net" href="http://www.php.net" target="_blank">PHP5</a><br />
- <a title="Net_Nmap" href="http://pear.php.net/package/Net_Nmap" target="_self">PEAR::Net_Nmap</a><br />
- <a title="nmap" href="http://nmap.org/" target="_blank">nmap</a></p>
<pre class="syntax-highlight:php">
&lt;?php

/**
 * Scan network to retrieve hosts and services information.
 */

require_once &#039;Net/Nmap.php&#039;;

//Define the target to scan
$target = array(&#039;127.0.0.1&#039;,&#039;www.yourserver.com&#039;);

$options = array(&#039;nmap_binary&#039; =&gt; &#039;/usr/local/bin/nmap&#039;);

try {
    $nmap = new Net_Nmap($options);

    //Enable nmap options
    $nmap_options = array(&#039;os_detection&#039; =&gt; true,
                          &#039;service_info&#039; =&gt; true,
                          &#039;port_ranges&#039; =&gt; &#039;U:53,111,137,T:21-25,80,139,8080&#039;,//to scan only specified ports
                          );

    $nmap-&gt;enableOptions($nmap_options);

    //Scan target
    $res = $nmap-&gt;scan($target);

    //Get failed hosts
    $failed_to_resolve = $nmap-&gt;getFailedToResolveHosts();

    if (count($failed_to_resolve) &gt; 0) {
        echo &#039;Failed to resolve given hostname/IP: &#039; .
             implode (&#039;, &#039;, $failed_to_resolve) .
             &quot;\n&quot;;
    }

    //Parse XML Output to retrieve Hosts Object
    $hosts = $nmap-&gt;parseXMLOutput();

    //Print results
    foreach ($hosts as $key =&gt; $host) {
        echo &#039;Hostname: &#039; . $host-&gt;getHostname() . &quot;\n&quot;;
        echo &#039;Address: &#039; . $host-&gt;getAddress() . &quot;\n&quot;;
        echo &#039;OS: &#039; . $host-&gt;getOS() . &quot;\n&quot;;
        echo &#039;Status: &#039; . $host-&gt;getStatus . &quot;\n&quot;;
        $services = $host-&gt;getServices();
        echo &#039;Number of discovered services: &#039; . count($services) . &quot;\n&quot;;
        foreach ($services as $key =&gt; $service) {
            echo &quot;\n&quot;;
            echo &#039;Service Name: &#039; . $service-&gt;name . &quot;\n&quot;;
            echo &#039;Port: &#039; . $service-&gt;port . &quot;\n&quot;;
            echo &#039;Protocol: &#039; . $service-&gt;protocol . &quot;\n&quot;;
            echo &#039;Product information: &#039; . $service-&gt;product . &quot;\n&quot;;
            echo &#039;Product version: &#039; . $service-&gt;version . &quot;\n&quot;;
            echo &#039;Product additional info: &#039; . $service-&gt;extrainfo . &quot;\n&quot;;
        }
    }
} catch (Net_Nmap_Exception $ne) {
    echo $ne-&gt;getMessage();
}
?&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://lucasforge.2bopen.org/2008/06/discovery-hosts-and-services-with-php-and-nmap/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Execute SQL script from a file using PHP</title>
		<link>http://lucasforge.2bopen.org/2008/06/execute-sql-script-from-a-file-using-php/</link>
		<comments>http://lucasforge.2bopen.org/2008/06/execute-sql-script-from-a-file-using-php/#comments</comments>
		<pubDate>Wed, 04 Jun 2008 16:45:39 +0000</pubDate>
		<dc:creator>Luca Corbo</dc:creator>
		
		<category><![CDATA[php]]></category>

		<category><![CDATA[php sql pear]]></category>

		<guid isPermaLink="false">http://lucasforge.2bopen.org/?p=7</guid>
		<description><![CDATA[The code below allows to retrieve and execute all SQL statements defined in a SQL script file removing all comments.

&#60;?php
$sql_file = &#039;test.sql&#039;;

$contents = file_get_contents($sql_file);

// Remove C style and inline comments
$comment_patterns = array(&#039;/\/\*.*(\n)*.*(\*\/)?/&#039;, //C comments
                      [...]]]></description>
			<content:encoded><![CDATA[<p>The code below allows to retrieve and execute all SQL statements defined in a SQL script file removing all comments.</p>
<pre class="syntax-highlight:php">
&lt;?php
$sql_file = &#039;test.sql&#039;;

$contents = file_get_contents($sql_file);

// Remove C style and inline comments
$comment_patterns = array(&#039;/\/\*.*(\n)*.*(\*\/)?/&#039;, //C comments
                          &#039;/\s*--.*\n/&#039;, //inline comments start with --
                          &#039;/\s*#.*\n/&#039;, //inline comments start with #
                          );
$contents = preg_replace($comment_patterns, &quot;\n&quot;, $contents);

//Retrieve sql statements
$statements = explode(&quot;;\n&quot;, $contents);
$statements = preg_replace(&quot;/\s/&quot;, &#039; &#039;, $statements);

require_once &#039;MDB2.php&#039;;

$mdb2 =&amp;amp; MDB2::connect(&#039;mysql://usr:pw@localhost/dbnam&#039;);

foreach ($statements as $query) {
    if (trim($query) != &#039;&#039;) {
        echo &#039;Executing query: &#039; . $query . &quot;\n&quot;;
        $res =&amp;amp; $mdb2-&gt;exec($query);

        if (PEAR::isError($res)) {
            die($res-&gt;getMessage());
        }
    }
}
?&gt;
</pre>
<p>I have used Pear::MDB2 abstraction layer to interact with the database but the code above should work with any other db abstraction layer or PHP built-in functions.</p>
]]></content:encoded>
			<wfw:commentRss>http://lucasforge.2bopen.org/2008/06/execute-sql-script-from-a-file-using-php/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ortro 1.3.1 released!</title>
		<link>http://lucasforge.2bopen.org/2008/05/ortro-131-released/</link>
		<comments>http://lucasforge.2bopen.org/2008/05/ortro-131-released/#comments</comments>
		<pubDate>Tue, 27 May 2008 14:00:28 +0000</pubDate>
		<dc:creator>Luca Corbo</dc:creator>
		
		<category><![CDATA[Ortro]]></category>

		<category><![CDATA[monitoring]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[scheduling]]></category>

		<guid isPermaLink="false">http://lucasforge.2bopen.org/?p=6</guid>
		<description><![CDATA[This version includes some enhancements, and one very important security fix, a cross-site scripting (XSS) vulnerability allows remote attackers to inject arbitrary web script or HTML.
We recommend everyone update immediately.
In addition to the security fix, the Net_Nmap library was updated making the autodiscovery without OS detection more faster, the capability to upload files for plugins [...]]]></description>
			<content:encoded><![CDATA[<p>This version includes some enhancements, and one very important security fix, a cross-site scripting (XSS) vulnerability allows remote attackers to inject arbitrary web script or HTML.</p>
<p><strong>We recommend everyone update immediately.</strong></p>
<p>In addition to the security fix, the Net_Nmap library was updated making the autodiscovery without OS detection more faster, the capability to upload files for plugins and the Web Service Test Plugin using SoapUI were added.</p>
<p>The SimpleTest and FCKeditor libraries were updated.</p>
<p>Help and comments are always welcome, see <a href="http://www.ortro.net/" target="_new">http://www.ortro.net</a> for full changelog and details.</p>
<p>Ortro 1.3.1 and the plugins may be downloaded as usual from:<br />
<a href="http://www.ortro.net/download" target="_new">http://www.ortro.net/download</a></p>
]]></content:encoded>
			<wfw:commentRss>http://lucasforge.2bopen.org/2008/05/ortro-131-released/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Net_Nmap 1.0.0 beta1 released!</title>
		<link>http://lucasforge.2bopen.org/2008/05/net_nmap-100-beta1-released/</link>
		<comments>http://lucasforge.2bopen.org/2008/05/net_nmap-100-beta1-released/#comments</comments>
		<pubDate>Thu, 22 May 2008 22:11:38 +0000</pubDate>
		<dc:creator>Luca Corbo</dc:creator>
		
		<category><![CDATA[Net_Nmap]]></category>

		<category><![CDATA[pear]]></category>

		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://lucasforge.2bopen.org/?p=5</guid>
		<description><![CDATA[The Net_Nmap Pear package is a simple interface for Nmap, the free and open source utility for network exploration or security auditing.
Net_Nmap can be used to auto discovery hosts and services in your network or simply to parse Nmap XML output.
You may install it on your system simply typing:
$ pear install Net_Nmap
or if prefer download [...]]]></description>
			<content:encoded><![CDATA[<p>The Net_Nmap <a title="Pear" href="http://pear.php.net" target="_blank">Pear</a> package is a simple interface for <a title="Nmap.org" href="http://nmap.org/">Nmap</a>, the free and open source utility for network exploration or security auditing.</p>
<p>Net_Nmap can be used to auto discovery hosts and services in your network or simply to parse Nmap XML output.</p>
<p>You may install it on your system simply typing:</p>
<pre>$ pear install Net_Nmap</pre>
<p>or if prefer <a title="Download Net_Nmap" href="http://pear.php.net/package/Net_Nmap/download" target="_blank">download it</a> from the Pear web site.</p>
]]></content:encoded>
			<wfw:commentRss>http://lucasforge.2bopen.org/2008/05/net_nmap-100-beta1-released/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Execute commands on folder and files containing spaces</title>
		<link>http://lucasforge.2bopen.org/2008/05/execute-commands-on-folder-and-files-containing-spaces/</link>
		<comments>http://lucasforge.2bopen.org/2008/05/execute-commands-on-folder-and-files-containing-spaces/#comments</comments>
		<pubDate>Thu, 08 May 2008 10:06:40 +0000</pubDate>
		<dc:creator>Luca Corbo</dc:creator>
		
		<category><![CDATA[Linux/Unix]]></category>

		<category><![CDATA[Tips]]></category>

		<category><![CDATA[bash]]></category>

		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://lucasforge.2bopen.org/?p=4</guid>
		<description><![CDATA[On Linux or Unix systems perform recursively a command on items might contain white space, quote marks, or backslashes can be a problem when using find &#124; xargs combination.
To solve this you may use:
find -type d -print0 &#124; xargs -0 &#60;command&#62;
find -type f -print0 &#124; xargs -0 &#60;command&#62;
For example to fix recursively permission:
find -type d [...]]]></description>
			<content:encoded><![CDATA[<p>On Linux or Unix systems perform recursively a command on items might contain white space, quote marks, or backslashes can be a problem when using <em>find | xargs</em> combination.</p>
<p>To solve this you may use:</p>
<pre>find -type d -print0 | xargs -0 &lt;command&gt;
find -type f -print0 | xargs -0 &lt;command&gt;</pre>
<p>For example to fix recursively permission:</p>
<pre>find -type d -print0 | xargs -0 chmod 755
find -type f -print0 | xargs -0 chmod 644</pre>
]]></content:encoded>
			<wfw:commentRss>http://lucasforge.2bopen.org/2008/05/execute-commands-on-folder-and-files-containing-spaces/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ortro 1.3.0 is out!</title>
		<link>http://lucasforge.2bopen.org/2008/05/ortro-130-is-out/</link>
		<comments>http://lucasforge.2bopen.org/2008/05/ortro-130-is-out/#comments</comments>
		<pubDate>Wed, 07 May 2008 17:15:22 +0000</pubDate>
		<dc:creator>Luca Corbo</dc:creator>
		
		<category><![CDATA[Ortro]]></category>

		<category><![CDATA[monitoring]]></category>

		<category><![CDATA[Net_Nmap]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[scheduling]]></category>

		<guid isPermaLink="false">http://lucasforge.2bopen.org/?p=3</guid>
		<description><![CDATA[The new stable version of Ortro has been released.
This version comes with some interesting features such us the auto discovery of the hosts and an import/export tools.
The Auto discovery tool is built on top of the Pear Net_Nmap library and allows to scan your network and successively add automatically the discovered hosts in a specified [...]]]></description>
			<content:encoded><![CDATA[<p>The new stable version of Ortro has been released.</p>
<p>This version comes with some interesting features such us the auto discovery of the hosts and an import/export tools.<br />
The <strong>Auto discovery</strong> tool is built on top of the Pear <a class="urlextern" title="http://pear.php.net/package/Net_Nmap/" rel="nofollow" href="http://pear.php.net/package/Net_Nmap/">Net_Nmap</a> library and allows to scan your network and <span onclick="dr4sdgryt(event)">successively</span> add automatically the discovered hosts in a specified System.</p>
<p>For a detailed list of bug fixes and improvements you may see the <a class="wikilink1" title="changelog" href="http://www.ortro.net/changelog">changelog</a>.</p>
<p>Ortro 1.3.0 and the plugins may be downloaded as usual from:<br />
<a href="http://www.ortro.net/download" target="_new">http://www.ortro.net/download</a></p>
]]></content:encoded>
			<wfw:commentRss>http://lucasforge.2bopen.org/2008/05/ortro-130-is-out/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Hello world!</title>
		<link>http://lucasforge.2bopen.org/2008/05/hello-world/</link>
		<comments>http://lucasforge.2bopen.org/2008/05/hello-world/#comments</comments>
		<pubDate>Tue, 06 May 2008 18:01:13 +0000</pubDate>
		<dc:creator>Luca Corbo</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://lucasforge.2bopen.org/?p=1</guid>
		<description><![CDATA[Welcome to my personal blog&#8230;
Coming soon with more news, stay tuned 
]]></description>
			<content:encoded><![CDATA[<p>Welcome to my personal blog&#8230;</p>
<p>Coming soon with more news, stay tuned <img src='http://lucasforge.2bopen.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://lucasforge.2bopen.org/2008/05/hello-world/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
