<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
		<channel>
			<title>[CWH] Code Snips</title>
			<link>http://www.crucialwebhost.com/code//</link>
			<description>Ready To Split-Shared Hosting?</description>
			<dc:language>en-us</dc:language>
			<dc:creator>code@crucialwebhost.com</dc:creator>
			<dc:rights>Copyright 2010</dc:rights>
			<dc:date>2010-02-02T10:29:15+00:00</dc:date>
			
			
				<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/cwhcode" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="cwhcode" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
					<title>Block IP Address</title>
					<link>http://www.crucialwebhost.com/code/block-ip-address/</link>
					<guid>http://www.crucialwebhost.com/code/block-ip-address/#When:10:29:15Z</guid>
					<description>iptables -I INPUT -s 25.22.22.22 -j DROP</description>
					<dc:date>2010-02-02T10:29:15+00:00</dc:date>
				</item>
			
				<item>
					<title>Validate Email Address With JavaScript</title>
					<link>http://www.crucialwebhost.com/code/validate-email-address-with-javascript/</link>
					<guid>http://www.crucialwebhost.com/code/validate-email-address-with-javascript/#When:13:00:14Z</guid>
					<description>/^((([a-z]|d|[!#$%&amp;amp;'*+-/=?^_`{|}~]|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])+(.([a-z]|d|[!#$%&amp;amp;'*+-/=?^_`{|}~]|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])+)*)|((x22)((((x20|x09)*(x0dx0a))?(x20|x09)+)?(([x01-x08x0bx0cx0e-x1fx7f]|x21|[x23-x5b]|[x5d-x7e]|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])|(\([x01-x09x0bx0cx0d-x7f]|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF]))))*(((x20|x09)*(x0dx0a))?(x20|x09)+)?(x22)))@((([a-z]|d|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])|(([a-z]|d|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])([a-z]|d|-|.|_|~|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])*([a-z]|d|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF]))).)+(([a-z]|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])|(([a-z]|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])([a-z]|d|-|.|_|~|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])*([a-z]|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF]))).?$/i</description>
					<dc:date>2010-01-08T13:00:14+00:00</dc:date>
				</item>
			
				<item>
					<title>Find Duplicate MySQL Records</title>
					<link>http://www.crucialwebhost.com/code/find-duplicate-mysql-records/</link>
					<guid>http://www.crucialwebhost.com/code/find-duplicate-mysql-records/#When:12:52:27Z</guid>
					<description>SELECT email, count(email) AS total FROM `tbl_mailing_list` GROUP BY email HAVING total &amp;gt; 1 ORDER BY total;</description>
					<dc:date>2009-12-16T12:52:27+00:00</dc:date>
				</item>
			
				<item>
					<title>Embed Audio Using The Audio Tag</title>
					<link>http://www.crucialwebhost.com/code/embed-audio-using-the-audio-tag/</link>
					<guid>http://www.crucialwebhost.com/code/embed-audio-using-the-audio-tag/#When:18:34:46Z</guid>
					<description>&amp;lt;audio controls autoplay autobuffer src=&amp;quot;song.mp3&amp;quot;&amp;gt;&amp;lt;/audio&amp;gt;</description>
					<dc:date>2009-12-07T18:34:46+00:00</dc:date>
				</item>
			
				<item>
					<title>Import MySQL Dump</title>
					<link>http://www.crucialwebhost.com/code/import-mysql-dump/</link>
					<guid>http://www.crucialwebhost.com/code/import-mysql-dump/#When:21:27:27Z</guid>
					<description>mysql -h DBHOST -u DBUSER -pDBPASS DBNAME &amp;lt; dump.sql
Replace text in uppercase with the appropriate information:

    DBHOST - Database hostname, usually localhost
    DBUSER - User with privileges to the database
    DBPASS - Password for the user
    DBNAME - Database name</description>
					<dc:date>2009-12-04T21:27:27+00:00</dc:date>
				</item>
			
				<item>
					<title>Google API jQuery Include</title>
					<link>http://www.crucialwebhost.com/code/google-api-jquery-include/</link>
					<guid>http://www.crucialwebhost.com/code/google-api-jquery-include/#When:21:19:27Z</guid>
					<description>&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
    $(function() {
&amp;nbsp;
    });
&amp;lt;/script&amp;gt;</description>
					<dc:date>2009-12-04T21:19:27+00:00</dc:date>
				</item>
			
				<item>
					<title>Print Active Connections To Port 80 Per IP Address</title>
					<link>http://www.crucialwebhost.com/code/print-active-connections-to-port-80-per-ip-address/</link>
					<guid>http://www.crucialwebhost.com/code/print-active-connections-to-port-80-per-ip-address/#When:20:10:53Z</guid>
					<description>netstat -plan | grep :80 | grep -E &amp;quot;(EST|LIST)&amp;quot; | awk {'print $5'} | cut -d: -f 1 | sort | uniq -c | sort -nk 1</description>
					<dc:date>2009-12-04T20:10:53+00:00</dc:date>
				</item>
			
				<item>
					<title>Send Email From Shell</title>
					<link>http://www.crucialwebhost.com/code/send-email-from-shell/</link>
					<guid>http://www.crucialwebhost.com/code/send-email-from-shell/#When:20:08:18Z</guid>
					<description>mail -s &amp;quot;Subject&amp;quot; email@address.com &amp;lt; message.txt</description>
					<dc:date>2009-12-04T20:08:18+00:00</dc:date>
				</item>
			
				<item>
					<title>Install CSF (Firewall) And LFD (Log File Daemon)</title>
					<link>http://www.crucialwebhost.com/code/install-csf-firewall-and-lfd-log-file-daemon/</link>
					<guid>http://www.crucialwebhost.com/code/install-csf-firewall-and-lfd-log-file-daemon/#When:20:00:12Z</guid>
					<description>cd /usr/src/
wget http://www.configserver.com/free/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh</description>
					<dc:date>2009-12-04T20:00:12+00:00</dc:date>
				</item>
			
				<item>
					<title>Show Process CPU Usage</title>
					<link>http://www.crucialwebhost.com/code/show-process-cpu-usage/</link>
					<guid>http://www.crucialwebhost.com/code/show-process-cpu-usage/#When:19:56:20Z</guid>
					<description>Display how much CPU a process is using:
ps -eo pcpu,pid -o comm= | sort -k1 -n -r | head -1
For example, show top five CPU using processes:
ps -eo pcpu,pid -o comm= | sort -k1 -n -r | head -5
Which will output the following:
0.6 24458 bash
0.3 24457 cphulkd.pl
0.2  7704 php5
0.1  7706 php5
0.1  7705 php5</description>
					<dc:date>2009-12-04T19:56:20+00:00</dc:date>
				</item>
			
				<item>
					<title>Show Each Process Memory Usage</title>
					<link>http://www.crucialwebhost.com/code/show-each-process-memory-usage/</link>
					<guid>http://www.crucialwebhost.com/code/show-each-process-memory-usage/#When:19:50:23Z</guid>
					<description>ps axu
Show full command in ps display:
ps axu --width=500</description>
					<dc:date>2009-12-04T19:50:23+00:00</dc:date>
				</item>
			
				<item>
					<title>HTML5 Starter Page</title>
					<link>http://www.crucialwebhost.com/code/html5-starter-page/</link>
					<guid>http://www.crucialwebhost.com/code/html5-starter-page/#When:16:53:48Z</guid>
					<description>&amp;lt;!doctype html&amp;gt;
&amp;lt;html lang=&amp;quot;en-us&amp;quot;&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;meta charset=&amp;quot;utf-8&amp;quot;&amp;gt;
    &amp;lt;title&amp;gt;My Site&amp;lt;/title&amp;gt;
    &amp;lt;!--[if lte IE 8]&amp;gt;
      &amp;lt;script src=&amp;quot;http://js.cwhcode.com/html5/&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;![endif]--&amp;gt;
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
    &amp;lt;section&amp;gt;
      &amp;lt;header role=&amp;quot;banner&amp;quot;&amp;gt;
        &amp;lt;hgroup&amp;gt;
          &amp;lt;h1&amp;gt;&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;My Site&amp;lt;/a&amp;gt;&amp;lt;/h1&amp;gt;
          &amp;lt;h2&amp;gt;Tagline&amp;lt;/h2&amp;gt;
        &amp;lt;/hgroup&amp;gt;
        &amp;lt;nav&amp;gt;
          &amp;lt;ul role=&amp;quot;navigation&amp;quot;&amp;gt;
            &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;Item 1&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
            &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;Item 2&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
            &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;Item 3&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
          &amp;lt;/ul&amp;gt;
        &amp;lt;/nav&amp;gt;
      &amp;lt;/header&amp;gt;
      &amp;lt;article role=&amp;quot;main&amp;quot;&amp;gt;
        &amp;lt;header&amp;gt;
          &amp;lt;h3&amp;gt;Article Title&amp;lt;/h3&amp;gt;
          &amp;lt;time datetime=&amp;quot;2010-04-20&amp;quot;&amp;gt;April, 20, 2010&amp;lt;/time&amp;gt;
        &amp;lt;/header&amp;gt;
        &amp;lt;section&amp;gt;
          &amp;lt;p&amp;gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit.&amp;lt;/p&amp;gt;
        &amp;lt;/section&amp;gt;
      &amp;lt;/article&amp;gt;
      &amp;lt;aside&amp;gt;
        &amp;lt;h4&amp;gt;Sidebar Heading&amp;lt;/h4&amp;gt;
        &amp;lt;ul&amp;gt;
          &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;Item 1&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
          &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;Item 2&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
          &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;Item 3&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
        &amp;lt;/ul&amp;gt;
      &amp;lt;/aside&amp;gt;
      &amp;lt;footer&amp;gt;Copyright &amp;amp;copy; 2010 My Site. All Rights Reserved.&amp;lt;/footer&amp;gt;
    &amp;lt;/section&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;</description>
					<dc:date>2009-12-04T16:53:48+00:00</dc:date>
				</item>
			
				<item>
					<title>CSS Debug</title>
					<link>http://www.crucialwebhost.com/code/css-debug/</link>
					<guid>http://www.crucialwebhost.com/code/css-debug/#When:16:33:44Z</guid>
					<description>* { outline:2px dotted red }
* * { outline:2px dotted green }
* * * { outline:2px dotted orange }
* * * * { outline:2px dotted blue }
* * * * * { outline:1px solid red }
* * * * * * { outline:1px solid green }
* * * * * * * { outline:1px solid orange }
* * * * * * * * { outline:1px solid blue }</description>
					<dc:date>2009-12-04T16:33:44+00:00</dc:date>
				</item>
			
				<item>
					<title>Create A MySQL User</title>
					<link>http://www.crucialwebhost.com/code/create-a-mysql-user/</link>
					<guid>http://www.crucialwebhost.com/code/create-a-mysql-user/#When:15:05:38Z</guid>
					<description>GRANT ALL PRIVILEGES ON `db_name.table_name` (or .*) TO 'username'@'localhost' IDENTIFIED BY 'password';</description>
					<dc:date>2009-12-04T15:05:38+00:00</dc:date>
				</item>
			
				<item>
					<title>MySQL Find And Replace</title>
					<link>http://www.crucialwebhost.com/code/mysql-find-and-replace/</link>
					<guid>http://www.crucialwebhost.com/code/mysql-find-and-replace/#When:15:03:10Z</guid>
					<description>UPDATE `tbl_name` SET tbl_field = replace(tbl_field, 'FIND', 'REPLACE');</description>
					<dc:date>2009-12-04T15:03:10+00:00</dc:date>
				</item>
			
		</channel>
	</rss>

