<?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>Looking for the paradigm &#187; Evan Hoffman</title>
	<atom:link href="http://www.evanhoffman.com/evan/author/evan/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.evanhoffman.com/evan</link>
	<description>So I can pass it off</description>
	<lastBuildDate>Thu, 26 Jan 2012 22:17:15 +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>Load balancing in EC2 with Nginx and HAProxy</title>
		<link>http://www.evanhoffman.com/evan/2012/01/09/load-balancing-in-ec2-with-nginx-and-haproxy/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=load-balancing-in-ec2-with-nginx-and-haproxy</link>
		<comments>http://www.evanhoffman.com/evan/2012/01/09/load-balancing-in-ec2-with-nginx-and-haproxy/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 22:00:22 +0000</pubDate>
		<dc:creator>Evan Hoffman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[elastic loadbalancer]]></category>
		<category><![CDATA[elb]]></category>
		<category><![CDATA[gslb]]></category>
		<category><![CDATA[haproxy]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[load balancer]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[reverse proxy]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.evanhoffman.com/evan/?p=1764</guid>
		<description><![CDATA[TweetWe wanted to setup a loadbalanced web cluster in AWS for expansion. My first inclination was to use ELB for this, but I soon learned that ELB doesn&#8217;t let you allocate a static IP, requiring you to refer to it only by DNS name. This would be OK except for the fact that our current [...]]]></description>
			<content:encoded><![CDATA[<div style="vertical-align: top; float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.evanhoffman.com/evan/2012/01/09/load-balancing-in-ec2-with-nginx-and-haproxy/&via=EvanHoffman&text=Load balancing in EC2 with Nginx and HAProxy&related=EvanHoffman:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="small" href="http://www.evanhoffman.com/evan/2012/01/09/load-balancing-in-ec2-with-nginx-and-haproxy/"></g:plusone></div><p>We wanted to setup a loadbalanced web cluster in AWS for expansion.  My first inclination was to use <a href="http://aws.amazon.com/elasticloadbalancing/">ELB</a> for this, but I soon learned that ELB doesn&#8217;t let you allocate a static IP, requiring you to refer to it only by DNS name.  This would be OK except for the fact that our current DNS provider, <a href="http://dyn.com/dns/dynect-managed-dns/">Dyn</a>, requires IP addresses when using their GSLB (geo-based load balancer) service.</p>
<p>Rather than let this derail the whole project, I decided to look into the software options available for loadbalancing in EC2.  I&#8217;ve been a fan of hardware load balancers for a while, sort of looking down at software-based solutions without any real rationale, but in this case I really had no choice so I figured I&#8217;d give it a try.</p>
<p>My first stop was Nginx.  I&#8217;ve used it before in a reverse-proxy scenario and like it.  The problem I had with it was that it doesn&#8217;t support active polling of nodes &#8211; the ability to send requests to the webserver and mark the node as up or down based on the response.  As far as I can tell, using <a href="http://wiki.nginx.org/HttpUpstreamModule">multiple upstream servers</a> in Nginx allows you to specify <tt>max_fails</tt> and <tt>fail_timeout</tt>, however a &#8220;fail&#8221; is determined when a real request comes in.  I don&#8217;t want to risk losing a real request &#8211; I like active polling.<br />
<span id="more-1764"></span><br />
This led me to HAProxy.  I&#8217;d never used HAProxy before but it seemed to be ideally suited to this (since it&#8217;s exclusively a load balancer).  The <tt>option httpchk</tt> even allows for active polling of nodes &#8211; yay!</p>
<p>Unfortunately, HAProxy doesn&#8217;t support SSL.  From <a href="http://haproxy.1wt.eu/">the HAProxy site</a>:</p>
<blockquote><p>People often ask for SSL and Keep-Alive support. Both features will complicate the code and render it fragile for several releases. By the way, both features have a negative impact on performance :</p>
<p>    Having SSL in the load balancer itself means that it becomes the bottleneck. When the load balancer&#8217;s CPU is saturated, the overall response times will increase and the only solution will be to multiply the load balancer with another load balancer in front of them. the only scalable solution is to have an SSL/Cache layer between the clients and the load balancer. Anyway for small sites it still makes sense to embed SSL, and it&#8217;s currently being studied. There has been some work on the CyaSSL library to ease integration with HAProxy, as it appears to be the only one out there to let you manage your memory yourself. </p></blockquote>
<p>Poop!  I figured out a workaround however, by using both Nginx and HAProxy on the same instance.  HAProxy listens on port 80 and 8443 (so that it can relay decrypted SSL traffic to the nodes on a separate port, so that the nodes are aware that it was originally SSL traffic).  Nginx is configured as a reverse proxy, listens on port 443 only, and has the SSL cert &#038; key.  The upstream for the Nginx is just localhost:8443 &#8211; HAProxy.  </p>
<p>This was pretty easy to setup and works very well.  I benchmarked HAProxy on an EC2 t1.micro instance (in front of two m1.large instances running our webapp) using <tt>ab -n 5000 -c 50 -t 60</tt> and found it actually performed better than one of our hardware load balancers.  That was pretty eye-opening (and sad).</p>
<p>The HAProxy and Nginx configs are below, in the hopes that it helps someone.  The main warning I&#8217;d give is that using this will cause the logs on your nodes to interpret all requests as coming from the IP of the load balancer.  I had to rewrite some code to have the app use the X-Forwarded-For address rather than the <a href="http://docs.oracle.com/javaee/5/api/javax/servlet/ServletRequest.html#getRemoteAddr%28%29">REMOTE_ADDR</a>, but other than that this has been working out pretty well.</p>
<p>/etc/nginx/nginx.conf<br />
Main thing is to make sure the server isn&#8217;t listening on port 80 (since HAProxy needs to).</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
</pre></td><td class="code"><pre class="txt" style="font-family:monospace;">user              nginx;
worker_processes  1;
&nbsp;
error_log  /var/log/nginx/error.log;
&nbsp;
pid        /var/run/nginx.pid;
&nbsp;
events {
    worker_connections  1024;
}
&nbsp;
http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;
&nbsp;
    log_format  main  '$remote_addr - $remote_user [$time_local] &quot;$request&quot; '
                      '$status $body_bytes_sent &quot;$http_referer&quot; '
                      '&quot;$http_user_agent&quot; &quot;$http_x_forwarded_for&quot;';
&nbsp;
    access_log  /var/log/nginx/access.log  main;
&nbsp;
    sendfile        on;
    keepalive_timeout  65;
&nbsp;
    #
    # The default server
    #
    server {
        listen       81;
        server_name  _;
&nbsp;
        location / {
            root   /usr/share/nginx/html;
            index  index.html index.htm;
        }
&nbsp;
        error_page  404              /404.html;
        location = /404.html {
            root   /usr/share/nginx/html;
        }
&nbsp;
        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /usr/share/nginx/html;
        }
&nbsp;
    }
&nbsp;
    # Load config files from the /etc/nginx/conf.d directory
    include /etc/nginx/conf.d/*.conf;
&nbsp;
}</pre></td></tr></table></div>

<p>/etc/nginx/conf.d/ssl-offloader.conf</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
</pre></td><td class="code"><pre class="txt" style="font-family:monospace;">upstream haproxy {
        server localhost:8443 ;
}
&nbsp;
server {
        listen       443;
        server_name f.q.d.n 1.2.3.4 ; # I put the FQDN and IP here, but maybe &quot;_&quot; will work too
#  server_name  _;
&nbsp;
        ssl                  on;
        ssl_certificate      /etc/nginx/ssl-cert/cert.pem;
        ssl_certificate_key  /etc/nginx/ssl-cert/cert.key;
&nbsp;
        ssl_session_timeout  5m;
&nbsp;
        ssl_protocols  SSLv3 TLSv1;
        ssl_ciphers     ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM;
        ssl_prefer_server_ciphers   on;
&nbsp;
        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;
                proxy_set_header X-NginX-Proxy true;
&nbsp;
                proxy_pass http://haproxy/;
                proxy_redirect default;
                proxy_redirect http://$host/ https://$host/;
                proxy_redirect http://hostname/ https://$host/;
&nbsp;
                proxy_read_timeout 15s;
                proxy_connect_timeout 15s;
        }
&nbsp;
}</pre></td></tr></table></div>

<p>/etc/haproxy/haproxy.cfg</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
</pre></td><td class="code"><pre class="txt" style="font-family:monospace;">#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
    log         127.0.0.1 local2
&nbsp;
    chroot      /var/lib/haproxy
    pidfile     /var/run/haproxy.pid
    maxconn     4000
    user        haproxy
    group       haproxy
    daemon
&nbsp;
    # turn on stats unix socket
    stats socket /var/lib/haproxy/stats
&nbsp;
#---------------------------------------------------------------------
# common defaults that all the 'listen' and 'backend' sections will
# use if not designated in their block
#---------------------------------------------------------------------
defaults
    mode                    http
    log                     global
    option                  httplog
    option                  dontlognull
    option http-server-close
    option forwardfor       except 127.0.0.0/8
    option                  redispatch
    retries                 3
    timeout http-request    3s
    timeout queue           1m
    timeout connect         2s
    timeout client          5s
    timeout server          5s
    timeout http-keep-alive 1s
    timeout check           10s
    maxconn                 3000
&nbsp;
       stats enable
       stats auth evan:change_me_brother
&nbsp;
#---------------------------------------------------------------------
# main frontend which proxys to the backends
#---------------------------------------------------------------------
frontend  main_http *:80
        option forwardfor except 127.0.0.1  
        option httpclose
        default_backend         web_http
&nbsp;
frontend main_https *:8443
        option forwardfor except 127.0.0.1  
        option httpclose
        default_backend         web_https
&nbsp;
#---------------------------------------------------------------------
# round robin balancing between the various backends
#---------------------------------------------------------------------
backend web_http
    balance     roundrobin
#       option httpchk GET / HTTP/1.1\r\nHost:\ host.com
        option httpchk
    server  node1 192.168.1.20:80 check port 80
    server  node2 192.168.1.30:80 check port 80
    server  node3 192.168.1.40:80 check port 80
&nbsp;
&nbsp;
backend web_https
    balance     roundrobin
#       option httpchk GET / HTTP/1.1\r\nHost:\ host.com
        option httpchk
    server  node1 192.168.1.20:8443 check port 8443
    server  node2 192.168.1.30:8443 check port 8443
    server  node3 192.168.1.40:8443 check port 8443</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.evanhoffman.com/evan/2012/01/09/load-balancing-in-ec2-with-nginx-and-haproxy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPad drops WiFi connection to Verizon FiOS Actiontec Router</title>
		<link>http://www.evanhoffman.com/evan/2012/01/01/ipad-drops-wifi-connection-to-verizon-fios-actiontec-router/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ipad-drops-wifi-connection-to-verizon-fios-actiontec-router</link>
		<comments>http://www.evanhoffman.com/evan/2012/01/01/ipad-drops-wifi-connection-to-verizon-fios-actiontec-router/#comments</comments>
		<pubDate>Mon, 02 Jan 2012 04:19:08 +0000</pubDate>
		<dc:creator>Evan Hoffman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[actiontec]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[connection]]></category>
		<category><![CDATA[drop]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[MI424WR]]></category>
		<category><![CDATA[MI424WR-GEN2]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[router]]></category>
		<category><![CDATA[wifi]]></category>

		<guid isPermaLink="false">http://www.evanhoffman.com/evan/?p=1770</guid>
		<description><![CDATA[TweetI got my wife an iPad 2 for Christmas and she soon started complaining about the Wifi dropping its connection. I suggested she try turning off the &#8220;auto join&#8221; wifi setting, but that didn&#8217;t help. She&#8217;d be doing something and get the &#8220;Sorry, there&#8217;s no internet connection&#8221; error every 5-10 minutes. We&#8217;ve had FiOS for [...]]]></description>
			<content:encoded><![CDATA[<div style="vertical-align: top; float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.evanhoffman.com/evan/2012/01/01/ipad-drops-wifi-connection-to-verizon-fios-actiontec-router/&via=EvanHoffman&text=iPad drops WiFi connection to Verizon FiOS Actiontec Router&related=EvanHoffman:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="small" href="http://www.evanhoffman.com/evan/2012/01/01/ipad-drops-wifi-connection-to-verizon-fios-actiontec-router/"></g:plusone></div><p>I got my wife an iPad 2 for Christmas and she soon started complaining about the Wifi dropping its connection.  I suggested she try turning off the &#8220;auto join&#8221; wifi setting, but that didn&#8217;t help.  She&#8217;d be doing something and get the &#8220;Sorry, there&#8217;s no internet connection&#8221; error every 5-10 minutes.  We&#8217;ve had FiOS for quite a while and we have 8 or 9 other devices connected (including Macs &#038; iPhones) to the router without issue, so this seemed weird.  I was starting to think it was a problem with the iPad, but we went to a friend&#8217;s house and used his wifi (with a Netgear router) and the iPad had no issues.  </p>
<p>Back home, I logged into the router and tried assigning her iPad a static IP through DHCP.  I had her release and renew and she got the new IP but the problem continued.  Since we ruled out a problem with the iPad and I knew there was nothing &#8220;wrong&#8221; with the router, I figured I&#8217;d check and see if there are any reported issues with iPads and the Verizon router.  Sure enough, there are.  The first thing I clicked on, <a href="http://appletoolbox.com/2010/04/fix-for-verizon-fios-vs-ipad-wi-fi-issues/">Fix for Verizon FIOS vs. iPad Wi-Fi Issues</a>, suggested changing the wifi channel from &#8220;Automatic&#8221; to &#8220;6&#8243; (it also suggests switching from WEP to WPA2-PSK, which I&#8217;ve always been using).  I did that and it hasn&#8217;t dropped the wifi connection at all in the past 3 hours.  Very odd issue.  If I could get into the Actiontec (or the iPad for that matter) I&#8217;d like to check the logs and see what&#8217;s actually happening, but a win&#8217;s a win.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanhoffman.com/evan/2012/01/01/ipad-drops-wifi-connection-to-verizon-fios-actiontec-router/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compellent &#8220;future proof?&#8221; Not so much.</title>
		<link>http://www.evanhoffman.com/evan/2011/12/21/compellent-future-proof-not-so-much/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=compellent-future-proof-not-so-much</link>
		<comments>http://www.evanhoffman.com/evan/2011/12/21/compellent-future-proof-not-so-much/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 04:39:33 +0000</pubDate>
		<dc:creator>Evan Hoffman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[compellent]]></category>
		<category><![CDATA[dell]]></category>
		<category><![CDATA[iscsi]]></category>
		<category><![CDATA[money]]></category>
		<category><![CDATA[pci]]></category>
		<category><![CDATA[pci-e]]></category>
		<category><![CDATA[pci-x]]></category>
		<category><![CDATA[rant]]></category>
		<category><![CDATA[sas]]></category>
		<category><![CDATA[stopwhining]]></category>

		<guid isPermaLink="false">http://www.evanhoffman.com/evan/?p=1761</guid>
		<description><![CDATA[TweetSo, I&#8217;ve written about Compellent a few times from a price perspective, mostly on the disk side. I was recently contacted by our vendor with quotes for two new Compellent controllers. &#8220;What&#8217;s this all about?&#8221; I asked. &#8220;Why don&#8217;t we have a call with Compellent to discuss?&#8221; he replied. I rolled my eyes a little [...]]]></description>
			<content:encoded><![CDATA[<div style="vertical-align: top; float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.evanhoffman.com/evan/2011/12/21/compellent-future-proof-not-so-much/&via=EvanHoffman&text=Compellent "future proof?" Not so much.&related=EvanHoffman:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="small" href="http://www.evanhoffman.com/evan/2011/12/21/compellent-future-proof-not-so-much/"></g:plusone></div><p>So, I&#8217;ve written about Compellent a few times from a price perspective, mostly on the disk side.  I was recently contacted by our vendor with quotes for two new Compellent controllers.  &#8220;What&#8217;s this all about?&#8221; I asked.  &#8220;Why don&#8217;t we have a call with Compellent to discuss?&#8221; he replied.  I rolled my eyes a little but figured it was worth hearing them out, since our Compellent SAN is at the heart of our infrastructure.</p>
<p>We currently have two controllers setup in failover mode.  The first was bought in 2008 and the other in 2010 to add redundancy.  Earlier this year we upgraded to the latest software version in preparation for moving our production DB onto the SAN, to allow us a nice window before we had to perform another upgrade (which would now risk DB downtime&#8230; I like failover but I don&#8217;t trust it enough to have a DB up during a failover), so I was kind of skeptical about any sort of upgrade to begin with.  </p>
<p>On the call, the Compellent reps explained that they&#8217;ve dropped Fibre Channel connectivity between the controller and the disk enclosure, and the purpose of the upgrade is to give us SAS.  In addition, they no longer sell SATA (!).  I asked why we couldn&#8217;t simply add SAS cards to our existing controllers and was told that our current controllers are PCI-X, so can only support up to 3Gb/s SAS, while the new controllers have PCI-e and support 6Gb/s.  And they want to ensure that we have the best possible performance.  Pretty sure someone said the new controllers &#8220;have the future built in&#8221; to them.</p>
<p>One of the features we really liked about Compellent from the beginning was the fact that it was basically a software solution on top of commodity hardware.  They stressed this point repeatedly.  &#8220;When new technology comes out, we can just add a new card into your existing controller.&#8221;  I think the example at the time was 10-gig Ethernet, but it seems like the same logic would apply to SAS.  I understand that PCI-X doesn&#8217;t support 6Gb/s SAS, but it&#8217;s a tough pill to swallow that if we want to expand our SAN at all now, on top of whatever the actual expansion costs, we&#8217;re going to need to plunk down some serious money to upgrade the controllers, which really seems like a net-zero for us.  We&#8217;re not going to ditch our existing FC enclosures so we&#8217;re going to be limited to 4Gb/s anyway.  If they&#8217;re only selling SAS, well, that sucks for us, but ok.  But why can&#8217;t we just throw a $500 PCI-X 3Gb/s card in to expand?  So we&#8217;re not running at peak performance.  I doubt that would be our performance bottleneck anyway.  Plus, swapping out controllers is a huge operation for us.</p>
<p>I know at some point we&#8217;re going to have to bite the bullet and do this upgrade, but it just irks me.  On the bright side, I guess, we don&#8217;t have to do a &#8220;forklift upgrade,&#8221; and the disks/enclosures will all still work.  But we have a long way to grow before we need to expand, so fortunately I can put this off for a while.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanhoffman.com/evan/2011/12/21/compellent-future-proof-not-so-much/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Graphing SSH dictionary attacks with HighCharts</title>
		<link>http://www.evanhoffman.com/evan/2011/11/18/graphing-ssh-dictionary-attacks-with-highcharts/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=graphing-ssh-dictionary-attacks-with-highcharts</link>
		<comments>http://www.evanhoffman.com/evan/2011/11/18/graphing-ssh-dictionary-attacks-with-highcharts/#comments</comments>
		<pubDate>Fri, 18 Nov 2011 19:06:03 +0000</pubDate>
		<dc:creator>Evan Hoffman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[geo ip]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[maxmind]]></category>
		<category><![CDATA[meta]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[secure]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.evanhoffman.com/evan/?p=1682</guid>
		<description><![CDATA[TweetAfter my 10-year-old basement Linux server died this week from a power outage, I took the sad step of giving up on it. It&#8217;s died before and I&#8217;ve patched it back together with a new power supply here or an addon PCI SATA card there, but I finally decided to throw in the towel since [...]]]></description>
			<content:encoded><![CDATA[<div style="vertical-align: top; float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.evanhoffman.com/evan/2011/11/18/graphing-ssh-dictionary-attacks-with-highcharts/&via=EvanHoffman&text=Graphing SSH dictionary attacks with HighCharts&related=EvanHoffman:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="small" href="http://www.evanhoffman.com/evan/2011/11/18/graphing-ssh-dictionary-attacks-with-highcharts/"></g:plusone></div><p>After my 10-year-old basement Linux server died this week from a power outage, I took the sad step of giving up on it.  It&#8217;s died before and I&#8217;ve patched it back together with a new power supply here or an addon PCI SATA card there, but I finally decided to throw in the towel since I had a newer old computer that had been idle for several years.  The one that died was an Athlon K7 750 MHz with 512 MB ram.  The new one is an Athlon 2 GHz (3200+) with 1 gig.  For my uses, specs don&#8217;t really matter that much, but it&#8217;s nice to have more power for free.</p>
<p>I put CentOS 6 on it and configured Samba and copied all the data off the old machine and was back up and running within a few hours.  Since I forward ports through my FiOS router to this box I did my standard lockdown procedure, including adding myself to the AllowUsers in sshd_config.  Afterwards I took a look in /var/log/secure and saw the typical flood of dictionary attacks trying to get in as root or bob or tfeldman or jweisz.  I have iptables configured to rate-limit SSH connections to 2 per 5 seconds per IP so the box doesn&#8217;t get DoSed out of existence, but some stuff does make it through to sshd.  </p>
<p>Looking through /var/log/secure, I got to thinking it would be interesting if there was some way to visualize the attacks in a handy graph.  Then I remembered, oh, wait, I can do that.</p>
<p>I wrote a perl script to parse out the attacks from /var/log/secure and insert them into a Postgres DB.  This turned out to be pretty easy.  Then I thought it would be more interesting to tie the IP of each attack to its originating country.  I&#8217;ve used <a href="http://www.maxmind.com/">MaxMind&#8217;s</a> GeoIP DB pretty extensively before, but I was looking something free.  That&#8217;s when I remembered that MaxMind has a free GeoIP DB: <a href="http://www.maxmind.com/app/geolitecity">GeoLiteCity</a>.  I grabbed it and yum-installed the <a href="http://search.cpan.org/~borisz/Geo-IP-1.40/lib/Geo/IP.pm">Perl lib</a> and added the geo data to the attack DB.  Rather than worry about normalizing the schema I just shoved the info into the same table.  Life is easier this way, and it&#8217;s just a for-fun project.</p>
<p>So I got that all working and parsed it against the existing /var/log/secures via</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>lunix2011 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># zcat /var/log/secure-20111117.gz | perl parse-secure.pl</span></pre></div></div>

<p>I wrote <a href="https://github.com/evandhoffman/parse-secure/blob/master/php/ssh.php">ssh.php</a> to see what&#8217;s in the table:</p>
<div id="attachment_1684" class="wp-caption aligncenter" style="width: 410px"><a href="http://www.evanhoffman.com/evan/2011/11/18/graphing-ssh-dictionary-attacks-with-highcharts/screen-shot-2011-11-18-at-1-38-07-pm/" rel="attachment wp-att-1684"><img src="http://www.evanhoffman.com/evan/wp-content/uploads/2011/11/Screen-shot-2011-11-18-at-1.38.07-PM.png" alt="ssh.php list of hacking attempts" title="ssh.php list of hacking attempts" width="300" class="size-full wp-image-1684" /></a><p class="wp-caption-text">ssh.php list of hacking attempts</p></div>
<p>So now that the data was all in place, time to move on to the graphs, which is what I really wanted to do.  Last time I wanted to graph data programmatically I used <a href="http://jpgraph.net/">JPGraph</a>, which does everything in PHP and is super versatile.  But I wanted something&#8230; cooler.  Maybe something interactive.  A little Googling turned up <a href="http://www.highcharts.com/">Highcharts</a> which is absolutely awesome, and does everything in JavaScript.  I basically modified some of their example charts and pumped my data into them and got the charts below.</p>
<p>Pie chart of attacks grouped by country for the past 30 days:</p>
<div id="attachment_1687" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.evanhoffman.com/evan/2011/11/18/graphing-ssh-dictionary-attacks-with-highcharts/screen-shot-2011-11-18-at-2-01-46-pm/" rel="attachment wp-att-1687"><img src="http://www.evanhoffman.com/evan/wp-content/uploads/2011/11/Screen-shot-2011-11-18-at-2.01.46-PM.png" alt="Pie chart by country" title="Pie chart by country" width="300"  class="size-full wp-image-1687" /></a><p class="wp-caption-text">Pie chart by country</p></div>
<p>Bar graph of attacks per day:</p>
<div id="attachment_1688" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.evanhoffman.com/evan/2011/11/18/graphing-ssh-dictionary-attacks-with-highcharts/screen-shot-2011-11-18-at-2-01-30-pm/" rel="attachment wp-att-1688"><img src="http://www.evanhoffman.com/evan/wp-content/uploads/2011/11/Screen-shot-2011-11-18-at-2.01.30-PM.png" alt="Bar graph of daily attacks" title="Bar graph of daily attacks" width="300"  class="size-full wp-image-1688" /></a><p class="wp-caption-text">Bar graph of daily attacks</p></div>
<p>So, that&#8217;s that.  Code is in <a href="https://github.com/evandhoffman/parse-secure">github</a> if anyone wants to play around with it.  I&#8217;ve cronned <a href="https://github.com/evandhoffman/parse-secure/blob/master/perl/parse-secure.pl">parse-secure.pl</a> to run every 5 minutes so the data gets updated automatically.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanhoffman.com/evan/2011/11/18/graphing-ssh-dictionary-attacks-with-highcharts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Sun (Oracle) JDK 1.5 on an EC2 instance</title>
		<link>http://www.evanhoffman.com/evan/2011/11/16/installing-sun-oracle-jdk-1-5-on-an-ec2-instance/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=installing-sun-oracle-jdk-1-5-on-an-ec2-instance</link>
		<comments>http://www.evanhoffman.com/evan/2011/11/16/installing-sun-oracle-jdk-1-5-on-an-ec2-instance/#comments</comments>
		<pubDate>Wed, 16 Nov 2011 16:52:55 +0000</pubDate>
		<dc:creator>Evan Hoffman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[1.5]]></category>
		<category><![CDATA[alternatives]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[JAVA_HOME]]></category>
		<category><![CDATA[jdk]]></category>
		<category><![CDATA[jvm]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[sun]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[x86_64]]></category>

		<guid isPermaLink="false">http://www.evanhoffman.com/evan/?p=1675</guid>
		<description><![CDATA[TweetI&#8217;m currently working on moving a Tomcat-based application into EC2. The code was written for Java 5.0. While Java 6 would probably work, I&#8217;d like to keep everything as &#8220;same&#8221; as possible, since EC2 presents its own challenges. I spun up a couple of t1.micro instances and copied everything over, including the Java 5 JDK, [...]]]></description>
			<content:encoded><![CDATA[<div style="vertical-align: top; float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.evanhoffman.com/evan/2011/11/16/installing-sun-oracle-jdk-1-5-on-an-ec2-instance/&via=EvanHoffman&text=Installing Sun (Oracle) JDK 1.5 on an EC2 instance&related=EvanHoffman:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="small" href="http://www.evanhoffman.com/evan/2011/11/16/installing-sun-oracle-jdk-1-5-on-an-ec2-instance/"></g:plusone></div><p>I&#8217;m currently working on moving a Tomcat-based application into EC2. The code was written for Java 5.0. While Java 6 would probably work, I&#8217;d like to keep everything as &#8220;same&#8221; as possible, since EC2 presents its own challenges. I spun up a couple of t1.micro instances and copied everything over, including the Java 5 JDK, <tt><a href="http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase5-419410.html#jdk-1.5.0_22-oth-JPR">jdk-1_5_0_22-linux-amd64.rpm</a></tt>. Installing from RPM was easy, but the EC2 instance defaults to using OpenJDK 1.6:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>ec2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># java -version</span>
java version <span style="color: #ff0000;">&quot;1.6.0_20&quot;</span>
OpenJDK Runtime Environment <span style="color: #7a0874; font-weight: bold;">&#40;</span>IcedTea6 1.9.10<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>amazon-52.1.9.10.40.amzn1-x86_64<span style="color: #7a0874; font-weight: bold;">&#41;</span>
OpenJDK <span style="color: #000000;">64</span>-Bit Server VM <span style="color: #7a0874; font-weight: bold;">&#40;</span>build <span style="color: #000000;">19.0</span>-b09, mixed mode<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>There were a couple of things I had to do to get the system to accept the Sun JDK as its &#8220;real&#8221; java.</p>
<h3>Alternatives</h3>
<p>Red Hat&#8217;s &#8220;alternatives&#8221; system is designed to allow a system to have multiple versions of a program installed and make it easy to choose which one you want to run.  Unfortunately I&#8217;ve found the syntax a bit strange and always have to Google it, so I figured I&#8217;d document it here for posterity.</p>
<p>So here&#8217;s the default:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>ec2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># alternatives --config java</span>
&nbsp;
There is <span style="color: #000000;">1</span> program that provides <span style="color: #ff0000;">'java'</span>.
&nbsp;
  Selection    Command
<span style="color: #660033;">-----------------------------------------------</span>
<span style="color: #000000; font-weight: bold;">*</span>+ <span style="color: #000000;">1</span>           <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>jvm<span style="color: #000000; font-weight: bold;">/</span>jre-1.6.0-openjdk.x86_64<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>java
&nbsp;
Enter to keep the current selection<span style="color: #7a0874; font-weight: bold;">&#91;</span>+<span style="color: #7a0874; font-weight: bold;">&#93;</span>, or <span style="color: #7a0874; font-weight: bold;">type</span> selection number:</pre></div></div>

<p>Here&#8217;s how to add Sun java, assuming the java binary is in <tt>/usr/java/jdk1.5.0_22/jre/bin/java</tt> (where the RPM puts it).</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>ec2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># alternatives --install /usr/bin/java java /usr/java/jdk1.5.0_22/jre/bin/java 1</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>ec2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># alternatives --config java</span>
There are <span style="color: #000000;">2</span> programs <span style="color: #c20cb9; font-weight: bold;">which</span> provide <span style="color: #ff0000;">'java'</span>.
&nbsp;
  Selection    Command
<span style="color: #660033;">-----------------------------------------------</span>
<span style="color: #000000; font-weight: bold;">*</span>+ <span style="color: #000000;">1</span>           <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>jvm<span style="color: #000000; font-weight: bold;">/</span>jre-1.6.0-openjdk.x86_64<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>java
   <span style="color: #000000;">2</span>           <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>java<span style="color: #000000; font-weight: bold;">/</span>jdk1.5.0_22<span style="color: #000000; font-weight: bold;">/</span>jre<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>java
&nbsp;
Enter to keep the current selection<span style="color: #7a0874; font-weight: bold;">&#91;</span>+<span style="color: #7a0874; font-weight: bold;">&#93;</span>, or <span style="color: #7a0874; font-weight: bold;">type</span> selection number: <span style="color: #000000;">2</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>ec2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># java -version</span>
java version <span style="color: #ff0000;">&quot;1.5.0_22&quot;</span>
Java<span style="color: #7a0874; font-weight: bold;">&#40;</span>TM<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">2</span> Runtime Environment, Standard Edition <span style="color: #7a0874; font-weight: bold;">&#40;</span>build 1.5.0_22-b03<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Java HotSpot<span style="color: #7a0874; font-weight: bold;">&#40;</span>TM<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">64</span>-Bit Server VM <span style="color: #7a0874; font-weight: bold;">&#40;</span>build 1.5.0_22-b03, mixed mode<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>Yay!  Unfortunately this doesn&#8217;t help with the other problem I had with Tomcat, which was that EC2 instances set the JAVA_HOME var to OpenJDK as well (<tt>/usr/lib/jvm/jre</tt>).  Fortunately this is an easy fix as well.</p>
<h3>Setting JAVA_HOME</h3>
<p>The JAVA_HOME var is set in <tt>/etc/profile.d/aws-apitools-common.sh</tt>.  Comment out this line:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">JAVA_HOME</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>jvm<span style="color: #000000; font-weight: bold;">/</span>jre</pre></div></div>

<p>Create a new file, <tt>/etc/profile.d/sun-java.sh</tt>, and put this in it:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">JAVA_HOME</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>java<span style="color: #000000; font-weight: bold;">/</span>jdk1.5.0_22<span style="color: #000000; font-weight: bold;">/</span>jre</pre></div></div>

<p>Also in that file I added the following to instruct the JVM to process all dates in America/New_York, since that&#8217;s the timezone all of our other servers use, and it makes reading log files easier when all dates are in the same tz:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">TZ</span>=America<span style="color: #000000; font-weight: bold;">/</span>New_York</pre></div></div>

<p>(I found I had to do this even after pointing /etc/localtime to the correct zoneinfo &#8211; Java was stuck on UTC even after the rest of the system was using America/New_York.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanhoffman.com/evan/2011/11/16/installing-sun-oracle-jdk-1-5-on-an-ec2-instance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The little man who follows me</title>
		<link>http://www.evanhoffman.com/evan/2011/11/12/the-little-man-who-follows-me/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-little-man-who-follows-me</link>
		<comments>http://www.evanhoffman.com/evan/2011/11/12/the-little-man-who-follows-me/#comments</comments>
		<pubDate>Sun, 13 Nov 2011 04:46:16 +0000</pubDate>
		<dc:creator>Evan Hoffman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://www.evanhoffman.com/evan/?p=1667</guid>
		<description><![CDATA[TweetI&#8217;m not usually one for introspection, but I found this a few years ago and it&#8217;s stuck with me. A careful man I want to be; A little fellow follows me. I do not dare to go astray For fear he&#8217;ll go the self same way. I cannot once escape his eyes, Whate&#8217;er he sees [...]]]></description>
			<content:encoded><![CDATA[<div style="vertical-align: top; float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.evanhoffman.com/evan/2011/11/12/the-little-man-who-follows-me/&via=EvanHoffman&text=The little man who follows me&related=EvanHoffman:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="small" href="http://www.evanhoffman.com/evan/2011/11/12/the-little-man-who-follows-me/"></g:plusone></div><p>I&#8217;m not usually one for introspection, but I found this a few years ago and it&#8217;s stuck with me.<br />
<span id="more-1667"></span></p>
<blockquote><p>A careful man I want to be;<br />
A little fellow follows me.<br />
I do not dare to go astray<br />
For fear he&#8217;ll go the self same way.</p>
<p>I cannot once escape his eyes,<br />
Whate&#8217;er he sees me do, he tries.<br />
Like me he says he&#8217;s going to be;<br />
The little chap who follows me.</p>
<p>He thinks that I&#8217;m so very fine,<br />
Believes in every word of mine.<br />
The base in me he must not see;<br />
The little chap who follows me.</p>
<p>I must remember as I go<br />
Through summer&#8217;s sun and winter&#8217;s snow,<br />
I&#8217;m building for the years to be;<br />
The little chap who follows me.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.evanhoffman.com/evan/2011/11/12/the-little-man-who-follows-me/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rescan SATA bus (aka hot-adding a SATA disk on a Linux guest in VMware without rebooting)</title>
		<link>http://www.evanhoffman.com/evan/2011/10/24/rescan-sata-bus-aka-hot-adding-a-sata-disk-on-a-linux-guest-in-vmware-without-rebooting/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rescan-sata-bus-aka-hot-adding-a-sata-disk-on-a-linux-guest-in-vmware-without-rebooting</link>
		<comments>http://www.evanhoffman.com/evan/2011/10/24/rescan-sata-bus-aka-hot-adding-a-sata-disk-on-a-linux-guest-in-vmware-without-rebooting/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 19:20:51 +0000</pubDate>
		<dc:creator>Evan Hoffman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bus]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[dmesg]]></category>
		<category><![CDATA[hot-add]]></category>
		<category><![CDATA[hot-plug]]></category>
		<category><![CDATA[hotadd]]></category>
		<category><![CDATA[hotplug]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[rescan]]></category>
		<category><![CDATA[sata]]></category>
		<category><![CDATA[scsi]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.evanhoffman.com/evan/?p=1655</guid>
		<description><![CDATA[TweetLinux supports hot-adding disks but whenever I add a new vdisk in VMware the new disk doesn&#8217;t show up unless I reboot, which defeats the purpose of hot-add. This command forces a rescan of the bus: echo &#34;- - -&#34; &#62; /sys/class/scsi_host/host0/scan dmesg shows the new disk has been found: Vendor: VMware Model: Virtual disk [...]]]></description>
			<content:encoded><![CDATA[<div style="vertical-align: top; float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.evanhoffman.com/evan/2011/10/24/rescan-sata-bus-aka-hot-adding-a-sata-disk-on-a-linux-guest-in-vmware-without-rebooting/&via=EvanHoffman&text=Rescan SATA bus (aka hot-adding a SATA disk on a Linux guest in VMware without rebooting)&related=EvanHoffman:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="small" href="http://www.evanhoffman.com/evan/2011/10/24/rescan-sata-bus-aka-hot-adding-a-sata-disk-on-a-linux-guest-in-vmware-without-rebooting/"></g:plusone></div><p>Linux supports hot-adding disks but whenever I add a new vdisk in VMware the new disk doesn&#8217;t show up unless I reboot, which defeats the purpose of hot-add.  This command forces a rescan of the bus:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;- - -&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>class<span style="color: #000000; font-weight: bold;">/</span>scsi_host<span style="color: #000000; font-weight: bold;">/</span>host0<span style="color: #000000; font-weight: bold;">/</span>scan</pre></div></div>

<p><tt>dmesg</tt> shows the new disk has been found:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">  Vendor: VMware    Model: Virtual disk      Rev: <span style="color: #000000;">1.0</span> 
  Type:   Direct-Access                      ANSI SCSI revision: 02
 target0:<span style="color: #000000;">0</span>:<span style="color: #000000;">2</span>: Beginning Domain Validation
 target0:<span style="color: #000000;">0</span>:<span style="color: #000000;">2</span>: Domain Validation skipping <span style="color: #c20cb9; font-weight: bold;">write</span> tests
 target0:<span style="color: #000000;">0</span>:<span style="color: #000000;">2</span>: Ending Domain Validation
 target0:<span style="color: #000000;">0</span>:<span style="color: #000000;">2</span>: FAST-<span style="color: #000000;">40</span> WIDE SCSI <span style="color: #000000;">80.0</span> MB<span style="color: #000000; font-weight: bold;">/</span>s ST <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">25</span> ns, offset <span style="color: #000000;">127</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
SCSI device sdd: <span style="color: #000000;">1048576000</span> <span style="color: #000000;">512</span>-byte hdwr sectors <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">536871</span> MB<span style="color: #7a0874; font-weight: bold;">&#41;</span>
sdd: Write Protect is off
sdd: Mode Sense: 03 00 00 00
sdd: cache data unavailable
sdd: assuming drive cache: <span style="color: #c20cb9; font-weight: bold;">write</span> through
SCSI device sdd: <span style="color: #000000;">1048576000</span> <span style="color: #000000;">512</span>-byte hdwr sectors <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">536871</span> MB<span style="color: #7a0874; font-weight: bold;">&#41;</span>
sdd: Write Protect is off
sdd: Mode Sense: 03 00 00 00
sdd: cache data unavailable
sdd: assuming drive cache: <span style="color: #c20cb9; font-weight: bold;">write</span> through
 sdd: unknown partition table
sd <span style="color: #000000;">0</span>:<span style="color: #000000;">0</span>:<span style="color: #000000;">2</span>:<span style="color: #000000;">0</span>: Attached scsi disk sdd
sd <span style="color: #000000;">0</span>:<span style="color: #000000;">0</span>:<span style="color: #000000;">2</span>:<span style="color: #000000;">0</span>: Attached scsi generic sg3 <span style="color: #7a0874; font-weight: bold;">type</span> <span style="color: #000000;">0</span></pre></div></div>

<p>Now, why there&#8217;s no &#8220;rescan_sata&#8221; command is something I can&#8217;t fathom, but that&#8217;s Linux for you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanhoffman.com/evan/2011/10/24/rescan-sata-bus-aka-hot-adding-a-sata-disk-on-a-linux-guest-in-vmware-without-rebooting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Displaying currently-playing iTunes track in the Mac menu bar</title>
		<link>http://www.evanhoffman.com/evan/2011/10/21/displaying-currently-playing-itunes-track-in-the-mac-menu-bar/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=displaying-currently-playing-itunes-track-in-the-mac-menu-bar</link>
		<comments>http://www.evanhoffman.com/evan/2011/10/21/displaying-currently-playing-itunes-track-in-the-mac-menu-bar/#comments</comments>
		<pubDate>Fri, 21 Oct 2011 18:48:42 +0000</pubDate>
		<dc:creator>Evan Hoffman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[current track]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[itunes]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[menulet]]></category>
		<category><![CDATA[meta]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[utility]]></category>
		<category><![CDATA[whine]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://www.evanhoffman.com/evan/?p=1641</guid>
		<description><![CDATA[TweetIn an attempt to teach myself Objective C, and because I couldn&#8217;t find anything that did what I wanted, I wrote a little utility to display the currently-playing iTunes track in the Mac taskbar. Originally I had it display the full track name right in the taskbar but it was too much text for such [...]]]></description>
			<content:encoded><![CDATA[<div style="vertical-align: top; float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.evanhoffman.com/evan/2011/10/21/displaying-currently-playing-itunes-track-in-the-mac-menu-bar/&via=EvanHoffman&text=Displaying currently-playing iTunes track in the Mac menu bar&related=EvanHoffman:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="small" href="http://www.evanhoffman.com/evan/2011/10/21/displaying-currently-playing-itunes-track-in-the-mac-menu-bar/"></g:plusone></div><p>In an attempt to teach myself Objective C, and because I couldn&#8217;t find anything that did what I wanted, I wrote a little utility to display the currently-playing iTunes track in the Mac taskbar.  Originally I had it display the full track name right in the taskbar but it was too much text for such a small space (especially on a 1440&#215;900 screen), so now you click a little musical note and it shows you the info in a menu.  </p>
<p>Here&#8217;s a screenshot:</p>
<p><a href="http://www.evanhoffman.com/evan/2011/10/21/displaying-currently-playing-itunes-track-in-the-mac-menu-bar/screen-shot-2011-10-20-at-8-54-49-pm/" rel="attachment wp-att-1642"><img src="http://www.evanhoffman.com/evan/wp-content/uploads/2011/10/Screen-shot-2011-10-20-at-8.54.49-PM.png" alt="" title="Screen shot 2011-10-20 at 8.54.49 PM" width="365" height="416" class="aligncenter size-full wp-image-1642" /></a></p>
<p>The code is all in <a href="https://github.com/evandhoffman/iTunes-Song-Title">github</a>.  If you&#8217;re looking for a similar utility, and are brave enough to try my first-ever Obj-C app, you can download it  <a href='http://www.evanhoffman.com/evan/2011/10/21/displaying-currently-playing-itunes-track-in-the-mac-menu-bar/itunes-current-track-app/' rel='attachment wp-att-1646'>here.</a>  But the freshest version will probably be in the github project.  </p>
<p>As an aside, I was surprised at how easy it was to cobble this together having never written ObjC before.  I found some good examples that I mostly ripped off, but it was still remarkably easy to have the app listen to iTunes for track changes, etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanhoffman.com/evan/2011/10/21/displaying-currently-playing-itunes-track-in-the-mac-menu-bar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Benchmarking DNS servers with Java</title>
		<link>http://www.evanhoffman.com/evan/2011/09/26/benchmarking-dns-servers-with-java/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=benchmarking-dns-servers-with-java</link>
		<comments>http://www.evanhoffman.com/evan/2011/09/26/benchmarking-dns-servers-with-java/#comments</comments>
		<pubDate>Mon, 26 Sep 2011 16:33:28 +0000</pubDate>
		<dc:creator>Evan Hoffman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://www.evanhoffman.com/evan/?p=1626</guid>
		<description><![CDATA[TweetI&#8217;m currently in the process of moving our DNS over to another provider and I was curious as to whether the old or new provider offers faster lookups. dig shows query times, but I didn&#8217;t want to just run that over and over. I decided to write something to do this, in Java since I [...]]]></description>
			<content:encoded><![CDATA[<div style="vertical-align: top; float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.evanhoffman.com/evan/2011/09/26/benchmarking-dns-servers-with-java/&via=EvanHoffman&text=Benchmarking DNS servers with Java&related=EvanHoffman:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="small" href="http://www.evanhoffman.com/evan/2011/09/26/benchmarking-dns-servers-with-java/"></g:plusone></div><p>I&#8217;m currently in the process of moving our DNS over to another provider and I was curious as to whether the old or new provider offers faster lookups.  <code>dig</code> shows query times, but I didn&#8217;t want to just run that over and over.  I decided to write something to do this, in Java since I like Java.  I found <a href="http://mowyourlawn.com/blog/?p=8">this post,</a> which has the meat of the work done already.  I also read some of Sun&#8217;s <a href="http://download.oracle.com/javase/1,5.0/docs/guide/jndi/jndi-dns.html">JNDI/DNS</a> lookup info, which was pretty dense.  All I want to do is specify the name server&#8217;s IP and do the lookup.  I don&#8217;t even really care about the result, just how long the query takes.</p>
<p>The thing I wrote only looks up <code>A</code> records, but can easily be modified to do CNAMEs or whatever.  Here&#8217;s how you call it:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ java <span style="color: #660033;">-jar</span> DNSTester.jar 4.2.2.2 www.google.com <span style="color: #000000;">25</span>
Resolved www.google.com to 74.125.235.19 against NS 4.2.2.2
Performed <span style="color: #000000;">25</span> lookups <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000;">233.29</span> milliseconds.  Average 9.3316ms per lookup.
&nbsp;
$ java <span style="color: #660033;">-jar</span> DNSTester.jar 8.8.4.4 www.google.com <span style="color: #000000;">25</span>
Resolved www.google.com to 74.125.226.146 against NS 8.8.4.4
Performed <span style="color: #000000;">25</span> lookups <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000;">450.034</span> milliseconds.  Average 18.00136ms per lookup.</pre></div></div>

<p>Code is in github <a href="https://github.com/evandhoffman/DNSBench">here</a>.  Jar is available <a href="http://www.evanhoffman.com/java/DNSTester.jar">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanhoffman.com/evan/2011/09/26/benchmarking-dns-servers-with-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fedora Core 15 &amp; Gnome 3</title>
		<link>http://www.evanhoffman.com/evan/2011/09/23/fedora-core-15-gnome-3/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=fedora-core-15-gnome-3</link>
		<comments>http://www.evanhoffman.com/evan/2011/09/23/fedora-core-15-gnome-3/#comments</comments>
		<pubDate>Fri, 23 Sep 2011 14:27:22 +0000</pubDate>
		<dc:creator>Evan Hoffman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[autostart]]></category>
		<category><![CDATA[chkconfig]]></category>
		<category><![CDATA[fc12]]></category>
		<category><![CDATA[fc15]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[preupgrade]]></category>
		<category><![CDATA[samba]]></category>
		<category><![CDATA[service]]></category>
		<category><![CDATA[smb]]></category>
		<category><![CDATA[systemctl]]></category>
		<category><![CDATA[systemd]]></category>

		<guid isPermaLink="false">http://www.evanhoffman.com/evan/?p=1618</guid>
		<description><![CDATA[Shrinking partitions, installing/upgrading to FC15, and systemd/chkconfig.]]></description>
			<content:encoded><![CDATA[<div style="vertical-align: top; float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.evanhoffman.com/evan/2011/09/23/fedora-core-15-gnome-3/&via=EvanHoffman&text=Fedora Core 15 & Gnome 3&related=EvanHoffman:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="small" href="http://www.evanhoffman.com/evan/2011/09/23/fedora-core-15-gnome-3/"></g:plusone></div><p>Over a year ago, the hard drive in my primary desktop at home bricked itself and rather than going through the hassle of reinstalling Win7 on the new disk, I decided to go with FC12. I&#8217;ve been pretty happy with it in general, since I&#8217;ve always been partial to Red Hat and use CentOS primarily at work.<br />
<span id="more-1618"></span><br />
Last week I got the great idea to upgrade to FC14. In hindsight I can&#8217;t even recall what led me to try this, but it didn&#8217;t end well. I tried the &#8220;preupgrade&#8221; procedure, which appeared to do the entire upgrade from FC12 to FC14 in place. I left it overnight, and when I looked at it the next day it looked like it was done. I was in FC14 and everything looked ok. But then I tried syncing my photos over NFS and discovered nfs wasn&#8217;t running on my desktop. When I tried starting it, it failed. After some trial and error, I used the Google and found that <a href="http://forums.fedoraforum.org/showthread.php?t=264182">this is just what happens when upgrading to FC14</a> due to changes between FC12 and FC14, namely the introduction of <a href="http://fedoraproject.org/wiki/Systemd">systemd</a>.</p>
<p>In all the threads I read, the &#8220;solution&#8221; was a clean install of Fedora. I tried doing this without formatting my / (root) partition, since that had 500 gigs of my stuff on it, but it kept failing. What I ended up doing was downloading <a href="http://partedmagic.com/doku.php?id=start">partedmagic</a>, which is a totally awesome partitioning tool.  If you&#8217;re familiar with Partition Magic, this is similar but Linux-based and free.  I burned the iso to disc, booted to it, and shrunk my / partition from 900 GB to 850 GB, and created a new 50 GB partition at the end of my disk without losing any of my data:</p>
<div id="attachment_1619" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.evanhoffman.com/evan/2011/09/23/fedora-core-15-gnome-3/parted-20110923/" rel="attachment wp-att-1619"><img class="size-medium wp-image-1619" title="FC15 Partitions" src="http://www.evanhoffman.com/evan/wp-content/uploads/2011/09/parted-20110923-300x195.png" alt="FC15 Partitions" width="300" height="195" /></a><p class="wp-caption-text">FC15 Partitions</p></div>
<p>Once this was done, which took surprisingly little time, I did a net install of FC15. I opted for a net install rather than downloading the ISO because I feel that with FiOS it&#8217;s actually faster than reading a DVD, and avoids having to run &#8220;yum update&#8221; afterwards.</p>
<p>So, I ended up with FC15 clean-installed to the new &#8220;/&#8221; partition. I moved everything around so the old partition is mounted at /docs and has all my stuff in it. I&#8217;d heard that FC15 was causing an uproar but until I logged into Gnome 3 myself I didn&#8217;t really understand the fuss. It&#8217;s going to take some getting used to, but after adding the <a href="http://code.google.com/p/tint2/">tint2</a> taskbar it&#8217;s not too awful.</p>
<p>But back to systemd. In FC15 I wanted to ensure Samba started at boot, since that&#8217;s how I share docs between my VMs and host. Chkconfig is still there, but based on my problems with NFS and systemd on FC14 I decided to look into it a bit and see if there&#8217;s a &#8220;new&#8221; way to enable stuff at startup. <a href="http://fedoraproject.org/wiki/Systemd#How_do_I_start.2Fstop_or_enable.2Fdisable_services.3F">There is!</a></p>
<p>Instead of:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># chkconfig smb on</span></pre></div></div>

<p>The command is:</p>

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

<p>Of course, when I did this it apparently fell back to using chkconfig for smb:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>evan-fedora ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># systemctl enable smb.service</span>
smb.service is not a native service, redirecting to <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>chkconfig.
Executing <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>chkconfig smb on</pre></div></div>

<p>It does say in the <a href="http://fedoraproject.org/wiki/Systemd#Does_chkconfig_command_work_with_systemd.3F">Fedora wiki</a> that systemd respects chkconfig and vice versa, so I guess this post is kind of pointless and I should have just linked to the wiki. But, whatever.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanhoffman.com/evan/2011/09/23/fedora-core-15-gnome-3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Making sure SSLv2 is disabled in Apache (and Nginx)</title>
		<link>http://www.evanhoffman.com/evan/2011/09/20/making-sure-sslv2-is-disabled-in-apache/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=making-sure-sslv2-is-disabled-in-apache</link>
		<comments>http://www.evanhoffman.com/evan/2011/09/20/making-sure-sslv2-is-disabled-in-apache/#comments</comments>
		<pubDate>Tue, 20 Sep 2011 18:06:38 +0000</pubDate>
		<dc:creator>Evan Hoffman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[beast]]></category>
		<category><![CDATA[cipher]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mitm]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[openssl]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[sslciphersuite]]></category>
		<category><![CDATA[sslv2]]></category>
		<category><![CDATA[tls]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.evanhoffman.com/evan/?p=1606</guid>
		<description><![CDATA[Tweet Edit Jan 24, 2012: Deleted all the crap from this story and just left the recommended Apache and Nginx SSL cipher suites for maximum security without SSLv2 and without BEAST vulnerability (at least according to Qualys). Apache httpd SSLProtocol -ALL +SSLv3 +TLSv1 SSLCipherSuite ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM; SSLHonorCipherOrder on nginx ssl_protocols SSLv3 TLSv1; ssl_ciphers ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM; ssl_prefer_server_ciphers on; [...]]]></description>
			<content:encoded><![CDATA[<div style="vertical-align: top; float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.evanhoffman.com/evan/2011/09/20/making-sure-sslv2-is-disabled-in-apache/&via=EvanHoffman&text=Making sure SSLv2 is disabled in Apache (and Nginx)&related=EvanHoffman:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="small" href="http://www.evanhoffman.com/evan/2011/09/20/making-sure-sslv2-is-disabled-in-apache/"></g:plusone></div><p><ins datetime="2012-01-24T03:50:52+00:00"><br />
<strong>Edit Jan 24, 2012: </strong> Deleted all the crap from this story and just left the recommended Apache and Nginx SSL cipher suites for maximum security without SSLv2 and without BEAST vulnerability (at least according to Qualys).<br />
</ins><br />
<strong>Apache httpd</strong></p>

<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">SSLProtocol -ALL +SSLv3 +TLSv1
SSLCipherSuite ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM;
SSLHonorCipherOrder on</pre></div></div>

<p><strong>nginx</strong></p>

<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">        ssl_protocols  SSLv3 TLSv1;
        ssl_ciphers     ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM;
        ssl_prefer_server_ciphers   on;</pre></div></div>

<p>Source: </p>
<ul>
<li>
<a href="https://community.qualys.com/blogs/securitylabs/2011/10/17/mitigating-the-beast-attack-on-tls">Qualys</a></li>
<li><a href="https://www.ssllabs.com/ssldb/">SSL checker</a></li>
</ul>
<p><a target="_blank" href="http://affiliate.godaddy.com/redirect/5F43C3ECBA841ACFC3859F4F4E6CA7DA64C271385B2D61A3AD6F3CCE83EB1DD8235E60DCD7D63BCD92E2429E79A75FAC"><img src="http://affiliate.godaddy.com/ads/5F43C3ECBA841ACFC3859F4F4E6CA7DA64C271385B2D61A3AD6F3CCE83EB1DD8235E60DCD7D63BCD92E2429E79A75FAC" border="0" width="468"  height="60" alt="Go Daddy $12.99 SSL Sale!"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanhoffman.com/evan/2011/09/20/making-sure-sslv2-is-disabled-in-apache/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Exchange (OWA) CAS crashes with 503 error &#8211; again</title>
		<link>http://www.evanhoffman.com/evan/2011/09/18/exchange-owa-cas-crashes-with-503-error-again/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=exchange-owa-cas-crashes-with-503-error-again</link>
		<comments>http://www.evanhoffman.com/evan/2011/09/18/exchange-owa-cas-crashes-with-503-error-again/#comments</comments>
		<pubDate>Sun, 18 Sep 2011 16:22:46 +0000</pubDate>
		<dc:creator>Evan Hoffman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[0xe053534f]]></category>
		<category><![CDATA[503]]></category>
		<category><![CDATA[appcrash]]></category>
		<category><![CDATA[crash]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[exchange]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[KERNELBASE.dll]]></category>
		<category><![CDATA[MSExchangeOWAAppPool]]></category>
		<category><![CDATA[owa]]></category>
		<category><![CDATA[w3wp.exe]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.evanhoffman.com/evan/?p=1599</guid>
		<description><![CDATA[TweetThis just started happening again, with these errors appearing in the event viewer: 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 [...]]]></description>
			<content:encoded><![CDATA[<div style="vertical-align: top; float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.evanhoffman.com/evan/2011/09/18/exchange-owa-cas-crashes-with-503-error-again/&via=EvanHoffman&text=Exchange (OWA) CAS crashes with 503 error - again&related=EvanHoffman:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="small" href="http://www.evanhoffman.com/evan/2011/09/18/exchange-owa-cas-crashes-with-503-error-again/"></g:plusone></div><p>This just started happening <a href="http://www.evanhoffman.com/evan/?p=986">again</a>, with these errors appearing in the event viewer:</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
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;">Log Name: System
Source: Microsoft-Windows-WAS
Date: 9/18/2011 11:16:33 AM
Event ID: 5011
Task Category: None
Level: Warning
Keywords: Classic
User: N/A
Computer: exch2010fe1
Description:
A process serving application pool 'MSExchangeOWAAppPool' suffered a
fatal communication error with the Windows Process Activation Service.
The process id was '3760'. The data field contains the error number.
&nbsp;
Log Name: System
Source: Microsoft-Windows-WAS
Date: 9/17/2011 6:47:07 AM
Event ID: 5009
Task Category: None
Level: Warning
Keywords: Classic
User: N/A
Computer: exch2010fe1
Description:
A process serving application pool 'MSExchangeOWAAppPool' terminated
unexpectedly. The process id was '3108'. The process exit code was
'0x800703e9'.
&nbsp;
Log Name: Application
Source: Application Error
Date: 9/17/2011 6:46:30 AM
Event ID: 1000
Task Category: (100)
Level: Error
Keywords: Classic
User: N/A
Computer: exch2010fe1
Description:
Faulting application name: w3wp.exe, version: 7.5.7600.16385, time
stamp: 0x4a5bd0eb
Faulting module name: KERNELBASE.dll, version: 6.1.7600.16385, time
stamp: 0x4a5bdfe0
Exception code: 0xe053534f
Fault offset: 0x000000000000aa7d
Faulting process id: 0x%9
Faulting application start time: 0x%10
Faulting application path: %11
Faulting module path: %12
Report Id: %13</pre></td></tr></table></div>

<p>After reviewing the IIS logs and the event logs, I think it has to do with the WebReady document viewer &#8211; the thing in OWA that renders and lets you view .doc attachments within the browser rather than forcing you to open Word or Excel.  I think users were attempting to open corrupted files and that was causing it to crash.  I&#8217;ve disabled Webready in EMC (Server Config -> CAS) and I&#8217;ll see what happens.  </p>
<p><a target="_blank" href="http://affiliate.godaddy.com/redirect/5F43C3ECBA841ACFC3859F4F4E6CA7DA64C271385B2D61A3AD6F3CCE83EB1DD8235E60DCD7D63BCD92E2429E79A75FAC"><img src="http://affiliate.godaddy.com/ads/5F43C3ECBA841ACFC3859F4F4E6CA7DA64C271385B2D61A3AD6F3CCE83EB1DD8235E60DCD7D63BCD92E2429E79A75FAC" border="0" width="468"  height="60" alt="Go Daddy $12.99 SSL Sale!"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanhoffman.com/evan/2011/09/18/exchange-owa-cas-crashes-with-503-error-again/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>64-bit Firefox 6 on CentOS 6 x86_64 (or Fedora) with Flash 11</title>
		<link>http://www.evanhoffman.com/evan/2011/08/31/64-bit-firefox-6-on-centos-6-x86_64-or-fedora-with-flash-11/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=64-bit-firefox-6-on-centos-6-x86_64-or-fedora-with-flash-11</link>
		<comments>http://www.evanhoffman.com/evan/2011/08/31/64-bit-firefox-6-on-centos-6-x86_64-or-fedora-with-flash-11/#comments</comments>
		<pubDate>Wed, 31 Aug 2011 20:15:14 +0000</pubDate>
		<dc:creator>Evan Hoffman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[64]]></category>
		<category><![CDATA[64-bit]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[rpm]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[x86_64]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://www.evanhoffman.com/evan/?p=1583</guid>
		<description><![CDATA[TweetSo I&#8217;ve gone back to Linux from Mac, due to the SSD issues I had with my Macbook Pro basically making VMware unusable. A Win7 VM would grind the guest and host to a halt on the 7200 RPM SATA OEM drive, and the SSD wouldn&#8217;t work, so I put the SSD back in my [...]]]></description>
			<content:encoded><![CDATA[<div style="vertical-align: top; float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.evanhoffman.com/evan/2011/08/31/64-bit-firefox-6-on-centos-6-x86_64-or-fedora-with-flash-11/&via=EvanHoffman&text=64-bit Firefox 6 on CentOS 6 x86_64 (or Fedora) with Flash 11&related=EvanHoffman:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="small" href="http://www.evanhoffman.com/evan/2011/08/31/64-bit-firefox-6-on-centos-6-x86_64-or-fedora-with-flash-11/"></g:plusone></div><p>So I&#8217;ve gone back to Linux from Mac, due to the SSD issues I had with my Macbook Pro basically making VMware unusable. A Win7 VM would grind the guest and host to a halt on the 7200 RPM SATA OEM drive, and the SSD wouldn&#8217;t work, so I put the SSD back in my HP and installed CentOS 6 x86_64. Not really ideal, but at least it works.</p>
<p>CentOS 6 ships with Firefox 3.6.9, which is really old by now. Fine for a server, but I wanted FF6. I grabbed the Firefox 6.0.1 bz2 from <a href="http://www.mozilla.org/community/mirrors.html">VoxCast</a>, unzipped it and copied it to <tt>/usr/lib64/firefox-6</tt>. Then I ran <tt>yum remove firefox</tt> to remove 3.6.9 and avoid any issues. I tried the instructions from <a href="http://www.evanhoffman.com/evan/?p=407">my older post</a> on this subject but for whatever reason it didn&#8217;t work &#8211; I&#8217;m guessing because I&#8217;m not using the distro&#8217;s Firefox RPM.</p>
<p>I followed <a href="http://fedoraproject.org/wiki/Multimedia/Flash#64-bit_Preview_Release">these instructions</a> to get the Flash 11 64-bit plugin installed. It still wasn&#8217;t working though.</p>
<p>I ended up creating a symlink:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>mozilla<span style="color: #000000; font-weight: bold;">/</span>plugins<span style="color: #000000; font-weight: bold;">/</span>libflashplayer.so <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>evan<span style="color: #000000; font-weight: bold;">/</span>.mozilla<span style="color: #000000; font-weight: bold;">/</span>plugins<span style="color: #000000; font-weight: bold;">/</span>libflashplayer.so</pre></div></div>

<p>When I started up Firefox after creating the symlink, Flash worked.</p>
<p>Additionally, to set Firefox 6 as the default browser, run <tt>gnome-default-applications-properties</tt>, select Custom, and paste <tt>/usr/lib64/firefox-6/firefox %s</tt> in the Command: field.</p>
<p><ins datetime="2011-09-17T21:54:13+00:00">Update:</ins> I upgraded my home desktop PC from FC12 to FC14 last night and used the above procedure to install Firefox 6.0.2 on it with Flash 11.  So, in case anyone was wondering, the above works for Fedora as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanhoffman.com/evan/2011/08/31/64-bit-firefox-6-on-centos-6-x86_64-or-fedora-with-flash-11/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Hurricane Transistor Radio</title>
		<link>http://www.evanhoffman.com/evan/2011/08/30/hurricane-transistor-radio/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=hurricane-transistor-radio</link>
		<comments>http://www.evanhoffman.com/evan/2011/08/30/hurricane-transistor-radio/#comments</comments>
		<pubDate>Tue, 30 Aug 2011 17:14:20 +0000</pubDate>
		<dc:creator>Evan Hoffman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[am]]></category>
		<category><![CDATA[hurricane]]></category>
		<category><![CDATA[irene]]></category>
		<category><![CDATA[low tech]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[radio]]></category>

		<guid isPermaLink="false">http://www.evanhoffman.com/evan/?p=1577</guid>
		<description><![CDATA[TweetWith hurricane Irene passing through this past weekend I quickly shopped for an AM/FM radio. I found this one: Sony ICF-S10MK2 Pocket AM/FM Radio. Cheap, runs on 2 AA batteries, and worked great. A++, would buy again. I actually bought 2, one for my mom. I ordered them on Friday and paid the $8 to [...]]]></description>
			<content:encoded><![CDATA[<div style="vertical-align: top; float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.evanhoffman.com/evan/2011/08/30/hurricane-transistor-radio/&via=EvanHoffman&text=Hurricane Transistor Radio&related=EvanHoffman:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="small" href="http://www.evanhoffman.com/evan/2011/08/30/hurricane-transistor-radio/"></g:plusone></div><p>With hurricane Irene passing through this past weekend I quickly shopped for an AM/FM radio.  I found this one: <a href="http://www.amazon.com/Sony-ICF-S10MK2-Pocket-Radio-Silver/dp/B00020S7XK/ref=sr_1_1?s=electronics&#038;ie=UTF8&#038;tag=evanhoffmasho-20&#038;qid=1314389265&#038;sr=1-1">Sony ICF-S10MK2 Pocket AM/FM Radio</a>.  Cheap, runs on 2 AA batteries, and worked great.  A++, would buy again.  I actually bought 2, one for my mom.  I ordered them on Friday and paid the $8 to bump each one up to overnight with Prime, and they were both delivered Saturday morning.  Unfortunately I wasn&#8217;t home to receive it, and the package weathered the storm on my front step.</p>
<p>Times like these you learn the real value of low-tech.  iPhone, useless.  The only way of getting information was this wonderful $10 AM/FM radio.  Thanks Sony and <a href="http://www.wlng.com/">WLNG</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanhoffman.com/evan/2011/08/30/hurricane-transistor-radio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Macbook Pro locks up with SSD installed.</title>
		<link>http://www.evanhoffman.com/evan/2011/08/23/macbook-pro-locks-up-with-ssd-installed/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=macbook-pro-locks-up-with-ssd-installed</link>
		<comments>http://www.evanhoffman.com/evan/2011/08/23/macbook-pro-locks-up-with-ssd-installed/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 16:04:54 +0000</pubDate>
		<dc:creator>Evan Hoffman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[beach ball]]></category>
		<category><![CDATA[computers]]></category>
		<category><![CDATA[disk]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[macbook]]></category>
		<category><![CDATA[MC118LL/A]]></category>
		<category><![CDATA[pro]]></category>
		<category><![CDATA[slow]]></category>
		<category><![CDATA[speed]]></category>
		<category><![CDATA[spinning]]></category>
		<category><![CDATA[ssd]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.evanhoffman.com/evan/?p=1563</guid>
		<description><![CDATA[TweetA few weeks ago I switched from my trusty old HP nc8430 to a Macbook Pro (MC118LL/A) that was left spare when another employee left. I mostly enjoyed using Linux but I was tired of dealing with weird quirks like having X lock up, essentially forcing me to do a hard reboot. To transition, I [...]]]></description>
			<content:encoded><![CDATA[<div style="vertical-align: top; float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.evanhoffman.com/evan/2011/08/23/macbook-pro-locks-up-with-ssd-installed/&via=EvanHoffman&text=Macbook Pro locks up with SSD installed.&related=EvanHoffman:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="small" href="http://www.evanhoffman.com/evan/2011/08/23/macbook-pro-locks-up-with-ssd-installed/"></g:plusone></div><p>A few weeks ago I switched from my trusty old <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16834147346">HP nc8430</a> to a <a href="http://www.amazon.com/gp/product/B002C744K6/ref=as_li_ss_tl?ie=UTF8&#038;tag=evanhoffmasho-20&#038;linkCode=as2&#038;camp=217145&#038;creative=399369&#038;creativeASIN=B002C744K6">Macbook Pro</a> (MC118LL/A) that was left spare when another employee left.  I mostly enjoyed using Linux but I was tired of dealing with weird quirks like having X lock up, essentially forcing me to do a hard reboot.  </p>
<p>To transition, I copied my documents from Linux to Mac, then turned off the Linux laptop.  Surprisingly I found I didn&#8217;t need to turn Linux back on at all.<br />
<span id="more-1563"></span><br />
Last week, I decided to put the final nail in Linux&#8217;s coffin by taking the SSD (<a href="http://www.amazon.com/gp/product/B002CI41US/ref=as_li_ss_tl?ie=UTF8&#038;tag=evanhoffmasho-20&#038;linkCode=as2&#038;camp=217145&#038;creative=399369&#038;creativeASIN=B002CI41US">Corsair CMFSSD-128GBG2D</a>)out of it and putting it in my Macbook.  The Macbook was pretty fast (Core 2 Duo @ 2.5 GHz) but some things were noticeably slower on its 7200RPM disk than on Linux with an SSD, especially running Windows VMs.</p>
<p>I booted Linux to Knoppix and zeroed out the disk, then removed it.  I backed my Mac up with Time Machine, shut it down, then undid the ~12 tiny screws, removed the bottom plate of the Macbook and popped the SSD in.  I booted from the Mac DVD, restored from Time Machine and went home (it took ~4 hours to restore).</p>
<p>When I got in the next day, the restore was complete, though I had to click &#8220;Restart&#8221; to finish, which was annoying.  Everything worked fine, and I was pretty impressed.  The machine was kind of sluggish due to Spotlight indexing but once that was done I was pretty amazed at the transformation.  Every app opened in under 1 second.  Windows VMs were super snappy.  Things were going well.  </p>
<p>But then I started noticing periods of extended hanging.  In the middle of some task, I&#8217;d get the <b>beachball</b> and the whole computer would become unresponsive (cursor would spin &#038; move around but I couldn&#8217;t click anything).  This would last about 30-60 seconds.  I assumed it was some behind-the-scenes optimization, or some residual spotlight indexing.  </p>
<p>Unfortunately, it hasn&#8217;t gone away.  Earlier today I copied a 3 GB zip file from our file server to my laptop and it beachballed me on and off (about 60-70% of the time) for about 15 minutes as it copied.  What&#8217;s odd is that the transfer speeds were pretty good, it appeared to be my computer itself that was bottlenecking it.  After the download completed, I attempted to unzip it and was beachballed again.  I checked Activity Monitor and it was peaking at 30 MB/s, but had extended periods of zeroes.  I ran iostat and got basically the same information:</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
80
81
82
83
84
85
86
87
88
89
</pre></td><td class="code"><pre class="log" style="font-family:monospace;">EvanMBP:~ root# iostat -Kw 3
          disk0           disk1       cpu     load average
    KB/t tps  MB/s     KB/t tps  MB/s  us sy id   1m   5m   15m
    9.33   3  0.03     0.00   0  0.00   9  4 87  0.25 0.28 0.32
    0.00   0  0.00     0.00   0  0.00  13  5 82  0.23 0.27 0.32
   20.00   0  0.01     0.00   0  0.00  15  5 80  0.23 0.27 0.32
   36.00   1  0.02     0.00   0  0.00  16  6 77  0.21 0.27 0.32
    0.00   0  0.00     0.00   0  0.00  12  5 83  0.21 0.27 0.32
   20.02  60  1.18     0.00   0  0.00  17 10 74  0.19 0.26 0.32
   24.60 363  8.72     0.00   0  0.00  18 13 69  0.17 0.26 0.31
   25.40 307  7.60     0.00   0  0.00  14 11 75  0.17 0.26 0.31
   21.95 426  9.14     0.00   0  0.00  15 12 73  0.32 0.29 0.32
   82.50 352 28.35     0.00   0  0.00  17 11 73  0.32 0.29 0.32
  809.70  84 66.41     0.00   0  0.00  22  9 69  0.29 0.28 0.32
    0.00   0  0.00     0.00   0  0.00   9  5 86  0.27 0.28 0.32
    0.00   0  0.00     8.89  11  0.09   9  5 86  0.27 0.28 0.32
    0.00   0  0.00     0.00   0  0.00   9  5 87  0.33 0.29 0.32
    0.00   0  0.00     0.00   0  0.00  12  7 81  0.33 0.29 0.32
    0.00   0  0.00     0.00   0  0.00  14  8 78  0.38 0.30 0.33
    0.00   0  0.00     0.00   0  0.00  11  6 83  0.35 0.29 0.33
    0.00   0  0.00     0.00   0  0.00  10  6 84  0.35 0.29 0.33
    0.00   0  0.00     0.00   0  0.00  10  5 84  0.32 0.29 0.32
    0.00   0  0.00     0.00   0  0.00  11  6 84  0.32 0.29 0.32
          disk0           disk1       cpu     load average
    KB/t tps  MB/s     KB/t tps  MB/s  us sy id   1m   5m   15m
    0.00   0  0.00     0.00   0  0.00  10  5 84  0.30 0.28 0.32
    0.00   0  0.00     0.00   0  0.00  11  6 84  0.27 0.28 0.32
    0.00   0  0.00     0.00   0  0.00  11  5 84  0.27 0.28 0.32
    0.00   0  0.00     0.00   0  0.00   9  5 85  0.25 0.27 0.32
    0.00   0  0.00     0.00   0  0.00  10  5 85  0.25 0.27 0.32
    0.00   0  0.00     0.00   0  0.00  10  5 85  0.31 0.29 0.32
    0.00   0  0.00     0.00   0  0.00  10  5 85  0.45 0.31 0.33
    0.00   0  0.00     0.00   0  0.00  10  5 85  0.45 0.31 0.33
    0.00   0  0.00     0.00   0  0.00  10  5 85  0.41 0.31 0.33
    0.00   0  0.00     0.00   0  0.00  10  5 85  0.41 0.31 0.33
  384.49  10  3.85    10.00   0  0.00  12  6 82  0.32 0.29 0.32
  291.73 126 35.78     0.00   0  0.00  23 13 64  0.38 0.31 0.33
  236.65 338 78.20     0.00   0  0.00  30 17 53  0.34 0.30 0.33
  397.61  21  8.02     0.00   0  0.00  15  8 77  0.34 0.30 0.33
    0.00   0  0.00     0.00   0  0.00  11  6 83  0.32 0.30 0.32
    0.00   0  0.00     0.00   0  0.00  12  7 81  0.32 0.30 0.32
    0.00   0  0.00     0.00   0  0.00  12  6 82  0.29 0.29 0.32
    0.00   0  0.00     0.00   0  0.00  11  6 83  0.35 0.30 0.33
    0.00   0  0.00     0.00   0  0.00  13  6 80  0.35 0.30 0.33
    0.00   0  0.00     0.00   0  0.00  11  6 83  0.32 0.30 0.32
          disk0           disk1       cpu     load average
    KB/t tps  MB/s     KB/t tps  MB/s  us sy id   1m   5m   15m
    0.00   0  0.00     0.00   0  0.00  13  8 78  0.32 0.30 0.32
    0.00   0  0.00     0.00   0  0.00  11  7 82  0.29 0.29 0.32
    0.00   0  0.00     0.00   0  0.00  10  5 86  0.35 0.30 0.33
  148.94 124 18.03     0.00   0  0.00  18  8 73  0.35 0.30 0.33
  267.73 121 31.72     0.00   0  0.00  17  8 76  0.32 0.30 0.32
  355.54 162 56.35     0.00   0  0.00  22  8 69  0.32 0.30 0.32
  738.07  38 27.38     0.00   0  0.00  16  6 78  0.30 0.29 0.32
  512.42  67 33.52     0.00   0  0.00  20  7 73  0.27 0.29 0.32
  835.74  61 50.05     0.00   0  0.00  19  7 73  0.27 0.29 0.32
  536.83  69 36.17     0.00   0  0.00  17  6 76  0.49 0.33 0.34
  543.89  83 43.90     0.00   0  0.00  20  8 72  0.49 0.33 0.34
  720.70  59 41.74     0.00   0  0.00  18  7 76  0.45 0.33 0.33
  541.23 124 65.70     0.00   0  0.00  22  9 70  0.41 0.32 0.33
  260.54 210 53.37     0.00   0  0.00  22  9 70  0.41 0.32 0.33
  806.93  73 57.78     0.00   0  0.00  20  8 72  0.46 0.33 0.34
  874.98  43 37.02     0.00   0  0.00  13  7 80  0.46 0.33 0.34
    0.00   0  0.00     0.00   0  0.00  11  4 85  0.42 0.33 0.33
    0.00   0  0.00     0.00   0  0.00   8  4 88  0.39 0.32 0.33
    0.00   0  0.00     0.00   0  0.00   9  4 87  0.39 0.32 0.33
    0.00   0  0.00     0.00   0  0.00   8  4 88  0.44 0.33 0.33
          disk0           disk1       cpu     load average
    KB/t tps  MB/s     KB/t tps  MB/s  us sy id   1m   5m   15m
    0.00   0  0.00     0.00   0  0.00  11  5 84  0.44 0.33 0.33
    0.00   0  0.00     0.00   0  0.00  13  6 81  0.48 0.34 0.34
    0.00   0  0.00     0.00   0  0.00  10  4 86  0.44 0.34 0.34
    0.00   0  0.00     0.00   0  0.00   8  4 88  0.44 0.34 0.34
    0.00   0  0.00     0.00   0  0.00   8  4 88  0.41 0.33 0.33
    0.00   0  0.00     0.00   0  0.00   8  4 88  0.41 0.33 0.33
    0.00   0  0.00     0.00   0  0.00   8  4 87  0.38 0.32 0.33
    0.00   0  0.00     0.00   0  0.00   7  4 89  0.35 0.32 0.33
    0.00   0  0.00     0.00   0  0.00   8  4 87  0.35 0.32 0.33
    0.00   0  0.00     0.00   0  0.00   7  3 89  0.32 0.31 0.33
    0.00   0  0.00     0.00   0  0.00   8  4 88  0.32 0.31 0.33
    0.00   0  0.00     0.00   0  0.00   7  3 90  0.29 0.31 0.33
  347.11  92 31.29     0.00   0  0.00  20  8 72  0.43 0.34 0.33
   49.98 656 32.03     0.00   0  0.00  32 10 59  0.43 0.34 0.33
  113.45 351 38.90     0.00   0  0.00  40 15 45  0.47 0.35 0.34
  819.41  34 27.20     0.00   0  0.00  26 12 63  0.47 0.35 0.34
  686.99  50 33.76     0.00   0  0.00  18  7 76  0.52 0.36 0.34
  878.17  23 20.01     0.00   0  0.00  20  8 72  0.47 0.35 0.34
    0.00   0  0.00     0.00   0  0.00   8  4 87  0.47 0.35 0.34
    0.00   0  0.00     0.00   0  0.00   8  4 88  0.44 0.34 0.34</pre></td></tr></table></div>

<p>You can see in the MB/s column, lots of &#8220;0.00&#8243; followed by some bursts of ~30 MB/s.  The zeros didn&#8217;t actually print at the time, but flooded the screen in bursts when the bottleneck cleared up.  It seems to me like it might be some problem with queueing or caching, or maybe the SATA controller on this Mac just isn&#8217;t up to the task of SSDs.  I&#8217;m not sure, but at this point I&#8217;m afraid I might have to go back to the 7200 RPM Seagate that came with the Mac.  30-second hangups are far more annoying than having lots of things be slower.  Kind of a strange amortization, if you think about it.  Anyway, I&#8217;ll keep looking into it, now that I know how to reproduce the problem (unzip a huge file).</p>
<p><ins datetime="2011-08-23T20:19:03+00:00">Updated</ins>: A quick Google search for &#8220;beach ball mac SSD&#8221; turned up  <a href="http://crucial.lithium.com/t5/Solid-State-Drives-SSD/MacBook-Pro-Spinning-Beach-Ball-Help/td-p/42328">this thread</a> which seems to be about this same problem, with a different model SSD.  Also referenced in <a href="https://discussions.apple.com/thread/3110516?start=0&#038;tstart=0">this thread</a> on Apple.com.  It feels like the problem may be due to an &#8220;old&#8221; SSD.</p>
<p><ins datetime="2011-08-24T13:04:41+00:00">Updated again</ins>: Here&#8217;s someone having the problem with a Corsair 128 GB SSD: <a href="http://forum.corsair.com/v3/showthread.php?t=91061">http://forum.corsair.com/v3/showthread.php?t=91061</a>.</p>
<p><ins datetime="2011-08-24T16:48:08+00:00">Updated again</ins>: According to <a href="http://forum.crucial.com/t5/Solid-State-Drives-SSD/M4-SSD-with-8GB-DDR3-PC3-8500-on-MBP-5-5-13-2-53-GHz-Mid-2009/m-p/58702/highlight/true#M18141">this post</a>, this appears to be a problem with the SATA controller in the 2009 Macbooks.  Bah.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanhoffman.com/evan/2011/08/23/macbook-pro-locks-up-with-ssd-installed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FCC Report shows Verizon much faster than Cablevision</title>
		<link>http://www.evanhoffman.com/evan/2011/08/11/fcc-report-shows-verizon-much-faster-than-cablevision/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=fcc-report-shows-verizon-much-faster-than-cablevision</link>
		<comments>http://www.evanhoffman.com/evan/2011/08/11/fcc-report-shows-verizon-much-faster-than-cablevision/#comments</comments>
		<pubDate>Thu, 11 Aug 2011 21:14:18 +0000</pubDate>
		<dc:creator>Evan Hoffman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cablevision]]></category>
		<category><![CDATA[cablevision vs fios]]></category>
		<category><![CDATA[fcc]]></category>
		<category><![CDATA[fios]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[isp]]></category>
		<category><![CDATA[long island]]></category>
		<category><![CDATA[money]]></category>
		<category><![CDATA[optimum]]></category>
		<category><![CDATA[speed]]></category>
		<category><![CDATA[verizon]]></category>

		<guid isPermaLink="false">http://www.evanhoffman.com/evan/?p=1519</guid>
		<description><![CDATA[TweetThe FCC recently conducted a study of some of the top broadband ISPs in the country and measured customers&#8217; actual bandwidth as compared to what the ISPs advertised. FiOS really came out on top. The report is available on the FCC site. The bottom line, though, is that Verizon FiOS averaged nearly 120% of advertised [...]]]></description>
			<content:encoded><![CDATA[<div style="vertical-align: top; float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.evanhoffman.com/evan/2011/08/11/fcc-report-shows-verizon-much-faster-than-cablevision/&via=EvanHoffman&text=FCC Report shows Verizon much faster than Cablevision&related=EvanHoffman:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="small" href="http://www.evanhoffman.com/evan/2011/08/11/fcc-report-shows-verizon-much-faster-than-cablevision/"></g:plusone></div><p>The FCC recently conducted a study of some of the top broadband ISPs in the country and measured customers&#8217; actual bandwidth as compared to what the ISPs advertised.  FiOS really came out on top.</p>
<p>The report is available <a href="http://transition.fcc.gov/cgb/measuringbroadbandreport/Measuring_U.S._-_Main_Report_Full.pdf">on the FCC site</a>.  The bottom line, though, is that Verizon FiOS averaged nearly 120% of advertised speed (i.e., more than was advertised) and Cablevision was between 50% and 75% of advertised speeds.  Latency (ping) was also heavily in FiOS&#8217;s favor.</p>
<p><div id="attachment_1526" class="wp-caption aligncenter" style="width: 634px"><a href="http://www.evanhoffman.com/evan/2011/08/11/fcc-report-shows-verizon-much-faster-than-cablevision/fios_vs_cv/" rel="attachment wp-att-1526"><img src="http://www.evanhoffman.com/evan/wp-content/uploads/2011/08/fios_vs_cv.png" alt="FCC - Fios vs Cablevision" title="FCC - Fios vs Cablevision" width="624" height="474" class="size-full wp-image-1526" /></a><p class="wp-caption-text">FCC - Fios vs Cablevision</p></div><br />
<span id="more-1519"></span><br />
The methodology was pretty interesting:</p>
<blockquote><p>
More than 78,000 consumers volunteered to participate in this study and a total of approximately 9,000 consumers were selected as potential participants and were supplied with specially configured routers.  The data in this Report is based on a statistically selected subset of those consumers—approximately 6,800 individuals—and the measurements taken in their homes during March 2011.  The participants in the volunteer consumer panel were recruited with the goal of covering ISPs within the U.S. across all broadband technologies, although only results from three major technologies—DSL, cable, and fiber-to-the-home—are reflected in<br />
this Report.  To account for network variances across the United States, volunteers were recruited from the four Census Regions: Northeast, Midwest, South, and West.  Within each Census Region, consumers were selected to represent broadband performance in three typical speed ranges: less than 3 Mbps, between 3 and 10 Mbps, greater than 10 Mbps.</p>
<p>The testing methodology itself required innovation on both the consumer, or “client,” side and on the ISP, or “server,” side.  The server-side infrastructure, which comprised reference measurement points that were distributed geographically across nine different U.S. locations, was made available to SamKnows for the project by M-Lab, a non-profit organization that supports Internet research activities. Each consumer participant’s broadband performance was measured from a hardware gateway in his or her household to the off-net test node that had the lowest latency to the consumer’s address.  </p>
<p>On the “client” side of the test, consumers self-installed a measurement gateway that was provided by SamKnows.  These gateways, or “Whiteboxes,” were installed between the consumer’s computer and Internet gateway and came pre-loaded with custom testing software.  The “Whitebox” software was programmed to automatically perform a periodic suite of broadband measurements while excluding the effects of consumer equipment and household broadband activity.  This approach permitted a direct measure of the broadband service an ISP delivered to a consumer’s household.
</p></blockquote>
<p>Anyone who&#8217;s experienced both Cablevision and Verizon can probably corroborate these results.  Unless Cablevision significantly improves their services (DVR/TV as well as Internet), at the same price there&#8217;s no way I&#8217;d go back to Cablevision; I&#8217;d even stick with Verizon if it meant spending $10-$20 more per month, the service is that much better.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanhoffman.com/evan/2011/08/11/fcc-report-shows-verizon-much-faster-than-cablevision/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Logging RT username in Apache access_log</title>
		<link>http://www.evanhoffman.com/evan/2011/08/08/logging-rt-username-in-apache-access_log/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=logging-rt-username-in-apache-access_log</link>
		<comments>http://www.evanhoffman.com/evan/2011/08/08/logging-rt-username-in-apache-access_log/#comments</comments>
		<pubDate>Mon, 08 Aug 2011 21:34:18 +0000</pubDate>
		<dc:creator>Evan Hoffman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[access_log]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[httpd.conf]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[mod_perl]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[rt]]></category>
		<category><![CDATA[rtuser]]></category>
		<category><![CDATA[username]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.evanhoffman.com/evan/?p=1513</guid>
		<description><![CDATA[TweetRT has its own internal accounting &#038; tracking system for logging activity, but I was interested in even more granular stuff, like seeing who looked at which tickets. I figured it wouldn&#8217;t be that hard to log this in Apache. Well, I was kind of right, in that it wasn&#8217;t &#8220;hard,&#8221; but it took me [...]]]></description>
			<content:encoded><![CDATA[<div style="vertical-align: top; float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.evanhoffman.com/evan/2011/08/08/logging-rt-username-in-apache-access_log/&via=EvanHoffman&text=Logging RT username in Apache access_log&related=EvanHoffman:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="small" href="http://www.evanhoffman.com/evan/2011/08/08/logging-rt-username-in-apache-access_log/"></g:plusone></div><p><a href="http://bestpractical.com/rt/">RT</a> has its own internal accounting &#038; tracking system for logging activity, but I was interested in even more granular stuff, like seeing who looked at which tickets.  I figured it wouldn&#8217;t be that hard to log this in Apache.  Well, I was kind of right, in that it wasn&#8217;t &#8220;hard,&#8221; but it took me a long time to find the right place to do it.  I did finally get it though.<br />
<span id="more-1513"></span></p>
<h3>httpd.conf</h3>
<p>In <code>httpd.conf</code> I created a new LogFormat:</p>

<div class="wp_syntax"><div class="code"><pre class="conf" style="font-family:monospace;">LogFormat &quot;%h %l %{RTUSER}e %t \&quot;%r\&quot; %&gt;s %b \&quot;%{Referer}i\&quot; \&quot;%{User-Agent}i\&quot;&quot; combined-rt</pre></div></div>

<p>So instead of the HTTP-auth user, it puts the RT user in this field.  Make sure to update your VirtualHost config to use the combined-rt LogFormat.</p>
<h3>/usr/share/rt3/html/autohandler</h3>
<p>In <code>/usr/share/rt3/html/autohandler</code>, right under this section:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># If we've got credentials, let's serve the file up.</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>    <span style="color: #009900;">&#40;</span> <span style="color: #000066;">defined</span> <span style="color: #0000ff;">$session</span><span style="color: #009900;">&#123;</span><span style="color: #ff0000;">'CurrentUser'</span><span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#41;</span>
    <span style="color: #b1b100;">and</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$session</span><span style="color: #009900;">&#123;</span><span style="color: #ff0000;">'CurrentUser'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">Id</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span></pre></div></div>

<p>Add this:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;">        <span style="color: #0000ff;">$ENV</span><span style="color: #009900;">&#123;</span><span style="color: #ff0000;">'RTUSER'</span><span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$session</span><span style="color: #009900;">&#123;</span><span style="color: #ff0000;">'CurrentUser'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">UserObj</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">EmailAddress</span><span style="color: #339933;">;</span></pre></div></div>

<p>This populates the RTUSER environment variable with the currently-logged-in user&#8217;s email address.</p>
<p>Restart httpd and the RT user&#8217;s email address should now appear in <code>access_log</code>.  Note that it will only appear for Perl pages (not gifs/jpgs or other static content, since Perl doesn&#8217;t process those):</p>

<div class="wp_syntax"><div class="code"><pre class="log" style="font-family:monospace;">10.0.0.10 - evan@example.com [08/Aug/2011:17:30:34 -0400] &quot;GET /rt3/index.html HTTP/1.1&quot; 200 46809 &quot;-&quot; &quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0.1) Gecko/20100101 Firefox/5.0.1&quot;
10.0.0.10 - - [08/Aug/2011:17:30:34 -0400] &quot;GET /rt3/NoAuth/images//css/rolldown-arrow.gif HTTP/1.1&quot; 200 83 &quot;https://help.example.com/rt3/NoAuth/css/3.5-default/main-squished.css&quot; &quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0.1) Gecko/20100101 Firefox/5.0.1&quot;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.evanhoffman.com/evan/2011/08/08/logging-rt-username-in-apache-access_log/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Amazon SES: &#8220;illegal headers&#8221; with ses-send-email.pl (followup)</title>
		<link>http://www.evanhoffman.com/evan/2011/08/02/amazon-ses-illegal-headers-with-ses-send-email-pl-followup/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=amazon-ses-illegal-headers-with-ses-send-email-pl-followup</link>
		<comments>http://www.evanhoffman.com/evan/2011/08/02/amazon-ses-illegal-headers-with-ses-send-email-pl-followup/#comments</comments>
		<pubDate>Tue, 02 Aug 2011 18:39:45 +0000</pubDate>
		<dc:creator>Evan Hoffman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[auto-submitted]]></category>
		<category><![CDATA[bugzilla]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[errors]]></category>
		<category><![CDATA[illegal headers]]></category>
		<category><![CDATA[organization]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[ses]]></category>
		<category><![CDATA[ses-send-email.pl]]></category>
		<category><![CDATA[smtp]]></category>
		<category><![CDATA[smtp headers]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[x-header]]></category>

		<guid isPermaLink="false">http://www.evanhoffman.com/evan/?p=1486</guid>
		<description><![CDATA[TweetA few people have emailed me asking me to integrate the perl code snippet into I wrote to strip illegal headers when sending email via Amazon SES into something actually usable. I&#8217;ve done so! I haven&#8217;t really tested this beyond sending some test emails, but here it is. Use this at your own risk, I [...]]]></description>
			<content:encoded><![CDATA[<div style="vertical-align: top; float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.evanhoffman.com/evan/2011/08/02/amazon-ses-illegal-headers-with-ses-send-email-pl-followup/&via=EvanHoffman&text=Amazon SES: "illegal headers" with ses-send-email.pl (followup) &related=EvanHoffman:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="small" href="http://www.evanhoffman.com/evan/2011/08/02/amazon-ses-illegal-headers-with-ses-send-email-pl-followup/"></g:plusone></div><p>A few people have emailed me asking me to integrate <a href="http://www.evanhoffman.com/evan/?p=1270">the perl code snippet into I wrote to strip illegal headers</a> when sending email via Amazon SES into something actually usable.  I&#8217;ve done so!  I haven&#8217;t really tested this beyond sending some test emails, but here it is.  Use this at your own risk, I make no warranty, blah blah blah.<br />
<span id="more-1486"></span><br />
This fix requires editing <code>ses-send-email.pl</code>, so I&#8217;d advise making a backup copy, though I imagine you can always get a fresh version from Amazon if necessary.</p>
<p>Open ses-send-email.pl in a text editor and find the <code>read_message</code> method.  It should look like this:<br />
<script src="https://gist.github.com/1120804.js?file=ses-send-email.pl"></script></p>
<p>Delete that and paste this in its place:<br />
<script src="https://gist.github.com/1120804.js?file=evan-ses-send-email.pl"></script></p>
<p>I tried it on the command line and it gave the output I expected &#8211; I haven&#8217;t tried integrating it with sendmail/postfix since I haven&#8217;t encountered this problem.  Here&#8217;s the test message I attempted to send:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">From: evan<span style="color: #000000; font-weight: bold;">@</span>example.com
To: evan<span style="color: #000000; font-weight: bold;">@</span>example.com
Subject: Email
Chicken: yummy
Cats: yucky
X-Zombies: <span style="color: #c20cb9; font-weight: bold;">kill</span> them<span style="color: #000000; font-weight: bold;">!</span>
&nbsp;
Now we<span style="color: #ff0000;">'re out of the header, into the body.  Grand!</span></pre></div></div>

<p><code>From</code>, <code>To</code>, and <code>Subject</code> are required headers.  <code>Chicken</code> &#038; <code>Cats</code> are illegal, <code>X-Zombies</code> should be ok since it&#8217;s X-ified.  Here&#8217;s what happened when I tried to send with the unmodified ses-send-email.pl:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>Tue Aug 02 <span style="color: #000000;">14</span>:<span style="color: #000000;">14</span>:<span style="color: #000000;">51</span> evan<span style="color: #000000; font-weight: bold;">@</span>EvanMBP <span style="color: #000000;">62</span> amazon-email<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ .<span style="color: #000000; font-weight: bold;">/</span>ses-send-email.pl <span style="color: #660033;">--verbose</span> <span style="color: #660033;">-k</span> aws-credentials <span style="color: #660033;">-r</span>
From: evan<span style="color: #000000; font-weight: bold;">@</span>example.com
To: evan<span style="color: #000000; font-weight: bold;">@</span>example.com
Subject: Email
Chicken: yummy
Cats: yucky
X-Zombies: <span style="color: #c20cb9; font-weight: bold;">kill</span> them<span style="color: #000000; font-weight: bold;">!</span>
&nbsp;
Now we<span style="color: #ff0000;">'re out of the header, into the body.  Grand!
&nbsp;
&nbsp;
&lt;ErrorResponse xmlns=&quot;http://ses.amazonaws.com/doc/2010-12-01/&quot;&gt;
  &lt;Error&gt;
    &lt;Type&gt;Sender&lt;/Type&gt;
    &lt;Code&gt;InvalidParameterValue&lt;/Code&gt;
    &lt;Message&gt;Illegal header '</span>Chicken<span style="color: #ff0000;">'.&lt;/Message&gt;
  &lt;/Error&gt;
  &lt;RequestId&gt;5ffad294-bd33-11e0-b6e3-affca9ad1eb5&lt;/RequestId&gt;
&lt;/ErrorResponse&gt;
Illegal header '</span>Chicken<span style="color: #ff0000;">'.</span></pre></div></div>

<p>Illegal header error.  Now with the modified version:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>Tue Aug 02 <span style="color: #000000;">14</span>:<span style="color: #000000;">15</span>:<span style="color: #000000;">17</span> evan<span style="color: #000000; font-weight: bold;">@</span>EvanMBP <span style="color: #000000;">63</span> amazon-email<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ .<span style="color: #000000; font-weight: bold;">/</span>ses-send-email-x-headers.pl <span style="color: #660033;">--verbose</span> <span style="color: #660033;">-k</span> aws-credentials <span style="color: #660033;">-r</span>
From: evan<span style="color: #000000; font-weight: bold;">@</span>example.com
To: evan<span style="color: #000000; font-weight: bold;">@</span>example.com
Subject: Email
Chicken: yummy
Cats: yucky
X-Zombies: <span style="color: #c20cb9; font-weight: bold;">kill</span> them<span style="color: #000000; font-weight: bold;">!</span>
&nbsp;
Now we<span style="color: #ff0000;">'re out of the header, into the body.  Grand!
&nbsp;
&nbsp;
&lt;SendRawEmailResponse xmlns=&quot;http://ses.amazonaws.com/doc/2010-12-01/&quot;&gt;
  &lt;SendRawEmailResult&gt;
    &lt;MessageId&gt;000001318bb51442-c2cfb780-0604-4363-925a-54a57015e567-000000&lt;/MessageId&gt;
  &lt;/SendRawEmailResult&gt;
  &lt;ResponseMetadata&gt;
    &lt;RequestId&gt;64e75a47-bd33-11e0-9d09-8f08f31615ad&lt;/RequestId&gt;
  &lt;/ResponseMetadata&gt;
&lt;/SendRawEmailResponse&gt;</span></pre></div></div>

<p>No errors, and I received the email below (extraneous SMTP headers added by Barracuda/Exchange removed):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">From: <span style="color: #000000; font-weight: bold;">&lt;</span>evan<span style="color: #000000; font-weight: bold;">@</span>example.com<span style="color: #000000; font-weight: bold;">&gt;</span>
To: <span style="color: #000000; font-weight: bold;">&lt;</span>evan<span style="color: #000000; font-weight: bold;">@</span>example.com<span style="color: #000000; font-weight: bold;">&gt;</span>
Subject: Email
X-Chicken: yummy
X-ASG-Orig-Subj: Email
X-Cats: yucky
X-Zombies: <span style="color: #c20cb9; font-weight: bold;">kill</span> them<span style="color: #000000; font-weight: bold;">!</span>
Date: Tue, <span style="color: #000000;">2</span> Aug <span style="color: #000000;">2011</span> <span style="color: #000000;">18</span>:<span style="color: #000000;">15</span>:<span style="color: #000000;">25</span> +0000
Message-ID: <span style="color: #000000; font-weight: bold;">&lt;</span>000001318bb51442-c2cfb780-0604-<span style="color: #000000;">4363</span>-925a-54a57015e567-000000<span style="color: #000000; font-weight: bold;">@</span>email.amazonses.com<span style="color: #000000; font-weight: bold;">&gt;</span>
Content-Type: text<span style="color: #000000; font-weight: bold;">/</span>plain
MIME-Version: <span style="color: #000000;">1.0</span>
&nbsp;
Now we<span style="color: #ff0000;">'re out of the header, into the body.  Grand!</span></pre></div></div>

<p>Illegal headers have been X-ified.  Hope this helps someone.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanhoffman.com/evan/2011/08/02/amazon-ses-illegal-headers-with-ses-send-email-pl-followup/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>US Public Debt &#8211; historical</title>
		<link>http://www.evanhoffman.com/evan/2011/07/27/us-public-debt-historical/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=us-public-debt-historical</link>
		<comments>http://www.evanhoffman.com/evan/2011/07/27/us-public-debt-historical/#comments</comments>
		<pubDate>Wed, 27 Jul 2011 17:14:10 +0000</pubDate>
		<dc:creator>Evan Hoffman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[chart]]></category>
		<category><![CDATA[debt]]></category>
		<category><![CDATA[debt ceiling]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[historical]]></category>
		<category><![CDATA[money]]></category>
		<category><![CDATA[public debt]]></category>
		<category><![CDATA[taxes]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://www.evanhoffman.com/evan/?p=1461</guid>
		<description><![CDATA[Charts and data related to growth of the US public debt from 1790 through 2010.]]></description>
			<content:encoded><![CDATA[<div style="vertical-align: top; float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.evanhoffman.com/evan/2011/07/27/us-public-debt-historical/&via=EvanHoffman&text=US Public Debt - historical&related=EvanHoffman:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="small" href="http://www.evanhoffman.com/evan/2011/07/27/us-public-debt-historical/"></g:plusone></div><p>In a recent &#8220;debate&#8221; with a friend, I looked for historical data about the US public debt.  I found <a href="http://www.google.com/publicdata/overview?ds=z6tggkh2adod2s_">Google Public Data</a>, which has info about the annual budget deficit/surplus, but apparently (oddly) doesn&#8217;t have the debt.  Odd because this info is available <a href="http://www.treasurydirect.gov/govt/reports/pd/histdebt/histdebt.htm">on the Treasury website</a>.<br />
<span id="more-1461"></span><br />
I copied &#038; pasted the data into Google Docs and made <a href="https://spreadsheets.google.com/spreadsheet/ccc?key=0Arz9JIGL5KjodGlHZjZyRE9YXzBRd0JpVDRKWkE1d0E&#038;hl=en_US">a chart of my own</a> and some basic comparisons over time.  Here are some of them rendered as images, though the scale makes the horizontal access kind of useless.  I tried embedding the interactive Flash-based graph but it didn&#8217;t work.  Oh well.</p>
<p><script type="text/javascript" src="//ajax.googleapis.com/ajax/static/modules/gviz/1.0/chart.js"> {"dataSourceUrl":"//spreadsheets.google.com/spreadsheet/tq?key=0Arz9JIGL5KjodGlHZjZyRE9YXzBRd0JpVDRKWkE1d0E&#038;transpose=0&#038;headers=1&#038;range=A1%3AC461&#038;gid=0&#038;pub=1","options":{"displayAnnotations":true,"title":"","backgroundColor":"#FFFFFF","legend":"right","logScale":false,"wmode":"opaque","hAxis":{"maxAlternation":1},"hasLabelsColumn":true,"width":550,"height":400},"state":{},"chartType":"AnnotatedTimeLine","chartName":"US Public Debt"} </script></p>
<p><img src="https://spreadsheets.google.com/spreadsheet/oimg?key=0Arz9JIGL5KjodGlHZjZyRE9YXzBRd0JpVDRKWkE1d0E&#038;oid=4&#038;zx=4edluian0c8k" /></p>
<p><img src="https://spreadsheets.google.com/spreadsheet/oimg?key=0Arz9JIGL5KjodGlHZjZyRE9YXzBRd0JpVDRKWkE1d0E&#038;oid=6&#038;zx=2eawru1ol7c2" /></p>
<p><img src="https://spreadsheets.google.com/spreadsheet/oimg?key=0Arz9JIGL5KjodGlHZjZyRE9YXzBRd0JpVDRKWkE1d0E&#038;oid=8&#038;zx=yeflxb3p4oqi" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanhoffman.com/evan/2011/07/27/us-public-debt-historical/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>33 hours to restore a Postgres DB</title>
		<link>http://www.evanhoffman.com/evan/2011/07/26/33-hours/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=33-hours</link>
		<comments>http://www.evanhoffman.com/evan/2011/07/26/33-hours/#comments</comments>
		<pubDate>Tue, 26 Jul 2011 22:10:01 +0000</pubDate>
		<dc:creator>Evan Hoffman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[logger]]></category>
		<category><![CDATA[long]]></category>
		<category><![CDATA[pgrestore]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[restore]]></category>
		<category><![CDATA[syslog]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.evanhoffman.com/evan/?p=1457</guid>
		<description><![CDATA[Restoring a huge DB takes a long time.]]></description>
			<content:encoded><![CDATA[<div style="vertical-align: top; float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.evanhoffman.com/evan/2011/07/26/33-hours/&via=EvanHoffman&text=33 hours to restore a Postgres DB&related=EvanHoffman:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="plus-one-wrap"><g:plusone size="small" href="http://www.evanhoffman.com/evan/2011/07/26/33-hours/"></g:plusone></div><p>Having <a href="http://www.evanhoffman.com/evan/?p=1390">migrated our DB to a new machine</a>, I was left with a pretty good machine unused.  I decided to rebuild it and try out Postgres 9.0.<br />
<span id="more-1457"></span><br />
I downloaded and installed CentOS 6.0 x86_64, built Postgres 9.0.4 from SRPMS (makes me feel better building it myself), installed it and did <code>initdb</code>, dumped the primary DB to our NAS using <code>psql</code> 9.0 (<code>pg_dump [db] | gzip > /path/to/file.gz</code>) and began the restore.</p>
<p>Not much of a story but it took 33 hours to restore the DB, with the bulk of the time spent building indices.  When the restore was complete I did an <code>analyze verbose</code> which took another 2 hours, for a total of 35 hours, not counting the time it took to create the dump file &#8211; about 14 hours, but this was with the DB under heavy load, made heavier by the dump, so I don&#8217;t know how long it would really take.  I&#8217;m glad I didn&#8217;t have to do this to migrate, but I&#8217;m not relishing the idea of doing a real upgrade to 9.0 if it&#8217;s going to take this long.  For the restore I disabled autovacuum and set <code>fsync = off</code>.  It&#8217;s an ext4 filesystem on a 24-disk RAID 10 of 10krpm SAS drives.</p>
<p>DB size on disk after a clean restore was 1156 GB, as per <code>pg_database_size()</code>, versus 1237 GB on disk for the one that was migrated via bit-copy, so there&#8217;s a sizable chunk of crud accumulated in there.</p>
<p>Also, in doing this I discovered the <a href="http://linux.die.net/man/1/logger">logger</a> command.  One of the things that I&#8217;ve always found annoying about doing a pg restore is that the output is just a bunch of statements like this:</p>
<pre>
SET
SET
SET
CREATE SCHEMA
ALTER SCHEMA
CREATE SCHEMA
ALTER SCHEMA
SET
CREATE TABLE
ALTER TABLE
CREATE FUNCTION
ALTER FUNCTION
</pre>
<p>This is just what&#8217;s returned from the SQL commands, but it&#8217;s not very informative, and most importantly it doesn&#8217;t show you the timestamp so you have no idea how long anything&#8217;s taking.  With <code>logger</code>, you can just pipe the output to it and it&#8217;ll be logged with syslog.  So my restore command looked like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">zcat</span> <span style="color: #000000; font-weight: bold;">/</span>nfs<span style="color: #000000; font-weight: bold;">/</span>db<span style="color: #000000; font-weight: bold;">/</span>pgdump-<span style="color: #000000;">90</span>.sql.gz <span style="color: #000000; font-weight: bold;">|</span> psql <span style="color: #660033;">-Upguser</span> db <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;</span> ~<span style="color: #000000; font-weight: bold;">/</span>restore.20110723-<span style="color: #000000;">1916</span>.log <span style="color: #000000; font-weight: bold;">|</span> logger <span style="color: #660033;">-t</span> PGRESTORE</pre></div></div>

<p>This made it trivial to get the messages out of <code>/var/log/messages</code> with grep:</p>
<pre>
[root@link log]# grep PGRESTORE messages | head
Jul 24 03:36:43 link PGRESTORE: ALTER TABLE
Jul 24 03:36:43 link PGRESTORE: SET
Jul 24 03:36:44 link PGRESTORE: ALTER TABLE
Jul 24 03:36:44 link PGRESTORE: ALTER TABLE
Jul 24 03:38:45 link PGRESTORE: ALTER TABLE
Jul 24 03:39:13 link PGRESTORE: ALTER TABLE
Jul 24 03:39:13 link PGRESTORE: ALTER TABLE
Jul 24 03:39:13 link PGRESTORE: ALTER TABLE
Jul 24 03:39:13 link PGRESTORE: SET
Jul 24 03:39:13 link PGRESTORE: ALTER TABLE
</pre>
<p>In addition to having the timestamps it eliminates the accumulation of the random log files that accumulate like droppings from myriad one-off scripts.  I modified about 20 cron jobs to pipe their output to logger rather than junk files in /tmp or my homedir.  I can&#8217;t believe I never heard of logger before!  Hooray for logger!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evanhoffman.com/evan/2011/07/26/33-hours/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

