<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>unorganized.net (Entries tagged as terminal)</title>
    <link>http://unorganized.net/blog/</link>
    <description>directly from the brain of Eike Bernhardt</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.5.3 - http://www.s9y.org/</generator>
    
    

<item>
    <title>Open SSH Connections with Butler</title>
    <link>http://unorganized.net/blog/archives/127-Open-SSH-Connections-with-Butler.html</link>
            <category>Mac</category>
    
    <comments>http://unorganized.net/blog/archives/127-Open-SSH-Connections-with-Butler.html#comments</comments>
    <wfw:comment>http://unorganized.net/blog/wfwcomment.php?cid=127</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://unorganized.net/blog/rss.php?version=2.0&amp;type=comments&amp;cid=127</wfw:commentRss>
    

    <author>nospam@example.com (Eike Bernhardt)</author>
    <content:encoded>
    	&lt;p&gt;How to use &lt;a href=&quot;http://www.manytricks.com/butler/&quot;&gt;Butler&lt;/a&gt;, &lt;a href=&quot;http://www.gnu.org/software/screen/screen.html&quot;&gt;screen&lt;/a&gt;, &lt;span class=&quot;caps&quot;&gt;SSH&lt;/span&gt; and some shell Skripts to open &lt;span class=&quot;caps&quot;&gt;SSH&lt;/span&gt; Connections to some servers.&lt;/p&gt;

	&lt;p&gt;First, create a directory which will contain the script(s) to connect to the servers &amp;#8211; I use &lt;code&gt;~/bin/Terminals&lt;/code&gt;. In that, place a file containing the following code:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
#!/bin/sh
exec ssh -t `basename $0` screen -DR ; exit
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;The filename should be the servername to connect to, you can use &lt;code&gt;~/.ssh/config&lt;/code&gt; to define short aliases for your servers:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
Host myshortalias
  HostName long.hostname.tld
  User ausername
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;This allows you to do &lt;code&gt;ssh myshortalias&lt;/code&gt; to connect to the server in question. So, to connect to this server, name the file in &lt;code&gt;~/bin/Terminals&lt;/code&gt; &lt;code&gt;myshortalias&lt;/code&gt;.&lt;/p&gt;

	&lt;p&gt;Make the &lt;code&gt;myshortalias&lt;/code&gt; file executable: &lt;code&gt;chmod 755 myshortalias&lt;/code&gt;&lt;/p&gt;

	&lt;p&gt;Try to open a connection via the &lt;code&gt;myshortalias&lt;/code&gt; file: &lt;code&gt;./myshortalias&lt;/code&gt; &amp;#8212; if this fails, you problably don&amp;#8217;t have &lt;code&gt;screen&lt;/code&gt; installed on the server &amp;#8211; I really recommend to install it.&lt;/p&gt;

	&lt;p&gt;OK, if that works, disconnect from the server, and open the Butler Configuration.&lt;/p&gt;

	&lt;p&gt;Expand the &amp;#8220;Hidden&amp;#8221; elements, if they are not visible. Select &amp;#8220;Add File&amp;#8221; from the plus button. Navigate to the &lt;code&gt;~/bin/&lt;/code&gt; folder and select the &amp;#8220;Terminals&amp;#8221; folder to add it to the Butler Configuration.&lt;/p&gt;

	&lt;p&gt;&lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://unorganized.net/blog/uploads/butler.png&#039; onclick=&quot;F1 = window.open(&#039;/blog/uploads/butler.png&#039;,&#039;Zoom&#039;,&#039;height=705,width=1016,top=255,left=459.5,toolbar=no,menubar=no,location=no,resize=1,resizable=1,scrollbars=yes&#039;); return false;&quot;&gt;&lt;!-- s9ymdb:2 --&gt;&lt;img class=&quot;serendipity_image_left&quot; width=&quot;110&quot; height=&quot;76&quot; style=&quot;float: left; border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://unorganized.net/blog/uploads/butler.serendipityThumb.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;Select the &amp;#8220;Terminals&amp;#8221; container, open the &amp;#8220;Triggers&amp;#8221; tab, assign a Hot Key, change mode to &amp;#8220;Opens a menu near the mouse&amp;#8221;.&lt;/p&gt;

	&lt;p&gt;&lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://unorganized.net/blog/uploads/butler2.png&#039; onclick=&quot;F1 = window.open(&#039;/blog/uploads/butler2.png&#039;,&#039;Zoom&#039;,&#039;height=705,width=1016,top=255,left=459.5,toolbar=no,menubar=no,location=no,resize=1,resizable=1,scrollbars=yes&#039;); return false;&quot;&gt;&lt;!-- s9ymdb:3 --&gt;&lt;img class=&quot;serendipity_image_right&quot; width=&quot;110&quot; height=&quot;76&quot; style=&quot;float: right; border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://unorganized.net/blog/uploads/butler2.serendipityThumb.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt; Select the &amp;#8220;Terminals&amp;#8221; folder, select the &amp;#8220;Menu Filter&amp;#8221; tab, change &amp;#8216;Menus show…&amp;#8217; to &amp;#8220;this folder&amp;#8217;s content with X levels of recursion&amp;#8221;, activate &amp;#8220;Translate subfolders into menus&amp;#8221;. &lt;/p&gt;

	&lt;p&gt;Select the &amp;#8220;Options&amp;#8221; tab and change the &amp;#8216;Open with…&amp;#8217; setting to &amp;#8220;Terminal&amp;#8221; (or iTerm or &amp;#8230;).&lt;/p&gt;

	&lt;p&gt;Pressing your hot key should now show a menu with the &lt;code&gt;myshortalias&lt;/code&gt; script. You can add subfolders to the &lt;code&gt;~/bin/Terminals&lt;/code&gt; folder to group your servers. To add a server, just copy (or even better: hard-link) the &lt;code&gt;myshortalias&lt;/code&gt; file to a new name which corresponds to a &lt;code&gt;Host&lt;/code&gt; config in &lt;code&gt;~/.ssh/config&lt;/code&gt;.&lt;/p&gt; 
    </content:encoded>

    <pubDate>Mon, 19 Jan 2009 21:10:28 +0100</pubDate>
    <guid isPermaLink="false">http://unorganized.net/blog/archives/127-guid.html</guid>
    <category>butler</category>
<category>connection</category>
<category>mac</category>
<category>menu</category>
<category>screen</category>
<category>ssh</category>
<category>terminal</category>

</item>

</channel>
</rss>