<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Systems on mariospr.org</title><link>https://mariospr.org/category/systems/</link><description>Recent content in Systems on mariospr.org</description><generator>Hugo</generator><language>en</language><lastBuildDate>Fri, 03 Jul 2015 15:31:31 +0000</lastBuildDate><atom:link href="https://mariospr.org/category/systems/index.xml" rel="self" type="application/rss+xml"/><item><title>On Linux32 chrooted environments</title><link>https://mariospr.org/2015/07/03/on-linux32-chrooted-environments/</link><pubDate>Fri, 03 Jul 2015 15:31:31 +0000</pubDate><guid isPermaLink="false">https://mariospr.org/?p=2030</guid><description>&lt;p&gt;I have a chrooted environment in my 64bit Fedora 22 machine that I use every now and then to work on a debian-like 32bit system where I might want to do all sorts of things, such as building software for the target system or creating debian packages. More specifically, today I was trying to build WebKitGTK+ 2.8.3 in there and something weird was happening:&lt;/p&gt;
&lt;p&gt;The following CMake snippet was &lt;strong&gt;not&lt;/strong&gt; properly recognizing my 32bit chroot:&lt;/p&gt;</description><content:encoded><![CDATA[<p>I have a chrooted environment in my 64bit Fedora 22 machine that I use every now and then to work on a debian-like 32bit system where I might want to do all sorts of things, such as building software for the target system or creating debian packages. More specifically, today I was trying to build WebKitGTK+ 2.8.3 in there and something weird was happening:</p>
<p>The following CMake snippet was <strong>not</strong> properly recognizing my 32bit chroot:</p>
<pre>
string(TOLOWER ${CMAKE_HOST_SYSTEM_PROCESSOR} LOWERCASE_CMAKE_HOST_SYSTEM_PROCESSOR)
if (CMAKE_COMPILER_IS_GNUCXX AND "${LOWERCASE_CMAKE_HOST_SYSTEM_PROCESSOR}" MATCHES "(i[3-6]86|x86)$")
    ADD_TARGET_PROPERTIES(WebCore COMPILE_FLAGS "-fno-tree-sra")
endif ()
</pre>
<p>After some investigation, I found out that <code>CMAKE_HOST_SYSTEM_PROCESSOR</code> relies on the output of <code>uname</code> to determine the type of the CPU, and this what I was getting if I ran it myself:</p>
<pre>
(debian32-chroot)mario:~ $ uname -a
Linux moucho 4.0.6-300.fc22.x86_64 #1 SMP Tue Jun 23 13:58:53 UTC 2015
x86_64 x86_64 x86_64 GNU/Linux
</pre>
<p>Let&rsquo;s avoid nasty comments about the stupid name of my machine (I&rsquo;m sure everyone else uses clever names instead), and see what was there: <strong>x86_64</strong>.</p>
<p>That looked <strong>wrong</strong> to me, so I googled a bit to see what others did about this and, besides finding all sorts of crazy hacks around, I found that in my case the solution was pretty simple just because I am using <a href="https://wiki.debian.org/Schroot">schroot</a>, a great tool that makes life easier when working with chrooted environments.</p>
<p>Because of that, all I would have to do would be to specify <code>personality=linux32</code> in the configuration file for my chrooted environment and that&rsquo;s it. Just by doing that and re-entering in the &ldquo;jail&rdquo;, the output would be much saner now:</p>
<pre>
(debian32-chroot)mario:~ $ uname -a
Linux moucho 4.0.6-300.fc22.x86_64 #1 SMP Tue Jun 23 13:58:53 UTC 2015
i686 i686 i686 GNU/Linux
</pre>
<p>And of course, WebKitGTK+ would now recognize and use the right CPU type in the snippet above and I could &ldquo;relax&rdquo; again while seeing WebKit building again.</p>
<p>Now, for extra reference, this is the content of my schroot configuration file:</p>
<pre>
$ cat /etc/schroot/chroot.d/00debian32-chroot
[debian32-chroot]
description=Debian-like chroot (32 bit) 
type=directory
directory=/schroot/debian32/
users=mario
groups=mario
root-users=mario
personality=linux32
</pre>
<p>That is all, hope somebody else will find this useful. It certainly saved my day!</p>
]]></content:encoded></item><item><title>Screen redrawing problems with the "nvidia" driver and Compiz</title><link>https://mariospr.org/2009/02/18/screen-redrawing-problems-with-the-nvidia-driver-and-compiz/</link><pubDate>Wed, 18 Feb 2009 23:45:27 +0000</pubDate><guid isPermaLink="false">https://mariospr.org/?p=39</guid><description>&lt;p&gt;Just in case you were experiencing, like me, some very annoying problems with your NVIDIA graphic card while using Compiz, here you have a very useful option to put inside the &amp;ldquo;Device&amp;rdquo; section in your /etc/X11/xorg.org file:&lt;/p&gt;
&lt;pre&gt;Option         "UseCompositeWrapper" "true"&lt;/pre&gt;
&lt;p&gt;After activating this option (available for nvidia drivers &amp;gt;= 169.xx) I found that the problems redrawing windows I was suffering, specially when scrolling (very annoying, for instance, when chatting through pidging), just dissapeared. And it was indeed a very annoying problem, since it used to happen very often and in almost any window (although not in Emacs ;-)) in my system, in a way so any information on it just got screwed up so it was completely unreadable&amp;hellip; and the only &amp;ldquo;manual&amp;rdquo; workaround I had found so far was just to re-scroll the window or select the text I was trying to read, which seemed not to be a very good idea.&lt;/p&gt;</description><content:encoded><![CDATA[<p>Just in case you were experiencing, like me, some very annoying problems with your NVIDIA graphic card while using Compiz, here you have a very useful option to put inside the &ldquo;Device&rdquo; section in your /etc/X11/xorg.org file:</p>
<pre>Option         "UseCompositeWrapper" "true"</pre>
<p>After activating this option (available for nvidia drivers &gt;= 169.xx) I found that the problems redrawing windows I was suffering, specially when scrolling (very annoying, for instance, when chatting through pidging), just dissapeared. And it was indeed a very annoying problem, since it used to happen very often and in almost any window (although not in Emacs ;-)) in my system, in a way so any information on it just got screwed up so it was completely unreadable&hellip; and the only &ldquo;manual&rdquo; workaround I had found so far was just to re-scroll the window or select the text I was trying to read, which seemed not to be a very good idea.</p>
<p>Needed to say that I started to see this odd behavior since I &ldquo;downgraded&rdquo; my Ubuntu 8.10 down to 8.04 last week (because of some very specific needs), and this strange problem never happened when using Intrepid, so if you&rsquo;re now using that version perhaps you can just throw this post away to the trash, because then it would not useful at all for you.</p>
<p>But just in case, here you are my two cents, and to make them even more useful, here you are the full configuration of my &ldquo;Device&rdquo; section in /etc/X11/xorg.conf, which allows me to use a fully accelerated desktop with no problems at all:</p>
<pre>Section "Device"
&nbsp;&nbsp;&nbsp;&nbsp;Identifier     "Videocard0"
&nbsp;&nbsp;&nbsp;&nbsp;Driver         "nvidia"
&nbsp;&nbsp;&nbsp;&nbsp;VendorName     "NVIDIA Corporation"
&nbsp;&nbsp;&nbsp;&nbsp;BoardName      "Quadro NVS 140M"
&nbsp;&nbsp;&nbsp;&nbsp;Option         "AllowGLXWithComposite" "true"
&nbsp;&nbsp;&nbsp;&nbsp;Option         "UseCompositeWrapper" "true"
&nbsp;&nbsp;&nbsp;&nbsp;Option         "XAANoOffscreenPixmaps"
&nbsp;&nbsp;&nbsp;&nbsp;Option         "NoLogo" "true"
&nbsp;&nbsp;&nbsp;&nbsp;Option         "backingstore" "true"
&nbsp;&nbsp;&nbsp;&nbsp;Option         "TripleBuffer" "true"
&nbsp;&nbsp;&nbsp;&nbsp;Option         "AddARGBGLXVisuals"  "true"
EndSection</pre>
<p>Hope this will be useful for you as well :-).</p>
<p><strong>Update:</strong> If you&rsquo;re still suffering these problems even after adding these lines to xorg.conf, you could try to install the nvidia driver through <a title="Envy" target="_blank" href="http://albertomilone.com/nvidia_scripts1.html">Envy</a>. These steps worked for me (at the end, the annoying problem appeared again, although not so often than before):</p>
<ol>
	<li>Uninstall any other driver you had installed before (through the ubuntu "restricted drivers" manager, or the .run script downloaded from nvidia.com).</li>
	<li>Install <a title="Envy" target="_blank" href="http://albertomilone.com/nvidia_scripts1.html">Envy</a>: <em>apt-get install envyng-core
