<?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>Brain Goo &#187; How Tos</title>
	<atom:link href="http://www.popmartian.com/tipsntricks/category/how-to-do-stuff/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.popmartian.com/tipsntricks</link>
	<description>Carpe Crap 'em</description>
	<lastBuildDate>Thu, 20 May 2010 17:52:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>HOWTO Turn off Line Numbers in VI</title>
		<link>http://www.popmartian.com/tipsntricks/2010/05/20/howto-turn-off-line-numbers-in-vi/</link>
		<comments>http://www.popmartian.com/tipsntricks/2010/05/20/howto-turn-off-line-numbers-in-vi/#comments</comments>
		<pubDate>Thu, 20 May 2010 17:52:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[How Tos]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.popmartian.com/tipsntricks/?p=167</guid>
		<description><![CDATA[I always forget how to turn off line numbers in VI.  The answer is:  set nonumbers or set nonu.  It&#8217;s all about the little things&#8230;
]]></description>
			<content:encoded><![CDATA[<p>I always forget how to turn off line numbers in VI.  The answer is:  set nonumbers or set nonu.  It&#8217;s all about the little things&#8230;</p>
<img src="http://www.popmartian.com/tipsntricks/?ak_action=api_record_view&id=167&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.popmartian.com/tipsntricks/2010/05/20/howto-turn-off-line-numbers-in-vi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python HOWTO Push a Dict on to a List (push a hash on to an array)</title>
		<link>http://www.popmartian.com/tipsntricks/2010/04/23/python-howto-push-a-dict-on-to-a-list-push-a-hash-on-to-an-array/</link>
		<comments>http://www.popmartian.com/tipsntricks/2010/04/23/python-howto-push-a-dict-on-to-a-list-push-a-hash-on-to-an-array/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 14:37:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[How Tos]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.popmartian.com/tipsntricks/?p=159</guid>
		<description><![CDATA[One of my more popular posts is How to Push a Hash on to an Array in PERL, but how do you push a dict on to a list in Python?
Lists are one-dimensional arrays and dicts are associative arrays or hash arrays.  This means we can do the same thing we do in other languages, [...]]]></description>
			<content:encoded><![CDATA[<p>One of my more popular posts is <a href="http://www.popmartian.com/tipsntricks/2008/08/12/perl-howto-push-a-hash-onto-an-array/">How to Push a Hash on to an Array in PERL</a>, but how do you push a dict on to a list in Python?</p>
<p>Lists are one-dimensional arrays and dicts are associative arrays or hash arrays.  This means we can do the same thing we do in other languages, with syntax to match Python&#8217;s object-oriented data structures.</p>
<p><code>import pprint</code></p>
<p><code># Define the list<br />
somelist = []</code></p>
<p><code># Do add some elements to the list<br />
somelist.append({'key1':'value1', 'key2': 'value2'})<br />
somelist.append({'key1':'value1', 'key2': 'value2'})<br />
somelist.append({'key1':'value1', 'key2': 'value2'})</code></p>
<p><code># Print it out<br />
pp = pprint.PrettyPrinter(indent=4)<br />
pp.pprint(somelist)</code></p>
<p>Will give you:</p>
<p><code>[   {   'key1': 'value1', 'key2': 'value2'},<br />
{   'key1': 'value1', 'key2': 'value2'},<br />
{   'key1': 'value1', 'key2': 'value2'}]</code></p>
<img src="http://www.popmartian.com/tipsntricks/?ak_action=api_record_view&id=159&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.popmartian.com/tipsntricks/2010/04/23/python-howto-push-a-dict-on-to-a-list-push-a-hash-on-to-an-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integrate Shared Google Calendars With Thunderbird</title>
		<link>http://www.popmartian.com/tipsntricks/2010/01/26/integrate-shared-google-calendars-with-thunderbird/</link>
		<comments>http://www.popmartian.com/tipsntricks/2010/01/26/integrate-shared-google-calendars-with-thunderbird/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 17:03:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Calendaring]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[How Tos]]></category>
		<category><![CDATA[Sunbird]]></category>
		<category><![CDATA[WebDav]]></category>
		<category><![CDATA[iCal]]></category>
		<category><![CDATA[lightning]]></category>
		<category><![CDATA[thunderbird]]></category>

		<guid isPermaLink="false">http://www.popmartian.com/tipsntricks/?p=137</guid>
		<description><![CDATA[Before we get started, if you have a personal calendar, Google  has a quick how-to here. The Google tutorial only covers basic calendars.  This tutorial will cover both personal and shared calendars.

Google Calendar is neat and pretty much every phone and app has some sync system that works with it&#8230; except Thunderbird with the [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>Before we get started, if you have a personal calendar, <a href="http://www.google.com/support/calendar/bin/answer.py?hl=en&amp;answer=99358#sunbird">Google  has a quick how-to here.</a> The Google tutorial only covers basic calendars.  This tutorial will cover both personal and shared calendars.<a href="http://www.google.com/support/calendar/bin/answer.py?hl=en&amp;answer=99358#sunbird"><br />
</a></p></blockquote>
<p>Google Calendar is neat and pretty much every phone and app has some sync system that works with it&#8230; except Thunderbird with the Lightning Add-on.  Actually it does, it&#8217;s just not intuitive.</p>
<p>NOTE: If you use the <a href="http://www.mozilla.org/projects/calendar/sunbird/">Sunbird stand-alone calendar client</a>, the steps are essentially the same, but some menu options may be different.</p>
<p>What you need:</p>
<p><a href="http://www.mozillamessaging.com/en-US/thunderbird/">Thunderbird</a> (2.x works, but &gt;= 3.01 is better)</p>
<p><a href="http://www.mozilla.org/projects/calendar/lightning/">Lightning Add-on</a> (.9x for Thunderbird 2.x, &gt;=1.0b1 for TB 3.0.x)</p>
<p>A <a href="http://www.google.com/calendar/">Google Calendar</a> or access to a shared Google Calendar.</p>
<p>What to do:</p>
<ol>
<li>Add the Lightning Add-on to Thunderbird and fire it up.</li>
<li>In the left column your calendars are listed.  Below them right-click and click New Calendar</li>
<li>Select On the Network, click Next</li>
<li>Select CalDAV</li>
<li>Put in your calendar URL<br />
The URL of your calendar takes this form:<br />
<code>https://www.google.com/calendar/dav/[Google Calendar ID]/events</code></p>
<p>In the case of  a personal calendar, the ID is simply your gmail.com address such as this:<br />
<code>https://www.google.com/calendar/dav/BigTurnip@gmail.com/events</code></p>
<p>In the case of a shared calendar the ID is fugly, like this:<br />
<code>https://www.google.com/calendar/dav/utqisjt6b9hoot6i9o2jk1k9qg%40group.calendar.google.com/events</code></p>
<p>To get that string, log in to your Google calendar and go to the calendar settings.  Down by the XML, iCAL and HTML links there is something like this:<br />
<code>(Calendar ID: SomeBigNastyStringOfJunk@group.calendar.google.com)</code></p>
<p>That&#8217;s your prize!</li>
<li>Click Next</li>
<li>Give your calendar and name, color and an email address.  Click Next.</li>
<li>Click Finish.</li>
<li>If it doesn&#8217;t seem to work, close and open Thunderbird.  There is a bug that may cause new network calendars to fail to display right away.  If it still fails, check the URL from step 5.</li>
</ol>
<p>Happy calendaring.</p>
<blockquote><p>Did you find this post useful or have questions or comments?  Please let  me know!</p></blockquote>
<img src="http://www.popmartian.com/tipsntricks/?ak_action=api_record_view&id=137&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.popmartian.com/tipsntricks/2010/01/26/integrate-shared-google-calendars-with-thunderbird/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Removing a File Beginning With Dash -</title>
		<link>http://www.popmartian.com/tipsntricks/2009/10/28/removing-a-file-beginning-with-dash/</link>
		<comments>http://www.popmartian.com/tipsntricks/2009/10/28/removing-a-file-beginning-with-dash/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 18:03:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[How Tos]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.popmartian.com/tipsntricks/?p=124</guid>
		<description><![CDATA[I get this a lot from friends and Google is full of examples, but here it is again.
If you have a file that begins with a hyphen (one of these: -) you&#8217;ll have a tough time removing it unless you remember something simple from Command Line 101.  In most CLI environments, your shell has [...]]]></description>
			<content:encoded><![CDATA[<p>I get this a lot from friends and Google is full of examples, but here it is again.</p>
<p>If you have a file that begins with a hyphen (one of these: -) you&#8217;ll have a tough time removing it unless you remember something simple from Command Line 101.  In most CLI environments, your shell has two ways to access a file: relative path and absolute path.</p>
<p>See, all I had to do was type that and 90% of you just went &#8220;Durr!&#8221; and removed your file.</p>
<p>For the rest of you, just refer to the file by it&#8217;s full path.  Example:</p>
<p><code>/tmp$ ls -la|grep ^\-</code><br />
<code>-rw-r--r--  1 bob bob     0 2009-10-28 12:50 -somefile</code></p>
<p>Oh look, I have a file in /tmp called -somefile.  What ever shall I do to remove it?</p>
<p><code>/tmp$ rm -somefile</code><br />
<code>rm: invalid option -- s</code><br />
<code>Try `rm ./-somefile' to remove the file `-somefile'.</code><br />
<code>Try `rm --help' for more information.</code></p>
<p>Oh my!  That didn&#8217;t work at all! The rm command thinks I&#8217;m passing it a flag called -somefile.  Conveniently, rm knows I&#8217;m not very bright and tells me how to remove it!</p>
<p><code>/tmp$ rm ./-somefile</code><br />
<code>/tmp$</code></p>
<p>Well blow me down!  Alternately, you can refer to the file with the full path:</p>
<p><code>/tmp$ rm /tmp/-somefile</code><br />
<code>/tmp$</code></p>
<p>The key is to remember that the shell knows where you are, but doesn&#8217;t know what you want.  If you imply that you want to delete something, the shell does it&#8217;s best guess.  In this case, it guesses wrong because rm command flags take precedence over arguments.  If you are explicit in what you want, the shell does not have to guess.</p>
<p>Of course, being fully explicit means issuing the full command for rm:</p>
<p><code>/bin/rm /tmp/-somefile</code></p>
<p>But you have to know where rm lives.  You can guess, or you can find it with which:</p>
<p><code>$ which rm</code><br />
<code>/bin/rm</code></p>
<p>But how do you know where which is?</p>
<p><code>``/usr/bin/which which` rm` /tmp/-somefile</code></p>
<p>Ok, that&#8217;s dumb.  Go remove your file.</p>
<blockquote><p>Did you find this post useful or have questions or comments?  Please let me know!</p></blockquote>
<img src="http://www.popmartian.com/tipsntricks/?ak_action=api_record_view&id=124&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.popmartian.com/tipsntricks/2009/10/28/removing-a-file-beginning-with-dash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Locate an Unknown NIC Device Name in Solaris 9</title>
		<link>http://www.popmartian.com/tipsntricks/2009/06/02/locate-an-unknown-nic-device-name-in-solaris-9/</link>
		<comments>http://www.popmartian.com/tipsntricks/2009/06/02/locate-an-unknown-nic-device-name-in-solaris-9/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 14:31:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[How Tos]]></category>
		<category><![CDATA[solaris]]></category>

		<guid isPermaLink="false">http://www.popmartian.com/tipsntricks/?p=118</guid>
		<description><![CDATA[If you install a NIC in a Solaris SPARC box, at least on Solaris 9, and you don&#8217;t know the device name, the following will help:
prtconf -pv &#124; more
look for
device_type:  'network'
Near the network device you&#8217;ll see model and name, similar to this:
model:  'SUNW,pci-qfe'
name:  'SUNW,qfe'
In this case your device is a qfe card.  You can get [...]]]></description>
			<content:encoded><![CDATA[<p>If you install a NIC in a Solaris SPARC box, at least on Solaris 9, and you don&#8217;t know the device name, the following will help:</p>
<p><code>prtconf -pv | more</code></p>
<p>look for<br />
<code>device_type:  'network'</code></p>
<p>Near the network device you&#8217;ll see model and name, similar to this:</p>
<p><code>model:  'SUNW,pci-qfe'<br />
name:  'SUNW,qfe'</code></p>
<p>In this case your device is a qfe card.  You can get it up and running with<br />
<code>ifconfig qfe0 plumb</code></p>
<blockquote><p>Did you find this post useful or have questions or comments?  Please let me know!</p></blockquote>
<img src="http://www.popmartian.com/tipsntricks/?ak_action=api_record_view&id=118&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.popmartian.com/tipsntricks/2009/06/02/locate-an-unknown-nic-device-name-in-solaris-9/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To disable WebDAV in IIS 6</title>
		<link>http://www.popmartian.com/tipsntricks/2009/05/20/howto-disable-webdav-in-iis-6/</link>
		<comments>http://www.popmartian.com/tipsntricks/2009/05/20/howto-disable-webdav-in-iis-6/#comments</comments>
		<pubDate>Wed, 20 May 2009 15:44:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[How Tos]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[WebDav]]></category>
		<category><![CDATA[windows 2003]]></category>

		<guid isPermaLink="false">http://www.popmartian.com/tipsntricks/?p=101</guid>
		<description><![CDATA[IIS 6 does not come with WebDAV enabled, but you can easily look to see if it is on.

Connect to the IIS manager.
Manager -&#62; Machine -&#62; Web Services Extensions
Check the window at right.  If WebDAV is not enabled, it should look like this:


If your IIS manager shows it as &#8220;Allowed&#8221;, you can disable it by [...]]]></description>
			<content:encoded><![CDATA[<p>IIS 6 does not come with WebDAV enabled, but you can easily look to see if it is on.</p>
<ol>
<li>Connect to the IIS manager.</li>
<li>Manager -&gt; Machine -&gt; Web Services Extensions</li>
<li>Check the window at right.  If WebDAV is not enabled, it should look like this:</li>
</ol>
<p style="text-align: center;"><a href="http://www.popmartian.com/tipsntricks/wp-content/uploads/2009/05/capture.jpg"><img class="aligncenter size-medium wp-image-102" title="IIS Config" src="http://www.popmartian.com/tipsntricks/wp-content/uploads/2009/05/capture-300x211.jpg" alt="IIS Config" width="300" height="211" /></a></p>
<p>If your IIS manager shows it as &#8220;Allowed&#8221;, you can disable it by clicking on it and clicking the &#8220;Prohibit&#8221; button to the left.</p>
<blockquote><p>Did you find this post useful or have questions or comments?  Please let me know!</p></blockquote>
<img src="http://www.popmartian.com/tipsntricks/?ak_action=api_record_view&id=101&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.popmartian.com/tipsntricks/2009/05/20/howto-disable-webdav-in-iis-6/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>LVM Breaks When Upgrading Debian Etch to Lenny 4.x to 5.0</title>
		<link>http://www.popmartian.com/tipsntricks/2009/04/28/lvm-breaks-when-upgrading-debian-etch-to-lenny-4x-to-50/</link>
		<comments>http://www.popmartian.com/tipsntricks/2009/04/28/lvm-breaks-when-upgrading-debian-etch-to-lenny-4x-to-50/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 14:37:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[How Tos]]></category>
		<category><![CDATA[LVM]]></category>

		<guid isPermaLink="false">http://www.popmartian.com/tipsntricks/?p=83</guid>
		<description><![CDATA[Using the standard upgrade proceedures, Debian Etch + LVM will fail to upgrade to Debian Lenny gracefully.  This is due to the kernel modules and is simple to avoid.

Before changing apt sources (They should be etch)
apt-get update
apt-get upgrade
reboot if kernel upgrades
Now change your apt sources  (Lenny or Stable)
apt-get update
apt-get upgrade
NOTE: At this point lvm2 is [...]]]></description>
			<content:encoded><![CDATA[<p>Using the standard upgrade proceedures, Debian Etch + LVM will fail to upgrade to Debian Lenny gracefully.  This is due to the kernel modules and is simple to avoid.</p>
<ol>
<li><strong>Before changing apt sources (They should be etch)</strong></li>
<li>apt-get update</li>
<li>apt-get upgrade</li>
<li>reboot if kernel upgrades</li>
<li><strong>Now change your apt sources  (Lenny or Stable)</strong></li>
<li>apt-get update</li>
<li>apt-get upgrade</li>
<li>NOTE: At this point lvm2 is probably held back.</li>
<li>Reboot if the kernel upgrades</li>
<li> NOW do your dist upgrade</li>
<li>apt-get update</li>
<li>apt-get dist-upgrade</li>
<li>NOTE: At this point lvm2 is probably <strong>still</strong> held back.</li>
<li>Reboot</li>
<li>apt-get update</li>
<li>apt-get install lvm2</li>
<li>Reboot</li>
</ol>
<p>TADA!  You have to reboot a couple times, but you never have to touch the configs or the mapper.</p>
<blockquote><p>Did you find this post useful or have questions or comments?  Please let me know!</p></blockquote>
<img src="http://www.popmartian.com/tipsntricks/?ak_action=api_record_view&id=83&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.popmartian.com/tipsntricks/2009/04/28/lvm-breaks-when-upgrading-debian-etch-to-lenny-4x-to-50/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>PERL How To Print A List Without A Loop</title>
		<link>http://www.popmartian.com/tipsntricks/2009/02/06/perl-how-to-print-a-list-without-a-loop/</link>
		<comments>http://www.popmartian.com/tipsntricks/2009/02/06/perl-how-to-print-a-list-without-a-loop/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 16:47:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[How Tos]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://www.popmartian.com/tipsntricks/?p=71</guid>
		<description><![CDATA[PERL has a built-in function called join() that will concatenate a list with a given string.  The official perldoc states:
join EXPR,LIST
Joins the separate strings of LIST into a single string with fields separated by the value of EXPR, and returns that new string. Example:
$rec = join(':', $login,$passwd,$uid,$gid,$gcos,$home,$shell);
From the code example, you can make CSV [...]]]></description>
			<content:encoded><![CDATA[<p>PERL has a built-in function called join() that will concatenate a list with a given string.  The official perldoc states:</p>
<p><em><strong>join EXPR,LIST</strong><br />
Joins the separate strings of LIST into a single string with fields separated by the value of EXPR, and returns that new string. Example:</em><br />
<code>$rec = join(':', $login,$passwd,$uid,$gid,$gcos,$home,$shell);</code></p>
<p>From the code example, you can make CSV output and all kinds of goodies, but what the doc misses and the example doesn&#8217;t show is that combining join() with a print statement makes writing lists to STDOUT or a file handle a snap.  This is where join() really shines.</p>
<p>Example:</p>
<p><em><strong>Code</strong></em><br />
<code>@names = ('Mark', 'Jim', 'Bob','Mary','Steven','Gomer');<br />
print join("\n", @names);</code></p>
<p><em><strong>Output</strong><br />
Mark<br />
Jim<br />
Bob<br />
Mary<br />
Steven<br />
Gomer</em></p>
<p>Note that this will NOT print a final or beginning string.  Join() concatenates the elements, meaning it puts the string value BETWEEN the list elements.</p>
<blockquote><p>Did you find this post useful or have questions or comments?  Please let me know!</p></blockquote>
<img src="http://www.popmartian.com/tipsntricks/?ak_action=api_record_view&id=71&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.popmartian.com/tipsntricks/2009/02/06/perl-how-to-print-a-list-without-a-loop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>
<blockquote><p>Did you find this post useful or have questions or comments?  Please let me know!</p></blockquote>
<img src="http://www.popmartian.com/tipsntricks/?ak_action=api_record_view&id=67&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.popmartian.com/tipsntricks/2008/10/27/sql-select-duplicate-rows-select-indistinct-rows/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</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>
<img src="http://www.popmartian.com/tipsntricks/?ak_action=api_record_view&id=41&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.popmartian.com/tipsntricks/2008/09/22/change-or-recover-mysql-root-password/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
