<?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>Adam Monsen &#187; ssh</title> <atom:link href="http://adammonsen.com/post/tag/ssh/feed" rel="self" type="application/rss+xml" /><link>http://adammonsen.com</link> <description></description> <lastBuildDate>Thu, 03 May 2012 18:11:34 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>Debugging web tests on remote servers</title><link>http://adammonsen.com/post/717?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=debugging-web-tests-on-remote-servers</link> <comments>http://adammonsen.com/post/717#comments</comments> <pubDate>Tue, 26 Jul 2011 15:01:42 +0000</pubDate> <dc:creator>adam</dc:creator> <category><![CDATA[Default]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[programming]]></category> <category><![CDATA[ssh]]></category> <category><![CDATA[Work]]></category><guid isPermaLink="false">http://adammonsen.com/?p=717</guid> <description><![CDATA[I run &#8220;web tests&#8221; on a remote server. I use Selenium to act like a person interacting with a website, viewing and entering data. Selenium is pretty awesome, it can drive a real web browser like Firefox. Even better is to have these web tests run automatically every time I commit code. I use Jenkins [...]]]></description> <content:encoded><![CDATA[<p>I run &#8220;web tests&#8221; on a remote server. I use <a href="http://seleniumhq.org">Selenium</a> to act like a person interacting with a website, viewing and entering data. Selenium is pretty awesome, it can drive a real web browser like Firefox.</p><p>Even better is to have these web tests run automatically every time I commit code. I use <a href="http://jenkins-ci.org">Jenkins</a> for this. Jenkins even fires up a headless desktop so Selenium can run Firefox.</p><p>When a web test breaks (especially in some way I can&#8217;t reproduce on my local desktop), sometimes it helps to actually see what Jenkins sees as it runs the test. Here&#8217;s a quick guide for doing so on an Ubuntu GNU/Linux server.</p><ol><li>Connect to the remote server using SSH. Install VNC server: <br/><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> vnc4-server</pre></div></div></li><li>On the remote server, become the user tests run as. For example: <br/><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">su</span> - ci</pre></div></div></li><li>Set a password for the VNC server using the <code>vncpasswd</code> command.</li><li>Start headless X server by running <code>vncserver</code>. Note the given display. If <code>example.com:1</code> is included in the output of <code>vncserver</code>, the display is <code>:1</code>.</li><li><p>Figure out which port the VNC server is using. I usually do something like</p><div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">netstat</span> <span style="color: #660033;">-nape</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">'^tcp.*LISTEN.*vnc.*'</span></pre></div></div><p> Here&#8217;s some example output:</p><div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">tcp        0      0 0.0.0.0:6001            0.0.0.0:*               LISTEN      107        3099855     13233/Xvnc4     
tcp6       0      0 :::5901                 :::*                    LISTEN      107        3099858     13233/Xvnc4</pre></div></div><p>By trial and error, I figured out that 5901 was the port I should use.</p></li><li><p>Port-forward VNC to your local machine.</p><ol><li>Disconnect from the server.</li><li>Reconnect, including <code>-L10000:localhost:5901</code> on your SSH command line.</li><li>Leave this connection open.</li></ol></li><li><p>On your local machine, connect a VNC <em>client</em> to localhost:10000. An X terminal should be displayed.</p></li></li><li><p>In the X terminal, run your web tests.</p></li><li> When finished debugging, kill the X server using the display noted earlier.<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">vncserver <span style="color: #660033;">-kill</span> :<span style="color: #000000;">1</span></pre></div></div></li></ol> ]]></content:encoded> <wfw:commentRss>http://adammonsen.com/post/717/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Passwordless SSH and other Tutorials</title><link>http://adammonsen.com/post/412?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=passwordless-ssh-and-other-tutorials</link> <comments>http://adammonsen.com/post/412#comments</comments> <pubDate>Fri, 09 Jan 2009 21:00:55 +0000</pubDate> <dc:creator>adam</dc:creator> <category><![CDATA[Default]]></category> <category><![CDATA[admin]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[ssh]]></category> <category><![CDATA[vim]]></category><guid isPermaLink="false">http://adammonsen.com/?p=412</guid> <description><![CDATA[New to GNU/Linux? Trying to get started with the same tools used by the pros? Check out linuxconfig.org. I helped them with their Passwordless SSH tutorial, and I like the screencasts in the Vim tutorial.]]></description> <content:encoded><![CDATA[<p>New to GNU/Linux? Trying to get started with the same tools used by the pros? Check out <a href="http://linuxconfig.org">linuxconfig.org</a>.</p><p>I helped them with their <a href="http://linuxconfig.org/Passwordless_ssh">Passwordless SSH tutorial</a>, and I like the screencasts in the <a href="http://linuxconfig.org/Vim_Tutorial">Vim tutorial</a>.</p> ]]></content:encoded> <wfw:commentRss>http://adammonsen.com/post/412/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Forced Remote Firefox</title><link>http://adammonsen.com/post/318?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=forced-remote-firefox</link> <comments>http://adammonsen.com/post/318#comments</comments> <pubDate>Thu, 20 Dec 2007 14:00:35 +0000</pubDate> <dc:creator>adam</dc:creator> <category><![CDATA[Default]]></category> <category><![CDATA[firefox]]></category> <category><![CDATA[ssh]]></category> <category><![CDATA[x11]]></category><guid isPermaLink="false">http://adammonsen.com/post/318</guid> <description><![CDATA[If a local instance of Firefox is running and you ssh into a remote machine (while forwarding X connections locally) a remotely invoked Firefox may simply open a new window in the local instance. Here&#8217;s a workaround (spoiler: use the -no-remote command-line flag).]]></description> <content:encoded><![CDATA[<p>If a local instance of Firefox is running and you ssh into a remote machine (while forwarding X connections locally) a remotely invoked Firefox may simply open a new window in the local instance. <a href="http://www.theopensourcerer.com/2007/11/15/remote-firefox-over-xssh/">Here&#8217;s a workaround</a> (spoiler: use the <code>-no-remote</code> command-line flag).</p> ]]></content:encoded> <wfw:commentRss>http://adammonsen.com/post/318/feed</wfw:commentRss> <slash:comments>1</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced

Served from: adammonsen.com @ 2012-05-22 20:05:07 -->
