<?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>SIGTTOU &#187; Linux</title>
	<atom:link href="http://sigttou.com/category/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://sigttou.com</link>
	<description>Just another background process...</description>
	<lastBuildDate>Wed, 22 Dec 2010 00:12:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>On the fourth day of Christmas my true love gave to me&#8230; four CUDA tips&#8230;</title>
		<link>http://sigttou.com/four-cuda-tips</link>
		<comments>http://sigttou.com/four-cuda-tips#comments</comments>
		<pubDate>Wed, 22 Dec 2010 00:12:06 +0000</pubDate>
		<dc:creator>Bob Somers</dc:creator>
				<category><![CDATA[Adventures in GraphicsLand]]></category>
		<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://sigttou.com/?p=282</guid>
		<description><![CDATA[This post is from a blog called Adventures in GraphicsLand that I&#8217;m writing with two fellow CS grad students, Chris Gibson and Ryan Schmitt. Articles about anything related to my graduate work in graphics or my thesis will be posted &#8230; <a href="http://sigttou.com/four-cuda-tips">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong><em>This post is from a blog called <a href="http://aigfx.com">Adventures in GraphicsLand</a> that I&#8217;m writing with two fellow CS grad students, Chris Gibson and Ryan Schmitt. Articles about anything related to my graduate work in graphics or my thesis will be posted there and then cross-posted here. Articles about handy tips (like fixing bugs with VirtualBox or software setup on Fedora) will remain here. This post that I wrote for AIGFX, originally appeared <a href="http://www.aigfx.com/2010/12/four-cuda-tips/">here</a>.</em></strong></p>
<p>Learning CUDA has definitely been an interesting experience. As much as they make it sound like it&#8217;s simple to get started (and for the most part, it is), there are lots of little traps that can keep you frustrated for hours&#8230; or days. Here are four tips that stumped me during initial development of Haste (which is <a title="Haste on GitHub" href="https://github.com/cphaste/haste" target="_blank">now on GitHub</a>!) that might be helpful to you.</p>
<h3>Long running kernels on a desktop workstation</h3>
<p>In Linux, X&#8217;s driver watchdog will kill a process that leaves a driver hanging for too long, so to prevent that from happening you can&#8217;t launch a GPU kernel unless it returns within a couple milliseconds. (This happens in Windows, too, but I&#8217;m working mainly in Linux at the moment.) However, you might want to test kernels on your workstation. The way around this is to switch to a text-only terminal before running your CUDA program. On most Linux distributions, you can swap between terminals using Ctrl-Alt-F2 through Ctrl-Alt-F6, where each is a different terminal. If you hit Ctrl-Alt-F1 in Fedora 14, it will take you back to your X session (you&#8217;re still logged in and everything).</p>
<p>So, all you need to do is write code in your graphical desktop, compile, hit Ctrl-Alt-F2 to switch to a text-only terminal, then run your program for testing. When you want to go back to graphical mode to fix bugs, just Ctrl-Alt-F1 back and off you go.</p>
<h3>Slow device info queries</h3>
<p>If you&#8217;re doing doing development on a headless compute box (like our Tesla machine at Cal Poly), you might have noticed that querying device information takes a long time. This is compounded if it&#8217;s a multi-device machine. Our box at Poly has four Tesla GPUs, and Haste startup was frustratingly slow. All we did is query the device list once, then query each device individually using <code>cudaGetDeviceProperties()</code>. It usually take on the order of 30 to 45 seconds at program startup to get all the device information and allocate memory before we were off to the races launching kernels.</p>
<p>The problem is that the NVIDIA drivers normally maintain a lot of state about the GPUs in memory. However, this state is only there if there&#8217;s some resident process keeping it there, like X. If X is not running (or not even installed, like on our headless compute box), that state will need to get reinitialized every time you make a call that requires it. This can be excruciatingly slow, especially on multi-device machines.</p>
<p>The solution? Well, the easiest one is to just install and leave X running, even on a headless machine. Just make sure it&#8217;s not driving a display, or better yet switch it over to a text-only terminal with Ctrl-Alt-F2 to keep X around but not have it interfere with your kernels.</p>
<h3>Printing debug info in device kernels</h3>
<p>I must admit, while debuggers are neat, I tend to like <code>printf()</code> debugging. It&#8217;s not that I don&#8217;t see the value of debuggers; for some problems they&#8217;re really the only way to solve things. Maybe it has something do with the fact that <a title="cuda-gdb goes kaboom" href="http://forums.nvidia.com/index.php?s=91b8cd119e65d54ab921f4415fc4fcfc&amp;showtopic=188223" target="_blank">cuda-gdb inexplicably crashes</a> on every machine and kernel I try to run it on.</p>
<p>With the Fermi architecture, available in cards of compute capability 2.0 and higher, you can actually do <code>printf()</code>&#8216;s directly from your device code now, without having to jump through any strange library hoops. Initially, however, I was never able to get it to work. I couldn&#8217;t find which CUDA header I needed to include to get things off the ground, and even when it seemed to compile it didn&#8217;t print anything.</p>
<p>Well, it sounds silly, but just <code>#include &lt;stdio.h&gt;</code> and away you go. I never tried this initially because I thought that didn&#8217;t make any sense. The C standard library doesn&#8217;t have CUDA device code! The best I can tell, <code>nvcc</code> is rewriting these standard calls from device code behind the scenes.</p>
<h3>The device info&#8217;s maximumThreadsPerBlock lies!</h3>
<p>This one really irks me. If you query a device&#8217;s properties, it reports the maximum number of threads per block in a <code>cudaDeviceProp</code> struct member called, shockingly, <code>maxThreadsPerBlock</code>. The problem is that this is not the actual number of threads you can launch. That depends entirely on your kernel&#8217;s occupancy, which you can figure out using the difficult-to-find <a href="http://developer.download.nvidia.com/compute/cuda/3_2_prod/sdk/docs/CUDA_Occupancy_Calculator.xls" target="_blank">occupancy calculator spreadsheet</a>. You&#8217;ll also want to compile your kernel with the <code>nvcc</code> option <code>--ptxas-options=-v</code> to see the shared memory and register usage for your kernel. You&#8217;ll need it in the spreadsheet.</p>
<p>The occupancy limit doesn&#8217;t bug me so much as the fact that this is not mentioned anywhere in the documentation where <code>maxThreadsPerBlock</code> is mentioned. Once would think that would be a great place to throw up a warning flag, letting developers know that that number is purely speculative, and that they need to do some real benchmarking of their kernel to find the best occupancy and thread launch combination. Essentially, the <code>maxThreadsPerBlock</code> element is entirely superfluous, since it&#8217;s only real use would be in scaling kernel launch sizes by number of device threads available. However, instead we should apparently embed the Excel worksheet in our program and have the device properties chug through the macros to provide any runtime adjustments based on the hardware we&#8217;re running on. (&lt;/sarcasm&gt;) Yeesh.</p>
<p>Hopefully these tips help you out. As I continue to bang my head against the wall and find new tidbits I&#8217;ll be keeping track of them on my <a title="GitHub wiki" href="https://github.com/bobsomers/haste/wiki/Cuda-notes" target="_blank">GitHub wiki page</a>. Happy holidays!</p>
]]></content:encoded>
			<wfw:commentRss>http://sigttou.com/four-cuda-tips/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Murmur (Mumble server) on Fedora 13</title>
		<link>http://sigttou.com/murmur-fedora-13</link>
		<comments>http://sigttou.com/murmur-fedora-13#comments</comments>
		<pubDate>Sat, 09 Oct 2010 05:49:44 +0000</pubDate>
		<dc:creator>Bob Somers</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://sigttou.com/?p=242</guid>
		<description><![CDATA[Just a quick note if you&#8217;re finding yourself stumped when installing murmur (the server component of Mumble) via yum on Fedora 13. The version currently in the yum repositories has a broken init script, so if you try to sudo &#8230; <a href="http://sigttou.com/murmur-fedora-13">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Just a quick note if you&#8217;re finding yourself stumped when installing murmur (the server component of <a href="http://mumble.sourceforge.net/">Mumble</a>) via yum on Fedora 13.</p>
<p>The version currently in the yum repositories has a broken init script, so if you try to <code>sudo service murmur start</code> you&#8217;ll get all sorts of nasty errors. The version currently in updates-testing works great, though. Install it from there like so:</p>
<p><code>sudo yum --enablerepo=updates-testing install murmur</code></p>
<p>That should do it. If you still have problems, try installing the <code>redhat-lsb</code> and <code>qt-sqlite</code> packages and see if that helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://sigttou.com/murmur-fedora-13/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Make vim save files with Ctrl-s like Windows</title>
		<link>http://sigttou.com/vim-ctrl-s</link>
		<comments>http://sigttou.com/vim-ctrl-s#comments</comments>
		<pubDate>Sat, 25 Sep 2010 07:27:15 +0000</pubDate>
		<dc:creator>Bob Somers</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://sigttou.com/?p=227</guid>
		<description><![CDATA[Have you ever been working in vim over ssh and hit Ctrl-s by accident? This happens to folks who also work on Windows all the time, because Ctrl-s is the standard Windows keyboard shortcut for saving a file. What happens &#8230; <a href="http://sigttou.com/vim-ctrl-s">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Have you ever been working in vim over ssh and hit <code>Ctrl-s</code> by accident? This happens to folks who also work on Windows all the time, because <code>Ctrl-s</code> is the standard Windows keyboard shortcut for saving a file. What happens over ssh is that you issue a terminal stop command, and your ssh session appears to lock up.</p>
<p>The good news is, it&#8217;s not lost &mdash; just frozen. You can &#8220;unstop&#8221; the terminal by hitting <code>Ctrl-q</code>. Good as new! But we can do more&#8230;</p>
<p>If you&#8217;re a Windows user who ssh&#8217;s into *nix boxes frequently, we can actually make <code>Ctrl-s</code> in vim save the file like you&#8217;re intending. First, add the following to your <code>.bashrc</code> file to disable terminal stopping:</p>
<p><code>stty stop ''</code></p>
<p>You&#8217;ll notice that now the <code>Ctrl-s</code> doesn&#8217;t lock up vim anymore, but it doesn&#8217;t do anything yet. Let&#8217;s add that functionality now with two mappings in our <code>.vimrc</code> file.</p>
<p><code>map &lt;C-s&gt; :w&lt;CR&gt;<br />
imap &lt;C-s&gt; &lt;Esc&gt;:w&lt;CR&gt;i<br />
</code></p>
<p>Boom, done! Now when you hit <code>Ctrl-s</code> in vim, rather than locking up your terminal, it saves the file. In command mode, it just executes the traditional <code>:w</code> command, and in insert mode, it hits escape (to get to command mode), does the <code>:w</code>, and then hits &#8220;i&#8221; to get you back into insert mode where you left off.</p>
<p>I&#8217;m not a vim expert by any means, so if anyone has a better way to do it, I&#8217;m all ears.</p>
]]></content:encoded>
			<wfw:commentRss>http://sigttou.com/vim-ctrl-s/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Installing TrueType Fonts in Fedora</title>
		<link>http://sigttou.com/fedora-truetype-fonts</link>
		<comments>http://sigttou.com/fedora-truetype-fonts#comments</comments>
		<pubDate>Thu, 15 Apr 2010 03:06:46 +0000</pubDate>
		<dc:creator>Bob Somers</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://sigttou.com/?p=180</guid>
		<description><![CDATA[I&#8217;ve haven&#8217;t written recently because I was completely bogged down finishing up my Bachelors degree and applying to grad schools, but here&#8217;s a quick tip for those of you looking for a painless way to install third party TrueType fonts &#8230; <a href="http://sigttou.com/fedora-truetype-fonts">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve haven&#8217;t written recently because I was completely bogged down finishing up my Bachelors degree and applying to grad schools, but here&#8217;s a quick tip for those of you looking for a painless way to install third party TrueType fonts in Fedora. This may work in other Linux distros, but Fedora is my distro of choice so that&#8217;s why it&#8217;s used here.</p>
<p>If you need to install fonts accessible to all users on the system, you have to do some more complicated voodoo. I hate voodoo, so I&#8217;m not going to cover that.</p>
<p>If all you need is to install a font for your own user, it&#8217;s just this simple:</p>
<p>Put your <code>myfont.ttf</code> file in your home directory, under directory called <code>/.fonts/</code>. So in other words, your font lives at:</p>
<p><code>/home/youruser/.fonts/myfont.ttf</code></p>
<p>Create the directory if it doesn&#8217;t already exist. Finally, restart any application you want to use that font in, and you should see it show up. You&#8217;re good to go.</p>
]]></content:encoded>
			<wfw:commentRss>http://sigttou.com/fedora-truetype-fonts/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing the Fedora 12 VirtualBox Guest Additions problem</title>
		<link>http://sigttou.com/fedora12-virtualbox-fix</link>
		<comments>http://sigttou.com/fedora12-virtualbox-fix#comments</comments>
		<pubDate>Fri, 08 Jan 2010 05:26:30 +0000</pubDate>
		<dc:creator>Bob Somers</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://sigttou.com/?p=167</guid>
		<description><![CDATA[I&#8217;m a frequent VirtualBox user, and as I&#8217;ve noted in my previous posts, I&#8217;m an avid fan of Fedora as well. However, there is a nasty bug in the most recent version of VirtualBox (3.1.2) when combined with Fedora 12. &#8230; <a href="http://sigttou.com/fedora12-virtualbox-fix">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a frequent <a href="http://www.virtualbox.org/">VirtualBox</a> user, and as I&#8217;ve noted in my previous posts, I&#8217;m an avid fan of <a href="http://fedoraproject.org/">Fedora</a> as well.</p>
<p>However, there is a nasty bug in the most recent version of VirtualBox (3.1.2) when combined with Fedora 12. After installing the Guest Additions kernel modules <a href="http://www.virtualbox.org/manual/UserManual.html#id2507643">as per the user docs</a>, the system boots to a black screen with a cryptic error message that looks like a SELinux labeling problem (it&#8217;s not).</p>
<p><code>type=1305 audit(12587840002.571:32444): audit_enabled=0 old=1 auid=4294967295 ses=4294967295 subj=system_u:system_r:readahead_t:s0 res=1</code></p>
<p>The problem is actually with the Guest Additions video driver, the one that gives you the nice resizable desktop window. Once the driver is built and installed, for some reason the X server can&#8217;t find any screens and refuses to start.</p>
<p>Until the bug gets fixed in the video driver, here&#8217;s how you can fix the system so that it will boot correctly, although you&#8217;ll lose the dynamic resizing ability. You&#8217;ll have to stick with fixed, predefined resolutions for now.</p>
<ol>
<li>Mount a Fedora 12 ISO, such as the full or network install discs, and boot to it. Boot into Rescue Mode from the GRUB bootloader screen.</li>
<li>Breeze through the language and network options, but be sure to have it mount your hard disk image (it will mount under /mnt/sysimage).</li>
<li>Drop into a shell and change into your hard disk&#8217;s X11 config directory, so that would be:<br />
<code class="syntax bash">cd /mnt/sysimage/etc/X11</code></li>
<li>Edit your xorg.conf file&#8230; but wait! In Fedora 12, they switched to HAL for X configuration, so there is no xorg.conf file! Never fear, you just need to create one and it will override the HAL:<br />
<code class="syntax bash">vi xorg.conf</code></li>
<li>Now, use the following settings for the new xorg.conf file:
<pre>
Section "Device"
    Identifier "Configured Video Device"
    Driver "vboxvideo"
EndSection

Section "Monitor"
    Identifier "Configured Monitor"
EndSection

Section "Screen"
    Identifier "Configured Screen"
    Monitor "Configured Monitor"
    Device "Configured Video Device"
    SubSection "Display"
        Depth 24
        Modes "1440x900" "1680x1050"
    EndSubSection
EndSection

Section "InputDevice"
    Identifier "vboxmouse"
    Driver "vboxmouse"
    Option "CorePointer"
    Option "Device" "/dev/input/mice"
EndSection

Section "ServerLayout"
   Identifier   "Default Layout"
   Screen      "Configured Screen"   0 0
   InputDevice   "vboxmouse"
EndSection
</pre>
</li>
<li>You&#8217;ll see I&#8217;ve defined two resolutions, 1440&#215;900 and 1680&#215;1050. What this allows me to do is work windowed at 1440&#215;900 and if I want to go full screen (remember, dynamic resizing won&#8217;t work) I can hit the full screen shortcut in VirtualBox (Host+F) and change the resolution within Fedora to match my screen res.</li>
<li>Save from vi (<code>:wq</code>) and reboot the system. Remember to unmount the install disc! The system should boot correctly now, albeit without dynamic resizing.</li>
</ol>
<p>A huge thanks goes out to <a href="http://forums.virtualbox.org/viewtopic.php?f=7&#038;t=24851">Jits in the VirtualBox forums</a> for this fix!</p>
]]></content:encoded>
			<wfw:commentRss>http://sigttou.com/fedora12-virtualbox-fix/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>SSL detection by PHP scripts run through FastCGI on nginx</title>
		<link>http://sigttou.com/ssl-php-fastcgi-nginx</link>
		<comments>http://sigttou.com/ssl-php-fastcgi-nginx#comments</comments>
		<pubDate>Sat, 04 Jul 2009 00:53:59 +0000</pubDate>
		<dc:creator>Bob Somers</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://sigttou.com/?p=66</guid>
		<description><![CDATA[How&#8217;s that title for acronym soup? I ran across this issue when playing around with nginx. I was trying to set up phpMyAdmin for SQL administration, but ran into a rather peculiar issue. To explain the problem, let me give &#8230; <a href="http://sigttou.com/ssl-php-fastcgi-nginx">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>How&#8217;s that title for acronym soup?</p>
<p>I ran across this issue when playing around with <a href="http://wiki.nginx.org">nginx</a>. I was trying to set up <a href="http://www.phpmyadmin.net">phpMyAdmin</a> for SQL administration, but ran into a rather peculiar issue. To explain the problem, let me give you some context.</p>
<p>I&#8217;m running nginx only on port 443, using SSL for everything. As I&#8217;m going through the setup for phpMyAdmin, imagine my surprise when it alerts me that I&#8217;m not using an SSL connection. In fact, it&#8217;s impossible for me <strong>not</strong> to use SSL, because there&#8217;s no regular HTTP server running on port 80. I continued with the setup anyway, checking the ForceSSL option which requires all phpMyAdmin requests to be done over SSL. When I finished installing it and tried to log in, I got a Firefox error that it was stuck in a redirect loop.</p>
<p>Much Google searching later, I still couldn&#8217;t find the problem. This was when I remembered that PHP is configured differently on nginx that is typically done with Apache. With Apache, many people use the mod_php module that compiles PHP support directly into the server. With nginx, you generally process PHP requests using FastCGI.</p>
<p>I wondered if perhaps the fact that the connection was taking place over SSL wasn&#8217;t being passed through to the FastCGI process. If that was the case, the phpMyAdmin setup script wouldn&#8217;t know it was being invoked over HTTPS, and when you tried to log in it would try to forward you to the HTTPS url, which is the same page you had just requested. That would push you into an infite redirect loop.</p>
<p>In fact, that&#8217;s exactly what was happening. You can fix this with a simple addition to your nginx.conf file:</p>
<pre>server {
    listen 443;
    ... more config here, include SSL ...
    location ~ \.php$ {
        ... FastCGI config here ...
        fastcgi_param HTTPS on;
    }
}</pre>
<p>That <code>fastcgi_param HTTPS on;</code> line does the trick. Now the PHP script knows it&#8217;s being invoked over SSL and doesn&#8217;t try to infinitely redirect you. Awesome.</p>
]]></content:encoded>
			<wfw:commentRss>http://sigttou.com/ssl-php-fastcgi-nginx/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Fedora, you need some slimfast</title>
		<link>http://sigttou.com/fedora-slimfast</link>
		<comments>http://sigttou.com/fedora-slimfast#comments</comments>
		<pubDate>Wed, 01 Jul 2009 06:04:42 +0000</pubDate>
		<dc:creator>Bob Somers</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://sigttou.com/?p=51</guid>
		<description><![CDATA[Let me get this out of the way up front. I absolutely love Fedora to death. It&#8217;s my favorite distribution of linux by far, and I&#8217;ve played with a lot of different distros. I love the way way it works, &#8230; <a href="http://sigttou.com/fedora-slimfast">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Let me get this out of the way up front. <strong>I absolutely love <a href="http://fedoraproject.org">Fedora</a> to death.</strong></p>
<p>It&#8217;s my favorite distribution of linux by far, and I&#8217;ve played with a lot of different distros. I love the way way it works, I love how it&#8217;s on the bleeding edge, I love how things are laid out and they just make sense. I love the massive repository of almost every piece of software I want to run right at my fingertips. I love being able to type</p>
<pre># yum install package</pre>
<p>and it just works. Absolutely fantastic. I&#8217;ve been a user since Fedora Core 3, and the team just pushed out version 11. Good job, guys.</p>
<p>But there&#8217;s one thing nagging me about the distro. I almost never notice it, but I&#8217;ve been running a lot fresh installs of Fedora lately, so it&#8217;s become pretty obvious to me. <strong>If she asks me if she looks fat in her Leonidas dress, I&#8217;m going to be honest and say yes.</strong></p>
<p>Now let&#8217;s give it a fair shake here, it is, after all, a distro designed for <em>desktop use</em>. It&#8217;s aimed to be usable to folks who might be trying linux for the first time, and it&#8217;s stellar for that. But that comes at an expense to us power users on occasion.</p>
<p>About half the time or more I use it as a GUI-less server, so I&#8217;ll be the first to admit I&#8217;m probably using the wrong tool for the job, but I just can&#8217;t give it up. She makes a great server distro too&#8230;</p>
<p><strong>Except for the fat.</strong></p>
<p>I just did a fresh install of Fedora 11, and I challenged myself to configure it with the absolutely minimal set of packages I needed. No desktops, no windowing system, no crazy text-based packages either. I unchecked all the unnecessary WiFi drivers (all of them, I don&#8217;t have wireless on this machine) and really slimmed it down to the bare, bare essentials.</p>
<p>Or so I thought&#8230; it still installed a whopping <strong>600 packages</strong> and takes up almost <strong>2 gigs </strong>worth of space. I realize 2 gigs might seem like a small number, but I&#8217;m provisioning an old box that uses a 20 GB hard drive. I&#8217;d like to see a ~500 MB install rather than have it take up 10% of the disk for the OS alone.</p>
<p>As the package installs were flying by, I tried to get a glimpse of what on earth was taking up so much space. One package that caught my attention was the Leonidas wallpaper pack. Really Fedora? I didn&#8217;t even install a desktop or windowing system and you&#8217;re installing wallpapers? <strong>What am I going to use those for?</strong></p>
<p>My guess is that they&#8217;re just standard packages included with every installation, but that doesn&#8217;t make much since if it offers me the ability to install without a desktop or X Windows. Perhaps some more intelligent package sorting is in order.</p>
<p>Thankfully I&#8217;m not the only one that&#8217;s noticed.</p>
<p>One of the planned features for Fedora 11 was a new <a href="https://fedoraproject.org/wiki/Features/MinimalPlatform">Minimal Platform</a>, which would install the bare minimum package set to get up and running, allowing you to bring up exactly what you needed with yum. When I originally read about it, I was ecstatic.</p>
<p>But alas, after realizing how much package culling it would require, dispute over where the option should appear in Anaconda (the graphical installer), and a general feeling that it wasn&#8217;t critical, it was pushed to Fedora 12.</p>
<p>Crap.</p>
<p>I guess I&#8217;ll stick with her&#8230; for now. Maybe I&#8217;ll hit the gym and see if she gets the hint. It&#8217;s just not good for your health Fedora, you&#8217;ve gotta drop some of that heft.</p>
]]></content:encoded>
			<wfw:commentRss>http://sigttou.com/fedora-slimfast/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using a file as input for iptables-restore</title>
		<link>http://sigttou.com/file-input-iptables-restore</link>
		<comments>http://sigttou.com/file-input-iptables-restore#comments</comments>
		<pubDate>Thu, 25 Jun 2009 07:12:01 +0000</pubDate>
		<dc:creator>Bob Somers</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://sigttou.com/?p=32</guid>
		<description><![CDATA[I deal with headless linux boxes a lot, and one of the first things you always want to do is configure your firewall. The general rule of thumb says to deny all traffic and only poke holes where you need &#8230; <a href="http://sigttou.com/file-input-iptables-restore">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I deal with headless linux boxes a lot, and one of the first things you always want to do is configure your firewall. The general rule of thumb says to deny all traffic and only poke holes where you need them. It&#8217;s an awful pain to configure iptables one rule at a time from the command line. It&#8217;s also a pain if you need to open one more port before that deny-all at the end of a chain, because that involves running through the whole chain again.</p>
<p>Now there&#8217;s probably some clever &#8220;iptables ninja&#8221; way to do it, but I prefer simplicity, so I use the <code>iptables-save</code> and <code>iptables-restore</code> commands. The first will dump your current firewall rules to standard out. The second will read rules from standard in into the firewall table.</p>
<p>For reference, my distro of choice is <a href="http://www.fedoraproject.org">Fedora</a>, so these commands are Red-Hat-centric.</p>
<p>Using <code>iptables-save</code> to dump your rules to a file is simple enough. Just redirect standard out to a file. Don&#8217;t forget to run it as root.</p>
<pre># sudo iptables-save &gt; ./firewall.rules</pre>
<p>Open up that file in vim (or a less worthy text editor&#8230; take that emacs!) and you&#8217;ll see it&#8217;s just a list of iptables commands. Perfect. Just drop in the new rule where you wanted it.</p>
<p>Reloading the firewall table from this file is a little more tricky, though. Specifically, iptables-restore takes input from standard input, but mysteriously doesn&#8217;t work when you redirect standard in from a file with the <code>&lt;</code> redirector.</p>
<p>The solution? <strong>Call the plumber!</strong> Using the piped output from <code>cat</code> works just fine. Don&#8217;t forget to flush the firewall rules before you read them in again, and run both the iptables commands as root.</p>
<pre># sudo iptables -F
# cat ./firewall.rules | sudo iptables-restore</pre>
<p>Now double check to make sure that the firewall configuration is really what you think it is.</p>
<pre># sudo iptables -L</pre>
<p>Lastly, save the firewall configuration so that it persists after a reboot. If you skip this step, your old configuration will come back when the iptables service starts next time.</p>
<pre># sudo service iptables save</pre>
<p>For good measure, I always like to restart the iptables service to verify that it will come back up using the config that I expect.</p>
<pre># sudo service iptables restart
# sudo iptables -L</pre>
<p>All done! Not to painful, right? This is also a great way to backup your firewall config. If anything bad happens, you need to reinstall iptables, or you&#8217;re provisioning a duplicate server, just run the back half of this process with <strong>iptables-restore</strong> and your backed up <em>firewall.rules</em> file.</p>
]]></content:encoded>
			<wfw:commentRss>http://sigttou.com/file-input-iptables-restore/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

