<?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>Mon, 23 Apr 2012 09:06:58 +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>Colorized text from php in unix terminals</title>
		<link>http://blog.globodyne.gr/2012/04/colorized-text-from-php-in-unix-terminals/</link>
		<comments>http://blog.globodyne.gr/2012/04/colorized-text-from-php-in-unix-terminals/#comments</comments>
		<pubDate>Mon, 23 Apr 2012 09:06:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.globodyne.gr/?p=108</guid>
		<description><![CDATA[Colorized text from php in unix terminals # first define colors to use $_colors = array( LIGHT_RED => &#8220;[1;31m", LIGHT_GREEN => "[1;32m", YELLOW => "[1;33m", LIGHT_BLUE => "[1;34m", MAGENTA => "[1;35m", LIGHT_CYAN => "[1;36m", WHITE => "[1;37m", NORMAL => "[0m", BLACK => "[0;30m", RED => "[0;31m", GREEN => "[0;32m", BROWN => "[0;33m", BLUE => "[0;34m", [...]]]></description>
			<content:encoded><![CDATA[<p>Colorized text from php in unix terminals</p>
<blockquote><p># first define colors to use<br />
$_colors = array(<br />
        LIGHT_RED      => &#8220;[1;31m",<br />
        LIGHT_GREEN     => "[1;32m",<br />
        YELLOW         => "[1;33m",<br />
        LIGHT_BLUE     => "[1;34m",<br />
        MAGENTA     => "[1;35m",<br />
        LIGHT_CYAN     => "[1;36m",<br />
        WHITE         => "[1;37m",<br />
        NORMAL         => "[0m",<br />
        BLACK         => "[0;30m",<br />
        RED         => "[0;31m",<br />
        GREEN         => "[0;32m",<br />
        BROWN         => "[0;33m",<br />
        BLUE         => "[0;34m",<br />
        CYAN         => "[0;36m",<br />
        BOLD         => "[1m",<br />
        UNDERSCORE     => "[4m",<br />
        REVERSE     => "[7m",</p>
<p>);<br />
##############################################<br />
# Output colorized text to terminal run<br />
# php scripts..<br />
##############################################<br />
function termcolored($text, $color="NORMAL", $back=1){<br />
    global $_colors;<br />
    $out = $_colors["$color"];<br />
    if($out == &#8220;&#8221;){ $out = &#8220;[0m&#8221;; }<br />
    if($back){<br />
        return chr(27).&#8221;$out$text&#8221;.chr(27).&#8221;[0m&#8221;;#.chr(27);<br />
    }else{<br />
        echo chr(27).&#8221;$out$text&#8221;.chr(27).chr(27).&#8221;[0m&#8221;;#.chr(27);<br />
    }//fi<br />
}// end function<br />
##############################################</p></blockquote>
<fb:like 
		href="http://blog.globodyne.gr/2012/04/colorized-text-from-php-in-unix-terminals/" 
		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/04/colorized-text-from-php-in-unix-terminals/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>fail2ban for elastix 2.2</title>
		<link>http://blog.globodyne.gr/2012/04/fail2ban-for-elastix-2-2/</link>
		<comments>http://blog.globodyne.gr/2012/04/fail2ban-for-elastix-2-2/#comments</comments>
		<pubDate>Fri, 20 Apr 2012 09:52:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.globodyne.gr/?p=105</guid>
		<description><![CDATA[Step 1. vi /etc/fail2ban/filter.d/asterisk.conf [Definition] #_daemon = asterisk # Option: failregex # Notes.: regex to match the password failures messages in the logfile. The # host must be matched by a group named &#8220;host&#8221;. The tag &#8220;&#8221; can # be used for standard IP/hostname matching and is only an alias for # (?:::f{4,6}:)?(?P\S+) # Values: [...]]]></description>
			<content:encoded><![CDATA[<p>Step 1.<br />
vi /etc/fail2ban/filter.d/asterisk.conf</p>
<blockquote><p>
[Definition]</p>
<p>#_daemon = asterisk</p>
<p># Option:  failregex<br />
# Notes.:  regex to match the password failures messages in the logfile. The<br />
#          host must be matched by a group named &#8220;host&#8221;. The tag &#8220;<HOST>&#8221; can<br />
#          be used for standard IP/hostname matching and is only an alias for<br />
#          (?:::f{4,6}:)?(?P<host>\S+)<br />
# Values:  TEXT<br />
#</p>
<p>failregex = NOTICE.* .*: Registration from &#8216;.*&#8217; failed for &#8216;<HOST>:.*&#8217; &#8211; Wrong password<br />
            NOTICE.* .*: Registration from &#8216;.*&#8217; failed for &#8216;<HOST>:.*&#8217; &#8211; No matching peer found<br />
            NOTICE.* .*: Registration from &#8216;.*&#8217; failed for &#8216;<HOST>:.*&#8217; &#8211; Username/auth name mismatch<br />
            NOTICE.* .*: Registration from &#8216;.*&#8217; failed for &#8216;<HOST>:.*&#8217; &#8211; Device does not match ACL<br />
            NOTICE.* <HOST> failed to authenticate as &#8216;.*&#8217;$<br />
            NOTICE.* .*: No registration for peer &#8216;.*&#8217; (from <HOST>)<br />
            NOTICE.* .*: Host <HOST> failed MD5 authentication for &#8216;.*&#8217; (.*)<br />
            VERBOSE.* logger.c: &#8212; .*IP/<HOST>-.* Playing &#8216;ss-noservice&#8217; (language &#8216;.*&#8217;)</p>
<p># Option:  ignoreregex<br />
# Notes.:  regex to ignore. If this regex matches, the line is ignored.<br />
# Values:  TEXT<br />
#<br />
ignoreregex =
</p></blockquote>
<p>Step 2.<br />
vi /etc/fail2ban/jail.conf</p>
<blockquote><p>[general]</p>
<p>ignoreip = 127.0.0.1 youripaddress (don&#8217;t ban yourself)</p>
<p>[asterisk-iptables]</p>
<p>enabled = true<br />
filter = asterisk<br />
action = iptables-allports[name=ASTERISK, protocol=all]<br />
sendmail-whois[name=ASTERISK, dest=root, sender=fail2ban@example.org]<br />
logpath = /var/log/asterisk/full<br />
maxretry = 3<br />
bantime = 600
</p></blockquote>
<p>Step 3.</p>
<blockquote><p>chkconfig fail2ban on<br />
/etc/init.d/fail2ban start
</p></blockquote>
<p>Step 4.<br />
check if your fail2ban is running</p>
<blockquote><p>iptables -L -v</p></blockquote>
<p>you should see something like this</p>
<p><strong>Chain fail2ban-ASTERISK (1 references)<br />
pkts bytes target prot opt in out source destination<br />
2013K 377M RETURN all &#8212; any any anywhere anywhere<br />
</strong></p>
<p>Now try to register on your elastix with the false credentials, also remeber test it from the ip which is not in ignoreip list. if everything goes well after 3 attempts you&#8217;ll be baned for 3600 seconds!</p>
<fb:like 
		href="http://blog.globodyne.gr/2012/04/fail2ban-for-elastix-2-2/" 
		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/04/fail2ban-for-elastix-2-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Force SSL (https://) using .htaccess and mod_rewrite</title>
		<link>http://blog.globodyne.gr/2012/04/force-ssl-https-using-htaccess-and-mod_rewrite/</link>
		<comments>http://blog.globodyne.gr/2012/04/force-ssl-https-using-htaccess-and-mod_rewrite/#comments</comments>
		<pubDate>Thu, 19 Apr 2012 11:26:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.globodyne.gr/?p=82</guid>
		<description><![CDATA[Sometimes you may need to make sure that the user is browsing your site over secure connection. An easy to way to always redirect the user to secure connection (https://) can be accomplished with a .htaccess file containing the following lines: RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.example.com/$1 [R,L] In case you wish to [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you may need to make sure that the user is browsing your site over secure connection. An easy to way to always redirect the user to secure connection (https://) can be accomplished with a .htaccess file containing the following lines:</p>
<blockquote><p>
RewriteEngine On<br />
RewriteCond %{SERVER_PORT} 80<br />
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
</p></blockquote>
<p>In case you wish to force HTTPS for a particular folder you can use:</p>
<blockquote><p>RewriteEngine On<br />
RewriteCond %{SERVER_PORT} 80<br />
RewriteCond %{REQUEST_URI} myfolder<br />
RewriteRule ^(.*)$ https://www.example.com/myfolder/$1 [R,L]</p></blockquote>
<p><em>The .htaccess file should be placed in the folder where you need to force HTTPS.</em></p>
<fb:like 
		href="http://blog.globodyne.gr/2012/04/force-ssl-https-using-htaccess-and-mod_rewrite/" 
		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/04/force-ssl-https-using-htaccess-and-mod_rewrite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to set time in OpenVZ VPS?</title>
		<link>http://blog.globodyne.gr/2012/03/how-to-set-time-in-openvz-vps/</link>
		<comments>http://blog.globodyne.gr/2012/03/how-to-set-time-in-openvz-vps/#comments</comments>
		<pubDate>Mon, 26 Mar 2012 09:01:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.globodyne.gr/?p=79</guid>
		<description><![CDATA[rm /etc/localtime ln -s /usr/share/zoneinfo/Europe/London /etc/localtime]]></description>
			<content:encoded><![CDATA[<p>rm /etc/localtime<br />
ln -s /usr/share/zoneinfo/Europe/London /etc/localtime</p>
<fb:like 
		href="http://blog.globodyne.gr/2012/03/how-to-set-time-in-openvz-vps/" 
		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/03/how-to-set-time-in-openvz-vps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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[PHP]]></category>
		<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>
	</channel>
</rss>

