<?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>GraysUnderground.com &#187; Uncategorized</title>
	<atom:link href="http://www.graysunderground.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.graysunderground.com</link>
	<description>Gray's Tech Blog</description>
	<lastBuildDate>Thu, 12 Jan 2012 23:41:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Optimize MySQL tables after deleteing alot of data</title>
		<link>http://www.graysunderground.com/2011/04/12/optimize-mysql-tables-after-deleteing-alot-of-data/</link>
		<comments>http://www.graysunderground.com/2011/04/12/optimize-mysql-tables-after-deleteing-alot-of-data/#comments</comments>
		<pubDate>Tue, 12 Apr 2011 18:11:23 +0000</pubDate>
		<dc:creator>Gray</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

	<!-- AutoMeta Start -->
	<category></category>
	<category></category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.graysunderground.com/?p=40</guid>
		<description><![CDATA[OPTIMIZE TABLE foo; will squeeze out the dead space. ALTER TABLE foo ORDER BY something; does what OPTIMIZE does (but in a totally different way), plus clusters data based on the ORDER BY. In a few cases, this can be quite beneficial. Here&#8217;s an example: * Table is bigger than will fit in cache. * [...]]]></description>
			<content:encoded><![CDATA[<p>OPTIMIZE TABLE foo;<br />
will squeeze out the dead space.</p>
<p>ALTER TABLE foo ORDER BY something;<br />
does what OPTIMIZE does (but in a totally different way), plus clusters data based on the ORDER BY. In a few cases, this can be quite beneficial. Here&#8217;s an example:<br />
* Table is bigger than will fit in cache.<br />
* Table has two ways to look at it, one is date oriented, the other is by some &#8220;key&#8221;.<br />
* There are hundreds of rows for each key (one per day)<br />
* There are thousands of keys for each day.<br />
* Data is coming in daily &#8212; That is, new rows are appended to the table and/or filling in holes left by deleted rows.<br />
* Your main query is SELECT &#8230; WHERE key = &#8216;&#8230;&#8217; &#8212; that is, one row per day.</p>
<p>Normally the rows for that SELECT will be quite scattered, and because of the size of the table, it will take a lot of disk hits.</p>
<p>The ALTER table will rearrange the rows so that the SELECT will find all the rows for the &#8216;key&#8217; clustered in a few blocks, hence much less disk I/O.</p>
<p>IF this use of ALTER feels right for you, I recommend doing it monthly. Watch out: It could take hours (remember, it is bigger than will fit in cache).</p>
<p>For small tables (say, <100K rows), the ALTER is reasonably fast, but gives only limited improvement.</p>
<p>I have felt the need for the ALTER in less than 1% of the tables I have studied.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.graysunderground.com/2011/04/12/optimize-mysql-tables-after-deleteing-alot-of-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Force Postgres to stop</title>
		<link>http://www.graysunderground.com/2011/02/23/force-postgres-to-stop/</link>
		<comments>http://www.graysunderground.com/2011/02/23/force-postgres-to-stop/#comments</comments>
		<pubDate>Wed, 23 Feb 2011 20:29:08 +0000</pubDate>
		<dc:creator>Gray</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

	<!-- AutoMeta Start -->
	<category></category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.graysunderground.com/2011/02/23/force-postgres-to-stop/</guid>
		<description><![CDATA[You might see the following when issuing the normal stop command to postgres via pg_ctl. -bash-3.1$ pg_ctl stop waiting for server to shut down……………………………………………………… failed pg_ctl: server does not shut down Sometimes postgres does not want to shutdown by just issuing a pg_ctl stop as the postgres user. User might feel the need to “kill [...]]]></description>
			<content:encoded><![CDATA[<p>You might see the following when issuing the normal stop command to postgres via pg_ctl.</p>
<p>-bash-3.1$ pg_ctl stop<br />
waiting for server to shut down……………………………………………………… failed<br />
pg_ctl: server does not shut down</p>
<p>Sometimes postgres does not want to shutdown by just issuing a pg_ctl stop as the postgres user. User might feel the need to “kill -9″ the postgres processes however this could be dangerous for PostgreSQL. Instead of trying to kill the PID follow the directions below in an attempt to stop postgres in an organized fashion.</p>
<p>   1. Attempt Normal Stop: bash-3.1$pg_ctl stop<br />
   2. Attempt Smart Stop: bash-3.1$pg_ctl stop -m s<br />
   3. Attempt Fast Stop: bash-3.1$pg_ctl stop -m f<br />
   4. Attempt Immediate Stop: bash-3.1$pg_ctl stop -m i<br />
The immediate stop almost always ends up stopping postgres if you are having trouble in stopping the processes. If the immediate stop does not work the issue should be investigated before attempting to kill -9 the PID.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.graysunderground.com/2011/02/23/force-postgres-to-stop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Argument list too long</title>
		<link>http://www.graysunderground.com/2011/02/17/argument-list-too-long/</link>
		<comments>http://www.graysunderground.com/2011/02/17/argument-list-too-long/#comments</comments>
		<pubDate>Fri, 18 Feb 2011 01:32:36 +0000</pubDate>
		<dc:creator>Gray</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Linux]]></category>

	<!-- AutoMeta Start -->
	<category></category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.graysunderground.com/2011/02/17/argument-list-too-long/</guid>
		<description><![CDATA[Hate when you can&#8217;t delete everything in a directory at once because rm runs out of args. This will DELETE everything in your current folder. Try this: find . -name &#8216;*&#8217; -exec rm {} \; What to force it so it does not ask you y/n for each file? find . -name &#8216;*&#8217; -exec rm [...]]]></description>
			<content:encoded><![CDATA[<p>Hate when you can&#8217;t delete everything in a directory at once because rm runs out of args. This will DELETE everything in your current folder.</p>
<p>Try this:</p>
<p>find . -name &#8216;*&#8217; -exec rm {} \; </p>
<p>What to force it so it does not ask you y/n for each file?</p>
<p>find . -name &#8216;*&#8217; -exec rm -f {} \; </p>
<p>To remove/delete only directories just add a &#8216;type&#8217; flag to find&#8230;</p>
<p>find . -name &#8216;*&#8217; -type d -exec rm {} \; </p>
]]></content:encoded>
			<wfw:commentRss>http://www.graysunderground.com/2011/02/17/argument-list-too-long/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Upgrade The Ubuntu Linux Kernel</title>
		<link>http://www.graysunderground.com/2011/01/31/how-to-upgrade-the-ubuntu-linux-kernel/</link>
		<comments>http://www.graysunderground.com/2011/01/31/how-to-upgrade-the-ubuntu-linux-kernel/#comments</comments>
		<pubDate>Tue, 01 Feb 2011 00:12:49 +0000</pubDate>
		<dc:creator>Gray</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ubuntu]]></category>

	<!-- AutoMeta Start -->
	<category></category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.graysunderground.com/2011/01/31/how-to-upgrade-the-ubuntu-linux-kernel/</guid>
		<description><![CDATA[This is how I do it. Mileage may very, use at own risk. First: sudo apt-get install linux-image- This will give you all current options for a new linux kernel image. Next do the same with the headers! sudo apt-get install linux-headers- Make sure you do your headers too!!!]]></description>
			<content:encoded><![CDATA[<p>This is how I do it. Mileage may very, use at own risk.</p>
<p>First:<br />
sudo apt-get install linux-image-<tab></p>
<p>This will give you all current options for a new linux kernel image. </p>
<p>Next do the same with the headers!<br />
sudo apt-get install linux-headers-<tab></p>
<p>Make sure you do your headers too!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.graysunderground.com/2011/01/31/how-to-upgrade-the-ubuntu-linux-kernel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux Unrar batch of files with password</title>
		<link>http://www.graysunderground.com/2011/01/18/linux-unrar-batch-of-files-with-password/</link>
		<comments>http://www.graysunderground.com/2011/01/18/linux-unrar-batch-of-files-with-password/#comments</comments>
		<pubDate>Tue, 18 Jan 2011 22:57:17 +0000</pubDate>
		<dc:creator>Gray</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Linux]]></category>

	<!-- AutoMeta Start -->
	<category></category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.graysunderground.com/2011/01/18/linux-unrar-batch-of-files-with-password/</guid>
		<description><![CDATA[So I need to unrar password protected files that are in a batch. Apprx 10-20 each time. This little command line script worked wonders for me, just replace PASSWORD with your password. find -type f -name &#8216;*.rar&#8217; -exec unrar -pPASSWORD x {} \;]]></description>
			<content:encoded><![CDATA[<p>So I need to unrar password protected files that are in a batch. Apprx 10-20 each time. This little command line script worked wonders for me, just replace PASSWORD with your password.</p>
<p>find -type f -name &#8216;*.rar&#8217; -exec unrar -pPASSWORD x {} \;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.graysunderground.com/2011/01/18/linux-unrar-batch-of-files-with-password/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

