<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet title="XSL formatting" type="text/xsl" href="http://blog.kereoz.org/feed/rss2/xslt" ?><rss version="2.0"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
  <title>Da Kereoz Blog</title>
  <link>http://blog.kereoz.org/</link>
  <atom:link href="http://blog.kereoz.org/feed/rss2" rel="self" type="application/rss+xml"/>
  <description></description>
  <language>en</language>
  <pubDate>Tue, 29 Jun 2010 08:06:22 +0100</pubDate>
  <copyright></copyright>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Dotclear</generator>
  
    
  <item>
    <title>Multiplexing ssh connections in one tunnel</title>
    <link>http://blog.kereoz.org/post/2010/04/29/Multiplexing-ssh-connections-in-one-tunnel</link>
    <guid isPermaLink="false">urn:md5:726c489a9b7124d82673d500c77cfdcb</guid>
    <pubDate>Thu, 29 Apr 2010 10:21:00 +0000</pubDate>
    <dc:creator>Kereoz</dc:creator>
        <category>Tech</category>
            
    <description>    &lt;p&gt;Say you run a script with multiple ssh accesses to the same machine. You
don't want to store the public key of the local machine on the server for
security reasons, but you don't want to type the password every time a
connection is made.&lt;/p&gt;
&lt;p&gt;Adding those lines to ~/.ssh/config will do the trick&lt;/p&gt;
&lt;p&gt;Host *&lt;/p&gt;
&lt;pre&gt;
  ControlMaster auto
  ControlPath ~/.ssh/master-%r@%h:%p
&lt;/pre&gt;
&lt;p&gt;See man ssh_config (5) for more details.&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Ruby::Array</title>
    <link>http://blog.kereoz.org/post/2009/04/28/Ruby%3A%3AArray</link>
    <guid isPermaLink="false">urn:md5:2bd87e554b1c2da803b011e2ceac51e9</guid>
    <pubDate>Tue, 28 Apr 2009 18:49:00 +0000</pubDate>
    <dc:creator>Kereoz</dc:creator>
            
    <description>    &lt;p&gt;Here are a few methods to extend the Array class in Ruby. It will let you
sum up Arrays, find how many level of Array are nested into each other, and
divide all the elements contained in an Array and in all the nested Arrays it
might contain.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;!ruby&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;
 # A new method to Array to sum elements between two arrays in a new array.
 # It works recursively with arrays of arrays
 class Array
   def add(y)
       return self if y.empty?
       return y if self.empty?
&lt;/pre&gt;
&lt;pre&gt;
       if self.deepness ==  1 and y.deepness == 1
           a_sum = self.zip(y.flatten).map{|a,b| a.to_f+b.to_f}
           return a_sum
&lt;/pre&gt;
&lt;pre&gt;
       else
           if y&lt;a href=&quot;http://blog.kereoz.org/post/2009/04/28/0&quot;&gt;0&lt;/a&gt;.is_a? Array and self&lt;a href=&quot;http://blog.kereoz.org/post/2009/04/28/0&quot;&gt;0&lt;/a&gt;.is_a? Array
               res = Array.new
               y.each_index do |i|
                   res.push self&lt;a href=&quot;http://blog.kereoz.org/post/2009/04/28/i&quot; title=&quot;i&quot;&gt;i&lt;/a&gt;.add y&lt;a href=&quot;http://blog.kereoz.org/post/2009/04/28/i&quot; title=&quot;i&quot;&gt;i&lt;/a&gt;
               end
               return res
           end
       end
   end
   
   # Return the deepness of an Array, ie how many Arrays does it 
   # recursively contains ? Note that the computation is only performed on the first item of the array.
   def deepness
       a = self.collect&lt;a href=&quot;http://blog.kereoz.org/post/2009/04/28/0&quot;&gt;0&lt;/a&gt;
           return 1 if not a.is_a? Array
           return 1 + a.deepness if a.is_a? Array
   end
   
   # Division applied recursively on every element
   def div(n)
       a = &lt;a href=&quot;http://blog.kereoz.org/post/2009/04/28/&quot;&gt;&lt;/a&gt;
       self.each do |s|
           if not s.is_a? Array
               a.push (s.to_f/n.to_f)
           else
               a.push s.div(n)
           end
       end
       return a
   end
