<?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>Reallywow &#187; hacks</title>
	<atom:link href="http://blog.reallywow.com/archives/category/hacks/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.reallywow.com</link>
	<description>Really? Wow... That's Reallywow</description>
	<lastBuildDate>Thu, 27 May 2010 15:02:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>IRC Blocked? Create an SSH tunnel with PuTTY</title>
		<link>http://blog.reallywow.com/archives/83</link>
		<comments>http://blog.reallywow.com/archives/83#comments</comments>
		<pubDate>Fri, 12 Jun 2009 16:19:06 +0000</pubDate>
		<dc:creator>lbjay</dc:creator>
				<category><![CDATA[hacks]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[putty]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://blog.reallywow.com/?p=83</guid>
		<description><![CDATA[Can&#8217;t get to IRC because port 6667 is blocked on your local network? Here are some instructions for how to create a SSH tunnel using  PuTTY, and then connect to freenode (or any other IRC server) with Pidgin using the tunnel as a SOCKS5 proxy. You can most likely s/Pidgin/your IRC client of choice/, but [...]]]></description>
			<content:encoded><![CDATA[<abbr class="unapi-id" title="http://blog.reallywow.com/?p=83"><!-- &nbsp; --></abbr>
<p>Can&#8217;t get to IRC because port 6667 is blocked on your local network? Here are some instructions for how to create a SSH tunnel using  <a href="http://www.putty.org/">PuTTY</a>, and then connect to freenode (or any other IRC server) with <a href="http://www.pidgin.im/">Pidgin</a> using the tunnel as a SOCKS5 proxy. You can most likely <em>s/Pidgin/your IRC client of choice/</em>, but the screenshots below will show the Pidgin config dialogs. These instructions also assume that SSH, port 22, is not also blocked. Woe be to you if that is the case.</p>
<p>My original source for how to do this was <a href="http://everythinghurts.com/ssh-tunnelling/">this post</a>, which describes the same trick but for FireFox.</p>
<p><strong>Step 1</strong>: create a new PuTTY session configuration. In this case I using the login <strong>me@ssh.example.com</strong> and calling the session <strong>irc-7777</strong>. I usually name the session based on the local port number I&#8217;m going to forward.</p>
<div id="attachment_93" class="wp-caption aligncenter" style="width: 466px"><img class="size-full wp-image-93" title="putty1" src="http://blog.reallywow.com/wp-content/uploads/2009/06/putty11.png" alt="create and save a new PuTTY session " width="456" height="435" /><p class="wp-caption-text">create and save a new PuTTY session </p></div>
<p><strong>Step 2</strong>: go to the <strong>Connection -&gt; SSH -&gt; Tunnels</strong> node of the session config. In the Source port field enter &#8220;7777&#8243; (or some other port number). In the radio button section below that select <strong>Dynamic</strong> and <strong>Auto</strong>. Click the <strong>Add</strong> button. You should see &#8220;D7777&#8243; appear in the list of forwarded ports.</p>
<div id="attachment_94" class="wp-caption aligncenter" style="width: 466px"><img class="size-full wp-image-94" title="putty2" src="http://blog.reallywow.com/wp-content/uploads/2009/06/putty21.png" alt="Configure the ssh tunnel " width="456" height="435" /><p class="wp-caption-text">Configure the ssh tunnel </p></div>
<div id="attachment_95" class="wp-caption aligncenter" style="width: 466px"><img class="size-full wp-image-95" title="putty3" src="http://blog.reallywow.com/wp-content/uploads/2009/06/putty31.png" alt="Tunnel D7777 appears in the list" width="456" height="435" /><p class="wp-caption-text">Tunnel D7777 appears in the list</p></div>
<p><strong>Step 3</strong>: go back to the man session config node and save the session again. Then open the PuTTY session by clicking the <strong>Open</strong> button. A normal looking PuTTY terminal window should open. This session is your tunnel so you should probably leave it be. i.e., don&#8217;t use it for doing stuff in the shell and as a tunnel (although I don&#8217;t really know what consequences that would lead to). If the fact that this tunnel takes up space in your TaskBar (it does me) check out <a href="http://haanstra.eu/putty/">PuTTY-Tray</a>.</p>
<div id="attachment_97" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-97" title="putty4" src="http://blog.reallywow.com/wp-content/uploads/2009/06/putty4-300x150.png" alt="You've probably never seen one of these before" width="300" height="150" /><p class="wp-caption-text">You&#39;ve probably never seen one of these before</p></div>
<p><strong>Step 4</strong>: Configure your Pidgin IRC account to use the tunnel as a SOCKS5 proxy. Go to Accounts -&gt; Manage Accounts. Highlight your IRC protocol account and click Modify (or create one by clicking Add). Go to the Advanced tab of the config dialog. In the Proxy Options section select SOCKS5 as the proxy type, enter &#8220;localhost&#8221; as the Host and &#8220;7777&#8243; (or whatever port you used) as the Port.</p>
<div id="attachment_96" class="wp-caption aligncenter" style="width: 314px"><img class="size-full wp-image-96" title="pidgin" src="http://blog.reallywow.com/wp-content/uploads/2009/06/pidgin1.png" alt="Specify your local tunnel as the SOCKS5 proxy" width="304" height="520" /><p class="wp-caption-text">Specify your local tunnel as the SOCKS5 proxy</p></div>
<p>Save and that&#8217;s it. You should be able to connect to IRC server through Pidgin.</p>
<p>On a *nix machine (or using Cygwin, I suppose) this is, of course, much simpler. You can replace the PuTTY steps with a single ssh command: <em>ssh -D localhost:7777 me@ssh.example.com</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.reallywow.com/archives/83/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Basic Block Data Decomposition in Perl</title>
		<link>http://blog.reallywow.com/archives/65</link>
		<comments>http://blog.reallywow.com/archives/65#comments</comments>
		<pubDate>Tue, 03 Mar 2009 21:28:19 +0000</pubDate>
		<dc:creator>lbjay</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[parallel]]></category>
		<category><![CDATA[perl parallel threads]]></category>

		<guid isPermaLink="false">http://blog.reallywow.com/?p=65</guid>
		<description><![CDATA[I was playing around with the idea of parallelizing something the other day to eke out some performance. Unfortunately, I&#8217;ve gotten a bit rusty since writing some MPI code for a parallel computing course a few years back. I got stuck on what should be the simple part of dividing up my input across the [...]]]></description>
			<content:encoded><![CDATA[<abbr class="unapi-id" title="http://blog.reallywow.com/?p=65"><!-- &nbsp; --></abbr>
<p>I was playing around with the idea of parallelizing something the other day to eke out some performance. Unfortunately, I&#8217;ve gotten a bit rusty since writing some MPI code for a parallel computing course a few years back. I got stuck on what should be the simple part of dividing up my input across the threads.</p>
<p><span id="more-65"></span>The goal is to divvy things up into continguous blocks of roughly equal size. i.e., if the size of your input is 38 (<em>n</em>) and you start four threads (<em>p</em>) you don&#8217;t want to give the first three threads chunks of 12 and the last thread gets 2. You want slices of 10, 9, 10 and 9.</p>
<p>So I flailed away with loops and the POSIX::floor for little awhile and came pretty close to what I remembered. I had to finally drag out my <a href="http://books.google.com/books?id=tDxNyGSXg5IC">textbook</a> (and translate from the C Macros) to get it right.</p>
<pre lang="perl">#!/usr/bin/perl

# Block Data Decomposition:
# Divide array n into p contiguous blocks of roughly equal size

use POSIX qw(floor);
use strict;

sub block_start {
    my ($i, $p, $n) = @_;
    return floor(($i * $n) / $p);
}

sub block_end {
    my ($i, $p, $n) = @_;
    return (block_start($i + 1, $p, $n) - 1);
}

my @input = get_input();
my $n = scalar @input;
my $p = 4;

for my $i (0..$p-1)
{
    my $start = block_start($i, $p, $n);
    my $end = block_end($i, $p, $n);
    my @range = @input[$start..$end];
    do_something(\@range);
}</pre>
<p>The idea is that</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">do_something(\@range)</div></div>
<p>sends a slice of input off for processing by one of your threads. A pretty useful algorithm when doing this sort of thing. Certainly not rocket science. Which is why we should all be happy I&#8217;m not a rocket scientist.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.reallywow.com/archives/65/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Code4LibCon 2009: Timeline and IRC log</title>
		<link>http://blog.reallywow.com/archives/45</link>
		<comments>http://blog.reallywow.com/archives/45#comments</comments>
		<pubDate>Sat, 28 Feb 2009 14:46:55 +0000</pubDate>
		<dc:creator>lbjay</dc:creator>
				<category><![CDATA[code4lib]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[irc]]></category>
		<category><![CDATA[c4l09]]></category>
		<category><![CDATA[code4lib2009]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[timeline]]></category>

		<guid isPermaLink="false">http://blog.reallywow.com/?p=45</guid>
		<description><![CDATA[To cut to the chase, I extracted the hCal events from the 2009 conference schedule and fed them into a Simile Timeline. I then linked each event to the corresponding slice of my IRC client log. If you want to take a look it&#8217;s here. I don&#8217;t remember what initially sent me there, but my [...]]]></description>
			<content:encoded><![CDATA[<abbr class="unapi-id" title="http://blog.reallywow.com/?p=45"><!-- &nbsp; --></abbr>
<p>To cut to the chase, I extracted the hCal events from the 2009 conference schedule and fed them into a <a href="http://code.google.com/p/simile-widgets/">Simile Timeline</a>. I then linked each event to the corresponding slice of my IRC client log. If you want to take a look it&#8217;s <a href="http://reallywow.com/c4l09/timeline">here</a>.</p>
<p><span id="more-45"></span>I don&#8217;t remember what initially sent me there, but my introduction to Code4Lib was through the IRC channel. I&#8217;ve been logged in there off and on ever since. It keeps me informed and entertained and, yes, occasionally distracted. I&#8217;ve since attended all four of the yearly conferences, met and meatspace-friended a good percentage of the #code4lib regulars, contributed a patch here and there to a couple of projects, and helped organize a <a href="http://wiki.code4lib.org/index.php/NEC4L">one-day regional gathering</a>. I guess you could say at this point that I&#8217;m pretty fond of the whole thing.</p>
<p>This is why I take it somewhat personally when the annual hand-wringing debate begins over the perceived &#8220;cliquishness&#8221; of the community. There was much fuss this year&#8211;an awkward amount, even, IMO&#8211;over 1st-timers vs. old-timers. I make it a point to try and sit with people I don&#8217;t know during the lunches and shake a few hands. Lots of folks do the same for dinner.  Basically, IMO, if you feel like an outcast n00b, YOU&#8217;RE NOT TRYING HARD ENOUGH.</p>
<p>There is, however&#8211;and maybe I have a bit of &#8220;I haz a straw man. Let me show u it&#8221; going on here, but anyway&#8211;an aspect of the <em>&#8220;code4lib is just a big fat secretive, juvenille high school-ish in crowd&#8221;</em> argument where I think we majorly fail, and that is the non-open nature of the backchannel.</p>
<p>I met a lot of awesome new people over the past few days attending the 4th code4lib conference in Providence, RI, Jon Phipps of the NSDL MetaData Registry. I was a little suprised to read <a href="http://managemetadata.org/blog/2009/02/25/embrace-the-chaos/">he didn&#8217;t enjoy the program</a>, but that&#8217;s cool. I give him big props for calling it as he sees it. The part that got under my skin, because he&#8217;s totally right, was his mention of <em>&#8220;the hugely active IRC back channel of ongoing commentary (which really should be displayed where everyone including the presenters can read it)&#8221;</em>. This simply rang true to me.</p>
<p>Let me first say what I&#8217;m not saying: <strong>I do not think</strong><strong> </strong>it&#8217;s rude and unfair that a bunch of us (100+, depending if you count those not physically present at the conf) are carrying on a parallel conversation while the presenters we have invited are getting up on stage and sharing projects and ideas that they care deeply about and have slaved over. This is the nature of our beast. To paraphrase something BillDeuber said in channel yesterday, is the channel and extension of the conf, or vice versa? I think the latter.</p>
<p>But <strong>I do think</strong> it&#8217;s rude and unfair that we are carrying on an <strong>un-open</strong> and <strong>inaccessible </strong>parallel conversation while the presenters <strong>we have invited</strong> are getting up on stage and sharing projects and ideas that they care deeply about and have slaved over.</p>
<p>The funny thing is, this reasoning is not what first prompted me to put my chat log up on the web. I did it because Corey Harper asked if I&#8217;d email him the section from when he was presenting at the linked data preconf and I figured others might like the same courtesy. I also thought Timeline would be a cool project to experiment with. I&#8217;ve since had a few conversations about whether or not it&#8217;s fair to the people in-channel who maybe didn&#8217;t realize what they were saying was going to be published later on. But if someone is accusing you of being cliquish and secretive, how is the proper response not to be more open and transparent? To say, &#8220;Here, take a look. See for yourself.&#8221;</p>
<p>This is probably making it seem like there must be some really juicy shit going on in the back channel, but that&#8217;s exactly the thing: there&#8217;s really not. It never gets any snarkier than your typical <a href="http://en.wikipedia.org/wiki/Mystery_Science_Theater_3000">MST3K</a> episode. And would anyone argue that Joel, Mike, Crow and Tom Servo didn&#8217;t really, deep down, love those old, bad movies they were forced to watch?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.reallywow.com/archives/45/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
