<?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>Veeb&#039;s Brain Dump</title>
	<atom:link href="http://www.veebsbraindump.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.veebsbraindump.com</link>
	<description></description>
	<lastBuildDate>Sun, 06 May 2012 10:29:33 +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>Installing MySQL 5.5 on Ubuntu 11</title>
		<link>http://www.veebsbraindump.com/2012/05/installing-mysql-5-5-on-ubuntu-11/</link>
		<comments>http://www.veebsbraindump.com/2012/05/installing-mysql-5-5-on-ubuntu-11/#comments</comments>
		<pubDate>Sun, 06 May 2012 07:07:27 +0000</pubDate>
		<dc:creator>Veebs</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.veebsbraindump.com/?p=501</guid>
		<description><![CDATA[The package manager for Ubuntu 11 installs MySQL 5.1. Read instructions from mysql and here to install 5.5. Step #1. Download 1. Browse to: http://dev.mysql.com/downloads/mysql/5.5.html 2. Choose: Linux Generic 3. Download: Linux - Generic 2.6 (x86, 64-bit), Compressed TAR Archive Step #2. Create mysql user and group Step #3. Install files to /usr/local/mysql Step #4. [...]]]></description>
			<content:encoded><![CDATA[<p>The package manager for Ubuntu 11 installs MySQL 5.1.</p>
<p>Read instructions from <a href="http://dev.mysql.com/doc/refman/5.5/en/binary-installation.html">mysql</a> and <a href="http://www.linaqu.info/moodle/upgrade-mysql">here</a> to install 5.5.</p>
<h3>Step #1. Download</h3>
<p>1. Browse to: <a href="http://dev.mysql.com/downloads/mysql/5.5.html">http://dev.mysql.com/downloads/mysql/5.5.html</a><br />
2. Choose: <tt>Linux Generic</tt><br />
3. Download: <tt>Linux - Generic 2.6 (x86, 64-bit), Compressed TAR Archive</tt></p>
<h3>Step #2. Create mysql user and group</h3>
<pre class="brush: bash; title: ; notranslate">
$ sudo groupadd mysql
$ sudo useradd -r -g mysql mysql
</pre>
<h3>Step #3. Install files to /usr/local/mysql</h3>
<pre class="brush: bash; title: ; notranslate">
$ cd /usr/local
$ sudo tar zxvf /path/to/mysql-VERSION-OS.tar.gz
$ sudo ln -s full-path-to-mysql-VERSION-OS mysql
$ cd mysql
$ sudo chown -R mysql .
$ sudo chgrp -R mysql .
</pre>
<h3>Step #4. Install Async IO library</h3>
<pre class="brush: bash; title: ; notranslate">
$ sudo apt-get install libaio1
</pre>
<h3>Step #5. Run mysql install script</h3>
<pre class="brush: bash; title: ; notranslate">
$ sudo scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql

Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/local/mysql/bin/mysqladmin -u root password 'new-password'
/usr/local/mysql/bin/mysqladmin -u root -h ubuntu password 'new-password'

Alternatively you can run:
/usr/local/mysql/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &amp;

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/local/mysql/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/local/mysql/scripts/mysqlbug script!
</pre>
<h3>Step #6. Add to path</h3>
<pre class="brush: bash; title: ; notranslate">
$ sudo vi /etc/environment
PATH=&quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/mysql/bin&quot;
</pre>
<h3>Step #7. Create the socket directory</h3>
<p>Setting the correct permission on the socket directory is very important, otherwise MySQL would not run.</p>
<pre class="brush: bash; title: ; notranslate">
$ sudo mkdir /var/run/mysqld/
$ mkdir: cannot create directory `/var/run/mysqld/': File exists
$ sudo chown -R mysql:mysql /var/run/mysqld/
</pre>
<h3>Step #8. Config Settings</h3>
<p>Create configuration</p>
<pre class="brush: bash; title: ; notranslate">
$ cp support-files/my-medium.cnf /etc/my.cnf
</pre>
<p>Add settings in <tt>/etc/my.cnf</tt></p>
<pre class="brush: bash; title: ; notranslate">
[client]
#password = your_password
port = 3306
socket =  /var/run/mysqld/mysqld.sock
#/tmp/mysql.sock

# The MySQL server
[mysqld]
user = mysql
port = 3306
socket = /var/run/mysqld/mysqld.sock
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
tmpdir = /tmp
log_error = /var/log/mysql/error.log
</pre>
<h3>Step #9. Remove the MySQL files from the older version</h3>
<pre class="brush: bash; title: ; notranslate">
$ sudo rm -R /var/lib/mysql
$ sudo rm -R /etc/mysql
$ sudo rm -R /usr/lib/mysql
</pre>
<h3>Step #10. Start Server</h3>
<p>From the terminal &#8230;</p>
<pre class="brush: bash; title: ; notranslate">
$ sudo /usr/local/mysql/bin/mysqld_safe --user=mysql &amp;
</pre>
<p>At startup as a service &#8230;</p>
<pre class="brush: bash; title: ; notranslate">
$ cd /usr/local/mysql/support-files/
$ sudo cp mysql.server /etc/init.d/mysql
$ sudo chmod +x /etc/init.d/mysql
$ sudo update-rc.d mysql defaults
# Starting
$ sudo service mysql start
# Stopping
$ sudo service mysql stop
</pre>
<p>Log file will be kept at <tt>/var/log/mysql/error.log</tt></p>
<h3>Step #11. Secure Server</h3>
<pre class="brush: bash; title: ; notranslate">
$ sudo /usr/local/mysql/bin/mysql_secure_installation
</pre>
<div id="tweetbutton501" class="tw_button" style="float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fveebsbraindump.com%2F%3Fp%3D501&amp;text=Installing%20MySQL%205.5%20on%20Ubuntu%2011&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fwww.veebsbraindump.com%2F2012%2F05%2Finstalling-mysql-5-5-on-ubuntu-11%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.veebsbraindump.com/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.veebsbraindump.com/2012/05/installing-mysql-5-5-on-ubuntu-11/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Just released Socko v0.1</title>
		<link>http://www.veebsbraindump.com/2012/05/just-released-socko-v0-1/</link>
		<comments>http://www.veebsbraindump.com/2012/05/just-released-socko-v0-1/#comments</comments>
		<pubDate>Wed, 02 May 2012 07:13:30 +0000</pubDate>
		<dc:creator>Veebs</dc:creator>
				<category><![CDATA[Akka]]></category>
		<category><![CDATA[Scala]]></category>

		<guid isPermaLink="false">http://www.veebsbraindump.com/?p=497</guid>
		<description><![CDATA[Got together with my good friend Dave to do some &#8220;brogramming&#8221;. We are trying to learn scala/akka and use it for a new open source project called Mashupbots (more on Mashupbots later). The first component of Mashupbots is now out! It is an embedded Scala web server powered by Netty networking and Akka processing. We&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>Got together with my good friend Dave to do some &#8220;brogramming&#8221;. We are trying to learn scala/akka and use it for a new open source project called Mashupbots (more on Mashupbots later).</p>
<p>The first component of Mashupbots is now out!</p>
<p>It is an embedded Scala web server powered by Netty networking and Akka processing.  </p>
<p>We&#8217;ve called it <a href="http://sockoweb.org">Socko</a>.  Check it out.</p>
<div id="tweetbutton497" class="tw_button" style="float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fveebsbraindump.com%2F%3Fp%3D497&amp;text=Just%20released%20Socko%20v0.1&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fwww.veebsbraindump.com%2F2012%2F05%2Fjust-released-socko-v0-1%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.veebsbraindump.com/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.veebsbraindump.com/2012/05/just-released-socko-v0-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t get fooled by Akka Logging Thread Name &#8211; Logging is Asynchronous</title>
		<link>http://www.veebsbraindump.com/2012/03/dont-get-fooled-by-akka-logging-thread-name-logging-is-asynchronous/</link>
		<comments>http://www.veebsbraindump.com/2012/03/dont-get-fooled-by-akka-logging-thread-name-logging-is-asynchronous/#comments</comments>
		<pubDate>Wed, 28 Mar 2012 00:31:26 +0000</pubDate>
		<dc:creator>Veebs</dc:creator>
				<category><![CDATA[Akka]]></category>

		<guid isPermaLink="false">http://www.veebsbraindump.com/?p=486</guid>
		<description><![CDATA[In my scala/akka web server, I&#8217;m doing all the processing in akka Actors. I&#8217;m doing a lot of blocking IO so, as per documentation, I&#8217;ve setup my Actor to run as a router with a pinned dispatcher so that each worker gets its own thread. In my application.conf file, I have the following setting: Log [...]]]></description>
			<content:encoded><![CDATA[<p>In my scala/akka web server, I&#8217;m doing all the processing in akka Actors.</p>
<p>I&#8217;m doing a lot of blocking IO so, as per documentation, I&#8217;ve setup my Actor to run as a router with a pinned dispatcher so that each worker gets its own thread.</p>
<pre class="brush: scala; title: ; notranslate">
   val router = actorSystem.actorOf(Props[StaticFileProcessor]
      .withRouter(FromConfig()).withDispatcher(&quot;mydispatcher&quot;), &quot;myrouter&quot;)
</pre>
<p>In my application.conf file, I have the following setting:</p>
<pre class="brush: plain; title: ; notranslate">
mydispatcher {
  executor = &quot;thread-pool-executor&quot;
  type = PinnedDispatcher
  thread-pool-executor {
    # minimum number of threads to cap factor-based core number to
    core-pool-size-min = 25
    # No of core threads ... ceil(available processors * factor)
    core-pool-size-factor = 2.0
    # maximum number of threads to cap factor-based number to
    core-pool-size-max = 30
  }
}

akka {
  event-handlers = [&quot;akka.event.slf4j.Slf4jEventHandler&quot;]
  loglevel=DEBUG

  actor {
    deployment {
      /myrouter {
        router = round-robin
        nr-of-instances = 5
      }
    }
  }
}
</pre>
<p>Log statements from my Actor is getting printed as follows:</p>
<pre class="brush: plain; title: ; notranslate">
22:15:44.471 [TestActorSystem-akka.actor.default-dispatcher-3] DEBUG o.m.w.processors.StaticFileProcessor akka://TestActorSystem/user/file-processor-test-router/$a - Compressed file name: /tmp/Temp_7097448265494079716/f6310e6f4d77113539594e81c62601cd.deflate
</pre>
<p>Note that the thread is: TestActorSystem-akka.actor.default-dispatcher-3.</p>
<p>This lead me to think that my pinned dispatcher configuration is not working.  Why would the thread be named default-dispatcher-3? Does this mean that my Actors are using the default dispatcher rather than mydisptacher?</p>
<p>After <a href="https://groups.google.com/forum/?fromgroups#!topic/akka-user/ATdGULxsYig">discussions</a> with the Akka team, I found that the misunderstanding comes from akka logging.</p>
<p><a href="http://doc.akka.io/docs/akka/2.0/scala/logging.html">Akka logging</a> is async and the thread printed in the log statement is the thread that is displaying the log message &#8211; NOT the thread that wrote or initiated the log message.</p>
<p>The fix is to add &#8220;%X{sourceThread}&#8221; to the logback pattern.  For example: %d{HH:mm:ss.SSS} [%thread %X{sourceThread}] %-5level %logger{36} %X{akkaSource} &#8211; %msg%n.</p>
<p>Now my log message is:</p>
<pre class="brush: plain; title: ; notranslate">
22:15:44.471 [TestActorSystem-akka.actor.default-dispatcher-3 TestActorSystem-1] DEBUG o.m.w.processors.StaticFileProcessor akka://TestActorSystem/user/file-processor-test-router/$a - Compressed file name: /tmp/Temp_7097448265494079716/f6310e6f4d77113539594e81c62601cd.deflate
</pre>
<p>The thread in which my Actor is running and writing the log message is: TestActorSystem-1.</p>
<p>The thread displaying the log message is: TestActorSystem-akka.actor.default-dispatcher-3.</p>
<div id="tweetbutton486" class="tw_button" style="float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fveebsbraindump.com%2F%3Fp%3D486&amp;text=Don%26%238217%3Bt%20get%20fooled%20by%20Akka%20Logging%20Thread%20Name%20%26%238211%3B%20Logging%20is%20Asynchronous&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fwww.veebsbraindump.com%2F2012%2F03%2Fdont-get-fooled-by-akka-logging-thread-name-logging-is-asynchronous%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.veebsbraindump.com/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.veebsbraindump.com/2012/03/dont-get-fooled-by-akka-logging-thread-name-logging-is-asynchronous/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache Benchmark (ab) hanging and timeout with -k Keep-Alive switch</title>
		<link>http://www.veebsbraindump.com/2012/03/apache-benchmark-ab-hanging-and-timeout-with-k-keep-alive-switch/</link>
		<comments>http://www.veebsbraindump.com/2012/03/apache-benchmark-ab-hanging-and-timeout-with-k-keep-alive-switch/#comments</comments>
		<pubDate>Wed, 28 Mar 2012 00:05:15 +0000</pubDate>
		<dc:creator>Veebs</dc:creator>
				<category><![CDATA[Netty]]></category>

		<guid isPermaLink="false">http://www.veebsbraindump.com/?p=482</guid>
		<description><![CDATA[Here&#8217;s one for newbies &#8230; I&#8217;ve been trying to learn scala and akka. I decided to write a netty based web server in scala and using akka. To test my new server, I used ab. ab works fine with no &#8220;keep alive&#8221;. However, with &#8220;keep alive&#8221;, ab kept hanging after the first request. It eventually [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s one for newbies &#8230;</p>
<p>I&#8217;ve been trying to learn scala and akka.  I decided to write a netty based web server in scala and using akka.</p>
<p>To test my new server, I used <a href="http://httpd.apache.org/docs/2.0/programs/ab.html" title="Apache Benchmark">ab</a>.</p>
<p>ab works fine with no &#8220;keep alive&#8221;.</p>
<p>However, with &#8220;keep alive&#8221;, ab kept hanging after the first request. It eventually timed out.</p>
<p>Thanks to Sean&#8217;s <a href="http://blog.lolyco.com/sean/2009/11/25/ab-apache-bench-hanging-with-k-keep-alive-switch/">post</a>, I found that the problem is that my server needed to return the &#8220;Connection: keep-alive&#8221; header in the response!</p>
<p>According to Sean, </p>
<blockquote><p>
This behaviour isn’t specified anywhere, but it is suggested in an Internet Draft for HTTP/1.1 at w3.org:<br />
The Connection header field with a keep-alive keyword must be sent on all requests and responses that wish to continue the persistence.
</p></blockquote>
<p>I&#8217;ll be sending a pull request to Netty shortly to add this to the http examples.</p>
<div id="tweetbutton482" class="tw_button" style="float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fveebsbraindump.com%2F%3Fp%3D482&amp;text=Apache%20Benchmark%20%28ab%29%20hanging%20and%20timeout%20with%20-k%20Keep-Alive%20switch&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fwww.veebsbraindump.com%2F2012%2F03%2Fapache-benchmark-ab-hanging-and-timeout-with-k-keep-alive-switch%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.veebsbraindump.com/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.veebsbraindump.com/2012/03/apache-benchmark-ab-hanging-and-timeout-with-k-keep-alive-switch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Git Hub Shortcuts</title>
		<link>http://www.veebsbraindump.com/2011/11/my-git-hub-shortcuts/</link>
		<comments>http://www.veebsbraindump.com/2011/11/my-git-hub-shortcuts/#comments</comments>
		<pubDate>Sat, 12 Nov 2011 04:14:41 +0000</pubDate>
		<dc:creator>Veebs</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.veebsbraindump.com/?p=458</guid>
		<description><![CDATA[A good Cheet Sheet. Fork http://help.github.com/fork-a-repo/ &#160; Committing Changes &#160; Update a Forked Repository &#160; Creating a Branch &#160; Getting a Remote Branch http://stackoverflow.com/questions/1897475/github-how-to-checkout-production-branch Tagging Merge Patch Request Locally to Test it Out If more than 1 person is working on a branch &#8230; To avoid &#8220;Merge branch &#8216;master&#8217; of &#8230;&#8221; in your commit history, [...]]]></description>
			<content:encoded><![CDATA[<p>A good <a href="http://www.git-tower.com/files/cheatsheet/Git_Cheat_Sheet_grey.pdf">Cheet Sheet</a>.</p>
<h2>Fork</h2>
<p><a href="http://help.github.com/fork-a-repo/">http://help.github.com/fork-a-repo/</a></p>
<pre class="brush: bash; title: ; notranslate">
# Clone to Spoon-Knife directory
git clone git@github.com:username/Spoon-Knife.git

# Clone to SpecificFolderName directory
git clone git@github.com:username/Spoon-Knife.git SpecificFolderName

cd Spoon-Knife
git remote add upstream git://github.com/octocat/Spoon-Knife.git
git fetch upstream
</pre>
<p>&nbsp;</p>
<h2>Committing Changes</h2>
<pre class="brush: bash; title: ; notranslate">
# To commit changes to local repository
git commit -a

# Send changes to remote repository:
git push origin master
</pre>
<p>&nbsp;</p>
<h2>Update a Forked Repository</h2>
<pre class="brush: bash; title: ; notranslate">
#Fetches any new changes from the original repo
git fetch upstream

# Merge changes retrieved from the fetch
git merge upstream/master
</pre>
<p>&nbsp;</p>
<h2>Creating a Branch</h2>
<pre class="brush: bash; title: ; notranslate">
# Creates a new branch called &quot;mybranch&quot;
git branch mybranch

# Switch to mybranch
git checkout mybranch

# Push new local branch
git push origin mybranch

# Merge changes from mybranch into master and delete mybranch
git checkout master
git merge mybranch
git branch -d mybranch

# Delete remote branch after local delete
git push origin :mybranch
</pre>
<p>&nbsp;</p>
<h2>Getting a Remote Branch</h2>
<p><a href="http://stackoverflow.com/questions/1897475/github-how-to-checkout-production-branch">http://stackoverflow.com/questions/1897475/github-how-to-checkout-production-branch</a></p>
<pre class="brush: bash; title: ; notranslate">
# To list branches:
git branch -a

#You could checkout directly the remote branch after fetching it
git fetch origin
git branch -f remote_branch_name origin/remote_branch_name
git checkout remote_branch name

# or shorter:
git checkout -b production origin/production

# Merge changes from remote production into local production
git co -b production
git pull origin production
</pre>
<h2>Tagging</h2>
<pre class="brush: bash; title: ; notranslate">
#Create local tag
git tag -m&quot;Tag version 1.0&quot; V1.0 

# Push tag to origin
git push --tags
</pre>
<h2>Merge Patch Request Locally to Test it Out</h2>
<pre class="brush: bash; title: ; notranslate">
# Every pull request has a .patch URL where you can grab a textual patch file to feed into the git-am command
$ git checkout master
$ curl http://github.com/github/jobs/pull/25.patch | git am
$ git push origin master
</pre>
<h2>If more than 1 person is working on a branch &#8230; </h2>
<p>To avoid &#8220;Merge branch &#8216;master&#8217; of &#8230;&#8221;  in your commit history, use the following to get the latest changes.  See this <a href="http://stackoverflow.com/questions/2472254/when-should-i-use-git-pull-rebase">link</a> for more info.</p>
<pre class="brush: bash; title: ; notranslate">
$ git pull --rebase origin
</pre>
<p>&nbsp;</p>
<div id="tweetbutton458" class="tw_button" style="float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fveebsbraindump.com%2F%3Fp%3D458&amp;text=My%20Git%20Hub%20Shortcuts&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fwww.veebsbraindump.com%2F2011%2F11%2Fmy-git-hub-shortcuts%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.veebsbraindump.com/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.veebsbraindump.com/2011/11/my-git-hub-shortcuts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remote javascript logging</title>
		<link>http://www.veebsbraindump.com/2011/10/remote-javascript-logging/</link>
		<comments>http://www.veebsbraindump.com/2011/10/remote-javascript-logging/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 22:27:39 +0000</pubDate>
		<dc:creator>Veebs</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.veebsbraindump.com/?p=444</guid>
		<description><![CDATA[Well, finally shipped a version of Chililog with decent websocket support. Can now stream console.log from user&#8217;s browser to my desktop browser. Checkout the video and live demo at http://blog.chililog.org/2011/10/24/remote-javascript-logging/. Tweet]]></description>
			<content:encoded><![CDATA[<p>Well, finally shipped a version of Chililog with decent websocket support. Can now stream console.log from user&#8217;s browser to my desktop browser.</p>
<p>Checkout the video and live demo at http://blog.chililog.org/2011/10/24/remote-javascript-logging/.</p>
<div id="tweetbutton444" class="tw_button" style="float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fveebsbraindump.com%2F%3Fp%3D444&amp;text=Remote%20javascript%20logging&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fwww.veebsbraindump.com%2F2011%2F10%2Fremote-javascript-logging%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.veebsbraindump.com/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.veebsbraindump.com/2011/10/remote-javascript-logging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chililog</title>
		<link>http://www.veebsbraindump.com/2011/10/chililog/</link>
		<comments>http://www.veebsbraindump.com/2011/10/chililog/#comments</comments>
		<pubDate>Fri, 14 Oct 2011 11:12:50 +0000</pubDate>
		<dc:creator>Veebs</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.veebsbraindump.com/?p=437</guid>
		<description><![CDATA[I&#8217;ve been working on a new open source project called Chililog. I&#8217;ll be blogging about how I&#8217;ve used Netty, HornetQ, MongoDB and Sproutcore to build Chililog here. Tweet]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on a new open source project called Chililog.</p>
<p>I&#8217;ll be blogging about how I&#8217;ve used Netty, HornetQ, MongoDB and Sproutcore to build Chililog <a title="Chililog Blog" href="http://blog.chililog.org" target="_blank">here</a>.</p>
<div id="tweetbutton437" class="tw_button" style="float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fveebsbraindump.com%2F%3Fp%3D437&amp;text=Chililog&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fwww.veebsbraindump.com%2F2011%2F10%2Fchililog%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.veebsbraindump.com/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.veebsbraindump.com/2011/10/chililog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WebSockets and Netty</title>
		<link>http://www.veebsbraindump.com/2011/10/websockets-and-netty/</link>
		<comments>http://www.veebsbraindump.com/2011/10/websockets-and-netty/#comments</comments>
		<pubDate>Mon, 03 Oct 2011 05:35:35 +0000</pubDate>
		<dc:creator>Veebs</dc:creator>
				<category><![CDATA[Netty]]></category>
		<category><![CDATA[WebSockets]]></category>

		<guid isPermaLink="false">http://www.veebsbraindump.com/?p=419</guid>
		<description><![CDATA[What are WebSockets? Current web browser communications protocol is limited to the HTTP request and response paradigm &#8211; i.e. the browser requests and the server responds. What if we want to use a different communications paradigm?  For example, what if we want to perform 2 way communications where the server sends a request and the [...]]]></description>
			<content:encoded><![CDATA[<h2>What are WebSockets?</h2>
<p>Current web browser communications protocol is limited to the HTTP request and response paradigm &#8211; i.e. the browser requests and the server responds.</p>
<p>What if we want to use a different communications paradigm?  For example, what if we want to perform 2 way communications where the server sends a request and the browser responds?  A common use case would be the server notifies the client that an event has occurred.</p>
<p>This is where <a href="http://en.wikipedia.org/wiki/WebSocket">WebSockets</a> come into play. WebSocket is a technology providing for bi-directional, full-duplex communications channels, over a single Transmission Control Protocol (TCP) socket.</p>
<p>In addition, because WebSockets can co-exist with other HTTP traffic over port 80 and 443, firewalls will not have to be re-configured.</p>
<h2>Version Confusion</h2>
<p>WebSockets is an evolving standard.  Just have a look at the different <a href="http://en.wikipedia.org/wiki/Comparison_of_WebSocket_implementations">implementations</a> and the different versions each support.</p>
<p>There have been numerous version of the WebSocket standards under different names.  So far, browser have converged on 2 versions.</p>
<ul>
<li><a href="http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-76">Hixie-76</a>/<a href="http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-00">HyBi-00</a></li>
<ul>
<li>Safari 5+, Chrome 4-13 and Firefox 4 supports this standard.</li>
<li>There are two names for this version because the Hixie-76 documentation is used as input into the new HiBi IETF working group.</li>
<li>A flaw in this standard was discovered in the handshaking which requires exchange of binary data in the HTTP body.  This did not work across some proxy servers.</li>
</ul>
<li><a href="http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-10">HyBi-10</a></li>
<ul>
<li>Chrome  14, Firefox 7 and IE 10 Developer Preview supports this standard.</li>
<li>Handshaking is performed in HTTP request and response headers</li>
<li>Uses wire protocol version 8.  You will see &#8220;Sec-WebSocket-Version: 8&#8243; in the HTTP header.</li>
</ul>
</ul>
<p>Hybi-00 and Hybi-10 both represents versions of the specification document.  The version of the wire protocol are actually 0 and 8 respectively.</p>
<p>Typically, the wire protocol (sequence of bits and bytes sent over the network) does not change between different versions of the specification document.  As such, the wire protocol version is set by the version of the specification document at which the change was made to the wire protocol.  So version 8 of the wire protocol was made in <a href="http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-08">Hybi-08</a>.</p>
<p>What changes are made between different versions of the specification document? Corrections of typos, clarification of concepts and adjustments in handshaking.</p>
<p>The latest version is <a href="http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-17">Hybi-17</a> (with a wire protocol version of 13).  So far, no browsers have supported that version.</p>
<h2>Netty WebSocket Support</h2>
<p>I&#8217;m using <a href="http://www.jboss.org/netty/downloads">Netty </a>3.2.5 in building <a href="https://github.com/chililog">Chililog</a> (topic for another blog post).</p>
<p>Netty 3.2.5 supports Hixie-75 and 76 but <strong>NOT</strong> Hybi-10.</p>
<p>I&#8217;ve compiled together my own WebSocket package for Chililog to support both &#8220;Hixie-75/76/Hybi-00&#8243; and &#8220;Hybi-10&#8243;.  This allows my Chililog server to support all of today&#8217;s major browsers (except for IE which does not support Web Sockets at all).</p>
<p>I&#8217;ve used the word &#8220;compiled&#8221; because I&#8217;ve extensively used code from Netty and <a href="https://github.com/joewalnes/webbit">Webbit</a> (for which Aslak Hellesøy has written hybi-10 support).  I&#8217;ve also used code from <a href="https://github.com/cgbystrom/netty-tools">cgbystrom </a>to help build web socket clients.</p>
<p>I&#8217;ve submitted the work back to Netty as <a href="https://github.com/netty/netty/pull/26">pull request #26</a>.</p>
<p>Points of interest:</p>
<ol>
<li>I&#8217;ve not changed the existing <em>org.jboss.netty.handler.codec.http.websocket</em> package.  I&#8217;ve found quite a few frameworks using this package.  I think it would be best if the next version of Netty can be a &#8220;drop-in&#8221; replacement.</li>
<li>I&#8217;ve put all my changes in <em>org.jboss.netty.handler.codec.http.websocket<strong>x</strong></em>.  The &#8220;x&#8221; is intended to represent multiple versions.</li>
<li>The <em>websocketx</em> package supports both WebSocket versions (&#8220;Hixie-75/76/Hybi-00&#8243; and &#8220;Hybi-10&#8243;)  for both client and server.</li>
<li>Frames</li>
<ul>
<li>Data is sent between client and server in frames.</li>
<li>The old <em>websocket</em> package implements only the <em>DefaultWebSocketFrame</em>.  Text, binary and closing frames are encapsulated into this single class.</li>
<li>The new <em>websocketx</em> package implements frames as a different class: <em>TextWebSocketFrame</em>, <em>BinaryWebSocketFrame</em>, <em>CloseWebSocketFrame</em>, <em>PingWebSocketFrame</em> and <em>PongWebSocketFrame</em>.  I felt that this made the code easier to read and understand.</li>
</ul>
<li>Encoders and Decoders</li>
<ol>
<li>Hixie-75/76/Hybi-00 is implemented as <em>WebSocket00FrameDecoder</em> and <em>WebSocket00FrameEncoder</em>.</li>
<li>Hybi-10 is implemented as <em>WebSocket08FrameDecoder</em> and <em>WebSocket08FrameEncoder</em>.  The version #8 is used because the wire protocol #8 is used in conjunction  with the specification document version #10.</li>
</ol>
<li>Server Handshake</li>
<ul>
<li>Implements the handshaking protocol on the server side.</li>
<li>Hixie-75/76/Hybi-00 is implemented in <em>WebSocketServerHandshaker00  </em></li>
<li>Hybi-10 is implemented in <em>WebSocketServerHandshaker10  </em></li>
<li><em>WebSocketServerHandshakerFactory</em> picks the correct handshaker to use based on the handshaking request sent by the client.</li>
<li>See <em>org.jboss.netty.example.http.websocketx.server.WebSocketServer</em>  for an example.</li>
</ul>
<li>Client Handshake</li>
<ul>
<li>Implements the handshaking protocol on the client side.</li>
<li>Hixie-75/76/Hybi-00 is implemented in <em>WebSocketClientHandshaker00</em></li>
<li><em>Hybi-10 is implemented in <em>WebSocketClientHandshaker10  </em><br />
</em></li>
<li><em><em><em>WebSocketClientHandshakerFactory</em></em></em> picks the correct handshaker to use based on the version of the specification passed in as a paramter<em><em>.<br />
</em></em></li>
<li><em><em>See <em>org.jboss.netty.example.http.websocketx.client.App</em></em></em>  for an example<em><em>.</em></em></li>
</ul>
</ol>
<p>Hope this helps anyone looking for Hybi-10 support in Netty.</p>
<h2>27 Oct 2011 &#8211; Update</h2>
<p>Pull #26 request has been merged into Netty.  This feature should be in upcoming Netty release 3.3.</p>
<h2>20 Jan 2012 &#8211; Update</h2>
<p>This has now been released in Netty 3.3.  See <a href="http://netty.io/blog/2012/01/19/">blog post</a>.</p>
<p style="padding-bottom: 4px;">
<div id="tweetbutton419" class="tw_button" style="float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fveebsbraindump.com%2F%3Fp%3D419&amp;text=WebSockets%20and%20Netty&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fwww.veebsbraindump.com%2F2011%2F10%2Fwebsockets-and-netty%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.veebsbraindump.com/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.veebsbraindump.com/2011/10/websockets-and-netty/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Strobe and BPM error on ubuntu: stack level too deep (SystemStackError)</title>
		<link>http://www.veebsbraindump.com/2011/09/strobe-and-bpm-error-on-ubuntu-stack-level-too-deep-systemstackerror/</link>
		<comments>http://www.veebsbraindump.com/2011/09/strobe-and-bpm-error-on-ubuntu-stack-level-too-deep-systemstackerror/#comments</comments>
		<pubDate>Sat, 03 Sep 2011 08:47:48 +0000</pubDate>
		<dc:creator>Veebs</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.veebsbraindump.com/?p=415</guid>
		<description><![CDATA[The cause is a missing gem.  https://github.com/bpm/bpm/issues/33 From the ubuntu software centre, install libyaml-dev sudo gem install psych sudo gem install strobe Tweet]]></description>
			<content:encoded><![CDATA[<div>The cause is a missing gem.  https://github.com/bpm/bpm/issues/33</div>
<div>
<ol>
<li>From the ubuntu software centre, install <tt>libyaml-dev</tt></li>
<li><tt>sudo gem install psych</tt></li>
<li><tt>sudo gem install strobe</tt></li>
</ol>
</div>
<div id="tweetbutton415" class="tw_button" style="float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fveebsbraindump.com%2F%3Fp%3D415&amp;text=Strobe%20and%20BPM%20error%20on%20ubuntu%3A%20stack%20level%20too%20deep%20%28SystemStackError%29&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fwww.veebsbraindump.com%2F2011%2F09%2Fstrobe-and-bpm-error-on-ubuntu-stack-level-too-deep-systemstackerror%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.veebsbraindump.com/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.veebsbraindump.com/2011/09/strobe-and-bpm-error-on-ubuntu-stack-level-too-deep-systemstackerror/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TortoiseGIT not refreshing in Windows Explorer after commit?</title>
		<link>http://www.veebsbraindump.com/2011/08/tortoisegit-not-refreshing-in-windows-explorer-after-commit/</link>
		<comments>http://www.veebsbraindump.com/2011/08/tortoisegit-not-refreshing-in-windows-explorer-after-commit/#comments</comments>
		<pubDate>Tue, 30 Aug 2011 07:50:04 +0000</pubDate>
		<dc:creator>Veebs</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.veebsbraindump.com/?p=411</guid>
		<description><![CDATA[Kill the process TGitCache.exe. Tweet]]></description>
			<content:encoded><![CDATA[<p>Kill the process TGitCache.exe.</p>
<div id="tweetbutton411" class="tw_button" style="float:left;margin-right:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fveebsbraindump.com%2F%3Fp%3D411&amp;text=TortoiseGIT%20not%20refreshing%20in%20Windows%20Explorer%20after%20commit%3F&amp;related=&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Fwww.veebsbraindump.com%2F2011%2F08%2Ftortoisegit-not-refreshing-in-windows-explorer-after-commit%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.veebsbraindump.com/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.veebsbraindump.com/2011/08/tortoisegit-not-refreshing-in-windows-explorer-after-commit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

