<?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>ldlabs.org - Blog &#187; ip</title>
	<atom:link href="http://www.ldlabs.org/blog/tag/ip/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ldlabs.org/blog</link>
	<description>Linux Tips &#38; c.</description>
	<lastBuildDate>Tue, 24 Jan 2012 08:09:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>cartelle condivise con VirtualBox ed altre cosette</title>
		<link>http://www.ldlabs.org/blog/2009/03/11/cartelle-condivise-con-virtualbox-ed-altre-cosette/</link>
		<comments>http://www.ldlabs.org/blog/2009/03/11/cartelle-condivise-con-virtualbox-ed-altre-cosette/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 15:22:25 +0000</pubDate>
		<dc:creator>Francesco Apollonio</dc:creator>
				<category><![CDATA[Guide]]></category>
		<category><![CDATA[hard disk]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[program]]></category>
		<category><![CDATA[utility]]></category>
		<category><![CDATA[varie]]></category>
		<category><![CDATA[virtual]]></category>
		<category><![CDATA[VirtualBox]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.ldlabs.org/blog/?p=97</guid>
		<description><![CDATA[<style type="text/css">
#leftcontainerBox {
float:left;
position: fixed;
top:40%;
left:60px;
z-index:1;
#F0F4F9 
}

#leftcontainerBox .buttons {
float:left;
clear:both;
margin:4px 4px 4px 4px;
width:110px;
height:60px;
padding-bottom:2px;
}


#bottomcontainerBox {
float:left;
height:30px;
width:100%;
#F0F4F9}

#bottomcontainerBox .buttons {
float:left;
height:30px;
width:110px;
margin:4px 4px 4px 4px;
}

</style>
Piccolo tutorial su come configurare le cartelle condivise per poter accedere alla partizione linux direttamente da windows (virtuale). Le prima cosa da fare è aggiungere (a macchina virtuale spenta) la cartella condivisa, basta premere il tasto in alto a destra &#8220;Aggiungi nuova cartella condivisa&#8221; ed impostare il percorso da condividere: ora avviamo la macchina virtuale [...]]]></description>
			<content:encoded><![CDATA[<style type="text/css">
#leftcontainerBox {
float:left;
position: fixed;
top:40%;
left:60px;
z-index:1;
#F0F4F9 
}

#leftcontainerBox .buttons {
float:left;
clear:both;
margin:4px 4px 4px 4px;
width:110px;
height:60px;
padding-bottom:2px;
}


#bottomcontainerBox {
float:left;
height:30px;
width:100%;
#F0F4F9}

#bottomcontainerBox .buttons {
float:left;
height:30px;
width:110px;
margin:4px 4px 4px 4px;
}

</style>
<p>Piccolo tutorial su come configurare le <strong>cartelle condivise</strong> per poter accedere alla partizione linux direttamente da <em>windows</em> (virtuale).</p>
<p>Le prima cosa da fare è aggiungere (a macchina virtuale spenta) la cartella condivisa, basta premere il tasto in alto a destra &#8220;Aggiungi nuova cartella condivisa&#8221;</p>
<div id="attachment_98" class="wp-caption aligncenter" style="width: 310px"><a rel="shadowbox" href="http://www.ldlabs.org/blog/wp-content/uploads/2009/03/windows-shared1.png"><img class="size-medium wp-image-98 colorbox-97" title="windows-shared1" src="http://www.ldlabs.org/blog/wp-content/uploads/2009/03/windows-shared1-300x251.png" alt="prima parte della configurazione (a macchina virtuale spenta)" width="300" height="251" /></a><p class="wp-caption-text">prima parte della configurazione (a macchina virtuale spenta)</p></div>
<p>ed impostare il percorso da condividere:</p>
<div id="attachment_100" class="wp-caption aligncenter" style="width: 310px"><a rel="shadowbox" href="http://www.ldlabs.org/blog/wp-content/uploads/2009/03/windows-shared2.png" target="_blank"><img class="size-medium wp-image-100 colorbox-97" title="windows-shared2" src="http://www.ldlabs.org/blog/wp-content/uploads/2009/03/windows-shared2-300x197.png" alt="seconda parte della configurazione (a macchina virtuale spenta)" width="300" height="197" /></a><p class="wp-caption-text">seconda parte della configurazione (a macchina virtuale spenta)</p></div>
<p>ora avviamo la macchina virtuale ed apriamo il <em>Prompt dei comandi</em>:</p>
<div id="attachment_101" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.ldlabs.org/blog/wp-content/uploads/2009/03/windows-shared3.png" target="_blank"><img class="size-medium wp-image-101 colorbox-97" title="windows-shared3" src="http://www.ldlabs.org/blog/wp-content/uploads/2009/03/windows-shared3-300x251.png" alt="il comando da eseguire per abilitare la cartella condivisa" width="300" height="251" /></a><p class="wp-caption-text">il comando da eseguire per abilitare la cartella condivisa</p></div>
<p>digitamo il comando:</p>

