<?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>Tips and Tricks</title>
	<atom:link href="http://www.legend.ws/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.legend.ws/blog</link>
	<description>Find useful tips and tricks related to your every day techy needs</description>
	<lastBuildDate>Fri, 06 Nov 2009 08:59:14 +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>Enabling telnet in windows vista</title>
		<link>http://www.legend.ws/blog/tips-tricks/enabling-telnet-in-windows-vista/</link>
		<comments>http://www.legend.ws/blog/tips-tricks/enabling-telnet-in-windows-vista/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 08:59:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.legend.ws/blog/?p=113</guid>
		<description><![CDATA[Some of you may be missing the good old command-line telnet client. The thing is that vista has this client disabled by default. The good news is that you can easily install/enable it. To do so, follow these steps:

Go to Control Panel
Click on &#8216;Programs&#8217;
Under &#8216;Programs and Features&#8217;, click on &#8216;Turn windows features on or off&#8217;
Wait [...]]]></description>
			<content:encoded><![CDATA[<p>Some of you may be missing the good old command-line telnet client. The thing is that vista has this client disabled by default. The good news is that you can easily install/enable it. To do so, follow these steps:</p>
<ol>
<li>Go to Control Panel</li>
<li>Click on &#8216;Programs&#8217;</li>
<li>Under &#8216;Programs and Features&#8217;, click on &#8216;Turn windows features on or off&#8217;</li>
<li>Wait a bit for the list to be compiled</li>
<li>Tick &#8216;Telnet <strong>client</strong>&#8216; and hit &#8216;OK&#8217; then wait for it to be installed</li>
</ol>
<p>You may now open a command prompt and use <em>telnet hostname port</em></p>
<p>Good luck</p>
]]></content:encoded>
			<wfw:commentRss>http://www.legend.ws/blog/tips-tricks/enabling-telnet-in-windows-vista/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Konami Code</title>
		<link>http://www.legend.ws/blog/tips-tricks/konami-code/</link>
		<comments>http://www.legend.ws/blog/tips-tricks/konami-code/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 14:45:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Humor]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.legend.ws/blog/?p=104</guid>
		<description><![CDATA[The &#8216;Konami code&#8217; fad is back!
For those of you who don&#8217;t know, Konami code (a.k.a Konami Command) is a cheat code that was used in several games back in the day.
It has been introduced not long ago on several websites. Upon entering this cheat code, some &#8217;secret&#8217; is revealed or a page is unlocked.
The sequence [...]]]></description>
			<content:encoded><![CDATA[<p>The &#8216;Konami code&#8217; fad is back!</p>
<p>For those of you who don&#8217;t know, Konami code (a.k.a Konami Command) is a cheat code that was used in several games back in the day.</p>
<p>It has been introduced not long ago on several websites. Upon entering this cheat code, some &#8217;secret&#8217; is revealed or a page is unlocked.</p>
<p>The sequence is: <strong>Up, Up, Down, Down, Left, Right, Left, Right, B, A</strong></p>
<p>Some of the famous websites that make use of it are: digg.com, facebook.com<br />
For instance, hitting the above sequence on any story page on digg would change the way comments are displayed, and you&#8217;ll be able to view them in a tree/nested structure.<br />
facebook would simply display some joyfull circles/colors (hit any key or press the mouse button after entering the konami code)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.legend.ws/blog/tips-tricks/konami-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Traffic forwarding on linux using IPTABLES</title>
		<link>http://www.legend.ws/blog/tips-tricks/traffic-forwarding-on-linux-using-iptables/</link>
		<comments>http://www.legend.ws/blog/tips-tricks/traffic-forwarding-on-linux-using-iptables/#comments</comments>
		<pubDate>Mon, 18 May 2009 08:24:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.legend.ws/blog/?p=100</guid>
		<description><![CDATA[IPTables allows you to easily setup rules for packet filtering/forwarding.
So, to keep it short and simple: assume you&#8217;d like to forward any traffic coming to your machine (192.168.0.1) on port 80 to machine2 (192.168.0.2) on port 8080 then:
- Enable port forwarding:
echo 1 &#62; /proc/sys/net/ipv4/ip_forward
- Now add the rules:
iptables &#45;t nat &#45;A PREROUTING &#45;p tcp &#45;d [...]]]></description>
			<content:encoded><![CDATA[<p>IPTables allows you to easily setup rules for packet filtering/forwarding.</p>
<p>So, to keep it short and simple: assume you&#8217;d like to forward any traffic coming to your machine (192.168.0.1) on port 80 to machine2 (192.168.0.2) on port 8080 then:</p>
<p>- Enable port forwarding:</p>
<blockquote><p>echo 1 &gt; /proc/sys/net/ipv4/ip_forward</p></blockquote>
<p>- Now add the rules:</p>
<blockquote><p>iptables &#45;t nat &#45;A PREROUTING &#45;p tcp &#45;d 192.168.0.1 &#45;&#45;dport 80 &#45;j DNAT &#45;&#45;to 192.168.0.2:8080</p>
<p>iptables &#45;t nat &#45;A POSTROUTING &#45;d 192.168.0.2 &#45;j MASQUERADE</p></blockquote>
<p>The &#45;p tcp flag specifies that the protocol is TCP (as opposed to UDP, ICMP for example).</p>
<p>The &#45;d 192.168.0.1 flag specifies that the packets was destined to IP 192.168.0.1</p>
<p>The &#45;&#45;dport 80 means that the packet had port 80 as destination</p>
<p>&#45;j is the target of the rule being enforced, NAT (network address translation). In more advanced rules, one can specify a predefined iptables chain of rules.</p>
<p>&#45;&#45;to will specify to where this packet should be forwarded, and on which port</p>
<p>As for the second rule, it says that outgoing packets to the second machine should be masqueraded. In other terms, the user trying to access the original machine on port 80 will not have a feel that his request was forwarded. The packet will show up as if it came from the masquerading host, while in practice, the request was forwarded to machine2, and the reply came back from that same machine.</p>
<p>On a side note, make sure to add these iptables rules to a file, give it an execution permission (chmod +x /path/to/file), and add it to /etc/rc.local so that it is executed on every system boot. Otherwise, the above rules will be fliushed every time your system is restarted.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.legend.ws/blog/tips-tricks/traffic-forwarding-on-linux-using-iptables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google&#8217;s source:life</title>
		<link>http://www.legend.ws/blog/search-engines/googles-sourcelife/</link>
		<comments>http://www.legend.ws/blog/search-engines/googles-sourcelife/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 08:18:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Search Engines]]></category>

		<guid isPermaLink="false">http://www.legend.ws/blog/?p=93</guid>
		<description><![CDATA[One of the neatest recent additions to Google search is the LIFE photo archive.
Basically, google images is now indexing a large photo archive owned by the famous Life magazine. Many of these images were also never published before. Talk about a jump back into some of the finest moment in history. Some of these photos [...]]]></description>
			<content:encoded><![CDATA[<p>One of the neatest recent additions to Google search is the <a href="http://images.google.com/hosted/life">LIFE photo archive</a>.</p>
<p>Basically, google images is now indexing a large photo archive owned by the famous Life magazine. Many of these images were also never published before. Talk about a jump back into some of the finest moment in history. Some of these photos date back to around the 1750s.</p>
<p>To search this archive for a specific keyword, simply append the following to your search term(s):  source:life</p>
<p>Try some of the following searches for instance:<a href="http://images.google.com/images?hl=en&amp;q=blues+source%3Alife&amp;btnG=Search+Images&amp;gbv=2"><br />
</a><strong><a href="http://images.google.com/images?hl=en&amp;q=blues+source%3Alife&amp;btnG=Search+Images&amp;gbv=2">Blues</a></strong> &#8211; <strong><a href="http://images.google.com/images?gbv=2&amp;hl=en&amp;q=titanic+source%3Alife&amp;btnG=Search+Images">Titanic</a></strong> &#8211; <strong><a href="http://images.google.com/images?gbv=2&amp;hl=en&amp;q=gold+rush+source%3Alife&amp;btnG=Search+Images">Gold rush</a></strong><br />
You may also browse through the decades-categorized items on the <a href="http://images.google.com/hosted/life">official landing page</a></p>
<p>Simply, amazing!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.legend.ws/blog/search-engines/googles-sourcelife/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google search tips</title>
		<link>http://www.legend.ws/blog/tips-tricks/google-search-tip/</link>
		<comments>http://www.legend.ws/blog/tips-tricks/google-search-tip/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 15:44:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Search Engines]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.legend.ws/blog/?p=86</guid>
		<description><![CDATA[&#8216;Face&#8217; photos
When searching for images, you could narrow down your search to &#8216;faces&#8217;. Simply, append &#8216;&#38;imgtype=face&#8217; to the end of the google images search url.
So if you&#8217;re searching for Robert De Niro, try doing it with &#8216;face&#8217; as image type
File Types
You could specify the type of file you&#8217;re looking for. Simply append &#8216;filetype: type&#8217; to [...]]]></description>
			<content:encoded><![CDATA[<p><strong>&#8216;Face&#8217; photos</strong><br />
When searching for images, you could narrow down your search to &#8216;faces&#8217;. Simply, append &#8216;&amp;imgtype=face&#8217; to the end of the google images search url.<br />
So if you&#8217;re searching for <a title="Robert De Niro" href="http://images.google.com/images?hl=en&amp;q=roberto+de+niro&amp;btnG=Search+Images" target="_blank">Robert De Niro</a>, try doing it <a href="http://images.google.com/images?hl=en&amp;q=roberto+de+niro&amp;btnG=Search+Images&amp;imgtype=face">with &#8216;face&#8217; as image type</a></p>
<p><strong>File Types</strong><br />
You could specify the type of file you&#8217;re looking for. Simply append &#8216;filetype: type&#8217; to your search query. So if you&#8217;re looking for an excel file related to subject Foo, then search for: &#8216;Foo filetype:xsl&#8217;</p>
<p><strong>Site limitation</strong><br />
If you&#8217;d like to narrow down your search results to those coming from a certain website, you may use the &#8217;site:&#8217; feature. For instance, if you&#8217;re looking for new year related articles on cnn.com, search for: &#8216;new year site:cnn.com&#8217;</p>
<p><strong>Definitions</strong><br />
Are you looking for a quick definition of a certain word, abbreviation, etc? use google&#8217;s &#8216;define:&#8217; criteria. For example, if you&#8217;re not sure what AFAIK means, simply search for: &#8216;define:AFAIK&#8217;. A set of definitions from multiple glossary website will be returned.<br />
Note that you may do so for multiple languages</p>
<p><strong>Cached version</strong><br />
Looking for a quick way to see google&#8217;s cache of a certain page? simply search for &#8216;cache:url&#8217;. For example, searchfing for &#8216;cache:cnn.com&#8217; would return google&#8217;s latest cached version of the cnn.com page</p>
<p><strong>Conversions</strong><br />
You may easily resort to converting units in google! try searching for some of the following: &#8216;12 feet in meters&#8217;, &#8216;10 kilograms in pounds&#8217;, &#8216;20 degrees celsius in fahrenheit&#8217;.<br />
You may also resort to currency conversions (not lively updated as it seems), e.g. &#8216;24 euros in usd&#8217;</p>
<p><strong>Calculations</strong><br />
On a note similar to that of the conversions, you may do simple to medium mathematical calculations using google as well. Try searching for sin(50), cos(39), tan(82)*24/cos(41). Quite neat.</p>
<p><strong>Current time</strong><br />
You can easily find the local time in a given city. Simple use: &#8216;time in cityname&#8217;. For instance, trying &#8216;time in kuala lumpur&#8217; can return at the time of testing: 10:32am Saturday (MYT) &#8211; Time in Kuala Lumpur, Malaysia</p>
<p><strong>Weather</strong><br />
Weather forecasts have never been easier. Try searching for &#8216;Weather in Prague&#8217;, &#8216;Weather in Rio de Janeiro&#8217;. You&#8217;d get a 4 days forecast (including today), with high, low and cute descriptive icons.</p>
<p><strong>Stocks</strong><br />
Yes, google does help you get quick stock quotes as well! simply search for &#8217;stocks:stockname&#8217;. e.g., searching for &#8217;stocks:dji&#8217; will return the Dow Jones Industrial Average, along with open, high, low, last update time and simple activity graph!</p>
<p><strong>Movies show times<br />
</strong>Google allows you to search for movies show times, by ZIP codes. So for instance, if you reside in Beverly hills 90210, try searching for: &#8217;showtimes 90210&#8242;</p>
<p><strong>Page titles<br />
</strong>Looking for web pages that contain a specific set of terms? you may query google using the following method: &#8216;intitle: &#8220;sentence here&#8221;&#8216;, e.g. &#8216;intitle: &#8220;dude where&#8217;s my car&#8221;&#8216;</p>
<p><strong>Synonyms<br />
</strong>You may let google search not only for terms you enter, but also their synonyms. For instance, if you&#8217;d like to find website that list inspirational quotes, with whatever synonyms inspirational might have (such as motivational), try looking for: &#8216;~inspiring quotes&#8217; (by adding the tilde as a prefix to the terms in question)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.legend.ws/blog/tips-tricks/google-search-tip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recovering your Journalspace.com blog posts</title>
		<link>http://www.legend.ws/blog/tips-tricks/recovering-your-livejournalcom-blog-posts/</link>
		<comments>http://www.legend.ws/blog/tips-tricks/recovering-your-livejournalcom-blog-posts/#comments</comments>
		<pubDate>Sun, 04 Jan 2009 10:37:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Search Engines]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.legend.ws/blog/?p=40</guid>
		<description><![CDATA[So it seems that journalspace.com is gone for good. For those of you that used to have blogs hosted there, now is the right time to try to recover as much of your blog posts as possible.
Definetly, the only resource that one can think of is search engine cache. Andrew heart seems to have already [...]]]></description>
			<content:encoded><![CDATA[<p>So it seems that journalspace.com is gone for good. For those of you that used to have blogs hosted there, now is the right time to try to recover as much of your blog posts as possible.<br />
Definetly, the only resource that one can think of is search engine cache. <a title="Andre Heart" href="http://andrewtheart.blogspot.com/2009/01/how-to-recover-mostall-of-your.html" target="_blank">Andrew heart</a> seems to have already mentioned this, but let me emphasis on some tips and tricks while doing your search.</p>
<p><strong>Recovering journalspace.com blog posts using google</strong></p>
<p>* To search for all your blog&#8217;s cached pages, use:</p>
<blockquote><p><strong>site</strong>:<em>yourusername</em>.journalspace.com</p></blockquote>
<p>* If there are lots of indexed pages and you&#8217;re looking for a specific post, use:</p>
<blockquote><p><strong>site</strong>:<em>yourusername</em>.journalspace.com <strong>intitle</strong>:&#8221;<em>your post title</em>&#8220;</p></blockquote>
<p>The quotes around your post title means that the post title contains that exact phrase. If you&#8217;re unsure of the exact title, but remember a couple words from it, you can use:</p>
<blockquote><p><strong>site</strong>:<em>yourusername</em>.journalspace.com <strong>intitle</strong>:<em>word1 </em><strong>intitle</strong>:<em>word2 </em><strong>intitle</strong>:<em>word3<br />
</em></p></blockquote>
<p>* If you&#8217;re looking for a specific category page on your blog, use:</p>
<blockquote><p><strong>site</strong>:<em>yourusername</em>.journalspace.com <strong>inurl</strong>:cat</p></blockquote>
<p>* If you&#8217;re looking just for entries, not general pages and category pages, use:</p>
<blockquote><p><strong>site</strong>:<em>yourusername</em>.journalspace.com <strong>inurl</strong>:entryid</p></blockquote>
<p>* If you&#8217;re looking at posts with comments, try using:</p>
<blockquote><p><strong>site</strong>:<em>yourusername</em>.journalspace.com <strong>inurl</strong>:displaycomments</p></blockquote>
<p>* If you&#8217;re looking for a list of posts from a specific month, use:</p>
<blockquote><p><strong>site</strong>:<em>yourusername</em>.journalspace.com <strong>inurl</strong>:&#8221;m=<em>0</em>&#8221; inurl:&#8221;Y=<em>0000</em>&#8220;</p></blockquote>
<p>replacing the dummy zeros with the month and year value</p>
<p>* If you&#8217;d like to recover your profile info, use:</p>
<blockquote><p><strong>site</strong>:journalspace.com/profile/ <strong>inurl</strong>:<em>yourusername</em></p></blockquote>
<p>replacing <em>yourusername </em>with your actual username.</p>
<p>* If your blog had authors/contributors and you&#8217;re looking for posts from a specific one, use:</p>
<blockquote><p><strong>site</strong>:<em>yourusername</em>.journalspace.com <strong>inurl</strong>:author <strong>inurl</strong>:<em>TheAuthorName</em></p></blockquote>
<p>Obviously, replacing <em>TheAuthorName</em> with the used author name.</p>
<p>* If you&#8217;re looking for all blog entries that DO NOT match a certain term in their title, use:</p>
<blockquote><p><strong>site</strong>:<em>yourusername</em>.journalspace.com<strong> -intitle</strong>:<em>termToDisregard<br />
</em></p></blockquote>
<p>Note that if you want to exclude some term(s) from all the result (i.e. not just found in the title), use:</p>
<blockquote><p><strong>site</strong>:<em>yourusername</em>.journalspace.com<strong> -</strong><em>termToDisregard1 -termToDisregard2 -termToDisregard3<br />
</em></p></blockquote>
<p>* If your&#8217;d like to see <strong>thumbnails </strong>of images on your blog that google has cached, go to:</p>
<blockquote><p>http://images.google.com/images?um=1&amp;hs=uR5&amp;q=site%3Ajournalspace.com+<em>yourusername</em>&amp;btnG=Search+Images (replace <em>yourusername</em>)</p></blockquote>
<p>The image cache is not for the full size images, but this might help you remember which photos you uploaded, and you may discover you you still have them somewhere on your drive!</p>
<p><strong>Recovering your items using MSN live search or Yahoo! site explorer<br />
</strong></p>
<p>Google is not the sole search engine indexing content. So if there is an item on your blog that google did not cache (and it&#8217;s very possible), try searching for the missing content on other search engines.<br />
MSN Live is one other good example, with search keywords almost identical to that of google.</p>
<p>The URL is http://search.live.com<br />
Useful Keywords you could use are <strong>intitle:</strong>, <strong>site:</strong>, &#8211; (negating a word), &#8220;&#8221; (quotations, to search for exact terms). Though, not sure about the alternative to google&#8217;s <strong>inurl</strong></p>
<p>Yahoo! site explorer is at http://siteexplorer.search.yahoo.com/<br />
&#8216;Exploring&#8217; your blog can be done at http://siteexplorer.search.yahoo.com/search?p=http%3A%2F%2F<em>yourusername</em>.journalspace.com%2F (replacing <em>yourusername</em> with your actual blog username). A link to each of the pages&#8217; cached copy is available</p>
<p>Keep in mind that search engines will eventually <strong>de-index</strong> their cache, once the pages in question will be found to be no longer available. So, act quickly on recovery.</p>
<p>Right now, Google has <a href="http://www.google.com/search?q=site%3Ajournalspace.com">53.2K pages</a>, and <a href="http://images.google.com/images?q=site%3Ajournalspace.com&amp;um=1&amp;ie=UTF-8&amp;sa=N&amp;tab=wi">375 images</a> indexed.<br />
MSN Live has <a href="http://search.live.com/results.aspx?q=site%3Ajournalspace.com">12.5K pages</a> and <a href="http://search.live.com/images/results.aspx?q=site%3ajournalspace.com&amp;FORM=BIRE">23K images</a> indexed.<br />
Yahoo! has <a href="http://siteexplorer.search.yahoo.com/search?p=journalspace.com&amp;y=Explore+URL&amp;fr=sfp">2.3K pages</a> and <a href="http://images.search.yahoo.com/">536 image</a> thumbs.<br />
I wonder if these are normal numbers or did the search engines start deindexing?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.legend.ws/blog/tips-tricks/recovering-your-livejournalcom-blog-posts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL password hashing</title>
		<link>http://www.legend.ws/blog/tips-tricks/mysql-password-hashing/</link>
		<comments>http://www.legend.ws/blog/tips-tricks/mysql-password-hashing/#comments</comments>
		<pubDate>Fri, 02 Jan 2009 18:55:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.legend.ws/blog/?p=35</guid>
		<description><![CDATA[Whenever you upgrade your MySQL installation, make sure to upgrade any client that uses it.
In some cases, clients that use a version prior to 4.1 will have a problem authenticating against the MySQL database if the latter has a post 4.1 version.
The trick is that after 4.1 (i.e. 4.11 and up), MySQL changed the way [...]]]></description>
			<content:encoded><![CDATA[<p>Whenever you upgrade your MySQL installation, make sure to upgrade any client that uses it.</p>
<p>In some cases, clients that use a version prior to 4.1 will have a problem authenticating against the MySQL database if the latter has a post 4.1 version.</p>
<p>The trick is that after 4.1 (i.e. 4.11 and up), MySQL changed the way it stores the passwords in the <strong>user</strong> table inside the <strong>mysql</strong> system database.<br />
Password hashes are now 41 bytes long instead of the old 16 bytes.</p>
<p>So for example, if your MySQL server is 5.0, while your <strong>php-mysql</strong> library is 4.1, your web applications will fail to connect to the database. As such, it is recommended that you upgrade the client.</p>
<p>In any case, MySQL offers a way to change the hash back into the old format. For the sake of argument, assume the user in question is <strong>john</strong>, and you want to be able to connect using password <strong>dummy</strong>. In this case, connect to your MySQL server from the prompt (SSH and use &#8216;mysql -u root -p mysql&#8217; on linux, or go to your mysql/bin windows directory and execute the same query), then issue the following queries:</p>
<blockquote><p>update user set Password=OLD_PASSWORD(&#8216;dummy&#8217;) where User=&#8217;john&#8217;;<br />
flush privileges;</p></blockquote>
<p>the OLD_PASSWORD() function will generate the old 16 bytes hash. The first query will eventually update the user password to use this hash. The second query is necessary in order for the MySQL service to re-read the new user privileges.</p>
<p>PS: if your root password is not working, refer as well to the <a href="http://www.legend.ws/blog/tips-tricks/reset-mysql-root-password/">guide on resetting it</a>.</p>
<p>Alternatively, if your database has many users and you didn&#8217;t keep track of them, you can use the following query and it will return usernames that are using the new hash</p>
<blockquote><p>select distinct(User) from User where LENGTH(Password)!=41;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.legend.ws/blog/tips-tricks/mysql-password-hashing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting rid of the ^M characters in vi</title>
		<link>http://www.legend.ws/blog/linux/removing-the-m-character-in-vim/</link>
		<comments>http://www.legend.ws/blog/linux/removing-the-m-character-in-vim/#comments</comments>
		<pubDate>Thu, 01 Jan 2009 18:53:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.legend.ws/blog/?p=29</guid>
		<description><![CDATA[If you&#8217;re a regular vi user, you may have noticed that some files, when being edited in vi, contain ^M characters at line ends.
This usually happens when you edit a file using certain windows-editors, then transfer it to your *nix machine.
Luckily, it is easily to get rid of this control character. While in vi, execute [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re a regular <a href="http://www.vim.org/">vi</a> user, you may have noticed that some files, when being edited in vi, contain <strong>^M</strong> characters at line ends.</p>
<p>This usually happens when you edit a file using certain windows-editors, then transfer it to your *nix machine.<br />
Luckily, it is easily to get rid of this control character. While in vi, execute the following command:</p>
<blockquote><p>:1,$s/<strong>^M</strong>//g</p></blockquote>
<p>Important note: do not manually type a caret then the capital M character. Actually, in order to type <strong>^M</strong>, press CTRL+V followed by CTRL+M.</p>
<p>A quick note:  the above command will look for the <strong>^M</strong> character starting on line <strong>1</strong>, replacing it (<strong>$s</strong>) with nothing (thus having the two consecutive forward slashes / with nothing in between). And this replacement is done globally (<strong>g</strong>).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.legend.ws/blog/linux/removing-the-m-character-in-vim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Chrome tips</title>
		<link>http://www.legend.ws/blog/tips-tricks/google-chrome-tips/</link>
		<comments>http://www.legend.ws/blog/tips-tricks/google-chrome-tips/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 13:09:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Search Engines]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.legend.ws/blog/?p=53</guid>
		<description><![CDATA[Useful keyboard shortcuts:

CTRL+T: Open new tab
CTRL+W: Close tab
CTRL+N: New window
CTRL+U: View page&#8217;s source code
CTRL+J: File download history
CTRL+SHIFT+N: Incognito window (no traces in the browser history or cookies)
SHIFT+ESCAPE: Google Chrome&#8217;s Task Manager (can kill tabs, etc)
CTRL+E or CTRL+K: perform a Google search for term(s) you provide
CTRL+TAB: Browse through tabs (forwards)
CTRL+SHIFT+TAB: Browse through tabs (backward)
CTRL+D: Bookmark current [...]]]></description>
			<content:encoded><![CDATA[<p>Useful keyboard shortcuts:</p>
<ul>
<li><span style="color: #0000ff;"><strong>CTRL+T</strong></span>: Open new tab</li>
<li><span style="color: #0000ff;"><strong>CTRL+W</strong></span>: Close tab</li>
<li><span style="color: #0000ff;"><strong>CTRL+N</strong></span>: New window</li>
<li><span style="color: #0000ff;"><strong>CTRL+U</strong></span>: View page&#8217;s source code</li>
<li><span style="color: #0000ff;"><strong>CTRL+J</strong></span>: File download history</li>
<li><span style="color: #0000ff;"><strong>CTRL+SHIFT+N</strong></span>: Incognito window (no traces in the browser history or cookies)</li>
<li><span style="color: #0000ff;"><strong>SHIFT+ESCAPE</strong></span>: Google Chrome&#8217;s Task Manager (can kill tabs, etc)</li>
<li><span style="color: #0000ff;"><strong>CTRL+E</strong></span> or <span style="color: #0000ff;"><strong>CTRL+K</strong></span>: perform a Google search for term(s) you provide</li>
<li><span style="color: #0000ff;"><strong>CTRL+TAB</strong></span>: Browse through tabs (forwards)</li>
<li><span style="color: #0000ff;"><strong>CTRL+SHIFT+TAB</strong></span>: Browse through tabs (backward)</li>
<li><span style="color: #0000ff;"><strong>CTRL+D</strong></span>: Bookmark current page</li>
<li><span style="color: #0000ff;"><strong>CTRL+F</strong></span> or <span style="color: #0000ff;"><strong>F3</strong></span> or <strong><span style="color: #0000ff;">CTRL+G</span>:</strong> Search current page &amp; highlight search terms (you can move through term occurences by using CTRL+G (forward) or CTRL+SHIFT+G (backward))</li>
<li><span style="color: #0000ff;"><strong>CTRL+H</strong></span>: View history</li>
<li><span style="color: #0000ff;"><strong>CTRL+R:</strong></span> Refresh</li>
<li><span style="color: #0000ff;"><strong>CTRL+L</strong></span>: Highlight address bar</li>
<li><span style="color: #0000ff;"><strong>CTRL+B</strong></span>: Show/hide bookmarks bar</li>
<li><span style="color: #0000ff;"><strong>CTRL+SHIFT+J</strong></span>: Code inspector</li>
<li><span style="color: #0000ff;"><strong>CTRL+SHIFT+L</strong></span>: JavaScript debugger</li>
<li><span style="color: #0000ff;"><strong>CTRL+SHIFT+B</strong></span>: Bookmark manager</li>
<li><span style="color: #0000ff;"><strong>CTRL+(+)</strong></span> / <span style="color: #0000ff;"><strong>CTRL+(-)</strong></span>: Increase / decrease font size</li>
<li><span style="color: #0000ff;"><strong>CTRL+5</strong></span>: Takes you to the 5th tab directly (replace 5 but your desired tab number)</li>
<li><span style="color: #0000ff;"><strong>ALT+Home</strong></span>: Opens the Chrome &#8216;home&#8217; page in a new tab</li>
</ul>
<p>To view some useful browser-recorded data, type one of the following in the address bar:</p>
<blockquote><p><strong>about:stats</strong> (counters/timers)<br />
<strong>about:histograms</strong><br />
<strong>about:cache</strong> (what the browser has stored in its cache)<br />
<strong>about:memory</strong> (useful to see which tab/window is consuming most memory)<br />
<strong>about:dns</strong> (domain name resolution related data)<br />
<strong>about:network</strong> (VERY useful. For instance, if some tabs are loading content, you can track what pages, files are being fetched)</p></blockquote>
<p>- You may jump backward (or forward) through the tab&#8217;s history by holding down the backward (or forward) arrow on the address bar.<br />
In other terms, you can view the previous URLs a tab has been through and chose one of them, instead of looping sequentially (clicking the back button several times)</p>
<p>- You may perform simple mathematical calculations without opening your calculator! Simply, type it in the address bar. e.g. typing 21.5 / 3.2 (with spaces) would yield the 6.71875 result WITHOUT havint to press RETURN/ENTER.<br />
<img class="alignnone size-full wp-image-61" title="chrome-math" src="http://www.legend.ws/blog/wp-content/uploads/2008/12/chrome-math.png" alt="chrome-math" width="367" height="113" /><br />
You could use this same method to do conversions. e.g. typing &#8216;43 miles in km&#8217; and waiting for a second would return  69.201 miles. Quite neat.<br />
<img class="alignnone size-full wp-image-66" title="chrome-math2" src="http://www.legend.ws/blog/wp-content/uploads/2008/12/chrome-math2.png" alt="chrome-math2" width="411" height="115" /></p>
<p>- You may resize text areas you stumble upon on web pages. Simply, click and hold the bottom right corner of the box and voila!<br />
<img class="alignnone size-full wp-image-69" title="chrome-textarea" src="http://www.legend.ws/blog/wp-content/uploads/2009/12/chrome-textarea.png" alt="chrome-textarea" width="203" height="88" /></p>
<p>- You may detach a tab by dragging it into your Desktop. This will change this tab into a brand new Chrome window!<br />
Alternatively, you may &#8216;attach&#8217; a tab to another Google chrome window by dragging it from one window to another.<br />
In other words, if you have 2 Google Chrome windows open, you may move a tab from the first instance to the second.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.legend.ws/blog/tips-tricks/google-chrome-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up MySQL database replication</title>
		<link>http://www.legend.ws/blog/tips-tricks/mysql-database-replication/</link>
		<comments>http://www.legend.ws/blog/tips-tricks/mysql-database-replication/#comments</comments>
		<pubDate>Mon, 15 Sep 2008 18:50:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.legend.ws/blog/tips-tricks/mysql-database-replication/</guid>
		<description><![CDATA[It&#8217;s always about data. What&#8217;s the use of any system without the data it relies on?
Setting up a database replication is one of many steps that should be taken in order to preserve data, preventing any loss and making disaster recovery easier.
Luckily, it&#8217;s easy with MySQL. So let&#8217;s suppose we have two servers running MySQL, [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s always about data. What&#8217;s the use of any system without the data it relies on?</p>
<p>Setting up a database replication is one of many steps that should be taken in order to preserve data, preventing any loss and making disaster recovery easier.</p>
<p>Luckily, it&#8217;s easy with MySQL. So let&#8217;s suppose we have two servers running MySQL, one called host1 and the other host2.<br />
Replication can be either master-master or master-slave. With a master-slave replication, the slave always replicates what the master database is executing. In master-master replication, both databases synchronize with each others.</p>
<p>For the purpose of this tutorial, a master-slave (here host1 and host2 respectively) scenario is examined.</p>
<p>First of all, open the mysql config file on host1 (usually found at /etc/my.cnf on linux, and c:\windows\my.ini on windows), and uncomment (remove the hash of) the following line:</p>
<blockquote><p>#skip-networking</p></blockquote>
<p>Secondly, you need to specify the file where the master (host1) should log (write) the queries it&#8217;s executing. This will enable the slave (host2) to read these queries and execute them as well. As such, add a line such as:</p>
<blockquote><p>log-bin = /path/to/mysql-bin.log</p></blockquote>
<p>where the value above is the path to file where MySQL should be doing the logging. You could very well create a separate directory or use the default mysql installation directory (such as c:\program files\mysql\ on windows or /var/lib/mysql on linux)</p>
<p>Then, you need to specify the name of the database in question. So if you&#8217;re setting up replication for one of your MySQL databases called &#8216;work_data&#8217;, then, this is the line you need to add to your MySQL config:</p>
<blockquote><p>binlog-do-db = work_data</p></blockquote>
<p>Finally, you need to specify a server id, which says that this is the master server</p>
<blockquote><p>server-id=1</p></blockquote>
<p>Save the config file and exit.<br />
Now you need to give host2 the permission to replicate the data. As such, a MySQL query needs to be issued on the master.</p>
<p>So on host1, login to the MySQL prompt (mysql -u root -pyour_root_password) (or PHPMyAdmin, etc&#8230; whatever you use), and issue the following statement:</p>
<blockquote><p>grant replication slave on *.* to &#8216;username&#8217;@'%&#8217; identified by &#8216;password&#8217;;</p></blockquote>
<p>Make sure to replace username and password with a credential of your choice. Do keep the single quotes though.<br />
The % sign means that the slave can connect from any host. If you want it to be more secure, replace that with host2 (the slave&#8217;s hostname).</p>
<p>After all the above is done, restart the MySQL service (service mysqld restart (linux) or, net stop mysql, net start mysql (on windows)).</p>
<p>If the database had data earlier, make sure you dump it and load it on the slave before doing any of the above. Dumping data is easy and can be done by cd&#8217;ing to the MySQL bin directory and issuing:</p>
<blockquote><p>mysqldump -Q -u root -pyour_root_password databasename > database_dump.sql</p></blockquote>
<p>(replace the password and database name with the correct login). The whole database will now be in the file called database_dump.sql</p>
<p>To import it on host2, cd to the mysql bin directory and issue:</p>
<blockquote><p>mysql -u root -pyour_root_password databasename < /path/to/the/file/database_dump.sql</p></blockquote>
<p>The MySQL config file on host2 should have the following lines:
</p></blockquote>
<blockquote><p>server-id=2<br />
master-host = host1<br />
master-user = username<br />
master-password = password<br />
master-port = 3306</p></blockquote>
<p>where host1 is the master&#8217;s hostname/IP, and username and password are the credentials you used when granting replication access a few steps above. 3306 is the port MySQL is running on (which is the default)</p>
<p>Then start the slave process on host2 by issuing at the MySQL prompt:</p>
<blockquote><p>start slave;</p></blockquote>
<p>To make sure replication is working, issue the following SQL query on host1:</p>
<blockquote><p>show slave status \G</p></blockquote>
<p>(Slave_SQL_Running and Slave_IO_Running should report &#8216;Yes&#8217;)</p>
<p>Good luck</p>
]]></content:encoded>
			<wfw:commentRss>http://www.legend.ws/blog/tips-tricks/mysql-database-replication/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