&lt;/pre&gt;
&lt;pre&gt;
  end
&lt;/pre&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Unison or how to keep your data synchronized</title>
    <link>http://blog.kereoz.org/post/2009/04/26/Unison-or-how-to-keep-your-data-synchronized</link>
    <guid isPermaLink="false">urn:md5:77fba25f472105d5abc0504a0976f8dd</guid>
    <pubDate>Sun, 26 Apr 2009 21:00:00 +0000</pubDate>
    <dc:creator>Kereoz</dc:creator>
        <category>Tech</category>
            
    <description>    &lt;p&gt;Unison is an opensource file-synchronization tool for Unix and Windows
written in CAML. Unlike rsync, it is able to propagate changes in both
directions when synchronizing between two machines. I use it to keep my two
laptops and my Desktop synchronized. Unison works both locally and remotely.
SSH can be used to securely synchronize from anywhere to anywhere.&lt;/p&gt;
&lt;p&gt;SSH options can be passed using the -sshargs option, eg:&lt;/p&gt;
&lt;pre&gt;
unison folder1 ssh://machine/folder2 -sshargs '-port 2222'
&lt;/pre&gt;
&lt;p&gt;Symlinks can be followed, and it makes things even easier : you can simply
create a 'sync' folder in your home directory, containing symlinks to the data
you want to keep in sync. I like to use it for config files such as .vimrc,
.emacs.&lt;/p&gt;</description>
    
    
    
      </item>
    
  <item>
    <title>Vim stuff</title>
    <link>http://blog.kereoz.org/post/2009/04/26/Vim</link>
    <guid isPermaLink="false">urn:md5:7a38cffe9a532c58e88ca8e615cf5cfa</guid>
    <pubDate>Sun, 26 Apr 2009 20:51:00 +0000</pubDate>
    <dc:creator>Kereoz</dc:creator>
        <category>Tech</category>
            
    <description>    &lt;p&gt;Hello world =) Let's start this blog with a short talk about vim. Even
though Vim is one of the most powerful text editors ever, it is often
underestimated by those who don't use it. The thing is that it takes times to
get used to it. It is highly customizable, and scriptable. It even has a native
Ruby support.&lt;/p&gt;
&lt;h4&gt;Some cool tips&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;I recently discovered the BufExplorer plugin. :BufExplorer show a list of
buffers, allows to jump between buffers, to delete them etc.. like emac's C-x b
so why not adding a key mapping like this :&lt;code&gt;:nmap &amp;lt;C-x&amp;gt;b
:BufExplorer &amp;lt;CR&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Substituting a string with another one in all opened buffer and save
changes can be done with &lt;code&gt;&amp;quot;:bufdo /string | :up&amp;quot;&lt;/code&gt;. It can be
generalized to any other operation. Very useful for core refactoring&lt;/li&gt;
&lt;li&gt;The current buffer is represented by % in vim commands. For example, :ruby
% will execute the current buffer as ruby code.&lt;/li&gt;
&lt;li&gt;In visual mode, you can execute commands as well with &lt;code&gt;&amp;quot;:!&amp;quot;&lt;/code&gt; and
get the output of the command. It allows to evaluate code on the fly.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;My vimrc is available through &lt;a href=&quot;http://kereoz.org/.vimrc&quot; title=&quot;http://kereoz.org/.vimrc&quot;&gt;http://kereoz.org/.vimrc&lt;/a&gt;&lt;/p&gt;</description>
    
    
    
      </item>
    
</channel>
</rss>