<?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>Nicolás Brailovsky &#187; Linux</title>
	<atom:link href="http://nicolasb.com.ar/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://nicolasb.com.ar</link>
	<description>A modern blog</description>
	<lastBuildDate>Tue, 07 Sep 2010 10:07:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Date time WTF</title>
		<link>http://nicolasb.com.ar/2010/08/date-time-wtf/</link>
		<comments>http://nicolasb.com.ar/2010/08/date-time-wtf/#comments</comments>
		<pubDate>Thu, 26 Aug 2010 10:00:06 +0000</pubDate>
		<dc:creator>nico</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[WTF]]></category>

		<guid isPermaLink="false">http://nicolasb.com.ar/?p=1208</guid>
		<description><![CDATA[Another one to add to my growing list of bad things about Ubuntu. For some reason my clock froze. I only noticed it when it started to be dark outside, for me the time had frozen at about 17pm.

]]></description>
			<content:encoded><![CDATA[<p>Another one to add to my growing list of bad things about Ubuntu. For some reason my clock froze. I only noticed it when it started to be dark outside, for me the time had frozen at about 17pm.</p>
<p><a href="http://nicolasb.com.ar/archivos/2010/08/date_time_wtf.png"><img class="aligncenter size-full wp-image-1209" title="date_time_wtf" src="http://nicolasb.com.ar/archivos/2010/08/date_time_wtf.png" alt="" width="276" height="524" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://nicolasb.com.ar/2010/08/date-time-wtf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oh my god</title>
		<link>http://nicolasb.com.ar/2010/07/oh-my-god/</link>
		<comments>http://nicolasb.com.ar/2010/07/oh-my-god/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 10:00:40 +0000</pubDate>
		<dc:creator>nico</dc:creator>
				<category><![CDATA[Console]]></category>

		<guid isPermaLink="false">http://nicolasb.com.ar/?p=923</guid>
		<description><![CDATA[


An old good Unix console joke goes like this:
% ar m God
ar: God does not exist
Obviously thats a very old and used joke, nowdays we&#8217;re much more advanced than that:
$ ar m God
$ ar: creating God




]]></description>
			<content:encoded><![CDATA[<table width="100%">
<tbody>
<tr>
<td width="*">An old good Unix console joke goes like this:</p>
<p>% ar m God<br />
ar: God does not exist</p>
<p>Obviously thats a very old and used joke, nowdays we&#8217;re much more advanced than that:</p>
<p>$ ar m God<br />
$ ar: creating God</td>
<td width="300"><a href="http://nicolasb.com.ar/archivos/2010/04/homer-and-god.jpg"><img class="aligncenter size-full wp-image-940" title="homer-and-god" src="http://nicolasb.com.ar/archivos/2010/04/homer-and-god.jpg" alt="" width="300" height="225" /></a></td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://nicolasb.com.ar/2010/07/oh-my-god/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Elvis is alive!</title>
		<link>http://nicolasb.com.ar/2010/07/elvis-is-alive/</link>
		<comments>http://nicolasb.com.ar/2010/07/elvis-is-alive/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 11:42:31 +0000</pubDate>
		<dc:creator>nico</dc:creator>
				<category><![CDATA[Console]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nicolasb.com.ar/?p=924</guid>
		<description><![CDATA[Unix trivia day: in the olden days of the 90&#8217;s there were a lot of Unix boxes out there named &#8220;elvis&#8221;. Nowdays it&#8217;s not uncommon to find one, either. Have you ever wondered why are there so many boxes called elvis?
This is related to Solaris&#8217; ping command. When you ping $HOST it prints &#8220;$HOST is [...]]]></description>
			<content:encoded><![CDATA[<p>Unix trivia day: in the olden days of the 90&#8217;s there were a lot of Unix boxes out there named &#8220;elvis&#8221;. Nowdays it&#8217;s not uncommon to find one, either. Have you ever wondered why are there so many boxes called elvis?</p>
<p>This is related to Solaris&#8217; ping command. When you ping $HOST it prints &#8220;$HOST is alive&#8221; (if it&#8217;s responding the pings), thus elvis is alive!</p>
<p><a href="http://nicolasb.com.ar/archivos/2010/04/homer-simpson-elvis1.gif"><img class="aligncenter size-medium wp-image-942" title="homer-simpson-elvis1" src="http://nicolasb.com.ar/archivos/2010/04/homer-simpson-elvis1-255x300.gif" alt="" width="255" height="300" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://nicolasb.com.ar/2010/07/elvis-is-alive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>There&#8217;s still hope</title>
		<link>http://nicolasb.com.ar/2010/06/theres-still-hope/</link>
		<comments>http://nicolasb.com.ar/2010/06/theres-still-hope/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 10:00:56 +0000</pubDate>
		<dc:creator>nico</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nicolasb.com.ar/?p=958</guid>
		<description><![CDATA[A log time ago, in a galaxy far away, I posted a list of stuff I apt-get&#8217;d as soon as my Buguntu install was ready. Well, fast forward to KK and this is the new apt-get script:



sudo apt-get install opera mocp unclutter build-essential gimp \


&#160; &#160; &#160; &#160; mmv gnome-do knetworkmanager xdiskusage iptraf sshfs \


&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>A log time ago, in a galaxy far away, I <a href="http://nicolasb.com.ar/2008/10/apt-get-new-system/">posted</a> <a href="http://nicolasb.com.ar/2008/12/apt-get-install-new-computer-ii/">a list</a> <a href="http://nicolasb.com.ar/2009/05/apt-get-install-new-computer-iii/">of stuff</a> I apt-get&#8217;d as soon as my Buguntu install was ready. Well, fast forward to KK and this is the new apt-get script:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">sudo</span> apt-get <span class="kw2">install</span> opera mocp unclutter build-essential <span class="kw2">gimp</span> \</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; mmv gnome-<span class="kw1">do</span> knetworkmanager xdiskusage iptraf sshfs \</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; shntool cuetools flac wavpack unrar vlc vim gvim vim-doc \</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; vim-full vim-gnome ddd devhelp doxygen doxygen-gui \</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; exuberant-ctags ctags &nbsp;subversion ifstat antiword</div>
</li>
</ol>
</div>
<p>Quite a progress I&#8217;d say, as these are mostly programs I use which don&#8217;t come in the default install (even though they should). You know, I even have hopes for <a href="http://nicolasb.com.ar/2010/05/ubuntu-sound-still-fubard/">the sound system</a> in my notebook this time&#8230;</p>
<p><a href="http://nicolasb.com.ar/archivos/2010/06/light-at-the-end-of-the-tunnel.jpg"><img class="aligncenter size-medium wp-image-961" title="light-at-the-end-of-the-tunnel" src="http://nicolasb.com.ar/archivos/2010/06/light-at-the-end-of-the-tunnel-300x234.jpg" alt="" width="300" height="234" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://nicolasb.com.ar/2010/06/theres-still-hope/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Binary portability in Linux</title>
		<link>http://nicolasb.com.ar/2010/06/binary-portability-in-linux/</link>
		<comments>http://nicolasb.com.ar/2010/06/binary-portability-in-linux/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 10:00:09 +0000</pubDate>
		<dc:creator>nico</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://nicolasb.com.ar/?p=813</guid>
		<description><![CDATA[



An interesting topic for a change: is Linux binary portable? That is, can we take a binary file and be sure it&#8217;ll run in any other Linux system? What happens if we broaden that to any POSIX system, will it blend? Eh, I mean, will it run?



Doing some research on the subject I wrote down [...]]]></description>
			<content:encoded><![CDATA[<table>
<tbody>
<tr>
<td><a href="http://nicolasb.com.ar/archivos/2010/02/binary_heart-thumb-400x438.jpg"><img class="aligncenter size-thumbnail wp-image-814" title="binary_heart-thumb-400x438" src="http://nicolasb.com.ar/archivos/2010/02/binary_heart-thumb-400x438-150x150.jpg" alt="" width="150" height="150" /></a></td>
<td>An interesting topic for a change: is Linux binary portable? That is, can we take a binary file and be sure it&#8217;ll run in any other Linux system? What happens if we broaden that to any POSIX system, will it blend? Eh, I mean, will it run?</td>
</tr>
</tbody>
</table>
<p>Doing some research on the subject I wrote down a list of the thought process which led my to an (inconclusive) answer:</p>
<p>1. First we should define what a binary is for us: When we talk about a binary we are usually thinking about a compiled binary file, not an interpreted script file like Ruby or Python. Those are for people who like things to actually work, so let&#8217;s focus on a compiled executable file, like a C/C++ application.</p>
<p>2. Defining compiled file: What could it be other than a sequence of bytes the microprocessor can understand? Yes, that&#8217;s right, it&#8217;s sort of interpreted code, only there&#8217;s electronics behind, not more code. This brings us to the first interesting conclusion: the executable must be (leaving emulators aside) compatible with the architecture you&#8217;re on. Running Sparc? Well then, the binary better be compiled for Sparc because otherwise to the uP will not make any sense.</p>
<p>3. Format: as any other thing, a binary file must have a format. That is a standard which defines the structure the file will follow. ELF is the binary format for Linux and it&#8217;s quite standard. Of course, if the binary format is a standard then we should get perfect portability between different platforms running on equal architecture. Unfortunately that&#8217;s not the case.</p>
<p>4. (Cont&#8217;d) Why don&#8217;t we? The binary depends not only on compile time &#8220;stuff&#8221; but a loading time linking occurs: the executable binary will get linked with the system files like glibc, or any other dependency on a shared library it may have.</p>
<p>So, what are the keypoints for Linux binary portability? Architecture, binary format and system libraries.</p>
<p>Of course, making the executable run is only part of the equation, as running and segfaulting on the spot is not so nice either. For this last part you&#8217;ll have to closely follow the standards defined by POSIX for paths and stuff like that.</p>
<p><a href="http://nicolasb.com.ar/archivos/2010/02/portable.jpg"><img class="aligncenter size-medium wp-image-815" title="portable" src="http://nicolasb.com.ar/archivos/2010/02/portable-300x226.jpg" alt="" width="300" height="226" /></a></p>
<h3>Epilogue</h3>
<p>As an epilogue, we could add that Windows binary compatibility tends to be great. Running binaries from 12 years back is no small feat, yet this leads to a whole lot of other problems: an incredible complex loader, security bugs, backwards compatibility headaches, et al. <a href="http://blogs.msdn.com/oldnewthing/">The old new thing</a> is a great source of information for this topics, I&#8217;m quite illiterate about Windows binaries nowdays <img src='http://nicolasb.com.ar/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Followup links</h3>
<ul>
<li><a href="http://evanjones.ca/portable-linux-binaries.html">http://evanjones.ca/portable-linux-binaries.html</a></li>
<li><a href="http://autopackage.org/docs/devguide/ch07.html">http://autopackage.org/docs/devguide/ch07.html</a> (I swear this one was working when I wrote this text&#8230; a year ago)</li>
</ul>
<p>Oh, talking about binaries:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/WGoi1MSGu64&amp;hl=es_ES&amp;fs=1&amp;rel=0" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/WGoi1MSGu64&amp;hl=es_ES&amp;fs=1&amp;rel=0" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://nicolasb.com.ar/2010/06/binary-portability-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu: Sound still FUBAR&#8217;d</title>
		<link>http://nicolasb.com.ar/2010/05/ubuntu-sound-still-fubard/</link>
		<comments>http://nicolasb.com.ar/2010/05/ubuntu-sound-still-fubard/#comments</comments>
		<pubDate>Tue, 04 May 2010 10:00:39 +0000</pubDate>
		<dc:creator>nico</dc:creator>
				<category><![CDATA[Grumpy]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[WTF]]></category>

		<guid isPermaLink="false">http://nicolasb.com.ar/?p=790</guid>
		<description><![CDATA[



Remember my problems with dual screen support in Ubuntu? Well, I still love bashing Ubuntu, and the sound system in Linux is certainly a topic to rant a lot. Making the sound work fine in Ubuntu is an odyssey in pain and frustration, unless it works fine out of the box. And even if it [...]]]></description>
			<content:encoded><![CDATA[<table>
<tbody>
<tr>
<td><a href="http://nicolasb.com.ar/archivos/2010/02/music_box_open_b.jpg"><img class="aligncenter size-medium wp-image-791" title="music_box_open_b" src="http://nicolasb.com.ar/archivos/2010/02/music_box_open_b-300x300.jpg" alt="" width="300" height="300" /></a></td>
<td>Remember my problems with <a href="http://nicolasb.com.ar/2010/02/ubuntu-dual-screen-still-fubard/">dual screen support</a> in Ubuntu? Well, I still love bashing Ubuntu, and the sound system in Linux is certainly a topic to rant a lot. Making the sound work fine in Ubuntu is an odyssey in pain and frustration, unless it works fine out of the box. And even if it does, it may still have it&#8217;s kirks. Lots of them.</p>
<p>In my case the sound starts in mute. I know it&#8217;s a problem with pulse (which is a WTF in itself) and alsa, I don&#8217;t really care what&#8217;s the problem though, I just want to play my mp3s collection without having to carefully turn the knobs up to eleven in alsamixer.</td>
</tr>
</tbody>
</table>
<p>After trying a lot of the &#8220;solutions&#8221; found on the internets I&#8217;ve decided the best thing to do, short of switching back to windows me, is adding the following to my &#8220;fix_ubuntu_fuckups.sh&#8221; start script, which already contains my dual-screen pseudofix:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">amixer -c0 &#8212; sset Master playback -0dB unmute</div>
</li>
<li class="li1">
<div class="de1">amixer -c0 &#8212; sset Headphone playback 0dB unmute</div>
</li>
<li class="li1">
<div class="de1">amixer -c0 &#8212; sset Front playback 0dB unmute</div>
</li>
<li class="li1">
<div class="de1">amixer -c0 &#8212; sset PCM playback -16dB unmute</div>
</li>
</ol>
</div>
<p>This sets alsamixer to normal volume levels. As for the real fix, I&#8217;ll wait till the next Ubuntu version. I wonder which sound subsystem will they chose next time.</p>
<p><a href="http://nicolasb.com.ar/archivos/2009/10/grumpy-old-man.jpg"><img class="aligncenter size-medium wp-image-605" title="grumpy old man" src="http://nicolasb.com.ar/archivos/2009/10/grumpy-old-man-300x300.jpg" alt="" width="300" height="300" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://nicolasb.com.ar/2010/05/ubuntu-sound-still-fubard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu: Dual screen still FUBAR&#8217;d</title>
		<link>http://nicolasb.com.ar/2010/04/ubuntu-dual-screen-still-fubard/</link>
		<comments>http://nicolasb.com.ar/2010/04/ubuntu-dual-screen-still-fubard/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 10:00:37 +0000</pubDate>
		<dc:creator>nico</dc:creator>
				<category><![CDATA[Gnome]]></category>

		<guid isPermaLink="false">http://nicolasb.com.ar/?p=767</guid>
		<description><![CDATA[I&#8217;m quite sure I have written about this before but I&#8217;m too lazy to search for the article right now. Well, dual screens in Ubuntu still sucks. Much less than ever before, granted, but it still works quite bad. In my specific case the whole desktop is shown, in both monitors (which by itself is [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m quite sure I have written about this before but I&#8217;m too lazy to search for the article right now. Well, dual screens in Ubuntu still sucks. Much less than ever before, granted, but it still works quite bad. In my specific case the whole desktop is shown, in both monitors (which by itself is a huge improvement over previous versions) but the working area is clipped to the notebook&#8217;s monitor size. Not nice.</p>
<p><a href="http://nicolasb.com.ar/archivos/2010/02/Jack-Rabbit.jpg"><img class="aligncenter size-medium wp-image-768" title="Jack Rabbit" src="http://nicolasb.com.ar/archivos/2010/02/Jack-Rabbit-300x201.jpg" alt="" width="300" height="201" /></a></p>
<p>To fix this problem (more like hacking it away, actually) I keep a handy bash script in the top left corner on my desktop:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">xrandr &#8211;output HDMI<span class="nu0">-2</span> &#8211;right-of HDMI<span class="nu0">-1</span> &#8211;mode 1680&#215;1050 &#8211;rotate normal</div>
</li>
</ol>
</div>
<p>Also, as I have two nice rotable monitors at work it&#8217;s nice that now Ubuntu supports actually rotating the picture displayed in the monitor (thanks Ubuntu for coming up to speed&#8230; with windows 98, that is). Obviously I keep another script for this, as it doesn&#8217;t really work by default:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">xrandr &#8211;output HDMI<span class="nu0">-1</span> &#8211;left-of HDMI<span class="nu0">-2</span> &#8211;mode 1680&#215;1050 &#8211;rotate left</div>
</li>
<li class="li1">
<div class="de1">xrandr &#8211;output HDMI<span class="nu0">-2</span> &#8211;left-of HDMI<span class="nu0">-1</span> &#8211;mode 1680&#215;1050 &#8211;rotate normal</div>
</li>
</ol>
</div>
<p>Even though I love bashing Ubuntu (and bash) I&#8217;m quite confident most, if not all, of this issues will be gone in future versions of the OS.</p>
]]></content:encoded>
			<wfw:commentRss>http://nicolasb.com.ar/2010/04/ubuntu-dual-screen-still-fubard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changing default file associations in gnome</title>
		<link>http://nicolasb.com.ar/2010/04/changing-default-file-associations-in-gnome/</link>
		<comments>http://nicolasb.com.ar/2010/04/changing-default-file-associations-in-gnome/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 10:00:20 +0000</pubDate>
		<dc:creator>nico</dc:creator>
				<category><![CDATA[Gnome]]></category>

		<guid isPermaLink="false">http://nicolasb.com.ar/?p=545</guid>
		<description><![CDATA[It&#8217;s been a long time since I posted a Linux related tip. Not in the mood I guess&#8230; well, this is one which really annoyed me, until I found out how easy it is: I hate some of the default file associations in gnome. Movieplayer, for example, is a horrible choice. Breaking and devolving with [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a long time since I posted a Linux related tip. Not in the mood I guess&#8230; well, this is one which really annoyed me, until I found out how easy it is: I hate some of the default file associations in gnome. Movieplayer, for example, is a horrible choice. Breaking and devolving with each new distro release, I have decided to settle with vlc as my default movie player, yet I couldn&#8217;t easily change the default file type association. After fiddling around with the thingy in gnome resembling a regedit (ugh) I found out the easy way:</p>
<p>* Right click the file for which you want to change default associations and click properties<br />
* Select &#8220;open with&#8221; tab<br />
* &#8230;<br />
* Profit!</p>
<p><a href="http://nicolasb.com.ar/archivos/2010/02/gnomo_joven.jpg"><img class="aligncenter size-medium wp-image-752" title="gnomo_joven" src="http://nicolasb.com.ar/archivos/2010/02/gnomo_joven-278x300.jpg" alt="" width="278" height="300" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://nicolasb.com.ar/2010/04/changing-default-file-associations-in-gnome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>gdb: debugging multithreaded applications</title>
		<link>http://nicolasb.com.ar/2009/10/gdb-debugging-multithreaded-applications/</link>
		<comments>http://nicolasb.com.ar/2009/10/gdb-debugging-multithreaded-applications/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 10:00:00 +0000</pubDate>
		<dc:creator>nico</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://nicolasb.com.ar/?p=395</guid>
		<description><![CDATA[


Few things look cooler than debugging a multithreaded application using TUI through ssh on a client, halfway across the world. There you are, felling the geek of the century when all of the sudden gdb starts jumping from one thread to the other. OMFGBBQ! What are you going to do now?




The scheduler locking policy defines [...]]]></description>
			<content:encoded><![CDATA[<table border="0">
<tbody>
<tr>
<td>Few things look cooler than debugging a multithreaded application using <a href="http://nicolasb.com.ar/2009/09/gdb-graphic-tui-mode">TUI</a> through ssh on a client, halfway across the world. There you are, felling the geek of the century when all of the sudden gdb starts jumping from one thread to the other. OMFGBBQ! What are you going to do now?</td>
<td><a href="http://nicolasb.com.ar/archivos/2009/10/thisthreadis128483904188593750.jpg"><img class="aligncenter size-medium wp-image-589" title="thisthreadis128483904188593750" src="http://nicolasb.com.ar/archivos/2009/10/thisthreadis128483904188593750-300x225.jpg" alt="thisthreadis128483904188593750" width="300" height="225" /></a></td>
</tr>
</tbody>
</table>
<p>The scheduler locking policy defines when will thread context swtiches occur. If you are debuging a thead and don&#8217;t want to be bothered by another then just lock the scheduler.</p>
<p>gdb has a default scheduling locking which defaults to &#8220;most annoying&#8221;, but fortunately you can easily change it:</p>
<p><span lang="bash"><br />
set scheduler-locking<br />
</span></p>
<p>The possible values are:</p>
<ul>
<li>off: Disable locking, switches threads whenever gdb damn pleases</li>
<li>on: Enable locking, won&#8217;t (ever) switch threads. <strong>Beware of deadlocks!</strong></li>
<li>step: Disable locking while running only</li>
</ul>
<p>Hopefully this will save you some time.</p>
]]></content:encoded>
			<wfw:commentRss>http://nicolasb.com.ar/2009/10/gdb-debugging-multithreaded-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sed magic: a simple guide</title>
		<link>http://nicolasb.com.ar/2009/09/sed-magic-a-simple-guide/</link>
		<comments>http://nicolasb.com.ar/2009/09/sed-magic-a-simple-guide/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 10:00:50 +0000</pubDate>
		<dc:creator>nico</dc:creator>
				<category><![CDATA[Console]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://nicolasb.com.ar/?p=517</guid>
		<description><![CDATA[


The other day I had to create one of those &#8220;enum to string&#8221; functions. They really suck, always getting out of sync, so I made a script to auto-update the header file containing this function&#8230; just add a target to the makefile and you&#8217;re done!




Anyway, this is the part of the script I came up [...]]]></description>
			<content:encoded><![CDATA[<table border="0">
<tbody>
<tr>
<td>The other day I had to create one of those &#8220;enum to string&#8221; functions. They really suck, always getting out of sync, so I made a script to auto-update the header file containing this function&#8230; just add a target to the makefile and you&#8217;re done!</td>
<td><a href="http://nicolasb.com.ar/archivos/2009/09/11Sed.jpg"><img class="aligncenter size-medium wp-image-570" title="11Sed" src="http://nicolasb.com.ar/archivos/2009/09/11Sed-295x300.jpg" alt="11Sed" width="295" height="300" /></a></td>
</tr>
</tbody>
</table>
<p>Anyway, this is the part of the script I came up with to get the enum elements:</p>
<p><span lang="bash"><br />
cat enum_definition.h | sed -n &#8216;/enum OID/,/\}\;/ s/\(.*\)/\1/p&#8217;<br />
</span></p>
<p>Nice voodoo, isn&#8217;t it? How the hell are you supposed to understand that? Well, you&#8217;re not, sed is write-only-code, but you can try reading <a href="http://www.grymoire.com/Unix/Sed.html#toc-uh-25">http://www.grymoire.com/Unix/Sed.html#toc-uh-25</a>, a great sed introduction.</p>
<p>Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://nicolasb.com.ar/2009/09/sed-magic-a-simple-guide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
