<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>ducttape.it - home</title>
  <id>tag:ducttape.it,2008:mephisto/</id>
  <generator version="0.8.0" uri="http://mephistoblog.com">Mephisto Drax</generator>
  <link href="http://ducttape.it/feed/atom.xml" rel="self" type="application/atom+xml"/>
  <link href="http://ducttape.it/" rel="alternate" type="text/html"/>
  <updated>2008-11-07T04:05:01Z</updated>
  <entry xml:base="http://ducttape.it/">
    <author>
      <name>sob</name>
    </author>
    <id>tag:ducttape.it,2008-11-07:6</id>
    <published>2008-11-07T04:04:00Z</published>
    <updated>2008-11-07T04:05:01Z</updated>
    <category term="tips &amp; tricks"/>
    <category term="forms"/>
    <category term="javascript"/>
    <category term="palm-to-forehead"/>
    <category term="prototype"/>
    <link href="http://ducttape.it/2008/11/7/submitting-disabled-form-elements" rel="alternate" type="text/html"/>
    <title>Submitting Disabled Form Elements</title>
<content type="html">
            &lt;p&gt;Most browsers (Firefox, Safari) won't pass disabled form elements during submission. This caused me quite a bit of trouble this morning until I decided to check the development.log for the POST data when editing my model. My solution was two part, first being javascript and second being CSS.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Javascript: enable all elements before submitting&lt;/b&gt;&lt;br /&gt;&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;r&quot;&gt;function&lt;/span&gt; addFormListener() {&lt;tt&gt;
&lt;/tt&gt;  $$(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;).each(&lt;span class=&quot;r&quot;&gt;function&lt;/span&gt;(f) {&lt;tt&gt;
&lt;/tt&gt;    f.observe(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;submit&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;r&quot;&gt;function&lt;/span&gt;(){&lt;tt&gt;
&lt;/tt&gt;      f.getInputs().each(&lt;span class=&quot;r&quot;&gt;function&lt;/span&gt;(i){&lt;tt&gt;
&lt;/tt&gt;        i.enable();&lt;tt&gt;
&lt;/tt&gt;      });&lt;tt&gt;
&lt;/tt&gt;    });&lt;tt&gt;
&lt;/tt&gt;  });&lt;tt&gt;
&lt;/tt&gt;};&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;Event.observe(&lt;span class=&quot;pt&quot;&gt;window&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;load&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, addFormListener());&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/p&gt;