<div class="wp_codebox"><table><tr id="p972"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p97code2"><pre class="dos" style="font-family:monospace;">net use x: \\vboxsrv\NOME_CARTELLA</pre></td></tr></table></div>

<p>ed ecco che la nostra partizione è accessibile anche dalla macchina virtuale.</p>
<div id="attachment_102" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.ldlabs.org/blog/wp-content/uploads/2009/03/windows-shared4.png" target="_blank"><img class="size-medium wp-image-102 colorbox-97" title="windows-shared4" src="http://www.ldlabs.org/blog/wp-content/uploads/2009/03/windows-shared4-300x251.png" alt="ecco la nostra partizione" width="300" height="251" /></a><p class="wp-caption-text">ecco la nostra partizione</p></div>
<p><strong>Altra piccola nota</strong>: per accedere all&#8217;host dalla macchina guest utilizzate l&#8217;ip 10.0.2.2.</p>
<div id="bottomcontainerBox">
			<div class="buttons">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.ldlabs.org%2Fblog%2F2009%2F03%2F11%2Fcartelle-condivise-con-virtualbox-ed-altre-cosette%2F&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowTransparency="true"></iframe></div>
			<div class="buttons">
			<g:plusone size="medium" href="http://www.ldlabs.org/blog/2009/03/11/cartelle-condivise-con-virtualbox-ed-altre-cosette/"></g:plusone>
			</div>
			<div class="buttons">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.ldlabs.org/blog/2009/03/11/cartelle-condivise-con-virtualbox-ed-altre-cosette/"  data-text="cartelle condivise con VirtualBox ed altre cosette" data-count="horizontal">Tweet</a>
			</div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div>]]></content:encoded>
			<wfw:commentRss>http://www.ldlabs.org/blog/2009/03/11/cartelle-condivise-con-virtualbox-ed-altre-cosette/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>mysql ip geolocation</title>
		<link>http://www.ldlabs.org/blog/2009/02/10/mysql-ip-geolocation/</link>
		<comments>http://www.ldlabs.org/blog/2009/02/10/mysql-ip-geolocation/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 15:32:45 +0000</pubDate>
		<dc:creator>Francesco Apollonio</dc:creator>
				<category><![CDATA[Guide]]></category>
		<category><![CDATA[Programmazione]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.ldlabs.org/blog/?p=22</guid>
		<description><![CDATA[<style type="text/css">
#leftcontainerBox {
float:left;
position: fixed;
top:40%;
left:60px;
z-index:1;
#F0F4F9 
}

#leftcontainerBox .buttons {
float:left;
clear:both;
margin:4px 4px 4px 4px;
width:110px;
height:60px;
padding-bottom:2px;
}


#bottomcontainerBox {
float:left;
height:30px;
width:100%;
#F0F4F9}

#bottomcontainerBox .buttons {
float:left;
height:30px;
width:110px;
margin:4px 4px 4px 4px;
}

</style>
Leggendo qua e la ho mi son ritrovato su questa pagina. tante volte avrei voluto conoscere la localizzazione geografica di un indirizzo ip, per svariati motivi: sapere l&#8217;origine di un mio visitatore per esempio. Bene ora tramite questo database mysql è possibile conoscere (approssimativamente) la localizzazione di un indirizzo ip. Per poterlo utilizzare bisogna avere [...]]]></description>
			<content:encoded><![CDATA[<style type="text/css">
#leftcontainerBox {
float:left;
position: fixed;
top:40%;
left:60px;
z-index:1;
#F0F4F9 
}

#leftcontainerBox .buttons {
float:left;
clear:both;
margin:4px 4px 4px 4px;
width:110px;
height:60px;
padding-bottom:2px;
}


