<?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>Megalinux</title>
	<atom:link href="http://www.megalinux.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.megalinux.net</link>
	<description>Just another sysadmin's blog</description>
	<lastBuildDate>Tue, 01 Feb 2011 22:32:12 +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>Compiling Varnish/Varnishtop: Issue with do_curses</title>
		<link>http://www.megalinux.net/compiling-varnishvarnishtop-issue-with-do_curses/</link>
		<comments>http://www.megalinux.net/compiling-varnishvarnishtop-issue-with-do_curses/#comments</comments>
		<pubDate>Mon, 29 Nov 2010 15:20:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.megalinux.net/?p=161</guid>
		<description><![CDATA[When compiling varnishtop (and other tools) on RHEL/CentOS 5, I came across the following issue: varnishtop.o: In function `do_curses': /tmp/varnish-2.1.4/bin/varnishtop/varnishtop.c:223: undefined reference to `initscr' /tmp/varnish-2.1.4/bin/varnishtop/varnishtop.c:224: undefined reference to `raw' /tmp/varnish-2.1.4/bin/varnishtop/varnishtop.c:225: undefined reference to `noecho' /tmp/varnish-2.1.4/bin/varnishtop/varnishtop.c:226: undefined reference to `nonl' /tmp/varnish-2.1.4/bin/varnishtop/varnishtop.c:227: undefined reference to `stdscr' ...... ...... collect2: ld returned 1 exit status make: *** [varnishtop] [...]]]></description>
			<content:encoded><![CDATA[<p>When compiling varnishtop (and other tools) on RHEL/CentOS 5, I came across the following issue:<br />
<code><br />
varnishtop.o: In function `do_curses':<br />
/tmp/varnish-2.1.4/bin/varnishtop/varnishtop.c:223: undefined reference to `initscr'<br />
/tmp/varnish-2.1.4/bin/varnishtop/varnishtop.c:224: undefined reference to `raw'<br />
/tmp/varnish-2.1.4/bin/varnishtop/varnishtop.c:225: undefined reference to `noecho'<br />
/tmp/varnish-2.1.4/bin/varnishtop/varnishtop.c:226: undefined reference to `nonl'<br />
/tmp/varnish-2.1.4/bin/varnishtop/varnishtop.c:227: undefined reference to `stdscr'<br />
......<br />
......<br />
collect2: ld returned 1 exit status<br />
make: *** [varnishtop] Error 1<br />
</code></p>
<p>The issue seems to be with the ncurses library that comes with the standard distribution. So, I installed the ncurses-5.7 libs from source, using:<br />
<code>./configure --with-shared --with-debug --enable-overwrite --with-termlib</code></p>
<p>and then recompiling/building varnish/varnishtop.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.megalinux.net/compiling-varnishvarnishtop-issue-with-do_curses/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CPU/Processor information in Linux</title>
		<link>http://www.megalinux.net/cpuprocessor-information-in-linux/</link>
		<comments>http://www.megalinux.net/cpuprocessor-information-in-linux/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 01:04:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.megalinux.net/?p=152</guid>
		<description><![CDATA[Finding Physical Processors: $ grep 'physical id' /proc/cpuinfo &#124; sort &#124; uniq &#124; wc -l Finding Virtual Processors $ grep ^processor /proc/cpuinfo &#124; wc -l Finding CPU cores $ grep 'cpu cores' /proc/cpuinfo &#8220;2&#8243; indicates the two physical processors are dual-core, resulting in 4 virtual processors. If &#8220;1&#8243; was returned, the two physical processors are [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Finding Physical Processors:</strong><br />
<code>$ grep 'physical id' /proc/cpuinfo | sort | uniq | wc -l</code></p>
<p><strong>Finding Virtual Processors</strong><br />
<code>$ grep ^processor /proc/cpuinfo | wc -l</code></p>
<p><strong>Finding CPU cores</strong><br />
<code>$ grep 'cpu cores' /proc/cpuinfo</code></p>
<p>&#8220;2&#8243; indicates the two physical processors are dual-core, resulting in 4 virtual processors.<br />
If &#8220;1&#8243; was returned, the two physical processors are single-core.</p>
<p>If the processors are single-core, and the number of virtual processors is greater than the number of physical processors, the CPUs are using hyper-threading.</p>
<p><strong>Finding CPU Arch</strong><br />
<code>$ grep flags /proc/cpuinfo | uniq | egrep -o -w "rm|tm|lm"</code></p>
<p>Under &#8220;Flags&#8221; section in /proc/cpuinfo, you will find any of the flags &#8220;tm&#8221; or<br />
&#8220;rm&#8221; or &#8220;lm&#8221;</p>
<ul>
<li>rm (Real Mode) means it is a 16 bit processor</li>
<li>tm (Transparent Mode) means it is a 32 bit processor</li>
<li>lm (Long Mode) means it is a 64 bit processor</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.megalinux.net/cpuprocessor-information-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redirecting non-www requests to www using rewriterule</title>
		<link>http://www.megalinux.net/redirecting-non-www-requests-to-www-using-rewriterule/</link>
		<comments>http://www.megalinux.net/redirecting-non-www-requests-to-www-using-rewriterule/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 00:13:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.megalinux.net/?p=148</guid>
		<description><![CDATA[RewriteEngine on RewriteCond %{HTTP_HOST} !^www.your_domain.com$ RewriteRule ^(.*)$ http://www.your_domain.com/$1 [R=301]]]></description>
			<content:encoded><![CDATA[<p><code><br />
RewriteEngine on<br />
RewriteCond %{HTTP_HOST} !^www.your_domain.com$<br />
RewriteRule ^(.*)$ http://www.your_domain.com/$1 [R=301]<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.megalinux.net/redirecting-non-www-requests-to-www-using-rewriterule/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Piwik Mediawiki Extension</title>
		<link>http://www.megalinux.net/piwik-mediawiki-extension/</link>
		<comments>http://www.megalinux.net/piwik-mediawiki-extension/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 19:58:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.megalinux.net/?p=143</guid>
		<description><![CDATA[Piwik(http://piwik.org/) is open source self-hostable web analytics tool (like omniture or  google analytics). To integrate piwik with mediawiki, I customized the existing Google Analytics mediawiki plugin (http://www.mediawiki.org/wiki/Extension:Google_Analytics_Integration) to work with piwik. To include the extension in your wiki, unzip the file, and deploy the piwik.php extension file into WIKI_INSTALL_DIR/extensions/. Then include the file in your [...]]]></description>
			<content:encoded><![CDATA[<p>Piwik(http://piwik.org/) is open source self-hostable web analytics tool (like omniture or  google analytics). To integrate piwik with mediawiki, I customized the existing Google Analytics mediawiki plugin (<a href="http://www.mediawiki.org/wiki/Extension:Google_Analytics_Integration">http://www.mediawiki.org/wiki/Extension:Google_Analytics_Integration</a>) to work with piwik. To include the extension in your wiki,<br />
unzip the file, and deploy the piwik.php extension file into WIKI_INSTALL_DIR/extensions/. Then include the file in your LocalSettings.php, using:<br />
<code><br />
require_once("extensions/piwik.php");<br />
</code></p>
<p>Download <a title="Piwik" href="http://www.megalinux.net/wp-content/uploads/2009/12/piwik.zip" target="_blank">piwik extension</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.megalinux.net/piwik-mediawiki-extension/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solution: received end packet from server, apparent master shutdown</title>
		<link>http://www.megalinux.net/solution-received-end-packet-from-server-apparent-master-shutdown/</link>
		<comments>http://www.megalinux.net/solution-received-end-packet-from-server-apparent-master-shutdown/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 20:51:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://www.megalinux.net/?p=136</guid>
		<description><![CDATA[If you are getting the below error in your mysql (slave) logs: 090723 21:46:40 [Note] Slave: received end packet from server, apparent master shutdown: 090723 21:46:40 [Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'mysql-bin.000012' at postion 106 Then, it means the slave is sharing an ID with another slave/node in [...]]]></description>
			<content:encoded><![CDATA[<p>If you are getting the below error in your mysql (slave) logs:<br />
<code>090723 21:46:40 [Note] Slave: received end packet from server, apparent master shutdown:<br />
090723 21:46:40 [Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'mysql-bin.000012' at postion 106</code></p>
<p>Then, it means the slave is sharing an ID with another slave/node in the replication setup. Check the server ID to make sure it is unique.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.megalinux.net/solution-received-end-packet-from-server-apparent-master-shutdown/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solution: Dell XPS M1530 Ubuntu 8.10 System Freeze Issue</title>
		<link>http://www.megalinux.net/solution-dell-xps-m1530-ubuntu-810-system-freeze-issue/</link>
		<comments>http://www.megalinux.net/solution-dell-xps-m1530-ubuntu-810-system-freeze-issue/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 16:35:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[8.10]]></category>
		<category><![CDATA[9.04]]></category>
		<category><![CDATA[Blinking lights]]></category>
		<category><![CDATA[Freeze]]></category>
		<category><![CDATA[Wifi]]></category>
		<category><![CDATA[Wireless]]></category>
		<category><![CDATA[Wirless N]]></category>

		<guid isPermaLink="false">http://www.megalinux.net/?p=119</guid>
		<description><![CDATA[When using Ubuntu 8.10 and connecting to a Wireless-n (802.11n) network, the system freezes with kernel panic (as indicated by blinking scroll and numlock). The system gets unusable and you would have to reboot. I have had this issue with my Dell XPS M1530, when connecting to Apple Extreme router. The issue with the intel [...]]]></description>
			<content:encoded><![CDATA[<p>When using Ubuntu 8.10 and connecting to a Wireless-n (802.11n) network, the system freezes with kernel panic (as indicated by blinking scroll and numlock). The system gets unusable and you would have to reboot. I have had this issue with my Dell XPS M1530, when connecting to Apple Extreme router.</p>
<p>The issue with the intel wireless module driver, and will get fixed by installing the compat-wireless driver.</p>
<p>Try compiling this iwlagn module, <a rel="nofollow" href="http://www.orbit-lab.org/kernel/compat-wireless-2.6/2008/10/compat-wireless-2008-10-01.tar.bz2">http://www.orbit-lab.org/kernel/compat-wireless-2.6/2008/10/compat-wireless-2008-10-01.tar.bz2</a> .<br />
Extract the archive and then follow these steps:</p>
<pre>sudo apt-get install build-essential
cd compat*
make
sudo make install</pre>
<p>Reboot the system, and you will not longer face kernel panic or system freeze.</p>
<p><strong>UPDATE:</strong></p>
<p>When installing 9.04, I figured out that 802.11N drivers for Ubuntu are totally broken. Since I did not want to fiddle around much, I added the following lines to /etc/modprobe.d/options(and restart the system):</p>
<pre>options iwlagn 11n_disable=1</pre>
<p>This would prevent Wireless-N mode, but it will get your Dell M1530 (and M1330) working on Wireless with Ubuntu</p>
]]></content:encoded>
			<wfw:commentRss>http://www.megalinux.net/solution-dell-xps-m1530-ubuntu-810-system-freeze-issue/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Using iTerm with Elasticfox on OS X</title>
		<link>http://www.megalinux.net/using-iterm-with-elasticfox-on-os-x/</link>
		<comments>http://www.megalinux.net/using-iterm-with-elasticfox-on-os-x/#comments</comments>
		<pubDate>Sat, 07 Feb 2009 21:55:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.megalinux.net/using-iterm-with-elasticfox-on-os-x/</guid>
		<description><![CDATA[Elasticfox plugin for firefox on OS X uses Terminal.app by default(to SSH into the EC2 instances). If you would like to use iTerm instead of Terminal.app: 1. Create a script (say ec2-ssh.osascript) in your home directory. This is an applescript. on run argv tell application "iTerm" activate set cmd to "ssh -i " &#038; item [...]]]></description>
			<content:encoded><![CDATA[<p>Elasticfox plugin for firefox on OS X uses Terminal.app by default(to SSH into the EC2 instances). If you would like to use iTerm instead of Terminal.app:</p>
<p>1. Create a script (say ec2-ssh.osascript) in your home directory. This is an applescript.</p>
<pre>
on run argv
  tell application "iTerm"
    activate
    set cmd to "ssh -i " &#038; item 1 of argv &#038; " " &#038; item 2 of argv
    set myterm to the last terminal
    tell myterm
      launch session "Default Session"
      tell the last session
        write text the cmd
      end tell
    end tell
  end tell
end run
</pre>
<p>2. Edit ElasticFox properties. It should look like the following:</p>
<p>
<img src="http://www.megalinux.net/wp-content/uploads/2009/02/capture-1.png" width="480" height="337" alt="capture 1.png" </p>
<p>So, every time you try to SSH, it would use iTerm instead of Terminal.app</p>
]]></content:encoded>
			<wfw:commentRss>http://www.megalinux.net/using-iterm-with-elasticfox-on-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Tcpdump for MySQL query logging</title>
		<link>http://www.megalinux.net/using-tcpdump-for-mysql-query-logging/</link>
		<comments>http://www.megalinux.net/using-tcpdump-for-mysql-query-logging/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 19:54:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Query]]></category>
		<category><![CDATA[TCPDUMP]]></category>

		<guid isPermaLink="false">http://www.megalinux.net/?p=117</guid>
		<description><![CDATA[If you are a privileged user (i.e. root), you can use tcpdump on a database server to take a peek into a network stream and filter for packets that go to MySQL. Those packets contain queries. Here&#8217;s a quick one-liner : # tcpdump -i eth0 -s 0 -l -w - dst port 3306 &#124; strings [...]]]></description>
			<content:encoded><![CDATA[<p>If you are a privileged user (i.e. root), you can use tcpdump on a database server to take a peek into a network stream and filter for packets that go to MySQL. Those packets contain queries. Here&#8217;s a quick one-liner :<br />
<code> # tcpdump -i eth0 -s 0 -l -w - dst port 3306 | strings | perl -e '<br />
while(&lt;&gt;) { chomp; next if /^[^ ]+[ ]*$/;<br />
if(/^(SELECT|UPDATE|DELETE|INSERT|SET|COMMIT|ROLLBACK|CREATE|DROP|ALTER)/i) {<br />
if (defined $q) { print "$qn"; }<br />
$q=$_;<br />
} else {<br />
$_ =~ s/^[ t]+//; $q.=" $_";<br />
}<br />
}'</code></p>
<p><font size="-2">Thanks to: http://www.mysqlperformanceblog.com/2008/11/07/poor-mans-query-logging/ </font></p>
]]></content:encoded>
			<wfw:commentRss>http://www.megalinux.net/using-tcpdump-for-mysql-query-logging/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>mod_fcgid: can&#8217;t apply process slot</title>
		<link>http://www.megalinux.net/mod_fcgid-cant-apply-process-slot/</link>
		<comments>http://www.megalinux.net/mod_fcgid-cant-apply-process-slot/#comments</comments>
		<pubDate>Tue, 23 Sep 2008 12:11:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[mod_fcgid Rails Ruby]]></category>

		<guid isPermaLink="false">http://www.megalinux.net/?p=109</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>It turns out that FastCGI (and I think both for mod_fastcgi and mod_fcgid) doesn&#8217;t play well with many of the default Linux setups. fcgid sets up a directory in /var/log/httpd/fcgidsock (mod_fastcgi may be a slightly different directory). The problem is not that the permissions are wrong, but that the permissions of the parent directory are wrong. More to the point, the permissions of the parent directory are made for standard Linux security purposes, not for the purposes of running FastCGI.</p>
<p>The fix is simple. In my case it was a simple chmod 755 /var/log/httpd, which allows Apache to actually read its log directory! Before the change, I was getting &#8220;Service Unavailable&#8221; with a log error of [warn] mod_fcgid: can&#8217;t apply process slot for [dispatch.fcgi full path]. Now it works!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.megalinux.net/mod_fcgid-cant-apply-process-slot/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Screenshot Shortcuts in Mac OS X</title>
		<link>http://www.megalinux.net/screenshot-shortcuts-in-mac-os-x/</link>
		<comments>http://www.megalinux.net/screenshot-shortcuts-in-mac-os-x/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 09:27:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://www.megalinux.net/?p=108</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<li>Command-Shift-3: Take a screenshot of the screen, and save it as a file on the desktop
<li>Command-Shift-4, then select an area: Take a screenshot of an area and save it as a file on the desktop
<li>Command-Shift-4, then space, then click a window: Take a screenshot of a window and save it as a file on the desktop
<li>Command-Control-Shift-3: Take a screenshot of the screen, and save it to the clipboard
<li>Command-Control-Shift-4, then select an area: Take a screenshot of an area and save it to the clipboard
<li>Command-Control-Shift-4, then space, then click a window: Take a screenshot of a window and save it to the clipboard<br />
]]></content:encoded>
			<wfw:commentRss>http://www.megalinux.net/screenshot-shortcuts-in-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
