<?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>Andrea Falco</title>
	<atom:link href="http://andreafalco.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://andreafalco.com/blog</link>
	<description>Note e consigli vari</description>
	<lastBuildDate>Sun, 18 Mar 2012 10:09:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Sostituire Open Office con Libre Office</title>
		<link>http://andreafalco.com/blog/2012/03/sostituire-open-office-con-libre-office/</link>
		<comments>http://andreafalco.com/blog/2012/03/sostituire-open-office-con-libre-office/#comments</comments>
		<pubDate>Sun, 18 Mar 2012 10:08:18 +0000</pubDate>
		<dc:creator>Andrea Falco</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Libre Office]]></category>
		<category><![CDATA[Open Office]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://andreafalco.com/blog/?p=177</guid>
		<description><![CDATA[Come sostituire Open Office con il nuovo Libre Office su una versione di Ubuntu che ancora non lo montava di default? Rimuovere completamente Open Office Aggiungere i nuovi repository Installare i nuovi pacchetti di Libre Office Per la traduzione in italiano è necessario installare]]></description>
			<content:encoded><![CDATA[<p>Come sostituire <strong>Open Office</strong> con il nuovo <strong>Libre Office</strong> su una versione di <strong>Ubuntu</strong> che ancora non lo montava di default?</p>
<p>Rimuovere completamente Open Office</p>
<pre class="brush: bash; title: ; notranslate">sudo apt-get remove openoffice*.*</pre>
</p>
<p>Aggiungere i nuovi repository</p>
<pre class="brush: bash; title: ; notranslate">sudo add-apt-repository ppa:libreoffice/ppa
sudo apt-get update</pre>
</p>
<p>Installare i nuovi pacchetti di Libre Office</p>
<pre class="brush: bash; title: ; notranslate">sudo apt-get install libreoffice libreoffice-gnome</pre>
</p>
<p>Per la traduzione in italiano è necessario installare</p>
<pre class="brush: bash; title: ; notranslate">sudo apt-get install libreoffice-l10n-it</pre></p>
]]></content:encoded>
			<wfw:commentRss>http://andreafalco.com/blog/2012/03/sostituire-open-office-con-libre-office/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ripristinare grub2</title>
		<link>http://andreafalco.com/blog/2011/01/ripristinare-grub2/</link>
		<comments>http://andreafalco.com/blog/2011/01/ripristinare-grub2/#comments</comments>
		<pubDate>Sun, 30 Jan 2011 12:25:30 +0000</pubDate>
		<dc:creator>Andrea Falco</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[boot]]></category>
		<category><![CDATA[grub 2]]></category>
		<category><![CDATA[grub2]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[liveCD]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://andreafalco.com/blog/?p=150</guid>
		<description><![CDATA[Lanciare una CD Live di Ubuntu 9.10 o superiore. Una volta avviato, aprire un terminale e digitare il seguente comando: Prendere nota della partizione sulla quale è installato Ubuntu. Nei prossimi passi verrà assunto come partizione di installazione /dev/sda1. Montare la partizione sulla quale risiede il sistema. Da riga di comando digitare: Montare il resto [...]]]></description>
			<content:encoded><![CDATA[<ol type="0">
<li>Lanciare una <em>CD Live</em> di <strong>Ubuntu 9.10</strong> o superiore. Una volta avviato, aprire un terminale e digitare il seguente comando:
<pre class="brush: bash; title: ; notranslate">sudo fdisk -l</pre>
<p>Prendere nota della partizione sulla quale è installato <strong>Ubuntu</strong>. Nei prossimi passi verrà assunto come partizione di installazione <tt>/dev/sda1</tt>.</li>
<li>Montare la partizione sulla quale risiede il sistema. Da riga di comando digitare:
<pre class="brush: bash; title: ; notranslate">sudo mount /dev/sda1 /mnt
</pre>
</li>
<li>Montare il resto dei dispositivi con il comando:
<pre class="brush: bash; title: ; notranslate">sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
</pre>
</li>
<li>Effettuare un <strong>chroot</strong> sul proprio sistema. Digitare da riga di comando:
<pre class="brush: bash; title: ; notranslate">sudo chroot /mnt
</pre>
<div>
<table>
<tbody>
<tr>
<td><a href="http://wiki.ubuntu-it.org/Icone/Piccole?action=AttachFile&amp;do=view&amp;target=note.png"><img src="http://wiki.ubuntu-it.org/Icone/Piccole?action=AttachFile&amp;do=get&amp;target=note.png" alt="" align="center" /></a></td>
<td><em>Se  non si è sicuri su questo punto, molto probabilmente non si possiede  una partizione di /boot separata. Saltare quindi il prossimo passaggio.</em></td>
</tr>
</tbody>
</table>
</div>
<p>Se Ubuntu è installato con una partizione di /boot separata (in questo esempio <tt>/dev/sda2</tt>), sarà necessario montare anch&#8217;essa digitando da riga di comando:</p>
<pre class="brush: bash; title: ; notranslate">mount /dev/sda2 /boot
</pre>
</li>
<li>Per installare <strong>Grub 2</strong> nel MBR, digitare nel terminale il seguente comando:
<pre class="brush: bash; title: ; notranslate">grub-install /dev/sda
update-grub2
</pre>
<p>Se si ricevono errori è possibile riprovare con il comando:</p>
<pre class="brush: bash; title: ; notranslate">grub-install --recheck /dev/sda
</pre>
</li>
<li>Uscire dal <strong>chroot</strong> premendo la combinazione di tasti <strong>Ctrl+D</strong> o eseguendo il comando:
<pre class="brush: bash; title: ; notranslate">exit
</pre>
</li>
<li>Smontare tutti i dispositivi digitando:
<pre class="brush: bash; title: ; notranslate">cd ~
sudo umount /mnt/dev
sudo umount /mnt/proc
sudo umount /mnt/sys
sudo umount /mnt/
</pre>
</li>
<li>Riavviare il sistema e rimuovere il CD Live.</li>
<ol type="0"></ol>
<p>Fonte: <a href="http://wiki.ubuntu-it.org/AmministrazioneSistema/Grub/Ripristino">http://wiki.ubuntu-it.org/AmministrazioneSistema/Grub/Ripristino</a></p>
]]></content:encoded>
			<wfw:commentRss>http://andreafalco.com/blog/2011/01/ripristinare-grub2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>String Replace in MySQL</title>
		<link>http://andreafalco.com/blog/2010/10/string-replace-in-mysql/</link>
		<comments>http://andreafalco.com/blog/2010/10/string-replace-in-mysql/#comments</comments>
		<pubDate>Tue, 12 Oct 2010 22:14:58 +0000</pubDate>
		<dc:creator>Andrea Falco</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[BBCodes]]></category>
		<category><![CDATA[REPLACE]]></category>
		<category><![CDATA[str_replace]]></category>

		<guid isPermaLink="false">http://andreafalco.com/blog/?p=143</guid>
		<description><![CDATA[Analogamente al linguaggio PHP, che presenta la funzione str_replace, anche il DBMS MySQL ci offre una funzione simile: REPLACE. Pensiamo ad esempio ai BBCodes, pezzi di codice inseriti dall&#8217;utente e poi convertiti in (x)HTML: ci sono molte alternative sul come effettuare la conversione da BBCodes ad (x)HTML; noi prenderemo in considerazione l&#8217;alternativa in cui i [...]]]></description>
			<content:encoded><![CDATA[<p>Analogamente al linguaggio PHP, che presenta la funzione <em>str_replace</em>, anche il DBMS MySQL ci offre una funzione simile: <em>REPLACE</em>. Pensiamo ad esempio ai BBCodes, pezzi di codice inseriti dall&#8217;utente e poi convertiti in (x)HTML: ci sono molte alternative sul come effettuare la conversione da BBCodes ad (x)HTML; noi prenderemo in considerazione l&#8217;alternativa in cui i dati inseriti dall&#8217;utente vengano inseriti nel database così come sono ed i BBCodes contenuti vengano poi convertiti in tag da MySQL.<br />
Ecco il codice di esempio:</p>
<pre class="brush: sql; title: ; notranslate">UPDATE `articoli` SET `contenuto`= REPLACE(`contenuto`,'[b]','&lt;strong&gt;');</pre>
<p>Con questo codice verrà convertito il BBCode <em>[B]</em> nel tag <em>&lt;strong&gt;</em>. Certamente non è sufficente questa unica query per rendere il tutto produttivo ma rende bene l&#8217;idea di come si possa utilizzare la funzione <em>REPLACE</em> di MySQL.</p>
]]></content:encoded>
			<wfw:commentRss>http://andreafalco.com/blog/2010/10/string-replace-in-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cancellare tutti i file vecchi</title>
		<link>http://andreafalco.com/blog/2010/07/cancellare-tutti-i-file-vecchi/</link>
		<comments>http://andreafalco.com/blog/2010/07/cancellare-tutti-i-file-vecchi/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 10:30:21 +0000</pubDate>
		<dc:creator>Andrea Falco</dc:creator>
				<category><![CDATA[Script Bash]]></category>

		<guid isPermaLink="false">http://andreafalco.com/blog/?p=138</guid>
		<description><![CDATA[Script per cancellare tutti i file più vecchi di un numero di giorni: dove -mtime +3 indica che verranno cercati i file creati più di 3 giorni fa.]]></description>
			<content:encoded><![CDATA[<p>Script per cancellare tutti i file più vecchi di un numero di giorni:</p>
<pre class="brush: bash; title: ; notranslate">find /dir/to/file/* -mtime +3 -exec rm {} \;</pre>
<p>dove <strong>-mtime +3</strong> indica che verranno cercati i file creati più di 3 giorni fa.</p>
]]></content:encoded>
			<wfw:commentRss>http://andreafalco.com/blog/2010/07/cancellare-tutti-i-file-vecchi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP cURL file download</title>
		<link>http://andreafalco.com/blog/2010/07/php-curl-file-download/</link>
		<comments>http://andreafalco.com/blog/2010/07/php-curl-file-download/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 14:02:49 +0000</pubDate>
		<dc:creator>Andrea Falco</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[cURL]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[HTTP]]></category>

		<guid isPermaLink="false">http://andreafalco.com/blog/?p=128</guid>
		<description><![CDATA[Se si tratta di un file ASCII utilizzare il seguente codice: Se invece si tratta di un file binario utilizzare quest&#8217;altro codice]]></description>
			<content:encoded><![CDATA[<p>Se si tratta di un file ASCII utilizzare il seguente codice:</p>
<pre class="brush: php; title: ; notranslate">$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://news.google.com/news?hl=en&amp;topic=t&amp;output=rss');
$fp = fopen('rss.xml', 'w');
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_exec ($ch);
curl_close ($ch);
fclose($fp);</pre>
<p>Se invece si tratta di un file binario utilizzare quest&#8217;altro codice</p>
<pre class="brush: php; title: ; notranslate">$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://example.com/serverfile.zip');
$fp = fopen('file.zip', 'wb');
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_exec ($ch);
curl_close ($ch);
fclose($fp);</pre>
]]></content:encoded>
			<wfw:commentRss>http://andreafalco.com/blog/2010/07/php-curl-file-download/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Link mailto antispam</title>
		<link>http://andreafalco.com/blog/2010/04/link-mailto-antispam/</link>
		<comments>http://andreafalco.com/blog/2010/04/link-mailto-antispam/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 14:48:49 +0000</pubDate>
		<dc:creator>Andrea Falco</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[xHTML]]></category>

		<guid isPermaLink="false">http://andreafalco.com/blog/?p=112</guid>
		<description><![CDATA[Come molti sapranno è sufficiente inserire un indirizzo email in una pagina web per essere bersagliati da una valanga di email di spam. Con qualche piccolo accorgimento si può evitare questo inconveniente. Io ad esempio ho deciso di usare javascript ma ci sono moltissimi altri modi per farlo. Ecco il codice da inserire nell&#8217;head:]]></description>
			<content:encoded><![CDATA[<p>Come molti sapranno è sufficiente inserire un indirizzo email in una pagina web per essere bersagliati da una valanga di email di spam. Con qualche piccolo accorgimento si può evitare questo inconveniente. Io ad esempio ho deciso di usare javascript ma ci sono moltissimi altri modi per farlo. Ecco il codice da inserire nell&#8217;head:</p>
<pre class="brush: xml; title: ; notranslate">&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery-1.4.2.min.js&quot;&gt;&lt;/script&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
$(document).ready(function () {
	mail_addr('#mail', 'info', 'andreafalco', 'com');
});
function mail_addr(i, n, d, t) {
	var string_mail = n + '@' + d + '.' + t;
	$(i).html(string_mail);
	$(i).attr('href', 'ma' + 'ilto' + ':' + string_mail);
}
&lt;/script&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://andreafalco.com/blog/2010/04/link-mailto-antispam/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Decomprimere file .gz</title>
		<link>http://andreafalco.com/blog/2010/01/decomprimere-file-gz/</link>
		<comments>http://andreafalco.com/blog/2010/01/decomprimere-file-gz/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 15:49:21 +0000</pubDate>
		<dc:creator>Andrea Falco</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://andreafalco.com/blog/?p=110</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<pre class="brush: php; title: ; notranslate">function gzfile_get_contents($filename, $use_include_path = 0)
{
	//File does not exist
	if(!@file_exists($filename)) {
		return false;
	}

	//Read and imploding the array to produce a one line string
	$data = gzfile($filename, $use_include_path);
	$data = implode($data);
	return $data;
}
//scriviamo il risultato in un file
file_put_contents('punto.txt', gzfile_get_contents('punto.txt.gz'));</pre>
]]></content:encoded>
			<wfw:commentRss>http://andreafalco.com/blog/2010/01/decomprimere-file-gz/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>System.Collections.Hashtable</title>
		<link>http://andreafalco.com/blog/2010/01/system-collections-hashtable/</link>
		<comments>http://andreafalco.com/blog/2010/01/system-collections-hashtable/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 15:11:08 +0000</pubDate>
		<dc:creator>Andrea Falco</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[DictionaryEntry]]></category>
		<category><![CDATA[Hashtable]]></category>
		<category><![CDATA[ICollection]]></category>
		<category><![CDATA[System.Collections]]></category>
		<category><![CDATA[System.Collections.Hashtable]]></category>

		<guid isPermaLink="false">http://andreafalco.com/blog/?p=103</guid>
		<description><![CDATA[Rappresenta un insieme di coppie chiave/valore organizzate in base al codice hash della chiave.]]></description>
			<content:encoded><![CDATA[<p>Rappresenta un insieme di coppie chiave/valore organizzate in base al codice hash della chiave.</p>
<pre class="brush: csharp; title: ; notranslate">using System;
using System.Collections;

class Example
{
	public static void Main()
	{
		Hashtable htTest = new Hashtable();

		htTest.Add(&quot;txt&quot;, &quot;notepad.exe&quot;);
		htTest.Add(&quot;bmp&quot;, &quot;paint.exe&quot;);
		htTest.Add(&quot;dib&quot;, &quot;paint.exe&quot;);
		htTest.Add(&quot;rtf&quot;, &quot;wordpad.exe&quot;);

		try
		{
			htTest.Add(&quot;txt&quot;, &quot;winword.exe&quot;);
		}
		catch
		{
			Console.WriteLine(&quot;Un elemento con 'Key' = 'txt' esiste gia.&quot;);
		}

		Console.WriteLine(&quot;Per la 'key' = 'rtf', 'Value' = {0}.&quot;, htTest[&quot;rtf&quot;]);

		htTest[&quot;rtf&quot;] = &quot;winword.exe&quot;;
		Console.WriteLine(&quot;Per la 'key' = 'rtf', 'Value' = {0}.&quot;, htTest[&quot;rtf&quot;]);

		htTest[&quot;doc&quot;] = &quot;winword.exe&quot;;

		if (!htTest.ContainsKey(&quot;ht&quot;))
		{
			htTest.Add(&quot;ht&quot;, &quot;hypertrm.exe&quot;);
			Console.WriteLine(&quot;Valore aggiunto con 'key' = 'ht', 'Value' = {0}&quot;, htTest[&quot;ht&quot;]);
		}

		Console.WriteLine();
		foreach( DictionaryEntry de in htTest )
		{
			Console.WriteLine(&quot;'Key' = {0}, 'Value' = {1}&quot;, de.Key, de.Value);
		}

		ICollection valueColl = htTest.Values;

		Console.WriteLine();
		foreach( string s in valueColl )
		{
			Console.WriteLine(&quot;'Value' = {0}&quot;, s);
		}

		ICollection keyColl = htTest.Keys;

		Console.WriteLine();
		foreach( string s in keyColl )
		{
			Console.WriteLine(&quot;'Key' = {0}&quot;, s);
		}

		Console.WriteLine(&quot;\nRimuovo elemento con chiave = 'doc'&quot;);
		htTest.Remove(&quot;doc&quot;);

		if (!htTest.ContainsKey(&quot;doc&quot;))
		{
			Console.WriteLine(&quot;L'elemento con chiave = 'doc' non esiste.&quot;);
		}
	}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://andreafalco.com/blog/2010/01/system-collections-hashtable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Formattare i numeri con printf()</title>
		<link>http://andreafalco.com/blog/2010/01/formattare-i-numeri-con-printf/</link>
		<comments>http://andreafalco.com/blog/2010/01/formattare-i-numeri-con-printf/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 15:13:12 +0000</pubDate>
		<dc:creator>Andrea Falco</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[printf()]]></category>

		<guid isPermaLink="false">http://andreafalco.com/blog/?p=90</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<pre class="brush: php; title: ; notranslate">$number = 15;
printf(&quot;Decimal: %d&quot;, $number);	//Decimal: 15
printf(&quot;Binary: %b&quot;, $number);	//Binary: 1111
printf(&quot;Double: %f&quot;, $number);	//Double: 15.000000
printf(&quot;Octal: %o&quot;, $number);	//Octal: 17
printf(&quot;String: %s&quot;, $number);	//String: 15
printf(&quot;Hex (lower): %x&quot;, $number);	//Hex (lower): f
printf(&quot;Hex (upper): %X&quot;, $number);	//Hex (upper): F</pre>
]]></content:encoded>
			<wfw:commentRss>http://andreafalco.com/blog/2010/01/formattare-i-numeri-con-printf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Watermark in PHP</title>
		<link>http://andreafalco.com/blog/2009/11/watermark-in-php/</link>
		<comments>http://andreafalco.com/blog/2009/11/watermark-in-php/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 19:34:48 +0000</pubDate>
		<dc:creator>Andrea Falco</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[watermark]]></category>

		<guid isPermaLink="false">http://andreafalco.com/blog/?p=69</guid>
		<description><![CDATA[Tratto da http://www.sastgroup.com/tutorials/aggiungere-un-watermark-alle-vostre-immagini-con-php]]></description>
			<content:encoded><![CDATA[<pre class="brush: php; title: ; notranslate">$main_img = "Porsche_911_996_Carrera_4S.jpg"; //immagine principale
$watermark_img = "watermark.gif"; //use GIF or PNG, JPEG has no tranparency support
$padding = 3; //distance to border in pixels for watermark image
$opacity = 100; //image opacity for transparent watermark

$watermark = imagecreatefromgif($watermark_img); //create watermark
$image = imagecreatefromjpeg($main_img); //create main graphic

if(!$image || !$watermark)
	die("Error: main image or watermark could not be loaded!");

$watermark_size = getimagesize($watermark_img);
$watermark_width = $watermark_size[0];
$watermark_height = $watermark_size[1];  

$image_size = getimagesize($main_img);
$dest_x = $image_size[0] - $watermark_width - $padding;
$dest_y = $image_size[1] - $watermark_height - $padding;

//copy watermark on main image
imagecopymerge($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, $opacity);

//print image to screen
header("content-type: image/jpeg");
imagejpeg($image);
imagedestroy($image);
imagedestroy($watermark);</pre>
<p>Tratto da <a href="http://www.sastgroup.com/tutorials/aggiungere-un-watermark-alle-vostre-immagini-con-php">http://www.sastgroup.com/tutorials/aggiungere-un-watermark-alle-vostre-immagini-con-php</a></p>
]]></content:encoded>
			<wfw:commentRss>http://andreafalco.com/blog/2009/11/watermark-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