#bottomcontainerBox {
float:left;
height:30px;
width:100%;
#F0F4F9}

#bottomcontainerBox .buttons {
float:left;
height:30px;
width:110px;
margin:4px 4px 4px 4px;
}

</style>
<p>Leggendo qua e la ho mi son ritrovato su <a href="http://blogama.org/node/58" target="_blank">questa pagina</a>. tante volte avrei voluto conoscere la localizzazione geografica di un indirizzo ip, per svariati motivi: sapere l&#8217;origine di un mio visitatore per esempio.<br />
Bene ora tramite questo database mysql è possibile conoscere (approssimativamente) la localizzazione di un indirizzo ip.</p>
<p>Per poterlo utilizzare bisogna avere un server mysql sul quale fare l&#8217;import del database, vi consiglio di farlo tramite la linea di comando del server per non avere problemi data la dimensione del file, questo è il comando da dare:</p>
<blockquote><p><em>source /path/to/ipinfodb.sql</em></p></blockquote>
<p>successivamente è necessario possedere l&#8217;indirizzo ip da ricercare (ovviamente <img src='http://www.ldlabs.org/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley colorbox-22' /> ) nella forma <em>`a.b.c.d`</em> e utilizzando la formula:</p>
<blockquote><p><em>(256*a + b) * 256 + c</em></p></blockquote>
<p>calcolarsi il valore con cui fare la ricerca. Questa è la query:</p>
<blockquote>
<div class="geshifilter"><em>SELECT * FROM `ip_group_city` where `ip_start` &lt;= <span style="text-decoration: line-through;">4881709</span> order by ip_start desc limit 1;</em></div>
</blockquote>
<div class="geshifilter">dove al posto di `<em><span style="text-decoration: line-through;">4881709</span></em>` dovete metterci il risultato dell&#8217;operazione sopra descritta.</div>
<div class="geshifilter">Questo piccolo script php fa tutto questo per voi, dovete solo riempire con server, username, password e database:</div>

<div class="wp_codebox"><table><tr id="p224"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code" id="p22code4"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ip'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #339933;">&lt;</span>form action<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;searchip.php&quot;</span> method<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;get&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;ip&quot;</span> <span style="color: #339933;">/&gt;&lt;</span>br <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;submit&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;/</span>form<span style="color: #339933;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">//QUESTO SCRIPT NON È SICURO (NON C'È CONTROLLO SULL'INPUT), UTILIZZATELO SOLO PER DELLE PROVE LOCALI!</span>
&nbsp;
<span style="color: #000088;">$split</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/explode"><span style="color: #990000;">explode</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;.&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ip'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$COUNT</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">256</span><span style="color: #339933;">*</span><span style="color: #000088;">$split</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> <span style="color: #000088;">$split</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">256</span> <span style="color: #339933;">+</span> <span style="color: #000088;">$split</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$QUERY</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'SELECT * FROM `ip_group_city` where `ip_start` &lt;= '</span><span style="color: #339933;">.</span><span style="color: #000088;">$COUNT</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' order by ip_start desc limit 1;'</span><span style="color: #339933;">;</span>
&nbsp;
<a href="http://www.php.net/mysql_connect"><span style="color: #990000;">mysql_connect</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'localhost'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'username'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://www.php.net/mysql_select_db"><span style="color: #990000;">mysql_select_db</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;test&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$res</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$QUERY</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$arr</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_fetch_array"><span style="color: #990000;">mysql_fetch_array</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$res</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Country: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$arr</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'country_code'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br /&gt;City: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$arr</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'city'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<div class="geshifilter">buon lavoro <img src='http://www.ldlabs.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley colorbox-22' /> </div>
<div id="bottomcontainerBox">
			<div class="buttons">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.ldlabs.org%2Fblog%2F2009%2F02%2F10%2Fmysql-ip-geolocation%2F&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowTransparency="true"></iframe></div>
			<div class="buttons">
			<g:plusone size="medium" href="http://www.ldlabs.org/blog/2009/02/10/mysql-ip-geolocation/"></g:plusone>
			</div>
			<div class="buttons">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.ldlabs.org/blog/2009/02/10/mysql-ip-geolocation/"  data-text="mysql ip geolocation" data-count="horizontal">Tweet</a>
			</div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div>]]></content:encoded>
			<wfw:commentRss>http://www.ldlabs.org/blog/2009/02/10/mysql-ip-geolocation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

