<?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>Random Web Tools</title>
	<atom:link href="http://www.randomtools.net/feed" rel="self" type="application/rss+xml" />
	<link>http://www.randomtools.net</link>
	<description>Advice and tools from a young web developer</description>
	<lastBuildDate>Fri, 13 Jan 2012 01:08:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to install PHP Memcache on Windows WAMP, Linux for any operating system (without really installing)</title>
		<link>http://www.randomtools.net/how-to-install-php-memcache-on-windows-wamp-linux-for-any-operating-system-without-really-installing-231.html</link>
		<comments>http://www.randomtools.net/how-to-install-php-memcache-on-windows-wamp-linux-for-any-operating-system-without-really-installing-231.html#comments</comments>
		<pubDate>Wed, 11 Jan 2012 18:30:50 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[How To's]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=231</guid>
		<description><![CDATA[I have a site that runs on Linux in production that uses Memcache. Installing Memcache on Linux is a cinch. I was setting this site up in my development environment however (Windows 7 64-bit, with WAMP, specifically Apache 2 and PHP 5.3) and I quickly discovered it&#8217;s not so easy. For the life of me, [...]]]></description>
			<content:encoded><![CDATA[<p>I have a site that runs on Linux in production that uses Memcache. Installing Memcache on Linux is a cinch. I was setting this site up in my development environment however (Windows 7 64-bit, with WAMP, specifically Apache 2 and PHP 5.3) and I quickly discovered it&#8217;s not so easy. For the life of me, I could not find the correct php_memcache.dll file.</p>
<p>After spending a ton of time unsuccessfully install Memcache on my local machine, I realized that I don&#8217;t even need the memory caching functionality of Memcache, I just need the functions to work.</p>
<p>After some thought, I decided to just implement the class and functions that Memcache provides. Following is what I came up with. It just uses a specified directory to store cache in serialized files on the hard drive. Obviously it doesn&#8217;t exactly simulate real production Memcache, but it allows you to work from any box without having to install it.</p>
<p>Here&#8217;s what I came up with:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
Fake PHP Memcache class
Use Memcache functions without installing. Useful in development environments.
&nbsp;
Dan Barnett
http://www.randomtools.net/
*/</span>
<span style="color: #000000; font-weight: bold;">class</span> Memcache <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$cache_dir</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'C:/path/to/directory/'</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> close<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> connect<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> pconnect<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">connect</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getVersion<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> get<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #990000;">unserialize</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cache_dir</span> <span style="color: #339933;">.</span> <span style="color: #990000;">md5</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;.txt&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> set<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #339933;">,</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #990000;">file_put_contents</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cache_dir</span> <span style="color: #339933;">.</span> <span style="color: #990000;">md5</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;.txt&quot;</span><span style="color: #339933;">,</span> <span style="color: #990000;">serialize</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #990000;">flush</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">glob</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cache_dir</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'*.txt'</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #990000;">unlink</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> <span style="color: #990000;">memcache_close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> <span style="color: #990000;">memcache_connect</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$memcache</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$memcache</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Memcache<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> <span style="color: #990000;">memcache_pconnect</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #990000;">memcache_connect</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> <span style="color: #990000;">memcache_set</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #339933;">,</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$memcache</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$memcache</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #339933;">,</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> <span style="color: #990000;">memcache_get</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$memcache</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$memcache</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> <span style="color: #990000;">memcache_get_version</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$memcache</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$memcache</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getVersion</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> <span style="color: #990000;">memcache_flush</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$memcache</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$memcache</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">flush</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p></p>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Bookmark this page</div><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://www.randomtools.net/how-to-install-php-memcache-on-windows-wamp-linux-for-any-operating-system-without-really-installing-231.html&amp;title=How to install PHP Memcache on Windows WAMP, Linux for any operating system (without really installing)' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://www.randomtools.net/how-to-install-php-memcache-on-windows-wamp-linux-for-any-operating-system-without-really-installing-231.html&amp;title=How to install PHP Memcache on Windows WAMP, Linux for any operating system (without really installing)' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://www.randomtools.net/how-to-install-php-memcache-on-windows-wamp-linux-for-any-operating-system-without-really-installing-231.html' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.randomtools.net/how-to-install-php-memcache-on-windows-wamp-linux-for-any-operating-system-without-really-installing-231.html&amp;title=How to install PHP Memcache on Windows WAMP, Linux for any operating system (without really installing)' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://www.randomtools.net/how-to-install-php-memcache-on-windows-wamp-linux-for-any-operating-system-without-really-installing-231.html&amp;title=How to install PHP Memcache on Windows WAMP, Linux for any operating system (without really installing)' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://www.randomtools.net/how-to-install-php-memcache-on-windows-wamp-linux-for-any-operating-system-without-really-installing-231.html&amp;title=How to install PHP Memcache on Windows WAMP, Linux for any operating system (without really installing)' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://www.randomtools.net/how-to-install-php-memcache-on-windows-wamp-linux-for-any-operating-system-without-really-installing-231.html&amp;title=How to install PHP Memcache on Windows WAMP, Linux for any operating system (without really installing)' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> </div></div>]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/how-to-install-php-memcache-on-windows-wamp-linux-for-any-operating-system-without-really-installing-231.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Install PHP APC on Fedora &amp; CentOS</title>
		<link>http://www.randomtools.net/how-to-install-php-apc-on-fedora-centos-225.html</link>
		<comments>http://www.randomtools.net/how-to-install-php-apc-on-fedora-centos-225.html#comments</comments>
		<pubDate>Sat, 10 Dec 2011 04:08:55 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[How To's]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=225</guid>
		<description><![CDATA[APC (or Alternate PHP Cache) is a popular PHP PECL extension that can be used for PHP op-code caching. It is very stable and can significantly reduce page rendering times. It works by caching the PHP binaries, so that PHP doesn&#8217;t have to compile them on every request. Installation is simple: 1. Use yum to [...]]]></description>
			<content:encoded><![CDATA[<p>APC (or Alternate PHP Cache) is a popular PHP PECL extension that can be used for PHP op-code caching. It is very stable and can significantly reduce page rendering times. It works by caching the PHP binaries, so that PHP doesn&#8217;t have to compile them on every request.</p>
<p>Installation is simple:</p>
<p>1. Use <strong>yum</strong> to install necessary packages.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># yum install php-pear php-devel httpd-devel pcre-devel</span></pre></div></div>

<p>2. Use <strong>pecl</strong> to install the PECL apc package.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># pecl install apc</span></pre></div></div>

<p>3. Create a config file that will be included in the PHP ini settings, which will load the APC binary. The default settings should be sufficient for most.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># echo &quot;extension=apc.so&quot; &gt; /etc/php.d/apc.ini</span></pre></div></div>

<p>4. Restart Apache:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># service httpd restart</span></pre></div></div>

<p>5. Make sure it works by creating a phpinfo.php with the following code and then accessing it in your browser. If it works correctly, there will be a new APC section.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">phpinfo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p><a href="http://www.randomtools.net/wp-content/uploads/2011/12/apc.jpg"><img src="http://www.randomtools.net/wp-content/uploads/2011/12/apc.jpg" alt="" title="apc" width="626" height="363" class="aligncenter size-full wp-image-228" /></a></p>
<p></p>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Bookmark this page</div><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://www.randomtools.net/how-to-install-php-apc-on-fedora-centos-225.html&amp;title=How to Install PHP APC on Fedora &#038; CentOS' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://www.randomtools.net/how-to-install-php-apc-on-fedora-centos-225.html&amp;title=How to Install PHP APC on Fedora &#038; CentOS' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://www.randomtools.net/how-to-install-php-apc-on-fedora-centos-225.html' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.randomtools.net/how-to-install-php-apc-on-fedora-centos-225.html&amp;title=How to Install PHP APC on Fedora &#038; CentOS' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://www.randomtools.net/how-to-install-php-apc-on-fedora-centos-225.html&amp;title=How to Install PHP APC on Fedora &#038; CentOS' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://www.randomtools.net/how-to-install-php-apc-on-fedora-centos-225.html&amp;title=How to Install PHP APC on Fedora &#038; CentOS' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://www.randomtools.net/how-to-install-php-apc-on-fedora-centos-225.html&amp;title=How to Install PHP APC on Fedora &#038; CentOS' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> </div></div>]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/how-to-install-php-apc-on-fedora-centos-225.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to insert a tab character into Putty for Linux</title>
		<link>http://www.randomtools.net/how-to-insert-a-tab-character-into-putty-for-linux-218.html</link>
		<comments>http://www.randomtools.net/how-to-insert-a-tab-character-into-putty-for-linux-218.html#comments</comments>
		<pubDate>Thu, 20 Oct 2011 19:18:14 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[How To's]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=218</guid>
		<description><![CDATA[If you&#8217;re like me, you&#8217;ve noticed that if you&#8217;re trying to grep for a tab character, the following won&#8217;t work: grep &#34;\t&#34; file.txt The solution is to use a literal tab character, but it&#8217;s not quite so simple. You can&#8217;t insert a tab character just by hitting the tab button or by pasting one in. [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re like me, you&#8217;ve noticed that if you&#8217;re trying to grep for a tab character, the following won&#8217;t work:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>&quot;</span> file.txt</pre></div></div>

<p>The solution is to use a literal tab character, but it&#8217;s not quite so simple. You can&#8217;t insert a tab character just by hitting the tab button or by pasting one in. You need to hit Ctrl+V first:</p>
<p>So to type a tab in the putty console:</p>
<ul>
<li>Ctrl+V</li>
<li>[TAB] character</li>
</ul>
<p></p>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Bookmark this page</div><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://www.randomtools.net/how-to-insert-a-tab-character-into-putty-for-linux-218.html&amp;title=How to insert a tab character into Putty for Linux' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://www.randomtools.net/how-to-insert-a-tab-character-into-putty-for-linux-218.html&amp;title=How to insert a tab character into Putty for Linux' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://www.randomtools.net/how-to-insert-a-tab-character-into-putty-for-linux-218.html' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.randomtools.net/how-to-insert-a-tab-character-into-putty-for-linux-218.html&amp;title=How to insert a tab character into Putty for Linux' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://www.randomtools.net/how-to-insert-a-tab-character-into-putty-for-linux-218.html&amp;title=How to insert a tab character into Putty for Linux' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://www.randomtools.net/how-to-insert-a-tab-character-into-putty-for-linux-218.html&amp;title=How to insert a tab character into Putty for Linux' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://www.randomtools.net/how-to-insert-a-tab-character-into-putty-for-linux-218.html&amp;title=How to insert a tab character into Putty for Linux' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> </div></div>]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/how-to-insert-a-tab-character-into-putty-for-linux-218.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to loop through days (dates) in bash and force two digits (zerofill)</title>
		<link>http://www.randomtools.net/how-to-loop-through-days-dates-in-bash-and-force-two-digits-zerofill-213.html</link>
		<comments>http://www.randomtools.net/how-to-loop-through-days-dates-in-bash-and-force-two-digits-zerofill-213.html#comments</comments>
		<pubDate>Fri, 20 May 2011 21:30:16 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=213</guid>
		<description><![CDATA[Often with bash, I need to run a script and pass in a date. It helps to be able to use a bash loop to do it all at once. Here&#8217;s how you do it, and make sure the day is two digits. Note the use of the println command. for day in &#123;1..31&#125;; do [...]]]></description>
			<content:encoded><![CDATA[<p>Often with bash, I need to run a script and pass in a date. It helps to be able to use a bash loop to do it all at once. Here&#8217;s how you do it, and make sure the day is two digits. Note the use of the println command.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">for</span> day <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #000000;">1</span>..<span style="color: #000000;">31</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>; <span style="color: #000000; font-weight: bold;">do</span> php some_script.php <span style="color: #000000;">2011</span>-05-<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">printf</span> <span style="color: #ff0000;">&quot;%02d&quot;</span> <span style="color: #007800;">$day</span><span style="color: #000000; font-weight: bold;">`</span>; <span style="color: #000000; font-weight: bold;">done</span></pre></div></div>

<p></p>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Bookmark this page</div><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://www.randomtools.net/how-to-loop-through-days-dates-in-bash-and-force-two-digits-zerofill-213.html&amp;title=How to loop through days (dates) in bash and force two digits (zerofill)' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://www.randomtools.net/how-to-loop-through-days-dates-in-bash-and-force-two-digits-zerofill-213.html&amp;title=How to loop through days (dates) in bash and force two digits (zerofill)' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://www.randomtools.net/how-to-loop-through-days-dates-in-bash-and-force-two-digits-zerofill-213.html' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.randomtools.net/how-to-loop-through-days-dates-in-bash-and-force-two-digits-zerofill-213.html&amp;title=How to loop through days (dates) in bash and force two digits (zerofill)' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://www.randomtools.net/how-to-loop-through-days-dates-in-bash-and-force-two-digits-zerofill-213.html&amp;title=How to loop through days (dates) in bash and force two digits (zerofill)' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://www.randomtools.net/how-to-loop-through-days-dates-in-bash-and-force-two-digits-zerofill-213.html&amp;title=How to loop through days (dates) in bash and force two digits (zerofill)' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://www.randomtools.net/how-to-loop-through-days-dates-in-bash-and-force-two-digits-zerofill-213.html&amp;title=How to loop through days (dates) in bash and force two digits (zerofill)' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> </div></div>]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/how-to-loop-through-days-dates-in-bash-and-force-two-digits-zerofill-213.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to have htop save configuration on exit</title>
		<link>http://www.randomtools.net/how-to-have-htop-save-configuration-on-exit-206.html</link>
		<comments>http://www.randomtools.net/how-to-have-htop-save-configuration-on-exit-206.html#comments</comments>
		<pubDate>Sun, 03 Apr 2011 22:55:26 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[How To's]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=206</guid>
		<description><![CDATA[htop is awesome. I use it all the time to monitor all the servers I use. It was only until recently that I noticed it has some great configuration options, namely the &#34;Tree View.&#34; This allows you to see a hierarchy of processes, which can be really helpful in finding out why certain processes are [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.randomtools.net/wp-content/uploads/2011/04/1713464130_c1451b8e3b.jpg"><img alt="" class="alignleft size-medium wp-image-207" height="180" src="http://www.randomtools.net/wp-content/uploads/2011/04/1713464130_c1451b8e3b-300x180.jpg" title="1713464130_c1451b8e3b" width="300" /></a>htop is awesome. I use it all the time to monitor all the servers I use. It was only until recently that I noticed it has some great configuration options, namely the &quot;Tree View.&quot; This allows you to see a hierarchy of processes, which can be really helpful in finding out why certain processes are running.</p>
<p>I quickly realized it would be a pain to have to constantly hit F5 every time I opened the program, until I realized there was a way to make htop remember your last configuration.</p>
<p>What you want to do is make sure you close out of htop with F10 instead of Ctrl+C, which I normally use. You only need to use F10 when you want to save the settings, and can subsequently close out how you normally do!</p>
<p></p>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Bookmark this page</div><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://www.randomtools.net/how-to-have-htop-save-configuration-on-exit-206.html&amp;title=How to have htop save configuration on exit' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://www.randomtools.net/how-to-have-htop-save-configuration-on-exit-206.html&amp;title=How to have htop save configuration on exit' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://www.randomtools.net/how-to-have-htop-save-configuration-on-exit-206.html' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.randomtools.net/how-to-have-htop-save-configuration-on-exit-206.html&amp;title=How to have htop save configuration on exit' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://www.randomtools.net/how-to-have-htop-save-configuration-on-exit-206.html&amp;title=How to have htop save configuration on exit' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://www.randomtools.net/how-to-have-htop-save-configuration-on-exit-206.html&amp;title=How to have htop save configuration on exit' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://www.randomtools.net/how-to-have-htop-save-configuration-on-exit-206.html&amp;title=How to have htop save configuration on exit' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> </div></div>]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/how-to-have-htop-save-configuration-on-exit-206.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Hide Digsby Ads</title>
		<link>http://www.randomtools.net/how-to-hide-digsby-ads-195.html</link>
		<comments>http://www.randomtools.net/how-to-hide-digsby-ads-195.html#comments</comments>
		<pubDate>Mon, 13 Dec 2010 21:15:13 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[How To's]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=195</guid>
		<description><![CDATA[I use Digsby as my instant messenger client. A couple minutes ago, I received an update which set ads to display in the conversation windows by default. I immediately decided I&#39;d try to figure out how to remove the ads, or switch back to Pidgin, the free open source client. Turns out it was simple [...]]]></description>
			<content:encoded><![CDATA[<p>I use <a href="http://www.digsby.com/" rel="nofollow">Digsby</a> as my instant messenger client. A couple minutes ago, I received an update which set ads to display in the conversation windows by default. I immediately decided I&#39;d try to figure out how to remove the ads, or switch back to <a href="http://www.pidgin.im/">Pidgin</a>, the free open source client. Turns out it was simple to turn off the ads. When you&#39;re done, you&#39;ll need to reopen your conversation windows to see the changes.</p>
<p><a href="http://www.randomtools.net/wp-content/uploads/2010/12/hide_digsby_ads.png"><img alt="" class="aligncenter size-medium wp-image-200" height="225" src="http://www.randomtools.net/wp-content/uploads/2010/12/hide_digsby_ads-300x225.png" title="hide_digsby_ads" width="300" /></a></p>
<p style="clear: both;">From the Buddy List window:</p>
<ol>
<li>Tools -&gt; Preferences</li>
<li>Conversations</li>
<li>Uncheck &quot;Support Digsby development by showing an ad in the IM window&quot;</li>
</ol>
<p></p>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Bookmark this page</div><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://www.randomtools.net/how-to-hide-digsby-ads-195.html&amp;title=How to Hide Digsby Ads' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://www.randomtools.net/how-to-hide-digsby-ads-195.html&amp;title=How to Hide Digsby Ads' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://www.randomtools.net/how-to-hide-digsby-ads-195.html' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.randomtools.net/how-to-hide-digsby-ads-195.html&amp;title=How to Hide Digsby Ads' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://www.randomtools.net/how-to-hide-digsby-ads-195.html&amp;title=How to Hide Digsby Ads' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://www.randomtools.net/how-to-hide-digsby-ads-195.html&amp;title=How to Hide Digsby Ads' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://www.randomtools.net/how-to-hide-digsby-ads-195.html&amp;title=How to Hide Digsby Ads' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> </div></div>]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/how-to-hide-digsby-ads-195.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Fix Linux SSH: Permission denied (publickey).</title>
		<link>http://www.randomtools.net/linux-ssh-permission-denied-publickey-190.html</link>
		<comments>http://www.randomtools.net/linux-ssh-permission-denied-publickey-190.html#comments</comments>
		<pubDate>Thu, 09 Dec 2010 07:01:24 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[How To's]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=190</guid>
		<description><![CDATA[I just got done setting up a user in my new developer environment on multiple boxes. I made sure to copy over the authorized_keys file exactly, including the correct 0600 permissions, but kept getting the &#34;Permission denied (publickey)&#34; error when trying to ssh into one box, even though all the others worked. What finally solved [...]]]></description>
			<content:encoded><![CDATA[<p>I just got done setting up a user in my new developer environment on multiple boxes. I made sure to copy over the authorized_keys file exactly, including the correct 0600 permissions, but kept getting the &quot;Permission denied (publickey)&quot; error when trying to ssh into one box, even though all the others worked.</p>
<p>What finally solved it for me was to make sure the user&#39;s password is set:</p>
<p><strong># passwd &lt;user&gt;</strong></p>
<p>If that doesn&#39;t work, make sure the user&#39;s <strong>.ssh directory is chmod 0700</strong> and the user&#39;s <strong>authorized_keys file is chmod 0600</strong>.</p>
<p></p>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Bookmark this page</div><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://www.randomtools.net/linux-ssh-permission-denied-publickey-190.html&amp;title=How to Fix Linux SSH: Permission denied (publickey).' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://www.randomtools.net/linux-ssh-permission-denied-publickey-190.html&amp;title=How to Fix Linux SSH: Permission denied (publickey).' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://www.randomtools.net/linux-ssh-permission-denied-publickey-190.html' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.randomtools.net/linux-ssh-permission-denied-publickey-190.html&amp;title=How to Fix Linux SSH: Permission denied (publickey).' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://www.randomtools.net/linux-ssh-permission-denied-publickey-190.html&amp;title=How to Fix Linux SSH: Permission denied (publickey).' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://www.randomtools.net/linux-ssh-permission-denied-publickey-190.html&amp;title=How to Fix Linux SSH: Permission denied (publickey).' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://www.randomtools.net/linux-ssh-permission-denied-publickey-190.html&amp;title=How to Fix Linux SSH: Permission denied (publickey).' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> </div></div>]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/linux-ssh-permission-denied-publickey-190.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android ANR keyDispatchingTimedOut</title>
		<link>http://www.randomtools.net/android-anr-keydispatchingtimedout-178.html</link>
		<comments>http://www.randomtools.net/android-anr-keydispatchingtimedout-178.html#comments</comments>
		<pubDate>Fri, 17 Sep 2010 02:49:21 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=178</guid>
		<description><![CDATA[I recently had some issues with my Mancala app where some users were experiencing frequent force closes and I could not figure out the reason for this behavior. Fortunately, with the help of Android&#39;s relatively new force close reporting features, I was able to get some insight into the issue. The big issue seemed to [...]]]></description>
			<content:encoded><![CDATA[<p></p>
<p>I recently had some issues with my Mancala app where some users were experiencing frequent force closes and I could not figure out the reason for this behavior. Fortunately, with the help of Android&#39;s relatively new force close reporting features, I was able to get some insight into the issue. The big issue seemed to be an ANR keyDispatchingTimedOut error, which was something I had no idea about, and Google wasn&#39;t super helpful.</p>
<p>Here&#39;s an example of the &quot;Dalvik threads&quot; that were reported to me in the Android Developer Console. My understanding is that this is a list of threads and their stack traces at the time of the force close.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
</pre></td><td class="code"><pre class="text" style="font-family:monospace;">DALVIK THREADS:
&amp;quot;main&amp;quot; prio=5 tid=1 NATIVE
  | group=&amp;quot;main&amp;quot; sCount=1 dsCount=0 s=N obj=0x4001d8c8 self=0xccc8
  | sysTid=9498 nice=0 sched=0/0 cgrp=default handle=-1345013672
  | schedstat=( 103942869 246185301 151 )
  at java.net.InetAddress.getaddrinfo(Native Method)
  at java.net.InetAddress.lookupHostByName(InetAddress.java:508)
  at java.net.InetAddress.getAllByNameImpl(InetAddress.java:280)
  at java.net.InetAddress.getByName(InetAddress.java:310)
  at java.net.InetSocketAddress.&lt;init&gt;(InetSocketAddress.java:110)
  at java.net.InetSocketAddress.&lt;init&gt;(InetSocketAddress.java:89)
  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.&lt;init&gt;(HttpConnection.java:62)
  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:88)
  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHTTPConnection(HttpURLConnectionImpl.java:927)
  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:909)
  at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:1152)
  at com.xoise.mancala.Mancala.checkUpdate(Mancala.java:203)
  at com.xoise.mancala.Mancala.onCreate(Mancala.java:45)
  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
  at android.os.Handler.dispatchMessage(Handler.java:99)
  at android.os.Looper.loop(Looper.java:123)
  at android.app.ActivityThread.main(ActivityThread.java:4627)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:521)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
  at dalvik.system.NativeStart.main(Native Method)
&nbsp;
&amp;quot;SoundPoolThread&amp;quot; prio=5 tid=8 NATIVE
  | group=&amp;quot;main&amp;quot; sCount=1 dsCount=0 s=N obj=0x43ee6dc8 self=0x22b020
  | sysTid=9506 nice=0 sched=0/0 cgrp=default handle=1204184
  | schedstat=( 854492 25299072 9 )
  at dalvik.system.NativeStart.run(Native Method)
&nbsp;
&amp;quot;SoundPool&amp;quot; prio=5 tid=9 NATIVE
  | group=&amp;quot;main&amp;quot; sCount=1 dsCount=0 s=N obj=0x43ee6e88 self=0x22b430
  | sysTid=9505 nice=0 sched=0/0 cgrp=default handle=1203920
  | schedstat=( 122071 25207520 2 )
  at dalvik.system.NativeStart.run(Native Method)
&nbsp;
&amp;quot;Binder Thread #2&amp;quot; prio=5 tid=7 NATIVE
  | group=&amp;quot;main&amp;quot; sCount=1 dsCount=0 s=N obj=0x43ecfa48 self=0x13f1f8
  | sysTid=9504 nice=0 sched=0/0 cgrp=default handle=1189136
  | schedstat=( 3265379 22705078 15 )
  at dalvik.system.NativeStart.run(Native Method)
&nbsp;
&amp;quot;Binder Thread #1&amp;quot; prio=5 tid=6 NATIVE
  | group=&amp;quot;main&amp;quot; sCount=1 dsCount=0 s=N obj=0x43ecf988 self=0x125a90
  | sysTid=9503 nice=0 sched=0/0 cgrp=default handle=1202768
  | schedstat=( 4425047 132843018 15 )
  at dalvik.system.NativeStart.run(Native Method)
&nbsp;
&amp;quot;Compiler&amp;quot; daemon prio=5 tid=5 VMWAIT
  | group=&amp;quot;system&amp;quot; sCount=1 dsCount=0 s=N obj=0x43ecd348 self=0x121228
  | sysTid=9502 nice=0 sched=0/0 cgrp=default handle=1184232
  | schedstat=( 1708986 15808104 6 )
  at dalvik.system.NativeStart.run(Native Method)
&nbsp;
&amp;quot;JDWP&amp;quot; daemon prio=5 tid=4 VMWAIT
  | group=&amp;quot;system&amp;quot; sCount=1 dsCount=0 s=N obj=0x43ecd2a0 self=0x120b08
  | sysTid=9501 nice=0 sched=0/0 cgrp=default handle=1184152
  | schedstat=( 2685545 5004884 22 )
  at dalvik.system.NativeStart.run(Native Method)
&nbsp;
&amp;quot;Signal Catcher&amp;quot; daemon prio=5 tid=3 RUNNABLE
  | group=&amp;quot;system&amp;quot; sCount=0 dsCount=0 s=N obj=0x43ecd1e8 self=0x120fa8
  | sysTid=9500 nice=0 sched=0/0 cgrp=default handle=1196024
  | schedstat=( 3875733 5920410 15 )
  at dalvik.system.NativeStart.run(Native Method)
&nbsp;
&amp;quot;HeapWorker&amp;quot; daemon prio=5 tid=2 VMWAIT
  | group=&amp;quot;system&amp;quot; sCount=1 dsCount=0 s=N obj=0x43111d58 self=0x129518
  | sysTid=9499 nice=0 sched=0/0 cgrp=default handle=1185056
  | schedstat=( 27954104 52368162 15 )
  at dalvik.system.NativeStart.run(Native Method)&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;</pre></td></tr></table></div>

<p>This ANR, or Application Not Responding, error occurs when a process on the main thread takes too long (something like 5 seconds). Android kills that process and any related by design to spare the device&#39;s resources.</p>
<p>The solution is to run resource-expensive tasks on another thread, and then post, or update the main thread accordingly. A common use for this is network calls (and this was what my problem was). The following is an example of how to implement this logic, in my case to check if an update is needed:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> checkUpdate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	SharedPreferences prefs <span style="color: #339933;">=</span> getPreferences<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	SharedPreferences.<span style="color: #006633;">Editor</span> editor <span style="color: #339933;">=</span> prefs.<span style="color: #006633;">edit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">long</span> lastUpdateTime <span style="color: #339933;">=</span> prefs.<span style="color: #006633;">getLong</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span>lastUpdateTime<span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span>, <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">long</span> time <span style="color: #339933;">=</span> <span style="color: #003399;">System</span>.<span style="color: #006633;">currentTimeMillis</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #cc66cc;">1000</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>lastUpdateTime <span style="color: #339933;">+</span> <span style="color: #cc66cc;">3600</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">24</span> <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> time<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		checkNetworkUpdate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		editor.<span style="color: #006633;">putLong</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span>lastUpdateTime<span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span>, time<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		editor.<span style="color: #006633;">commit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000066; font-weight: bold;">void</span> checkNetworkUpdate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003399;">Thread</span> t <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Thread</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> run<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #003399;">URL</span> updateURL <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">URL</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.updateurl.com/&amp;quot;);       </span>
				<span style="color: #003399;">URLConnection</span> conn <span style="color: #339933;">=</span> updateURL.<span style="color: #006633;">openConnection</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				conn.<span style="color: #006633;">setConnectTimeout</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">3000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				Scanner scanner <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Scanner<span style="color: #009900;">&#40;</span>conn.<span style="color: #006633;">getInputStream</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
				scanner.<span style="color: #006633;">useDelimiter</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span>\\n<span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
				<span style="color: #000066; font-weight: bold;">int</span> curVersion <span style="color: #339933;">=</span> getPackageManager<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getPackageInfo</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span>your.<span style="color: #000000; font-weight: bold;">package</span>.<span style="color: #006633;">name</span><span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span>, <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">versionCode</span><span style="color: #339933;">;</span>
				<span style="color: #000066; font-weight: bold;">int</span> newVersion <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
				<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>scanner.<span style="color: #006633;">hasNext</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
					newVersion <span style="color: #339933;">=</span> <span style="color: #003399;">Integer</span>.<span style="color: #006633;">valueOf</span><span style="color: #009900;">&#40;</span>scanner.<span style="color: #006633;">next</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
				<span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000066; font-weight: bold;">boolean</span> displayUpdate <span style="color: #339933;">=</span> newVersion <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> curVersion<span style="color: #339933;">;</span>
&nbsp;
				runOnUiThread<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Runnable</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> run<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						handleNetworkReply<span style="color: #009900;">&#40;</span>displayUpdate<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span>
				<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
	t.<span style="color: #006633;">start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> handleNetworkReply<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">boolean</span> displayUpdate<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>displayUpdate<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> AlertDialog.<span style="color: #006633;">Builder</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">setMessage</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span>An update is available<span style="color: #339933;">!</span>\n\nOpen Android Market to see the details<span style="color: #339933;">?&amp;</span>quot<span style="color: #339933;">;</span><span style="color: #009900;">&#41;</span>
			.<span style="color: #006633;">setTitle</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span>Update Available<span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span><span style="color: #009900;">&#41;</span>
			.<span style="color: #006633;">setPositiveButton</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span>Yes<span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span>, <span style="color: #000000; font-weight: bold;">new</span> DialogInterface.<span style="color: #006633;">OnClickListener</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onClick<span style="color: #009900;">&#40;</span>DialogInterface dialog, <span style="color: #000066; font-weight: bold;">int</span> whichButton<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					Intent intent <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Intent<span style="color: #009900;">&#40;</span>Intent.<span style="color: #006633;">ACTION_VIEW</span>, Uri.<span style="color: #006633;">parse</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span>market<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//details?id=your.package.name&amp;quot;));</span>
					startActivity<span style="color: #009900;">&#40;</span>intent<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
			.<span style="color: #006633;">setNegativeButton</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span>No<span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span>, <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
			.<span style="color: #006633;">create</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
			.<span style="color: #006633;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Then just call checkUpdate() to perform the task. Note the major points of importance here being the Thread object with a run() method and the runOnUiThread() method of the Activity, which allows you to post data to the main UI thread.</p>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Bookmark this page</div><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://www.randomtools.net/android-anr-keydispatchingtimedout-178.html&amp;title=Android ANR keyDispatchingTimedOut' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://www.randomtools.net/android-anr-keydispatchingtimedout-178.html&amp;title=Android ANR keyDispatchingTimedOut' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://www.randomtools.net/android-anr-keydispatchingtimedout-178.html' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.randomtools.net/android-anr-keydispatchingtimedout-178.html&amp;title=Android ANR keyDispatchingTimedOut' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://www.randomtools.net/android-anr-keydispatchingtimedout-178.html&amp;title=Android ANR keyDispatchingTimedOut' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://www.randomtools.net/android-anr-keydispatchingtimedout-178.html&amp;title=Android ANR keyDispatchingTimedOut' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://www.randomtools.net/android-anr-keydispatchingtimedout-178.html&amp;title=Android ANR keyDispatchingTimedOut' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> </div></div>]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/android-anr-keydispatchingtimedout-178.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatically convert to and from Base64</title>
		<link>http://www.randomtools.net/automatically-convert-to-and-from-base64-170.html</link>
		<comments>http://www.randomtools.net/automatically-convert-to-and-from-base64-170.html#comments</comments>
		<pubDate>Mon, 16 Aug 2010 06:16:11 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Web Tools]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=170</guid>
		<description><![CDATA[I just finished a small, simple, yet interesting script for detecting whether code is base64 and encoding or decoding it based on the result. Let&#39;s be honest, PHP made it super easy for me with the base64_encode() and base64_decode() functions. I just wrapped it up in what I think is a pretty handy little tool [...]]]></description>
			<content:encoded><![CDATA[<p>I just finished a small, simple, yet interesting script for detecting whether code is base64 and encoding or decoding it based on the result. Let&#39;s be honest, PHP made it super easy for me with the base64_encode() and base64_decode() functions. I just wrapped it up in what I think is a pretty handy little tool that I know at least one person will get some use out of!</p>
<p>Try it out: <a href="http://www.base64converter.com/">Base64 Converter</a></p>
<p></p>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Bookmark this page</div><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://www.randomtools.net/automatically-convert-to-and-from-base64-170.html&amp;title=Automatically convert to and from Base64' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://www.randomtools.net/automatically-convert-to-and-from-base64-170.html&amp;title=Automatically convert to and from Base64' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://www.randomtools.net/automatically-convert-to-and-from-base64-170.html' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.randomtools.net/automatically-convert-to-and-from-base64-170.html&amp;title=Automatically convert to and from Base64' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://www.randomtools.net/automatically-convert-to-and-from-base64-170.html&amp;title=Automatically convert to and from Base64' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://www.randomtools.net/automatically-convert-to-and-from-base64-170.html&amp;title=Automatically convert to and from Base64' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://www.randomtools.net/automatically-convert-to-and-from-base64-170.html&amp;title=Automatically convert to and from Base64' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> </div></div>]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/automatically-convert-to-and-from-base64-170.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>View HTTP Response Headers</title>
		<link>http://www.randomtools.net/view-http-response-headers-175.html</link>
		<comments>http://www.randomtools.net/view-http-response-headers-175.html#comments</comments>
		<pubDate>Mon, 16 Aug 2010 06:15:44 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Web Tools]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=175</guid>
		<description><![CDATA[Just a quick note to share a site I found that comes in handy when needing to debug web troubles. You can use the site to handily view HTTP request and HTTP response headers to see exactly what&#39;s going on behind the scenes. Web Sniffer To be totally honest, I&#8217;ll probably end up creating my [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick note to share a site I found that comes in handy when needing to debug web troubles. You can use the site to handily view HTTP request and HTTP response headers to see exactly what&#39;s going on behind the scenes.</p>
<p><a href="http://web-sniffer.net/" target="_blank" rel="nofollow">Web Sniffer</a></p>
<p>To be totally honest, I&#8217;ll probably end up creating my own site for this because I like to build things out for the fun of it.</p>
<p></p>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Bookmark this page</div><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://www.randomtools.net/view-http-response-headers-175.html&amp;title=View HTTP Response Headers' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://www.randomtools.net/view-http-response-headers-175.html&amp;title=View HTTP Response Headers' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://www.randomtools.net/view-http-response-headers-175.html' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.randomtools.net/view-http-response-headers-175.html&amp;title=View HTTP Response Headers' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://www.randomtools.net/view-http-response-headers-175.html&amp;title=View HTTP Response Headers' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://www.randomtools.net/view-http-response-headers-175.html&amp;title=View HTTP Response Headers' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://www.randomtools.net/view-http-response-headers-175.html&amp;title=View HTTP Response Headers' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> </div></div>]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/view-http-response-headers-175.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

