<?xml version="1.0"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Blog&amp;#x27;n&amp;#x27;Roll</title>
<link>http://mixinet.net/~sto/blog/</link>
<description>StoWiki</description>
<item>
	
	<title>Debian Signs @ DebConf 9</title>
	
	<guid>http://mixinet.net/~sto/blog/debian/20090728_debian_signs/</guid>
	<link>http://mixinet.net/~sto/blog/debian/20090728_debian_signs/</link>
	
	<pubDate></pubDate>
	<description><![CDATA[<p>I have not blogged about until now, but I'm in Cáceres since last Thursday,
where <a href="http://oskuro.net/blog">jordi</a> and I came by car from Valencia to
attend the <a href="http://debconf9.debconf.org/">DebConf 9</a>.</p>

<p>I'm not doing any Debian work here, but I'm having a good time socializing
meeting and talking with a lot of people and attending some of the talks and
BOFs.</p>

<p>Yesterday we went to the <em>Valle del Jerte</em> for the Day Trip, where we did a
short walk and got to <em>Los Pilones</em>, where we saw a lot of natural pools
between the mountains where we swimmed (I loved a small cascade that was like
a natural <em>hydro massage</em> system) and stayed there for a couple of hours until
we had to go back to the bus to visit another natural pool on the village of
Jerte, that time a big one built inside the river that was also very nice.</p>

<p>Anyway, what I wanted to say is that yesterday's Day Trip was another good
example of how the Debian Project helps its users and developers; when we were
walking back from the mountains to pick the bus we found Debian people on a
cross road telling us what was the right way and after a little while we found
a Debian Sign on the floor:</p>

<p><img class="centered" src="http://mixinet.net/~sto/images/DebConf9_DayTrip_Go.jpg" alt="Day Trip Go" /></p>

<p>We followed the advice and we confirmed that it was a shortcut in our way down,
obviously installed there by someone from the Debian Project.</p>
]]></description>
</item>
<item>
	
	<title>Free Software Summer</title>
	
	<guid>http://mixinet.net/~sto/blog/free-sw/20090617_free_software_summer/</guid>
	<link>http://mixinet.net/~sto/blog/free-sw/20090617_free_software_summer/</link>
	
	<pubDate></pubDate>
	<description><![CDATA[<p>On recent years I've only been in one or two free software related conferences
per year, usually because I've been invited to go for a day or two and give a
talk.</p>

<p>The truth is that my day to day activities don't leave me enough time to
contribute or participate a little bit more in free software projects, but
this year I decided (and negotiated) that I had to go to <a href="http://debconf9.debconf.org/">Debconf</a>,
as it is the best opportunity to go to a Debian conference that I'm going to
have in the near future.</p>

<p>So this summer it is going to be a <em>free software summer</em>, the 3rd of July
I'll be giving a talk at the <a href="http://www.jornadespl.org/">Jornades de Programari Lliure</a> in Barcelona
and from the 23th to the 30th or 31th I'll be at <a href="http://debconf9.debconf.org/">Debconf 9</a> in
Cáceres.</p>

<p>In Barcelona I will talk about building IT infrastructures using free
software, explaining which programs I use, why I've choosen them and how I
configure things depending on my needs and in Cáceres I will be just listening
and exchanging gpg keys.</p>
]]></description>
</item>
<item>
	
	<title>Encrypting a Debian GNU/Linux installation (take 3)</title>
	
	<guid>http://mixinet.net/~sto/blog/sysadmin/20090226_macbook_cryptsetup_take_3/</guid>
	<link>http://mixinet.net/~sto/blog/sysadmin/20090226_macbook_cryptsetup_take_3/</link>
	
	<pubDate></pubDate>
	<description><![CDATA[<p>After my <a href="http://mixinet.net/~sto/blog/sysadmin/20090225_macbook_cryptsetup_followup/">followup</a> to the Tuesday 
<a href="http://mixinet.net/~sto/blog/sysadmin/20090222_macbook_cryptsetup/">post</a> I've received some additional comments
and I'm writing this entry to close the subject... ;)</p>

<p>One of the comments was from <a href="http://gwolf.org/">Gunnar</a> to tell me that the
<em>followup</em> setup was the same provided by the automatic partitioner of the
<a href="http://www.debian.org/devel/debian-installer/">Debian Installer</a> since 2007.</p>

<p>I was unaware of that because until some weeks ago I never tried to install a
system with encryption support and when I did it on my laptop I used the
manual setup because I wanted to keep the <strong>MacOS X</strong> partitions.</p>

<p>Anyway my <a href="http://mixinet.net/~sto/blog/sysadmin/20090225_macbook_cryptsetup_followup/">followup</a> blog entry made
sense anyway, as I just wanted to comment my thoughts about the advantages and
disadvantages of each partitioning schema.</p>

<p>I also received a couple of messages proposing the use of three layers to
keep the flexibility of the original setup and the simplicity of the second;
the setup is as follows:</p>

<ul>
<li><em>Layer 1</em>: use LVM on a physical volume,</li>
<li><em>Layer 2</em>: create a logical volume and format it as an encrypted volume,</li>
<li><em>Layer 3</em>: use LVM on top of the encrypted logical volume and put there the
file systems that you want encrypted.</li>
</ul>

<p>With the LVM at the lower level you get the advantages of my setup (mix
encrypted and unencrypted partitions, the crypted volume can use multiple
physical volumes, etc.) and the advantages of the second setup (only one key
for all the encrypted file systems).</p>

<p>I believe that this setup is a little too much for a laptop, but can be a good
option if you need encrypted file systems on a server.</p>
]]></description>
</item>
<item>
	
	<title>Encrypting a Debian GNU/Linux installation (followup)</title>
	
	<guid>http://mixinet.net/~sto/blog/sysadmin/20090225_macbook_cryptsetup_followup/</guid>
	<link>http://mixinet.net/~sto/blog/sysadmin/20090225_macbook_cryptsetup_followup/</link>
	
	<pubDate></pubDate>
	<description><![CDATA[<p>Yesterday I received a mail message from a Debian user called Ekrem Erdem
about my previous <a href="http://mixinet.net/~sto/blog/sysadmin/20090222_macbook_cryptsetup/">post</a>, proposing a different
partitioning schema that I found interesting.</p>

<p>The basic idea is to swap the order of the technologies, that is, use LVM on
top of an encrypted partition instead of encrypting logical volumes.</p>

<p>I never thought about this schema because I always use LVM on servers and that
is one of the fist things I setup (just after software RAID-1, if the machine
has two hard drives); when I was evaluating how to setup my system for
encryption I started with the LVM setup and never looked back.</p>

<p>The advantage of this setup is that there is only one pass phrase (the one used
to unlock the encrypted partition, <code>sda4</code> in my case), eliminating the need of
derived keys (i. e. my swap setup) or key files (I use them to mount snapshots
of the encrypted partition non interactively).</p>

<p>On the negative side I believe that this setup looses some flexibility:</p>

<ul>
<li><p>On my original model crypted and unencrypted partitions can coexist on the
same volume group, while the new setup requires a different volume group
for unencrypted volumes.</p></li>
<li><p>If the user wants to have multiple partitions each one can use a different
pass phrase or key file.</p></li>
<li><p>If a logical volume is expanded through multiple physical volumes the new
setup requires a key for each physical volume, while the original setup only
needs one key.</p></li>
</ul>

<p>Anyway if the plan is to encrypt all the file systems on a laptop the proposed
setup is simpler and, IMHO, as safe as my configuration (remember that my keys
are related).</p>

<p>I'm not going to change my setup now (it works great), but I'll probably try
this one in the future if I need an encrypted setup on a different machine.</p>
]]></description>
</item>
<item>
	
	<title>Encrypting a Debian GNU/Linux installation on a MacBook</title>
	
	<guid>http://mixinet.net/~sto/blog/sysadmin/20090222_macbook_cryptsetup/</guid>
	<link>http://mixinet.net/~sto/blog/sysadmin/20090222_macbook_cryptsetup/</link>
	
	<pubDate></pubDate>
	<description><![CDATA[<p>A couple of weeks ago I updated my <strong>Debian Sid</strong> setup on the <strong>MacBook</strong> to
use disk encryption; this post is to document what I did for later reference.</p>

<p>The system was configured for dual booting <strong>Debian</strong> or <strong>Mac OS X</strong> using
<code>refit</code> and <code>grub2</code> as documented on the <a href="http://wiki.debian.org/MacBook/">Debian
Wiki</a>; I don't use the <strong>Mac OS X</strong> system
much, but I left it there to be able to test things and be able to answer
questions of <strong>Mac OS X</strong> users when I have to.</p>

<p>The Debian installation was done using two primary partitions, one for <em>swap</em>
(I used a partition to be able to suspend to disk without troubles) and an
<code>ext3</code> file system used as the <em>root</em> file system.</p>

<p>The plan was to use the <strong>Debian Installer</strong> to do the disk setup and recover
the Sid installation from a backup once the encrypted setup was working OK.</p>

<h2>Backup for later recovery</h2>

<p>My first step was to install all the needed packages on the original system;
basically I verified that I had the <code>lvm2</code> and <code>cryptsetup</code> packages
installed.</p>

<p>The second step was to backup the root file system; to do it I changed to
run level 1 and copied the files to an external USB disk using <code>rsync</code>.</p>

<p>My third step was to boot into <strong>Mac OS X</strong> to reduce the space assigned to
it; I had a lot of free space that I didn't plan to use with <strong>Mac OS X</strong> and
I thought that this was the best occasion to reassign it to the Debian
file system.</p>

<h2>Encrypted Lenny installation</h2>

<p>Now the machine was ready for the installer. As I formatted the system a couple
of weeks ago I used a daily build of the <em>Lenny Debian Installer</em>, now that
<strong>Lenny</strong> is out I would have used the official version.</p>

<p>I booted the installer and on the partition disk step I selected the manual
method; I left <code>sda1</code> and <code>sda2</code> as they were (the <strong>Mac OS X</strong> installation
uses them) and set up <code>sda3</code> and <code>sda4</code> as follows:</p>

<ul>
<li><code>sda3</code>: 256 MB, use as <code>ext3</code>, mount point: <code>/boot</code></li>
<li><code>sda4</code>: 86 GB, use as physical volume for LVM</li>
</ul>

<p>Note that I decided to put <code>/boot</code> on a plain <code>ext3</code> partition to be able to
use <strong>grub2</strong> as the boot loader (if we put the kernel on an LVM logical volume
we need to use <code>lilo</code> as the boot loader).</p>

<p>Once <code>sda4</code> was adjusted as LVM I entered on the <code>LVM setup</code> and created a LVM
Volume Group (VG) with the name <code>debian</code>, using <code>sda4</code> as the physical volume.</p>

<p>Once the VG was defined I created a couple of Logical Volumes (LV):</p>

<ul>
<li><code>root</code>: 82 GB</li>
<li><code>swap</code>: 2  GB</li>
</ul>

<p>I left some space unallocated to be able to create LVM snapshots (I use them
to do backups, I'll post about it on the next days).</p>

<p>Once the LV were ready I finished with the LVM setup and went back to the
partitioner to configure the <em>Logical Volumes</em>:</p>

<ul>
<li>debian-root: use as physicals volume for encryption</li>
<li>debian-swap: use as pascal volume for encryption, encryption key: random</li>
</ul>

<p>Once both encrypted volumes were ready I entered on the <em>Configure the
encrypted volumes menu</em> and the installer formatted the volumes for encryption
and asked for the  <code>debian-root</code> pass phrase.</p>

<p>Back on the main partitioning menu I set up the <code>debian-root_crypt</code> encrypted
volume:</p>

<ul>
<li>debian-root_crypt: use as <code>ext3</code>, mount point: <code>/</code>.</li>
</ul>

<p>I didn't need to touch the <code>debian-swap_crypt</code>, it was configured
automatically as <em>swap</em> because I choose a random encryption key.</p>

<p>At this point I was finished with the partitioning; to finish I installed a
minimal system and rebooted to try the system.</p>

<p>As I had changed the disk layout I had to <em>re-sync</em> the partition tables from
<code>refit</code>; once that was done I was able to boot from the newly installed
system.</p>

<h2>Setting up suspend to disk</h2>

<p>I was using <code>s2disk</code> to suspend the system; to test if it still worked with
the new setup I installed the <code>uswsusp</code> package and adjusted the <code>resume
device</code> on the <code>/etc/uswsusp.conf</code> to <code>/dev/mapper/debian-swap_crypt</code>.</p>

<p>After my first try I noticed that the <em>resume</em> step failed with the encrypted
swap partition because it was using a random key, which means that the swap
contents are unrecoverable after a reboot.</p>

<p>Looking at the <code>cryptsetup</code> documentation I found that the solution was to use
a <em>derived key</em> for the swap partition instead of a <em>random</em> one.</p>

<p>The command sequence was as follows:</p>

<pre><code># disable swap
swapoff -a
# close encrypted volume
cryptsetup luksClose debian-swap_crypt
# change the swap partition setup on the /etc/crypttab file
sed -e -i 's%^debian-swap.*%debian-swap_crypt /dev/mapper/debian-swap debian-root_crypt cipher=aes-cbc-essiv:sha256,size=256,swap,hash=sha256,keyscript=/lib/cryptsetup/scripts/decrypt_derived,swap%' /etc/crypttab
# open the encrypted volumes with the new setup
/etc/init.d/cryptdisks start
# enable swap
swapon -a
# update the initrd image
update-initramfs -u
</code></pre>

<p>After executing all those commands the suspend to disk system worked as
expected.</p>

<h2>Recovering the original system</h2>

<p>If I were going to reinstall the system completely I would have finished here,
but in my case I wanted to recover my original system setup (except the
minimal changes required to use the encrypted passions, of course).</p>

<p>To recover my old installation I backed up some files (<code>/etc/fstab</code>,
<code>/etc/crypttab</code>, <code>/etc/uswsusp.conf</code> and the current <code>/boot</code> contents to be
able to boot in case of failure with my old kernel) from the current
installation, after that I recovered all the files from the initial backup
(except the ones just saved) using <code>rsync</code> again and regenerated the initrd
images of my old kernels:</p>

<pre><code>update-initramfs -u -k all
</code></pre>

<p>After that I rebooted and everything worked as on my original installation
(except for the disk encryption, of course).</p>
]]></description>
</item>
<item>
	
	<title>My first nginx module</title>
	
	<guid>http://mixinet.net/~sto/blog/free-sw/20080918_my_first_nginx_module/</guid>
	<link>http://mixinet.net/~sto/blog/free-sw/20080918_my_first_nginx_module/</link>
	
	<pubDate></pubDate>
	<description><![CDATA[<p>Yesterday I sent a message to the <a href="http://wiki.codemongers.com/">Nginx</a> list to announce the
availability of my first module for that web server.</p>

<p>The module is used to do HTTP Basic Authentication agains PAM instead of using
an htpasswd file; I wrote it because I wanted to authenticate against OpenLDAP
and PostgreSQL and PAM already has support for that ;)</p>

<p>The code is available <a href="http://web.iti.upv.es/~sto/nginx/">here</a> and on the readme there are
instructions on how to build a patched debian package with the module
included.</p>
]]></description>
</item>
<item>
	
	<title>Hugo meets Marc</title>
	
	<guid>http://mixinet.net/~sto/blog/general/20080823_hugo_meets_marc/</guid>
	<link>http://mixinet.net/~sto/blog/general/20080823_hugo_meets_marc/</link>
	
	<pubDate></pubDate>
	<description><![CDATA[<p>As promised a photo of the first meeting between Hugo and Marc.</p>

<p><img class="centered" src="http://mixinet.net/~sto/images/hmm.jpg" alt="Hugo meets Marc" /></p>

<p>With luck this afternoon the whole family will be at home.</p>
]]></description>
</item>
<item>
	
	<title>Marc</title>
	
	<guid>http://mixinet.net/~sto/blog/general/20080822_marc/</guid>
	<link>http://mixinet.net/~sto/blog/general/20080822_marc/</link>
	
	<pubDate></pubDate>
	<description><![CDATA[<p>At 17:55 of the 21th of August of 2008 (four days late from the expected
schedule) passenger Marc Talens i Blasco landed at La Fé Hospital in
Valencia.</p>

<p><img class="centered" src="http://mixinet.net/~sto/images/marc.jpg" alt="Marc" /></p>

<p>On my next post... Hugo meets Marc!</p>
]]></description>
</item>
<item>
	
	<title>Summertime, change times</title>
	
	<guid>http://mixinet.net/~sto/blog/general/20080814_summer_time__change_time/</guid>
	<link>http://mixinet.net/~sto/blog/general/20080814_summer_time__change_time/</link>
	
	<pubDate></pubDate>
	<description><![CDATA[<p>After less than a week of vacation I've decided it was time to write a short
blog entry, as I plan to write at least another one in some days, as we are
waiting the arrival of Marc, our second son, for this week or the next one.</p>

<p>In the last months I haven't done what I said in my last posts, I'm quite busy
with the rest of my life and blogging or keeping my home computing
infrastructure is not on the top list.</p>

<p>Anyway I still have managed to do some things like giving a talk about
virtualization on the <a href="http://jornadespl.org/">VII Jornades de Programari
Lliure</a>, not going to
<a href="http://debconf8.debconf.org/">Debconf8</a> (next year should be the one, the
conference is in Spain and I have enough time to prepare it, including a
possible trip with all the family) or do a partial server migration at home,
leaving two machines to do the work of one.</p>

<p>My plan for the migration has changed and if time permits I'll try to do it in
the next couple of weeks; now I plan to move my current servers to an ASUS
EeePC with 2GB of RAM and an external USB disk (it is a lot smaller and the
hardware is still faster than my old server) and I'll use OpenVZ instead of
Linux-Vserver for virtualization (OpenVZ enabled kernels are available for
Lenny).</p>
]]></description>
</item>
<item>
	
	<title>Redmine</title>
	
	<guid>http://mixinet.net/~sto/blog/sysadmin/20080301_redmine/</guid>
	<link>http://mixinet.net/~sto/blog/sysadmin/20080301_redmine/</link>
	
	<pubDate></pubDate>
	<description><![CDATA[<p>I've been using <a href="http://subversion.tigris.org/">Subversion</a> and
<a href="http://trac.edgewall.org/">Trac</a> for some years now, and I have encouraged
its use at work since the last couple of years, with the undesired effect of
having to maintain four different <code>Trac</code> installations with different database
systems (<code>SQLite3</code> and <code>PostgreSQL</code>), plugins (more than 15 on the big
servers), authentication systems (<code>htpass</code> files, <code>LDAP</code> and a database based
system) and tons of projects published (two internal servers have 64 and 16
projects, one of the client system has 33 projects and there is only one
single project installation, but it is living at a client's system).</p>

<p>Yesterday night, while reading <a href="http://planet.debian.org/">Planet Debian</a> I
found a <a href="http://changelog.complete.org/posts/694-Trac-Git.html">post</a> from
John Goerzen about tools to replace <a href="http://trac.edgewall.org/">Trac</a>,
including the option to use <a href="http://git.or.cz/">Git</a> as the project
<a href="http://en.wikipedia.org/wiki/Version_control_system">VCS</a>.</p>

<p>In the post he talks about different options, mainly projects that I would
categorize as <em>issue tracking systems</em> (<em>mantis</em>, <em>roundup</em>, etc.), but it
also talks about <a href="http://www.redmine.org/">Redmine</a>, a project management
system implemented using the <a href="http://www.rubyonrails.org/">Ruby on Rails</a>
framework that is similar to <code>Trac</code>.</p>

<p>As it looked interesting I downloaded, installed and executed an instance in
about 15 minutes (I love the systems that support
<a href="http://www.sqlite.org/">sqlite3</a> for this quick tests, not having to touch
real database servers speeds up simple tests a lot).</p>

<p>I played a little bit with the system and I believe that I will spend some
more time testing it at work next week, as it looks quite promising; the
standard version has almost all the features I'm interested in without the
need to install additional plugins and it can do most of the things I was
missing from <code>Trac</code> to do lightweight <em>project management</em>.</p>

<p>I evaluated <a href="http://project-open.org">]project-open[</a> to use it together with
<code>Trac</code> for our internal <em>project management</em> tasks, mainly because we miss
important features from <code>Trac</code>, like having clean systems to view the tasks of
a user in all projects or a clean way to do the project planning using
<em>tickets</em> and <em>gantt charts</em>. Of course there are ways to do it, but the
plugins I've tried are not as good and simple as I would like.</p>

<p>The problem with the use of <code>]project-open[</code> is that I don't really like it
for us, as it has tons of features that I feel we don't need nor will use and,
on a first try, the system seemed difficult to deploy and maintain, probably
because my lack of knowledge about <a href="http://openacs.org/">OpenACS</a> and
<a href="http://www.tcl.tk/">TCL</a>.</p>

<p>In fact we still don't have <code>]po[</code> running at work because I was unable to to
integrate the authentication system with our LDAP server on my first tries
and have had no time to investigate further since then.</p>

<p>The good thing about trying <code>Redmine</code> is that if we don't end up using it at
least I can take the most of this opportunity by looking at <code>Ruby on Rails</code>
and the <a href="http://www.ruby-lang.org/en/">Ruby Programming Language</a>, at least
from the administration side, as I have never looked at it seriously.</p>
]]></description>
</item>

</channel>
</rss>
