<?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>GloboDyne.gr Blog</title>
	<atom:link href="http://blog.globodyne.gr/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.globodyne.gr</link>
	<description>GloboDyne.gr Blog</description>
	<lastBuildDate>Fri, 06 Jan 2012 16:23:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Ip address validation in PHP using regular expression</title>
		<link>http://blog.globodyne.gr/2012/01/ip-address-validation-in-php-using-regular-expression/</link>
		<comments>http://blog.globodyne.gr/2012/01/ip-address-validation-in-php-using-regular-expression/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 16:22:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.globodyne.gr/?p=75</guid>
		<description><![CDATA[If you don’t know how to validate the IP address format in PHP, then you are in the right place. I’ll show you here how to validate the IP address using regular expression in PHP. &#160; IP address consists four parts. Each parts separated by period “.” and these part consists the digits which ranges [...]]]></description>
			<content:encoded><![CDATA[<p>If you don’t know how to validate the IP address format in PHP, then you are in the right place.</p>
<p>I’ll show you here how to validate the IP address using regular expression in PHP.</p>
<p>&nbsp;</p>
<p>IP address consists four parts. Each parts separated by period “.” and these part consists the digits which ranges from 0 to 255.</p>
<p><strong>Function to validate IP address in PHP using Regular Expression</strong></p>
<blockquote><p>//function to validate ip address format in php<br />
function validateIpAddress($ip_addr)<br />
{<br />
//first of all the format of the ip address is matched<br />
if(preg_match(&#8220;/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/&#8221;,$ip_addr))<br />
{<br />
//now all the intger values are separated<br />
$parts=explode(&#8220;.&#8221;,$ip_addr);<br />
//now we need to check each part can range from 0-255<br />
foreach($parts as $ip_parts)<br />
{<br />
if(intval($ip_parts)&gt;255 || intval($ip_parts)&lt;0)<br />
return false; //if number is not within range of 0-255<br />
}<br />
return true;<br />
}<br />
else<br />
return false; //if format of ip address doesn&#8217;t matches<br />
}</p></blockquote>
<p>As you can see above, first of all the format of the “$ip_addr” is validated using regular expression. In the regular expression “\d{1,3}” means that there should be digits which can be either 1 to 3 digits because a IP Adress can be “222.0.123.12″ or<br />
“12.15.123.5″. So, each part can consists 1 to 3 digits.</p>
<p>After validating the format using regular expression, each part of the IP address is separated using period(“.”) using explode() function available in PHP. And finally, it is checked that each part of the IP address is between 0 to 225 or not.</p>
<fb:like 
		href="http://blog.globodyne.gr/2012/01/ip-address-validation-in-php-using-regular-expression/" 
		layout="button_count" 
		show_faces="true" 
		width="450" 
		
		action="like" 
		colorscheme="light" 
		style="margin-top:5px;"
		class="fb_edge_widget_with_comment fb_iframe_widget"></fb:like>]]></content:encoded>
			<wfw:commentRss>http://blog.globodyne.gr/2012/01/ip-address-validation-in-php-using-regular-expression/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP &#8211; Converting IP to Country</title>
		<link>http://blog.globodyne.gr/2011/12/php-converting-ip-to-country/</link>
		<comments>http://blog.globodyne.gr/2011/12/php-converting-ip-to-country/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 12:01:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.globodyne.gr/?p=71</guid>
		<description><![CDATA[What to note is that differnet scripts use different IP to Address databases. Some are better than others. If you&#8217;re interested in writing your own, you can download a database from sourceforge, or http://www.hostip.info for example.. Then use it to get the country from the IP. Another way is to use a webservice. For instance [...]]]></description>
			<content:encoded><![CDATA[<p>What to note is that differnet scripts use different <strong>IP</strong> to Address databases. Some are better than others.</p>
<p>If you&#8217;re interested in writing your own, you can download a database from sourceforge, or <a href="http://www.hostip.info/" rel="nofollow" target="_blank">http://www.hostip.info</a> for example..</p>
<p>Then use it to get the <strong>country</strong> from the <strong>IP</strong>.</p>
<p>Another way is to use a webservice.</p>
<p>For instance you can use this one:<br />
<a href="http://www.hostip.info/use.html" rel="nofollow" target="_blank">http://www.hostip.info/use.html</a></p>
<p>To get the <strong>country</strong> would be:</p>
<p>http://api.hostip.info/country.php?ip=$IP</p>
<p>Where $IP is the user <strong>IP</strong>.</p>
<p><strong>PHP</strong> would look something like:</p>
<blockquote><p>&lt;?php</p>
<p>$country = &#8221;;<br />
$IP = $_SERVER['REMOTE_ADDR'];</p>
<p>if (!empty($IP)) {<br />
$country = file_get_contents(&#8216;http://api.hostip.info/country.php?ip=&#8217;.$IP);<br />
}<br />
?&gt;</p></blockquote>
<fb:like 
		href="http://blog.globodyne.gr/2011/12/php-converting-ip-to-country/" 
		layout="button_count" 
		show_faces="true" 
		width="450" 
		
		action="like" 
		colorscheme="light" 
		style="margin-top:5px;"
		class="fb_edge_widget_with_comment fb_iframe_widget"></fb:like>]]></content:encoded>
			<wfw:commentRss>http://blog.globodyne.gr/2011/12/php-converting-ip-to-country/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install VPN PPTP Server on CentOS 6</title>
		<link>http://blog.globodyne.gr/2011/10/install-vpn-pptp-server-on-centos-6/</link>
		<comments>http://blog.globodyne.gr/2011/10/install-vpn-pptp-server-on-centos-6/#comments</comments>
		<pubDate>Sun, 30 Oct 2011 19:53:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.globodyne.gr/?p=66</guid>
		<description><![CDATA[n this tutorial, I will use pptp as protocol to connect to VPN server using a username and password, with 128 bit MPPE encryption. Variable as below: OS: CentOS 6 64bit VPN server:  209.85.227.26 VPN client IP: 209.85.227.27 - 209.85.227.30 VPN username: vpnuser Password: myVPN$99 1. Install ppp via yum: $ yum install ppp -y 2. [...]]]></description>
			<content:encoded><![CDATA[<p>n this tutorial, I will use <strong>pptp</strong> as protocol to connect to VPN server using a username and password, with 128 bit <strong>MPPE</strong> encryption. Variable as below:</p>
<blockquote><p>OS: CentOS 6 64bit<br />
VPN server:  209.85.227.26<br />
VPN client IP: 209.85.227.27 - 209.85.227.30<br />
VPN username: vpnuser<br />
Password: myVPN$99</p></blockquote>
<p>1. Install <strong>ppp</strong> via yum:</p>
<blockquote><p>$ yum install ppp -y</p></blockquote>
<p>2. Download and install pptpd (the daemon for point-to-point tunneling). You can find the correct package at this website <a href="http://poptop.sourceforge.net/yum/stable/packages/">http://poptop.sourceforge.net/yum/stable/packages/</a> :</p>
<blockquote><p>$ cd /usr/local/src<br />
$ wget http://poptop.sourceforge.net/yum/stable/packages/pptpd-1.3.4-2.el6.x86_64.rpm<br />
$ rpm -Uhv pptpd-1.3.4-2.el6.x86_64.rpm</p></blockquote>
<p>3. Once installed, open <strong>/etc/pptpd.conf</strong> using text editor and add following line:</p>
<blockquote><p>localip 209.85.227.26<br />
remoteip 209.85.227.27-30</p></blockquote>
<p>4. Open <strong>/etc/ppp/options.pptpd</strong> and add DNS resolver value:</p>
<blockquote><p>ms-dns 8.8.8.8</p></blockquote>
<p>5. Lets create user to access the VPN server. Open <strong>/etc/ppp/chap-secrets</strong> and add the user as below:</p>
<blockquote><p>vpnuser pptptd myVPN$99 *</p></blockquote>
<p>6. We need to allow IP packet forwarding for this server. Open <strong>/etc/sysctl.conf</strong> via text editor and change line below:</p>
<blockquote><p>net.ipv4.ip_forward = 1</p></blockquote>
<p>7. Run following command to take effect on the changes:</p>
<blockquote><p>$ sysctl -p</p></blockquote>
<p>8. Allow IP masquerading in <strong>IPtables</strong>:</p>
<blockquote><p>$ iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE</p></blockquote>
<p>9. Turn on the <strong>pptpd</strong> service at startup and reboot the server:</p>
<blockquote><p>$ chkconfig pptpd on</p></blockquote>
<fb:like 
		href="http://blog.globodyne.gr/2011/10/install-vpn-pptp-server-on-centos-6/" 
		layout="button_count" 
		show_faces="true" 
		width="450" 
		
		action="like" 
		colorscheme="light" 
		style="margin-top:5px;"
		class="fb_edge_widget_with_comment fb_iframe_widget"></fb:like>]]></content:encoded>
			<wfw:commentRss>http://blog.globodyne.gr/2011/10/install-vpn-pptp-server-on-centos-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable snmp for the Speedtouch Thompson 780</title>
		<link>http://blog.globodyne.gr/2011/09/enable-snmp-for-the-speedtouch-thompson-780/</link>
		<comments>http://blog.globodyne.gr/2011/09/enable-snmp-for-the-speedtouch-thompson-780/#comments</comments>
		<pubDate>Wed, 14 Sep 2011 09:05:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.globodyne.gr/?p=63</guid>
		<description><![CDATA[To enable snmp you have to use telnet to connect to the speedtouch router. telnet x.x.x.x After this type in the following commands: service system modify name=SNMP_AGENT state=enabled to check if it is really enabled type: service system list Default the community string is public. If you want to change it to your own one [...]]]></description>
			<content:encoded><![CDATA[<p>To enable snmp you have to use telnet to connect to the speedtouch router.</p>
<blockquote><p>telnet x.x.x.x</p></blockquote>
<p>After this type in the following commands:</p>
<blockquote><p>service system modify name=SNMP_AGENT state=enabled</p></blockquote>
<p>to check if it is really enabled type:</p>
<blockquote><p>service system list</p></blockquote>
<p>Default the community string is public. If you want to change it to your own one type the following cli:</p>
<blockquote><p>snmp community add securityname=ROCommunity communityname=&lt;community&gt;</p></blockquote>
<p>If you have a Linux System you can also check if it’s working. Go to your bash shell and type the following command:</p>
<blockquote><p>snmpwalk -m ALL -v1 -c &lt;communitystring&gt; &lt;ip address router&gt;</p></blockquote>
<fb:like 
		href="http://blog.globodyne.gr/2011/09/enable-snmp-for-the-speedtouch-thompson-780/" 
		layout="button_count" 
		show_faces="true" 
		width="450" 
		
		action="like" 
		colorscheme="light" 
		style="margin-top:5px;"
		class="fb_edge_widget_with_comment fb_iframe_widget"></fb:like>]]></content:encoded>
			<wfw:commentRss>http://blog.globodyne.gr/2011/09/enable-snmp-for-the-speedtouch-thompson-780/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Mcrypt on CentOS 6</title>
		<link>http://blog.globodyne.gr/2011/08/php-mcrypt-on-centos-6/</link>
		<comments>http://blog.globodyne.gr/2011/08/php-mcrypt-on-centos-6/#comments</comments>
		<pubDate>Thu, 25 Aug 2011 10:38:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.globodyne.gr/?p=60</guid>
		<description><![CDATA[CentOS 6 still doesn’t by default include mcrypt in it’s distribution on repositories. There is hope, EPEL to the rescue again: rpm -ivh http://download.fedora.redhat.com/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm yum update yum install php-mcrypt **Please note the above download is for CentOS 6 x86_64**]]></description>
			<content:encoded><![CDATA[<p>CentOS 6 still doesn’t by default include mcrypt in it’s distribution on repositories.</p>
<p>There is hope, EPEL to the rescue again:</p>
<blockquote><p>rpm -ivh http://download.fedora.redhat.com/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm</p>
<p>yum update</p></blockquote>
<blockquote><p><code>yum install php-mcrypt</code></p></blockquote>
<p>**Please note the above download is for CentOS 6 x86_64**</p>
<fb:like 
		href="http://blog.globodyne.gr/2011/08/php-mcrypt-on-centos-6/" 
		layout="button_count" 
		show_faces="true" 
		width="450" 
		
		action="like" 
		colorscheme="light" 
		style="margin-top:5px;"
		class="fb_edge_widget_with_comment fb_iframe_widget"></fb:like>]]></content:encoded>
			<wfw:commentRss>http://blog.globodyne.gr/2011/08/php-mcrypt-on-centos-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert MySQL Query Result To Excel</title>
		<link>http://blog.globodyne.gr/2011/06/convert-mysql-query-result-to-excel/</link>
		<comments>http://blog.globodyne.gr/2011/06/convert-mysql-query-result-to-excel/#comments</comments>
		<pubDate>Fri, 24 Jun 2011 20:31:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.globodyne.gr/?p=56</guid>
		<description><![CDATA[Using PHP to convert MySQL query result to Excel format is also common especially in web based finance applications. The finance data stored in database are downloaded as Excel file for easy viewing. There is no special functions in PHP to do the job. But you can do it easily by formatting the query result [...]]]></description>
			<content:encoded><![CDATA[<p>Using PHP to convert MySQL query result to Excel format is also common especially in web based finance applications. The finance data stored in database are downloaded as Excel file for easy viewing. There is no special functions in PHP to do the job. But you can do it easily by formatting the query result as tab separated values or put the value in an HTML table. After that set the content type to  application/vnd.ms-excel</p>
<div>
<blockquote><p>&lt;?php<br />
include &#8216;library/config.php&#8217;;<br />
include &#8216;library/opendb.php&#8217;;</p>
<p>$query  = &#8220;SELECT fname, lname FROM students&#8221;;<br />
$result = mysql_query($query) or die(&#8216;Error, query failed&#8217;);</p>
<p>$tsv  = array();<br />
$html = array();<br />
while($row = mysql_fetch_array($result, MYSQL_NUM))<br />
{<br />
$tsv[]  = <strong>implode(&#8220;\t&#8221;, $row);</strong><br />
$html[] = &#8220;&lt;tr&gt;&lt;td&gt;&#8221; .implode(&#8220;&lt;/td&gt;&lt;td&gt;&#8221;, $row) .              &#8221;&lt;/td&gt;&lt;/tr&gt;&#8221;;<br />
}</p>
<p>$tsv = implode(&#8220;\r\n&#8221;, $tsv);<br />
$html = &#8220;&lt;table&gt;&#8221; . implode(&#8220;\r\n&#8221;, $html) . &#8220;&lt;/table&gt;&#8221;;</p>
<p>$fileName = &#8216;mysql-to-excel.xls&#8217;;<br />
<strong>header(&#8220;Content-type: application/vnd.ms-excel&#8221;);<br />
header(&#8220;Content-Disposition: attachment; filename=$fileName&#8221;);</strong></p>
<p>echo $tsv;<br />
//echo $html;</p>
<p>include &#8216;library/closedb.php&#8217;;<br />
?&gt;</p></blockquote>
</div>
<fb:like 
		href="http://blog.globodyne.gr/2011/06/convert-mysql-query-result-to-excel/" 
		layout="button_count" 
		show_faces="true" 
		width="450" 
		
		action="like" 
		colorscheme="light" 
		style="margin-top:5px;"
		class="fb_edge_widget_with_comment fb_iframe_widget"></fb:like>]]></content:encoded>
			<wfw:commentRss>http://blog.globodyne.gr/2011/06/convert-mysql-query-result-to-excel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH with authentication key instead of password</title>
		<link>http://blog.globodyne.gr/2011/06/ssh-with-authentication-key-instead-of-password/</link>
		<comments>http://blog.globodyne.gr/2011/06/ssh-with-authentication-key-instead-of-password/#comments</comments>
		<pubDate>Fri, 17 Jun 2011 07:08:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.globodyne.gr/?p=52</guid>
		<description><![CDATA[Generate the authentication key On the client machine, the user must generate a public / private keys pair that will identify himself on the servers. One can choose to protect it with password or not. Letting it with no password, means that anyone with access to the key files (eg. root on the client’s machine) [...]]]></description>
			<content:encoded><![CDATA[<h3><a id="generate_the_authentication_key" rel="nofollow" name="generate_the_authentication_key">Generate the authentication key</a></h3>
<p>On the client machine, the user must generate a public / private keys pair that will identify himself on the servers. One can choose to protect it with password or not.</p>
<p>Letting it with no password, means that anyone with access to the key files (eg. root on the client’s machine) will have the same level of access of the user and no password will be asked when the client tries to connect to the servers.</p>
<p>Protecting the keys with password means that every time the user tries to connect to a server using those keys , the password for decrypting it will be asked. This is surely more secure, since anyone who can read the key files, will only see an encrypted version.</p>
<p>To generate the key pair do:</p>
<blockquote><p>john@laptop:~$ ssh-keygen<br />
Generating public/private rsa key pair.<br />
Enter file in which to save the key (/home/john/.ssh/id_rsa):<br />
Enter passphrase (empty for no passphrase):<br />
Enter same passphrase again:<br />
Your identification has been saved in /home/john/.ssh/id_rsa.<br />
Your public key has been saved in /home/john/.ssh/id_rsa.pub.<br />
The key fingerprint is:<br />
44:3e:ef:58:94:15:52:c2:88:ca:ab:21:43:53:3d:42 john@laptop<br />
john@laptop:~$</p></blockquote>
<p>Just let the default file (~/.ssh/id_rsa). Enter the password at choice, as explained before. If you need to change the password or add one, do:</p>
<blockquote><p>john@laptop:~$ ssh-keygen -p<br />
Enter file in which the key is (/home/john/.ssh/id_rsa):<br />
Key has comment &#8216;/home/john/.ssh/id_rsa&#8217;<br />
Enter new passphrase (empty for no passphrase):<br />
Enter same passphrase again:<br />
Your identification has been saved with the new passphrase.<br />
john@laptop:~$</p></blockquote>
<p>In this case, a new password was added. Note that this operation does not change the public / private key pair. It only changes its encryption.</p>
<h3><a id="install_the_public_key_on_the_servers" rel="nofollow" name="install_the_public_key_on_the_servers">Install the public key on the servers</a></h3>
<p>Once the public key is installed on the server, access will be granted with no password question. <acronym title="Secure Shell">SSH</acronym> usually comes with an utility called <code>ssh-copy-id</code> that simply adds the contents of client’s <code>~/.ssh/id_rsa.pub</code> to the server’s <code>~/.ssh/authorized_keys</code>:</p>
<blockquote><p>john@laptop:~$ ssh-copy-id -i .ssh/id_rsa.pub root@192.168.0.1<br />
15<br />
john@192.168.0.1&#8242;s password:<br />
Now try logging into the machine, with &#8220;ssh &#8216;john@192.168.0.1&#8242;&#8221;, and check in:</p>
<p>.ssh/authorized_keys</p>
<p>to make sure we haven&#8217;t added extra keys that you weren&#8217;t expecting.</p>
<p>john@laptop:~$</p></blockquote>
<p>Note that at this point password access is needed. This procedure can be done by any other way you wish. For example, the server’s administrator himself can add the public key to allow a user access, instead of giving him a password.</p>
<h3><a id="access" rel="nofollow" name="access">Access</a></h3>
<p>At this point, user’s account on the server can be locked for password authentication. On Linux systems, one can make:</p>
<blockquote><p>root@192.168.0.1:~# passwd -l john</p></blockquote>
<p>to lock john&#8217;s account. Key authentication will still be possible.</p>
<p>Now, try to access the server:</p>
<blockquote><p>john@laptop:~$ ssh john@192.168.0.1<br />
Enter passphrase for key &#8216;/home/john/.ssh/id_rsa&#8217;:<br />
john@192.168.0.1:~$</p></blockquote>
<p>On this case, the client’s key was encrypted and its password was asked. If it had no password, nothing would have been asked, and access would be direct:</p>
<pre>john@laptop:~$ ssh john@192.168.0.1
john@192.168.0.1:~$</pre>
<fb:like 
		href="http://blog.globodyne.gr/2011/06/ssh-with-authentication-key-instead-of-password/" 
		layout="button_count" 
		show_faces="true" 
		width="450" 
		
		action="like" 
		colorscheme="light" 
		style="margin-top:5px;"
		class="fb_edge_widget_with_comment fb_iframe_widget"></fb:like>]]></content:encoded>
			<wfw:commentRss>http://blog.globodyne.gr/2011/06/ssh-with-authentication-key-instead-of-password/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Secure DNS (bind)</title>
		<link>http://blog.globodyne.gr/2011/05/how-to-secure-dns-bind/</link>
		<comments>http://blog.globodyne.gr/2011/05/how-to-secure-dns-bind/#comments</comments>
		<pubDate>Wed, 11 May 2011 07:21:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.globodyne.gr/?p=47</guid>
		<description><![CDATA[Close Open DNS Servers For those of you who check your nameservers and other DNS related issues using the popular site dnsreport you&#8217;re probbaly seeing Fail Open DNS Servers. We&#8217;ll show you have to fixed named to close open dns servers. How do I check my system? Go to www.dnsreport.com and enter your domain name, [...]]]></description>
			<content:encoded><![CDATA[<p>Close Open DNS Servers<br />
For  those of you who check your nameservers and other DNS related issues  using the popular site dnsreport you&#8217;re probbaly seeing Fail Open DNS  Servers. We&#8217;ll show you have to fixed named to close open dns servers.</p>
<p>How do I check my system?<br />
Go to <a href="http://www.dnsreport.com/">www.dnsreport.com</a> and enter your domain name, eg webhostgear.com</p>
<p>You are safe if you see:<br />
PASS Open DNS servers</p>
<p>You need to follow this tutorial if you see:<br />
FAIL Open DNS servers</p>
<p><strong>Closing Open DNS Servers Tutorial</strong></p>
<p><strong>1)</strong> Login to your server and su to root.</p>
<p><strong>2)</strong> Edit the /etc/named.conf file such as:# vi /etc/named.conf</p>
<p>Look for:</p>
<pre>key "rndckey" {
};</pre>
<p>After this add the following, replacing mainIP and secondaryIP with your systems nameservers.</p>
<pre>acl "trusted" {
mainIP;secondaryIP;127.0.0.1;
};</pre>
<p>or if you want to allow your local subnet:</p>
<pre>acl trusted {
 192.168.1.0/24;
 localhost;
 };</pre>
<p><strong>3)</strong> After that is done you want to add the section  that says only the trusted is allowed for certain functions. Check your  options area and make sure you add the following:</p>
<pre>allow-recursion { trusted; };
allow-notify { trusted; };
allow-transfer { trusted; };</pre>
<p>So the final result looks something like:</p>
<pre>options {
        directory "/var/named";
        allow-recursion { trusted; };
        allow-notify { trusted; };
        allow-transfer { trusted; };
        dump-file "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        /*
         * If there is a firewall between you and nameservers you want
         * to talk to, you might need to uncomment the query-source
         * directive below.  Previous versions of BIND always asked
         * questions using port 53, but BIND 8.1 uses an unprivileged
         * port by default.
         */
         // query-source address * port 53;
};</pre>
<p><strong>4)</strong> Save the changes and restart the named service: service named restart</p>
<p><strong>5)</strong> Recheck your site at dnsreport.com</p>
<fb:like 
		href="http://blog.globodyne.gr/2011/05/how-to-secure-dns-bind/" 
		layout="button_count" 
		show_faces="true" 
		width="450" 
		
		action="like" 
		colorscheme="light" 
		style="margin-top:5px;"
		class="fb_edge_widget_with_comment fb_iframe_widget"></fb:like>]]></content:encoded>
			<wfw:commentRss>http://blog.globodyne.gr/2011/05/how-to-secure-dns-bind/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How can I customise my PayPal page with my logo?</title>
		<link>http://blog.globodyne.gr/2011/05/how-can-i-customise-my-paypal-page-with-my-logo/</link>
		<comments>http://blog.globodyne.gr/2011/05/how-can-i-customise-my-paypal-page-with-my-logo/#comments</comments>
		<pubDate>Tue, 10 May 2011 10:56:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.globodyne.gr/?p=42</guid>
		<description><![CDATA[When your customers buy something from you and you use PayPal to accept payments, your customer will find themselves at the PayPal checkout page. Normally your customer will only see your email address at the top of this page. It is possible to customise this page to make it look like your own website. One [...]]]></description>
			<content:encoded><![CDATA[<p>When your customers buy something from you and you use PayPal to  accept payments, your customer will find themselves at the PayPal  checkout page. Normally your customer will only see your email address  at the top of this page. It is possible to customise this page to make  it look like your own website. One way to achieve this is to create a  nice looking graphical banner, using the same style as your own website,  and including your own business logo.You can only do this with a PayPal  business account (read our PayPal FAQ about the different types of  account).</p>
<p>Here&#8217;s what you need to do:</p>
<ol>
<li>Log into PayPal</li>
<li>Click &#8216;Profile&#8217;</li>
<li>Click &#8216;Custom Payment Pages&#8217; under &#8216;Selling Preferences&#8217;</li>
<li>Click &#8216;New&#8217;</li>
<li>Enter a name for your custom page. In the &#8216;Header Image URL&#8217; field,  paste the URL that we provide you with. This will be different for  everyone, because you all have different business logos.</li>
</ol>
<p><a href="http://blog.globodyne.gr/wp-content/uploads/2011/05/general-paypal-custombanner.png"><img class="aligncenter size-medium wp-image-43" title="Paypal custom banner" src="http://blog.globodyne.gr/wp-content/uploads/2011/05/general-paypal-custombanner-300x130.png" alt="How can I customise my PayPal page with my logo?" width="406" height="175" /></a></p>
<ol>
<li>Click Save</li>
<li>Select the new page and then choose &#8216;Make Primary&#8217; and then click  &#8216;Yes&#8217; when you&#8217;re prompted if you&#8217;re sure you want to do this.</li>
</ol>
<p>Now when your customers see your PayPal checkout page they no longer  see just your email address, they see your business logo instead.</p>
<fb:like 
		href="http://blog.globodyne.gr/2011/05/how-can-i-customise-my-paypal-page-with-my-logo/" 
		layout="button_count" 
		show_faces="true" 
		width="450" 
		
		action="like" 
		colorscheme="light" 
		style="margin-top:5px;"
		class="fb_edge_widget_with_comment fb_iframe_widget"></fb:like>]]></content:encoded>
			<wfw:commentRss>http://blog.globodyne.gr/2011/05/how-can-i-customise-my-paypal-page-with-my-logo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BIND with MySQL backend</title>
		<link>http://blog.globodyne.gr/2011/05/bind-with-mysql-backend/</link>
		<comments>http://blog.globodyne.gr/2011/05/bind-with-mysql-backend/#comments</comments>
		<pubDate>Tue, 10 May 2011 08:26:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.globodyne.gr/?p=30</guid>
		<description><![CDATA[Make sure you&#8217;ve got those installed, mysql mysql-server mysql-devel openssl openssl-devel Make sure MySQL is running, service mysqld start Make sure BIND server is NOT installed, rpm -qa &#124; grep bind Installation Get latest BIND tarball (ftp.isc.org/isc/bind9/cur/). Get the BIND/MySQL SDB driver (sourceforge.net/projects/mysql-bind/) Extract the archives, tar xvzf bind-9.7.1-P2.tar.gz tar xvzf mysql-bind.tar.gz Deploy the driver, [...]]]></description>
			<content:encoded><![CDATA[<div>Make sure you&#8217;ve got those installed,</div>
<div>
<ul>
<li>mysql</li>
<li>mysql-server</li>
<li>mysql-devel</li>
<li>openssl</li>
<li>openssl-devel</li>
</ul>
<div>Make sure MySQL is running,</div>
<blockquote>
<div>
<div>service mysqld start</div>
</div>
</blockquote>
<div>
<div>
<div>Make sure BIND server is NOT installed,</div>
<blockquote>
<div>rpm -qa | grep bind</div>
</blockquote>
<div><span id="more-30"></span></div>
<div>
<div><strong>Installation</strong></div>
<div>Get latest BIND tarball (<a href="ftp://ftp.isc.org/isc/bind9/cur/">ftp.isc.org/isc/bind9/cur/</a>).</div>
<div>Get the BIND/MySQL SDB driver (<a href="http://sourceforge.net/projects/mysql-bind/">sourceforge.net/projects/mysql-bind/</a>)</div>
<div>
<div>Extract the archives,</div>
<blockquote>
<div>
<div>tar xvzf bind-9.7.1-P2.tar.gz</div>
<div>tar xvzf mysql-bind.tar.gz</div>
</div>
</blockquote>
<div>
<div>
<div><strong>Deploy the driver,</strong></div>
<blockquote>
<div>
<div>cp mysql-bind/mysqldb.c bind-9.7.1-P2/bin/named</div>
<div>cp mysql-bind/mysqldb.h bind-9.7.1-P2/bin/named/include</div>
</div>
</blockquote>
<div>
<div>
<div>Adapt the makefile,</div>
<blockquote>
<div>
<div>cd bind-9.7.1-P2/bin/named</div>
<div>vi Makefile.in</div>
</div>
</blockquote>
<div>
<div>
<div>change,</div>
<blockquote>
<div>DBDRIVER_OBJS = mysqldb.@O@</div>
<div>DBDRIVER_SRCS = mysqldb.c</div>
</blockquote>
<div>also see MySQL&#8217;s compile flags,</div>
<blockquote>
<div>mysql_config &#8211;cflags</div>
</blockquote>
<div>and copy/paste to,</div>
<blockquote>
<div>DBDRIVER_INCLUDES  = -I/usr/include/mysql  -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions  -fstack-protector &#8211;param=ssp-buffer-size=4 -m32  -fasynchronous-unwind-tables -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64  -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv</div>
</blockquote>
<div>also see MySQL&#8217;s libraries,</div>
<blockquote>
<div>mysql_config &#8211;libs</div>
</blockquote>
<div>and copy/paste to,</div>
<blockquote>
<div>DBRIVER_LIBS = -rdynamic -L/usr/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -L/usr/lib -lssl -lcrypto</div>
</blockquote>
<div>
<div>Add driver&#8217;s include into BIND&#8217;s code,</div>
<blockquote>
<div>cd bind-9.7.1-P2/bin/named</div>
<div>vi main.c</div>
</blockquote>
<div>add,</div>
<blockquote>
<div>/*</div>
<div>* Include header files for database drivers here.</div>
<div>*/</div>
<div>/* #include &#8220;xxdb.h&#8221; */</div>
<div>#include &#8220;mysqldb.h&#8221;</div>
</blockquote>
<div>also search for &#8216;ns_server_create&#8217; and add mysqldb_init just before,</div>
<blockquote>
<div>mysqldb_init();</div>
<div>ns_server_create(ns_g_mctx, &amp;ns_g_server);</div>
</blockquote>
<div>also search for &#8216;ns_server_destroy&#8217; and add mysqldb_clear just after,</div>
<blockquote>
<div>ns_server_destroy(&amp;ns_g_server);</div>
<div>mysqldb_clear();</div>
</blockquote>
<div>Fix driver&#8217;s own include path,</div>
<blockquote>
<div>cd bind-9.7.1-P2/bin/named</div>
<div>vi mysqldb.c</div>
</blockquote>
<div>change,</div>
<blockquote>
<div>/* #include &lt;named/mysqldb.h&gt; */</div>
<div>#include &#8220;include/mysqldb.h&#8221;</div>
</blockquote>
<div>Note. otherwise you&#8217;ll get this error at compile time,</div>
<div>mysqldb.c:41:27: error: named/mysqldb.h: No such file or directory</div>
<div><strong>Compile BIND,</strong></div>
<blockquote>
<div>cd ../..</div>
<div>./configure &#8211;help</div>
<div>./configure</div>
<div>#./configure &#8211;disable-openssl-version-check</div>
<div>make clean</div>
<div>make</div>
<div>make install</div>
</blockquote>
<div>
<div><strong>Configuration</strong></div>
<div>Configure BIND,</div>
<blockquote>
<div>cd /etc</div>
<div>vi named.conf</div>
</blockquote>
<div>like,</div>
<blockquote>
<div>zone &#8220;example.local&#8221; {</div>
<div>type master;</div>
<div>notify no;</div>
<div>database &#8220;mysqldb bindmysql example_local 127.0.0.1 DBUSER DBPASS&#8221;;</div>
<div>};</div>
</blockquote>
<div>note. change the values accordingly</div>
<div>check,</div>
<blockquote>
<div>named-checkconf</div>
</blockquote>
<div>Note. also just in case (optional, it reads /etc/named.conf anyway),</div>
<blockquote>
<div>cd /usr/local/etc</div>
<div>ln -s ../../../etc/named.conf</div>
</blockquote>
<div>Connect to MySQL,</div>
<blockquote>
<div>mysql -uDBUSER -p</div>
<div>create a database,</div>
<div>create database if not exists bindmysql;</div>
<div>and create a table per domain in that database,</div>
<div>use bindmysql</div>
<div>create table example_local (</div>
<div>name varchar(255) default NULL,</div>
<div>ttl int(11) default NULL,</div>
<div>rdtype varchar(255) default NULL,</div>
<div>rdata varchar(255) default NULL</div>
<div>) type=MyISAM;</div>
</blockquote>
<div>note. underscore instead of a dot for table name as domain name</div>
<div>inject some data e.g.,</div>
<blockquote>
<div>insert  into example_local values (&#8216;example.local&#8217;, 259200, &#8216;SOA&#8217;,  &#8216;example.local. postmaster.example.local. 201007281 28800 7200 86400  28800&#8242;);</div>
<div>insert into example_local values (&#8216;example.local&#8217;, 259200, &#8216;NS&#8217;, &#8216;ns0.example.local.&#8217;);</div>
<div>insert into example_local values (&#8216;example.local&#8217;, 259200, &#8216;MX&#8217;, &#8217;10 mail.example.local.&#8217;);</div>
<div>insert into example_local values (&#8216;ns0.example.local&#8217;, 259200, &#8216;A&#8217;, &#8217;10.1.1.1&#8242;);</div>
<div>insert into example_local values (&#8216;example.local&#8217;, 259200, &#8216;A&#8217;, &#8217;10.1.1.1&#8242;);</div>
<div>insert into example_local values (&#8216;mail.example.local&#8217;, 259200, &#8216;A&#8217;, &#8217;10.1.1.1&#8242;);</div>
<div>insert into example_local values (&#8216;www.example.local&#8217;, 259200, &#8216;Cname&#8217;, &#8216;ns0.example.local.&#8217;);</div>
</blockquote>
<div>
<div><strong>Ready go go</strong></div>
<div>Start the daemon,</div>
<blockquote>
<div>/usr/local/sbin/named</div>
</blockquote>
<div>Note. in case you need to reload named.conf,</div>
<blockquote>
<div>kill -HUP XXXX</div>
</blockquote>
<div><strong>Check everything&#8217;s fine,</strong></div>
<blockquote>
<div>host example.local 127.0.0.1</div>
<div>host www.example.local 127.0.0.1</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<fb:like 
		href="http://blog.globodyne.gr/2011/05/bind-with-mysql-backend/" 
		layout="button_count" 
		show_faces="true" 
		width="450" 
		
		action="like" 
		colorscheme="light" 
		style="margin-top:5px;"
		class="fb_edge_widget_with_comment fb_iframe_widget"></fb:like>]]></content:encoded>
			<wfw:commentRss>http://blog.globodyne.gr/2011/05/bind-with-mysql-backend/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

