<?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>chys&#039;s random notes &#187; Linux</title>
	<atom:link href="http://en.chys.info/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://en.chys.info</link>
	<description>Study more problems; Talk less of isms.</description>
	<lastBuildDate>Tue, 27 Dec 2011 11:56:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>A problem with pipes in Python 3</title>
		<link>http://en.chys.info/2011/11/a-problem-with-pipes-in-python-3/</link>
		<comments>http://en.chys.info/2011/11/a-problem-with-pipes-in-python-3/#comments</comments>
		<pubDate>Mon, 14 Nov 2011 09:00:30 +0000</pubDate>
		<dc:creator>chys</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://en.chys.info/?p=901</guid>
		<description><![CDATA[The most disturbing change from Python 2 to 3 definitely is not the print() function; nor that some functions which used to return lists now return iterators; nor the removal of __cmp__; but the transition to Unicode. I&#8217;m completely supportive of the transition per se, but I&#8217;m disappointed that they&#8217;re trying to compel us to [...]<hr/>
Related posts:<ol>
<li><a href='http://en.chys.info/2009/08/cmp-should-be-reintroduced-to-python/' rel='bookmark' title='__cmp__ should be reintroduced to Python'>__cmp__ should be reintroduced to Python</a></li>
<li><a href='http://en.chys.info/2008/10/another-vmware-problem/' rel='bookmark' title='Another VMware problem'>Another VMware problem</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>The most disturbing <a href="http://docs.python.org/release/3.0.1/whatsnew/3.0.html">change from Python 2 to 3</a> definitely is not the <code>print()</code> function; nor that some functions which used to return lists now return iterators; nor the <a href="/2009/08/cmp-should-be-reintroduced-to-python/">removal of <code>__cmp__</code></a>; but the transition to Unicode.</p>
<p>I&#8217;m completely supportive of the transition <em>per se</em>, but I&#8217;m disappointed that they&#8217;re trying to compel us to use Unicode by dropping useful functionalities for byte-streams/8-byte strings. For example, <code>bytes</code> has no <a href="http://www.python.org/dev/peps/pep-3101/"><code>format</code></a> or <a href="http://docs.python.org/release/2.5.2/lib/typesseq-strings.html"><code>%</code></a> in Python 3.</p>
<p>I have some code like this:</p>
<blockquote><pre>
proc = <a href="http://docs.python.org/release/3.1.3/library/subprocess.html">subprocess</a>.Popen((....), stdout=subprocess.PIPE)
for line in proc.stdout:
    ...
</pre>
</blockquote>
<p>I found that, on Linux, this code snippet is almost 10 times slower in Python 3 than in Python 2. Then I <a href="http://en.wikipedia.org/wiki/Strace">strace</a>&#8216;d the code and found Python 3 is passing length 1 to <a href="http://linux.die.net/man/2/read"><code>read</code></a>, incurring thousands of times more system calls than Python 2. Are you kidding me? I was forced to use something like <code>proc.stdout.read(...)</code>.</p>
<p>I understand this is not the direct result of the transition to Unicode, but it is somehow related.</p>
<hr/><p>Related posts:<ol>
<li><a href='http://en.chys.info/2009/08/cmp-should-be-reintroduced-to-python/' rel='bookmark' title='__cmp__ should be reintroduced to Python'>__cmp__ should be reintroduced to Python</a></li>
<li><a href='http://en.chys.info/2008/10/another-vmware-problem/' rel='bookmark' title='Another VMware problem'>Another VMware problem</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://en.chys.info/2011/11/a-problem-with-pipes-in-python-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A hack to strace -f</title>
		<link>http://en.chys.info/2011/03/a-hack-to-strace-f/</link>
		<comments>http://en.chys.info/2011/03/a-hack-to-strace-f/#comments</comments>
		<pubDate>Fri, 25 Mar 2011 13:22:20 +0000</pubDate>
		<dc:creator>chys</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[multithread]]></category>

		<guid isPermaLink="false">http://en.chys.info/?p=886</guid>
		<description><![CDATA[I have a multithreaded program which I would like to strace for debugging purpose. My program sometimes calls (fork and exec) an external program, which in turn calls a setuid program. Because my program is multithreaded, I cannot omit the “-f” flag (also trace child threads and processes) when using strace. And because all children, [...]<hr/>
No related posts.]]></description>
			<content:encoded><![CDATA[<p>I have a multithreaded program which I would like to <a href="http://en.wikipedia.org/wiki/Strace">strace</a> for debugging purpose. My program sometimes calls (fork and exec) an external program, which in turn calls a <a href="http://www.aquaphoenix.com/ref/gnu_c_library/libc_438.html">setuid program</a>.</p>
<p>Because my program is multithreaded, I cannot omit the “<code>-f</code>” flag (also trace child threads and processes) when using strace. And because all children, including the setuid program, are traced, setuid fails. (Yes, I am aware that strace claims it is possible to trace setuid programs, but the trick does not work for me, probably because the setuid program is not directly executed by strace.)</p>
<p>Fortunately, the <code><a href="http://linux.die.net/man/2/clone">clone</a></code> system call has many useful flags. It works fine for me when I substitute calls to <code><a href="http://linux.die.net/man/2/fork">fork()</a></code> with:</p>
<blockquote><p><code>(pid_t) syscall (__NR_clone, CLONE_UNTRACED|SIGCHLD, NULL);<br />
</code></p></blockquote>
<p>(Yes, <code>SIGCHLD</code>, not <code>CLONE_SIGCHLD</code>. It&#8217;s not a typo.)</p>
<p>I guess there may be better solutions, without modifying the program being traced?</p>
<hr/><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://en.chys.info/2011/03/a-hack-to-strace-f/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Concatenate PDF files in Linux</title>
		<link>http://en.chys.info/2010/12/concatenate-pdf-files-in-linux/</link>
		<comments>http://en.chys.info/2010/12/concatenate-pdf-files-in-linux/#comments</comments>
		<pubDate>Sun, 26 Dec 2010 11:52:22 +0000</pubDate>
		<dc:creator>chys</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://en.chys.info/?p=880</guid>
		<description><![CDATA[Some people recommend using convert or gs. However, there is a major problem with them &#8211; all text and vector graphics become raster graphics. pdftk (PDF ToolKit) is a better solution &#8211; it keeps text and vector graphics. We just have to use this command: pdftk *.pdf cat output result.pdf PDF Shuffler, written in Python [...]<hr/>
No related posts.]]></description>
			<content:encoded><![CDATA[<p>Some people recommend using <a href="http://linux.die.net/man/1/convert">convert</a> or <a href="http://linux.die.net/man/1/gs">gs</a>. However, there is a major problem with them &#8211; all text and vector graphics become <a href="http://en.wikipedia.org/wiki/Raster_graphics">raster graphics</a>.</p>
<p><a href="http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/">pdftk</a> (PDF ToolKit) is a better solution &#8211; it keeps text and vector graphics. We just have to use this command:</p>
<blockquote><pre>pdftk *.pdf cat output result.pdf</pre>
</blockquote>
<p><a href="http://sourceforge.net/projects/pdfshuffler/">PDF Shuffler</a>, written in Python and based on <a href="http://poppler.freedesktop.org/">poppler</a>, also does the trick, and has a nice GUI.</p>
<p>However, there are drawbacks for both pdftk and PDF Shuffler:</p>
<ul>
<li>pdftk only supports ASCII filenames. So it&#8217;s a bit inconvenient for non-English users like me.</li>
<li>PDF Shuffler is <em>way</em> too slow. I tried concatenating several files (approx. 1000 pages), and it kept running for more than 10 minutes before I hit Ctrl-C; pdftk finished the same task in just a few seconds.</li>
</ul>
<hr/><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://en.chys.info/2010/12/concatenate-pdf-files-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert PDF to images in Linux</title>
		<link>http://en.chys.info/2010/12/convert-pdf-to-images-in-linux/</link>
		<comments>http://en.chys.info/2010/12/convert-pdf-to-images-in-linux/#comments</comments>
		<pubDate>Sat, 11 Dec 2010 14:36:58 +0000</pubDate>
		<dc:creator>chys</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://en.chys.info/?p=864</guid>
		<description><![CDATA[Just use convert, the universal image converter shipped with ImageMagick. convert a.pdf a.png And we get as many PNG files as there are pages in the PDF. They converted files are named a-0.png, a-1.png, &#8230; We can also use it the other way around: convert a.jpg b.png c.gif abc.pdf This will combine the three images [...]<hr/>
Related posts:<ol>
<li><a href='http://en.chys.info/2010/12/concatenate-pdf-files-in-linux/' rel='bookmark' title='Concatenate PDF files in Linux'>Concatenate PDF files in Linux</a></li>
<li><a href='http://en.chys.info/2008/12/migrating-to-ext4/' rel='bookmark' title='Migrating to EXT4'>Migrating to EXT4</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Just use <code><a href="http://linux.die.net/man/1/convert">convert</a></code>, the universal image converter shipped with <a href="http://www.imagemagick.org">ImageMagick</a>.</p>
<blockquote><p><code>convert a.pdf a.png</code></p></blockquote>
<p>And we get as many PNG files as there are pages in the PDF. They converted files are named <code>a-0.png</code>, <code>a-1.png</code>, &#8230;</p>
<p>We can also use it the other way around:</p>
<blockquote><p>convert a.jpg b.png c.gif abc.pdf</p></blockquote>
<p>This will combine the three images into one PDF file. Very flexible.</p>
<hr/><p>Related posts:<ol>
<li><a href='http://en.chys.info/2010/12/concatenate-pdf-files-in-linux/' rel='bookmark' title='Concatenate PDF files in Linux'>Concatenate PDF files in Linux</a></li>
<li><a href='http://en.chys.info/2008/12/migrating-to-ext4/' rel='bookmark' title='Migrating to EXT4'>Migrating to EXT4</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://en.chys.info/2010/12/convert-pdf-to-images-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>man 3 sleep</title>
		<link>http://en.chys.info/2010/10/man-3-sleep/</link>
		<comments>http://en.chys.info/2010/10/man-3-sleep/#comments</comments>
		<pubDate>Sun, 17 Oct 2010 14:17:32 +0000</pubDate>
		<dc:creator>chys</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[multithread]]></category>

		<guid isPermaLink="false">http://en.chys.info/?p=843</guid>
		<description><![CDATA[The man page of sleep(3) used to say: sleep() makes the calling process sleep until seconds seconds have elapsed or a signal arrives which is not ignored. [Old version; color added] Now it says: sleep() makes the calling thread sleep until seconds seconds have elapsed or a signal arrives which is not ignored. [New version] [...]<hr/>
Related posts:<ol>
<li><a href='http://en.chys.info/2010/03/errno-as-thread-identifier/' rel='bookmark' title='&lt;code&gt;&amp;errno&lt;/code&gt; as thread identifier'><code>&amp;errno</code> as thread identifier</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>The man page of <code>sleep</code>(3) used to say:</p>
<blockquote><p><strong>sleep</strong>() makes the calling <font color="red">process</font> sleep until <em>seconds</em> seconds have elapsed or a signal arrives which is not ignored. [<a href="http://linux.die.net/man/3/sleep">Old version</a>; color added]</p></blockquote>
<p>Now it says:</p>
<blockquote><p><strong>sleep</strong>() makes the calling <font color="red">thread</font> sleep until <em>seconds</em> seconds have elapsed or a signal arrives which is not ignored. [<a href="http://www.kernel.org/doc/man-pages/online/pages/man3/sleep.3.html">New version</a>]</p></blockquote>
<p>Alas, they finally did the right thing &#8211; we have waited for at least 5 years. This change happened some time between versions 3.23 and 3.26.  </p>
<p>There is indeed no reason to use &#8220;process&#8221; anymore, at least since the emergence of Linux 2.6 and <a href="http://en.wikipedia.org/wiki/Native_POSIX_Thread_Library">NPTL</a>. As far as I know, this very sentence has confused many newbie Linux programmers who are not familiar with the history of Linux multithreading, and has led some to firmly believe there is no &#8220;real&#8221; thread or threads are actually processes under Linux, a statement which was probably right for the obsolete implementation <a href="http://en.wikipedia.org/wiki/LinuxThreads">LinuxThreads</a>, but definitely wrong today.</p>
<hr/><p>Related posts:<ol>
<li><a href='http://en.chys.info/2010/03/errno-as-thread-identifier/' rel='bookmark' title='&lt;code&gt;&amp;errno&lt;/code&gt; as thread identifier'><code>&amp;errno</code> as thread identifier</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://en.chys.info/2010/10/man-3-sleep/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Switch from syslog-ng to rsyslog</title>
		<link>http://en.chys.info/2010/07/switch-from-syslog-ng-to-rsyslog/</link>
		<comments>http://en.chys.info/2010/07/switch-from-syslog-ng-to-rsyslog/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 13:27:24 +0000</pubDate>
		<dc:creator>chys</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[syslog]]></category>

		<guid isPermaLink="false">http://en.chys.info/?p=821</guid>
		<description><![CDATA[I just think it is funny for a package as fundamental as system logger to depend on glib (part of the GTK+ project). (Of course, I don&#8217;t mean glib is a bad library. I&#8217;m not implying anything like that.) Of course there are other reasons, but they are less important: Many distributions also prefer rsyslog [...]<hr/>
No related posts.]]></description>
			<content:encoded><![CDATA[<p>I just think it is funny for a package as fundamental as system logger to depend on <a href="http://library.gnome.org/devel/glib/">glib</a> (part of the <a href="http://www.gtk.org/">GTK+</a> project). (Of course, I don&#8217;t mean glib is a bad library. I&#8217;m not implying anything like that.)</p>
<p>Of course there are other reasons, but they are less important:</p>
<ul>
<li>Many distributions also prefer rsyslog to syslog-ng because it&#8217;s more powerful and scalable. <a href="http://bugs.archlinux.org/task/12314?project=1">[1]</a> <a href="http://www.rsyslog.com/doc-rsyslog_ng_comparison.html">[2]</a></li>
<li>Several people complained against the performance of syslog-ng <a href="http://osdir.com/ml/sysutils.syslog-ng.announce/2004-09/msg00000.html">[3]</a>, although the performance of syslog is normally not an issue for individual users.</li>
<li>Third, I don&#8217;t understand why the author of syslog-ng prefers listening on <code>/dev/log</code> as a <a href="http://en.wikipedia.org/wiki/Stream_socket">stream socket</a> (<a href="http://en.wikipedia.org/wiki/Unix_domain_socket">local</a> counterpart of TCP) instead of a <a href="http://en.wikipedia.org/wiki/Datagram_socket">datagram one</a> (local counterpart of UDP). (I know it can be changed in the configuration file.) None of the common issues of UDP is present in local datagram sockets: too short length limit; out of order; unreliability. On the contrary, syslog needs unidirectional channels carrying boundary-maintained messages, for which nothing can be more suitable.</li>
<li>Finally, licensing issues, upstream responsiveness, etc. They are less important for individual users, though.</li>
</ul>
<p>Sure, syslog-ng also has its advantages. For example, I like the format of its configuration files.</p>
<hr/><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://en.chys.info/2010/07/switch-from-syslog-ng-to-rsyslog/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CPU Frequency Governor</title>
		<link>http://en.chys.info/2010/05/cpu-frequency-governor/</link>
		<comments>http://en.chys.info/2010/05/cpu-frequency-governor/#comments</comments>
		<pubDate>Fri, 21 May 2010 14:29:26 +0000</pubDate>
		<dc:creator>chys</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://en.chys.info/?p=812</guid>
		<description><![CDATA[Kernel documentation recommends &#8220;conservative&#8221; for laptops, citing latency reasons. However, Intel explicitly recommends &#8220;ondemand&#8221; in its powertop. So does at least one Intel kernel developer. OK. I have been using &#8220;conservative.&#8221; I decide to switch to &#8220;ondemand&#8221; from now on. Reference Related posts: gspca in Linux 2.6.27<hr/>
Related posts:<ol>
<li><a href='http://en.chys.info/2009/01/gspca-in-linux-2627/' rel='bookmark' title='gspca in Linux 2.6.27'>gspca in Linux 2.6.27</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.mjmwired.net/kernel/Documentation/cpu-freq/governors.txt">Kernel documentation</a> recommends &#8220;<a href="http://www.mjmwired.net/kernel/Documentation/cpu-freq/governors.txt#162">conservative</a>&#8221; for laptops, citing latency reasons.</p>
<p>However, Intel explicitly recommends &#8220;<a href="http://www.mjmwired.net/kernel/Documentation/cpu-freq/governors.txt#109">ondemand</a>&#8221; in its <a href="http://www.lesswatts.org/projects/powertop/">powertop</a>. So does at least <a href="http://www.bughost.org/pipermail/power/2007-May/000071.html">one Intel kernel developer</a>.</p>
<p>OK. I have been using &#8220;conservative.&#8221; I decide to switch to &#8220;ondemand&#8221; from now on.</p>
<p><a href="http://www.thinkwiki.org/wiki/How_to_make_use_of_Dynamic_Frequency_Scaling">Reference</a></p>
<hr/><p>Related posts:<ol>
<li><a href='http://en.chys.info/2009/01/gspca-in-linux-2627/' rel='bookmark' title='gspca in Linux 2.6.27'>gspca in Linux 2.6.27</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://en.chys.info/2010/05/cpu-frequency-governor/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>NULL can be a valid address</title>
		<link>http://en.chys.info/2010/04/null-can-be-a-valid-address/</link>
		<comments>http://en.chys.info/2010/04/null-can-be-a-valid-address/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 11:58:31 +0000</pubDate>
		<dc:creator>chys</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[memory]]></category>

		<guid isPermaLink="false">http://en.chys.info/?p=799</guid>
		<description><![CDATA[It is only a convention to consider NULL (0) as an invalid pointer. Technically, the operating system or hardware does not really care if a pointer is zero or not, although operating systems may restrict the use of valid null pointers as they may be a security hole. Consider this program: #include &#60;stdio.h&#62; #include &#60;sys/mman.h&#62; [...]<hr/>
Related posts:<ol>
<li><a href='http://en.chys.info/2009/07/null-pointer-to-member/' rel='bookmark' title='null pointer to member'>null pointer to member</a></li>
<li><a href='http://en.chys.info/2009/05/install-vs-cp-and-mmap/' rel='bookmark' title='install vs. cp; and mmap'>install vs. cp; and mmap</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>It is only a convention to consider <code>NULL</code> (0) as an invalid pointer. Technically, the operating system or hardware does not really care if a pointer is zero or not, although operating systems may restrict the use of valid null pointers as they may be a security hole.</p>
<p>Consider this program:</p>
<blockquote><pre>#include &lt;stdio.h&gt;
#include &lt;sys/mman.h&gt;

int main ()
{
    int *p = mmap (0, 4096, PROT_READ|PROT_WRITE,
        MAP_FIXED|MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
    *p = 2554;
    printf ("p=%p; *p=%d\n", p, *p);
    return 0;
}
</pre>
</blockquote>
<p>It attempts to make <code>NULL</code> (0) a valid address and then write to it. On Linux, it runs without error as <code>root</code>, but crashes as a normal user.</p>
<p>Note: Calling <code>mmap</code> with <code>NULL</code> as its first argument usually means the kernel will choose an address. However, if <code>MAP_FIXED</code> is also specified, it instead instructs the kernel to use the very address <code>0</code>. Only privileged processes are allowed to do so; a non-privileged process only gets <code>EPERM</code> (Permission denied).</p>
<p>This also explains why <code>MAP_FAILED</code> is equal to <code>(void *)-1</code> instead of <code>NULL</code>.</p>
<hr/><p>Related posts:<ol>
<li><a href='http://en.chys.info/2009/07/null-pointer-to-member/' rel='bookmark' title='null pointer to member'>null pointer to member</a></li>
<li><a href='http://en.chys.info/2009/05/install-vs-cp-and-mmap/' rel='bookmark' title='install vs. cp; and mmap'>install vs. cp; and mmap</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://en.chys.info/2010/04/null-can-be-a-valid-address/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Removed some distribution-specific patches</title>
		<link>http://en.chys.info/2010/03/removed-some-distribution-specific-patches/</link>
		<comments>http://en.chys.info/2010/03/removed-some-distribution-specific-patches/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 06:56:21 +0000</pubDate>
		<dc:creator>chys</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://en.chys.info/?p=783</guid>
		<description><![CDATA[With all due respect to Gentoo developers, I really hate the patches they made for coreutils, especially the one to have uname parse /proc/cpuinfo. The result is that uname -a displays more info, specifically the mode of the CPU, on Gentoo than other Linux distributions. Generally this is not a bad thing. But I do [...]<hr/>
No related posts.]]></description>
			<content:encoded><![CDATA[<p>With all due respect to Gentoo developers, I really hate the patches they made for <a href="http://www.gnu.org/software/coreutils/">coreutils</a>, especially the one to have <code><a href="http://linux.die.net/man/1/uname">uname</a></code> parse <code>/proc/cpuinfo</code>.</p>
<p>The result is that <code>uname -a</code> displays more info, specifically the mode of the CPU, on Gentoo than other Linux distributions. Generally this is not a bad thing. But I do have concerns:</p>
<p>(1) In my view the utility <code>uname</code> should remain a simple wrapper of the <a href="http://linux.die.net/man/2/uname">homonym system call</a>. If CPU/vendor info really needs to be returned by <code>uname</code>, it is better to add it to kernel. This is also part of the reason why upstream <a href="http://lists.gnu.org/archive/html/bug-coreutils/2005-09/msg00063.html">rejected</a> this patch.</p>
<p>(2) If I am used to finding CPU info from <code>uname</code>, I will likely forget the more orthodox method (<code>cat /proc/cpuinfo</code>). A job interviewer may not be that patient to listen to my explanation about the patch.</p>
<hr/><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://en.chys.info/2010/03/removed-some-distribution-specific-patches/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Extract Deb files from command line</title>
		<link>http://en.chys.info/2010/02/extract-deb-files/</link>
		<comments>http://en.chys.info/2010/02/extract-deb-files/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 16:15:12 +0000</pubDate>
		<dc:creator>chys</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://en.chys.info/?p=739</guid>
		<description><![CDATA[Debian and its derivatives use the .deb format to distribute their packages. To extract them, use ar &#8211; Yes, the very program we programmers use to make static libraries. ar x sudo_1.6.9p17-2_i386.deb Or we can directly extract things from data.tar.gz contained in the .deb file: ar p sudo_1.6.9p17-2_i386.deb data.tar.gz &#124; tar -xzf - No longer [...]<hr/>
Related posts:<ol>
<li><a href='http://en.chys.info/2010/12/concatenate-pdf-files-in-linux/' rel='bookmark' title='Concatenate PDF files in Linux'>Concatenate PDF files in Linux</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.debian.org">Debian</a> and its derivatives use the <code>.deb</code> format to distribute their packages. To extract them, use <code>ar</code> &#8211; Yes, the very program we programmers use to make static libraries.</p>
<blockquote><p><code>ar x sudo_1.6.9p17-2_i386.deb</code></p></blockquote>
<p>Or we can directly extract things from <code>data.tar.gz</code> contained in the <code>.deb</code> file:</p>
<blockquote><p><code>ar p sudo_1.6.9p17-2_i386.deb data.tar.gz | tar -xzf -</code></p></blockquote>
<p>No longer a user of Debian GNU/Linux, I still have to remember how to extract <code>.deb</code> files. I frequently need to cross-compile a 64-bit version of my program on a 32-bit system, and vice versa; but I don&#8217;t want to cross-compile by myself so many libraries on which my program depends. Instead, I find it a good idea to download a right <code>.deb</code> file from the <a href="http://www.debian.org/distrib/packages">Debian Packages Repository</a> and pick out the <code>.so</code> files.</p>
<hr/><p>Related posts:<ol>
<li><a href='http://en.chys.info/2010/12/concatenate-pdf-files-in-linux/' rel='bookmark' title='Concatenate PDF files in Linux'>Concatenate PDF files in Linux</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://en.chys.info/2010/02/extract-deb-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

