<?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>i.justrealized &#187; Code</title>
	<atom:link href="http://i.justrealized.com/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://i.justrealized.com</link>
	<description>All things observable</description>
	<lastBuildDate>Mon, 15 Mar 2010 17:59:52 +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>NetBeans 6.8 released</title>
		<link>http://i.justrealized.com/2009/12/19/netbeans-6-8-released/</link>
		<comments>http://i.justrealized.com/2009/12/19/netbeans-6-8-released/#comments</comments>
		<pubDate>Sat, 19 Dec 2009 14:26:24 +0000</pubDate>
		<dc:creator>KahWee</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[ide]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[release]]></category>

		<guid isPermaLink="false">http://i.justrealized.com/?p=2732</guid>
		<description><![CDATA[As possibly the only NetBeans users coding in PHP in Singapore, I would like to announce in a somewhat lonely fashion that NetBeans 6.8 has been released. Despite being ridiculed for the past two years [insert laughter]  for my unusual support for coding PHP with NetBeans IDE, I can never get used to something [...]]]></description>
			<content:encoded><![CDATA[<p>As possibly the only NetBeans users coding in PHP in Singapore, I would like to announce in a somewhat lonely fashion that NetBeans 6.8 has been released. Despite being ridiculed for the past two years <em>[insert laughter] </em> for my unusual support for coding PHP with NetBeans IDE, I can never get used to something other than NetBeans so there&#8217;s probably something NetBeans did right after all.</p>
<p>If you&#8217;re on NetBeans 6.7, I urge you to upgrade. If you aren&#8217;t a NetBeans user, do give NetBeans a chance. It&#8217;s (probably) slower and Java-ish but the excellent code completion support more than made up for it. Oh yeah, and it&#8217;s free too.</p>
<p><a href="http://netbeans.org/downloads/index.html">Try NetBeans 6.8</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://i.justrealized.com/2009/12/19/netbeans-6-8-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Richard Stallman will code for foot</title>
		<link>http://i.justrealized.com/2009/12/16/richard-stallman-will-code-for-foot/</link>
		<comments>http://i.justrealized.com/2009/12/16/richard-stallman-will-code-for-foot/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 07:46:04 +0000</pubDate>
		<dc:creator>KahWee</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[disgusting]]></category>
		<category><![CDATA[ewww]]></category>
		<category><![CDATA[food]]></category>
		<category><![CDATA[hungry]]></category>
		<category><![CDATA[richard stallman]]></category>

		<guid isPermaLink="false">http://i.justrealized.com/?p=2725</guid>
		<description><![CDATA[Opensource hero Richard Stallman gets hungry and will code for foot:
Richard Stallman Eats Something From His Foot

During a lecture Q&#038;A session Richard Stallman appears to pick something off his foot or toe, places it in his mouth and chews on it. Disgusting!
]]></description>
			<content:encoded><![CDATA[<p>Opensource hero Richard Stallman gets hungry and will code for foot:</p>
<h3>Richard Stallman Eats Something From His Foot</h3>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/I25UeVXrEHQ&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/I25UeVXrEHQ&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>During a lecture Q&#038;A session Richard Stallman appears to pick something off his foot or toe, places it in his mouth and chews on it. Disgusting!</p>
]]></content:encoded>
			<wfw:commentRss>http://i.justrealized.com/2009/12/16/richard-stallman-will-code-for-foot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google now does DNS resolving too</title>
		<link>http://i.justrealized.com/2009/12/04/google-dns-resolver/</link>
		<comments>http://i.justrealized.com/2009/12/04/google-dns-resolver/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 21:34:00 +0000</pubDate>
		<dc:creator>KahWee</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://i.justrealized.com/?p=2710</guid>
		<description><![CDATA[Google now does DNS resolving too. You can switch if you&#8217;re using OpenDNS.
Introducing Google Public DNS: A new DNS resolver from Google
Today, as part of our efforts to make the web faster, we are announcing Google Public DNS, a new experimental public DNS resolver.
The DNS protocol is an important part of the web&#8217;s infrastructure, serving [...]]]></description>
			<content:encoded><![CDATA[<p>Google now does DNS resolving too. You can switch if you&#8217;re using OpenDNS.</p>
<blockquote><h3>Introducing Google Public DNS: A new DNS resolver from Google</h3>
<p>Today, as part of our efforts to make the web faster, we are announcing Google Public DNS, a new experimental public DNS resolver.</p>
<p>The DNS protocol is an important part of the web&#8217;s infrastructure, serving as the Internet&#8217;s &#8220;phone book&#8221;. Every time you visit a website, your computer performs a DNS lookup. Complex pages often require multiple DNS lookups before they complete loading. As a result, the average Internet user performs hundreds of DNS lookups each day, that collectively can slow down his or her browsing experience.</p>
<ul>
<li>Speed: Resolver-side cache misses are one of the primary contributors to sluggish DNS responses. Clever caching techniques can help increase the speed of these responses. Google Public DNS implements prefetching: before the TTL on a record expires, we refresh the record continuously, asychronously and independently of user requests for a large number of popular domains. This allows Google Public DNS to serve many DNS requests in the round trip time it takes a packet to travel to our servers and back.</li>
<li>Security: DNS is vulnerable to spoofing attacks that can poison the cache of a nameserver and can route all its users to a malicious website. Until new protocols like <a href="http://www.dnssec.net/">DNSSEC</a> get widely adopted, resolvers need to take additional measures to keep their caches secure. Google Public DNS makes it more difficult for attackers to spoof valid responses by randomizing the case of query names and including additional data in its DNS messages.</li>
<li>Validity: Google Public DNS complies with the DNS standards and gives the user the exact response his or her computer expects without performing any blocking, filtering, or redirection that may hamper a user&#8217;s browsing experience.</li>
</ul>
<p>(Source: <a href="http://googlecode.blogspot.com/2009/12/introducing-google-public-dns-new-dns.html">Google</a>)</p></blockquote>
<p>Just use the following name servers:</p>
<div class="codesnip-container" >
<div class="bash codesnip" style="font-family:monospace;">nameserver 8.8.8.8<br />
nameserver 8.8.4.4</div>
</div>
<p>Nice numbers. They got those from Level 3.</p>
]]></content:encoded>
			<wfw:commentRss>http://i.justrealized.com/2009/12/04/google-dns-resolver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Price evaluation of Amazon EC2</title>
		<link>http://i.justrealized.com/2009/12/03/price-evaluation-of-amazon-ec2/</link>
		<comments>http://i.justrealized.com/2009/12/03/price-evaluation-of-amazon-ec2/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 12:41:50 +0000</pubDate>
		<dc:creator>KahWee</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[cloud computing]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[evaluation]]></category>
		<category><![CDATA[price]]></category>
		<category><![CDATA[rackspace cloud]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[slicehost]]></category>

		<guid isPermaLink="false">http://i.justrealized.com/?p=2701</guid>
		<description><![CDATA[I&#8217;ve been looking at the pricing of Amazon EC2 (Amazon Elastic Compute Cloud) running as if it were a VPS. I intend to run it continuously for as long as possible. I likely only need a small instance as described here.
Specification of EC2 Small Instance

1.7 GB memory
1 EC2 Compute Unit (1 virtual core with 1 EC2 Compute [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been looking at the pricing of Amazon EC2 (Amazon Elastic Compute Cloud) running as if it were a VPS. I intend to run it continuously for as long as possible. I likely only need a small instance as described <a href="http://aws.amazon.com/ec2/instance-types/" target="_blank">here</a>.</p>
<h3>Specification of EC2 Small Instance</h3>
<ul>
<li>1.7 GB memory</li>
<li>1 EC2 Compute Unit (1 virtual core with 1 EC2 Compute Unit)</li>
<li>160 GB instance storage (150 GB plus 10 GB root partition)</li>
<li>32-bit platform</li>
<li>I/O Performance: Moderate</li>
</ul>
<p>These are some notes I have made for Amazon EC2. All prices are in US dollar and does not include bandwidth costs as those are far too varying.</p>
<p>I only need the smallest Linux/UNIX instance and the pricing is $0.085 / hour for a server instance in North Virginia, USA without reserving an instance. <a target="_blank" href="http://i.justrealized.com/2009/12/03/amazon-web-services-expands-to-singapore/">(There&#8217;s going to be one in Singapore next year.)</a></p>
<p>I can choose to reserve the server instance for 1 or 3 years and pay $227.50 or $350 respectively and pay for $0.03 / hour for a similar instance.</p>
<p>To put the cost into perspective:</p>
<h3>For 1 year</h3>
<ul>
<li><strong>Without reserved instance</strong>: $0.085 * 24 * 365 = $744.60 ($62.05 / month)</li>
<li><strong>With reserved instance</strong>: $0.03 * 24 * 365+ $227.50 = $490.30 (~$40.86 / month)</li>
<li><strong>Percentage saving after 1 year</strong>: (744.60 &#8211; 490.30) / 744.60 = ~34.1%</li>
</ul>
<h3>For 3 years</h3>
<ul>
<li><strong>Without reserved instance</strong>: $0.085 * 24 * 365 * 3 = $2233.80 ($62.05/ month)</li>
<li><strong>With reserved instance</strong>: $0.03 * 24 * 365 * 3 + $350 = $1138.40 (~$31.62 / month)</li>
<li><strong>Percentage saving after 3 years</strong>: (2233.80 &#8211; 1138.40) / 2233.80 = ~49.0%</li>
</ul>
<p>I&#8217;m currently on Slicehost and Rackspace Cloud. They&#8217;ve been pretty good so far but Amazon&#8217;s cloud computing offering is beginning to look quite tempting.</p>
]]></content:encoded>
			<wfw:commentRss>http://i.justrealized.com/2009/12/03/price-evaluation-of-amazon-ec2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Amazon Web Services expands to Singapore</title>
		<link>http://i.justrealized.com/2009/12/03/amazon-web-services-expands-to-singapore/</link>
		<comments>http://i.justrealized.com/2009/12/03/amazon-web-services-expands-to-singapore/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 02:14:53 +0000</pubDate>
		<dc:creator>KahWee</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[cloud computing]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[price]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://i.justrealized.com/?p=2707</guid>
		<description><![CDATA[This isn&#8217;t exactly the latest news but &#8212; Amazon Web Services expands to Singapore. Expansion to Singapore would keep Singapore web hosting prices a lot more competitive. Amazon is bringing to Singapore:

Amazon Elastic Compute Cloud (Amazon EC2),
Amazon Simple Storage Service (Amazon S3),
Amazon SimpleDB,
Amazon Relational Database Service (Amazon RDS),
Amazon Simple Queue Service (Amazon SQS),
Amazon Elastic MapReduce,
Amazon [...]]]></description>
			<content:encoded><![CDATA[<p>This isn&#8217;t exactly the latest news but &#8212; Amazon Web Services expands to Singapore. Expansion to Singapore would keep Singapore web hosting prices a lot more competitive. Amazon is bringing to Singapore:</p>
<ul>
<li>Amazon Elastic Compute Cloud (Amazon EC2),</li>
<li>Amazon Simple Storage Service (Amazon S3),</li>
<li>Amazon SimpleDB,</li>
<li>Amazon Relational Database Service (Amazon RDS),</li>
<li>Amazon Simple Queue Service (Amazon SQS),</li>
<li>Amazon Elastic MapReduce,</li>
<li>Amazon CloudFront.</li>
</ul>
<p>Yes EC2 is coming to Singapore over the second half of 2010. I am considering migrating some stuff over to Amazon due to its pricing.</p>
<blockquote>
<h3>Amazon Web Services Announces Expansion into Asia in the First Half of 2010</h3>
<p>Amazon Web Services LLC, an Amazon.com company (NASDAQ:AMZN), today announced an expansion of its services into an Asia-Pacific region in the first half of 2010, enabling businesses to deploy compute and storage resources in close proximity to their end-users in the region. Software developers and businesses will be able to access AWS’s infrastructure services from multiple Availability Zones in Singapore in the first half of 2010, then in other Availability Zones within Asia over the second half of 2010. AWS services available at the launch of the Asia-Pacific region will include Amazon Elastic Compute Cloud (Amazon EC2), Amazon Simple Storage Service (Amazon S3), Amazon SimpleDB, Amazon Relational Database Service (Amazon RDS), Amazon Simple Queue Service (Amazon SQS), Amazon Elastic MapReduce, and Amazon CloudFront. (Source: <a href="http://phx.corporate-ir.net/phoenix.zhtml?c=176060&#038;p=irol-newsArticle&#038;ID=1354553&#038;highlight=">Amazon</a>)</p></blockquote>
<p>Amazon has yet to release the pricing for Singapore but I&#8217;m guessing it would cost about USD0.20 per hour. Hosting hasn&#8217;t been that cheap in Singapore currently. If they charge less than USD$0.14 per hour for a small Linux EC2 instance, I would start advocating people to switch. Currently in US, Amazon charges USD$0.085 per hour. VPS hosting in Singapore is still kinda expensive for whatever reasons. Running a website really shouldn&#8217;t be that costly.</p>
]]></content:encoded>
			<wfw:commentRss>http://i.justrealized.com/2009/12/03/amazon-web-services-expands-to-singapore/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to log slow MySQL queries</title>
		<link>http://i.justrealized.com/2009/11/22/how-to-log-slow-mysql-queries/</link>
		<comments>http://i.justrealized.com/2009/11/22/how-to-log-slow-mysql-queries/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 13:13:53 +0000</pubDate>
		<dc:creator>KahWee</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[speed]]></category>

		<guid isPermaLink="false">http://i.justrealized.com/?p=2691</guid>
		<description><![CDATA[I haven&#8217;t been generous enough to spend money on higher RAM for my blogs. I started to notice slow downs in the blog recent, particularly caused by a particular plugin that does related posts. I found out by checking on slow queries log. Here&#8217;s how to get MySQL to log slow queries:
If you are using [...]]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t been generous enough to spend money on higher RAM for my blogs. I started to notice slow downs in the blog recent, particularly caused by a particular plugin that does related posts. I found out by checking on slow queries log. Here&#8217;s how to get MySQL to log slow queries:</p>
<p>If you are using Ubuntu of Debian-based operating systems, it&#8217;s found in /etc/mysql/my.cnf. You may need to use</p>
<div class="codesnip-container" >
<div class="bash codesnip" style="font-family:monospace;"><span class="kw2">sudo</span> <span class="kw2">nano</span> <span class="sy0">/</span>etc<span class="sy0">/</span>mysql<span class="sy0">/</span>my.cnf</div>
</div>
<p>Press CTRL + W, that&#8217;s search in nano. Find &#8220;slow&#8221; for the section for logging slow queries.</p>
<div class="codesnip-container" >
<div class="bash codesnip" style="font-family:monospace;"><span class="co0"># Here you can see queries with especially long duration</span><br />
<span class="co0">#log_slow_queries &nbsp; &nbsp; &nbsp; &nbsp;= /var/log/mysql/mysql-slow.log</span><br />
<span class="co0">#long_query_time = 2</span><br />
<span class="co0">#log-queries-not-using-indexes</span></div>
</div>
<p>I uncommented &#8220;log_slow_queries&#8221; and &#8220;long_query_time&#8221;. I put long_query_time to 8. That requires a bit of experimentation. It depends on your environment.</p>
<p>I run the following command to check the slow queries:</p>
<div class="codesnip-container" >
<div class="bash codesnip" style="font-family:monospace;"><span class="kw2">sudo</span> <span class="kw2">cat</span> <span class="sy0">/</span>var<span class="sy0">/</span>log<span class="sy0">/</span>mysql<span class="sy0">/</span>mysql-slow.log</div>
</div>
<p>After you change the configuration in my.cnf, you need to restart. You can do so using:</p>
<div class="codesnip-container" >
<div class="bash codesnip" style="font-family:monospace;"><span class="kw2">sudo</span> <span class="sy0">/</span>etc<span class="sy0">/</span>init.d<span class="sy0">/</span>mysql restart</div>
</div>
<p>Hope it helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://i.justrealized.com/2009/11/22/how-to-log-slow-mysql-queries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Addons.Mozilla.org to move from CakePHP to Django</title>
		<link>http://i.justrealized.com/2009/11/18/addons-mozilla-org-to-move-from-cakephp-to-django/</link>
		<comments>http://i.justrealized.com/2009/11/18/addons-mozilla-org-to-move-from-cakephp-to-django/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 11:45:06 +0000</pubDate>
		<dc:creator>KahWee</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[mozilla]]></category>

		<guid isPermaLink="false">http://i.justrealized.com/?p=2683</guid>
		<description><![CDATA[Addons.Mozilla.org is currently using CakePHP but they will no longer in 2010. They decided to adopt Django. (Source: Micropipes.com)
]]></description>
			<content:encoded><![CDATA[<p><a href="https://addons.mozilla.org/en-US/firefox/">Addons.Mozilla.org</a> is currently using CakePHP but they will no longer in 2010. They decided to adopt Django. (Source: <a href="http://micropipes.com/blog/2009/11/17/amo-development-changes-in-2010/">Micropipes.com</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://i.justrealized.com/2009/11/18/addons-mozilla-org-to-move-from-cakephp-to-django/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to know which processes uses the most resources</title>
		<link>http://i.justrealized.com/2009/11/11/how-to-know-which-processes-uses-the-most-resources/</link>
		<comments>http://i.justrealized.com/2009/11/11/how-to-know-which-processes-uses-the-most-resources/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 12:52:20 +0000</pubDate>
		<dc:creator>KahWee</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[resource]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://i.justrealized.com/?p=2667</guid>
		<description><![CDATA[There are times where some processes use too much resources. You can use &#8220;ps aux&#8221; to get a list of all the processes that are currently running. But what about having them sorted? Here is one way. This works in Ubuntu Linux.
Top 10 % CPU usage

ps aux&#124;sort -nr -k3&#124;grep -v USER&#124;head -10

Top 10 % Memory [...]]]></description>
			<content:encoded><![CDATA[<p>There are times where some processes use too much resources. You can use &#8220;ps aux&#8221; to get a list of all the processes that are currently running. But what about having them sorted? Here is one way. This works in Ubuntu Linux.</p>
<h3>Top 10 % CPU usage</h3>
<div class="codesnip-container" >
<div class="bash codesnip" style="font-family:monospace;"><span class="kw2">ps</span> aux<span class="sy0">|</span><span class="kw2">sort</span> <span class="re5">-nr</span> -k3<span class="sy0">|</span><span class="kw2">grep</span> <span class="re5">-v</span> USER<span class="sy0">|</span><span class="kw2">head</span> <span class="re5">-10</span></div>
</div>
<h3>Top 10 % Memory usage</h3>
<div class="codesnip-container" >
<div class="bash codesnip" style="font-family:monospace;"><span class="kw2">ps</span> aux<span class="sy0">|</span><span class="kw2">sort</span> <span class="re5">-nr</span> -k4<span class="sy0">|</span><span class="kw2">grep</span> <span class="re5">-v</span> USER<span class="sy0">|</span><span class="kw2">head</span> <span class="re5">-10</span></div>
</div>
<p>The following is the sample output for Top 10 % memory usage:</p>
<div class="codesnip-container" >
<div class="bash codesnip" style="font-family:monospace;">briecheese ~: <span class="kw2">ps</span> aux<span class="sy0">|</span><span class="kw2">sort</span> <span class="re5">-nr</span> -k4<span class="sy0">|</span><span class="kw2">grep</span> <span class="re5">-v</span> USER<span class="sy0">|</span><span class="kw2">head</span> <span class="re5">-10</span><br />
www-data &nbsp;3883 &nbsp;2.9 14.1 107052 37176 ? &nbsp; &nbsp; &nbsp; &nbsp;S &nbsp; &nbsp;11:44 &nbsp; 1:46 <span class="sy0">/</span>usr<span class="sy0">/</span>bin<span class="sy0">/</span>php-cgi<br />
www-data &nbsp;3882 &nbsp;2.9 13.8 107664 36264 ? &nbsp; &nbsp; &nbsp; &nbsp;S &nbsp; &nbsp;11:44 &nbsp; 1:46 <span class="sy0">/</span>usr<span class="sy0">/</span>bin<span class="sy0">/</span>php-cgi<br />
www-data &nbsp;3881 &nbsp;1.2 13.2 106768 34688 ? &nbsp; &nbsp; &nbsp; &nbsp;S &nbsp; &nbsp;11:44 &nbsp; 0:44 <span class="sy0">/</span>usr<span class="sy0">/</span>bin<span class="sy0">/</span>php-cgi<br />
www-data &nbsp;3884 &nbsp;3.1 13.1 107244 34592 ? &nbsp; &nbsp; &nbsp; &nbsp;S &nbsp; &nbsp;11:44 &nbsp; 1:54 <span class="sy0">/</span>usr<span class="sy0">/</span>bin<span class="sy0">/</span>php-cgi<br />
www-data &nbsp;3879 &nbsp;1.1 11.8 106888 31160 ? &nbsp; &nbsp; &nbsp; &nbsp;S &nbsp; &nbsp;11:44 &nbsp; 0:40 <span class="sy0">/</span>usr<span class="sy0">/</span>bin<span class="sy0">/</span>php-cgi<br />
www-data &nbsp;3880 &nbsp;0.9 &nbsp;9.5 &nbsp;94232 25092 ? &nbsp; &nbsp; &nbsp; &nbsp;S &nbsp; &nbsp;11:44 &nbsp; 0:34 <span class="sy0">/</span>usr<span class="sy0">/</span>bin<span class="sy0">/</span>php-cgi<br />
mysql &nbsp; &nbsp; 3659 &nbsp;3.5 &nbsp;6.9 277256 18200 ? &nbsp; &nbsp; &nbsp; &nbsp;Sl &nbsp; 09:45 &nbsp; 6:25 <span class="sy0">/</span>usr<span class="sy0">/</span>sbin<span class="sy0">/</span>mysqld <span class="re5">&#8211;basedir</span>=<span class="sy0">/</span>usr <span class="re5">&#8211;datadir</span>=<span class="sy0">/</span>var<span class="sy0">/</span>lib<span class="sy0">/</span>mysql <span class="re5">&#8211;user</span>=mysql <span class="re5">&#8211;pid-file</span>=<span class="sy0">/</span>var<span class="sy0">/</span>run<span class="sy0">/</span>mysqld<span class="sy0">/</span>mysqld.pid <span class="re5">&#8211;skip-external-locking</span> <span class="re5">&#8211;port</span>=3306 <span class="re5">&#8211;socket</span>=<span class="sy0">/</span>var<span class="sy0">/</span>run<span class="sy0">/</span>mysqld<span class="sy0">/</span>mysqld.sock<br />
root &nbsp; &nbsp; &nbsp;4103 &nbsp;0.2 &nbsp;1.0 &nbsp;53468 &nbsp;2704 ? &nbsp; &nbsp; &nbsp; &nbsp;Ss &nbsp; 12:44 &nbsp; 0:00 sshd: me <span class="br0">&#91;</span>priv<span class="br0">&#93;</span><br />
me &nbsp; &nbsp;4106 &nbsp;0.0 &nbsp;0.8 &nbsp;18128 &nbsp;2116 pts<span class="sy0">/</span>0 &nbsp; &nbsp;Ss &nbsp; 12:44 &nbsp; 0:00 <span class="re5">-bash</span><br />
www-data &nbsp;3875 &nbsp;0.0 &nbsp;0.7 &nbsp;57440 &nbsp;1972 ? &nbsp; &nbsp; &nbsp; &nbsp;S &nbsp; &nbsp;11:44 &nbsp; 0:00 <span class="sy0">/</span>usr<span class="sy0">/</span>sbin<span class="sy0">/</span>lighttpd <span class="re5">-f</span> <span class="sy0">/</span>etc<span class="sy0">/</span>lighttpd<span class="sy0">/</span>lighttpd.conf</div>
</div>
<p>Percentage memory usage is the 4th column. This is useful when you need a quick overview of what&#8217;s consuming the most memory. [Thanks <a href="http://uzyn.com">U-Zyn</a>]</p>
]]></content:encoded>
			<wfw:commentRss>http://i.justrealized.com/2009/11/11/how-to-know-which-processes-uses-the-most-resources/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to repair MySQL tables</title>
		<link>http://i.justrealized.com/2009/11/11/how-to-repair-mysql-tables/</link>
		<comments>http://i.justrealized.com/2009/11/11/how-to-repair-mysql-tables/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 11:54:35 +0000</pubDate>
		<dc:creator>KahWee</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[corruption]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[repair]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://i.justrealized.com/?p=2657</guid>
		<description><![CDATA[There are generally 2 ways of repairing MySQL tables using the command line. First is to use &#8220;mysqlcheck&#8220;, the other is to use &#8220;myisamchk&#8221; (only for MyISAM). This is more for my own information.
This has been tested on Ubuntu 9.10 with MySQL 5
mysqlcheck
This is how you can check if your database tables are fine:

mysqlcheck -uUsername [...]]]></description>
			<content:encoded><![CDATA[<p>There are generally 2 ways of repairing MySQL tables using the command line. First is to use &#8220;<a href="http://dev.mysql.com/doc/refman/5.0/en/mysqlcheck.html" target="_blank">mysqlcheck</a>&#8220;, the other is to use &#8220;<a href="http://dev.mysql.com/doc/refman/5.0/en/myisamchk.html" target="_blank">myisamchk</a>&#8221; (only for MyISAM). This is more for my own information.</p>
<p>This has been tested on Ubuntu 9.10 with MySQL 5</p>
<h3>mysqlcheck</h3>
<p>This is how you can check if your database tables are fine:</p>
<div class="codesnip-container" >
<div class="bash codesnip" style="font-family:monospace;">mysqlcheck <span class="re5">-uUsername</span> <span class="re5">-pSecret</span> <span class="re5">&#8211;all-databases</span></div>
</div>
<p>Change &#8220;Username&#8221; to your username and &#8220;Secret&#8221; to your password.</p>
<p>To repair them, use:</p>
<div class="codesnip-container" >
<div class="bash codesnip" style="font-family:monospace;">mysqlcheck <span class="re5">-uUsername</span> <span class="re5">-pSecret</span> <span class="re5">&#8211;all-databases</span> <span class="re5">&#8211;auto-repair</span></div>
</div>
<p>This requires of your MySQL daemon to be running. If it isn&#8217;t running use this to start:</p>
<div class="codesnip-container" >
<div class="bash codesnip" style="font-family:monospace;"><span class="kw2">sudo</span> <span class="sy0">/</span>etc<span class="sy0">/</span>init.d<span class="sy0">/</span>mysql start</div>
</div>
<h3>myisamchk</h3>
<p>If you have trouble running &#8216;mysqlcheck&#8217;, you can consider using &#8216;myisamchk&#8217; instead if your tables are MyISAM. This command can be performed without MySQL daemon running. This fixes the data in your file system directly and this has saved me once.</p>
<div class="codesnip-container" >
<div class="bash codesnip" style="font-family:monospace;"><span class="kw2">sudo</span> myisamchk <span class="re5">&#8211;max-record-length</span>=1048576 <span class="re5">-o</span> <span class="re5">-f</span> <span class="sy0">/</span>var<span class="sy0">/</span>lib<span class="sy0">/</span>mysql<span class="sy0">/</span>db_name<span class="sy0">/</span>table_name.MYI</div>
</div>
<p>Change &#8220;db_name&#8221; to your database name and &#8220;table_name&#8221; to the name of the table you wish to repair.</p>
]]></content:encoded>
			<wfw:commentRss>http://i.justrealized.com/2009/11/11/how-to-repair-mysql-tables/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My disk got full</title>
		<link>http://i.justrealized.com/2009/11/11/my-disk-got-full/</link>
		<comments>http://i.justrealized.com/2009/11/11/my-disk-got-full/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 08:53:21 +0000</pubDate>
		<dc:creator>KahWee</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[disk]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://i.justrealized.com/?p=2655</guid>
		<description><![CDATA[I just realized I totally used up my disk space in my slice:

briecheese ~: sudo /etc/init.d/mysql start
&#91;sudo&#93; password for me: 
&#160;* /etc/init.d/mysql: ERROR: The partition with /var/lib/mysql is too full!

It has never occurred to me that this would happen. I start to do some clearing up and delete some backups that I no longer need. [...]]]></description>
			<content:encoded><![CDATA[<p>I just realized I totally used up my disk space in my slice:</p>
<div class="codesnip-container" >
<div class="bash codesnip" style="font-family:monospace;">briecheese ~: <span class="kw2">sudo</span> <span class="sy0">/</span>etc<span class="sy0">/</span>init.d<span class="sy0">/</span>mysql start<br />
<span class="br0">&#91;</span><span class="kw2">sudo</span><span class="br0">&#93;</span> password <span class="kw1">for</span> me: <br />
&nbsp;<span class="sy0">*</span> <span class="sy0">/</span>etc<span class="sy0">/</span>init.d<span class="sy0">/</span>mysql: ERROR: The partition with <span class="sy0">/</span>var<span class="sy0">/</span>lib<span class="sy0">/</span>mysql is too full<span class="sy0">!</span></div>
</div>
<p>It has never occurred to me that this would happen. I start to do some clearing up and delete some backups that I no longer need. </p>
<div class="codesnip-container" >
<div class="bash codesnip" style="font-family:monospace;">briecheese ~<span class="sy0">/</span>www: <span class="kw2">df</span> <span class="re5">-h</span><br />
Filesystem &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Size &nbsp;Used Avail Use<span class="sy0">%</span> Mounted on<br />
<span class="sy0">/</span>dev<span class="sy0">/</span>sda1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 9.4G &nbsp;6.7G &nbsp;2.3G &nbsp;<span class="nu0">75</span><span class="sy0">%</span> <span class="sy0">/</span><br />
varrun &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;129M &nbsp; 40K &nbsp;129M &nbsp; <span class="nu0">1</span><span class="sy0">%</span> <span class="sy0">/</span>var<span class="sy0">/</span>run<br />
varlock &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 129M &nbsp; &nbsp; <span class="nu0">0</span> &nbsp;129M &nbsp; <span class="nu0">0</span><span class="sy0">%</span> <span class="sy0">/</span>var<span class="sy0">/</span>lock<br />
udev &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;129M &nbsp; 16K &nbsp;129M &nbsp; <span class="nu0">1</span><span class="sy0">%</span> <span class="sy0">/</span>dev<br />
devshm &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;129M &nbsp; &nbsp; <span class="nu0">0</span> &nbsp;129M &nbsp; <span class="nu0">0</span><span class="sy0">%</span> <span class="sy0">/</span>dev<span class="sy0">/</span>shm<br />
overflow &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1.0M &nbsp; &nbsp; <span class="nu0">0</span> &nbsp;1.0M &nbsp; <span class="nu0">0</span><span class="sy0">%</span> <span class="sy0">/</span>tmp</div>
</div>
<p>I managed to free more than 2 Gb.</p>
]]></content:encoded>
			<wfw:commentRss>http://i.justrealized.com/2009/11/11/my-disk-got-full/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
