<?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>Chaos Engine &#187; Unix</title>
	<atom:link href="http://dev.modmancer.com/index.php/category/unix/feed/" rel="self" type="application/rss+xml" />
	<link>http://dev.modmancer.com</link>
	<description>Sometimes I drink to forget.. but then I forget to drink..</description>
	<lastBuildDate>Mon, 06 Feb 2012 16:11:00 +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>Crossplatform QueryPerformanceTimer</title>
		<link>http://dev.modmancer.com/index.php/2010/09/26/crossplatform-queryperformancetimer/</link>
		<comments>http://dev.modmancer.com/index.php/2010/09/26/crossplatform-queryperformancetimer/#comments</comments>
		<pubDate>Sun, 26 Sep 2010 10:25:32 +0000</pubDate>
		<dc:creator>akiko</dc:creator>
				<category><![CDATA[BSD]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[Win32]]></category>
		<category><![CDATA[QueryPerformanceTimer]]></category>

		<guid isPermaLink="false">http://dev.modmancer.com/?p=101</guid>
		<description><![CDATA[Here is a simple way to get high precision timer on both Linux and Windows (can&#8217;t remember where I saw parts of this code, but I hope wrapping it up and spreading it won&#8217;t make the author angry) : cross_platform_timer.h cross_platform_timer.cpp I added few helper wrappers to make the life easier, you can get current [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a simple way to get high precision timer on both Linux and Windows (can&#8217;t remember where I saw parts of this code, but I hope wrapping it up and spreading it won&#8217;t make the author angry) :</p>
<p><a href="http://www.modmancer.com/downloads/dev_blog/cross_platform_timer.h">cross_platform_timer.h</a><br />
<a href="http://www.modmancer.com/downloads/dev_blog/cross_platform_timer.cpp">cross_platform_timer.cpp</a></p>
<p>I added few helper wrappers to make the life easier, you can get current time in microseconds or milliseconds by calling:</p>
<pre>//! Returns current time in milisecs or microsecs.

//! \param micro Returns micro seconds if set to true.
double timer_get(bool micro = false);</pre>
<p>Or you can get elapsed time by calling:</p>
<pre name="code" class="html">timer_start();

// Your code here..

// Get elapsed time in milliseconds.
double dt = timer_stop();</pre>
]]></content:encoded>
			<wfw:commentRss>http://dev.modmancer.com/index.php/2010/09/26/crossplatform-queryperformancetimer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Resurrect NTFS partition after Win XP reinstall</title>
		<link>http://dev.modmancer.com/index.php/2010/06/09/resurrect-ntfs-partition-after-win-xp-reinstall/</link>
		<comments>http://dev.modmancer.com/index.php/2010/06/09/resurrect-ntfs-partition-after-win-xp-reinstall/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 21:19:23 +0000</pubDate>
		<dc:creator>akiko</dc:creator>
				<category><![CDATA[Hard drive]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[hard disk]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[lost partition]]></category>
		<category><![CDATA[ntfs]]></category>
		<category><![CDATA[partition]]></category>
		<category><![CDATA[reinstallation]]></category>
		<category><![CDATA[resurrect]]></category>
		<category><![CDATA[salvage]]></category>
		<category><![CDATA[testdisk]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[windows xp]]></category>

		<guid isPermaLink="false">http://dev.modmancer.com/?p=54</guid>
		<description><![CDATA[The system was missing my partition E, or my Storage partition. It was wiped out. Storage manager denoted it as unallocated space. A quick reboot into Ubuntu ended up with same knowledge: Unallocated space.

No space for panic. Google comes, google helps. I found a marvelous little command line tool which was able to revamp my Storage NTFS partition in about 10 seconds. It's called testdisk.]]></description>
			<content:encoded><![CDATA[<p>Another unpleasant experience with windows last week. (We&#8217;ll just disregard the notorious behaviour of Win installer which eradicates any previously installed foreign OS boot manager.)</p>
<p><span id="more-54"></span>I have Ubuntu 10.04 and WinXP SP3 multiboot. I have 3 partitions:</p>
<p>1) NTFS, WinXP (defunct)<br />
2) ReiserFS (+ extra swap partition) Ubuntu<br />
3) NTFS, Storage (lots of my windows projects stored there)</p>
<p>Few days ago, my WinXP stopped working, no way to boot it, something went so terribly wrong, and from the previous long year experience with windows I could simply sense when the time for total reinstall has come. Since I have started with Ubuntu 9.04 my GRUB was the legacy mode GRUB, so I prepared an Ubuntu 9.04 live cd to be able to reinstall GRUB after installing WinXP, and naturally: I though I was ready for the operation.</p>
<p>I booted from the Windows XP SP3 installation DVD, selected partition C (NTFS) to be reformatted and chosen as destination. Everything went smooth, C was erased, new Windows appeared on it, I rebooted the computer, and was happy to see that everything is there..</p>
<p>Or at least I thought so.</p>
<p>The system was missing my partition E, or my Storage partition. It was wiped out. Storage manager denoted it as unallocated space. A quick reboot into Ubuntu ended up with same knowledge: Unallocated space.</p>
<p>No space for panic. Google comes, google helps. I found a marvelous little command line tool which was able to revamp my Storage NTFS partition in about 10 seconds. It&#8217;s called <strong>testdisk</strong>.</p>
<p>Open your synaptic, type testdisk, install it.</p>
<p>Open terminal, type<br />
&lt;pre&gt;<br />
$ sudo testdisk<br />
&lt;/pre&gt;</p>
<p>1) Now on the first screen select [ Create ] ( Create a new log file ).<br />
2) From listed hard discs select the one that you need to salvage. Then [Proceed].<br />
3) Then [Continue].<br />
4) Then [Intel] &#8211; this works in most cases, but if you have some other exotic partition types, you can tell testdisk which one it is on this screen.<br />
5) Then [Analyse].<br />
6) Then [Quick Search] &#8211; this will do most of the time. But if corruption was more severe, you might need to select another round of &#8216;deeper search&#8217;.<br />
7) On the next screen select Vista [Y/N] &#8211; N, if you used WinXP to create the controversial partition.<br />
8) &#8212; disregard the stupid smiley &#8211;  Now you will see all partitions that testdisk was able to identify. Press Enter (continue).<br />
9) Ok finally &#8211; if you are happy with the results, ie. you see your lost partition in the list, select  [ Write ] and reboot (you will be informed about that on the next screen anyway). But if testdisk wasn&#8217;t able to dig out the lost partition, then select [ Deeper Search ].</p>
<p>It saved my night. And a lot of data. I think this tool exists for windows as well. Check it out, remember it. It will come handy sooner or later!</p>
<p>[EDIT]<br />
Yep, TestDisk runs on several platforms &#8211; check it out:<br />
<a href="http://www.cgsecurity.org/wiki/TestDisk">http://www.cgsecurity.org/wiki/TestDisk</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.modmancer.com/index.php/2010/06/09/resurrect-ntfs-partition-after-win-xp-reinstall/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grep intelligence &#8211; grep lines that DO NOT MATCH an expression</title>
		<link>http://dev.modmancer.com/index.php/2010/05/13/grep-intelligence-grep-lines-that-do-not-match-an-expression/</link>
		<comments>http://dev.modmancer.com/index.php/2010/05/13/grep-intelligence-grep-lines-that-do-not-match-an-expression/#comments</comments>
		<pubDate>Thu, 13 May 2010 11:24:34 +0000</pubDate>
		<dc:creator>akiko</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[regexp]]></category>
		<category><![CDATA[regular expression]]></category>
		<category><![CDATA[tail]]></category>

		<guid isPermaLink="false">http://dev.modmancer.com/?p=28</guid>
		<description><![CDATA[I have an apache access log that I need to monitor frequently while users do funny things, but the problem is 99% of the logged calls are some trivial ajax get requests which do stuff, like &#8216;check new messages&#8217; which, when coming in from each user who has opened the page each second, tend to [...]]]></description>
			<content:encoded><![CDATA[<p>I have an apache access log that I need to monitor frequently while users do funny things, but the problem is 99% of the logged calls are some trivial ajax get requests which do stuff, like &#8216;check new messages&#8217; which, when coming in from each user who has opened the page each second, tend to flood my shell.</p>
<p>In order to filter them out I use tail + grep combo:</p>
<pre>tail -f yourapache.log | grep -v ('controller\/check')</pre>
<p>This will effectively filter out all *controller/check* calls.</p>
<p>Flag -v in grep manual says: Output only lines which do NOT match</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.modmancer.com/index.php/2010/05/13/grep-intelligence-grep-lines-that-do-not-match-an-expression/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

