<?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>Riding The Breeze &#187; Things I forget</title>
	<atom:link href="http://www.iliveinperego.com/category/things-i-forget/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.iliveinperego.com</link>
	<description>Yes !</description>
	<lastBuildDate>Fri, 12 Feb 2010 09:46:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>CSV export from MySQL</title>
		<link>http://www.iliveinperego.com/2007/09/csv-export-from-mysql/</link>
		<comments>http://www.iliveinperego.com/2007/09/csv-export-from-mysql/#comments</comments>
		<pubDate>Sat, 15 Sep 2007 15:17:36 +0000</pubDate>
		<dc:creator>simone</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Things I forget]]></category>

		<guid isPermaLink="false">http://www.iliveinperego.com/csv-export-from-mysql</guid>
		<description><![CDATA[If you have access on the machine with MySQL and you need to export all tables in a database you can use:
hpatoio@namazu:~$ mysqldump -uroot -p DATABASE_NAME -T '/home/simone/export_csv' --fields-terminated-by "," --fields-enclosed-by '"' --lines-terminated-by "\n"
the script will create a files for each table of the DB and will place it in export_csv.
If you need to export [...]]]></description>
			<content:encoded><![CDATA[<p>If you have access on the machine with MySQL and you need to export all tables in a database you can use:</p>
<p><code>hpatoio@namazu:~$ mysqldump -uroot -p DATABASE_NAME -T '/home/simone/export_csv' --fields-terminated-by "," --fields-enclosed-by '"' --lines-terminated-by "\n"</code></p>
<p>the script will create a files for each table of the DB and will place it in <em>export_csv</em>.</p>
<p>If you need to export a custom resultset or you need to export data from a remote MySQL server on your machine you can use this command :</p>
<p><code>hpatoio@namazu:~$ mysql -uroot -h HOSTNAME -p DATABASE_NAME -B -e "select field1,field2 ... fieldX from \`TABLE_NAME\`;" | sed 's/\t/","/g;s/^/"/;s/$/"/;s/\n//g' &gt; my_export.csv</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.iliveinperego.com/2007/09/csv-export-from-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add days to a date in javascript</title>
		<link>http://www.iliveinperego.com/2007/05/add-days-to-a-date-in-javascript/</link>
		<comments>http://www.iliveinperego.com/2007/05/add-days-to-a-date-in-javascript/#comments</comments>
		<pubDate>Wed, 30 May 2007 15:20:57 +0000</pubDate>
		<dc:creator>simone</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[Things I forget]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.iliveinperego.com/add-days-to-a-date-in-javascript</guid>
		<description><![CDATA[shiftDay = 10
var myDate = new Date();
myDate.setDate(myDate.getUTCDate() + shiftDay)
day   = myDate.getUTCDate()
month = myDate.getUTCMonth()*1 + 1
year  = myDate.getUTCFullYear()
This code is quite easy: 

shiftDay hold the number of days you want to add, if you need to go backwards you can set it to a negative value.
myDate is set to the current date
At the end we will [...]]]></description>
			<content:encoded><![CDATA[<p><code>shiftDay = 10<br />
var myDate = new Date();<br />
myDate.setDate(myDate.getUTCDate() + shiftDay)<br />
day   = myDate.getUTCDate()<br />
month = myDate.getUTCMonth()*1 + 1<br />
year  = myDate.getUTCFullYear()</code></p>
<p>This code is quite easy<em>: </em></p>
<ul>
<li><em>shiftDay</em> hold the number of days you want to add, if you need to go backwards you can set it to a negative value.</li>
<li><em>myDate</em> is set to the current date</li>
<li>At the end we will have the data we need in <em>day</em>, <em>month</em> and <em>year.</em></li>
<li><em>getUTCMonth</em> return the current month shifted back by one (January is 0, February is 1 and so on) that&#039;s why we add 1. We multiply the value returned by <em>getUTCMonth</em> by one to cast it to integer.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.iliveinperego.com/2007/05/add-days-to-a-date-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MSSQL &#124; Convert unix timestamp to date</title>
		<link>http://www.iliveinperego.com/2007/04/mssql-convert-unix-timestamp-to-date/</link>
		<comments>http://www.iliveinperego.com/2007/04/mssql-convert-unix-timestamp-to-date/#comments</comments>
		<pubDate>Tue, 24 Apr 2007 12:37:48 +0000</pubDate>
		<dc:creator>simone</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[MSSQL]]></category>
		<category><![CDATA[Things I forget]]></category>

		<guid isPermaLink="false">http://www.iliveinperego.com/mssql-convert-unix-timestamp-to-date</guid>
		<description><![CDATA[select dateadd(ss, {field_name}, '19700101')
]]></description>
			<content:encoded><![CDATA[<p><code>select dateadd(ss, {field_name}, '19700101')</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.iliveinperego.com/2007/04/mssql-convert-unix-timestamp-to-date/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Slang</title>
		<link>http://www.iliveinperego.com/2006/11/slang/</link>
		<comments>http://www.iliveinperego.com/2006/11/slang/#comments</comments>
		<pubDate>Thu, 02 Nov 2006 22:17:03 +0000</pubDate>
		<dc:creator>simone</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Things I forget]]></category>

		<guid isPermaLink="false">http://www.iliveinperego.com/slang</guid>
		<description><![CDATA[Here some slang/vocabulary from the english course &#034;Rain dogs&#034;

Yes man &#8211; Brown nose
Lecchino, paraculo
Shitting bricks
Avere paura, ironico
Spew
Vomitare
Bill
Banconota in americano, conto in inglese
Note
Banconote in inglese
Check
Conto in americano, assegno in inglese
Jack the ripper
Jack lo squartatore

]]></description>
			<content:encoded><![CDATA[<p>Here some slang/vocabulary from the english course <em>&#034;Rain dogs&#034;</em></p>
<dl>
<dt>Yes man &#8211; Brown nose</dt>
<dd>Lecchino, paraculo</dd>
<dt>Shitting bricks</dt>
<dd>Avere paura, ironico</dd>
<dt>Spew</dt>
<dd>Vomitare</dd>
<dt>Bill</dt>
<dd>Banconota in americano, conto in inglese</dd>
<dt>Note</dt>
<dd>Banconote in inglese</dd>
<dt>Check</dt>
<dd>Conto in americano, assegno in inglese</dd>
<dt>Jack the ripper</dt>
<dd>Jack lo squartatore</dd>
</dl>
]]></content:encoded>
			<wfw:commentRss>http://www.iliveinperego.com/2006/11/slang/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ops &#8230;</title>
		<link>http://www.iliveinperego.com/2006/10/ops/</link>
		<comments>http://www.iliveinperego.com/2006/10/ops/#comments</comments>
		<pubDate>Sun, 08 Oct 2006 21:44:42 +0000</pubDate>
		<dc:creator>simone</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Things I forget]]></category>

		<guid isPermaLink="false">http://www.iliveinperego.com/ops</guid>
		<description><![CDATA[Oh no ! It happend again !!
The sysadmin turned on the gpc_magic_quotes and you got the DB full of \&#039;
Here a fast way to get back the correct values.

UPDATE table_name SET field_name = REPLACE(field_name,&#039;\&#034;&#039;,&#034;&#034;)
 
]]></description>
			<content:encoded><![CDATA[<p>Oh no ! It happend again !!</p>
<p>The sysadmin turned on the gpc_magic_quotes and you got the <acronym title="Database">DB</acronym> full of \&#039;</p>
<p>Here a fast way to get back the correct values.</p>
<blockquote><p>
UPDATE <em>table_name</em> SET <em>field_name</em> = REPLACE(<em>field_name</em>,&#039;\&#034;&#039;,&#034;&#034;)
 </p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.iliveinperego.com/2006/10/ops/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Access Mysql from other machines</title>
		<link>http://www.iliveinperego.com/2006/08/access-mysql-from-other-machine/</link>
		<comments>http://www.iliveinperego.com/2006/08/access-mysql-from-other-machine/#comments</comments>
		<pubDate>Tue, 29 Aug 2006 20:46:54 +0000</pubDate>
		<dc:creator>simone</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Things I forget]]></category>

		<guid isPermaLink="false">http://www.iliveinperego.com/access-mysql-from-other-machine</guid>
		<description><![CDATA[For security reason, MySQL doesn&#039;t allow access from other computer.
If you try to connect with a MySQL administration client like MySQL Administrator you will get a Mysql Error Number 2003.
All this operations modify system settings, so they must be executed with root privileges
If you want connect from a computer in your LAN to your mysql [...]]]></description>
			<content:encoded><![CDATA[<p>For security reason, MySQL doesn&#039;t allow access from other computer.<br />
If you try to connect with a MySQL administration client like <a href="http://www.mysql.com/products/tools/administrator/">MySQL Administrator</a> you will get a <em>Mysql Error Number 2003</em>.</p>
<p>All this operations modify system settings, so they must be executed with root privileges</p>
<p>If you want connect from a computer in your LAN to your mysql server you have to :</p>
<h3>1) Edit your MySQL configuration file</h3>
<p><code>root@namazu:~#sudo vi /etc/mysql/my.conf</code><br />
and change the line<br />
bind-address = 127.0.0.1<br />
with<br />
bind-address = 192.168.178.100</p>
<p>Now, to apply changes you have to reload the MySQL server<br />
<code>root@namazu:~#sudo /etc/init.d/mysql start</code><br />
No MySQL listen on your external interface, to verify that the server is up and accept connection type</p>
<p><code>root@namazu:~#telnet 192.168.178.100 3306</code></p>
<p>and you should get:</p>
<p><code>Trying 192.168.178.100...<br />
Connected to 192.168.178.100.<br />
Escape character is '^]'.<br />
@<br />
5.0.75-0ubuntu10.2</code></p>
<h3>2) Give grants</h3>
<p>Now MySQL is reachable on the &#034;network&#034; level, we have to enable access to databases.</p>
<p>Let&#039;s access MySQL with the mysql client, we still use <i>localhost</i> because we don&#039;t have privileges to access MySQL from others hosts yet.</p>
<p><code>root@namazu:~#mysql -u<em>root</em> -p<em>myRootPass</em> -h localhost </p>
<p>Welcome to the MySQL monitor.  Commands end with ; or \g. Your MySQL connection id is 7 to server version: 5.0.22-Debian_0ubuntu6.06-log  Type 'help;' or '\h' for help. Type '\c' to clear the buffer.</code></p>
<p>Modify access privileges to the server</p>
<p><code>mysql&gt;GRANT ALL PRIVILEGES ON <em>DB_NAME</em> TO '<em>USERNAME</em>'@'<em>HOST</em>' IDENTIFIED BY<br />
'<em>PASSWORD</em>';</code></p>
<p><acronym title="Nota bene">N.B.</acronym> </p>
<ul>
<li>if you want to give access from any host set <em>HOST</em> to &#039;%&#039;</li>
<li>if you want to grant access to all the DBs set <em>DB_NAME</em> to *.*</li>
</ul>
<p>So, for instance, with this command :</p>
<p><code>mysql&gt;GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'foopass';</code></p>
<p>we allow root (whose pass is <i>foopass</i>) to access all databases whichever host.</p>
<p>Exit the client</p>
<p><code>mysql&gt;exit</code></p>
<p>Reload the privileges</p>
<p><code>root@namazu:~#mysqladmin reload</code></p>
<p>For more info on GRANT command: <a title="GRANT Syntax | MySQL Reference Manual" href="http://dev.mysql.com/doc/refman/5.0/en/grant.html">GRANT Syntax on MySQL Reference Manual</a></p>
<p>Have fun &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iliveinperego.com/2006/08/access-mysql-from-other-machine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Import dump in MySQL</title>
		<link>http://www.iliveinperego.com/2006/07/import-dump-in-mysql/</link>
		<comments>http://www.iliveinperego.com/2006/07/import-dump-in-mysql/#comments</comments>
		<pubDate>Mon, 17 Jul 2006 21:45:36 +0000</pubDate>
		<dc:creator>simone</dc:creator>
				<category><![CDATA[Things I forget]]></category>

		<guid isPermaLink="false">http://www.iliveinperego.com/import-dump-in-mysql</guid>
		<description><![CDATA[From a shell run
mysql -u USER -p DBNAME < dump.sql
then insert the password and is done.
]]></description>
			<content:encoded><![CDATA[<p>From a shell run</p>
<blockquote><p>mysql -u <em>USER </em>-p <em>DBNAME </em>< dump.sql</p></blockquote>
<p>then insert the password and is done.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iliveinperego.com/2006/07/import-dump-in-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable display errors for PHP</title>
		<link>http://www.iliveinperego.com/2006/06/enable-display-errors-for-php/</link>
		<comments>http://www.iliveinperego.com/2006/06/enable-display-errors-for-php/#comments</comments>
		<pubDate>Sat, 24 Jun 2006 09:53:36 +0000</pubDate>
		<dc:creator>simone</dc:creator>
				<category><![CDATA[Things I forget]]></category>

		<guid isPermaLink="false">http://www.iliveinperego.com/enable-display-errors-for-php</guid>
		<description><![CDATA[Create or open the file .htaccess and add this line
php_value display_errors On
]]></description>
			<content:encoded><![CDATA[<p>Create or open the file <em>.htaccess</em> and add this line</p>
<blockquote><p>php_value display_errors On</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.iliveinperego.com/2006/06/enable-display-errors-for-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
