<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Web Developer apache / php / mysql code and configuration snippets</title>
	<atom:link href="http://lampbear.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://lampbear.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Tue, 29 Jun 2010 14:59:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='lampbear.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Web Developer apache / php / mysql code and configuration snippets</title>
		<link>http://lampbear.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://lampbear.wordpress.com/osd.xml" title="Web Developer apache / php / mysql code and configuration snippets" />
	<atom:link rel='hub' href='http://lampbear.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Serialize error at offset &#8211; how to fix</title>
		<link>http://lampbear.wordpress.com/2010/06/29/serialize-error-at-offset-how-to-fix/</link>
		<comments>http://lampbear.wordpress.com/2010/06/29/serialize-error-at-offset-how-to-fix/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 14:59:13 +0000</pubDate>
		<dc:creator>lampbear</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://lampbear.wordpress.com/?p=35</guid>
		<description><![CDATA[Recently I have been storing some stuff in mysql using serialize which is very useful at storing things like arrays in a DB safely without anything corrupting. However recently I have been getting the error message &#8220;unserialize() [function.unserialize]: Error at offset 2 of &#8230;&#8221;.. after looking around at some strange and confusing solutions.. simple code [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lampbear.wordpress.com&amp;blog=12760353&amp;post=35&amp;subd=lampbear&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently I have been storing some stuff in mysql using serialize which is very useful at storing things like arrays in a DB safely without anything corrupting. However recently I have been getting the error message &#8220;unserialize() [function.unserialize]: Error at offset 2 of &#8230;&#8221;.. after looking around at some strange and confusing solutions.. simple code fixed it:</p>
<p><code><br />
$safeformysqldata = base64_encode(serialize($cutearrayhere));<br />
</code></p>
<p>and to get it back out of the DB:</p>
<p><code><br />
unserialize(base64_decode($row['mydata']));<br />
</code></p>
<p>I hope this helps someone <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lampbear.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lampbear.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lampbear.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lampbear.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lampbear.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lampbear.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lampbear.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lampbear.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lampbear.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lampbear.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lampbear.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lampbear.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lampbear.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lampbear.wordpress.com/35/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lampbear.wordpress.com&amp;blog=12760353&amp;post=35&amp;subd=lampbear&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lampbear.wordpress.com/2010/06/29/serialize-error-at-offset-how-to-fix/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a5065579fe0f0d84efb2ccef951bedb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lampbear</media:title>
		</media:content>
	</item>
		<item>
		<title>Queries using datetime in mysql to search by month</title>
		<link>http://lampbear.wordpress.com/2010/06/28/queries-using-datetime-in-mysql-to-search-by-month/</link>
		<comments>http://lampbear.wordpress.com/2010/06/28/queries-using-datetime-in-mysql-to-search-by-month/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 03:15:19 +0000</pubDate>
		<dc:creator>lampbear</dc:creator>
				<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://lampbear.wordpress.com/?p=32</guid>
		<description><![CDATA[I recently started working with a sales database and rather than using my personal favorite timestamp column type they used datetime &#8211; it took me a couple googles before I finally found the syntax to do queries to find date ranges: SELECT * FROM `sales` WHERE MONTH(column_name) = 6 AND DAY(column_name) &#60; 10; Will get [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lampbear.wordpress.com&amp;blog=12760353&amp;post=32&amp;subd=lampbear&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently started working with a sales database and rather than using my personal favorite timestamp column type they used datetime &#8211; it took me a couple googles before I finally found the syntax to do queries to find date ranges:</p>
<p><code>SELECT * FROM `sales` WHERE MONTH(column_name) = 6 AND DAY(column_name) &lt; 10;</code></p>
<p>Will get all the sales before the 10th in the month of June and ANY year <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  not so great if you have more than a years data hehe <img src='http://s2.wp.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  but now you know how it works and to find year is YEAR(column_name) </p>
<p>If you wanted to get all records that were for this year you can use:</p>
<p><code>Select * from table_name where field_name &gt; YEAR(CURDATE());</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lampbear.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lampbear.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lampbear.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lampbear.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lampbear.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lampbear.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lampbear.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lampbear.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lampbear.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lampbear.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lampbear.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lampbear.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lampbear.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lampbear.wordpress.com/32/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lampbear.wordpress.com&amp;blog=12760353&amp;post=32&amp;subd=lampbear&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lampbear.wordpress.com/2010/06/28/queries-using-datetime-in-mysql-to-search-by-month/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a5065579fe0f0d84efb2ccef951bedb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lampbear</media:title>
		</media:content>
	</item>
		<item>
		<title>How to send UTF8 encoded mail in php</title>
		<link>http://lampbear.wordpress.com/2010/05/24/how-to-send-utf8-encoded-mail-in-ph/</link>
		<comments>http://lampbear.wordpress.com/2010/05/24/how-to-send-utf8-encoded-mail-in-ph/#comments</comments>
		<pubDate>Mon, 24 May 2010 13:15:35 +0000</pubDate>
		<dc:creator>lampbear</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://lampbear.wordpress.com/?p=29</guid>
		<description><![CDATA[After some of my foreign language emails were coming out strange I had a look around to find a way to send out mails through the mail function in PHP.. here it is: $headers = "MIME-Version: 1.0" . "\r\n" . "Content-type: text/plain; charset=UTF-8" . "\r\n"; mail($to, "=?UTF-8?B?".base64_encode($subject)."?=", $message, $headers); You can use this method to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lampbear.wordpress.com&amp;blog=12760353&amp;post=29&amp;subd=lampbear&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>After some of my foreign language emails were coming out strange I had a look around to find a way to send out mails through the mail function in PHP.. here it is:</p>
<p><code><br />
  $headers = "MIME-Version: 1.0" . "\r\n" . "Content-type: text/plain; charset=UTF-8" . "\r\n";<br />
  mail($to, "=?UTF-8?B?".base64_encode($subject)."?=", $message, $headers);<br />
</code></p>
<p>You can use this method to utf encode the sender/recipient/message. Be sure to change text/plain to text/html if you are sending html in a mail <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lampbear.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lampbear.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lampbear.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lampbear.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lampbear.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lampbear.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lampbear.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lampbear.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lampbear.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lampbear.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lampbear.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lampbear.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lampbear.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lampbear.wordpress.com/29/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lampbear.wordpress.com&amp;blog=12760353&amp;post=29&amp;subd=lampbear&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lampbear.wordpress.com/2010/05/24/how-to-send-utf8-encoded-mail-in-ph/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a5065579fe0f0d84efb2ccef951bedb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lampbear</media:title>
		</media:content>
	</item>
		<item>
		<title>Fix for X-Authentication-Warning: .. apache set sender to  using -f</title>
		<link>http://lampbear.wordpress.com/2010/04/26/fix-for-x-authentication-warning-apache-set-sender-to-using-f/</link>
		<comments>http://lampbear.wordpress.com/2010/04/26/fix-for-x-authentication-warning-apache-set-sender-to-using-f/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 10:01:54 +0000</pubDate>
		<dc:creator>lampbear</dc:creator>
				<category><![CDATA[sendmail]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[deliver]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://lampbear.wordpress.com/?p=26</guid>
		<description><![CDATA[Like many people I love to send mail from PHP using apache! But when I do a tail -f of my mail logs I can see many &#8220;X-Authentication-Warning&#8221;&#8216;s. I don&#8217;t like to see warnings in my logs and I read rumors on the net that this also affects the deliverability of your mail.. which is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lampbear.wordpress.com&amp;blog=12760353&amp;post=26&amp;subd=lampbear&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Like many people I love to send mail from PHP using apache! But when I do a tail -f of my mail logs I can see many &#8220;X-Authentication-Warning&#8221;&#8216;s. I don&#8217;t like to see warnings in my logs and I read rumors on the net that this also affects the deliverability of your mail.. which is bad!</p>
<p>Anyway to fix this you just need to add apache as a trusted user in the trusted users list at /etc/mail/trusted-users</p>
<p>After opening that file and adding apache on its own line the error message vanishes <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lampbear.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lampbear.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lampbear.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lampbear.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lampbear.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lampbear.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lampbear.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lampbear.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lampbear.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lampbear.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lampbear.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lampbear.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lampbear.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lampbear.wordpress.com/26/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lampbear.wordpress.com&amp;blog=12760353&amp;post=26&amp;subd=lampbear&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lampbear.wordpress.com/2010/04/26/fix-for-x-authentication-warning-apache-set-sender-to-using-f/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a5065579fe0f0d84efb2ccef951bedb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lampbear</media:title>
		</media:content>
	</item>
		<item>
		<title>Find the size of the current working directory in linux</title>
		<link>http://lampbear.wordpress.com/2010/04/13/find-the-size-of-the-current-working-directory-in-linux/</link>
		<comments>http://lampbear.wordpress.com/2010/04/13/find-the-size-of-the-current-working-directory-in-linux/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 08:09:49 +0000</pubDate>
		<dc:creator>lampbear</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://lampbear.wordpress.com/?p=22</guid>
		<description><![CDATA[Its not so obvious how to find out the size of the directory and all subdirectories in linux but here is the command for quick reference du -sch This will tell you the disk space used by the current working directory and all its sub-directories in a human readable format!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lampbear.wordpress.com&amp;blog=12760353&amp;post=22&amp;subd=lampbear&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Its not so obvious how to find out the size of the directory and all subdirectories in linux but here is the command for quick reference <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
<code><br />
du -sch<br />
</code><br />
This will tell you the disk space used by the current working directory and all its sub-directories in a human readable format!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lampbear.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lampbear.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lampbear.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lampbear.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lampbear.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lampbear.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lampbear.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lampbear.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lampbear.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lampbear.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lampbear.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lampbear.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lampbear.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lampbear.wordpress.com/22/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lampbear.wordpress.com&amp;blog=12760353&amp;post=22&amp;subd=lampbear&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lampbear.wordpress.com/2010/04/13/find-the-size-of-the-current-working-directory-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a5065579fe0f0d84efb2ccef951bedb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lampbear</media:title>
		</media:content>
	</item>
		<item>
		<title>Restart the firewall on CentOS/Redhat</title>
		<link>http://lampbear.wordpress.com/2010/04/12/restart-the-firewall-on-centosredhat/</link>
		<comments>http://lampbear.wordpress.com/2010/04/12/restart-the-firewall-on-centosredhat/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 15:34:51 +0000</pubDate>
		<dc:creator>lampbear</dc:creator>
				<category><![CDATA[Firewall]]></category>

		<guid isPermaLink="false">http://lampbear.wordpress.com/?p=20</guid>
		<description><![CDATA[Another simple one service iptables restart Simply restarts iptables on centos or redhat! I wonder how my shell client stays connected when it does this though..<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lampbear.wordpress.com&amp;blog=12760353&amp;post=20&amp;subd=lampbear&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Another simple one <img src='http://s2.wp.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /><br />
<code><br />
service iptables restart<br />
</code><br />
Simply restarts iptables on centos or redhat! I wonder how my shell client stays connected when it does this though.. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lampbear.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lampbear.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lampbear.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lampbear.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lampbear.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lampbear.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lampbear.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lampbear.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lampbear.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lampbear.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lampbear.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lampbear.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lampbear.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lampbear.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lampbear.wordpress.com&amp;blog=12760353&amp;post=20&amp;subd=lampbear&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lampbear.wordpress.com/2010/04/12/restart-the-firewall-on-centosredhat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a5065579fe0f0d84efb2ccef951bedb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lampbear</media:title>
		</media:content>
	</item>
		<item>
		<title>Start/stop and restart mysql server</title>
		<link>http://lampbear.wordpress.com/2010/04/12/startstop-and-restart-mysql-server/</link>
		<comments>http://lampbear.wordpress.com/2010/04/12/startstop-and-restart-mysql-server/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 13:36:25 +0000</pubDate>
		<dc:creator>lampbear</dc:creator>
				<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://lampbear.wordpress.com/?p=18</guid>
		<description><![CDATA[So simple I should know this by now /etc/init.d/mysqld restart /etc/init.d/mysqld start /etc/init.d/mysqld stop That works for RedHat, this works for Ubuntu/Debian: /etc/init.d/mysql restart<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lampbear.wordpress.com&amp;blog=12760353&amp;post=18&amp;subd=lampbear&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So simple I should know this by now <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<code><br />
/etc/init.d/mysqld restart<br />
/etc/init.d/mysqld start<br />
/etc/init.d/mysqld stop<br />
</code></p>
<p>That works for RedHat, this works for Ubuntu/Debian:<br />
<code><br />
/etc/init.d/mysql restart<br />
</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lampbear.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lampbear.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lampbear.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lampbear.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lampbear.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lampbear.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lampbear.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lampbear.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lampbear.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lampbear.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lampbear.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lampbear.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lampbear.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lampbear.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lampbear.wordpress.com&amp;blog=12760353&amp;post=18&amp;subd=lampbear&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lampbear.wordpress.com/2010/04/12/startstop-and-restart-mysql-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a5065579fe0f0d84efb2ccef951bedb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lampbear</media:title>
		</media:content>
	</item>
		<item>
		<title>Unzip all zip files into current directory on linux using find</title>
		<link>http://lampbear.wordpress.com/2010/04/08/unzip-all-zip-files-into-current-directory-on-linux-using-find/</link>
		<comments>http://lampbear.wordpress.com/2010/04/08/unzip-all-zip-files-into-current-directory-on-linux-using-find/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 04:55:50 +0000</pubDate>
		<dc:creator>lampbear</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[linux unzip find]]></category>

		<guid isPermaLink="false">http://lampbear.wordpress.com/2010/04/08/unzip-all-zip-files-into-current-directory-on-linux-using-find/</guid>
		<description><![CDATA[I needed a quick and dirty command to unzip all the .zip files in the current working directory on my redhat box and this was it! find *.zip -exec unzip {} \; Enjoy EDIT: Same but for rar files, auto renames the files if they exist and uses rar name as the directory: find *.rar [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lampbear.wordpress.com&amp;blog=12760353&amp;post=17&amp;subd=lampbear&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I needed a quick and dirty command to unzip all the .zip files in the current working directory on my redhat box and this was it!<br />
<code><br />
find *.zip -exec unzip {} \;<br />
</code><br />
Enjoy <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>EDIT: Same but for rar files, auto renames the files if they exist and uses rar name as the directory:<br />
<code><br />
find *.rar -exec unrar e -ad -or {} \;<br />
</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lampbear.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lampbear.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lampbear.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lampbear.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lampbear.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lampbear.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lampbear.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lampbear.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lampbear.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lampbear.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lampbear.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lampbear.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lampbear.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lampbear.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lampbear.wordpress.com&amp;blog=12760353&amp;post=17&amp;subd=lampbear&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lampbear.wordpress.com/2010/04/08/unzip-all-zip-files-into-current-directory-on-linux-using-find/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a5065579fe0f0d84efb2ccef951bedb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lampbear</media:title>
		</media:content>
	</item>
		<item>
		<title>Use wget to download from hotfile &#8211; automated!</title>
		<link>http://lampbear.wordpress.com/2010/04/05/use-wget-to-download-from-hotfile-automated/</link>
		<comments>http://lampbear.wordpress.com/2010/04/05/use-wget-to-download-from-hotfile-automated/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 07:30:09 +0000</pubDate>
		<dc:creator>lampbear</dc:creator>
				<category><![CDATA[wget]]></category>
		<category><![CDATA[automated download]]></category>
		<category><![CDATA[hotfile]]></category>

		<guid isPermaLink="false">http://lampbear.wordpress.com/?p=14</guid>
		<description><![CDATA[To automatically download from Hotfile using Wget you can do the following: wget --save-cookies /path/to/hotfilecookie --post-data "returnto=%2F&#38;user=1234567&#38;pass=yourpass&#38;=Login" -O - http://www.hotfile.com/login.php &#62; /dev/null This will save your login to a cookie on your server and then we can do: wget -c --load-cookies /path/to/hotfilecookie -i /path/to/inputfile -o /path/to/downloadlog -nc -b This will set wget running in the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lampbear.wordpress.com&amp;blog=12760353&amp;post=14&amp;subd=lampbear&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>To automatically download from Hotfile using Wget you can do the following:</p>
<p><code><br />
wget --save-cookies /path/to/hotfilecookie --post-data "returnto=%2F&amp;user=1234567&amp;pass=yourpass&amp;=Login" -O - http://www.hotfile.com/login.php &gt; /dev/null<br />
</code></p>
<p>This will save your login to a cookie on your server and then we can do:</p>
<p><code><br />
wget -c --load-cookies /path/to/hotfilecookie -i /path/to/inputfile -o /path/to/downloadlog -nc -b<br />
</code></p>
<p>This will set wget running in the background logging its progress to a download log. It will skip downloading any files that already exist, and it will read all the files to download from a file called inputfile. I hope this helps someone <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lampbear.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lampbear.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lampbear.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lampbear.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lampbear.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lampbear.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lampbear.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lampbear.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lampbear.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lampbear.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lampbear.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lampbear.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lampbear.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lampbear.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lampbear.wordpress.com&amp;blog=12760353&amp;post=14&amp;subd=lampbear&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lampbear.wordpress.com/2010/04/05/use-wget-to-download-from-hotfile-automated/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a5065579fe0f0d84efb2ccef951bedb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lampbear</media:title>
		</media:content>
	</item>
		<item>
		<title>Stop mails sent from PHP being marked as spam by editing SPF records!</title>
		<link>http://lampbear.wordpress.com/2010/04/04/stop-mails-sent-from-php-being-marked-as-spam-by-editing-spf-records/</link>
		<comments>http://lampbear.wordpress.com/2010/04/04/stop-mails-sent-from-php-being-marked-as-spam-by-editing-spf-records/#comments</comments>
		<pubDate>Sun, 04 Apr 2010 07:56:43 +0000</pubDate>
		<dc:creator>lampbear</dc:creator>
				<category><![CDATA[DNS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[namecheap]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://lampbear.wordpress.com/?p=12</guid>
		<description><![CDATA[So I just moved servers and my inbound mail traffic was going down each day.. I took a look at the mail headers and got this: Return-Path: Received-SPF: neutral (google.com: 66.x.x.x is neither permitted nor denied by best guess record for domain of support@thaifriendly.com) client-ip=66.x.x.x; I managed to change this from a neutral to a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lampbear.wordpress.com&amp;blog=12760353&amp;post=12&amp;subd=lampbear&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So I just moved servers and my inbound mail traffic was going down each day.. I took a look at the mail headers and got this:<br />
<code><br />
Return-Path:<br />
Received-SPF: neutral (google.com: 66.x.x.x is neither permitted nor denied by best guess record for domain of support@thaifriendly.com) client-ip=66.x.x.x;<br />
</code></p>
<p>I managed to change this from a neutral to a pass by adding a return path to my mail command in PHP:<br />
<code><br />
mail($toemail,$subject,$message,$headers," -f support@mydomain.com");<br />
</code><br />
.. and by logging into namecheap and adding a TXT record to my domain (Login -&gt; select domain -&gt; All host records) for host name add @ for IP address/URL add &#8220;v=spf1 a:my.mailserver.ip.address ~all&#8221; and selecting &#8220;TXT Record&#8221;. After saving changes and sending a test mail google now happily reports:<br />
<code><br />
Return-Path:<br />
Received-SPF: pass (google.com: domain of support@mydomain.com designates my.mailserver.ip.address as permitted sender) client-ip=my.mailserver.ip.address;<br />
</code></p>
<p>It took me a few searches to get all this information together, particularily editing host records in namecheap too, I hope it helps someone!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lampbear.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lampbear.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lampbear.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lampbear.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lampbear.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lampbear.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lampbear.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lampbear.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lampbear.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lampbear.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lampbear.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lampbear.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lampbear.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lampbear.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lampbear.wordpress.com&amp;blog=12760353&amp;post=12&amp;subd=lampbear&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lampbear.wordpress.com/2010/04/04/stop-mails-sent-from-php-being-marked-as-spam-by-editing-spf-records/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a5065579fe0f0d84efb2ccef951bedb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lampbear</media:title>
		</media:content>
	</item>
	</channel>
</rss>
