<?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>Yet another tech blog</title>
	<atom:link href="http://www.daemonize.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.daemonize.com/blog</link>
	<description>The personal blog of Paul Krohn, writing in San Francisco.</description>
	<lastBuildDate>Sat, 03 Dec 2011 16:16:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>maximize</title>
		<link>http://www.daemonize.com/blog/?p=460</link>
		<comments>http://www.daemonize.com/blog/?p=460#comments</comments>
		<pubDate>Sat, 03 Dec 2011 06:24:27 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[tech talk]]></category>

		<guid isPermaLink="false">http://www.daemonize.com/blog/?p=460</guid>
		<description><![CDATA[The ubiquitous maximize button on Flash video players is missing on a certain URL of interest to me. You can only watch it at 325&#215;198 px (it&#8217;s actually almost twice those dimensions). This has forced &#8212; and I do mean forced &#8212; me to rummage through the page and find a way to download the [...]]]></description>
			<content:encoded><![CDATA[<p>The ubiquitous maximize button on Flash video players is missing on a certain <a href="http://sharks.nhl.com/club/gamevideo.htm?id=2011020365">URL</a> of interest to me. You can only watch it at 325&#215;198 px (it&#8217;s actually almost twice those dimensions). This has forced &#8212; and I do mean forced &#8212; me to rummage through the page and find a way to download the content so I can view it at a normal size.</p>
<p>I started with the usual &#8220;inspect element&#8221; routine, and discovered that the media is streamed via rtmp. This requires an Intermediate Internet Forensics Kit to untangle:</p>
<ul>
<li>a way to decode the flashvars variable that is passed by the browser to Flash</li>
<li>a tool to download the RTMP stream</li>
<li>a way to play the downloaded file</li>
</ul>
<div>OK so the first step is install some tools, maybe actually just one, called rtmpdump. I used the MacPorts collection to install it.</div>
<div>to find the URL of the video stream, which is kept in a variable called &#8220;jsonString&#8221;. You can get at it like this:</div>
<pre>$ curl "http://sharks.nhl.com/club/gamevideo.htm?id=2011020365" | grep jsonString</pre>
<div>You&#8217;ll get a boatload of gibberish, including a bit that looks like this:</div>
<pre>rtmp:\/\/flash.onthefly.nhl.com\/ondemand\/NHLHighlights\/mp4:20112012\/02\/0365\/2_365_mtl_sjs_1112_h_continuous_1600K_16x9_1.mp4</pre>
<p>Well that is some hideous gibberish, way too many escape sequences. Pipe it through <code>sed 's/\\//g'</code> to get rid of the backslashes. Then it&#8217;ll be easy to  pick it apart:</p>
<ul>
<li>the host part: <code>flash.onthefly.nhl.com</code></li>
<li>the &#8220;app&#8221;, which is the first two URL path segments: <code>ondemand/NHLHighlights</code></li>
<li>the filename, in this case <code>2_3w65_mtl_sjs_1112_h_continuous_1600K_16x9_1.mp4</code></li>
</ul>
<p>OK so now we are ready to download! All you need to do is string all the details together, along with the URL of the swf file which is required for some wort of authentication token, like this:<br />
<code>$ rtmpdump -r rtmp://flash.onthefly.nhl.com -o sharks-habs-hilites.flv \<br />
−−swfVfy "http://www.nhl.com/swf/DynamicLeadThreeColumn.swf?v=5.7" \<br />
--app ondemand/NHLHighlights --playpath \<br />
mp4:20112012/02/0365/2_365_mtl_sjs_1112_h_continuous_800K_16x9_1.mp4</code><br />
The <code>-o</code> option specifies the output file (don&#8217;t be mislead by their use of .mp4 for a Flash video stream) and now you can open it in anything that can play an FLV, <a href="http://code.google.com/p/movist/">Movist</a> or <a href="http://www.videolan.org/">VLC</a> will do fine.</p>
<p>Final note to the folks at the NHL: I know you went to trouble to try and keep people from downloading, um, game highlights? Question for you: if there had been a maximize button on your player, would I have bothered with all this?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.daemonize.com/blog/?feed=rss2&#038;p=460</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>daiso</title>
		<link>http://www.daemonize.com/blog/?p=448</link>
		<comments>http://www.daemonize.com/blog/?p=448#comments</comments>
		<pubDate>Thu, 31 Mar 2011 22:56:29 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[offline]]></category>

		<guid isPermaLink="false">http://www.daemonize.com/blog/?p=448</guid>
		<description><![CDATA[How much do we love Daiso? Well, a lot since we found a bag for sundry pool items there. I am not sure what the original purpose of the bag is, though it is &#8220;A4-sized&#8221;, if you want to keep some paper in a soft bag. My favorite part is the inscription in the lower [...]]]></description>
			<content:encoded><![CDATA[<p>How much do we love Daiso? Well, a lot since we found a bag for sundry pool items there. I am not sure what the original purpose of the bag is, though it is &#8220;A4-sized&#8221;, if you want to keep some paper in a soft bag.</p>
<p>My favorite part is the inscription in the lower right corner, which reads:</p>
<blockquote><p>I will pack it with a wonderful memory. I open it, and look.</p></blockquote>
<p>Seriously, that is a lot of utility and entertainment for $1.50! Also entertaining is the V <em>mit Umlaut</em>.</p>
<div id="attachment_452" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.daemonize.com/blog/wp-content/uploads/2011/03/P1080772.jpg"><img class="size-medium wp-image-452" title="Daiso case inscription detail" src="http://www.daemonize.com/blog/wp-content/uploads/2011/03/P1080772-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">Detail from my new &quot;Favric Case.&quot;</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.daemonize.com/blog/?feed=rss2&#038;p=448</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>de-sea-foam-erator</title>
		<link>http://www.daemonize.com/blog/?p=435</link>
		<comments>http://www.daemonize.com/blog/?p=435#comments</comments>
		<pubDate>Sun, 20 Mar 2011 00:49:56 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[tech talk]]></category>

		<guid isPermaLink="false">http://www.daemonize.com/blog/?p=435</guid>
		<description><![CDATA[If there is a web site the you like the the content on, but can&#8217;t stand the look of, there are a number of options for adding your own CSS. There is Safari + &#8220;User CSS&#8221;, Firefox + GreaseMonkey, and so on. If, like me, you aren&#8217;t a designer and CSS does not come naturally [...]]]></description>
			<content:encoded><![CDATA[<p>If there is a web site the you like the the content on, but can&#8217;t stand the look of, there are a number of options for adding your own CSS. There is Safari + &#8220;User CSS&#8221;, Firefox + GreaseMonkey, and so on.</p>
<p>If, like me, you aren&#8217;t a designer and CSS does not come naturally to you, actually getting the CSS to load and work is another story. Here&#8217;s what I came up with to get rid of the sea foam scheme on http://www.sfgate.com/:</p>
<pre>a:visited {
 color:#282828 !important;
 text-decoration:none !important;
} 

a:link {
 color:#000000 !important;
 text-decoration:none !important;
} 

div.headernav_tile {
 background:none !important ;
}
div.headernav_leaderboard {
 background: none !important;
}</pre>
<p>The <code>!important</code> statement after each rule means the opposite of what it appears to a programmer. As the exclamation point symbol is frequently used to express &#8220;not&#8221;, it&#8217;s use here as &#8220;more&#8221; is counter-intuitive. Fortunately, the use interface for &#8220;User CSS&#8221; prompts you with this information or I might never have figured it out.</p>
<p>Finally, the <code>a:link</code> and <code>a:visited</code> stanzas are probably useful on most sites you might want to re-style; the last two stanzas are completely sfgate.com-specific.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.daemonize.com/blog/?feed=rss2&#038;p=435</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>crapware</title>
		<link>http://www.daemonize.com/blog/?p=428</link>
		<comments>http://www.daemonize.com/blog/?p=428#comments</comments>
		<pubDate>Fri, 19 Feb 2010 06:03:00 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[and yet true]]></category>
		<category><![CDATA[tech talk]]></category>

		<guid isPermaLink="false">http://www.daemonize.com/blog/?p=428</guid>
		<description><![CDATA[Can you guess the time we installed the &#8220;upgrade?&#8221; I&#8217;d take it more in stride, but this PostScript preflighting software licenses at $20k/host and stubbornly refuses to use more than one CPU/core. We were considering putting our 2 licenses on virtual hosts to at least free up some hardware, but can we really do that [...]]]></description>
			<content:encoded><![CDATA[<p>Can you guess the time we installed the &#8220;upgrade?&#8221;</p>
<p><a href="http://www.daemonize.com/blog/wp-content/uploads/2010/02/upgrade.png"><img class="aligncenter size-full wp-image-429" title="upgrade" src="http://www.daemonize.com/blog/wp-content/uploads/2010/02/upgrade.png" alt="" width="587" height="247" /></a></p>
<p>I&#8217;d take it more in stride, but this PostScript preflighting software licenses at $20k/host and stubbornly refuses to use more than one CPU/core. We were considering putting our 2 licenses on virtual hosts to at least free up some hardware, but can we really do that if it&#8217;ll consume 70% of a CPU when idle?</p>
<p>Add to that that you can&#8217;t run it as a service, you are requred to keep a generic user logged in at the console to run the application.</p>
<p>Fie on you!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.daemonize.com/blog/?feed=rss2&#038;p=428</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>silos</title>
		<link>http://www.daemonize.com/blog/?p=423</link>
		<comments>http://www.daemonize.com/blog/?p=423#comments</comments>
		<pubDate>Fri, 05 Feb 2010 06:41:58 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[and yet true]]></category>
		<category><![CDATA[tech talk]]></category>

		<guid isPermaLink="false">http://www.daemonize.com/blog/?p=423</guid>
		<description><![CDATA[An interesting op-ed by an former Microsoft VP, describing the silos that company is divided into and a bit of the internecine warfare that goes on between them. Microsoft posted a rebuttal, and one of their point was the integration of a product called OneNote into the Office suite. This was the first I had [...]]]></description>
			<content:encoded><![CDATA[<p>An interesting <a href="http://www.nytimes.com/2010/02/04/opinion/04brass.html">op-ed</a> by an former Microsoft VP, describing the silos that company is divided into and a bit of the internecine warfare that goes on between them.</p>
<p>Microsoft posted a <a href="http://office.microsoft.com/onenote">rebuttal</a>, and one of their point was the integration of a product called <a href="http://office.microsoft.com/onenote">OneNote</a> into the Office suite. This was the first I had ever heard of OneNote, so I clicked through to the <a href="http://office.microsoft.com/en-us/onenote/HA101672671033.aspx">demo</a> page and found that it requires Flash.</p>
<p>Maybe someone should tell the OneNote team about <a href="http://silverlight.net/">Silverlight</a>?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.daemonize.com/blog/?feed=rss2&#038;p=423</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>reservoirs</title>
		<link>http://www.daemonize.com/blog/?p=417</link>
		<comments>http://www.daemonize.com/blog/?p=417#comments</comments>
		<pubDate>Mon, 01 Feb 2010 16:15:26 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.daemonize.com/blog/?p=417</guid>
		<description><![CDATA[I know the reservoirs could use the boost, but still: sigh.]]></description>
			<content:encoded><![CDATA[<p>I know the reservoirs could <a href="http://www.sfgate.com/cgi-bin/article.cgi?f=/c/a/2009/12/01/BACB1ATBDL.DTL">use the boost</a>, but still: sigh.</p>
<p><a href="http://www.daemonize.com/blog/wp-content/uploads/2010/02/Screen-shot-2010-02-01-at-8.10.56-AM.png"><img class="aligncenter size-full wp-image-418" title="Screen shot 2010-02-01 at 8.10.56 AM" src="http://www.daemonize.com/blog/wp-content/uploads/2010/02/Screen-shot-2010-02-01-at-8.10.56-AM.png" alt="" width="290" height="188" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.daemonize.com/blog/?feed=rss2&#038;p=417</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>1862</title>
		<link>http://www.daemonize.com/blog/?p=404</link>
		<comments>http://www.daemonize.com/blog/?p=404#comments</comments>
		<pubDate>Sun, 17 Jan 2010 05:43:14 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.daemonize.com/blog/?p=404</guid>
		<description><![CDATA[I made previous reference to a scan available online of a map of San Francisco and my intention to put that map on a Google Map. Well, I&#8217;ve spent way more time on it than I anticipated but it finally, actually works as I originally envisioned. Challenges: Google Maps are aligned with &#8220;true north&#8221;; the [...]]]></description>
			<content:encoded><![CDATA[<p>I made <a href="/blog/?p=395">previous reference</a> to a scan available online of a map of San Francisco and my intention to put that map on a Google Map. Well, I&#8217;ve spent way more time on it than I anticipated but it finally, actually works as I originally envisioned.</p>
<p>Challenges:</p>
<ol>
<li>Google Maps are aligned with &#8220;true north&#8221;; the old map is aligned with some other north, possibly magnetic north at the time the map was made</li>
<li>the horizontal and vertical scales are not the same</li>
<li>the old map apparently fell apart and was taped back together; this was not done perfectly and there are a few small gaps and missing bits</li>
<li>the scale tends to vary over relatively small distances; agreement between the tiles I generated and Google&#8217;s tiles can wander even within one tile</li>
</ol>
<p>I ultimately decided not to fix items 3 and 4. Fixing the gaps tended to do more harm than good and scale variances require far more graphics-fu than I am ever likely to have.</p>
<p>If you want to cut to the chase &amp; see the map, it is <a href="/maps/oldsf/">here</a>.</p>
<p>Here is what I did:<span id="more-404"></span></p>
<ul>
<li>Create a map from Google tiles of the area of the map. This made it possible to determine both the rotation and scaling necessary.</li>
</ul>
<pre>#!/bin/bash
let EX=5236
let WY=12660
while [ ${EX} -lt 5243 ] ; do {
 while [ ${WY} -lt 12670 ] ; do {
 curl -o z15_x${EX}_${WY}.png "http://mt1.google.com/vt/lyrs=m@116&amp;hl=en&amp;src=api&amp;x=${EX}&amp;s=&amp;y=${WY}&amp;z=15&amp;s=Galileo"
 let WY=(${WY}+1);
 } ; done
 let EX=(${EX}+1);
 let WY=12660;
} ; done
</pre>
<p>To combine all these tiles into a larger map:</p>
<pre>#!/bin/bash
let EX=5236
let WY=12660
while [ ${WY} -lt 12670 ] ; do {
 FILES=`ls *${WY}*`
 echo "appending $FILES"
 convert ${FILES} +append ${WY}.png
 let WY=(${WY}+1);
} ; done
YFILES=`ls 12*.png`
convert $YFILES -append whole_map.png
</pre>
<p>(The convert binary is part of <a href="http://www.imagemagick.org/">ImageMagick</a>.)</p>
<p>Comparing this image with the <a href="http://www.flickr.com/photos/walkingsf/4245732273/sizes/o/">downloaded file</a>, I estimated that the rotation should be about 9 degrees counter-clockwise (ie, -9°). I rotated the image with:</p>
<pre>convert -rotate -9 whole_map.png whole_map_rotated.png</pre>
<p>This created a white background, I wanted the background to be clear. It seems to me you need to know the size of the image to on this image, so to rotate the image I did this:</p>
<pre>convert -size 4606x5108 xc:none -background \
 transparent \( whole_map_rotated.png -rotate -9 \) -flatten test.png
</pre>
<p>This gave me the rotated, clear-background image I needed. Once I started gereating the tiles based on that image, I discovered that if the tile crop area included a negative x or y offset, the image would be scaled awkwardly either in ImageMagick or in the browser. So I added a border area of 500 px on all sides to give a little margin for error. Unfortunately, after a lot of flopping around with ImageMagick, I resorted to Photoshop and the &#8220;canvas size&#8221; dialog.</p>
<p>Finally I wrote a <a href="http://www.daemonize.com/blog/wp-content/uploads/2010/01/oldsfpngs2.pl_.gz">script</a> to generate the tiles.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.daemonize.com/blog/?feed=rss2&#038;p=404</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tweets for 2010-01-10</title>
		<link>http://www.daemonize.com/blog/?p=403</link>
		<comments>http://www.daemonize.com/blog/?p=403#comments</comments>
		<pubDate>Mon, 11 Jan 2010 05:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.daemonize.com/blog/?p=403</guid>
		<description><![CDATA[pet peeve: &#34;simple&#34; script in &#60;new language&#62; gets unwieldy and I wind up re-doing it in Perl &#8230; maybe all I have is the 1 hammer? #]]></description>
			<content:encoded><![CDATA[<ul class="aktt_tweet_digest">
<li>pet peeve: &quot;simple&quot; script in &lt;new language&gt; gets unwieldy and I wind up re-doing it in Perl &#8230; maybe all I have is the 1 hammer? <a href="http://twitter.com/paul_krohn/statuses/7609880176" class="aktt_tweet_time">#</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.daemonize.com/blog/?feed=rss2&#038;p=403</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tweets for 2010-01-07</title>
		<link>http://www.daemonize.com/blog/?p=397</link>
		<comments>http://www.daemonize.com/blog/?p=397#comments</comments>
		<pubDate>Fri, 08 Jan 2010 05:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.daemonize.com/blog/?p=397</guid>
		<description><![CDATA[love my eyetv but the only API is AppleScript :( # if you had bit.ly preview, you would already know where that link goes &#8230; http://bit.ly/p7aq #]]></description>
			<content:encoded><![CDATA[<ul class="aktt_tweet_digest">
<li>love my eyetv but the only API is AppleScript :( <a href="http://twitter.com/paul_krohn/statuses/7468765805" class="aktt_tweet_time">#</a></li>
<li>if you had bit.ly preview, you would already know where that link goes &#8230; <a href="http://bit.ly/p7aq" rel="nofollow">http://bit.ly/p7aq</a> <a href="http://twitter.com/paul_krohn/statuses/7504021320" class="aktt_tweet_time">#</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.daemonize.com/blog/?feed=rss2&#038;p=397</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>neighborhood</title>
		<link>http://www.daemonize.com/blog/?p=395</link>
		<comments>http://www.daemonize.com/blog/?p=395#comments</comments>
		<pubDate>Fri, 08 Jan 2010 03:50:00 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[house]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.daemonize.com/blog/?p=395</guid>
		<description><![CDATA[I tweeted a few days ago about an article on SFGate about the little street we live on. A couple days after that, the SFist posted an old map of the city from 1862. Take close look at the map, in the lower left corner. If you follow Market Street to the lower left corner, [...]]]></description>
			<content:encoded><![CDATA[<p>I tweeted a few days ago about an article on SFGate about the little street we live on. A couple days after that, the <a href="http://sfist.com/2010/01/05/sf_map_1862.php">SFist posted</a> an old <a href="http://www.flickr.com/photos/walkingsf/4245732273/sizes/o/">map of the city</a> from 1862.</p>
<p>Take close look at the map, in the lower left corner. If you follow Market Street to the lower left corner, near a large number 11 is &#8220;Kate Street&#8221;. This street no longer exists, and it leads to an area labeled &#8220;Hospital Area&#8221;; this is now Duboce Park and three cul-de-sac blocks of homes, one of which is now Potomac St. It&#8217;s fun to see the map agree with what I read in the <a href="http://www.amazon.com/Good-Bad-Times-Francisco-Neighborhood/dp/0981450903">book by Harry Nimmo</a> referenced in the article.</p>
<p>I am entertaining a fantasy of creating a Google Map of the area and replacing the tiles with the old map. Hopefully I&#8217;ll actually get to that.</p>
<p>UPDATE: I&#8217;ve checked the <a href="http://code.google.com/apis/maps/documentation/overlays.html">Google Maps API</a>, and it seems what I need to do is a &#8220;Custom Map Type&#8221;, which The Google deems an &#8220;Advanced Topic.&#8221; They put this <span style="color: #ff0000;">in red</span>; I may be in over my head!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.daemonize.com/blog/?feed=rss2&#038;p=395</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 1.437 seconds -->
