<?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>Frederik&#039;s Blog &#187; Debian</title>
	<atom:link href="http://artipc10.vub.ac.be/wordpress/tag/debian/feed/" rel="self" type="application/rss+xml" />
	<link>http://artipc10.vub.ac.be/wordpress</link>
	<description>Random thoughts of a Linux sysadmin</description>
	<lastBuildDate>Sun, 04 Mar 2012 18:13:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Creating your own GNOME session based on cairo-dock and Compiz</title>
		<link>http://artipc10.vub.ac.be/wordpress/2012/03/04/creating-your-own-gnome-session-based-on-cairo-dock-and-compiz/</link>
		<comments>http://artipc10.vub.ac.be/wordpress/2012/03/04/creating-your-own-gnome-session-based-on-cairo-dock-and-compiz/#comments</comments>
		<pubDate>Sun, 04 Mar 2012 18:09:26 +0000</pubDate>
		<dc:creator>Frederik</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[cairo-dock]]></category>
		<category><![CDATA[Compiz]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[GNOME 3]]></category>
		<category><![CDATA[gnome-shell]]></category>

		<guid isPermaLink="false">http://artipc10.vub.ac.be/wordpress/?p=1244</guid>
		<description><![CDATA[Personally I absolutely do not like the gnome-shell in GNOME 3. I actually even hate it: it is slow, messy and cumbersome to use and I have the feeling that developers are not listening to criticism. Obvious and trivial design bugs which are well known, are totally ignored (bug 662738 is an example). For that [...]]]></description>
			<content:encoded><![CDATA[<p>Personally I absolutely do not like the gnome-shell in GNOME 3. I actually even hate it: it is slow, messy and cumbersome to use and I have the feeling that developers are not listening to criticism. Obvious and trivial design bugs which are well known, are totally ignored (<a href="https://bugzilla.gnome.org/show_bug.cgi?id=662738">bug 662738</a> is an example).</p>
<p>For that reason, I went looking for an alternative desktop. KDE is way too bloated for a netbook with 1 GB of RAM, while XFCE is not as polished as a traditional GNOME 2.32 desktop. The best alternative I could find out right now, was to just replace the GNOME Shell by a custom panel or dock implementation. In the end I chose cairo-dock: it is written in C, so it is probably not as memory hungry as AWN (which uses Python) and Docky (which uses Mono, which I also consider as a possible patent minefield). Cairo-dock is also actively maintained. I paired cairo-dock with the compiz window manager to get some nicely looking desktop.<br />
<span id="more-1244"></span><br />
First we need to install all componenents:</p>
<p><code># apt-get install compiz compizconfig-settings-manager compizconfig-backend-gconf compiz-fusion-plugins-extra compiz-fusion-plugins-main compiz-fusion-plugins-unsupported cairo-dock gnome-tweak-tool</code></p>
<p>Now we create a new X session, which can be chosen in our login screen. First we need to make sure that GNOME understands that compiz is actually a kind of window manager. This is done by creating a desktop file /usr/share/applications/compiz.desktop:</p>
<p><code>[Desktop Entry]<br />
Type=Application<br />
Name=Compiz Window Manager<br />
Exec=/usr/bin/compiz<br />
NoDisplay=true<br />
X-GNOME-Autostart-Phase=WindowManager<br />
X-GNOME-Provides=windowmanager<br />
X-GNOME-Autostart-Notify=true</code></p>
<p>Then we create a custom GNOME Session which starts compiz as window manager and cairo-dock as desktop shell. The file /usr/share/gnome-session/sessions/cairo-dock.session looks like this:</p>
<p><code>[GNOME Session]<br />
Name=cairo-dock</p>
<p>RequiredComponents=cairo-dock;gnome-settings-daemon;<br />
RequiredProviders=windowmanager;notifications;<br />
DefaultProvider-windowmanager=compiz<br />
DefaultProvider-notifications=notification-daemon<br />
</code></p>
<p>We create a little shell script /usr/local/bin/gnome-session-cairo-dock which starts up our custom GNOME session:</p>
<p><code>#! /bin/sh<br />
exec gnome-session --session cairo-dock "$@"</code></p>
<p>The script needs to be executable:<br />
<code># chmod +x /usr/local/bin/gnome-session-cairo-dock</code></p>
<p>And finally we create the /usr/share/xsessions/gnome-cairo-dock.desktop file which defines the custom X session:</p>
<p><code>[Desktop Entry]<br />
Name=GNOME + Cairo Dock<br />
Exec=/usr/local/bin/gnome-session-cairo-dock<br />
TryExec=gnome-session<br />
Icon=<br />
Type=Application<br />
</code></p>
<p>Now when you log out, you will see the GNOME + cairo-dock session in your login manager.</p>
<p>After that you can start up gnome-tweak-tool to customize your environment. You might want to change the default fonts, choose to have the file manager to handle the desktop (so that you will get desktop icons) and change the default theme. If you need to change the fonts of the desktop icons, use this command:</p>
<p><code>$ gsettings set org.gnome.nautilus.desktop font "Cantarell 9"</code></p>
<p>Of course you can replace the Cantarell font or 9 pt font size by your preference.</p>
<p>In cairo-dock, I enabled these plug-ins: Applications menu, Clipboard history, Clock, Log Out, Motion Blur, Notifications Area Old, Recent-Events, Show Desktop, Sound Control. Right click on an applet and choose &#8220;Configure this applet&#8221; to set up various options. I place the notification area at the top of the desktop: in the Desklet tab page, set the desklet position to -220, 0 and under visibibily check &#8220;detached from dock&#8221; and &#8220;should be visible on all desktops&#8221; and set visiblity to &#8220;keep above&#8221;.</p>
<p>With the ccsm utility you can configure your compiz window mananager. First click on Preferences in the left side, and select the GConf configuration back-end. Then enable and configure any plug-in you want. Here are some that I enabled: Gnome compatibility, Expo, Desktop Cube, Fade to desktop, trailfocus, animations, Login/logout, Window Previews, Shift switcher, Move window, Resize window, Scale, Place windows. If you have the problem that you have no window manager when lauching your GNOME + Cairo session, then set the above options in ccsm first from another desktop environment.</p>
]]></content:encoded>
			<wfw:commentRss>http://artipc10.vub.ac.be/wordpress/2012/03/04/creating-your-own-gnome-session-based-on-cairo-dock-and-compiz/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fixing grub-probe error: Couldn&#8217;t find PV, check your device.map.</title>
		<link>http://artipc10.vub.ac.be/wordpress/2011/09/09/fixing-grub-probe-error-couldnt-find-pv-check-your-device-map/</link>
		<comments>http://artipc10.vub.ac.be/wordpress/2011/09/09/fixing-grub-probe-error-couldnt-find-pv-check-your-device-map/#comments</comments>
		<pubDate>Fri, 09 Sep 2011 08:47:25 +0000</pubDate>
		<dc:creator>Frederik</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Grub]]></category>

		<guid isPermaLink="false">http://artipc10.vub.ac.be/wordpress/?p=1085</guid>
		<description><![CDATA[Today I was getting this error when installing a new kernel on a server running Debian: /usr/sbin/grub-probe: error: Couldn't find PV pv2. Check your device.map. The error can be reproduce by running the update-grub command. The day before, a new RAID disk was added to this server, so I suspected this could be the cause. [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was getting this error when installing a new kernel on a server running Debian:</p>
<p><code>/usr/sbin/grub-probe: error: Couldn't find PV pv2. Check your device.map.</code></p>
<p>The error can be reproduce by running the update-grub command.</p>
<p>The day before, a new RAID disk was added to this server, so I suspected this could be the cause. The file /boot/grub/device.map contained a reference to the first RAID disk as (hd0) but did not contain a reference to the new RAID disk. I ran</p>
<p><code># ls -l /dev/disk/by-id/</code></p>
<p>to find out which SCSI ID referred to sdb (the new RAID disk), and then added the following line to device.map:</p>
<p><code><br />
(hd1)	/dev/disk/by-id/scsi-3600304800087c4f015fb4f2e4cc7a8e5<br />
</code></p>
<p>Now installing the new kernel works fine!</p>
]]></content:encoded>
			<wfw:commentRss>http://artipc10.vub.ac.be/wordpress/2011/09/09/fixing-grub-probe-error-couldnt-find-pv-check-your-device-map/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linux performance improvements</title>
		<link>http://artipc10.vub.ac.be/wordpress/2011/05/27/linux-performance-improvements/</link>
		<comments>http://artipc10.vub.ac.be/wordpress/2011/05/27/linux-performance-improvements/#comments</comments>
		<pubDate>Fri, 27 May 2011 10:07:37 +0000</pubDate>
		<dc:creator>Frederik</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[CFS]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[KVM]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[scheduler]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://artipc10.vub.ac.be/wordpress/?p=973</guid>
		<description><![CDATA[Two years ago I wrote an article presenting some Linux performance improvements. These performance improvements are still valid, but it is time to talk about some new improvements available. As I am using Debian now, I will focus on that distribution, but you should be able to easily implement these things on other distributions too. [...]]]></description>
			<content:encoded><![CDATA[<p>Two years ago I wrote<a title="Speeding up my Linux system" href="http://artipc10.vub.ac.be/wordpress/2009/07/08/speeding-up-my-linux-system/"> an article presenting some Linux performance improvements</a>. These performance improvements are still valid, but it is time to talk about some new improvements available. As I am using Debian now, I will focus on that distribution, but you should be able to easily implement these things on other distributions too. Some of these improvements are best suited for desktop systems, other for server systems and some are useful for both.<span id="more-973"></span></p>
<h1>System update</h1>
<p>First of all, it is important that your system is up to date. Update it to Debian testing if you have not done that yet. It will give your, amongst others:</p>
<ul>
<li>Updated <a href="http://www.eglibc.org/cgi-bin/viewcvs.cgi/branches/eglibc-2_13/libc/NEWS?view=markup">eglibc 2.13</a>, which includes functions optimized for instruction sets SSE2, SSSE3&nbsp; and SSE4.2 provided by recent processors</li>
<li>Updated <a href="http://gcc.gnu.org/gcc-4.5/changes.html">GCC 4.5</a> (with <a href="http://gcc.gnu.org/gcc-4.6/changes.html">GCC 4.6</a> being on the way)</li>
<li>Updated graphics stack with Xserver 1.10, Mesa 7.10.2 and new X drivers and up to date pixman and cairo libraries, all improving performance</li>
<li>A recent kernel which brings improvements to process and disk schedulers, better hardware drivers, transparant hugepages (see further), scalability improvements to the EXT4 and XFS file systems and the Virtual File System layer, vhost-net for reduced network latency for KVM virtual machines and more. Debian testing has a 2.6.38 kernel, while 2.6.39 is available in unstable and will migrate to testing in the near future.</li>
<li>Parts of GNOME 2.32, such as Evolution which has improved start-up performance and important bug fixes (for example support of mailboxes larger than 2GB)</li>
<li>Iceweasel 4 is available in Debian Experimental and the upcoming 5 version, bringing even more performance improvements, is already available in an <a href="http://mozilla.debian.net">external repository</a>.</li>
</ul>
<h1>Transparant hugepages</h1>
<p>Transparant hugepages is a feature introduced in Linux 2.6.38 which can improve performance of applications. The processor has a translation lookaside buffer (TLB) which is a CPU cache used to speed up mapping of virtual memory addresses to physical memory addresses. This TLB has a limited size. By transparently combining several small 4 KB pages to larger &#8220;hugepages&#8221;,&nbsp; more pages can fit into the TLB. Transparent hugepages can be enabled on the fly, however it will only have effect on applications started after you have enabled this feature. For this reason, it is best to activate it right from the start by using a kernel boot parameter. With transparent_hugepage=always, the kernel will use transparant hugepages for any process. If you want to use transparent hugepages only for applications which explicitly indicate that they prefer hugepages, you can use transparent_hugepage=madvise. You have to add one of these boot parameters to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub in Debian, and run the update-grub command. At the next boot, you can take a look at the contents of the /sys/kernel/mm/transparent_hugepage file to verify that it is really enabled.</p>
<p>More information:</p>
<ul>
<li><a href="https://lwn.net/Articles/423584/">https://lwn.net/Articles/423584/</a></li>
<li><a href="https://lwn.net/Articles/423592/">https://lwn.net/Articles/423592/</a></li>
</ul>
<h1>Tuning ondemand cpufreq governor</h1>
<p>The ondemand cpufreq governor (which should be used on most systems by default; make sure you have Debbian&#8217;s cpufrequtils package installed) tends to switch back to slower CPU frequency speeds a bit too early in some cases, hurting performance. By setting the sampling_down_factor to a value higher than 1, you can prevent it from reducing the clock speed too quickly.</p>
<p>I have added this to my /etc/rc.local script:<br />
<code><br />
if test -f /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor<br />
then<br />
&nbsp;&nbsp;&nbsp;&nbsp;echo 10 &gt; /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor<br />
fi</code></p>
<p>On server systems, I even use 100 instead of 10.</p>
<p>More information:</p>
<ul>
<li><a href="https://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=3f78a9f7fcee0e9b44a15f39ac382664e301fad5">https://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=3f78a9f7fcee0e9b44a15f39ac382664e301fad5</a></li>
<li><a href="https://forums.gentoo.org/viewtopic-t-877539.html?sid=bb3b956d1960647972fc73b3458ff6c8">https://forums.gentoo.org/viewtopic-t-877539.html?sid=bb3b956d1960647972fc73b3458ff6c8</a></li>
</ul>
<h1>VM dirty ratio</h1>
<p>By default the VM dirty ratio is set to 20% and the background dirty ratio is set to 10%. This means that when 10% of memory is filled with dirty pages (cached data which has to be flushed to disk), the kernel will start writing out the data to disk into the background, without interrupting processes. If the amount of dirty pages raises up to 20%, processes will be forced to write out data to disk and cannot continue other work before they have done so.</p>
<p>By increasing these values, more data will be cached into memory, and data will be written out in larger I/O streams. This can be a good thing on servers with fast storage and lots of memory.</p>
<p>To increase these values, create a file /etc/sysctl.d/dirty_ratio.conf with these contents:<br />
<code><br />
vm.dirty_ratio = 40<br />
vm.dirty_background_ratio = 15</code></p>
<p>Then with the command &lt;code&gt;sysctl -p /etc/sysctl.d/dirty_ratio.conf&lt;/code&gt; you make these settings become in effect immediately.</p>
<p>On desktop systems, the default dirty_ratio of 20 and dirty_background_ratio of 10 should be reasonable. You do not want a too high dirty_ratio on desktop systems, because applications will stall for too long if they have to write out all these dirty pages at once.</p>
<p>More information:</p>
<ul>
<li><a href="http://www.kernel.org/doc/Documentation/sysctl/vm.txt">http://www.kernel.org/doc/Documentation/sysctl/vm.txt</a></li>
<li><a href="http://www.scribd.com/doc/46600383/RHEL-Perf-Tuning">http://www.scribd.com/doc/46600383/RHEL-Perf-Tuning</a></li>
</ul>
<h1>CFS scheduler tuning</h1>
<p>CFS (Competely Fair Scheduler) is the name of the Linux process scheduler. By default it is tuned for desktop workloads. For server systems where throughput is more important than latency, <a href="http://git.fedorahosted.org/git/?p=tuned.git;a=blob_plain;f=tune-profiles/throughput-performance/sysctl.ktune;hb=HEAD">Red Hat&#8217;s tuned package</a> proposes these sysctl settings for CFS for servers:<code><br />
kernel.sched_min_granularity_ns = 10000000<br />
kernel.sched_wakeup_granularity_ns = 15000000</code></p>
<p>More information:</p>
<ul>
<li><a href="http://www.kernel.org/doc/Documentation/scheduler/sched-design-CFS.txt">http://www.kernel.org/doc/Documentation/scheduler/sched-design-CFS.txt</a></li>
</ul>
<h1>ulatencyd</h1>
<p>ulatencyd is a daemon which uses cgroups to give hints to the  kernel&#8217;s process scheduler CFS to improve desktop latency and make  applications feel more responsive. It will prevent individual applications from hogging the system, slowing down other applications .  This is somewhat simpler than the much hyped (but controversial) <a href="https://secure.wikimedia.org/wikipedia/en/wiki/Completely_Fair_Scheduler#Fairer_algorithms">autogroup kernel patch</a> but this solution is much more extensive in that ulatencyd knows  different applications and desktops and knows how to configure the  scheduler to improve responsiveness.</p>
<p>On Debian, you install the ulatencyd package and start the ulatencyd  init script. The ulatency package contains the ulatency client too,  which shows you the cgroups ulatencyd has set up.</p>
<p>In my opinion, ulatencyd is great for desktop systems but I do not recommend to install this on server systems.</p>
<p>More information:</p>
<ul>
<li><a href="https://github.com/poelzi/ulatencyd/wiki">https://github.com/poelzi/ulatencyd/wiki</a></li>
</ul>
<h1>KVM performance improvements</h1>
<p>When using Linux guests in kvm virtual machines, it is important to configure the network interface and hard drive as <a href="http://wiki.libvirt.org/page/Virtio">virtio</a> devices in order to experience the best performance. KVM also benefits from transparant hugepages: be sure to enable them both in the host as in the guest machine.</p>
<p>More information:</p>
<ul>
<li><a href="http://publib.boulder.ibm.com/infocenter/lnxinfo/v3r0m0/topic/liaav/LPC/LPCKVMSSPV2.1.pdf">http://publib.boulder.ibm.com/infocenter/lnxinfo/v3r0m0/topic/liaav/LPC/LPCKVMSSPV2.1.pdf</a></li>
<li><a href="http://www.linux-kvm.org/page/Tuning_KVM">http://www.linux-kvm.org/page/Tuning_KVM</a></li>
</ul>
<h2>VHostNet</h2>
<p>VHostNet improves network latency and throughput of KVM guests. To enable it, you need to load the vhost_net kernel module in your host system. In Debian you can add vhost_net to /etc/modules to load it automatically when booting the system. Then if you use libvirt to manage your virtual machines, VHostNet will be used automatically when starting virtual machines. If you start qemu-kvm by hand, you will need to add the vhost=on option to the netdev device.</p>
<p>More information:</p>
<ul>
<li><a href="http://www.linux-kvm.org/page/VhostNet">http://www.linux-kvm.org/page/VhostNet</a></li>
</ul>
<h2>Raw devices, disable cache and choose deadline I/O scheduler</h2>
<p>For best performance, raw devices are recommended instead of qcow2 or other image files. In libvirt/virt-manager I have defined a storage pool on an LVM volume group, and let virt-install create logical volumes on it containing raw images.</p>
<p>It is recommended to disable I/O caching in KVM because it reduces data copies and bus traffic. In the libvirt XML file for your virtual machine, set the cache=&#8217;none&#8217; attribute for the driver tag for the disk device. You can also use virt-manager to make this change: look for the cache mode under the advanced options for the disk.</p>
<p>Benchmarks seems to indicate that it is best to to use the deadline I/O scheduler instead of the default CFQ scheduler.&nbsp; Using deadline in the guest seems also beneficial.&nbsp; To make deadline the default scheduler, edit /etc/default/grub.conf and add elevator=deadline to the<cite> </cite>GRUB_CMDLINE_LINUX_DEFAULT variable.</p>
<p>More information:</p>
<ul>
<li><a href="http://publib.boulder.ibm.com/infocenter/lnxinfo/v3r0m0/topic/liaat/liaatbpioschedulers.htm">http://publib.boulder.ibm.com/infocenter/lnxinfo/v3r0m0/topic/liaat/liaatbpioschedulers.htm</a></li>
</ul>
<h2>Native AIO</h2>
<p>Native AIO offers better performance than the thread based AIO in KVM. However, it should only be enabled on raw images, because it can lead to disk corruption in some cases otherwise. This problem is supposed to be fixed in recent kernels according to information I got on the <a href="irc://irc.freenode.org/#kvm">#kvm IRC channel</a>, but better be safe than sorry.</p>
<p>To enable this, add the parameter io=&#8217;native&#8217; to the driver tag of the disk in the XML file for the virtual machine in libvirt.</p>
<ul>
<li><a href="https://access.redhat.com/kb/docs/DOC-40644">https://access.redhat.com/kb/docs/DOC-40644</a></li>
</ul>
<h2>CPU features</h2>
<p>By default, KVM only provides a common limited set of CPU instructions implemented by different CPU&#8217;s from Intel and AMD. This is needed to permit live migration of a virtual machine to hardware with a CPU which does not implement all instructions available in the original system. If you do not plan on doing doing that, you can enable all instruction sets of your host CPU in the virtual machines, so that your virtual machine can make use of all advanced features of your CPU (for example SSE3 and others). The easiest way to do this, is by using virt-manager. Click on &#8220;Copy host configuration&#8221; in the Processor &#8211; Configuration settings of the virtual machine. The next time you start up the virtual machine, it will have access to all extended instruction sets of your CPU.</p>
<h2>KSM</h2>
<p>Kernel Samepage Merging is a kernel feature which merges identical pages in memory. If you are using different virtual machines, with the same operating system and applications running in it, lots of memory pages will actually be identical. KSM will save memory by merging the identical pages.</p>
<p>To enable this on Debian, I have put this in my /etc/rc.local script:<br />
<code><br />
echo 1 &gt; /sys/kernel/mm/ksm/run<br />
echo 200 &gt; /sys/kernel/mm/ksm/sleep_millisecs<br />
</code></p>
<p>The last line is optional. It raises the interval during two different memory scans, so that the CPU is not too busy scanning for duplicate memory pages all the time.</p>
<p>More information:</p>
<ul>
<li><a href="http://www.linux-kvm.org/page/KSM">http://www.linux-kvm.org/page/KSM</a></li>
</ul>
<ul>
<li><a href="http://publib.boulder.ibm.com/infocenter/lnxinfo/v3r0m0/index.jsp?topic=/liaat/liaatbpioschedulers.htm">http://publib.boulder.ibm.com/infocenter/lnxinfo/v3r0m0/index.jsp?topic=/liaat/liaatbpioschedulers.htm</a></li>
</ul>
<h1>zram disk</h1>
<p>If you do not have much RAM available in your system, it is useful to compress part of the data in memory. This can be done by using a zram disk, which is a ram disk on which all data is transparently compressed. On this zram disk you create a swap partition which you give a higher priority than the normal on disk swap space. Once the available RAM (total RAM &#8211; RAM reserved for zram disk) is used, data will be swapped out to the zram disk, which is much faster than swap space on a rotating hard disk. This way, more data fits into the RAM.</p>
<p>On my 1 GB netbook system which runs a full GNOME desktop, I have reserved 512 MB for the zram disk. To do so, I added the following in /etc/rc.local:</p>
<p><code>echo $((512*1024*1024)) &gt; /sys/block/zram0/disksize<br />
mkswap /dev/zram0<br />
swapon -p 60 /dev/zram0</code></p>
<p>Of course, a better solution is to add RAM to your system, especially on server systems.</p>
]]></content:encoded>
			<wfw:commentRss>http://artipc10.vub.ac.be/wordpress/2011/05/27/linux-performance-improvements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DHCPd failover</title>
		<link>http://artipc10.vub.ac.be/wordpress/2010/11/28/dhcpd-fail-over/</link>
		<comments>http://artipc10.vub.ac.be/wordpress/2010/11/28/dhcpd-fail-over/#comments</comments>
		<pubDate>Sun, 28 Nov 2010 16:13:40 +0000</pubDate>
		<dc:creator>Frederik</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[DHCP]]></category>
		<category><![CDATA[dhcpd]]></category>
		<category><![CDATA[failover]]></category>
		<category><![CDATA[incron]]></category>
		<category><![CDATA[load balancing]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://artipc10.vub.ac.be/wordpress/?p=839</guid>
		<description><![CDATA[Last week, I set up two dhcpd servers in a fail-over configuration. The goal is that when one DHCP server goes down, the other one takes over so that clients don&#8217;t lose their network connection. I read different tutorials on the web, such as this one of a fellow blogger and this documentation published by [...]]]></description>
			<content:encoded><![CDATA[<p>Last week, I set up two dhcpd servers in a fail-over configuration. The goal is that when one DHCP server goes down, the other one takes over so that clients don&#8217;t lose their network connection. I read different tutorials on the web, such as <a href="http://barryp.org/blog/entries/dhcp-failover//">this one of a fellow blogger</a> and <a href="http://publib.boulder.ibm.com/infocenter/clresctr/vxrx/index.jsp?topic=%2Fcom.ibm.cluster.csm16.admin.doc%2Fam7ad_dhcpfaillnx.html">this documentation published by IBM</a>.</p>
<p><span id="more-839"></span></p>
<p>First of all, you need two machines with exactly the same version of <a href="http://www.isc.org/software/dhcp">ISC dhcpd</a>. Failover is unsupported when the two systems are running a different dhcpd version, as the implementation may have been changed.</p>
<p>On the primary dhcpd, you put this in dhcpd.conf:</p>
<pre>failover peer "dhcp" {
    primary;
    address 123.456.789.001; # address of this server
    port 519;
    peer address 123.456.789.002; # address of the secondary dhcpd
    peer port 519;
   max-response-delay 60;
   max-unacked-updates 10;
   mclt 600;
   split 128;
   load balance max seconds 3;
}

key primaryhost {
    algorithm hmac-md5;
    secret "secret";
};

omapi-key primaryhost;
omapi-port 7911;

include "/etc/dhcp/dhcpd.master";
</pre>
<p>You have to change the address of the primary and the secondary dhcpd in the configuration file. In this example, both the primary and the secondary dhcpd are listening on port 519, so you will have to open this port in the firewall on both systems so that the two dhcp daemons can contact each other.  A split value of 128 means that both the primary and secondary server will manage half of the available IP addresses. By setting a higher number (max 255), the primary server will manage more addresses, by lowering it, the secondary will take care of a bigger part. With this option, you can distribute the load over the two servers. mclt is the duration of leases in seconds that either of the DHCP servers will offer to the peer&#8217;s DHCP clients when the peer is down. max-response-delay defines the number of seconds after which a dhcpd will consider its peer as dead if it does not get any reply; load balance max seconds is the time which a load balancing is disabled: if a dhcpd fails to respond within this time to a DHCPDISCOVER packet, the peer dhcpd will respond in its place.</p>
<p>Now you need to create a key for connecting to OMAPI, which is dhcpd&#8217;s interface which can be used to send it commands at run-time. You will need the dnssec-keygen command, part of the bind9utils package in Debian. To create the key, first cd to the /etc/dhcp/ directory, and run<br />
<code># dnssec-keygen -a HMAC-MD5 -b 512 -n HOST primaryhost</code></p>
<p>&#8220;primaryhost&#8221; should be the name of the key you used in the dhcpd.conf file, you can use use the hostname if you want. This will create two files, one with the extension key and one with the extension private. Open the key file, and copy the last part of the line in that file (i.e. everything after the last space). This is the key&#8217;s secret: you have to to put it in your dhcpd.conf file after the secret keyword.</p>
<p>This is how dhcpd.conf looks like on the secondary dhcpd:</p>
<pre>failover peer "dhcp" {
    secondary;
    address 123.456.789.002;
    port 519;
    peer address 123.456.789.001;
    peer port 519;
    max-response-delay 60;
    max-unacked-updates 10;
    load balance max seconds 3;
}

key secondaryhost {
    algorithm hmac-md5;
    secret "secret";
};

omapi-key secondaryhost;
omapi-port 7911;
include "/etc/dhcp/dhcpd.master";
</pre>
<p>Create an OMAPI key on the secondary dhcpd host, just like you did on the primary host, and copy the key&#8217;s secret in the dhcpd.conf.</p>
<p>Now we have to create the dhcpd.master file. This file should be at all time identical on both hosts! It can look something like this:</p>
<pre>default-lease-time 7200;
max-lease-time 14400;
option domain-name-servers 123.456.789.001, 123.456.789.002;
option domain-name "my.domain";
subnet 123.456.789.0 netmask 255.255.255.0 {
    authoritative;
    option subnet-mask 255.255.255.0;
    option broadcast-address 123.456.789.255;
    option routers 123.456.789.5;
    pool {
        failover peer "dhcp";
        range 123.456.789.50 123.456.789.150;
    }
}</pre>
<p>Basically the only difference with your non-failover dhcpd.conf file, is that you add a line</p>
<pre>failover peer "dhcp"</pre>
<p>in every pool section. If you used another name than dhcp in the failover peer section in dhcpd.conf, replace dhcp by the name you have chosen.</p>
<p>Now we have to find a way to make sure that dhcpd.master on the secondary dhcpd is always in sync with the one on the primary dhcpd. In the future, I might start using something like <a href="http://www.cfengine.org/">cfengine</a> to manage configuration files on my servers, but for now I wanted something simple to set up. <a href="http://incron.aiken.cz">Incron</a> was the perfect solution. On the primary server, I created a /etc/incron.d/dhcpd file with these contents:</p>
<pre>/etc/dhcp IN_CLOSE_WRITE /usr/local/sbin/dhcpd.master.incron.sh $@/$#</pre>
<p>This will execute the given shell script for every time a file is modified and closed in the directory /etc/dhcp. Note that you cannot just put an inotify watch on /etc/dhcp/dhcpd.master itself, as the watch will be lost whenever dhcpd.master is deleted, and this is exactly what happens when you use vim to edit the file: when saving an existing file, vim creates a new temporary file, then deletes the original old file, and renames the temporary file to the original name.</p>
<p>/usr/local/sbin/dhcpd.master.incron looks like this:</p>
<pre>#!/bin/bash
if [ $1"x" == "/etc/dhcp/dhcpd.masterx" ]
then
    scp /etc/dhcp/dhcpd.master dhcp@secondarydhcp.my.domain:/var/lib/dhcpd/dhcpd.master/
fi</pre>
<p>We check whether the saved file is dhcpd.master, and in that case, we scp it to the secondary server.</p>
<p>On the secondary server, I created a user dhcp and I created the directory /var/lib/dhcpd/dhcpd.master/, writable by the dhcp users. I added root&#8217;s ssh certificate of the primary server to ~dhcp/.ssh/authorized_keys on the secondary server.</p>
<p>The install incron on the secondary server and create this incron configuration file:</p>
<pre>/var/lib/dhcpd/dhcpd.master IN_CLOSE_WRITE /usr/local/sbin/dhcpd.master.incron.sh $@/$#</pre>
<p>Then  /usr/local/sbin/dhcpd.master.incron.sh looks like this:</p>
<pre>#!/bin/bash
if [ $1"x" == "/var/lib/dhcpd/dhcpd.master/dhcpd.masterx" ]
then
    cp $1 /etc/dhcp/
    /etc/init.d/dhcpd restart
fi</pre>
<p>Now as soon as you have modified dhcpd.master on the primary dhcp server, the file will be copied to the secondary server and the secondary dhcp daemon will be restarted immediately. You still have to take care of restarting the primary dhcp daemon yourself. I prefer not to do this automatically at every dhcpd.master modification, because otherwise you will have no dhcpd running at all anymore if there is a syntax error in dhcpd.master.</p>
<p>If you plan to do maintenance on one of the dhcp servers, which will take longer than the MCLT time, it can be interesting to let the other dhcpd know that its partner is down, so that it will immediately will claim the complete DHCP pool. You can also use this when you start up one of the dhcp servers while the other one is down. If you do not do this, dhcpd will refuse to offer new IP addresses until MCLT has passed.</p>
<p>For example, if the secondary server is down, run this on the primary server:</p>
<pre>omshell < < EOF
server localhost
port 7911
key primaryhost "secret"
connect
new failover-state
set name = "dhcp"
open
set local-state = 4
update
EOF
</pre>
<p>Keep in mind this note of <a href="http://barryp.org/blog/entries/dhcp-failover/">Barry Pederson's blog</a> however:</p>
<blockquote><p>
When the downed server comes back up, the two servers automatically start communicating and eventually get themselves back into a normal state. But only after the recovering server has spent mclt time in recover-wait state, where it renews existing leases but won't offer up new ones. So you probably wouldn't want to go into a partner-down state if the other server will be down for less than that amount of time.
</p></blockquote>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://artipc10.vub.ac.be/wordpress/2010/11/28/dhcpd-fail-over/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Server migration to Debian</title>
		<link>http://artipc10.vub.ac.be/wordpress/2010/10/04/server-migration-to-debian/</link>
		<comments>http://artipc10.vub.ac.be/wordpress/2010/10/04/server-migration-to-debian/#comments</comments>
		<pubDate>Mon, 04 Oct 2010 17:19:19 +0000</pubDate>
		<dc:creator>Frederik</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[HP Proliant DL185G5]]></category>
		<category><![CDATA[KVM]]></category>
		<category><![CDATA[Mandriva]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[Squeeze]]></category>

		<guid isPermaLink="false">http://artipc10.vub.ac.be/wordpress/?p=815</guid>
		<description><![CDATA[Since this afternoon, this server is now running Debian GNU/Linux Squeeze. Just like the previous system, this is a KVM virtual machine running on a HP Proliant DL185G5 host. The host server has always been running Debian. This was my last production system still running Mandriva. I might have forgotten to move over a few [...]]]></description>
			<content:encoded><![CDATA[<p>Since this afternoon, this server is now running Debian GNU/Linux Squeeze. Just like the previous system, this is a KVM virtual machine running on a HP Proliant DL185G5 host. The host server has always been running Debian. This was my last production system still running Mandriva. I might have forgotten to move over a few things or there might be some breakage somewhere, so let me know if you encounter a problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://artipc10.vub.ac.be/wordpress/2010/10/04/server-migration-to-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why prefer Debian GNU/Linux over another distribution</title>
		<link>http://artipc10.vub.ac.be/wordpress/2010/08/16/why-prefer-debian-gnulinux-over-another-distribution/</link>
		<comments>http://artipc10.vub.ac.be/wordpress/2010/08/16/why-prefer-debian-gnulinux-over-another-distribution/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 13:55:28 +0000</pubDate>
		<dc:creator>Frederik</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux distributions]]></category>
		<category><![CDATA[Mandriva]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://artipc10.vub.ac.be/wordpress/?p=675</guid>
		<description><![CDATA[Quite some time ago I wrote a blog post explaining why I preferred Mandriva over other distributions. But I have now switched to Debian GNU/Linux, so it is time for an update. I will mostly compare with Mandriva because that is where I come from and what I know the best, although most points are [...]]]></description>
			<content:encoded><![CDATA[<p>Quite some time ago I wrote <a href="/wordpress/2009/05/01/why-prefer-mandriva-over-another-distribution/">a blog post explaining why I preferred Mandriva over other distributions</a>. But I have now switched to Debian GNU/Linux, so it is time for an update. I will mostly compare with Mandriva because that is where I come from and what I know the best, although most points are rather universal.</p>
<p>So, these are some reasons why I prefer Debian GNU/Linux over other distributions:</p>
<ul>
<li>All officially released Debian GNU/Linux stable versions are <strong>supported for a long time</strong>. Where most other free distributions are supported for about 1,5 year, this is much longer for Debian stable. For example, <a href="http://wiki.debian.org/DebianEtch">security updates for Debian Etch were published up to about 3 years after its release</a>.</li>
<li>Debian is more <strong>stable</strong> than most other distributions. This is due to the large amount of testers and due to Debian&#8217;s unique development model: the &#8220;unstable&#8221; branch contains only software which is considered stable upstream (with a few generally accepted exceptions). When a package is in &#8220;unstable&#8221; for 10 days without new release critical bugs it gets moved to the &#8220;testing&#8221; distribution. The stable releases are a snapshot of the testing distribution after a freeze during which all release critical bugs are fixed. Releases of the stable distribution are not time driven: the stable distribution is only released when it is really ready.</li>
<li>By using <a href="http://jaqque.sbih.org/kplug/apt-pinning.html"><strong>apt pinning</strong></a> it is possible to easily mix and match packages from different repositories so that you can run the latest version of specific applications. Apt pinning can be used to pick packages from the extensive <a href="http://backports.org/dokuwiki/doku.php">backports</a> repository or to install packages from the testing, unstable and even the experimental repositories without having to update your whole system to the same release (unlike Mandriva for example, and as far as I know the same is true for other distributions like Fedora). Instead, carefully defined dependencies will make sure that all packages which need to be updated together are pulled in, resulting in a working system.</li>
<li>Due to Debian&#8217;s development model it is possible to run a pretty up to date system at any time without sacrificing stability by using <strong>the testing distribution</strong>. I am now running Debian Lenny testing different systems for more than a month, with software which is often more up to date than in Mandriva 2010.1, yet the system is much more stable in general than my systems which were running Mandriva 2010.1.</li>
<li>Debian is <strong>fast</strong>. Debian Squeeze boots up very fast without hacks like Mandriva&#8217;s speedboot, readahead or preload. Also application start up is very fast. I am not really sure why this is the case, but my guess is that this is due to Debian&#8217;s simplicity: it does not install too much daemons and boot up scripts by default. Also Debian uses dash instead of bash for /bin/sh, which also results in faster boot times. Shutdown also feels faster than what I was used to in Mandriva.</li>
<li>Debian is <strong>secure</strong>. Because stable versions are supported for about 3 years and because security updates get released very fast. Debian also plays a rather active role in fixing security problems. For example, Debian&#8217;s webkitgtk maintainer searched for all webkit security patches and ported them to the webkitgtk 1.2 branch. The fixes were included in Debian&#8217;s webkitgtk and then were also included upstream in <a href="https://lists.webkit.org/pipermail/webkit-gtk/2010-July/000291.html"> webkitgtk 1.2.3</a>.</li>
<li><strong>Debian is available for lots of platforms.</strong> You have an old PowerPC based laptop, a <a href="http://www.globalscaletechnologies.com/t-guruplugdetails.aspx">GuruPlug</a> or <a href="http://www.globalscaletechnologies.com/p-35-openrd-ultimate.aspx">OpenRD</a> system with ARM processor or a SUN UltraSPARC server? Debian will run on all these systems.</li>
<li>Debian values <strong>freedom</strong>. Debian allows me to use my GNOME system without PulseAudio without loosing my volume applet in the panel (like was the case in Mandriva). But of course, if you want PulseAudio it is available and you can install it. Debian is not exclusively tied to the Linux kernel: there exist versions with a FreeBSD or even HURD kernels. The choice is up to you. Debian uses the Exim MTA by default but if you do not like this, other MTA&#8217;s are available and are equally well maintained and integrated into the distribution. Debian does not include non-free software by default, so that you can safely use distribute and even modify the software in all possible situations without having to worry about the license. But if you want to use non-free software, it is available in the non-free repository.</li>
<li>Debian is very &#8220;<strong>standard</strong>&#8220;. It does not replace standard components by its own implementations like especially Ubuntu is doing. That means that Debian does not use non-standard things like Upstart, notify-osd or indicator-applet by default or does not move the window decoration buttons to the left side. Of course if you do want to use these csutomizations, they are all available (Debian values freedom!), but by default Debian prefers to use the standard upstream software. This ensures the best compatibility with upstream now and in the future, because all these non-standard Ubuntu things might cause conflicts later on with new upstream design decisions.</li>
<li>Debian is <strong>not owned by a commercial organization</strong>. The free distribution is not some kind of crippled version of a commercial product which has all features and software available. It ensures also that decisions are not taken based on commercial interests, but only in the interest of the community. If you do want commercial support, <a href="http://www.debian.org/consultants/">there are many companies supporting Debian all over the world</a>.</li>
</ul>
<p>Related to that: today is Debian&#8217;s 17th anniversary and Debian Appreciation Day. If you use Debian, let the Debian community know you appreciate their work <a href="http://thank.debian.net">http://thank.debian.net</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://artipc10.vub.ac.be/wordpress/2010/08/16/why-prefer-debian-gnulinux-over-another-distribution/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>A wise server migration</title>
		<link>http://artipc10.vub.ac.be/wordpress/2010/08/07/a-wise-server-migration/</link>
		<comments>http://artipc10.vub.ac.be/wordpress/2010/08/07/a-wise-server-migration/#comments</comments>
		<pubDate>Sat, 07 Aug 2010 21:48:34 +0000</pubDate>
		<dc:creator>Frederik</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Dell]]></category>
		<category><![CDATA[Dokuwiki]]></category>
		<category><![CDATA[Joomla]]></category>
		<category><![CDATA[KVM]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[power consumption]]></category>
		<category><![CDATA[Poweredge R410]]></category>
		<category><![CDATA[Squeeze]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[Wise]]></category>

		<guid isPermaLink="false">http://artipc10.vub.ac.be/wordpress/?p=662</guid>
		<description><![CDATA[Yesterday I migrated two servers at work to a new machine. The old machines were pretty underpowered: a Pentium III 1 Ghz system (with 384 MB RAM if I remember correctly) and a Pentium 4 system. The new machine is a Dell Poweredge R410 with a Xeon E5504 processor, 12 GB RAM and a PERC [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I migrated two servers at work to a new machine. The old machines were pretty underpowered: a Pentium III 1 Ghz system (with 384 MB RAM if I remember correctly) and a Pentium 4 system. The new machine is a Dell Poweredge R410 with a Xeon E5504 processor, 12 GB RAM and a PERC H700 RAID controller (which is actually a LSI MegaSAS 9260) with 3 750 GB SATA disks in RAID 5. The hardware is pretty nice (although I am not happy at all with the way Dell treats its customers, so I will rather prefer other vendors in the future, but maybe more about that in a later post).</p>
<p>The old servers were running Debian Lenny, while the new server runs Debian Squeeze, which is frozen since yesterday. That was a nice coincidence. The new server actually hosts three virtual machines using the Linux KVM virtualization system. One of them hosts the website <a href="http://wise.vub.ac.be"> http://wise.vub.ac.be</a>, a second VM hosts a file server, and a third VM is the gateway for a small internal network.</p>
<p>The migration went pretty well, except for the smaller problems which you can always expect with such things, for example a Java web application which had hard-coded host names which had changed. The update to PHP 5.3 caused some compatibility problems which I already fixed before the migration itself: Dokuwiki had to be updated to a recent version in order to not show any warnings. There was also a website based on Joomla 1.0,  which is actually not supported anymore. As updating it to a recent version was not really an option, I found some posts on the web on how to fix the errors I was seeing and cooked up a simple <a href="/wordpress/wp-content/uploads/joomla.patch">patch</a>.</p>
<p>The new server is using 140 Watts most of the time. Keeping in mind that in the future it will also replace a third old server, that will probably be a nice reduction of power consumption compared to the old situation.</p>
]]></content:encoded>
			<wfw:commentRss>http://artipc10.vub.ac.be/wordpress/2010/08/07/a-wise-server-migration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debian on desktop systems</title>
		<link>http://artipc10.vub.ac.be/wordpress/2010/07/08/debian-on-desktop-systems/</link>
		<comments>http://artipc10.vub.ac.be/wordpress/2010/07/08/debian-on-desktop-systems/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 21:02:19 +0000</pubDate>
		<dc:creator>Frederik</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[avant-window-navigator]]></category>
		<category><![CDATA[Compiz]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Epiphany]]></category>
		<category><![CDATA[Evolution]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[Mandriva]]></category>
		<category><![CDATA[netbook]]></category>
		<category><![CDATA[Pulseaudio]]></category>
		<category><![CDATA[Samsung N210]]></category>

		<guid isPermaLink="false">http://artipc10.vub.ac.be/wordpress/?p=598</guid>
		<description><![CDATA[What I expected to happen some time ago, is finally becoming reality: Debian is now my favourite distribution for desktop systems. First I installed Debian on my new Samsung N210 netbook and I was very pleased with the result. Shortly after that, my father experienced a bug while trying to print in Firefox on Mandriva [...]]]></description>
			<content:encoded><![CDATA[<p><a href="/wordpress/2010/04/27/enjoy-life/">What I expected to happen some time ago</a>, is finally becoming reality: Debian is now my favourite distribution for desktop systems.</p>
<p>First I installed Debian on my new <a href="/wordpress/2010/06/30/samsung-n210-netbook-on-debian-gnulinux/">Samsung N210 netbook</a> and I was very pleased with the result. Shortly after that, my father experienced a bug while trying to print in Firefox on Mandriva 2010.1. It would fail to print and there were errors related to ps2ps (if I remember correctly) in the Cups log, hinting at some bug in Ghostscript. Actually it was not the first time this bug hit us, I had seen the same problem some weeks ago.</p>
<p>As analysing and having this bug fixed would likely take a lot of time and I needed a rather quick solution, I though it was the right time to reinstall this system with Debian Squeeze (testing).  Debian has many additional bug fixes in its GhostScript package so there was a fair chance that printing would be working better. So I did the same as with my netbook last week: I set up PXE booting to start the Debian installer (easier than digging up a CD-R, downloading an ISO and burning it), and then I installed Debian on the disk, leaving the old /home logical volume intact.</p>
<p><span id="more-598"></span></p>
<p>The installation went smoothly and after recreating the users and fixing the UID and GID of the home directories, the system was ready to use. Some observations:</p>
<ul>
<li>The first reaction when booting a clean Debian GNOME install is that it is much faster than Mandriva, even reusing the home directory from the Mandriva installation. Booting itself feels fast, login feels faster and starting applications feels faster. I am not sure whether this is because Debian itself is faster or because my old Mandriva installation was suffering from file fragmentation and suboptimal location of files belonging together.</li>
<li>Debian does not install PulseAudio by default. Even better, it is possible to add a working volume applet to your GNOME panel in Debian if you are not using PulseAudio. This is much better then Mandriva, where you are left without a quickly accessible volume mixer if you disable PulseAudio.</li>
<li>I had to re-add all applets on the GNOME panels. I am not sure why they were all lost after switching to Debian. After all, Mandriva and Debian Squeeze use the same GNOME 2.30 version. Anyway, this was easily fixable.</li>
<li>If you have a wired connection which is configured in /etc/network/interfaces, then NetworkManager will not pick up the network connection and because of that applications like Evolution will not go online because they think there is no network connection. Either completely remove the networkmanager package (I would recommend this on a desktop system with just an Ethernet connection) or comment out everything in /etc/network/interfaces related to your Ethernet card and configure your connection with NetworkManager (I recommend this on laptop systems where you want to use NetworkManager for connecting to wifi networks).
</li>
<li>And last but not least: printing works fine. There are no ps2ps crashes. I just had to get hplip from unstable because the hplip package in testing is built with python 2.5 while testing switched to Python 2.6 by default very recently.</li>
</ul>
<h1>Firefox/Iceweasel</h1>
<p>I am using Iceweasel 3.6 from Experimental because Squeeze (and Sid) only have Firefox 3.5. Do not be fooled by the version number 3.6.4: Debian has patched this version with the single bugfix in 3.6.6, so you are actually using the latest secure 3.6.6.</p>
<h1>Compiz</h1>
<p>On my netbook, I am using Compiz. To start it in GNOME, I added this line to ~/.gnomerc:<br />
<code><br />
export WINDOW_MANAGER=/usr/local/bin/compiz-ccp<br />
</code>
</p>
<p>Then create /usr/local/bin/compiz-ccp with these contents:<br />
<code><br />
#!/bin/sh<br />
/usr/bin/compiz ccp<br />
</code><br />
and make the file executable. There might be an easier way to get this working fine, not involving the creation of the custom start-up script, but this is working for me.
</p>
<h1>Adobe Flash</h1>
<p>Even though I still think <a href="/wordpress/uncategorized/open-letter-to-adobe-regarding-flash-on-linux.html">Flash sucks</a> (before Firefox started running plug-in in their own process in version 3.6.4, <a href="http://www.betanews.com/article/Firefox-starts-reining-in-Flash-Silverlight-QuickTime/1271802297">Flash was responsible for 25% of all Firefox crashes</a>!), unfortunately there is no real way around it when installing systems for other users. On 32 bit x86 Debian it is as easy as adding the non-free repository in /etc/apt/sources.list and then installing the flashplugin-nonfree package, which will download the latest Flash and install it for you. If you are using 64 bit however, things get a bit more complicated because Adobe does not publish a 64 bit Flash plug-in. Fortunately, the <a href="http://debian-multimedia.org/">debian-multimedia</a> repositories contain everything we need to get the 32 bit plug-in working with nspluginwrapper: add the repositories, <a href="http://debian-multimedia.org/faq.php#q1">install the repository&#8217;s public key</a> and then install the flashplayer-mozilla package. More details: <a href="http://www.debianadmin.com/how-to-install-adobe-flash-in-debian-etchlennysid.html">http://www.debianadmin.com/how-to-install-adobe-flash-in-debian-etchlennysid.html </a></p>
<h1>Application selection and configuration for a netbook with small display</h1>
<p>My netbook has only 1 GB of RAM and a resolution of 1024&#215;600 pixels so I made some adaptations to make use of these resources in an efficient way.</p>
<h2>Font size</h2>
<p>First I decreased the font size in GNOME. In the menu System &#8211; Preference &#8211; Appearancd &#8211; Fonts I configured it to use 9pt fonts and a 8pt monospace font. </p>
<h2>Avant Window Navigator</h2>
<p>I disabled the standard gnome-panel and use Avant Window Navigator instead. It combines an application launcher and taskbar in one dock and it can be configured to automatically hide, saving space on my netbook screen. When you have started Avant Window Navigator, right-click on the dock and choose Dock Preferences. I set the panel behaviour to IntelliHide and chose the 3D style and I added the Cairo Main Menu, Show Desktop, Launcher/TaskManager, Notification Area and Notification Daemon applets. Now to make awn replace the gnome-panel by default at login, start-up gconf-editor, and go to /desktop/gnome/session/required_components and change the value of the panel key to avant-window-navigator.</p>
<h2>Epiphany</h2>
<p>For maximum performance on my netbook I use Epiphany most of the time instead of Firefox/Iceweasel. Epiphany has some useful extensions available in the <a href="http://packages.debian.org/squeeze/epiphany-extensions">epiphany-extensions</a> package which you might want to install too. For example it contans an AdBlock extension and an extension which lets you view Youtube movies without using Flash.</p>
<p>In Epiphany, you can switch to full screen mode by pressing F11, which is quite handy on a small netbook screen</p>
<h2>Evolution</h2>
<p>For e-mail I use Evolution. It is pretty heavy but there are not that many lightweight alternatives available except maybe for <a href="http://www.claws-mail.org/">Claws Mail</a>. However I do not like its interface too much and it also has less advanced IMAP support (Evolution now supports the IDLE extension in its IMAPx implementation). I switched Evolution to vertical style (View &#8211; Preview &#8211; Vertical Style) and I disabled the status bar ((View &#8211; Layout &#8211; Show Status Bar ) and the Switcher buttons in the bottom part of the sidebar (View &#8211; Switcher Appearance, uncheck Show Buttons).</p>
<h1>Video acceleration</h1>
<p>To squeeze (!) the best performance out of my Intel graphics chip in my netbook, I decided to install the latest versions of the mesa and the Intel driver available in experimental. This has not caused any stability problems for me. I also installed cairo 1.9.10 from experimental but as this is really an upstream development version this is much more risky. I seem to experience some glitches which might be caused by this so you have been warned!</p>
<h1>Software Centre</h1>
<p>If you want a very nice application for finding and installing new software, then you definitely need to install the <a href="http://packages.debian.org/sid/software-center">software-center</a> package.</p>
<p>So, these were some quick notes about using Debian on a desktop and netbook system. I am quite pleased with the result so I will probably be migrating my other Mandriva systems too in the near future.</p>
]]></content:encoded>
			<wfw:commentRss>http://artipc10.vub.ac.be/wordpress/2010/07/08/debian-on-desktop-systems/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Samsung N210 netbook on Debian GNU/Linux</title>
		<link>http://artipc10.vub.ac.be/wordpress/2010/06/30/samsung-n210-netbook-on-debian-gnulinux/</link>
		<comments>http://artipc10.vub.ac.be/wordpress/2010/06/30/samsung-n210-netbook-on-debian-gnulinux/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 21:30:03 +0000</pubDate>
		<dc:creator>Frederik</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[netbook]]></category>
		<category><![CDATA[Samsung N210]]></category>

		<guid isPermaLink="false">http://artipc10.vub.ac.be/wordpress/?p=588</guid>
		<description><![CDATA[With the upcoming holidays in sight, I could not resist buying a netbook system to take along with me on my travel to Italy. So yesterday, I received a brand new Samsung N210. I chose this system because it is not too expensive and it appeared about the best netbook in this price class according [...]]]></description>
			<content:encoded><![CDATA[<p>With the upcoming holidays in sight, I could not resist buying a netbook system to take along with me on my travel to Italy. So yesterday, I received a brand new <a href="http://www.samsung.com/us/consumer/office/mobile-computing/netbooks/NP-N210-JA02US/index.idx?pagetype=prd_detail">Samsung N210</a>.</p>
<p>I chose this system because it is not too expensive and it appeared about the best netbook in this price class according to many reviews. Especially the battery time, keyboard and matte screen are praised a lot. It also seemed to work nice in Linux, which was of course also an important requirement.</p>
<p>I have removed the Windows 7 Starter edition which was installed on this system and installed Debian GNU/Linux Squeeze (currently testing) on it. I decided to go for Debian because it is quickly becoming my favourite distribution, now that Mandriva has all kind of difficulties keeping up with innovation and I fear that its future does not seem too bright.</p>
<p>I booted the Debian installer using PXE. So on my DHCP server, I added this in dhcpd.conf:
</p>
<pre>group {
  allow bootp;
  next-server 192.168.100.1;
    filename "/pxelinux.0";
    host samsung-n210 {
        hardware ethernet xx:xx:xx:xx:xx:xx;
        fixed-address 192.168.100.10;
    }
}
</pre>
<p>With 192.168.100.1 being the address of the TFTP server (the same host as the dhcpd in my case).</p>
<p>I installed tftpd-hpa and xinetd, and created this tftpd file in /etc/xinetd.d:</p>
<pre>service tftp
{
   socket_type   = dgram
   protocol   = udp
   wait      = yes
   user      = root
   server      = /usr/sbin/in.tftpd
   server_args   = -p -v -v -v -s /var/lib/tftpboot
   disable      = no
   flags        = IPv4
}
</pre>
</p>
<p>Then I dumped the contents of netboot.tar.gz of the <a href="http://d-i.debian.org/daily-images/amd64/daily/netboot/">Debian installer daily builds for AMD64</a> in /var/lib/tftpboot. Then set up the N210&#8242;s BIOS to enable PXE booting and set the network card as first boot device and you should get into the Debian installer.</p>
<p>I had some trouble with the network connection bailing out after some time, but after a few attempts at least I succeeded in installing the Debian base system without X and the system booted correctly. Maybe I was just using a bad network cable.</p>
<p>I installed the gnome-desktop-environment package with apt, which also pulled in X.  The graphical environment was working perfectly fine out of the box without any manual configuration needed. Also the webcam was working fine out of the box with Cheese.</p>
<p>The wireless network card works fine once you install the firmware-linux-nonfree package from the non-free repository and to get a nice GUI to connect to wireless networks, I installed network-manager-gnome. Then connecting to my wifi AP protected by WPA2 was a piece of cake and the wireless connection works perfectly stable too.</p>
<p>Actually the only minor problem I met is that the brightness keys are not working. There is a <a href="http://newyork.ubuntuforums.org/showthread.php?t=1397371">documented solution</a> available to change the brightness (execute # setpci -s 00:02.0 f4.b=ff for maximum brightness).</p>
<p>All in all, I am very happy with this system. Even though it has a 5400 RPM hard drive, which feels a bit slowish during the installation, and has only 1 GB RAM, the system is very fast during normal use in GNOME, especially if you use some more lightweight applications (for example Epiphany or Chromium as web browser). Also with a few adaptations to the desktop and application settings, the small resolution is not really a problem. But maybe I will write some more details about this in a later post.</p>
]]></content:encoded>
			<wfw:commentRss>http://artipc10.vub.ac.be/wordpress/2010/06/30/samsung-n210-netbook-on-debian-gnulinux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Making your mixed KDE and GNOME desktop look cool</title>
		<link>http://artipc10.vub.ac.be/wordpress/2009/11/18/making-your-mixed-kde-and-gnome-desktop-look-cool/</link>
		<comments>http://artipc10.vub.ac.be/wordpress/2009/11/18/making-your-mixed-kde-and-gnome-desktop-look-cool/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 22:20:57 +0000</pubDate>
		<dc:creator>Frederik</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[eye candy]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[Mandriva]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://artipc10.vub.ac.be/wordpress/?p=299</guid>
		<description><![CDATA[Most people use a mix of QT/KDE and GTK+/GNOME applications on their Linux system. Because both QT and GTK+ use their own widgets (which are all GUI elements, like buttons, toolbars, menus, checkboxes, etc&#8230;) and theme engine, QT and GTK+ applications look different from each other. This is especially bad if you use KDE in [...]]]></description>
			<content:encoded><![CDATA[<p>Most people use a mix of QT/KDE and GTK+/GNOME applications on their Linux system. Because both QT and GTK+ use their own widgets (which are all GUI elements, like buttons, toolbars, menus, checkboxes, etc&#8230;) and theme engine, QT and GTK+ applications look different from each other. This is especially bad if you use KDE in Debian: in that case by default no GTK+ theme is configured, making GTK+ applications, like Firefox, look like ugly Windows 95 applications. Mandriva on the contrary does use a common graphical theme for both GTK+ and KDE applications (called Ia Ora), but it&#8217;s not easy to change the GTK+ theme if you use KDE or the QT/KDE theme if you use GNOME.</p>
<p>Here&#8217;s a howto for Debian and Mandriva which explains how to make your desktop look nice if you&#8217;re using a mix of KDE and GTK+. Because Ubuntu is based on Debian, this howto might also apply to Ubuntu, but I have not verified this.</p>
<h1>Pre-requisites</h1>
<p>I assume that you are running either Debian Squeeze (testing) or Mandriva 2010.0 or a more recent version of these distributions. For Mandriva 2010.0, you also need to have activated the Backports repositories. You can activate them in the Mandriva Control Centre &#8211; Software Management &#8211; Configure media sources.</p>
<h1>Using GTK+ applications in KDE</h1>
<p>If you want to use a unified look for KDE and GTK+ applications, then I recommend using the <a href="http://www.kde-look.org/content/show.php?content=40492">QtCurve theme</a>. Just like Mandriva&#8217;s Ia Ora, it consists of a theme engine for KDE and another one for GTK+ which looks exactly the same.</p>
<p>In Mandriva you install the kde4-style-qtcurve package. If you have urpmi&#8217;s &#8220;suggests&#8221; support enabled (it is by default), then this will automatically pull in both the KDE 4 and the GTK+ theme, and also systemsettings-qt-gtk, a tool which lets you choose the GTK+ theme to use in KDE.</p>
<p>In Debian you need the packages qtcurve and also system-config-gtk-kde to set up the GTK+ theme.</p>
<p>Once you have installed all packages, you can start KDE&#8217;s System Settings and go to Appearance. In the Style page, you can choose the theme to use in KDE applications, while in GTK+ Styles and Fonts, you select the theme used by GTK+ applications. If you choose QtCurve in both, KDE and GTK+ applications will look very similar and even use the same KDE icon set.</p>
<p>The QtCurve theme comes with different pre-defined styles. If you don&#8217;t like the default look of QtCurve, go to System Settings &#8211; Appearance &#8211; Style, and click on the Configure&#8230; button next to the QtCurve widget style box. Under the button Options there, you find the list of predefined styles.</p>
<p>Of course you can also further fine-tune the theme by going to the Colors and Windows pages in System Settings &#8211; Apperance, where you can choose a colour set and window manager theme to your liking (QtCurve has a matching colour set and window manager theme, but of course you can choose something else if you want).</p>
<h1>Using QT/KDE applications in GNOME</h1>
<p>If you are using GNOME and want to make QT and KDE applications look like all GNOME applications without using Ia Ora, you have to run the qtconfig application. In both Mandriva and Debian, you need to have the qt4-qtconfig package installed. Then in qtconfig you select GTK+ as the GUI style to use. If you run KDE applications, you will also need to set the KDE theme to GTK+. This can be done by running<br />
<code>$ kwriteconfig --file kdeglobals --group General --key widgetStyle gtk</code><br />
in a terminal window. Before executing this command, you will need to have the kdebase4-runtime package installed in Mandriva or kdebase-runtime in Debian.</p>
<div id="attachment_343" class="wp-caption aligncenter" style="width: 710px"><a href="http://artipc10.vub.ac.be/wordpress/wp-content/uploads/2009/11/squeeze-kde.jpg"><img src="http://artipc10.vub.ac.be/wordpress/wp-content/uploads/2009/11/squeeze-kde-700x525.jpg" alt="Debian Squeeze running KDE with the QtCurve theme." title="squeeze-kde" width="700" height="525" class="size-large wp-image-343" /></a><p class="wp-caption-text">Debian Squeeze KDE 4.3 running Dolphin and Iceweasel (Firefox) 3.5 with the QtCurve theme (Shiny Glass style), Slim Glow Plasma theme and desktop effects enabled.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://artipc10.vub.ac.be/wordpress/2009/11/18/making-your-mixed-kde-and-gnome-desktop-look-cool/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>