</em></li>
	<li>Shutdown X and install the nvidia driver <strong>from a tty terminal</strong>: <em>envyng -t</em></li>
</ol>
After following these steps, and the simple instructions on screen, by ubuntu hardy perfectly booted up with the nvidia driver v173.14, which seems not to present the same problem.
<p>Let&rsquo;s see if these new advice helps you too :-)</p>
]]></content:encoded></item><item><title>My Slug, my PS3 and me</title><link>https://mariospr.org/2009/01/27/my-slug-my-ps3-and-me/</link><pubDate>Tue, 27 Jan 2009 00:04:32 +0000</pubDate><guid isPermaLink="false">https://mariospr.org/?p=33</guid><description>&lt;p&gt;&lt;a title="Juan's NSLU2 page" target="_blank" href="https://blogs.igalia.com/jasuarez/nslu2"&gt;As Juan&lt;/a&gt;, I&amp;rsquo;m one of the proud owners of a &lt;a target="_blank" title="Linksys NSLU2" href="http://en.wikipedia.org/wiki/NSLU2"&gt;Linksys NSLU2&lt;/a&gt; (aka &lt;em&gt;Slug&lt;/em&gt;) perfectly (and continuously) running the &lt;a target="_blank" title="Debian/NSLU2" href="http://www.nslu2-linux.org/wiki/Debian/HomePage"&gt;Debian/NSLU2&lt;/a&gt; distribution for more than 6 months, currently featuring the following configuration (both sw and hw), after some slightly changes:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Attached 500Gb 2,5" HD (powered through its USB2.0 connector).&lt;/li&gt;
&lt;li&gt;&lt;a target="_blank" title="MediaTomb - Free UPnP Media Server" href="http://mediatomb.cc/"&gt;MediaTomb&lt;/a&gt; &lt;a title="uPnP" href="http://en.wikipedia.org/wiki/Upnp"&gt;uPnP&lt;/a&gt; media server, to keep a nice "media center" running always available.&lt;/li&gt;
&lt;li&gt;&lt;a title="Samba" target="_blank" href="http://us3.samba.org/samba/"&gt;Samba&lt;/a&gt; filesharing server (to easily share files with any device connected to the LAN)&lt;/li&gt;
&lt;li&gt;&lt;a title="The libtorrent and rtorrent project" target="_blank" href="http://libtorrent.rakshasa.no/"&gt;&lt;em&gt;rtorrent&lt;/em&gt;&lt;/a&gt; bitTorrent client, to use the &lt;em&gt;Slug&lt;/em&gt; as a dedicated machine always up and ready to download whatever you want.&lt;/li&gt;
&lt;li&gt;The 'screen' command line utility (useful to easily keep the &lt;em&gt;rtorrent&lt;/em&gt; app always running and "detachable" ;-)).&lt;/li&gt;
&lt;li&gt;&lt;a title="OpenSSH" target="_blank" href="http://www.openssh.com/"&gt;OpenSSH&lt;/a&gt; server (ssh port forwarded in the router to access the &lt;em&gt;Slug&lt;/em&gt; from the Internet), to easily manage my &lt;em&gt;Slug&lt;/em&gt; from anywhere in the world.&lt;/li&gt;
&lt;/ol&gt;
With the exception of the HD (which used to be a 3,5" 120Gb HD since June to December, when I replaced with the 500Gb one), the rest of the configuration was amazingly working with &lt;span style="font-weight: bold"&gt;no problems at all for more than &lt;/span&gt;6 months, as I previously stated. This, along with the fact that this  device is quite small, noise-and-heat-free (no fans) and only needs 8W (it's the 266Mhz, 'underclocked' version) to work, makes it one of my favourite devices I ever had :-).
&lt;p&gt;But all this was kind of &amp;ldquo;incomplete&amp;rdquo; stuff until I got a &lt;a title="Playstation 3" target="_blank" href="http://www.us.playstation.com/PS3"&gt;&lt;em&gt;PS3&lt;/em&gt;&lt;/a&gt;, as a present from my girlfriend during last Christmas holidays, which gave it a new dimension to the &lt;em&gt;Slug&lt;/em&gt;, since the &lt;em&gt;PS3&lt;/em&gt; bundles a nice uPnP client for pictures, audio and video which works perfectly with the MediaTomb server installed in this cute device&lt;span style="font-style: italic"&gt;.&lt;/span&gt;&lt;/p&gt;</description><content:encoded><![CDATA[<p><a title="Juan's NSLU2 page" target="_blank" href="https://blogs.igalia.com/jasuarez/nslu2">As Juan</a>, I&rsquo;m one of the proud owners of a <a target="_blank" title="Linksys NSLU2" href="http://en.wikipedia.org/wiki/NSLU2">Linksys NSLU2</a> (aka <em>Slug</em>) perfectly (and continuously) running the <a target="_blank" title="Debian/NSLU2" href="http://www.nslu2-linux.org/wiki/Debian/HomePage">Debian/NSLU2</a> distribution for more than 6 months, currently featuring the following configuration (both sw and hw), after some slightly changes:</p>
<ol>
	<li>Attached 500Gb 2,5" HD (powered through its USB2.0 connector).</li>
	<li><a target="_blank" title="MediaTomb - Free UPnP Media Server" href="http://mediatomb.cc/">MediaTomb</a> <a title="uPnP" href="http://en.wikipedia.org/wiki/Upnp">uPnP</a> media server, to keep a nice "media center" running always available.</li>
	<li><a title="Samba" target="_blank" href="http://us3.samba.org/samba/">Samba</a> filesharing server (to easily share files with any device connected to the LAN)</li>
	<li><a title="The libtorrent and rtorrent project" target="_blank" href="http://libtorrent.rakshasa.no/"><em>rtorrent</em></a> bitTorrent client, to use the <em>Slug</em> as a dedicated machine always up and ready to download whatever you want.</li>
	<li>The 'screen' command line utility (useful to easily keep the <em>rtorrent</em> app always running and "detachable" ;-)).</li>
	<li><a title="OpenSSH" target="_blank" href="http://www.openssh.com/">OpenSSH</a> server (ssh port forwarded in the router to access the <em>Slug</em> from the Internet), to easily manage my <em>Slug</em> from anywhere in the world.</li>
</ol>
With the exception of the HD (which used to be a 3,5" 120Gb HD since June to December, when I replaced with the 500Gb one), the rest of the configuration was amazingly working with <span style="font-weight: bold">no problems at all for more than </span>6 months, as I previously stated. This, along with the fact that this  device is quite small, noise-and-heat-free (no fans) and only needs 8W (it's the 266Mhz, 'underclocked' version) to work, makes it one of my favourite devices I ever had :-).
<p>But all this was kind of &ldquo;incomplete&rdquo; stuff until I got a <a title="Playstation 3" target="_blank" href="http://www.us.playstation.com/PS3"><em>PS3</em></a>, as a present from my girlfriend during last Christmas holidays, which gave it a new dimension to the <em>Slug</em>, since the <em>PS3</em> bundles a nice uPnP client for pictures, audio and video which works perfectly with the MediaTomb server installed in this cute device<span style="font-style: italic">.</span></p>
<p>The point now is that I no more need to copy the video files I download with my Slug to another device (a desktop PC, a laptop&hellip;) to watch them, either in such a device or in the TV (with the help of a multimedia HD)&hellip; all I need to do is just:</p>
<ol>
	<li>Have the MediaTomb server continuously running in the <em>Slug</em>, watching (through its <a title="inotify" target="_blank" href="http://en.wikipedia.org/wiki/Inotify"><em>inotify</em></a> feature) to the <em>/storage/videos</em> directory for new videos (I want it to index them whenever I copy new downloaded videos under that path).</li>
	<li>Have the <em>PS3</em> connected to the local network, either through it's wired or wireless interface.</li>
	<li>Move the video files, as soon as they get fully downloaded, from my <em>/storage/downloads</em> path into <em>/storage/videos</em></li>
</ol>
This way, just by the moving the downloaded media files as explained in (3), and waiting a couple of minutes for the <em>MediaTomb</em> to index them, I have that media content available to be directly watched in the TV, which is really cool and very handy, by the way :-)
<p>Of course, you can also do the same with regular pictures or audio files (which is very nice also if you have, like me, the <em>PS3</em> audio output also plugged into a Hi-Fi), but I think you&rsquo;ll agree with me that watching video files seems to be the best way to make the most of the <em>Slug</em>+<em>Ps3</em>+<em>TV</em> combo :-).</p>
<p>And that&rsquo;s all, I think&hellip; just to mention I&rsquo;ve written this post while I was listening to a nice <a target="_blank" title="Thin Lizzy" href="http://en.wikipedia.org/wiki/Thin_Lizzy">Thin Lizzy</a> album (&quot;<a target="_blank" title="Thin Lizzy: Dedication" href="http://en.wikipedia.org/wiki/Dedication:_The_Very_Best_of_Thin_Lizzy">Dedication</a>&quot;) stored in the <em>Slug</em>, through the <em>PS3 </em>and my Hi-Fi equipment. It sounds good, doesn&rsquo;t it? :-)</p>
<p>PS: One of these days I&rsquo;ll post more in detail how to set up the configuration for all the components I&rsquo;m currently using in my <em>Slug (rtorrent</em>, <em>Samba</em>, <em>MediaTomb</em>&hellip;)<em>,</em> just in case someone found it useful.</p>
]]></content:encoded></item><item><title>Automatically mounting LUKS encrypted partitions with pam_mount</title><link>https://mariospr.org/2008/03/08/automatically-mounting-luks-encrypted-partitions-with-pam_mount/</link><pubDate>Sat, 08 Mar 2008 12:43:04 +0000</pubDate><guid isPermaLink="false">https://mariospr.org/?p=22</guid><description>&lt;p&gt;Yesterday I&amp;rsquo;ve got my new Thinkpad T61 laptop and I had to spend some time installing a GNU/Linux distribution on it, so doing all those related tasks that are a must: partitioning, installing linux, installing emacs&amp;hellip; and besides to all those tasks &lt;strong&gt;a very important one&lt;/strong&gt;: encrypting some disk partitions.&lt;/p&gt;
&lt;p&gt;To do that, I just followed the instructions that &lt;a title="Berto's blog" href="https://blogs.igalia.com/berto"&gt;Berto&lt;/a&gt; had posted some months ago in his blog, either for &lt;a title="Disk encryption in Linux (IV): Encrypting a full partition with LUKS" href="https://blogs.igalia.com/berto/2006/11/08/disk-encryption-in-linux-iv-encrypting-a-full-partition-with-luks/"&gt;encrypting full regular partitions with LUKS&lt;/a&gt; as for &lt;a title="Disk encryption in Linux (III): Encrypting temporary filesystems" href="https://blogs.igalia.com/berto/2006/11/03/disk-encryption-in-linux-iii-encrypting-temporary-filesystems/"&gt;encrypting temporary filesystems&lt;/a&gt;, say, &lt;strong&gt;/tmp&lt;/strong&gt; and &lt;strong&gt;swap&lt;/strong&gt; partitions.&lt;/p&gt;</description><content:encoded><![CDATA[<p>Yesterday I&rsquo;ve got my new Thinkpad T61 laptop and I had to spend some time installing a GNU/Linux distribution on it, so doing all those related tasks that are a must: partitioning, installing linux, installing emacs&hellip; and besides to all those tasks <strong>a very important one</strong>: encrypting some disk partitions.</p>
<p>To do that, I just followed the instructions that <a title="Berto's blog" href="https://blogs.igalia.com/berto">Berto</a> had posted some months ago in his blog, either for <a title="Disk encryption in Linux (IV): Encrypting a full partition with LUKS" href="https://blogs.igalia.com/berto/2006/11/08/disk-encryption-in-linux-iv-encrypting-a-full-partition-with-luks/">encrypting full regular partitions with LUKS</a> as for <a title="Disk encryption in Linux (III): Encrypting temporary filesystems" href="https://blogs.igalia.com/berto/2006/11/03/disk-encryption-in-linux-iii-encrypting-temporary-filesystems/">encrypting temporary filesystems</a>, say, <strong>/tmp</strong> and <strong>swap</strong> partitions.</p>
<p>So, once I got those tasks done (quite easy if you follow the steps <a title="Berto's blog" href="https://blogs.igalia.com/berto">Berto</a>&rsquo;s explained in his posts), only one more task was still left: to make those <a title="LUKS" href="http://luks.endorphin.org/">LUKS</a> encrypted partitions to be automatically mounted when logging into the system with my username.</p>
<p>The idea behind this is just that you use the <strong>same password</strong> both for logging into the system with your username as for decrypting those LUKS partitions before mounting them. To do this, I&rsquo;ve just  used the <a title="pam_mount module" href="http://pam-mount.sourceforge.net/">pam_mount</a> module so it took care of using the user password to automatically mount those partitions right after the user gets identified in the system. And of course, that pam module also takes care of unmounting those partitions right after you log out and no open sessions with your username remains active.</p>
<p>So, I&rsquo;d like to share with you a recipe to get all this stuff easily working:</p>
<ol>
	<li>Follow the steps in <a title="Berto's blog" href="https://blogs.igalia.com/berto">Berto</a>'s post to <a title="Disk encryption in Linux (IV): Encrypting a full partition with LUKS" href="https://blogs.igalia.com/berto/2006/11/08/disk-encryption-in-linux-iv-encrypting-a-full-partition-with-luks/">encrypt a full partition with LUKS</a>.</li>
	<li>When you add a LUKS password for that encrypted partition, use the <strong>same password</strong> you use to log into your system with your username. LUKS allows you to add more than one password for your partitions, so at least one of them should be the same than your user password.</li>
	<li>Install the <a title="pam_mount module" href="http://pam-mount.sourceforge.net/">pam_mount</a> module:</li>
<blockquote>sudo apt-get install libpam-mount</blockquote>
	<li>Edit your /etc/security/pam_mount.conf file and append there a line like the following one (one for each encrypted partition you'd like to automatically mount):</li>
<blockquote>volume USERNAME crypt - DEV_FILE MOUNTPOINT - - -</blockquote>
For example, to mount a encripted partition present in /dev/sda6 under a /encrypted folder whenever the user 'mario' logs into the system, you should append the following line:
<blockquote>volume mario crypt - /dev/sda6 /encrypted - - -</blockquote>
	<li>Edit /etc/pam.d/login so it looks as follows at the end of the file</li>
<blockquote>[...]
# Standard Un*x account and session
@include common-account
@include common-session
@include common-pammount
@include common-password</blockquote>
	<li>And, if you use <a title="Gnome display manager" href="http://www.gnome.org/projects/gdm/">GDM</a> (as me), you should also edit /etc/pam.d/gdm in a similar way:</li>
<blockquote>[...]
@include common-account
session required        pam_limits.so
@include common-session
@include common-pammount
session optional        pam_gnome_keyring.so  auto_start
@include common-password</blockquote>
	<li>At last make sure that you have removed (or commented) some lines in /etc/fstab and /etc/crypttab, in order to avoid both asking for the LUKS password at startup (because the crypttab file) as trying to mount a not decrypted partition (because of fstab). For instance, this is how those files would look for the example given:</li>
<ol />
<ul>
	<li>/etc/crypttab:</li>
</ul>
<ol>
<blockquote>#encrypted /dev/sda6  none            luks,check=ext2
cswap   /dev/sda8   /dev/urandom    swap
ctmp    /dev/sda9    /dev/urandom    tmp</blockquote>
</ol>
<ul>
	<li>/etc/fstab:</li>
</ul>
<ol>
<blockquote>[...]
#/dev/mapper/encrypted     /encrypted  ext3    defaults        0       2
[...]</blockquote>
</ol>
</ol>
Once you have followed all those steps, you should be able to reboot and see how the encrypted partition gets mounted right after you login in your system, either by using GDM as by using a text-mode terminal.
<p>And that&rsquo;s all. I hope you find it useful.</p>
]]></content:encoded></item></channel></rss>