<?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/"
	>

<channel>
	<title>Pastacode computer science blog</title>
	<atom:link href="http://www.pastacode.de/feed/en/" rel="self" type="application/rss+xml" />
	<link>http://www.pastacode.de</link>
	<description>Blog from a computer science student: programming, web, algorithms, computers and apples </description>
	<pubDate>Tue, 28 Jul 2009 11:14:29 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Howto: Virtualising with Xen under Debian Lenny (Linux Kernel 2.6.26)</title>
		<link>http://www.pastacode.de/howto-virtualising-with-xen-under-debian-lenny-linux-kernel-2626/en/</link>
		<comments>http://www.pastacode.de/howto-virtualising-with-xen-under-debian-lenny-linux-kernel-2626/en/#comments</comments>
		<pubDate>Sun, 22 Mar 2009 12:08:13 +0000</pubDate>
		<dc:creator>Benjamin Milde</dc:creator>
		
		<category><![CDATA[Howto]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Virtualisierung]]></category>

		<category><![CDATA[Xen]]></category>

		<guid isPermaLink="false">http://www.pastacode.de/?p=337</guid>
		<description><![CDATA[This howto is about installing and configuring Xen under the Linux distribution Debian Lenny. It also shows some simple steps to create and manage Xen-images.
Xen belongs to the group of paravirtualization, there an hypervisor (which runs on the host system) distributes cpu-cycles and other resources to virtual guest systems. The guest system will be directly [...]]]></description>
			<content:encoded><![CDATA[<p>This howto is about installing and configuring Xen under the Linux distribution Debian Lenny. It also shows some simple steps to create and manage Xen-images.<br />
Xen belongs to the group of paravirtualization, there an hypervisor (which runs on the host system) distributes cpu-cycles and other resources to virtual guest systems. The guest system will be directly executed on the CPU, with the exception of system calls, which are forwarded to the hypervisor. This works without special hardware extensions at an amazing performance, closely to native speed. The only drawback is that the host system must be patched in order to use the hypervisor instead of real syscalls. Special kernel-patches for Linux, FreeBSD, Solaris, and other free operating systems are already available. If you like to run Windows, which can&#8217;t be patched, you must stick with hardware-virtualization, a feature that Xen now also offers.<br />
<span id="more-337"></span></p>
<p>But now to the installation: I show it with the 64bit version of Debian Lenny.</p>
<p>After the installation of Lenny, install the custom Xen kernel and Xen-Tools:</p>
<p><code>apt-get install xen-linux-system-2.6.26-1-xen-amd64 xen-utils-3.2-1 lvm2 python-xml xen-tools</code></p>
<p>In order to bridge the virtual network devices of your guests to the host system, you need to edit the configuration file /etc/xen/xend-config.sxp</p>
<p>This part is relevant:</p>
<p><code><br />
##<br />
# To bridge network traffic, like this:<br />
#<br />
# dom0: ----------------- bridge -> real eth0 -> the network<br />
#                            |<br />
# domU: fake eth0 -> vifN.0 -+<br />
#<br />
# use<br />
#<br />
(network-script network-bridge)<br />
#<br />
# Your default ethernet device is used as the outgoing interface, by default.<br />
# To use a different one (e.g. eth1) use<br />
#<br />
# (network-script 'network-bridge netdev=eth1')<br />
#<br />
# The bridge is named xenbr0, by default.  To rename the bridge, use<br />
#<br />
# (network-script 'network-bridge bridge=<name>&#8216;)<br />
#<br />
# It is possible to use the network-bridge script in more complicated<br />
# scenarios, such as having two outgoing interfaces, with two bridges, and<br />
# two fake interfaces per guest domain.  To do things like this, write<br />
# yourself a wrapper script, and call network-bridge from it, as appropriate.<br />
#<br />
#(network-script network-dummy)<br />
</code></p>
<p>You must comment &#8220;(network-script network-dummy)&#8221; out as seen in the listing and remove the comment before &#8220;(network-script network-bridge)&#8221;</p>
<p>Now you can boot into your freshly installed Xen-Linux:<br />
<code>shutdown -r now</code></p>
<p>To check that everything works as expected run:</p>
<p><code>xm list</code> Xm stands for Xen-management, a tool to manage your guest machines.</p>
<p>Is should say something like this:</p>
<p><code><br />
olymp:~# xm list<br />
Name                                        ID   Mem VCPUs      State   Time(s)<br />
Domain-0                                     0  3242     4     r-----    266.8<br />
</code></p>
<p>Domain-0 is your host system and you haven&#8217;t created any guests yet.</p>
<p>You can do that very easily with the xen-tools, that you&#8217;ve already installed. You can set your default preferences for it very easily in the file /etc/xen-tools/xen-tools.conf. To use Debian Lenny 64bit as default guest, use the following configuration:</p>
<link rel="stylesheet" href="http://www.pastacode.de/wp-content/plugins/codeviewer/codeviewer.css" type="text/css" media="all" />
<ol class="codelist">
<li value="1" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">##</span></code></li>
<li value="2" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># &nbsp;/etc/xen-tools/xen-tools.conf</span></code></li>
<li value="3" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">##</span></code></li>
<li value="4" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="5" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># &nbsp;This is the global configuration file for the scripts included</span></code></li>
<li value="6" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># within the xen-tools package.</span></code></li>
<li value="7" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="8" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># &nbsp;For more details please see:</span></code></li>
<li value="9" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="10" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># &nbsp; &nbsp; &nbsp; &nbsp;http://xen-tools.org/</span></code></li>
<li value="11" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="12" class="tab0 even"><code><span style="color: #666666; font-style: italic;">##</span></code></li>
<li value="13" class="odd">&nbsp;</li>
<li value="14" class="even">&nbsp;</li>
<li value="15" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">##</span></code></li>
<li value="16" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="17" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># File Format</span></code></li>
<li value="18" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># &#8212;&#8212;&#8212;&#8211;</span></code></li>
<li value="19" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="20" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># &nbsp;Anything following a &#8216;#&#8217; character is ignored as a comment.</span></code></li>
<li value="21" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="22" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># &nbsp;Otherwise the format of this file &quot;key = value&quot;. &nbsp;The value of</span></code></li>
<li value="23" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># any keys in this file may be constructed via the output of a command.</span></code></li>
<li value="24" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="25" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># &nbsp;For example:</span></code></li>
<li value="26" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="27" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># &nbsp; &nbsp; &nbsp; &nbsp; kernel = /boot/vmlinuz-`uname -r`</span></code></li>
<li value="28" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="29" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">##</span></code></li>
<li value="30" class="even">&nbsp;</li>
<li value="31" class="odd">&nbsp;</li>
<li value="32" class="even">&nbsp;</li>
<li value="33" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="34" class="tab0 even"><code><span style="color: #666666; font-style: italic;">##</span></code></li>
<li value="35" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># &nbsp;Output directory for storing loopback images.</span></code></li>
<li value="36" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="37" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># &nbsp;If you choose to use loopback images, which are simple to manage but</span></code></li>
<li value="38" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># slower than LVM partitions, then specify a directory here and uncomment</span></code></li>
<li value="39" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># the line.</span></code></li>
<li value="40" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="41" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># &nbsp;New instances will be stored in subdirectories named after their</span></code></li>
<li value="42" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># hostnames.</span></code></li>
<li value="43" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="44" class="tab0 even"><code><span style="color: #666666; font-style: italic;">##</span></code></li>
<li value="45" class="tab0 odd"><code><span style="color: #c20cb9; font-weight: bold;">dir</span> = <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>xen</code></li>
<li value="46" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="47" class="odd">&nbsp;</li>
<li value="48" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="49" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">##</span></code></li>
<li value="50" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="51" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># If you don&#8217;t wish to use loopback images then you may specify an</span></code></li>
<li value="52" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># LVM volume group here instead</span></code></li>
<li value="53" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="54" class="tab0 even"><code><span style="color: #666666; font-style: italic;">##</span></code></li>
<li value="55" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># lvm = skx-vg</span></code></li>
<li value="56" class="even">&nbsp;</li>
<li value="57" class="odd">&nbsp;</li>
<li value="58" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="59" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">##</span></code></li>
<li value="60" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="61" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># &nbsp;Installation method.</span></code></li>
<li value="62" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="63" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># &nbsp;There are four distinct methods which you may to install a new copy</span></code></li>
<li value="64" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># of Linux to use in your Xen guest domain:</span></code></li>
<li value="65" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="66" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># &nbsp; - Installation via the debootstrap command.</span></code></li>
<li value="67" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># &nbsp; - Installation via the rpmstrap command.</span></code></li>
<li value="68" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># &nbsp; - Installation via the rinse command.</span></code></li>
<li value="69" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># &nbsp; - Installation by copying a directory containing a previous installation.</span></code></li>
<li value="70" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># &nbsp; - Installation by untarring a previously archived image.</span></code></li>
<li value="71" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="72" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># &nbsp;NOTE That if you use the &quot;untar&quot;, or &quot;copy&quot; options you should ensure</span></code></li>
<li value="73" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># that the image you&#8217;re left with matches the &#8216;dist&#8217; setting later in</span></code></li>
<li value="74" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># this file.</span></code></li>
<li value="75" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="76" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="77" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">##</span></code></li>
<li value="78" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="79" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="80" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># install-method = [ debootstrap | rinse | rpmstrap | copy | tar ]</span></code></li>
<li value="81" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="82" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="83" class="tab0 odd"><code>install-method = debootstrap</code></li>
<li value="84" class="even">&nbsp;</li>
<li value="85" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="86" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># If you&#8217;re using the &quot;copy&quot;, or &quot;tar&quot; installation methods you must</span></code></li>
<li value="87" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># need to specify the source location to copy from, or the source</span></code></li>
<li value="88" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># .tar file to unpack.</span></code></li>
<li value="89" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="90" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># You may specify that with a line such as:</span></code></li>
<li value="91" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="92" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># install-source = /path/to/copy</span></code></li>
<li value="93" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># install-source = /some/path/img.tar</span></code></li>
<li value="94" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="95" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="96" class="even">&nbsp;</li>
<li value="97" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="98" class="tab0 even"><code><span style="color: #666666; font-style: italic;">##</span></code></li>
<li value="99" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># &nbsp;Command definitions.</span></code></li>
<li value="100" class="tab0 even"><code><span style="color: #666666; font-style: italic;">##</span></code></li>
<li value="101" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="102" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># The &quot;rinse&quot;, and &quot;rpmstrap&quot; commands are hardwired into</span></code></li>
<li value="103" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># the script, but if you wish to modify the commands which are executed</span></code></li>
<li value="104" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># when installing new systems by a &quot;copy&quot;, &quot;debootstrap&quot;, or &quot;tar&quot; method</span></code></li>
<li value="105" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># you can do so here:</span></code></li>
<li value="106" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="107" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># (This allows you to install from a .tar.bz file, rather than a plain</span></code></li>
<li value="108" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># tar file, use cdebootstrap, etc.)</span></code></li>
<li value="109" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="110" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># install-method=copy:</span></code></li>
<li value="111" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># copy-cmd = /bin/cp -a $src/* $dest</span></code></li>
<li value="112" class="tab0 even"><code><span style="color: #666666; font-style: italic;">##</span></code></li>
<li value="113" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#install-method=debootstrap:</span></code></li>
<li value="114" class="tab0 even"><code>debootstrap-cmd=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>debootstrap</code></li>
<li value="115" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="116" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># install-method=tar:</span></code></li>
<li value="117" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># tar-cmd &nbsp;= /bin/tar &#8211;numeric-owner -xvf $src</span></code></li>
<li value="118" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="119" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="120" class="even">&nbsp;</li>
<li value="121" class="odd">&nbsp;</li>
<li value="122" class="even">&nbsp;</li>
<li value="123" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="124" class="tab0 even"><code><span style="color: #666666; font-style: italic;">##</span></code></li>
<li value="125" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># &nbsp;Disk and Sizing options.</span></code></li>
<li value="126" class="tab0 even"><code><span style="color: #666666; font-style: italic;">##</span></code></li>
<li value="127" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="128" class="tab0 even"><code><span style="color: #c20cb9; font-weight: bold;">size</span> &nbsp; = 4Gb &nbsp; &nbsp; &nbsp;<span style="color: #666666; font-style: italic;"># Disk image size.</span></code></li>
<li value="129" class="tab0 odd"><code>memory = 256Mb &nbsp; &nbsp;<span style="color: #666666; font-style: italic;"># Memory size</span></code></li>
<li value="130" class="tab0 even"><code>swap &nbsp; = 256Mb &nbsp; &nbsp;<span style="color: #666666; font-style: italic;"># Swap size</span></code></li>
<li value="131" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># noswap = 1 &nbsp; &nbsp; &nbsp;# Don&#8217;t use swap at all for the new system.</span></code></li>
<li value="132" class="tab0 even"><code>fs &nbsp; &nbsp; = ext3 &nbsp; &nbsp; <span style="color: #666666; font-style: italic;"># use the EXT3 filesystem for the disk image.</span></code></li>
<li value="133" class="tab0 odd"><code>dist &nbsp; = lenny &nbsp; &nbsp; <span style="color: #666666; font-style: italic;"># Default distribution to install.</span></code></li>
<li value="134" class="tab0 even"><code>image &nbsp;= sparse &nbsp; <span style="color: #666666; font-style: italic;"># Specify sparse vs. full disk images.</span></code></li>
<li value="135" class="odd">&nbsp;</li>
<li value="136" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="137" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># &nbsp;Currently supported and tested distributions include:</span></code></li>
<li value="138" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="139" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># via Debootstrap:</span></code></li>
<li value="140" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="141" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># &nbsp;Debian:</span></code></li>
<li value="142" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># &nbsp; sid, sarge, etch, lenny.</span></code></li>
<li value="143" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="144" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># &nbsp;Ubuntu:</span></code></li>
<li value="145" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># &nbsp; edgy, feisty, dapper.</span></code></li>
<li value="146" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="147" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># via Rinse:</span></code></li>
<li value="148" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># &nbsp; centos-4, centos-5.</span></code></li>
<li value="149" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># &nbsp; fedora-core-4, fedora-core-5, fedora-core-6, fedora-core-7</span></code></li>
<li value="150" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="151" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="152" class="even">&nbsp;</li>
<li value="153" class="odd">&nbsp;</li>
<li value="154" class="even">&nbsp;</li>
<li value="155" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">##</span></code></li>
<li value="156" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># Networking setup values.</span></code></li>
<li value="157" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">##</span></code></li>
<li value="158" class="even">&nbsp;</li>
<li value="159" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="160" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># Uncomment and adjust these network settings if you wish to give your</span></code></li>
<li value="161" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># new instances static IP addresses.</span></code></li>
<li value="162" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="163" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># gateway &nbsp; = 192.168.1.1</span></code></li>
<li value="164" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># netmask &nbsp; = 255.255.255.0</span></code></li>
<li value="165" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># broadcast = 192.168.1.255</span></code></li>
<li value="166" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="167" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># Uncomment this if you wish the images to use DHCP</span></code></li>
<li value="168" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="169" class="tab0 odd"><code>dhcp = <span style="color: #000000;">1</span></code></li>
<li value="170" class="even">&nbsp;</li>
<li value="171" class="odd">&nbsp;</li>
<li value="172" class="tab0 even"><code><span style="color: #666666; font-style: italic;">##</span></code></li>
<li value="173" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># Misc options</span></code></li>
<li value="174" class="tab0 even"><code><span style="color: #666666; font-style: italic;">##</span></code></li>
<li value="175" class="odd">&nbsp;</li>
<li value="176" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="177" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># Uncomment the following line if you wish to disable the caching</span></code></li>
<li value="178" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># of downloaded .deb files when using debootstrap to install images.</span></code></li>
<li value="179" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="180" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># cache = no</span></code></li>
<li value="181" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="182" class="even">&nbsp;</li>
<li value="183" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="184" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># Uncomment the following line if you wish to interactively setup</span></code></li>
<li value="185" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># a new root password for images.</span></code></li>
<li value="186" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="187" class="tab0 odd"><code><span style="color: #c20cb9; font-weight: bold;">passwd</span> = <span style="color: #000000;">1</span></code></li>
<li value="188" class="even">&nbsp;</li>
<li value="189" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="190" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># If you&#8217;d like all accounts on your host system which are not present</span></code></li>
<li value="191" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># on the guest system to be copied over then uncomment the following line.</span></code></li>
<li value="192" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="193" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># accounts = 1</span></code></li>
<li value="194" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="195" class="odd">&nbsp;</li>
<li value="196" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="197" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># Default kernel and ramdisk to use for the virtual servers</span></code></li>
<li value="198" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="199" class="tab0 odd"><code>kernel &nbsp; &nbsp; &nbsp;= <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>vmlinuz-<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">uname</span> -r<span style="color: #000000; font-weight: bold;">`</span></code></li>
<li value="200" class="tab0 even"><code>initrd &nbsp; &nbsp; &nbsp;= <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>initrd.img-<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">uname</span> -r<span style="color: #000000; font-weight: bold;">`</span></code></li>
<li value="201" class="odd">&nbsp;</li>
<li value="202" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="203" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># &nbsp;The architecture to use when using debootstrap, rinse, or rpmstrap.</span></code></li>
<li value="204" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="205" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># &nbsp;This is most useful on 64 bit host machines, for other systems it</span></code></li>
<li value="206" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># doesn&#8217;t need to be used.</span></code></li>
<li value="207" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="208" class="tab0 even"><code><span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">arch</span></span>=amd64</code></li>
<li value="209" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="210" class="even">&nbsp;</li>
<li value="211" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="212" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># The default mirror for debootstrap to install Debian-derived distributions</span></code></li>
<li value="213" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="214" class="tab0 even"><code>mirror = http:<span style="color: #000000; font-weight: bold;">//</span>ftp.de.debian.org<span style="color: #000000; font-weight: bold;">/</span>debian<span style="color: #000000; font-weight: bold;">/</span></code></li>
<li value="215" class="odd">&nbsp;</li>
<li value="216" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="217" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># A mirror suitable for use when installing the Dapper release of Ubuntu.</span></code></li>
<li value="218" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="219" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># mirror = http://gb.archive.ubuntu.com/ubuntu/</span></code></li>
<li value="220" class="even">&nbsp;</li>
<li value="221" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="222" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># &nbsp;If you like you could use per-distribution mirrors, which will</span></code></li>
<li value="223" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># be more useful if you&#8217;re working in an environment where you want</span></code></li>
<li value="224" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># to regularly use multiple distributions:</span></code></li>
<li value="225" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="226" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># mirror_sid=http://ftp.us.debian.org/debian</span></code></li>
<li value="227" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># mirror_sarge=http://ftp.us.debian.org/debian</span></code></li>
<li value="228" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># mirror_etch=http://ftp.us.debian.org/debian</span></code></li>
<li value="229" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># mirror_dapper=http://archive.ubuntu.com/ubuntu</span></code></li>
<li value="230" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># mirror_edgy=http://archive.ubuntu.com/ubuntu</span></code></li>
<li value="231" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># mirror_feisty=http://archive.ubuntu.com/ubuntu</span></code></li>
<li value="232" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># mirror_gutsy=http://archive.ubuntu.com/ubuntu</span></code></li>
<li value="233" class="odd">&nbsp;</li>
<li value="234" class="even">&nbsp;</li>
<li value="235" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="236" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># &nbsp;Filesystem options for the different filesystems we support.</span></code></li>
<li value="237" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="238" class="tab0 even"><code>ext3_options &nbsp; = noatime,nodiratime,<span style="color: #007800;">errors</span>=remount-ro</code></li>
<li value="239" class="tab0 odd"><code>ext2_options &nbsp; = noatime,nodiratime,<span style="color: #007800;">errors</span>=remount-ro</code></li>
<li value="240" class="tab0 even"><code>xfs_options &nbsp; &nbsp;= defaults</code></li>
<li value="241" class="tab0 odd"><code>reiser_options = defaults</code></li>
<li value="242" class="even">&nbsp;</li>
<li value="243" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="244" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># &nbsp;Uncomment if you wish newly created images to boot once they&#8217;ve been</span></code></li>
<li value="245" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># created.</span></code></li>
<li value="246" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="247" class="tab0 odd"><code>boot = <span style="color: #000000;">1</span></code></li>
<li value="248" class="even">&nbsp;</li>
<li value="249" class="odd">&nbsp;</li>
<li value="250" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="251" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># &nbsp;If you&#8217;re using the lenny or later version of the Xen guest kernel you will</span></code></li>
<li value="252" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># need to make sure that you use &#8216;hvc0&#8242; for the guest serial device,</span></code></li>
<li value="253" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># and &#8216;xvdX&#8217; instead of &#8217;sdX&#8217; for serial devices.</span></code></li>
<li value="254" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="255" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># &nbsp;You may specify the things to use here:</span></code></li>
<li value="256" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="257" class="tab0 odd"><code>serial_device = hvc0 <span style="color: #666666; font-style: italic;">#default</span></code></li>
<li value="258" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># serial_device = tty1</span></code></li>
<li value="259" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="260" class="tab0 even"><code>disk_device = xvda <span style="color: #666666; font-style: italic;">#default</span></code></li>
<li value="261" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># disk_device = sda</span></code></li>
<li value="262" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="263" class="odd">&nbsp;</li>
<li value="264" class="even">&nbsp;</li>
<li value="265" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="266" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># &nbsp;Here we specify the output directory which the Xen configuration</span></code></li>
<li value="267" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># files will be written to, and the suffix to give them.</span></code></li>
<li value="268" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="269" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># &nbsp;Historically xen-tools have created configuration files in /etc/xen,</span></code></li>
<li value="270" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># and given each file the name $hostname.cfg. &nbsp;If you want to change</span></code></li>
<li value="271" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># that behaviour you may do so here.</span></code></li>
<li value="272" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="273" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li value="274" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># output &nbsp; &nbsp;= /etc/xen</span></code></li>
<li value="275" class="tab0 odd"><code><span style="color: #666666; font-style: italic;"># extension = .cfg</span></code></li>
<li value="276" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#</span></code></li>
<li class="sourcelink"><strong>Download this code:</strong> <a href="http://www.pastacode.de/code/xen-tools.conf">xen-tools.conf</a></li>
</ol>
<p>Now you can use:<br />
<code><br />
xen-create-image --hostname test1 --role=udev<br />
</code><br />
to install a new Debian Lenny as guest system. If everything went as it should, you should see your new client after that in &#8220;xm list&#8221;. Otherwise it doesn&#8217;t show up and you can try to manuelly create it with &#8220;xm create <Path to config file>&#8221; to see the error.</p>
<p>By the way &#8220;&#8211;role=udev&#8221; is needed, to install the package udev automatically in the guest. Without it, you can&#8217;t use ssh with your new guest and get the following error if you try to log in:</p>
<p><code><br />
PTY allocation request failed on channel 0<br />
stdin: is not a tty<br />
</code></p>
<p>If you use images for your guest (like shown here) you get very fast to the standard loopback limit of Debian Lenny. With that limit you can&#8217;t create more than 3 or 4 guests. It&#8217;s recommended to edit the file /etc/modprobe.d/local-loop (or create it) to adjust that limit:</p>
<p><code><br />
options loop max_loop=64<br />
</code></p>
<p>Some more basics besides &#8220;xm list&#8221;: You can use &#8220;xm top&#8221; to monitor the activity of your guests (like top for processes). You can start, reboot and shutdown a guest with &#8220;xm start <guest>&#8220;, &#8220;xm reboot <guest>&#8221; and &#8220;xm shutdown <guest>&#8220;.<br />
You can enter a guest system directly with &#8220;xm console <guest>&#8220;. To exit the guest and go back to Dom0 use ctrl+]</p>
<p>For more commands you should read &#8220;xm help&#8221; <img src='http://www.pastacode.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.pastacode.de/howto-virtualising-with-xen-under-debian-lenny-linux-kernel-2626/en/feed/en/</wfw:commentRss>
		</item>
		<item>
		<title>Extending GNU Screen - Adding a taskbar</title>
		<link>http://www.pastacode.de/extending-gnu-screen-adding-a-taskbar/en/</link>
		<comments>http://www.pastacode.de/extending-gnu-screen-adding-a-taskbar/en/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 15:44:24 +0000</pubDate>
		<dc:creator>Benjamin Milde</dc:creator>
		
		<category><![CDATA[Howto]]></category>

		<category><![CDATA[Tipps]]></category>

		<guid isPermaLink="false">http://www.pastacode.de/?p=221</guid>
		<description><![CDATA[One of the biggest drawbacks of GNU Screen is that you don&#8217;t see an overview of your virtual terminals in most standard configurations. But that can be easily changed. My screen now looks like this:
You can clearly see which programs are running and you have a good overview. The other goodies like cpu load display [...]]]></description>
			<content:encoded><![CDATA[<p>One of the biggest drawbacks of GNU Screen is that you don&#8217;t see an overview of your virtual terminals in most standard configurations. But that can be easily changed. My screen now looks like this:</p>
<div id="attachment_74" class="wp-caption alignnone" style="width: 593px"><img src="http://www.pastacode.de/wp-content/screen_pimpt.png" alt="Bild / Screenshot eines gepimpten und aufgemotzten screen-Terminals" title="screen_pimpt" width="583" height="412" class="size-full wp-image-74" /><p class="wp-caption-text">Screenshot of extented screen with taskbar</p></div>
<p>You can clearly see which programs are running and you have a good overview. The other goodies like cpu load display and the clock is also very practical.</p>
<p>The global configuration file /etc/screenrc already has some minor tweaks (Depending on your distribution). If you only want the taskbar for a particular user, than the local .screenrc in your home directory is the file to edit.</p>
<p>The heart of my screen configuration is: </p>
<p><code><br />
backtick 1 0 0 /usr/bin/cpuusage<br />
hardstatus alwayslastline<br />
hardstatus string '%{= kG} %{G}%H %{g}[%= %{=kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}] %1`%% CPU %{W}%c %{g}&#8217;<br />
</code></p>
<p>With &#8220;backtick&#8221; a command-directive (1 here - must be a number) is noted.  The &#8220;0 0&#8243; then means that whenever a new output from the program is produced, screen stores the last line of output. &#8220;Hardstatus&#8221; is for the taskbar and each % directive is for special purposes. With `% 1 for example the last line of the backtick command is printed. For all the other directives better read the <a  rel="no-follow" href="http://www.mediacollege.com/cgi-bin/man/page.cgi?topic=screen">GNU screen-manpage</a></p>
<p>The cpuusage-script looks like this:</p>
<link rel="stylesheet" href="http://www.pastacode.de/wp-content/plugins/codeviewer/codeviewer.css" type="text/css" media="all" />
<ol class="codelist">
<li value="1" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#!/bin/bash</span></code></li>
<li value="2" class="tab0 even"><code><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">&#8216;BEGIN {file = &quot;/proc/stat&quot;;while (a==a) {getline &lt; file;u=$2-up;s=$3-sp;n=$4-np;i=$5-ip;printf (&quot;%2.1f\n&quot;),(u+s)/(u+s+n+i)*100;up=$2;sp=$3;np=$4;ip=$5;close(file);system(&quot;sleep 1&quot;)}}&#8217;</span></code></li>
<li class="sourcelink"><strong>Download this code:</strong> <a href="http://www.pastacode.de/code/cpuusage">cpuusage</a></li>
</ol>
<p>This awk-oneliner uses the information from /proc/stat to calculate the cpuload for one second. That is supported on all unixes with proc support (Mac OS X has no proc).</p>
<p>What&#8217;s missing now, is dynamic window titles. In the previous configuration, all titles are set to &#8220;n * bash&#8221;, we had to change the titles manually.</p>
<p>With a special escape-sequence, the title can be set from the console. The screen manpage explains the procedure:</p>
<p><code><br />
       The default name for all shell windows can be set with the "shelltitle"<br />
       command in the .screenrc file, while all other windows are created with<br />
       a "screen" command and thus can have their name set with the -t option.<br />
       Interactively,    there    is    the    title-string    escape-sequence<br />
       (<esc>kname<esc>\)  and the &#8220;title&#8221; command (C-a A).  The former can be<br />
       output from an application to control the window&#8217;s name under  software<br />
       control,  and  the  latter  will prompt for a name when typed.  You can<br />
       also bind pre-defined names to keys with the  &#8220;title&#8221;  command  to  set<br />
       things quickly without prompting.<br/><br />
       Finally,  screen has a shell-specific heuristic that is enabled by set-<br />
       ting the window&#8217;s name to &#8220;search|name&#8221; and arranging to  have  a  null<br />
       title escape-sequence output as a part of your prompt.  The search por-<br />
       tion specifies an end-of-prompt search string, while the  name  portion<br />
       specifies the default shell name for the window.  If the name ends in a<br />
       &#8216;:&#8217; screen will add what it believes to be the current command  running<br />
       in  the window to the end of the window&#8217;s shell name (e.g. &#8220;name:cmd&#8221;).<br />
       Otherwise the current command name supersedes the shell name  while  it<br />
       is running.<br/><br />
       Here&#8217;s  how  it  works:   you must modify your shell prompt to output a<br />
       null title-escape-sequence (<esc>k<esc>\) as a  part  of  your  prompt.<br />
       The  last part of your prompt must be the same as the string you speci-<br />
       fied for the search portion of the title.  Once this is set up,  screen<br />
       will  use  the title-escape-sequence to clear the previous command name<br />
       and get ready for the next command.  Then, when a newline  is  received<br />
       from  the shell, a search is made for the end of the prompt.  If found,<br />
       it will grab the first word after the matched string and use it as  the<br />
       command  name.  If the command name begins with either &#8216;!&#8217;, &#8216;%&#8217;, or &#8216;^&#8217;<br />
       screen will use the first word on the  following  line  (if  found)  in<br />
       preference  to  the  just-found  name.  This helps csh users get better<br />
       command names when using job control or history recall commands.</p>
<p></code></p>
<p>My shellprompt looks like this:</p>
<p><code><br />
server1 pastacode #<br />
</code></p>
<p>That means, all my commands are typed in after the #. So, I have to add this to my .shellrc :</p>
<p><code><br />
#dynamic title<br />
shelltitle '# |bash'<br />
</code></p>
<p>Screen now looks for a # when it gets the escape-sequence.  &#8220;| Bash&#8221; means that the default title is &#8220;Bash&#8221;. We now only need the escape sequence in our promt; that can be customized (in Bash) with the PS1 variable. To do this we will either edit the /etc/bashrc (for any user) or the local .bashrc in our home directory. My .bashrc looks like this:</p>
<link rel="stylesheet" href="http://www.pastacode.de/wp-content/plugins/codeviewer/codeviewer.css" type="text/css" media="all" />
<ol class="codelist">
<li value="1" class="tab0 odd"><code><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">EDITOR</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">vi</span></code></li>
<li value="2" class="even">&nbsp;</li>
<li value="3" class="tab1 odd"><code><span style="color: #666666; font-style: italic;"># Set the screen title</span></code></li>
<li value="4" class="tab1 even"><code><span style="color: #000000; font-weight: bold;">case</span> <span style="color: #007800;">$TERM</span> <span style="color: #000000; font-weight: bold;">in</span></code></li>
<li value="5" class="tab2 odd"><code><span style="color: #c20cb9; font-weight: bold;">screen</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></code></li>
<li value="6" class="tab3 even"><code><span style="color: #666666; font-style: italic;"># This is the escape sequence ESC k \w ESC \</span></code></li>
<li value="7" class="tab3 odd"><code><span style="color: #666666; font-style: italic;">#Use path as titel</span></code></li>
<li value="8" class="tab3 even"><code><span style="color: #666666; font-style: italic;">#SCREENTITLE=&#8217;\[\ek\w\e\\\]&#8216;</span></code></li>
<li value="9" class="tab3 odd"><code><span style="color: #666666; font-style: italic;">#Use program name as titel</span></code></li>
<li value="10" class="tab3 even"><code><span style="color: #007800;">SCREENTITLE</span>=<span style="color: #ff0000;">&#8216;\[\ek\e\\\]&#8216;</span></code></li>
<li value="11" class="tab3 odd"><code><span style="color: #000000; font-weight: bold;">;;</span></code></li>
<li value="12" class="tab2 even"><code><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></code></li>
<li value="13" class="tab3 odd"><code><span style="color: #007800;">SCREENTITLE</span>=<span style="color: #ff0000;">&#8221;</span></code></li>
<li value="14" class="tab3 even"><code><span style="color: #000000; font-weight: bold;">;;</span></code></li>
<li value="15" class="tab1 odd"><code><span style="color: #000000; font-weight: bold;">esac</span></code></li>
<li value="16" class="even">&nbsp;</li>
<li value="17" class="odd">&nbsp;</li>
<li value="18" class="tab0 even"><code><span style="color: #007800;">PS1</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">${SCREENTITLE}</span><span style="color: #007800;">${PS1}</span>&quot;</span></code></li>
<li class="sourcelink"><strong>Download this code:</strong> <a href="http://www.pastacode.de/code/bashrc">bashrc</a></li>
</ol>
<p>The PS1 is altered to add the screen escape-sequence, but only when we are in screen. In my file, you can actually choose between two versions: either the current path is the dynamic title, or the program name, although I prefer the latter. Unfortunately viewing both seems to be not a trivial thing.</p>
<p>So I hope the whole thing works for you - for suggestions, better ideas - write a comment!</p>
<p>Last but not least my complete .screenrc: </p>
<link rel="stylesheet" href="http://www.pastacode.de/wp-content/plugins/codeviewer/codeviewer.css" type="text/css" media="all" />
<ol class="codelist">
<li value="1" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#no bells and startup messages</span></code></li>
<li value="2" class="tab0 even"><code>startup_message off</code></li>
<li value="3" class="tab0 odd"><code>vbell off</code></li>
<li value="4" class="even">&nbsp;</li>
<li value="5" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#10000 lines scrollback buffer</span></code></li>
<li value="6" class="tab0 even"><code>defscrollback <span style="color: #000000;">10000</span></code></li>
<li value="7" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#no login</span></code></li>
<li value="8" class="tab0 even"><code>deflogin off</code></li>
<li value="9" class="odd">&nbsp;</li>
<li value="10" class="tab0 even"><code><span style="color: #666666; font-style: italic;"># Default shell</span></code></li>
<li value="11" class="tab0 odd"><code>shell <span style="color: #c20cb9; font-weight: bold;">bash</span></code></li>
<li value="12" class="even">&nbsp;</li>
<li value="13" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#Timeout for displaying messages</span></code></li>
<li value="14" class="tab0 even"><code>msgwait <span style="color: #000000;">1</span></code></li>
<li value="15" class="tab0 odd"><code>activity <span style="color: #ff0000;">&quot; &nbsp; &nbsp; &nbsp; &nbsp; Activity has appeared in window &nbsp; &nbsp; &nbsp;%n - %t&quot;</span></code></li>
<li value="16" class="even">&nbsp;</li>
<li value="17" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#taskbar</span></code></li>
<li value="18" class="tab0 even"><code>backtick <span style="color: #000000;">1</span> <span style="color: #000000;">0</span> <span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>cpuusage</code></li>
<li value="19" class="tab0 odd"><code>hardstatus alwayslastline</code></li>
<li value="20" class="tab0 even"><code>hardstatus string <span style="color: #ff0000;">&#8216;%{= kG} %{G}%H %{g}[%= %{=kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}] %1`%% CPU %{W}%c %{g}&#8217;</span></code></li>
<li value="21" class="odd">&nbsp;</li>
<li value="22" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#dynamic title</span></code></li>
<li value="23" class="tab0 odd"><code>shelltitle <span style="color: #ff0000;">&#8216;# |bash&#8217;</span></code></li>
<li value="24" class="even">&nbsp;</li>
<li value="25" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#When your ssh connection dies, screen is autodetached</span></code></li>
<li value="26" class="tab0 even"><code>autodetach on</code></li>
<li value="27" class="odd">&nbsp;</li>
<li value="28" class="tab0 even"><code><span style="color: #666666; font-style: italic;">#Nice 256 term colors</span></code></li>
<li value="29" class="tab0 odd"><code>attrcolor b <span style="color: #ff0000;">&quot;.I&quot;</span></code></li>
<li value="30" class="tab0 even"><code>termcapinfo xterm <span style="color: #ff0000;">&#8216;Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm&#8217;</span></code></li>
<li class="sourcelink"><strong>Download this code:</strong> <a href="http://www.pastacode.de/code/screenrc">screenrc</a></li>
</ol>
<p>And the cpuusage script: </p>
<link rel="stylesheet" href="http://www.pastacode.de/wp-content/plugins/codeviewer/codeviewer.css" type="text/css" media="all" />
<ol class="codelist">
<li value="1" class="tab0 odd"><code><span style="color: #666666; font-style: italic;">#!/bin/bash</span></code></li>
<li value="2" class="tab0 even"><code><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">&#8216;BEGIN {file = &quot;/proc/stat&quot;;while (a==a) {getline &lt; file;u=$2-up;s=$3-sp;n=$4-np;i=$5-ip;printf (&quot;%2.1f\n&quot;),(u+s)/(u+s+n+i)*100;up=$2;sp=$3;np=$4;ip=$5;close(file);system(&quot;sleep 1&quot;)}}&#8217;</span></code></li>
<li class="sourcelink"><strong>Download this code:</strong> <a href="http://www.pastacode.de/code/cpuusage">cpuusage</a></li>
</ol>
<p>Sources:</p>
<p>The pages below helped me alot:</p>
<p><a href="http://listserv.ccjclearline.com/pipermail/kwlug-disc/2006-November/002132.html">http://listserv.ccjclearline.com/pipermail/kwlug-disc/2006-November/002132.html</a><br />
<a href="http://b79.net/code/screenrc">http://b79.net/code/screenrc</a><br />
<a href="http://www.mediacollege.com/cgi-bin/man/page.cgi?topic=screen">http://www.mediacollege.com/cgi-bin/man/page.cgi?topic=screen</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pastacode.de/extending-gnu-screen-adding-a-taskbar/en/feed/en/</wfw:commentRss>
		</item>
		<item>
		<title>Songbird &#8230; The Firefox of audioplayers</title>
		<link>http://www.pastacode.de/songbird-the-firefox-of-audioplayers/en/</link>
		<comments>http://www.pastacode.de/songbird-the-firefox-of-audioplayers/en/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 15:08:20 +0000</pubDate>
		<dc:creator>Benjamin Milde</dc:creator>
		
		<category><![CDATA[Musik]]></category>

		<category><![CDATA[Tipps]]></category>

		<guid isPermaLink="false">http://www.pastacode.de/?p=202</guid>
		<description><![CDATA[ From a certain size on one&#8217;s own music collection is not simply sortable in a file structure. The index approach is something I started to like, I gained control over my collection again. This approach is used by almost all the major players - be it Amarok (Linux), Windows Media Player or Itunes.
 Songbird [...]]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_180" class="wp-caption alignright" style="width: 310px"><a href="http://www.pastacode.de/wp-content/songbird-screenshot.png"><img src="http://www.pastacode.de/wp-content/songbird-screenshot-300x172.png" alt="Songbird screenshot under Mac OS X" title="Songbird screenshot" width="300" height="172" class="size-medium wp-image-180" /></a><p class="wp-caption-text">Songbird screenshot under Mac OS X</p></div> From a certain size on one&#8217;s own music collection is not simply sortable in a file structure. The index approach is something I started to like, I gained control over my collection again. This approach is used by almost all the major players - be it Amarok (Linux), Windows Media Player or Itunes.</p>
<p> Songbird is coming to conquer the crown of this sort of audioplayers. The big download button on <a href="http://www.getsongbird.com/">getsongbird.com</a>, the domain, the site &#8230;. all that is familiar and is reminiscent of Firefox and Co.<span id="more-202"></span></p>
<p>Like back then with Firefox, it will take some time until Songbird reaches the masses.  I tested it&#8230; and hey, I&#8217;m really impressed. This player just has the potential to reach the masses. The appearance just seems like iTunes, but there is more to discover under the hood.</p>
<p>Like with Firefox, Songbird can be extended - some interesting plugins have already been developed. There is mashTape that displays all sorts of useful information about the artist played (see screenshot), the Last.fm Album cover plugin, which shows covers from last.fm&#8230; or the album art manager, to manage covers locally.</p>
<p>There is even iPod support as plugin, which I have not yet tested. It is a very pleasant thing, to have a free (open source!) audio player as an alternative to Itunes and co. </p>
<p>Long live the birdy! <img src='http://www.pastacode.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.pastacode.de/songbird-the-firefox-of-audioplayers/en/feed/en/</wfw:commentRss>
		</item>
		<item>
		<title>Cdogs Mac OS X port</title>
		<link>http://www.pastacode.de/cdogs-mac-os-x-port-2/en/</link>
		<comments>http://www.pastacode.de/cdogs-mac-os-x-port-2/en/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 16:42:46 +0000</pubDate>
		<dc:creator>Benjamin Milde</dc:creator>
		
		<category><![CDATA[Games]]></category>

		<category><![CDATA[Mac]]></category>

		<category><![CDATA[dmg]]></category>

		<category><![CDATA[game]]></category>

		<category><![CDATA[legacy DOS]]></category>

		<category><![CDATA[UniversalBinary]]></category>

		<guid isPermaLink="false">http://www.pastacode.de/?p=167</guid>
		<description><![CDATA[I&#8217;ve made another Mac Bundle, this time it is the SDL version of the legacy DOS-Game Cdogs. 
It&#8217;s not the first mac version, but there exists only an older ppc build.
Download: cdogs.dmg.
* Cdogs 0.4
* UniversalBinary
* needs OS X >= 10.4
* tested under Mac OS X 10.5, Intel.
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve made another Mac Bundle, this time it is the SDL version of the legacy DOS-Game <a href="http://lumaki.com/code/cdogs/">Cdogs</a>. </p>
<p>It&#8217;s not the first mac version, but there exists only an older ppc build.</p>
<p>Download: <a href="http://www.pastacode.de/macgames/cdogs.dmg">cdogs.dmg</a>.</p>
<p>* Cdogs 0.4<br />
* UniversalBinary<br />
* needs OS X >= 10.4<br />
* tested under Mac OS X 10.5, Intel.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pastacode.de/cdogs-mac-os-x-port-2/en/feed/en/</wfw:commentRss>
		</item>
		<item>
		<title>&#8220;Numpty Physics&#8221; intel mac port</title>
		<link>http://www.pastacode.de/numpty-physics-intel-mac-port-2/en/</link>
		<comments>http://www.pastacode.de/numpty-physics-intel-mac-port-2/en/#comments</comments>
		<pubDate>Mon, 12 Jan 2009 15:42:08 +0000</pubDate>
		<dc:creator>Benjamin Milde</dc:creator>
		
		<category><![CDATA[Games]]></category>

		<category><![CDATA[Mac]]></category>

		<category><![CDATA[Physics]]></category>

		<category><![CDATA[Physik]]></category>

		<category><![CDATA[Spiel]]></category>

		<guid isPermaLink="false">http://www.pastacode.de/?p=162</guid>
		<description><![CDATA[&#8220;Harness gravity with your crayon and set about creating blocks, ramps, levers, pulleys and whatever else you fancy to get the little red thing to the little yellow thing.&#8221;
I ported this nice little 2D-physics game to Mac OS X: http://numptyphysics.garage.maemo.org/
The SDL-Linux source was used to port and I only needed minor changes. Mail me if [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;Harness gravity with your crayon and set about creating blocks, ramps, levers, pulleys and whatever else you fancy to get the little red thing to the little yellow thing.&#8221;</p>
<p>I ported this nice little 2D-physics game to Mac OS X: <a href="http://numptyphysics.garage.maemo.org/">http://numptyphysics.garage.maemo.org/</a></p>
<p>The SDL-Linux source was used to port and I only needed minor changes. Mail me if you want the project files. The port is native (Cocoa-SDL!), so no xorg server is needed</p>
<p>Download: <a href="http://www.pastacode.de/macgames/numptyphysics.dmg">here</a>. (Latest version: 0.2 svn-11jan)</p>
<p>Requirements:</p>
<p>* Intel Mac. Sorry, no UB. Couldn&#8217;t make the library Box2D for ppc. If you tell me how much you would love it to have a ppc version, I may try it again.<br />
* Mac Os X >= 10.4</p>
<p>Please comment for questions and tell me if it works for you. HAVE FUN! <img src='http://www.pastacode.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><img src="http://www.pastacode.de/wp-content/np-small.jpg" alt="Numpty Physics 0.2 mac port screenshot" title="Numpty Physics 0.2 mac port screenshot" width="400" height="247" class="alignnone size-full wp-image-155" /></p>
<p><small>Screenshot</small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pastacode.de/numpty-physics-intel-mac-port-2/en/feed/en/</wfw:commentRss>
		</item>
	</channel>
</rss>

