<?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>pig-monkey.com &#187; gnu screen</title>
	<atom:link href="http://pig-monkey.com/tag/gnu-screen/feed/" rel="self" type="application/rss+xml" />
	<link>http://pig-monkey.com</link>
	<description>Here are recorded many goings and comings, doings and beings; stories, symbols and meanings. Gossamer threads that may be woven into a larger web: a story of this Age of the World.</description>
	<lastBuildDate>Sun, 25 Jul 2010 08:11:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>An Ubuntu VPS on Slicehost: Basic Setup</title>
		<link>http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-basic-setup/</link>
		<comments>http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-basic-setup/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 19:04:09 +0000</pubDate>
		<dc:creator>Pig Monkey</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[gnu screen]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[slicehost]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://www.pig-monkey.com/?p=1408</guid>
		<description><![CDATA[As mentioned previously, I&#8217;ve recently moved this domain over to Slicehost. What follows is Part One of a guide, compiled from my notes, to setting up an Ubuntu Hardy VPS. See also Part Two, Part Three, and Part Four. Slicehost has an excellent article repository, containing guides on a number of subjects. After building a <a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-basic-setup/">[...]</a>]]></description>
			<content:encoded><![CDATA[<p><em>As <a href="http://pig-monkey.com/2008/06/09/a-move-to-slicehost/">mentioned previously</a>, I&#8217;ve recently moved this domain over to <a href="http://www.slicehost.com/">Slicehost</a>. What follows is Part One of a guide, compiled from my notes, to setting up an Ubuntu Hardy VPS. See also <a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-web-server">Part Two</a>, <a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-mail">Part Three</a>, and <a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-wordpress">Part Four</a>.</em></p>
<p>Slicehost has an <a href="http://articles.slicehost.com/">excellent article repository</a>, containing guides on a number of subjects. After building a fresh Slice, you should first follow <a href="http://articles.slicehost.com/2008/4/25/ubuntu-hardy-setup-page-1">Part 1</a> and <a href="http://articles.slicehost.com/2008/4/25/ubuntu-hardy-setup-page-2">Part 2</a> of Slicehost&#8217;s basic setup articles.</p>
<p>I use slightly different coloring in my bash prompt, so, rather than what Slicehost suggests in their article, I add the following to <code>~/.bashrc</code>:</p>
<p><span id="more-1408"></span></p>
<p><pre>
export PS1=&#039;\[\033[0;32m\]\u@\[\033[0;35m\]\h\[\033[0;33m\] \w\[\033[00m\]: &#039;
</pre></p>
<p>This is a good time to protect SSH by installing <a href="http://denyhosts.sourceforge.net/">DenyHosts</a>, which I discuss <a href="http://pig-monkey.com/2008/10/03/thoughts-on-ssh-security/">here</a>:<br />
<pre>
$ sudo aptitude install denyhosts
</pre></p>
<p>Ubuntu&#8217;s default text editor is nano, which I abhor. Real men use vim. Ubuntu comes with a slimmed down version of vim, but you&#8217;ll probably want the full version:<br />
<pre>
$ sudo aptitude install vim
</pre></p>
<p>To change the global default editor variable, execute the following and select the editor of your choice:<br />
<pre>
$ sudo update-alternatives --config editor
</pre></p>
<p>This is also a perfect time to install <a href="http://www.gnu.org/software/screen/">GNU Screen</a>.<br />
<pre>
$ sudo aptitude install screen
</pre></p>
<p>If you&#8217;re not familiar with Screen, <a href="http://www.redhatmagazine.com/2007/09/27/a-guide-to-gnu-screen/">Red Hat Magazine has a nice little introduction</a></p>
<p>My .screenrc looks like this:<br />
<pre>
# Print a pretty line at the bottom of the screen
hardstatus alwayslastline
hardstatus string &#039;%{= kG}[ %{G}%H %{g}][%= %{=kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{Y}%Y-%m-%d %{W}%c %{g}]&#039;

# Nobody likes startup messages
startup_message off

# Turn visual bell on and set the message to display for only a fraction of a second
vbell on
vbellwait .3

# Set default shell title to blank
shelltitle &#039;&#039;

# Gimme my scrollback!
defscrollback 5000

# Change command character to backtick
escape `` 

# Stop programs (live vim) from leaving their contents
# in the window after they exit
altscreen on

# Default screens
screen -t shell 0 
</pre></p>
<p>I prefer to have my bash profile setup to connect me to Screen as soon as I login. If there are no running sessions, it will create one. If there is a current session, it will disconnect the session from wherever it is connected and connect it to my login. When I disconnect from screen, it automatically logs me out. To achieve this, I add the following to <code>~/.bashrc</code>:</p>
<p><pre>
# If possible, reattach to an existing session and detach that session
# elsewhere. If not possible, create a new session.
if [ -z &quot;$STY&quot; ]; then
&nbsp;&nbsp;&nbsp;&nbsp;exec screen -dR
fi
</pre></p>
<p>I would also recommend following Slicehost&#8217;s guide to <a href="http://articles.slicehost.com/2007/9/10/scanning-for-rootkits-with-chkrootkit">installing chkrootkit</a> and <a href="http://articles.slicehost.com/2007/9/10/scanning-for-rootkits-with-rkhunter">rkhunter</a>.</p>
<p>One more thing: let&#8217;s set the timezone of the server to whatever is local to you (Slicehost&#8217;s Ubuntu image defaults to UTC). To do that, run:<br />
<pre>
$ sudo dpkg-reconfigure tzdata
</pre></p>
<p>Next up: <a href="http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-web-server">install a web server</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://pig-monkey.com/2008/06/10/an-ubuntu-vps-on-slicehost-basic-setup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