&lt;p&gt;&lt;b&gt;CSS: maintain styles for disabled elements and class=disabled&lt;/b&gt;&lt;br /&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;er&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;cl&quot;&gt;.textField&lt;/span&gt;&lt;span class=&quot;cl&quot;&gt;.disabled&lt;/span&gt; { &lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;er&quot;&gt;background-color&lt;/span&gt;: &lt;span class=&quot;cr&quot;&gt;#eee&lt;/span&gt;; &lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;er&quot;&gt;color&lt;/span&gt;: &lt;span class=&quot;cr&quot;&gt;#808080&lt;/span&gt;; &lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;er&quot;&gt;border&lt;/span&gt;: &lt;span class=&quot;fl&quot;&gt;2px&lt;/span&gt; &lt;span class=&quot;er&quot;&gt;solid&lt;/span&gt; &lt;span class=&quot;cr&quot;&gt;#808080&lt;/span&gt;; }&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/p&gt;

&lt;p&gt;&lt;b&gt;What about read-only or locked attributes?&lt;/b&gt;&lt;br /&gt;Those should be handled in your model anyway and blocked from mass-assignment. Remember? skinny controllers, fat models!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://ducttape.it/">
    <author>
      <name>sob</name>
    </author>
    <id>tag:ducttape.it,2008-11-05:5</id>
    <published>2008-11-05T21:25:00Z</published>
    <updated>2008-11-05T21:28:38Z</updated>
    <category term="reviews"/>
    <category term="expandrive"/>
    <category term="osx"/>
    <category term="remote administration"/>
    <category term="ssh"/>
    <link href="http://ducttape.it/2008/11/5/expandrive" rel="alternate" type="text/html"/>
    <title>ExpanDrive</title>
<content type="html">
            &lt;p&gt;Aside from the typical Y! perks (free coffee, coffee bar, and soda) every now and then companies will give a handful of software licenses to Y! developers in an attempt to generate buzz for their software. Some of the software is really strange but every now and then I get a nugget of ones and zeros that changes the way I work. &lt;a href=&quot;http://magnetk.com/expandrive&quot; title=&quot;ExpanDrive homepage (via magnetk.com)&quot;&gt;ExpanDrive&lt;/a&gt; by &lt;a href=&quot;http://magnetk.com&quot; title=&quot;Magnetk, LLC homepage (via magnetk.com)&quot;&gt;Magnetk&lt;/a&gt; is one of those. It's basically a wrapper for fuse-ssh (which has always been a bit buggy for me) that works flawlessly.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Features&lt;/b&gt;
&lt;ul&gt;
  &lt;li&gt;Map drives using SSH (sftp) or FTP/FTPS&lt;/li&gt;
  &lt;li&gt;Automatically reconnect drives at login&lt;/li&gt;
  &lt;li&gt;Fast access from a menu bar icon&lt;/li&gt;
  &lt;li&gt;Directory listing caching to prevent &lt;a href=&quot;http://macromates.com/&quot; title=&quot;TextMate homepage (via macromates.com)&quot;&gt;TextMate&lt;/a&gt; lockups (see below)&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;

&lt;p&gt;&lt;b&gt;TextMate + ReMate + ExpanDrive&lt;/b&gt;&lt;br /&gt;One of my biggest gripes about working with network drives is that TextMate constantly refreshes the directory tree upon gaining window focus. This is fine for small folders but large rails apps for example, this can lead to a visible lag. ExpanDrive utilizes some sort of magic caching above what your standard fuse-ssh stuff does to cut down on this but Magnetk recommends using &lt;a href=&quot;http://ciaranwal.sh/remate/&quot; title=&quot;ReMate homepage (via ciaranwal.sh)&quot;&gt;ReMate&lt;/a&gt; by &lt;a href=&quot;http://ciaranwal.sh/&quot; title=&quot;home page for Ciarán Walsh (via ciaranwal.sh)&quot;&gt;Ciarán Walsh&lt;/a&gt; to reduce this lag even further.&lt;/p&gt;

&lt;p&gt;I've found ExpanDrive especially useful here at Y! when working with virtual machines hosted on my linux desktop from my mac laptop. No more copying .vimrc or .profile files among virtual machines that I'm simply throwing away after finishing a task. I can edit and test away all from the comfort of my macbook pro.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://ducttape.it/">
    <author>
      <name>sob</name>
    </author>
    <id>tag:ducttape.it,2008-11-05:4</id>
    <published>2008-11-05T00:25:00Z</published>
    <updated>2008-11-05T00:52:13Z</updated>
    <category term="tips &amp; tricks"/>
    <category term="oracle"/>
    <category term="palm-to-forehead"/>
    <category term="ssh"/>
    <link href="http://ducttape.it/2008/11/5/oracle-ssh-load-balancing" rel="alternate" type="text/html"/>
    <title>oracle + ssh + load balancing</title>
<content type="html">
            &lt;h3&gt;Problem&lt;/h3&gt;
&lt;p&gt;So you've configured your SSH tunnel properly through your corporate login machine and right into your Oracle 10g RAQ.&lt;/p&gt;

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;# ssh -L 1521:db.prod.corp.com:1521 login.corp.com&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;


&lt;p&gt;You've also pointed your tnsnames.ora to localhost 1521 and can successfully tnsping your connection. However, upon successfully logging in the machine hangs. strace reveals that the listener is directing your client to the production server ip address (ignoring your kind request to use SSH tunnels). This causes the client to timeout immediately after successful authentication.&lt;/p&gt;

&lt;h3&gt;Solution&lt;/h3&gt;
&lt;p&gt;You need to direct the client to use a specific instance (rather than allowing the listener to direct it). You need to specify the instance name in the CONNECT_DATA block. Your TNSNAMES should look something like...&lt;/p&gt;

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;14&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;15&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;BLACKBEAR =&lt;tt&gt;
&lt;/tt&gt; (DESCRIPTION =&lt;tt&gt;
&lt;/tt&gt;   (ADDRESS_LIST =&lt;tt&gt;
&lt;/tt&gt;     (ADDRESS = &lt;tt&gt;
&lt;/tt&gt;       (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))&lt;tt&gt;
&lt;/tt&gt;     (ADDRESS = &lt;tt&gt;
&lt;/tt&gt;       (PROTOCOL = TCP)(HOST = localhost)(PORT = 1522))&lt;tt&gt;
&lt;/tt&gt;     (LOAD_BALANCE = YES)&lt;tt&gt;
&lt;/tt&gt;   )&lt;tt&gt;
&lt;/tt&gt;   (CONNECT_DATA =&lt;tt&gt;
&lt;/tt&gt;     (SERVICE_NAME = BLACKBEAR)&lt;tt&gt;
&lt;/tt&gt;     (SRVR = DEDICATED)&lt;tt&gt;
&lt;/tt&gt;     (INSTANCE_NAME = BLACKBEAR1)&lt;tt&gt;
&lt;/tt&gt;   )&lt;tt&gt;
&lt;/tt&gt; )&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;


&lt;p&gt;This basically makes load balancing useless and as such should probably not be used for production (use network acls instead) but should be fine on a development or staging machine. If the instance is down simply modify the INSTANCE_NAME value and connect again.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://ducttape.it/">
    <author>
      <name>sob</name>
    </author>
    <id>tag:ducttape.it,2008-11-04:3</id>
    <published>2008-11-04T23:42:00Z</published>
    <updated>2008-11-05T00:52:01Z</updated>
    <category term="announcements"/>
    <link href="http://ducttape.it/2008/11/4/back-in-action" rel="alternate" type="text/html"/>
    <title>back in action</title>
<content type="html">
            &lt;p&gt;So I finally got the blog back up and running, domains re-pointed, mod_rewrite working, oh and Mephisto working properly. I somehow lost my database backups so no return of the old articles, not that there were many but expect more content this time around...&lt;/p&gt;
          </content>  </entry>
</feed>
