<?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"
	>

<channel>
	<title>Brain Goo</title>
	<atom:link href="http://www.popmartian.com/tipsntricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.popmartian.com/tipsntricks</link>
	<description>Carpe Crap 'em</description>
	<pubDate>Mon, 27 Oct 2008 16:11:40 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>SQL: Select duplicate rows, select indistinct rows</title>
		<link>http://www.popmartian.com/tipsntricks/2008/10/27/sql-select-duplicate-rows-select-indistinct-rows/</link>
		<comments>http://www.popmartian.com/tipsntricks/2008/10/27/sql-select-duplicate-rows-select-indistinct-rows/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 16:09:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[How Tos]]></category>

		<category><![CDATA[SQL]]></category>

		<category><![CDATA[mysql]]></category>

		<category><![CDATA[howto]]></category>

		<guid isPermaLink="false">http://www.popmartian.com/tipsntricks/?p=67</guid>
		<description><![CDATA[Using SQL, MySQL or whatever your favorite database may be, we all know using SELECT DISTINCT will return unique values in case a value appears more than once in a table.
How do you fine duplicates?  What if I want to know where the duplicates are?
The trick is to use count() and compare it to [...]]]></description>
			<content:encoded><![CDATA[<p>Using SQL, MySQL or whatever your favorite database may be, we all know using <code>SELECT DISTINCT</code> will return unique values in case a value appears more than once in a table.</p>
<p>How do you fine duplicates?  What if I want to know where the duplicates are?</p>
<p>The trick is to use count() and compare it to an integer.</p>
<p><code>SELECT count(*), locations.* FROM locations GROUP BY number HAVING COUNT(*) > 1</code></p>
<p>That will select a count of unique instances of a value from a table called &#8220;locations&#8221;, group them by a field called &#8220;number&#8221; where the count is greater than 1.  In other words, it will return all the fields where there are more than one instance of the same value in the column &#8220;number&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.popmartian.com/tipsntricks/2008/10/27/sql-select-duplicate-rows-select-indistinct-rows/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Change or recover MySQL root password</title>
		<link>http://www.popmartian.com/tipsntricks/2008/09/22/change-or-recover-mysql-root-password/</link>
		<comments>http://www.popmartian.com/tipsntricks/2008/09/22/change-or-recover-mysql-root-password/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 16:02:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[How Tos]]></category>

		<category><![CDATA[mysql]]></category>

		<category><![CDATA[howto]]></category>

		<guid isPermaLink="false">http://www.popmartian.com/tipsntricks/?p=41</guid>
		<description><![CDATA[To Change a Known Password
If you know the current password, use one of these methods to reset it.  If you do not know, skip ahead to the next section.
Using mysqladmin if there is no password:
$ mysqladmin -u root password &#60;new password&#62;
Using mysqladmin if there is a password:
$ mysqladmin -u root -p &#60;old password&#62; &#60;new password&#62;
Using [...]]]></description>
			<content:encoded><![CDATA[<p><strong>To Change a Known Password</strong><br />
If you know the current password, use one of these methods to reset it.  If you do not know, skip ahead to the next section.</p>
<p><strong>Using mysqladmin if there is no password:</strong></p>
<p><code>$ mysqladmin -u root password &lt;new password&gt;</code></p>
<p><strong>Using mysqladmin if there is a password:</strong><br />
<code>$ mysqladmin -u root -p &lt;old password&gt; &lt;new password&gt;</code></p>
<p><strong>Using mysql shell if there is no password</strong><br />
<code>mysql -u root<br />
mysql&gt; update user set password=PASSWORD("&lt;new password&gt;") where User='root';<br />
mysql&gt; flush privileges;<br />
mysql&gt; quit</code></p>
<p><strong>Using mysql shell if there is a password</strong><br />
<code>mysql -u root -p<br />
Password: &lt;old password&gt;<br />
mysql&gt; update user set password=PASSWORD("&lt;new password&gt;") where User='root';<br />
mysql&gt; flush privileges;<br />
mysql&gt; quit</code></p>
<p><strong>Recover/reset the password if you don&#8217;t know it</strong><br />
There is no way to recover the password if you don&#8217;t know it, but you can reset it to something new.<br />
You must have root on the box for this.</p>
<ol>
<li>Kill the running server</li>
<li>Create a text file with the following contents:<br />
<code>UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';<br />
FLUSH PRIVILEGES;</code></li>
<li>Run the mysql_safe binary with the <code>--init-file</code> option pointing to your new file like this:<br />
<code>mysqld_safe --init-file=/path/to/file &amp;</code></li>
<li>Delete the init file you created.</li>
<li>Stop and start MySQL normally.</li>
</ol>
<blockquote><p>Did you find this post useful or have questions or comments?  Please let me know!</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.popmartian.com/tipsntricks/2008/09/22/change-or-recover-mysql-root-password/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Windows 2003 Update Group Policy</title>
		<link>http://www.popmartian.com/tipsntricks/2008/08/29/windows-2003-update-group-policy/</link>
		<comments>http://www.popmartian.com/tipsntricks/2008/08/29/windows-2003-update-group-policy/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 20:33:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[How Tos]]></category>

		<category><![CDATA[howto]]></category>

		<category><![CDATA[microsoft]]></category>

		<category><![CDATA[windows 2003]]></category>

		<guid isPermaLink="false">http://www.popmartian.com/tipsntricks/?p=38</guid>
		<description><![CDATA[From Microsoft knowledgebase article http://support.microsoft.com/kb/298444
To update the group policy, run Gpupdate.exe from a cmd window.  This is refresh any changes in the Group Policy as they apply to that machine.  Run Gpupdate.exe /Force from a cmd window in order to force a full refresh of the Group Policy.
You have to check Event Log -&#62; Application [...]]]></description>
			<content:encoded><![CDATA[<p>From Microsoft knowledgebase article <a title="A Description of the Group Policy Update Utility" href="http://support.microsoft.com/kb/298444" target="_self">http://support.microsoft.com/kb/298444</a></p>
<p>To update the group policy, run <strong>Gpupdate.exe</strong> from a cmd window.  This is refresh any changes in the Group Policy as they apply to that machine.  Run <strong>Gpupdate.exe /Force</strong> from a cmd window in order to force a full refresh of the Group Policy.</p>
<p>You have to check Event Log -&gt; Application to see if it actually succeeded.</p>
<blockquote><p>Did you find this post useful or have questions or comments?  Please let me know!</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.popmartian.com/tipsntricks/2008/08/29/windows-2003-update-group-policy/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to update qmail relay rules</title>
		<link>http://www.popmartian.com/tipsntricks/2008/08/20/how-to-update-qmail-relay-rules/</link>
		<comments>http://www.popmartian.com/tipsntricks/2008/08/20/how-to-update-qmail-relay-rules/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 15:31:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Email Servers]]></category>

		<category><![CDATA[How Tos]]></category>

		<category><![CDATA[qmail]]></category>

		<guid isPermaLink="false">http://www.popmartian.com/tipsntricks/?p=27</guid>
		<description><![CDATA[D. J. Bernstein&#8217;s Qmail, now in the public domain, is a powerful yet clumsy SMTP messaging system.  One of the most common problems is updating the rules for allowing SMTP relay, or denying the same.
If you qmail-smtpd under tcpserver, the following will update relay allow and relay forbid rules.
Create a file called /etc/tcp.smtp and [...]]]></description>
			<content:encoded><![CDATA[<p>D. J. Bernstein&#8217;s Qmail, now in the public domain, is a powerful yet clumsy SMTP messaging system.  One of the most common problems is updating the rules for allowing SMTP relay, or denying the same.</p>
<p>If you qmail-smtpd under tcpserver, the following will update relay allow and relay forbid rules.</p>
<p>Create a file called /etc/tcp.smtp and put in it:</p>
<p><code>127.:allow,RELAYCLIENT=""<br />
1.1.1.1:allow,RELAYCLIENT=""<br />
2.2.:allow,RELAYCLIENT=""<br />
2.2.2.5:deny</code></p>
<p>Qmail uses simple pattern matching so only classful subnets are allowed.  Sorry, no CIDR notation.</p>
<p>The example above will allow/deny:</p>
<ul>
<li>Allow relaying from 127.* your localhost subnet of 127.0.0.0/8</li>
<li>Allow the /32 address of 1.1.1.1</li>
<li>Allow 2.2.* the /16 subnet of 2.2.0.0/16</li>
<li>Specifically forbid 2.2.2.5</li>
</ul>
<p>In order to implement these rules you need to update the server tcp.smpt.cbd file and restart Qmail.</p>
<p>First, back up /etc/tcp.smtp, then run the command:<br />
<code>tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp &lt; /etc/tcp.smtp</code></p>
<p>If the rules don&#8217;t update, make sure <code>-x /etc/tcp.smtp.cdb</code> is after tcpserver in your start script, then restart Qmail.</p>
<blockquote><p>Did you find this post useful or have questions or comments?  Please let me know!</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.popmartian.com/tipsntricks/2008/08/20/how-to-update-qmail-relay-rules/feed/</wfw:commentRss>
		</item>
		<item>
		<title>perl howto push a hash onto an array</title>
		<link>http://www.popmartian.com/tipsntricks/2008/08/12/perl-howto-push-a-hash-onto-an-array/</link>
		<comments>http://www.popmartian.com/tipsntricks/2008/08/12/perl-howto-push-a-hash-onto-an-array/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 20:59:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[How Tos]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://www.popmartian.com/tipsntricks/?p=24</guid>
		<description><![CDATA[use Data::Dumper;
my @array;
push @array, {'key1' =&#62; 'value1', 'key2' =&#62; 'value2'};
push @array, {'key1' =&#62; 'value1', 'key2' =&#62; 'value2'};
push @array, {'key1' =&#62; 'value1', 'key2' =&#62; 'value2'};
print Dumper(@array);
Will give you:

$VAR1 = {
'key2' =&#62; 'value2',
'key1' =&#62; 'value1'
};
$VAR2 = {
'key2' =&#62; 'value2',
'key1' =&#62; 'value1'
};
$VAR3 = {
'key2' =&#62; 'value2',
'key1' =&#62; 'value1'
};

Snazzy!
Did you find this post useful or have questions or comments?  [...]]]></description>
			<content:encoded><![CDATA[<p><code>use Data::Dumper;<br />
my @array;<br />
push @array, {'key1' =&gt; 'value1', 'key2' =&gt; 'value2'};<br />
push @array, {'key1' =&gt; 'value1', 'key2' =&gt; 'value2'};<br />
push @array, {'key1' =&gt; 'value1', 'key2' =&gt; 'value2'};<br />
print Dumper(@array);</code></p>
<p>Will give you:<br />
<code><br />
$VAR1 = {<br />
'key2' =&gt; 'value2',<br />
'key1' =&gt; 'value1'<br />
};<br />
$VAR2 = {<br />
'key2' =&gt; 'value2',<br />
'key1' =&gt; 'value1'<br />
};<br />
$VAR3 = {<br />
'key2' =&gt; 'value2',<br />
'key1' =&gt; 'value1'<br />
};<br />
</code></p>
<p>Snazzy!</p>
<blockquote><p>Did you find this post useful or have questions or comments?  Please let me know!</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.popmartian.com/tipsntricks/2008/08/12/perl-howto-push-a-hash-onto-an-array/feed/</wfw:commentRss>
		</item>
		<item>
		<title>calculate server btu output</title>
		<link>http://www.popmartian.com/tipsntricks/2008/07/28/calculate-server-btu-output/</link>
		<comments>http://www.popmartian.com/tipsntricks/2008/07/28/calculate-server-btu-output/#comments</comments>
		<pubDate>Mon, 28 Jul 2008 15:49:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[How Tos]]></category>

		<category><![CDATA[howto]]></category>

		<category><![CDATA[mathmatics]]></category>

		<category><![CDATA[servers]]></category>

		<guid isPermaLink="false">http://www.popmartian.com/tipsntricks/?p=22</guid>
		<description><![CDATA[This post was updated on 8/29/2008 to clarify a few things
This is a heavily viewed page. Please leave me a comment if this was helpful or if something is missing or confusing.  I would like it to be more comprehensive.
Shouts to Lavrik for getting this started.
To calculate heat output (BTU) of your systems, you need [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>This post was updated on 8/29/2008 to clarify a few things</p>
<p>This is a heavily viewed page. Please leave me a comment if this was helpful or if something is missing or confusing.  I would like it to be more comprehensive.</p></blockquote>
<p>Shouts to <a href="http://lavrik.net/index.php?option=com_content&amp;task=view&amp;id=12&amp;Itemid=2">Lavrik</a> for getting this started.</p>
<p>To calculate heat output (BTU) of your systems, you need to remember (or read below) your high school electrical class.  There are three questions to answer.</p>
<ol>
<li>How much power am I going to draw?</li>
<li>How much heat will that power useage generate?</li>
<li>How much cooling do I need for that heat?</li>
</ol>
<p><strong>How much power am I going to draw?</strong></p>
<p>Power is measured in Watts and used in math as the letter &#8216;P&#8217;.  The formula for calculating power requires Volts (How much juice you can provide) and Amperes (How hard you suck on the straw).</p>
<p>Power in Watts (P) = Volts (V) * Current in Amperes (I) or:</p>
<p><code>P = V * I</code></p>
<p>If you know how many Watts your power supplies can feed and you know how much voltage you have, you can figure out your Amperes.</p>
<p>Take a simple server:</p>
<p>- A server with a 1000 Watt power supply.<br />
- 208 Volt service.<br />
- Running at theoretical maximum load.</p>
<p>P = 1000<br />
V = 208<br />
I = ?</p>
<p><code>I = P/V or 1000/208 = 4.8 Amperes</code></p>
<p>So now that you know how much you&#8217;re tugging on the grid, find out how much heat that will produce.</p>
<p><strong>How much heat will that power usage generate?</strong></p>
<p>BTUs or British Thermal Units are heat measurements.  Generally measured in per-hour increments.  In common usage 12,000 BTU/h is considered a Ton.  This is important because we cool and heat over time so we need to know how much cooling to throw in to the room per hour.</p>
<p><code>1 Watt will produce 3.412 BTU per hour</code></p>
<p>To calculate the BTU/heat output of a system, substitute BTUs for Watts and use the following equation:</p>
<p><code>BTU/h = (V * I) * 3.412</code></p>
<p>Using the example server above running full blast in a sealed room with no air moving in and out and no heat loss through the walls you can do the math:</p>
<p><code>BTU/h = 3.412 x 1000 = 3412BTU/h</code></p>
<p><strong>How much cooling do I need for that heat?</strong></p>
<p>About 1/3 Ton of cooling is required to cool this system.  However, your actual requirements will probably be lower because we can assume you won&#8217;t run the equipment at full capacity and there is some energy loss through the walls, ceiling and floors.</p>
<p>Using the techniques above, you can make a simple worksheet to calculate your total theoretical maximum cooling requirements.  Don&#8217;t forget to take in to account other sources of heat.  Ambient building temperature (do you have hot walls from the boiler in the next room?), lights, cooling compressor (it should list it&#8217;s heat output) and other equipment.</p>
<p>You can probably undercut your requirements if your equipment does not run at full capacity, but be sure you leave enough room to grow and to keep up in case a cooling unit fails or you experience a period of heavy load and you do use your gear at capacity.</p>
<blockquote><p>Did you find this post useful or have questions or comments?  Please let me know!</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.popmartian.com/tipsntricks/2008/07/28/calculate-server-btu-output/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Word Press problem Unknown: Releasing SysV semaphore</title>
		<link>http://www.popmartian.com/tipsntricks/2008/07/14/word-press-releasing-sysv-semaphore/</link>
		<comments>http://www.popmartian.com/tipsntricks/2008/07/14/word-press-releasing-sysv-semaphore/#comments</comments>
		<pubDate>Mon, 14 Jul 2008 16:20:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Apache]]></category>

		<category><![CDATA[How Tos]]></category>

		<category><![CDATA[Software]]></category>

		<category><![CDATA[blogging]]></category>

		<category><![CDATA[offsiteHowTo]]></category>

		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.popmartian.com/tipsntricks/?p=21</guid>
		<description><![CDATA[If you have WordPress installed you may run in to an error that constantly prints something like this:
Warning:  Unknown: Releasing SysV semaphore id 58 key 0&#215;152b in request cleanup in Unknown on line 0

This is not an error from WordPress, but from the WP Super Cache Plugin you forgot you installed.  The error [...]]]></description>
			<content:encoded><![CDATA[<p>If you have WordPress installed you may run in to an error that constantly prints something like this:</p>
<p><code><b>Warning</b>:  Unknown: Releasing SysV semaphore id 58 key 0&#215;152b in request cleanup in <b>Unknown</b> on line <b>0</b><br />
</code></p>
<p>This is not an error from WordPress, but from the <a href="http://ocaoimh.ie/wp-super-cache/">WP Super Cache</a> Plugin you forgot you installed.  The error comes when from the cache directory is not writable.</p>
<p>Change the permissions on the wp-content/cache directory to allow the web user to write and the error will disappear.</p>
<p>The solution is obvious if you check the source code on the page when the error appears.  WP Super Cache spits out the error, but it is hidden in HTML comment tags.  Your source code will look something like this:</p>
<p><code>&lt;!-- Dynamic Page Served (once) in 0.297 seconds --&gt;<br />
&lt;!-- File not cached! Super Cache Couldn't write to: wp-content/cache/wp-cache-2876abde8ce3a2aa817c8289ea85486e.html --&gt;</code></p>
<p><code>87<br />
&lt;br /&gt;<br />
&lt;b&gt;Warning&lt;/b&gt;:  Unknown: Releasing SysV semaphore id 58 key 0x152b in request cleanup in &lt;b&gt;Unknown&lt;/b&gt; on line &lt;b>0&lt;/b&gt;&lt;br /&gt;</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.popmartian.com/tipsntricks/2008/07/14/word-press-releasing-sysv-semaphore/feed/</wfw:commentRss>
		</item>
		<item>
		<title>RBLs with Exim4 (debian friendly)</title>
		<link>http://www.popmartian.com/tipsntricks/2008/01/11/rbls-with-exim4-debian-friendly/</link>
		<comments>http://www.popmartian.com/tipsntricks/2008/01/11/rbls-with-exim4-debian-friendly/#comments</comments>
		<pubDate>Fri, 11 Jan 2008 22:44:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Email Servers]]></category>

		<category><![CDATA[Exim]]></category>

		<category><![CDATA[How Tos]]></category>

		<category><![CDATA[Mail Post]]></category>

		<category><![CDATA[RBL]]></category>

		<category><![CDATA[SMTP]]></category>

		<category><![CDATA[Software]]></category>

		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://www.popmartian.com/tipsntricks/2008/01/11/rbls-with-exim4-debian-friendly/</guid>
		<description><![CDATA[Denying connections based on RBLs is a snap with Exim4.  Most confusion is related to ACLs and where the definition sits.
The fastest way to deny based on RBL is to add it to whatever ACL you specify in acl_smtp_rcpt
However, you MUST put the declaration AFTER any relay allow definitions.  ACLs are based on [...]]]></description>
			<content:encoded><![CDATA[<p>Denying connections based on RBLs is a snap with Exim4.  Most confusion is related to ACLs and where the definition sits.</p>
<p>The fastest way to deny based on RBL is to add it to whatever ACL you specify in acl_smtp_rcpt</p>
<p>However, you <strong>MUST</strong> put the declaration AFTER any relay allow definitions.  ACLs are based on first-match which means they run in order and stop when they hit a match.  Implicit allow.</p>
<p>Here is my ACL declared as acl_check_rcpt</p>
<p><code></p>
<pre>
acl_check_rcpt:
  accept  hosts = :
  deny    local_parts   = ^.*[@%!/|] : ^\\.
  accept  local_parts   = postmaster
          domains       = +local_domains
  require verify        = sender
  accept  domains       = +local_domains
          endpass
          message       = unknown user
          verify        = recipient
  accept  domains       = +relay_to_domains
          endpass
          message       = unrouteable address
          verify        = recipient
  accept  hosts         = +relay_from_hosts
  accept  authenticated = *
  deny    dnslists = zen.spamhaus.org
          message = Message rejected because $sender_fullhost is blacklisted at $dnslist_domain see $dnslist_text
  deny    message       = relay not permitted
</pre>
<p></code></p>
<p>The RBL definition is toward the bottom, after we allow everyone in that we want in.  This lets people relay via SMTP-AUTH or explicit allow before checking the RBL.  If they aren&#8217;t allowed via anything we allow, then we check the RBL and die with a nice message.</p>
<p>Adverts:<br />
<a href="http://www.amazon.com/gp/product/0954452909?ie=UTF8&#038;tag=popma-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=0954452909">The Exim SMTP Mail Server</a><img src="http://www.assoc-amazon.com/e/ir?t=popma-20&#038;l=as2&#038;o=1&#038;a=0954452909" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /><br />
<a href="http://www.amazon.com/gp/product/0596000987?ie=UTF8&#038;tag=popma-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=0596000987">Exim: The Mail Transfer Agent</a><img src="http://www.assoc-amazon.com/e/ir?t=popma-20&#038;l=as2&#038;o=1&#038;a=0596000987" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /><br />
<a href="http://www.amazon.com/gp/product/0954452976?ie=UTF8&#038;tag=popma-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=0954452976">The Exim SMTP Mail Server: Official Guide for Release 4</a><img src="http://www.assoc-amazon.com/e/ir?t=popma-20&#038;l=as2&#038;o=1&#038;a=0954452976" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /><br />
<a href="http://www.amazon.com/gp/product/0131478230?ie=UTF8&#038;tag=popma-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=0131478230">A Practical Guide to Linux(R) Commands, Editors, and Shell Programming</a><img src="http://www.assoc-amazon.com/e/ir?t=popma-20&#038;l=as2&#038;o=1&#038;a=0131478230" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /><br />
<a href="http://www.amazon.com/gp/product/0596005652?ie=UTF8&#038;tag=popma-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=0596005652">Understanding the Linux Kernel</a><img src="http://www.assoc-amazon.com/e/ir?t=popma-20&#038;l=as2&#038;o=1&#038;a=0596005652" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /><br />
<a href="http://www.amazon.com/gp/product/0596527209?ie=UTF8&#038;tag=popma-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=0596527209">Ubuntu Hacks: Tips &#038; Tools for Exploring, Using, and Tuning Linux (Hacks)</a><img src="http://www.assoc-amazon.com/e/ir?t=popma-20&#038;l=as2&#038;o=1&#038;a=0596527209" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /><br />
<a href="http://www.amazon.com/gp/product/0596006284?ie=UTF8&#038;tag=popma-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=0596006284">Linux Pocket Guide</a><img src="http://www.assoc-amazon.com/e/ir?t=popma-20&#038;l=as2&#038;o=1&#038;a=0596006284" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.popmartian.com/tipsntricks/2008/01/11/rbls-with-exim4-debian-friendly/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Updating RedHat 9</title>
		<link>http://www.popmartian.com/tipsntricks/2007/12/17/updating-redhat-9/</link>
		<comments>http://www.popmartian.com/tipsntricks/2007/12/17/updating-redhat-9/#comments</comments>
		<pubDate>Mon, 17 Dec 2007 22:41:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[How Tos]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[redhat]]></category>

		<guid isPermaLink="false">http://www.popmartian.com/tipsntricks/2007/12/17/updating-redhat-9/</guid>
		<description><![CDATA[Simply: You can&#8217;t.  up2date will not run and RedHat does not provide updated packages.  In 2003 RedHat switched from RedHat9 to Fedora.  If you have an old RedHat box, you will have to migrate to Fedora.  If it is really old, you may just be out of luck.  Next time [...]]]></description>
			<content:encoded><![CDATA[<p>Simply: You can&#8217;t.  up2date will not run and RedHat does not provide updated packages.  In 2003 RedHat switched from RedHat9 to Fedora.  If you have an old RedHat box, you will have to migrate to Fedora.  If it is really old, you may just be out of luck.  Next time keep up with those updates.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.popmartian.com/tipsntricks/2007/12/17/updating-redhat-9/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Quick Character Escaping in PHP</title>
		<link>http://www.popmartian.com/tipsntricks/2007/10/10/quick-character-escaping-in-php/</link>
		<comments>http://www.popmartian.com/tipsntricks/2007/10/10/quick-character-escaping-in-php/#comments</comments>
		<pubDate>Wed, 10 Oct 2007 17:48:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[SQL]]></category>

		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.popmartian.com/tipsntricks/2007/10/10/quick-character-escaping-in-php/</guid>
		<description><![CDATA[When writing PHP web apps, I tend to run in to a portability issue when dealing with SQL connectivity.  Since I can&#8217;t count on having the PEAR DB module available, I rolled my own set of functions to interact with a MySQL database.
The problem lies in escaping characters in your SQL queries.  Do [...]]]></description>
			<content:encoded><![CDATA[<p>When writing PHP web apps, I tend to run in to a portability issue when dealing with SQL connectivity.  Since I can&#8217;t count on having the PEAR DB module available, I rolled my own set of functions to interact with a MySQL database.</p>
<p>The problem lies in escaping characters in your SQL queries.  Do I <code>addslashes()</code>?  Is magic_quotes_gpc enabled?</p>
<p>My quick-and-dirty solution is the following function:</p>
<p><code><br />
function request_cleanup()<br />
{<br />
&nbsp;&nbsp;if(get_magic_quotes_gpc() == 0)<br />
&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;foreach($_REQUEST as $req_key => $req_value)<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$_REQUEST[$req_key]=addslashes($_REQUEST[$req_key]);<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;}<br />
}<br />
</code></p>
<p>By calling that function on every page that deals with inserting content in to the database, I know will will get my content escaped correctly.</p>
<p>Of course it escapes all submitted content, including that which isn&#8217;t going in to the database so don&#8217;t forget to <code>stripslashes()</code> when you are working with data that doesn&#8217;t need it.</p>
<p>Example:<br />
<code><br />
request_cleanup();</p>
<p>$notes = $_REQUEST['notes '];<br />
$confirmation = stripslashes($_REQUEST['notes ']);</p>
<p>$SQL = &#8220;INSERT INTO notes (note) VALUES (&#8217;$notes&#8217;)&#8221;;<br />
sql_proc($SQL);</p>
<p>print &#8220;Your note was: $confirmation&#8221;;<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.popmartian.com/tipsntricks/2007/10/10/quick-character-escaping-in-php/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
