<?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>Chillibear</title>
	<atom:link href="http://chillibear.org/feed" rel="self" type="application/rss+xml" />
	<link>http://chillibear.org</link>
	<description>A place for notes about stuff</description>
	<lastBuildDate>Sun, 11 Mar 2012 18:04:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>Ruby Percent Syntax (Percent Functions)</title>
		<link>http://chillibear.org/2012/03/ruby-percent-syntax-percent-functions.html</link>
		<comments>http://chillibear.org/2012/03/ruby-percent-syntax-percent-functions.html#comments</comments>
		<pubDate>Sun, 11 Mar 2012 18:04:56 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://chillibear.org/?p=426</guid>
		<description><![CDATA[I was trying to find a decent reference to Ruby&#8217;s percent functions, but alas trying to google for &#8216;%w&#8217; doesn&#8217;t get you very far. After a while I did come across http://old.blog.jimhoskins.com/?p=8, but at the time of writing the site isn&#8217;t available. So this is a quick summary of the content from that blog, reworked [...]]]></description>
			<content:encoded><![CDATA[<p>I was trying to find a decent reference to Ruby&#8217;s percent functions, but alas trying to google for &#8216;%w&#8217; doesn&#8217;t get you very far.  After a while I did come across <a href="http://old.blog.jimhoskins.com/?p=8">http://old.blog.jimhoskins.com/?p=8</a>, but at the time of writing the site isn&#8217;t available.  So this is a quick summary of the content from that blog, reworked a tiny bit in places for reference.</p>
<p>It&#8217;s possible in Ruby to create certain strings and arrays and indeed system commands easier to write by allowing the use of alternative deliminators, meaning less escaping and hopefully more readable code.  This is all done via the percent syntax.</p>
<p>The syntax for the % literals is a percent symbol (%) a letter which defines what kind of literal it is (Q, q, w, x, r) then a delimiter, thenthe content, and finally the closing delimiter.</p>
<p>The delimiter can be pretty much any character, and is defined as whatever character is immediately after the letter in the syntax. For example <strong>%Q!content!</strong> , the delimiter is the <strong>!</strong> and it surrounds the content. There are special cases when the delimiter is <strong>{</strong> or <strong>(</strong>, the closing delimiter will be <strong>}</strong> or <strong>)</strong> respectively.</p>
<h4>%Q and %q (Percent Q): Strings</h4>
<pre class="brush: ruby;">%Q!Some String of &quot;Characters&quot;! &lt;==&gt; &quot;Some String of \&quot;Characters\&quot;&quot;</pre>
<p>%Q is the equivalent to a normal double-quoted ruby string so markup like <tt>#{expression}</tt> works.  You can actually also leave off the Q and it will have the same functionality.</p>
<pre class="brush: ruby;">%q!Some String of &quot;Characters&quot;! &lt;==&gt; 'Some String of &quot;Characters&quot;'</pre>
<p>The %q is just like %Q, but acts the same as a single-quoted string. Whatever is inside the delimiters is returned as a string.</p>
<h4>%W (Percent W): Arrays</h4>
<pre class="brush: ruby;">%W(North South East West) &lt;==&gt; [&quot;North&quot;, &quot;South&quot;, &quot;East&quot;, &quot;West&quot;]</pre>
<p>%W (and %w) allow you to create an Array of strings without using quotes and commas.</p>
<p>The content inside the delimiters are split by white-space, and put into an array.</p>
<p>When using %W, it is evaluated as a double-quoted string. This allows you to use #{} to interpolate values. %w will evaluate as a single quoted string.</p>
<h4>%x (Percent x): System Execution</h4>
<pre class="brush: ruby;">%x{ ls /usr/local } &lt;==&gt; `ls /usr/local`</pre>
<p>%x allows you to call system commands, equivalent to wrapping the command in backticks (`), or grave accents if we&#8217;re going to be more formal.</p>
<h4>%r (Percent r): Regular Expressions</h4>
<pre class="brush: ruby;">%r{/usr/bin/} &lt;==&gt; /\/usr\/bin\//</pre>
<p>%r is useful for regular expressions that contain forward slashes (/) which of course are the normal delimiter for regular expressions and would therefore have to be escaped.</p>
]]></content:encoded>
			<wfw:commentRss>http://chillibear.org/2012/03/ruby-percent-syntax-percent-functions.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PORTSCOUT=	limit:^1.4</title>
		<link>http://chillibear.org/2012/01/portscoutlimit1-4.html</link>
		<comments>http://chillibear.org/2012/01/portscoutlimit1-4.html#comments</comments>
		<pubDate>Thu, 12 Jan 2012 18:14:08 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ports]]></category>

		<guid isPermaLink="false">http://chillibear.org/?p=419</guid>
		<description><![CDATA[It would appear you can set a regexp variable thus (for example): PORTSCOUT=limit:^1.4 In a ports Makefile to prevent portscout looking for newer versions, very useful if you need to put a legacy version in the tree.]]></description>
			<content:encoded><![CDATA[<p>It would appear you can set a regexp variable thus (for example):</p>
<p><code>PORTSCOUT=limit:^1.4</code></p>
<p>In a ports Makefile to prevent portscout looking for newer versions, very useful if you need to put a legacy version in the tree.</p>
]]></content:encoded>
			<wfw:commentRss>http://chillibear.org/2012/01/portscoutlimit1-4.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IP Network masks</title>
		<link>http://chillibear.org/2011/03/ip-network-masks.html</link>
		<comments>http://chillibear.org/2011/03/ip-network-masks.html#comments</comments>
		<pubDate>Tue, 08 Mar 2011 22:35:59 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[IP]]></category>
		<category><![CDATA[LAN]]></category>
		<category><![CDATA[Network]]></category>

		<guid isPermaLink="false">http://chillibear.org/?p=409</guid>
		<description><![CDATA[Numbers of network addresses available for a given number of network bits&#8230; I always forget so&#8230; Network bits Mask Number of addresses /20 255.255.240.0 4096 /21 255.255.248.0 2048 /22 255.255.252.0 1024 /23 255.255.254.0 512 /24 255.255.255.0 256 /25 255.255.255.128 128 /26 255.255.255.192 64 /27 255.255.255.224 32 /28 255.255.255.240 16 /29 255.255.255.248 8 /30 255.255.255.252 4]]></description>
			<content:encoded><![CDATA[<p>Numbers of network addresses available for a given number of network bits&#8230; I always forget so&#8230;</p>
<table border="1" cellpadding="4">
<tbody>
<tr>
<th>Network bits</th>
<th>Mask</th>
<th>Number of addresses</th>
</tr>
<tr>
<td>/20</td>
<td>255.255.240.0</td>
<td>4096</td>
</tr>
<tr>
<td>/21</td>
<td>255.255.248.0</td>
<td>2048</td>
</tr>
<tr>
<td>/22</td>
<td>255.255.252.0</td>
<td>1024</td>
</tr>
<tr>
<td>/23</td>
<td>255.255.254.0</td>
<td>512</td>
</tr>
<tr>
<td>/24</td>
<td>255.255.255.0</td>
<td>256</td>
</tr>
<tr>
<td>/25</td>
<td>255.255.255.128</td>
<td>128</td>
</tr>
<tr>
<td>/26</td>
<td>255.255.255.192</td>
<td>64</td>
</tr>
<tr>
<td>/27</td>
<td>255.255.255.224</td>
<td>32</td>
</tr>
<tr>
<td>/28</td>
<td>255.255.255.240
</td>
<td>16</td>
</tr>
<tr>
<td>/29</td>
<td>255.255.255.248</td>
<td>8</td>
</tr>
<tr>
<td>/30</td>
<td>255.255.255.252</td>
<td>4</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://chillibear.org/2011/03/ip-network-masks.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clone FreeBSD</title>
		<link>http://chillibear.org/2011/01/clone-freebsd.html</link>
		<comments>http://chillibear.org/2011/01/clone-freebsd.html#comments</comments>
		<pubDate>Mon, 17 Jan 2011 22:31:49 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[dump]]></category>
		<category><![CDATA[restore]]></category>

		<guid isPermaLink="false">http://chillibear.org/?p=398</guid>
		<description><![CDATA[Clone a running FreeBSD system to another disk. Source drive: ad0, target drive ad1 Prepare the target drive cd /tmp/ df -h > liveFSsizes bsdlabel da0s1 > liveSPsizes dd if=/dev/zero of=/dev/da1 count=2 fdisk -BI /dev/da1 bsdlabel -B -w da1s1 bsdlabel -R da1s1 liveSPsizes cat liveSPsizes newfs -U /dev/da1s1a newfs -U /dev/da1s1d newfs -U /dev/da1s1e newfs [...]]]></description>
			<content:encoded><![CDATA[<p>Clone a running FreeBSD system to another disk.  Source drive: ad0, target drive ad1</p>
<p>Prepare the target drive<br />
<code><br />
cd /tmp/<br />
df -h > liveFSsizes<br />
bsdlabel da0s1 > liveSPsizes<br />
dd if=/dev/zero of=/dev/da1 count=2<br />
fdisk -BI /dev/da1<br />
bsdlabel -B -w da1s1<br />
bsdlabel -R da1s1 liveSPsizes<br />
cat liveSPsizes<br />
newfs -U /dev/da1s1a<br />
newfs -U /dev/da1s1d<br />
newfs -U /dev/da1s1e<br />
newfs -U /dev/da1s1f<br />
</code></p>
<p>Mount each partition and dump the source partition (da0) to our backup (-)<br />
<code><br />
mount /dev/da1s1a /mnt<br />
cd /mnt<br />
dump -0Lauf - /dev/da0s1a | restore -rf -<br />
mount /dev/da1s1d /mnt/var<br />
cd /mnt/var<br />
dump -0Lauf - /dev/da0s1d | restore -rf -<br />
mount /dev/da1s1e /mnt/tmp<br />
cd /mnt/tmp<br />
dump -0Lauf - /dev/da0s1e | restore -rf -<br />
mount /dev/da1s1f /mnt/usr<br />
cd /mnt/usr<br />
dump -0Lauf - /dev/da0s1f | restore -rf -<br />
sync<br />
cd /tmp<br />
rm liveSPsizes<br />
rm liveFSsizes<br />
umount /mnt/usr<br />
umount /mnt/tmp<br />
umount /mnt/var<br />
umount /mnt<br />
</code></p>
<p>Note when you fdisk you should expec the following errors:<br />
<code><br />
******* Working on device /dev/da1 *******<br />
fdisk: Class not found<br />
</code></p>
<p>The original version of this can be found on the FreeBSD fora in this thread: <a href="http://forums.freebsd.org/showthread.php?t=11680">http://forums.freebsd.org/showthread.php?t=11680</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://chillibear.org/2011/01/clone-freebsd.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby Net/HTTP not respecting timeout</title>
		<link>http://chillibear.org/2010/12/ruby-nethttp-not-respecting-timeout.html</link>
		<comments>http://chillibear.org/2010/12/ruby-nethttp-not-respecting-timeout.html#comments</comments>
		<pubDate>Thu, 16 Dec 2010 22:34:22 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://chillibear.org/?p=391</guid>
		<description><![CDATA[One that caught me out for a while &#8230; needed to reduce the timeout the Net/HTTP library was defaulting to because the servers I was querying were liable to be offline and I didn&#8217;t want my script hanging around. I wrote something like: require 'net/http' res = Net::HTTP.start('http://www.example.com') do &#124;http&#124; http.open_timeout = 4 http.read_timeout = [...]]]></description>
			<content:encoded><![CDATA[<p>One that caught me out for a while &#8230; needed to reduce the timeout the Net/HTTP library was defaulting to because the servers I was querying were liable to be offline and I didn&#8217;t want my script hanging around.</p>
<p>I wrote something like:</p>
<pre class="brush: ruby;">
require 'net/http'
res = Net::HTTP.start('http://www.example.com') do |http|
  http.open_timeout = 4
  http.read_timeout = 4
  http.get('/index.html')
end
puts res.body
</pre>
<p>Pah, why does Ruby seem to totally ignore the <em>timeout</em> settings?  It just ignores it&#8230; humm.  Okay some digging required.  It would appear the <em>instance</em> method invokes the connect then yields so by the time the block is actually executed the connection has already been attempted, with the default timeouts &#8211; rather than those that appears to be set.</p>
<p>So we need to use code akin to:</p>
<pre class="brush: ruby;">
require 'net/http'
http = Net::HTTP.new(&quot;http://www.example.com&quot;)
http.open_timeout = 4
http.read_timeout = 4
res = http.get('/index.html')
puts res.body
</pre>
<p>For it to respect our timeouts!</p>
]]></content:encoded>
			<wfw:commentRss>http://chillibear.org/2010/12/ruby-nethttp-not-respecting-timeout.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby class and case statements</title>
		<link>http://chillibear.org/2010/10/ruby-class-and-case-statements.html</link>
		<comments>http://chillibear.org/2010/10/ruby-class-and-case-statements.html#comments</comments>
		<pubDate>Wed, 27 Oct 2010 17:50:24 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[case]]></category>

		<guid isPermaLink="false">http://chillibear.org/?p=382</guid>
		<description><![CDATA[I was writing some code akin to: case something.class when String, Symbol then 1 when Fixnum then 2 when Time then 3 end Only to find it didn&#8217;t work, always returning nil. A bit of trawling turned up the following blog post: http://www.postal-code.com/mrhappy/blog/2007/02/01/ruby-comparing-an-objects-class-in-a-case-statement/, which explains that you don&#8217;t need the .class. So my above code [...]]]></description>
			<content:encoded><![CDATA[<p>I was writing some code akin to:</p>
<pre class="brush: ruby;">
case something.class
  when String, Symbol then 1
  when Fixnum then 2
  when Time then 3
end
</pre>
<p>Only to find it didn&#8217;t work, always returning <em>nil</em>.  A bit of trawling turned up the following blog post: <a href="http://www.postal-code.com/mrhappy/blog/2007/02/01/ruby-comparing-an-objects-class-in-a-case-statement/">http://www.postal-code.com/mrhappy/blog/2007/02/01/ruby-comparing-an-objects-class-in-a-case-statement/</a>, which explains that you don&#8217;t need the <strong>.class</strong>.  So my above code would become:</p>
<pre class="brush: ruby;">
case something
  when String, Symbol then 1
  when Fixnum then 2
  when Time then 3
end
</pre>
<p>Which works.</p>
]]></content:encoded>
			<wfw:commentRss>http://chillibear.org/2010/10/ruby-class-and-case-statements.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dell R210 power consumption</title>
		<link>http://chillibear.org/2010/10/dell-r210-power-consumption.html</link>
		<comments>http://chillibear.org/2010/10/dell-r210-power-consumption.html#comments</comments>
		<pubDate>Wed, 13 Oct 2010 22:19:21 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[dell]]></category>
		<category><![CDATA[power]]></category>
		<category><![CDATA[r210]]></category>

		<guid isPermaLink="false">http://www.chillibear.org/?p=362</guid>
		<description><![CDATA[Just recording the power ratings I measured with this plug-in meter and a Dell R210 server. Firstly some base readings with no operating system installed and the machine powered up (with no power applied the Drac Express draws about 26W). No OS, with 2 Seagate 2.5&#8243; drives, 2x4GB RAM, DVD, Drac Express: 60.75W No OS, [...]]]></description>
			<content:encoded><![CDATA[<p>Just recording the power ratings I measured with this <a href="http://www.electricity-monitor.com/plugin-power-meter-p-36.html">plug-in meter</a> and a Dell R210 server.  Firstly some base readings with no operating system installed and the machine powered up (with no power applied the Drac Express draws about 26W).</p>
<ul>
<li>No OS, with 2 Seagate 2.5&#8243; drives, 2x4GB RAM, DVD, Drac Express: <strong>60.75W</strong></li>
<li>No OS, with 1 Seagate 2.5&#8243; drive, 2x4GB RAM, DVD, Drac Express: <strong>58.32W</strong></li>
<li>No OS, with 2 Seagate 2.5&#8243; drives, 2x4GB RAM, Drac Express: <strong>60.75W</strong></li>
<li>No OS, with 2 Seagate 2.5&#8243; drives, 2x2GB RAM, Drac Express: <strong>61.25W</strong></li>
<li>No OS, with 2 Seagate 2.5&#8243; drives, 1x4GB RAM, Drac Express: <strong>60.75W</strong></li>
<li>No OS, with 1 Western Digital RE2, 2x4GB RAM, DVD, Drac Express: <strong>57.6W</strong></li>
<li>No OS, 2x4GB RAM, DVD, Drac Express: <strong>55.0W</strong></li>
</ul>
<p>Now putting an OS on the machine and actually optimising so the OS can power down the CPU, etc.</p>
<ul>
<li>FreeBSD 8 (base), with 2 Seagate 2.5&#8243; drives (RAID1), 2x4GB RAM, DVD, Drac Express: <strong>60.75W</strong></li>
<li>FreeBSD 8 (optimised), with 2 Seagate 2.5&#8243; drives (RAID1), 2x4GB RAM, DVD, Drac Express: <strong>55.0W</strong></li>
<li>FreeBSD 8 (heavily optimised), with 2 Seagate 2.5&#8243; drives, 2x4GB RAM, DVD, Drac Express: <strong>51.0W</strong></li>
</ul>
<p>On a more expensive calibrated meter we tickled 47VA with that last configuration.</p>
]]></content:encoded>
			<wfw:commentRss>http://chillibear.org/2010/10/dell-r210-power-consumption.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dell iDrac 2048 bit CSR</title>
		<link>http://chillibear.org/2010/08/dell-idrac-2048-bit-csr.html</link>
		<comments>http://chillibear.org/2010/08/dell-idrac-2048-bit-csr.html#comments</comments>
		<pubDate>Sun, 22 Aug 2010 16:02:41 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[OpenSSL]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dell]]></category>
		<category><![CDATA[drac]]></category>

		<guid isPermaLink="false">http://www.chillibear.org/?p=370</guid>
		<description><![CDATA[Got an iDRAC card in your Dell server and want to generate a 2048 bit certificate signing request? You&#8217;ll need to modify the settings on the DRAC to change it from the default 1024 bit request. SSH into the iDRAC and then type the racadm command as indicated: /admin1-> racadm config -g cfgRacSecurity -o cfgRacSecCsrKeySize [...]]]></description>
			<content:encoded><![CDATA[<p>Got an iDRAC card in your Dell server and want to generate a 2048 bit certificate signing request?  You&#8217;ll need to modify the settings on the DRAC to change it from the default 1024 bit request.</p>
<p>SSH into the iDRAC and then type the racadm command as indicated:</p>
<p><code><br />
/admin1-> racadm config -g cfgRacSecurity -o cfgRacSecCsrKeySize 2048<br />
Object value modified successfully<br />
/admin1-><br />
</code></p>
<p>Credit to: <a href="http://christoph.ruegg.name/blog/2010/7/20/how-to-create-2048bit-certificate-csrs-for-dells-idrac6.html">http://christoph.ruegg.name/blog/2010/7/20/how-to-create-2048bit-certificate-csrs-for-dells-idrac6.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://chillibear.org/2010/08/dell-idrac-2048-bit-csr.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby xml-mapping: `write&#8217;: undefined local variable or method `output&#8217;</title>
		<link>http://chillibear.org/2010/07/ruby-xml-mapping-write-undefined-local-variable-or-method-output.html</link>
		<comments>http://chillibear.org/2010/07/ruby-xml-mapping-write-undefined-local-variable-or-method-output.html#comments</comments>
		<pubDate>Sun, 25 Jul 2010 08:02:59 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[*NIX]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Gem]]></category>
		<category><![CDATA[REXML]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.chillibear.org/?p=277</guid>
		<description><![CDATA[I&#8217;ve been working with the XML-Mapping gem and had the following error when trying to generate XML: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/element.rb:685:in `write': undefined local variable or method `output' for &#60;xml_node&#62; ... &#60;/&#62;:REXML::Element (NameError) A bit of digging lead me to this bug report, which lead me to look properly at the code and sure enough correcting the code [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working with the XML-Mapping gem and had the following error when trying to generate XML:</p>
<pre class="brush: bash;">
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/element.rb:685:in `write': undefined local variable or method `output' for &lt;xml_node&gt; ... &lt;/&gt;:REXML::Element (NameError)
</pre>
<p>A bit of digging lead me to this <a href="http://trac.germane-software.com/rexml/ticket/128">bug report</a>, which lead me to look properly at the code and sure enough <em>correcting</em> the code (line 674) corrects the bug and I can generate XML.  <em>i.e.</em> changing</p>
<pre class="brush: ruby;">def write(writer=$stdout, indent=-1, transitive=false, ie_hack=false)</pre>
<p>to</p>
<pre class="brush: ruby;">def write(output=$stdout, indent=-1, transitive=false, ie_hack=false)</pre>
<p>Note <strong>writer</strong> has now become <strong><em>output</em></strong>.  Now since the that function in REXML is depreciated anyway I should probably modify the XML-Mapping code to use the more modern REXML::Formatters</p>
]]></content:encoded>
			<wfw:commentRss>http://chillibear.org/2010/07/ruby-xml-mapping-write-undefined-local-variable-or-method-output.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Colons in filenames in Ruby on OSX</title>
		<link>http://chillibear.org/2010/07/colons-in-filenames-in-ruby-on-osx.html</link>
		<comments>http://chillibear.org/2010/07/colons-in-filenames-in-ruby-on-osx.html#comments</comments>
		<pubDate>Sun, 11 Jul 2010 15:43:50 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Macintosh]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[colon]]></category>
		<category><![CDATA[OSX]]></category>

		<guid isPermaLink="false">http://www.chillibear.org/?p=358</guid>
		<description><![CDATA[Now this might just be my system and I certainly don&#8217;t have this problem with any of my FreeBSD machines, but I&#8217;ve got a weird problem with filenames and colons on my Mac (10.5.8) with Ruby (ruby 1.8.6 (2009-06-08 patchlevel 369) [universal-darwin9.0]). Anyhow if I write something like this: File.open('foo:bar.txt', 'w') {&#124;f&#124; f.write(&#34;hello world&#34;) } [...]]]></description>
			<content:encoded><![CDATA[<p>Now this might just be my system and I certainly don&#8217;t have this problem with any of my FreeBSD machines, but I&#8217;ve got a weird problem with filenames and colons on my Mac (10.5.8) with Ruby (ruby 1.8.6 (2009-06-08 patchlevel 369) [universal-darwin9.0]).</p>
<p>Anyhow if I write something like this:</p>
<pre class="brush: ruby;">
File.open('foo:bar.txt', 'w') {|f| f.write(&quot;hello world&quot;) }
</pre>
<p>Rather than get a file in the current directory named <strong>foo:bar.txt</strong> I actually get one named <strong>foo/bar.txt</strong>.  I&#8217;ve tried various potential escape sequences (\: \c <em>etc.</em>).  </p>
<p>The colon name totally works as you&#8217;d imagine on my FreeBSD machines, so it must be something either to do with the Ruby version or OSX &#8211; I guess it must be half identifying the colon as a path seperator, but the file created with the &#8216;/&#8217; in it is a proper file with that name.</p>
<p>Chalk one up to not enough time to debug, but enough time to note.</p>
]]></content:encoded>
			<wfw:commentRss>http://chillibear.org/2010/07/colons-in-filenames-in-ruby-on-osx.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

