<?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>Johanns GREGORIAN</title>
	<atom:link href="http://jsani.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://jsani.com</link>
	<description></description>
	<lastBuildDate>Sat, 11 Feb 2012 19:40:51 +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>Nginx + SSL on Ubuntu 11.XX: The 1-2-3&#8230;</title>
		<link>http://jsani.com/2011/12/nginx-ssl-ubuntu-the-1-2-3/</link>
		<comments>http://jsani.com/2011/12/nginx-ssl-ubuntu-the-1-2-3/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 08:58:05 +0000</pubDate>
		<dc:creator>jo</dc:creator>
				<category><![CDATA[sys]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[rials]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://jsani.com/?p=161</guid>
		<description><![CDATA[1- Generate a Certificate Request <p></p>openssl req -new -newkey rsa:2048 -nodes -keyout /etc/ssl/private/myKey.key -out myRequest.csr<p>Note: A key size of 2048 bits is recommended for commercial sites (especially if PCI is a concern).</p> 2- Copy Certificate to Server <p>Best practice:</p> Copy CRT file(s) to /etc/ssl/certs Key file should already be in /etc/ssl/private  3- Configure Nginx Sample [...]]]></description>
			<content:encoded><![CDATA[<h3>1- Generate a Certificate Request</h3>
<p><span id="more-161"></span></p><pre class="crayon-plain-tag"><code>openssl req -new -newkey rsa:2048 -nodes -keyout /etc/ssl/private/myKey.key -out myRequest.csr</code></pre><p><em>Note: A key size of 2048 bits is recommended for commercial sites (especially if PCI is a concern).</em></p>
<h3>2- Copy Certificate to Server</h3>
<p>Best practice:</p>
<ul>
<li>Copy CRT file(s) to <em>/etc/ssl/certs</em></li>
<li>Key file should already be in<em> /etc/ssl/private </em></li>
</ul>
<h3>3- Configure Nginx</h3>
<h5>Sample Configuration: Static Content</h5>
<pre class="crayon-plain-tag"><code>server {
	listen 443;

	root /var/www;
	index index.html index.htm;

	ssl on;
	ssl_certificate /etc/ssl/certs/myCertificate.crt;
	ssl_certificate_key /etc/ssl/private/myKey.key;

	ssl_session_timeout 5m;

	ssl_protocols SSLv3 TLSv1;
	ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
	ssl_prefer_server_ciphers on;

	location / {
		try_files $uri $uri/ /index.html;
	}
}</code></pre><p><h5>Sample Configuration: Proxy Rails via thin</h5></p><pre class="crayon-plain-tag"><code>upstream thin_cluster {
	server 127.0.0.1:3000;
 	server 127.0.0.1:3001;
}
server {
	listen 443;

	root /var/www;
	index index.html index.htm;

	ssl on;
	ssl_certificate /etc/ssl/certs/myCertificate.crt;
	ssl_certificate_key /etc/ssl/private/myKey.key;

	ssl_session_timeout 5m;

	ssl_protocols SSLv3 TLSv1;
	ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
	ssl_prefer_server_ciphers on;

	location / {
		proxy_set_header  X-Real-IP  $remote_addr;
		proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header  Host $http_host;
		
		# Note: Tell Rails that client session is secure.
		proxy_set_header X-FORWARDED_PROTO https;
		proxy_redirect off;

		if (-f $request_filename/index.html) {
			rewrite (.*) $1/index.html break;
		 }

		if (-f $request_filename.html) { 
			rewrite (.*) $1.html break;
		}

		if (!-f $request_filename) {
			proxy_pass http://thin_cluster;
			break;
		}
 	}
}</code></pre><p><p>
<p>-JO</p>
]]></content:encoded>
			<wfw:commentRss>http://jsani.com/2011/12/nginx-ssl-ubuntu-the-1-2-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu 11.XX + Nginx + Thin + Rails 3: A HOW-TO</title>
		<link>http://jsani.com/2011/09/ubuntu-11-xx-nginx-thin-rails-3-a-how-to/</link>
		<comments>http://jsani.com/2011/09/ubuntu-11-xx-nginx-thin-rails-3-a-how-to/#comments</comments>
		<pubDate>Sat, 10 Sep 2011 09:36:01 +0000</pubDate>
		<dc:creator>jo</dc:creator>
				<category><![CDATA[sys]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[production]]></category>
		<category><![CDATA[rackspace]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[thin]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://jsani.com/?p=72</guid>
		<description><![CDATA[<p>Updated on: Dec. 20th, 2011<br /> A step-by-step guide for getting Ruby on Rails (1.9.x/3.x) working on Ubuntu 11.x and Nginx.<br /> </p> Basics <p>Update the system:</p>sudo apt-get update sudo apt-get upgrade <p>Install the essentials: Build system, NodeJS, Nginx</p># Build essentials sudo apt-get install build-essential bison openssl libreadline5 libreadline-gplv2-dev curl git-core zlib1g zlib1g-dev libssl-dev libsqlite3-0 [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Updated on: Dec. 20th, 2011</strong><br />
A step-by-step guide for getting Ruby on Rails (1.9.x/3.x) working on Ubuntu 11.x and Nginx.<br />
<span id="more-72"></span></p>
<h2>Basics</h2>
<p>Update the system:</p><pre class="crayon-plain-tag"><code>sudo apt-get update
sudo apt-get upgrade</code></pre>
<p>Install the essentials: Build system, NodeJS, Nginx</p><pre class="crayon-plain-tag"><code># Build essentials
sudo apt-get install build-essential bison openssl libreadline5 libreadline-gplv2-dev curl git-core zlib1g zlib1g-dev libssl-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libmysqlclient-dev
# NodeJS
sudo apt-get install nodejs
# Nginx
sudo apt-get install nginx
# Links (for testing)
sudo apt-get install links</code></pre>
<h2>Security</h2>
<p>Add a bit of security:</p><pre class="crayon-plain-tag"><code># Install Uncomplicated Firewall
apt-get install ufw
# Permit incoming ports TCP 80 (http), and 443 (https)
sudo ufw add 'Nginx Full'
# Permit incoming port TCP 22 (ssh)
sudo ufw add 'OpenSSH'
# Enable UFW (fingers crossed)
sudo ufw enable</code></pre>
<h2>Ruby</h2>
<p>Install Ruby using RVM.</p><pre class="crayon-plain-tag"><code>sudo bash -s stable &lt; &lt;(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )</code></pre>
<p><em>NOTE: I recommend relaunching your shell session to allow RVM to load properly.</em></p>
<p>Install Ruby:</p><pre class="crayon-plain-tag"><code># I'm targeting 1.9.2; you can substitute with version of choice.
rvmsudo rvm install 1.9.2
# And, set 1.9.2 as system default
rvmsudo rvm use 1.9.2 --default</code></pre>
<h2>Rails, and thin</h2>
<p>Install Rails:</p><pre class="crayon-plain-tag"><code>rvmsudo gem install rails</code></pre>
<p>And, thin:</p><pre class="crayon-plain-tag"><code>rvmsudo gem install thin</code></pre>
<p>Install the thin daemon:</p><pre class="crayon-plain-tag"><code>rvmsudo thin install</code></pre>
<p>Because RoR and gang were installed via RVM, we need to make certain that <em>thin</em> (daemon) loads through the proper environment. This can be accomplish by creating a RVM wrapper for thin.</p>
<pre class="crayon-plain-tag"><code># Again, targeting 1.9.2p290 environment.
# Substitute as necessary.
rvmsudo rvm wrapper 1.9.2@/usr/local/rvm/gems/ruby-1.9.2-p290 daemon192 thin</code></pre>
<p>This will create the following script <em>/usr/local/bin/daemon192_thin</em>. Edit <em>/etc/init.d/thin</em>, and change the following line from:</p>
<pre class="crayon-plain-tag"><code>DAEMON=/usr/local/rvm/gems/ruby-1.9.2-p290/bin/thin</code></pre>
<p>&#8230;to:</p>
<pre class="crayon-plain-tag"><code>DAEMON=/usr/local/rvm/bin/daemon192_thin</code></pre>
<h3>thin daemon Configuration</h3>
<p>For the purposes of this section, it&#8217;s assumed that target RoR application is in the following directory: <em>/var/www/myapp</em>.<br />
Create a thin configuration file (Note: Remember to update path for your application):</p><pre class="crayon-plain-tag"><code>rvmsudo thin config -C /etc/thin/myapp.yml --servers 4 -e production -c /var/www/myapp</code></pre>
<p>This will generate a <em>thin</em> configuration file that will spawn (4) thin processes (cluster).<br />
To start, and stop the thin damon:</p><pre class="crayon-plain-tag"><code># Start
service thin start
# Stop
service thin stop</code></pre>
<h2>Nginx</h2>
<p>Simple nginx configuration to proxy <em>thin</em> cluster.</p><pre class="crayon-plain-tag"><code>upstream thin_cluster&nbsp;{
 server 127.0.0.1:3000;
 server 127.0.0.1:3001;
 server 127.0.0.1:3002;
 server 127.0.0.1:3003;
}

server&nbsp;{
 listen&nbsp;80;
 server_name myapp.domain;

 access_log&nbsp;/var/www/myapp/log/access.log;
 error_log &nbsp;/var/www/myapp/log/error.log;

 root &nbsp;&nbsp;/var/www/celox.me/public/;
 index &nbsp;index.html;

 location&nbsp;/&nbsp;{
  proxy_set_header &nbsp;X-Real-IP &nbsp;$remote_addr;
  proxy_set_header &nbsp;X-Forwarded-For&nbsp;$proxy_add_x_forwarded_for;
  proxy_set_header &nbsp;Host&nbsp;$http_host;
  proxy_redirect off;

  if&nbsp;(-f&nbsp;$request_filename/index.html)&nbsp;{
   rewrite&nbsp;(.*)&nbsp;$1/index.html&nbsp;break;
  }

  if&nbsp;(-f&nbsp;$request_filename.html)&nbsp;{ 
   rewrite&nbsp;(.*)&nbsp;$1.html&nbsp;break;
  }

  if&nbsp;(!-f&nbsp;$request_filename)&nbsp;{
   proxy_pass http://thin_cluster;
   break;
  }
 }
}</code></pre><p><p><p><p><p><p><p><p><p><p><p><p><p>
<p>Johanns</p>
]]></content:encoded>
			<wfw:commentRss>http://jsani.com/2011/09/ubuntu-11-xx-nginx-thin-rails-3-a-how-to/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>gplus.to: Make Short for Google+</title>
		<link>http://jsani.com/2011/09/gplus-to-make-short-for-google/</link>
		<comments>http://jsani.com/2011/09/gplus-to-make-short-for-google/#comments</comments>
		<pubDate>Fri, 02 Sep 2011 08:40:13 +0000</pubDate>
		<dc:creator>jo</dc:creator>
				<category><![CDATA[social]]></category>
		<category><![CDATA[google+]]></category>

		<guid isPermaLink="false">http://jsani.com/?p=57</guid>
		<description><![CDATA[<p>How sweet is this! And, why am I just learning about it.</p> I am at: <a href="http://gplus.to/johanns">http://gplus.to/johanns</a>]]></description>
			<content:encoded><![CDATA[<p>How sweet is this! And, why am I just learning about it.</p>
<div id="main">
<div id="status">
<div id="answer">I am at: <a href="http://gplus.to/johanns">http://gplus.to/johanns</a></div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://jsani.com/2011/09/gplus-to-make-short-for-google/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Celox.ME: Self-Destructing, Single Serve Message</title>
		<link>http://jsani.com/2011/09/celox-me-self-destructing-single-serve-message/</link>
		<comments>http://jsani.com/2011/09/celox-me-self-destructing-single-serve-message/#comments</comments>
		<pubDate>Fri, 02 Sep 2011 06:31:49 +0000</pubDate>
		<dc:creator>jo</dc:creator>
				<category><![CDATA[dev]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[cryptography]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[openssl]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://jsani.com/?p=47</guid>
		<description><![CDATA[<p>celox.message (<a href="https://celox.me">https://celox.me</a>) is yet another self-destructing, single serve message web application. It&#8217;s my first Ruby on Rails app; a work-in-progress, and far from feature complete. It&#8217;s also open source (and available on <a href="http://github.com/johanns/Celox">github</a>).</p> <p>Overview:</p> Message is securely transmitted and stored in a data store. Message is destroyed once it is read (self destructs). Message [...]]]></description>
			<content:encoded><![CDATA[<p><strong>celox.me</strong>ssage (<a href="https://celox.me">https://celox.me</a>) is yet another self-destructing, single serve message web application. It&#8217;s my first Ruby on Rails app; a work-in-progress, and far from feature complete. It&#8217;s also open source (and available on <a href="http://github.com/johanns/Celox">github</a>).</p>
<p><strong>Overview:</strong></p>
<ul>
<li>Message is securely transmitted and stored in a data store.</li>
<li>Message is destroyed once it is read (self destructs).</li>
<li>Message eventually expires and is removed from the system (even if not read).</li>
</ul>
<div><strong>Components Used</strong>:</div>
<div>
<ul>
<li>Ruby 1.9.2 (initial development)</li>
<li>Rails 3.0.x; later migrated to 3.1.3.</li>
<li>Twitter Bootstrap 1.1 framework.</li>
<li>lib OpenSSL.</li>
</ul>
</div>
<div><strong>Security:</strong></div>
<div>
<ul>
<li>Form is submitted via HTTPS (TLS/SSL).</li>
<li>OpenSSL cipher suite is used for data encryption (server-side). Server operator can choose any crypto algorithm supported by OpenSSL (via config file).</li>
<li>A multi-case alphanumeric pseduo-random key is generated per message (key length can be set via config file). Key is passed on to the user as part of the retrieval URL.</li>
<li>Key is hashed (SHA2-256), and stored as a stub (used to retrieve message). PBKDF2 is used to create to a strong cipher key; however, the stub hash is the weakest link in the chain against a brute force attack.</li>
<li>Encryption algorithm, encrypted data, salt, and IV (initialization vector) objects are marshalled (binary) and encoded (base64) before being stored. This also allows for the encryption algorithm to be changed without invalidating previously encrypted messages.</li>
<li>Message body is overwritten once stub URL is accessed. Reader IP and timestamp are stored, and displayed should the user access the URL again (configurable).</li>
<li>Entire message (row) is eventually removed from the data store (cron job; configurable).</li>
</ul>
<div><strong>TO DO:</strong></div>
<div>
<ul>
<li>Improve exception handling (don&#8217;t want to lose user data if server-side issue/exception).</li>
<li>Allow user to select expiration period (not to exceed operator&#8217;s limits).</li>
<li>Brute force protection against data (data/key isolation); blacklisting.</li>
<li>Notify user when message is read.</li>
<li>Mobile site?</li>
<li>Mobile APP that utilizes the REST API.</li>
<li>&#8216;Are you human?&#8217; mechanism. Issue with Facebook, and various security applications accessing the message URL, effectively destroying the data, before it&#8217;s seen by the intended party.</li>
</ul>
<div>Johanns</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://jsani.com/2011/09/celox-me-self-destructing-single-serve-message/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LaunchPad vs. Adobe Creative Suite: HOW-TO Man-Handle It!</title>
		<link>http://jsani.com/2011/09/launchpad-vs-adobe-suites-how-to-man-handle-it/</link>
		<comments>http://jsani.com/2011/09/launchpad-vs-adobe-suites-how-to-man-handle-it/#comments</comments>
		<pubDate>Fri, 02 Sep 2011 05:30:55 +0000</pubDate>
		<dc:creator>jo</dc:creator>
				<category><![CDATA[note_to_self]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[os x lion]]></category>

		<guid isPermaLink="false">http://jsani.com/?p=20</guid>
		<description><![CDATA[<p>This just hurts my brain, and inflames my OCD! So, while there are a couple of nice options to clean-up LaunchPad (i.e., Launchpad-Control (free), and <a href="http://launchpadcleaner.com/">Launchpad Cleaner</a> ($4.99)), I much rather man-handle it with outmost prejudice, and most impractical way possible &#8212; here is how:<a href="http://jsani.com/wp-content/uploads/2011/09/EZuvv.png"><br /> </a></p> Open your favorite Terminal application cd ~/Library/Application Support/Dock [...]]]></description>
			<content:encoded><![CDATA[<p>This just hurts my brain, and inflames my OCD! So, while there are a couple of nice options to clean-up LaunchPad (i.e., Launchpad-Control (free), and <a href="http://launchpadcleaner.com/">Launchpad Cleaner</a> ($4.99)), I much rather man-handle it with outmost prejudice, and most impractical way possible &#8212; here is how:<span class="Apple-style-span" style="color: #000000; -webkit-text-decorations-in-effect: none;"><a href="http://jsani.com/wp-content/uploads/2011/09/EZuvv.png"><br />
<img class="alignright size-large wp-image-25" title="OCD" src="http://jsani.com/wp-content/uploads/2011/09/EZuvv-1024x576.png" alt="" width="237" height="133" /></a></span></p>
<ol>
<li>Open your favorite Terminal application</li>
<li><em>cd ~/Library/Application Support/Dock</em></li>
<li>List directory content, make note of your database (.db) file</li>
<li>Open .db file using <strong>sqlite3</strong> (e.g.: <em>sqlite3 D3B8D593-6BE6-4F6C-91BB-F8A286E8594F.db</em>)</li>
<li>Run the following query, and make note of item_id&#8217;s  (first column) for all unwanted items:</li>
<ul>
<li><em><strong>select * from apps;</strong></em></li>
</ul>
<li>Time to delete some rows:</li>
<ul>
<li><strong><em> delete from apps where item_id=</em>N;</strong><em>  //(N = item_id&#8217;s noted earlier)</em></li>
</ul>
<li>Repeat till satisfied; when ready, quite sqlite3 by <em><strong>.q</strong></em></li>
<li>Relaunch Dock by <strong><em>killall Dock</em></strong></li>
</ol>
<div>Of course, don&#8217;t be surprised if &#8220;Adobe XXX Uninstaller&#8221; make a cameo appearance at some point.</div>
]]></content:encoded>
			<wfw:commentRss>http://jsani.com/2011/09/launchpad-vs-adobe-suites-how-to-man-handle-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

