<?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>Abbas &#124; Bassu &#187; Linux</title>
	<atom:link href="http://bashukhan.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://bashukhan.com</link>
	<description>Life&#039;s having zeros and ones all over</description>
	<lastBuildDate>Thu, 29 Jul 2010 13:00:32 +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>Maildir search at its best!</title>
		<link>http://bashukhan.com/maildir-search-at-its-best/</link>
		<comments>http://bashukhan.com/maildir-search-at-its-best/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 17:47:17 +0000</pubDate>
		<dc:creator>Abbas</dc:creator>
				<category><![CDATA[Geekism]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[maildir searching]]></category>
		<category><![CDATA[mu better than mairix]]></category>
		<category><![CDATA[mu installation on centos 5]]></category>
		<category><![CDATA[mu tools]]></category>

		<guid isPermaLink="false">http://bashukhan.com/?p=271</guid>
		<description><![CDATA[Search, search and search &#8211; that&#8217;s what we all do in daily inhabitance. When it comes to maildir, the &#8216;mu-tools&#8217; are its best. Mairix is one sort of alternative but mu is quite powerful and more customizable. The only problem is its installation on an RHEL5 based system such as CentOS5. The problem starts on [...]]]></description>
			<content:encoded><![CDATA[<p>Search, search and search &#8211; that&#8217;s what we all do in daily inhabitance. When it comes to maildir, the &#8216;<a href="http://www.djcbsoftware.nl/code/mu/" target="_blank">mu-tools&#8217;</a> are its best. Mairix is one sort of alternative but mu is quite powerful and more customizable. The only problem is its installation on an RHEL5 based system such as CentOS5. The problem starts on the fact that development of mu seems to have happened on a Debian based distro which by all means is more advanced in system core packages. Debian or Ubuntu is meant for the cutting-edge technology with latest up-to-date packages while Red Hat on other side doesn&#8217;t really like to keep all of the system core RPMs most up-to-date till their next major release or at least until then point when there are severe security flaws found in those packages. For example, you found a new tool, check with apt-get; you find it, install 1, 2, 3 and you&#8217;re ready to go! However, that&#8217;s not same thing with RHEL, even after loading bunch of third party repositories. Those who interact with both Debian and Red Hat Enterprise Linux on daily basis may know how difficult installing new applications can become. I hate it whenever this happens. Red Hat chose &#8216;stability&#8217; over &#8216;updates&#8217;. Both of these infrastructures have their own downsides. Perhaps, that&#8217;s the reason why RHEL is widely deployed as server OS comparative to other distributions.</p>
<p>With that said, installation of mu is not that simple. Earlier in mu 0.4 it was a nightmare as I had to go through lots of and different installation errors, but now with thanks to developer Dirk-jan Binnema who fixed a bug for me and made a few changes to leisure its installation, it&#8217;s not that hard if you know the calculated amount of steps involved:</p>
<ul>
<li>Compiling glib 2.24</li>
<li>Compiling and installing xapian and xapin-config</li>
<li>Adding /usr/local/bin/pkg-config to current PKG_CONFIG_PATH</li>
<li> Fixing that notorious bug of &#8220;undefined reference to sqlite3_prepare_v2&#8243; in sqlite-dev package that exists in all RHEL related packages (not needed as version 0.7 eliminates sqlite dependency by using xapian instead)</li>
</ul>
<p>Presuming that you&#8217;ve all compiling and development tools (gcc, gcc++, libtool), installation involves these underlined steps. Try not to use package versions other than the ones mentioned. Trust me, when I say that<strong>.<br />
</strong></p>
<p><em><strong>1. Installing glib2, updating system library and exporting pkg-config path.<br />
</strong></em></p>
<pre class="brush: bash;">
# wget http://ftp.gnome.org/pub/gnome/sources/glib/2.24/glib-2.24.1.tar.gz
# tar zxvf glib-2.24.1.tar.gz
# cd glib-2.24.1/
# ./configure
# make
# make install
# echo &quot;/usr/local/lib/&quot; &gt;&gt; /etc/ld.so.conf.d/glib2-i386.conf
# ldconfig
# export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
</pre>
<p><em><strong>2. Installing gmime<br />
</strong></em></p>
<pre class="brush: bash;">
# wget http://dl.atrpms.net/el5-i386/atrpms/stable/atrpms-package-config-120-3.el5.i386.rpm
# rpm -ivh atrpms-package-config-120-3.el5.i386.rpm
# yum --enablerepo=atrpms install gmime-2.4.7-1.99 gmime-devel-2.4.7-1.99
</pre>
<p><em><strong>3. Installing xapian</strong></em></p>
<pre class="brush: bash;">
# wget http://centos.karan.org/kbsingh-CentOS-Extras.repo -0 /etc/yum.repos.d/kbsingh-CentOS-Extras.repo
# yum install --enable=kbs-CentOS-Testing xapian-core xapian-core-devel -y
</pre>
<p><em><strong>4. Compiling and installing mu<br />
</strong></em></p>
<pre class="brush: bash;">
# wget http://mu0.googlecode.com/files/mu-0.7.tar.gz
# git clone git://gitorious.org/mu/mu-ng.git
# tar zxvf mu-0.7.tar.gz
# rm -f mu-0.7/src/mu-cmd-index.c
# cp mu-ng/src/mu-cmd-index.c mu-0.7/src/
# cd mu-0.7/
# ./configure
# make
# make install
</pre>
<p>That&#8217;s all you need to get started. There&#8217;s no other tool like &#8216;mu view&#8217; (formerly mu-msginfo) for getting instant command line outputs of an email formatted in maildir format. I instantly fell in love with it when I first used.<br />
Wish a nice playing with it! <img src='http://bashukhan.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://bashukhan.com/maildir-search-at-its-best/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PC speaker and CentOS 5</title>
		<link>http://bashukhan.com/pc-speaker-and-centos-5/</link>
		<comments>http://bashukhan.com/pc-speaker-and-centos-5/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 16:16:35 +0000</pubDate>
		<dc:creator>Abbas</dc:creator>
				<category><![CDATA[Geekism]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux beep melodies]]></category>
		<category><![CDATA[pc beep stop in kernel 2.6.18.164]]></category>
		<category><![CDATA[pc speaker not working in centos 5]]></category>
		<category><![CDATA[pcspkr]]></category>

		<guid isPermaLink="false">http://bashukhan.com/pc-speaker-and-centos-5/</guid>
		<description><![CDATA[Ah, I just was lazy the other day and surfing around while I came across some pfSense stuff. I remembered the way it belled the beeps during startups and shutdowns being one of the good things that I liked about when I had it (yea, it pretty much sucked in my dual wan environment as [...]]]></description>
			<content:encoded><![CDATA[<p>Ah, I just was lazy the other day and surfing around while I came across some pfSense stuff. I remembered the way it belled the beeps during startups and shutdowns being one of the good things that I liked about when I had it (yea, it pretty much sucked in my dual wan environment as a load balancer so I tried to switching to ClearOS, of course an RHEL5 based firewall; nevertheless I totally agree to what Linus once said &#8216;I claim that Mach people (and apparently FreeBSD) are incompetent  idiots&#8217;) like you instantly click good features of a thing when you think about anything in first few thoughts. This is sometime really helpful for home-servers which don&#8217;t always have a monitor plugged into their consoles.</p>
<p>As I used &#8216;beep&#8217; program already a few times in Ubuntu I knew it would be interesting to use it with new &#8216;-n&#8217; feature instead of using issuing beep command for an each frequency beep. That is, the whole script here at<a href="http://redmine.pfsense.org/repositories/annotate/pfsense/usr/local/bin/beep.sh" target="_blank"> http://redmine.pfsense.org/repositories/annotate/pfsense/usr/local/bin/beep.sh</a> can be translated into a single beep command of:</p>
<pre class="brush: bash;">
beep -f 500 -l 155 -n -f 400 -l 155 -n -f 600 -l 155 -n -f 800 -l 155 -n -f 800 -l 155 -n -f 600 -l 155 -n -f 800 -l 155 -n -f 500 -l 155 -n -f 400 -l 155 -n -f 400 -l 155
</pre>
<p>But after installing beep and running didn&#8217;t make any sound. I witnessed that spkr kernel module as well as the motherboard speaker were well being detected but still no sound. After investigating, it turns out that its bug in kernel earlier than 2.6.18-164 interestingly using external speakers instead of PC&#8217;s internal one for producing system bells. Basically its a bug called as an &#8216;aggression&#8217; for a feature that breaks of with any newer kernel release. I saw multiple bugs relating to the problem in Red Hat&#8217;s bugzilla https://bugzilla.redhat.com/show_bug.cgi?id=532444, https://bugzilla.redhat.com/show_bug.cgi?id=525390 and https://bugzilla.redhat.com/show_bug.cgi?id=526751. So, I hit upon the CentOS 5&#8242;s lastest kernel, 2.6.18-194.8.1.el5 and that gave me back my system beeps <img src='http://bashukhan.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>[root@Bassu ~]# dmesg | grep -i &#8216;speaker&#8217;<br />
input: PC Speaker as /class/input/input2<br />
[root@Bassu ~]# lsmod | grep -i spkr<br />
pcspkr                  7105  0</p>
<p>Almost I finished adding beeps in rc.local and shutdown, I stumbled upon a good init script which I modified a bit and added chkconfig parameters so it can be added into RHEL&#8217;s ntsysv services &#8211; exactly what I needed! Then I found another beep melody for Beethoven&#8217;s theme <img src='http://bashukhan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<pre class="brush: bash;">
beep -f 659 -l 460 -n -f 784 -l 340 -n -f 659 -l 230 -n -f 659 -l 110 -n -f 880 -l 230 -n -f 659 -l 230 -n -f 587 -l 230 -n -f 659 -l 460 -n -f 988 -l 340 -n -f 659 -l 230 -n -f 659 -l 110 -n -f 1047-l 230 -n -f 988 -l 230 -n -f 784 -l 230 -n -f 659 -l 230 -n -f 988 -l 230 -n -f 1318 -l 230 -n -f 659 -l 110 -n -f 587 -l 230 -n -f 587 -l 110 -n -f 494 -l 230 -n -f 740 -l 230 -n -f 659 -l 460
</pre>
<p>Add below script to file, /etc/init.d/beep, make it executable and do a &#8216;chkconfig &#8211;add beep&#8217; to add it as a system service.</p>
<pre class="brush: bash;">
#!/bin/sh
# chkconfig: 2345 95 20
# description: Beep PC speaker with analog melody on startup and stoppage
#
# processname: beep
NAME=beep
BEEP=/usr/bin/$NAME
MELODY_START=&quot;-f 65.4064 -l 100 -n -f 130.813 -l 100 -n -f 261.626 -l 100 -n -f 523.251 -l 100 -n -f 1046.50 -l 100 -n -f 2093.00 -l 100 -n -f 4186.01 -l 100&quot;
MELODY_STOP=&quot;-f 523.251 -l 100 -D 100 -n -f 391.995 -l 100 -D 100 -n -f 329.628 -l 100 -D 100 -n -f 261.626 -l 200&quot;
SCRIPTNAME=/etc/init.d/$NAME
#ARGS=&quot;-e /dev/input/event0&quot;
# Exit if the package is not installed
[ -x &quot;$BEEP&quot; ] || exit 0
case &quot;$1&quot; in
 start)
 $BEEP $ARGS $MELODY_START
 ;;
 stop)
 $BEEP $ARGS $MELODY_STOP
 ;;
 restart|force-reload)
 # Do nothing
 ;;
 *)
 echo &quot;Usage: $SCRIPTNAME {start|stop|restart|force-reload}&quot; &gt;&amp;2
 exit 3
 ;;
esac
</pre>
<p><strong>With that said, coming out of Mario world and now going back to my laziness <img src='http://bashukhan.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </strong></p>
<p><span style="text-decoration: underline;"><em><span style="color: #000080;"><strong>UPDATE:</strong></span></em></span></p>
<p>Talking about the Mario, I just created its beep command from some random junk of frequencies I found. So, here it goes:</p>
<pre class="brush: bash;">
beep -f 330 -l 137 -n -f 330 -l 275 -n -f 330 -l 137 -d 137 -n -f 262 -l 137 -n -f 330 -l 275 -n -f 392 -l 550 -d 550 -n -f 262 -l 412 -n -f 196 -l 137 -d 275 -n -f 164 -l 137 -d 137 -n -f 220 -l 275 -n -f 247 -l 137 -d 137 -n -f 233 -l 137 -n -f 220 -l 275 -n -f 196 -l 205 -n -f 330 -l 205 -n -f 392 -l 275 -n -f 440 -l 275 -n -f 349 -l 137 -n -f 392 -l 137 -d 137 -n -f 330 -l 275 -n -f 262 -l 137 -n -f 294 -l 137 -n -f 247 -l 412 -n -f 262 -l 412 -n -f 196 -l 137 -d 275 -n -f 164 -l 275 -d 137 -n -f 220 -l 275 -n -f 247 -l 137 -d 137 -n -f 233 -l 137 -n -f 220 -l 275 -n -f 196 -l 205 -n -f 330 -l 205 -n -f 392 -l 275 -n -f 440 -l 275 -n -f 349 -l 137 -n -f 392 -l 137 -d 137 -n -f 330 -l 275 -n -f 262 -l 137 -n -f 294 -l 137 -n -f 247 -l 412 -d 275 -n -f 392 -l 137 -n -f 370 -l 137 -n -f 349 -l 137 -n -f 311 -l 275 -n -f 330 -l 137 -d 137 -n -f 207 -l 137 -n -f 220 -l 137 -n -f 262 -l 137 -d 137 -n -f 220 -l 137 -n -f 262 -l 137 -n -f 294 -l 137 -d 275 -n -f 392 -l 137 -n -f 370 -l 137 -n -f 349 -l 137 -n -f 311 -l 275 -n -f 330 -l 137 -d 137 -n -f 523 -l 275 -n -f 523 -l 137 -n -f 523 -l 550 -n -f 392 -l 137 -n -f 370 -l 137 -n -f 349 -l 137 -n -f 311 -l 275 -n -f 330 -l 137 -d 137 -n -f 207 -l 137 -n -f 220 -l 137 -n -f 262 -l 137 -d 137 -n -f 220 -l 137 -n -f 262 -l 137 -n -f 294 -l 137 -d 275 -n -f 311 -l 275 -d 137 -n -f 294 -l 275 -n -f 262 -l 550 -d 550
</pre>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="350" height="300" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.youtube.com/v/42fsPaAkcag" /><embed type="application/x-shockwave-flash" width="350" height="300" src="http://www.youtube.com/v/42fsPaAkcag"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://bashukhan.com/pc-speaker-and-centos-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple mistakes</title>
		<link>http://bashukhan.com/simple-mistakes/</link>
		<comments>http://bashukhan.com/simple-mistakes/#comments</comments>
		<pubDate>Mon, 05 Jul 2010 08:32:49 +0000</pubDate>
		<dc:creator>Abbas</dc:creator>
				<category><![CDATA[Geekism]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[folder permissions supercede filer permissions in linux]]></category>
		<category><![CDATA[linux permissions inheritence]]></category>
		<category><![CDATA[most common cause of permission denied bash]]></category>
		<category><![CDATA[root directory permissions]]></category>
		<category><![CDATA[simple mistake]]></category>

		<guid isPermaLink="false">http://bashukhan.com/?p=253</guid>
		<description><![CDATA[I think there&#8217;s at least a time in human-being&#8217;s life when you feel impugned about the time that single small error, but really hard to be traced, wastes, obstructs and then makes you silly. Even an expert cannot deny this fact. In Linux, this could be more idiotic after you find out that the you [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://bashukhan.com/wp-content/uploads/2010/07/mistake_21-e1278317852697.gif" rel="lightbox[253]"><img class="alignleft size-full wp-image-255" title="mistake_2" src="http://bashukhan.com/wp-content/uploads/2010/07/mistake_21-e1278317852697.gif" alt="" width="160" height="147" /></a>I think there&#8217;s at least a time in human-being&#8217;s life when you feel impugned about the time that single small error, but really hard to be traced, wastes, obstructs and then makes you silly. Even an expert cannot deny this fact. In Linux, this could be more idiotic after you find out that the you already knew about how basic and simple the error was made of! Anyone having a basic know-how of Linux filesystem may know that <em><strong>directory permissions supercede file permissions.</strong></em> For instance, you may forgot to check permissions on all preceding directories, specially the root mount point, when it&#8217;s getting &#8216;permissions denied&#8217; error even having all rwx permissions on it. Despite the fact being simply understandable, it took time to find out that  the permissions of &#8216;/&#8217; root directory mount point were the culprits.</p>
<pre class="brush: bash;">
$ ssh -vl abbas 10.10.10.251

Last login: Mon Jul  5 03:58:16 2010 from 10.10.10.243
Could not chdir to home directory /home/abbas: Permission denied
/bin/bash: Permission denied
debug1: channel 0: free: client-session, nchannels 1
Connection to 10.10.10.251 closed.
Transferred: sent 2048, received 2072 bytes, in 0.0 seconds
Bytes per second: sent 51120.7, received 51719.8
debug1: Exit status 1

# stat /
File: `/'
Size: 4096          Blocks: 16         IO Block: 4096   directory
Device: fd00h/64768d    Inode: 2           Links: 23
Access: (0700/drwx------)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2010-07-04 04:02:02.000000000 -0400
Modify: 2010-07-02 10:14:43.000000000 -0400
Change: 2010-07-05 03:58:50.000000000 -0400
</pre>
]]></content:encoded>
			<wfw:commentRss>http://bashukhan.com/simple-mistakes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More Raid tidbits &#8211; Monitoring all raid events and changing default email template</title>
		<link>http://bashukhan.com/more-raid-tidbits-monitoring-all-raid-events-and-changing-default-email-template/</link>
		<comments>http://bashukhan.com/more-raid-tidbits-monitoring-all-raid-events-and-changing-default-email-template/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 19:27:41 +0000</pubDate>
		<dc:creator>Abbas</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[check all raid events]]></category>
		<category><![CDATA[customize default raid mdadm email template]]></category>
		<category><![CDATA[mdadm monitor warning level events]]></category>
		<category><![CDATA[monitor all raid events linux]]></category>
		<category><![CDATA[photoblog]]></category>

		<guid isPermaLink="false">http://bashukhan.com/?p=157</guid>
		<description><![CDATA[A geek really knows the importance of his or her data and backups that just avoids pulling the hair off! When one of my hard drives on a server just died after having a well served 6000+ hours of life span, I found myself really lucky as other array component of RAID1 came to the [...]]]></description>
			<content:encoded><![CDATA[<p>A geek really knows the importance of his or her data and backups that just avoids pulling the hair off! When one of my hard drives on a server just died after having a well served 6000+ hours of life span, I found myself really lucky as other array component of RAID1 came to the rescue. Reason was a perhaps a short circuit which could have cost me the biggest loss of my data ever, I had in my life, so a blazing smile was well deserved. Electric power is one of the infinite things that doesn&#8217;t work here like it always (oh, its a long story &#8211; I should tell some of it sometime later)!</p>
<p>I got an email from mdmonitor telling me about DegradedArray event. So, when I was rebuilding the array, I noticed I got no alerts about rebuild process or  array status updates which I really wanted to investigate. Till that time, I wasn&#8217;t event knowing that &#8216;mdadm &#8211;monitor&#8217; only sends you the critical updates. So, I pulled up man pages and saw these are critical events:</p>
<ul>
<li>DeviceDisappeared</li>
<li> Fail</li>
<li> FailSpare</li>
<li> DegradedArray</li>
</ul>
<p>Rest of the events are not reported at all! Also, that RHEL5&#8242;s mdadm package has pre-compiled template of email that mdadm sends upon occurrence of a critical event which I wanted to change from as well cause it looks pretty immature:</p>
<pre class="brush: bash;">
This is an automatically generated mail message from mdadm running on HOSTNAME
A DegradedArray event had been detected on md device /dev/md1.
Faithfully yours, etc.

P.S. The /proc/mdstat file currently contains the following:
bla bla bla
</pre>
<p>Seriously, it says &#8220;faithfully&#8221;&#8230; wth? Lol. We know that all machines are faithful to a human unless they&#8217;re not broken or gay! <img src='http://bashukhan.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  It definitely needed to be changed. Checking /etc/init.d/mdmonitor at least gave an idea that its not something changeable but it uses default template when MAILADDR is specified while it doesn&#8217;t when PROGRAM parameter is used in /etc/mdadm.conf by passing on RAID array as arguments to the script which is used, instead.</p>
<p>I did this then.</p>
<pre class="brush: bash;">

# mdadm --detail --scan &gt;&gt; /etc/mdadm.conf

# echo &quot;PROGRAM /etc/raidalerter&quot; &gt;&gt; /etc/mdadm.conf
# sed -e '1i\DEVICE partitions' -i  /etc/mdadm.conf
# cat /etc/raidalerter    (create this file with below script)

#!/bin/bash
echo -e &quot;Likely an unfavourable or a bad thing just happened to your RAID. Even if its recovering, it was a bad thing which caused this! \n\n\n&quot; $(cat -A /proc/mdstat | sed 's/\$/\\n/g') | mail -s &quot;$1 on $2 $3 at $HOSTNAME&quot; some-mail-address@example.com

# chmod +x /etc/raidalerter
# service mdmonitor restart
</pre>
<p>Provided that you&#8217;ve an MTA working fine, mails would be delivered upon any of RAID incidents to the maximum verbosity possible. I don&#8217;t think that any of the hardware raids does so?!<br />
I then tested it on a small array to make sure that alerts are deliverable.</p>
<pre class="brush: bash;">

# mdadm /dev/md0 -f /dev/sdb1 -r /dev/sdb1
mdadm: set /dev/sdb1 faulty in /dev/md0
mdadm: hot removed /dev/sdb1
# mdadm /dev/md0 -a /dev/sdb1
mdadm: re-added /dev/sdb1
</pre>
<p><a href="http://bashukhan.com/wp-content/uploads/2010/03/Mdmonitor-Report-all-mdadm-monitor-events-.png" rel="lightbox[157]"><img class="aligncenter size-full wp-image-165" title="Mdmonitor - Report all mdadm monitor events" src="http://bashukhan.com/wp-content/uploads/2010/03/Mdmonitor-Report-all-mdadm-monitor-events-.png" alt="" width="693" height="292" /></a></p>
<p><strong>Preview: </strong></p>
<p>Subject: RebuildFinished on /dev/md0 at ToughGuy<br />
Likely an unfavorable or a bad thing just happened to your RAID. Even if its recovering, it was a bad thing which caused this!   Personalities :</p>
<p>[raid1]<br />
md1 : active<br />
raid1 sdb3[1] sda3[0]<br />
724555520 blocks [2/2] [UU]<br />
md0 : active<br />
raid1 sdb1[1] sda1[0]<br />
4008064 blocks [2/2] [UU]<br />
unused devices: &lt;none&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://bashukhan.com/more-raid-tidbits-monitoring-all-raid-events-and-changing-default-email-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HA LB Cluster on CentOS5 &#8211; Without actual heartbeat :P</title>
		<link>http://bashukhan.com/ha-lb-cluster-on-centos5-without-actual-heartbeat-p/</link>
		<comments>http://bashukhan.com/ha-lb-cluster-on-centos5-without-actual-heartbeat-p/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 18:13:19 +0000</pubDate>
		<dc:creator>Abbas</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[centos5 cluster]]></category>
		<category><![CDATA[ha lb cluster with ipvsadm an heartbeat-ldirectord without actual "heartbeat"]]></category>
		<category><![CDATA[ipvsadm and ldirectord on centos5]]></category>
		<category><![CDATA[old load balance cluster centos5]]></category>
		<category><![CDATA[quick dirty centos5 apache load balance cluster]]></category>

		<guid isPermaLink="false">http://bashukhan.com/?p=118</guid>
		<description><![CDATA[Last month I wrote a howto for highly available load balanced Piranha cluster using Red Hat&#8217;s cluster suite. Until then it was quite not obvious why one should use the Debian styled network load balanced cluster in the production environment when actual &#8220;heartbeat&#8221; package and service creates a lot of havoc on Red Hat machines. [...]]]></description>
			<content:encoded><![CDATA[<p>Last month I <a href="http://bashukhan.com/tag/piranha-tutorial/" target="_blank">wrote a howto</a> for highly available load balanced Piranha cluster using Red Hat&#8217;s cluster suite. Until then it was quite not obvious why one should use the Debian styled network load balanced cluster in the production environment when actual &#8220;heartbeat&#8221; package and service creates a lot of havoc on Red Hat machines. But my reckoning of doing classic things more manually kept me interrogative and I found the flexible way of doing load balanced clustering without needing the actual heartbeat service. Reasons why I&#8217;m so much against of having it are numerous:<br />
- Running heartbeat snatches the independence of managing virtual IP addresses on load balancer by hand.<br />
- Thus restricting expansion of the pools!<br />
- Ldirector&#8217;s daemon must be managed by heartbeat when its running.<br />
- Waste of resources in utilization; such with a sheer restart of heartbeat service and it just sits on waiting and waiting,&#8230;<br />
- And above all, I don&#8217;t need a &#8220;second&#8221; load balancer for a failover. All that glitters is one load balancer running ldirectord in a simple environment and as for the job, it does most of heartbeat&#8217;s when acting as a divider and a monitor for distributing requests between web servers.</p>
<p><strong><em>Environment</em><br />
</strong></p>
<p>Requirements: At least three systems, each with a minimum of one IP (CentOS in my case). Packages &#8216;heartbeat&#8217;, &#8216;heartbeat-ldirector&#8217; for <a href="http://www.linux-ha.org/" target="_blank">load balancing</a> and &#8216;ipvsadm&#8217; for Linux <a href="http://www.linuxvirtualserver.org/" target="_blank">IP Virtual Server</a>. I know you&#8217;re thinking that why the &#8216;heartbeat&#8217; when actually we&#8217;re not going to run it. In fact, we&#8217;re not going to run it; its just for a dependency resolution, rather a service startup requirement &#8211; I should say (/etc/ha.d/shellfuncs is the file needed)! And I swear we won&#8217;t run it <img src='http://bashukhan.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ! So these are the packages which shape into a project <a href="http://www.ultramonkey.org/" target="_blank">Ultramonkey</a> when combined and it describes the different topologies of a functional HA LB cluster but that&#8217;s not our concern, anyway <img src='http://bashukhan.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  (perhaps yours if you think you&#8217;ve a bit of free time)</p>
<p>Virtual IP<strong>: </strong>10.10.10.60<br />
Load Balancer: 10.10.10.61 aka VM1.<br />
Cluster Nodes/Real Servers:<br />
Web Server1: 10.10.10.62 aka VM2<br />
Web Server2: 10.10.10.63 aka VM3.</p>
<p>And we&#8217;ll be using LVS-DR (direct routing) approach for clustering; its most widely used and has lesser downsides.<br />
Lets start by configuring the web servers first.</p>
<p><em><strong>Cluster Nodes  Configurations</strong></em></p>
<p><strong>1. </strong>On both web servers VM2 and VM3, apache should be running having a common serving file (for purpose of get checked by ldirectord).</p>
<pre class="brush: bash;">
# yum install httpd -y
# echo foo &gt; /var/www/html/test.html
# service httpd start
# chkconfig httpd on
</pre>
<p>And to distinguish both of the web servers during test loading, create at least a one unique file on each of web servers.</p>
<pre class="brush: bash;">
[root@VM2 ~]# echo &quot;This is VM2&quot; &gt; /var/www/html/index.html
[root@VM3 ~]# echo &quot;This is VM3&quot; &gt; /var/www/html/index.html
</pre>
<p><strong>2.</strong> Virtual IP needs to be terminated on both web servers so we&#8217;ll create a second network interface on each of it. Because eventually all three NICs on all three servers would have to have the same VIP so this would cause a problem with ARP as it resolves MACs against IPs. There are different solutions to this problem. Some may refer to use iptables or arptables_jf. Many would recommend changing default gateway route or hiding the network interface (by the way don&#8217;t use iptables or change default gateway for this; Red Hat discourages both of these methods as they cause a lot of overhead). But the most flexible approach I&#8217;ve found is:</p>
<p style="padding-left: 30px;"><strong>a. </strong>create a loopback interface so it doesn&#8217;t communicate with your network gateway/router directly.<br />
<strong>b.</strong> instruct Linux kernel to announce ARP requests with preference to be taken from local address when matching for communication instead preference from the destination address.<br />
<strong>c. </strong>instruct Linux kernel to send ARP responses only to the requests originating from same sender address to same local addresses&#8217; subnet. Details <a href="http://kb.linuxvirtualserver.org/wiki/Using_arp_announce/arp_ignore_to_disable_ARP" target="_blank">here</a>, if you&#8217;re really curious about it.</p>
<pre class="brush: bash;">
# vi /etc/sysconfig/network-scripts/ifcfg-lo:0
DEVICE=lo:0
IPADDR=10.10.10.60
NETMASK=255.255.255.255
ONBOOT=yes
NAME=loopback
#
# vi /etc/sysctl.conf
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.eth0.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
net.ipv4.conf.eth0.arp_announce = 2
# sysctl -p
# ifup lo:0
</pre>
<p><em><strong>Load Balancer Configuration</strong></em></p>
<p>We&#8217;ll be going through:</p>
<p><strong>a. </strong>installing required packages<br />
<strong>b.</strong> enabling IP forwarding,</p>
<pre class="brush: bash;">
# yum install heartbeat heartbeat-ldirector ipvsadm -y
# chkconfig --add ldirectord
# chkconfig --del heartbeat
# sed -i 's/net.ipv4.ip_forward = 1/net.ipv4.ip_forward = 0' /etc/sysctl.conf

# sysctl -p
</pre>
<p><strong>c.</strong> configure secondary eth0 for VIP as its going to be exposed to outside world or your local gateway and</p>
<pre class="brush: bash;">
# vi /etc/sysconfig/network-scripts/ifcfg-eth0:0
DEVICE=eth0:0
BOOTPROTO=none
ONBOOT=yes
HWADDR=3a:5d:71:ad:67:47
NETMASK=255.255.255.0
IPADDR=10.10.10.60
GATEWAY=12.12.12.1
TYPE=Ethernet
</pre>
<p><strong>d.</strong> then creating ldirector.cf, the configuration file of our load balancer, respectively!!</p>
<pre class="brush: bash;">
# vi /etc/ha.d/ldirectord.cf
checktimeout=10
checkinterval=2
autoreload=no
logfile=&quot;/var/log/ldirectord.log&quot;
quiescent=no
virtual=10.10.10.60:80
 real=10.10.10.62:80 gate
 real= 10.10.10.63:80 gate
 service=http
 request=&quot;test.html&quot;
 receive=&quot;foo&quot;
 scheduler=wrr
 protocol=tcp
 checktype=negotiate

# service ldirectord start
</pre>
<p>Option &#8216;quiescent&#8217; just removes the real server from ipvs table whom ldirectord doesn&#8217;t recieve any response from, when querying for test.html within ten seconds, marking that real server as dead; until its available again. Note that the &#8220;gate&#8221; switch in &#8216;real&#8217; server&#8217;s parameter value which testifies the usage of LVS Direct Routing method. The rest of the two methods are masq and ipip the details of which along with the other options available, particularly the scheduler parameters, for this configuration file can be found in &#8216;man ldirectord&#8217;.</p>
<p><em><strong>Testing</strong></em></p>
<p><em><strong></strong></em>Use &#8216;ipvsadm&#8217; to list down current statistics of ldirectord. Make sure that both real servers IPs are listed there and have non-zero value in weight (since we&#8217;ve this default setup, it should be 1). If not, then try checking the log file, tcpdump on ldirector and apache logs on real servers.<br />
If everything works good, you&#8217;ll see changing content when browsing to http://10.10.10.60/ multiple times (from another system outside these cluster nodes). Then stop httpd on one web server, browse to the URL again and all requests should now be served from the other web server.</p>
<pre class="brush: bash;">
[root@VM1 ~]# ipvsadm -l
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-&gt; RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  10.10.10.60:http wrr
-&gt; 10.10.10.63:http             Route   1      0          0
-&gt; 10.10.10.62:http             Route   1      0          0
</pre>
<p>For a more meaningful testing</p>
<pre class="brush: bash;">
$ for i in $(seq 6); do curl http://10.10.10.60/index.html; done
 This is VM3
 This is VM2
 This is VM3
 This is VM2
 This is VM3
 This is VM2
</pre>
<p>I&#8217;ll be posting a couple of optimizations techniques soon when I&#8217;ll be getting some more free time. Stay tuned and take care <img src='http://bashukhan.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 1388px; width: 1px; height: 1px;">checktimeout=10<br />
checkinterval=2<br />
autoreload=no<br />
logfile=&#8221;/var/log/ldirectord.log&#8221;<br />
quiescent=yes<br />
virtual=10.10.10.60:80<br />
real=10.10.10.62:80 gate<br />
real= 10.10.10.63:80 gate<br />
service=http<br />
request=&#8221;index.html&#8221;<br />
receive=&#8221;hi&#8221;<br />
scheduler=wlc<br />
protocol=tcp<br />
checktype=negotiate</div>
]]></content:encoded>
			<wfw:commentRss>http://bashukhan.com/ha-lb-cluster-on-centos5-without-actual-heartbeat-p/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>ASCII Art in Linux</title>
		<link>http://bashukhan.com/ascii-art-in-linux/</link>
		<comments>http://bashukhan.com/ascii-art-in-linux/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 20:03:21 +0000</pubDate>
		<dc:creator>Abbas</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[asci art in linux]]></category>
		<category><![CDATA[convert text into ascii art tool]]></category>
		<category><![CDATA[figlet]]></category>
		<category><![CDATA[linux_logo]]></category>
		<category><![CDATA[photoblog]]></category>

		<guid isPermaLink="false">http://bashukhan.com/?p=95</guid>
		<description><![CDATA[I&#8217;m fond of two ascii art tools in Linux. - linux_logo - figlet Both of these are available in RPMForge/Dag&#8217;s repository. Second one, figlet draws the ascii art for any text that is input. It has a lot of font options available (see man for figlet and figlist).]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m fond of two ascii art tools in Linux.</p>
<p>- linux_logo<br />
- figlet</p>
<p>Both of these are available in RPMForge/Dag&#8217;s repository. Second one, figlet draws the ascii art for any text that is input. It has a lot of font options available (see man for figlet and figlist).</p>
<p style="text-align: center;"><a href="http://bashukhan.com/wp-content/uploads/2009/12/ascii-art.png" rel="lightbox[95]"><img class="aligncenter size-medium wp-image-100" title="ascii-art" src="http://bashukhan.com/wp-content/uploads/2009/12/ascii-art-300x197.png" alt="" width="300" height="197" /></a></p>
<p style="text-align: center;">
]]></content:encoded>
			<wfw:commentRss>http://bashukhan.com/ascii-art-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing HPLIP 3.9.10 on CentOS 5.4 for newer printers (HP LaserJet M1120 MFP)</title>
		<link>http://bashukhan.com/installing-hplip-3-9-10-on-centos-5-4-for-newer-printers-hp-laserjet-m1120-mfp/</link>
		<comments>http://bashukhan.com/installing-hplip-3-9-10-on-centos-5-4-for-newer-printers-hp-laserjet-m1120-mfp/#comments</comments>
		<pubDate>Sat, 19 Dec 2009 13:34:41 +0000</pubDate>
		<dc:creator>Abbas</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[CentOS hplip drivers with scanner support]]></category>
		<category><![CDATA[fixing hplip dependency errors]]></category>
		<category><![CDATA[HP LaserJet M1120]]></category>
		<category><![CDATA[HP LaserJet M1120 Red Hat]]></category>
		<category><![CDATA[install hplip on CentOS 5]]></category>
		<category><![CDATA[latest hplip 3.9 on CentOS 5.5]]></category>
		<category><![CDATA[photoblog]]></category>

		<guid isPermaLink="false">http://bashukhan.com/?p=84</guid>
		<description><![CDATA[CentOS 5&#8242;s base repository has an older version of HPLIP, something about &#8217;1.6.7&#8242; or so which of course is not adequate to get newer HP printers specially the LaserJet series, to get to work. Now the natural way to have this installed, you may think is to compile it from source &#8211; if you&#8217;re thinking [...]]]></description>
			<content:encoded><![CDATA[<p>CentOS 5&#8242;s base repository has an older version of HPLIP, something about &#8217;1.6.7&#8242; or so which of course is not adequate to get newer HP printers specially the LaserJet series, to get to work. Now the natural way to have this installed, you may think is to compile it from <em><strong><a title="HPLIP installation from source" href="http://hplipopensource.com/hplip-web/install/manual/distros/centos.html" target="_blank">source</a></strong></em> &#8211; if you&#8217;re thinking that then no, that won&#8217;t help out! Even after fulfilling all of the required dependencies. I got about almost 14 errors when running hp-check utility after compiling, got&#8217;em reduced to 10 but no far lesser than that if you know what I mean.</p>
<pre class="brush: bash;">
error: NOT FOUND! This is a REQUIRED/RUNTIME ONLY dependency. Please make sure that this dependency is installed before installing or running HPLIP.
error: NOT FOUND! This is a REQUIRED/RUNTIME ONLY dependency. Please make sure that this dependency is installed before installing or running HPLIP.
warning: NOT FOUND! This is an OPTIONAL/RUNTIME ONLY dependency. Some HPLIP functionality may not function properly.
warning: NOT FOUND! This is an OPTIONAL/RUNTIME ONLY dependency. Some HPLIP functionality may not function properly.
error: NOT FOUND! This is a REQUIRED/COMPILE TIME ONLY dependency. Please make sure that this dependency is installed before installing or running HPLIP.
error: Could not access file: No such file or directory
error: 10 errors and/or warnings.
-----------
| SUMMARY |
-----------
Please refer to the installation instructions at:

http://hplip.sourceforge.net/install/index.html
</pre>
<p>Pretty insane though, many of these dependencies were already installed. I would assume that this would be the reason why hplip is not under active development for CentOS and why its not current under CentOS as I saw quite a few HP&#8217;s devs and techs saying a big &#8220;no&#8221; to this community based distribution when people complained on their Launchpad about these compilation errors. Plus, the relative hplip installation issues I found on CentOS&#8217; forum.</p>
<p>After being in disappointed (oops wth) situation, I tried running the RHEL5&#8242;s rpm (can be downloaded from hplip&#8217;s site) on it after removing the source installed version, but it too gave the dependency errors which I hoped I would resolve and I did later on.</p>
<p><em><strong>Installing&#8230;&#8230;</strong></em></p>
<pre class="brush: bash;">
# rpm -ivh /Raid/hplip-3.9.10_rhel-5.0.i386.rpm
Preparing...                ########################################### [100%]
 file /usr/bin/hpijs from install of hplipfull-3.9.10-0.i386 conflicts with file from package hpijs-1.6.7-4.1.el5.4.i386
 file /usr/lib/libhpip.so.0.0.1 from install of hplipfull-3.9.10-0.i386 conflicts with file from package hpijs-1.6.7-4.1.el5.4.i386
 file /usr/lib/sane/libsane-hpaio.so.1.0.0 from install of hplipfull-3.9.10-0.i386 conflicts with file from package libsane-hpaio-1.6.7-4.1.el5.4.i386
</pre>
<p><em><strong>So, I decided to remove problematic hpijs</strong></em></p>
<pre class="brush: bash;">

 Package                 Arch       Version          Repository        Size

Removing:
 hpijs                   i386       1:1.6.7-4.1.el5.4  installed         588 k
Removing for dependencies:
 libsane-hpaio           i386       1.6.7-4.1.el5.4  installed          94 k
 sane-backends           i386       1.0.18-5.el5     installed         3.1 M
 sane-backends-devel     i386       1.0.18-5.el5     installed          27 k
 sane-backends-libs      i386       1.0.18-5.el5     installed         5.2 M
 xsane                   i386       0.991-5.el5      installed         4.5 M

Transaction Summary
Install      0 Package(s)
Update       0 Package(s)
Remove       6 Package(s)
</pre>
<p><em><strong>But realised soon that it also removed libsane sub-dependency as well.</strong></em></p>
<pre class="brush: bash;">
# rpm -ivh /Raid/hplip-3.9.10_rhel-5.0.i386.rpm
error: Failed dependencies:
 libsane.so.1 is needed by hplipfull-3.9.10-0.i386
 </pre>
<p><em><strong>Because installing sane would also install hpijs and other conflicting stuff as well so the solution here was to remove problematic packages without &#8216;removing&#8217; any dependencies needed.</strong></em></p>
<pre class="brush: bash;">
[root@ToughGuy ~]# rpm -ivh /Raid/hplip-3.9.10_rhel-5.0.i386.rpm
Preparing...                ########################################### [100%]
 file /usr/bin/hpijs from install of hplipfull-3.9.10-0.i386 conflicts with file from package hpijs-1.6.7-4.1.el5.4.i386
 file /usr/lib/libhpip.so.0.0.1 from install of hplipfull-3.9.10-0.i386 conflicts with file from package hpijs-1.6.7-4.1.el5.4.i386
 file /usr/lib/sane/libsane-hpaio.so.1.0.0 from install of hplipfull-3.9.10-0.i386 conflicts with file from package libsane-hpaio-1.6.7-4.1.el5.4.i386
#
# rpm -ev --nodeps libsane-hpaio
# rpm -ivh /Raid/hplip-3.9.10_rhel-5.0.i386.rpm
Preparing...                ########################################### [100%]
 file /usr/bin/hpijs from install of hplipfull-3.9.10-0.i386 conflicts with file from package hpijs-1.6.7-4.1.el5.4.i386
 file /usr/lib/libhpip.so.0.0.1 from install of hplipfull-3.9.10-0.i386 conflicts with file from package hpijs-1.6.7-4.1.el5.4.i386
#
# rpm -ev --nodeps hpijs
#
# rpm -ivh /Raid/hplip-3.9.10_rhel-5.0.i386.rpm
Preparing...                ########################################### [100%]
 1:hplipfull              ########################################### [100%]
#
</pre>
<p><em><strong>Concluding the overall steps:</strong></em></p>
<pre class="brush: bash;">
# yum install cups cups-devel ghostscript* PyQt xsane -y
# Download and install hplip-3.9.10_rhel-5.0.i386.rpm from http://hplipopensource.com/hplip-web/install_wizard/index.html choosing RHEL5.
# rpm -ev --nodeps libsane-hpaio
# rpm -ev --nodeps hpijs
# rpm -ivh hplip-3.9.10_rhel-5.0.i386.rpm
# Reboot the system if you're lucky enough, you'll see no errors
# reboot
# system-config-printer
</pre>
<p>And configure the printer now as usual. Just out of curiosity, this was my XenServer where I installed it (yea I know it would sound funny) and I got scanner (LaserJet M1120 is dual scanner and printer) working fine as well with xsane. Check it out <img src='http://bashukhan.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<div id="attachment_85" class="wp-caption aligncenter" style="width: 310px"><a href="http://bashukhan.com/wp-content/uploads/2009/12/Scan_test.png" rel="lightbox[84]"><img class="size-medium wp-image-85" title="Scan Test HP LaserJet M1120 MFP" src="http://bashukhan.com/wp-content/uploads/2009/12/Scan_test-300x293.png" alt="" width="300" height="293" /></a><p class="wp-caption-text">Scan Test HP LaserJet M1120 MFP</p></div>
<p><strong><span style="color: #000000;">NOTE: </span></strong><span style="color: #000000;">If this post helped you out or provided you with ways of troubleshooting, feel free to say a little thanks <img src='http://bashukhan.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </span></p>
]]></content:encoded>
			<wfw:commentRss>http://bashukhan.com/installing-hplip-3-9-10-on-centos-5-4-for-newer-printers-hp-laserjet-m1120-mfp/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Mail from root, root and root! :&gt;</title>
		<link>http://bashukhan.com/mail-from-root-root-and-root/</link>
		<comments>http://bashukhan.com/mail-from-root-root-and-root/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 09:40:04 +0000</pubDate>
		<dc:creator>Abbas</dc:creator>
				<category><![CDATA[Geekism]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[exim address rewriting]]></category>
		<category><![CDATA[headers_rewrite]]></category>
		<category><![CDATA[replace root sender address]]></category>

		<guid isPermaLink="false">http://bashukhan.com/2009/12/mail-from-root-root-and-root/</guid>
		<description><![CDATA[I&#8217;m sometimes pretty sick of getting emails from &#8216;root&#8217; reporting crons, updates, errors and rest of things I would usually use daily in any Linux machine. My eyes just get sore when I see email from root in all of my email clients specially Gmail. Perhaps that&#8217;s because I&#8217;m fed up of seeing root everywhere [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m sometimes pretty sick of getting emails from &#8216;root&#8217; reporting crons, updates, errors and rest of things I would usually use daily in any Linux machine. My eyes just get sore when I see email from root in all of my email clients specially Gmail. Perhaps that&#8217;s because I&#8217;m fed up of seeing root everywhere and that&#8217;s why I&#8217;ve an alias for root to forward all these rootish emails to one of my email addresses. But that&#8217;s just not enough as I actually want to see a humane human name as a sender just instead of root :&gt;</p>
<p>To add to it, this just becomes more anguish when common, rather I would say major, Linux applications suck in changing the default sender address off from &#8216;root&#8217; (although some apps like &#8216;exim -f&#8217; and mutt having SET FROM defined in ~/.muttrc allow you to change sending address while emailing from command line but this isn&#8217;t what I needed). And so called mighty default MTA, sendmail just brings more panic to it when trying to change it during an in-mail transport (btw, I already dislike sendmail mainly cause of its sluggishness during startup and restart)! As I really had to do something about it and I already knew that Exim&#8217;s address rewriting can be helpful here so after installing it and changing default MTA with &#8216;alternative &#8211;config mta&#8217; I added a quick rewrite at transport.</p>
<pre class="brush: bash;">
$ grep -A 5 remote_smtp /etc/exim/exim.conf | tail -5

driver = smtp
headers_rewrite = root@*  some-email-address@example.com fsr
</pre>
<p>This worked but didn&#8217;t change the FROM field&#8217;s name as expected. I tried combinations of different settings including the rewrite tag &#8216;F&#8217; but the FROM envelop address kept showing the original sender root. I was searching till I stumbled upon http://www.exim.org/exim-html-2.00/doc/html/spec_32.html#SEC671 where it states the FULL &#8216;from&#8217; envelop address is changed with &#8216;w&#8217; tag and allows to have a new sender name (RFC 822) to be configured. So I added.</p>
<pre class="brush: bash;">
$ grep -A 5 remote_smtp /etc/exim/exim.conf | tail -5

driver = smtp
# Adding to rewrite the stupid root@ FROM field which I hate
headers_rewrite = root@* &quot;Abbas &lt;some-email-address@example.com&gt;&quot; fsrw
return_path = some-email-address@example.com
</pre>
<p><strong><span style="color: #333300;">And boo you naughty (!) root  <img src='http://bashukhan.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </span><br />
</strong></p>
<p><img class="alignleft size-full wp-image-62" title="screenshot3" src="http://bashukhan.com/wp-content/uploads/2009/12/screenshot3.png" alt="screenshot3" width="504" height="22" /></p>
]]></content:encoded>
			<wfw:commentRss>http://bashukhan.com/mail-from-root-root-and-root/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redundant customized XenServer</title>
		<link>http://bashukhan.com/redundent-customized-xenserver/</link>
		<comments>http://bashukhan.com/redundent-customized-xenserver/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 08:10:10 +0000</pubDate>
		<dc:creator>Abbas</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[auto backup on xen]]></category>
		<category><![CDATA[raid1 xen]]></category>
		<category><![CDATA[red]]></category>
		<category><![CDATA[Redundant xenserver]]></category>

		<guid isPermaLink="false">http://bashukhan.com/?p=56</guid>
		<description><![CDATA[I just finished setting my home XenServer making it fully redundant, mirrored and backup&#8217;ed. Thought, I would share what&#8217;s on it - Raid1 setup on boot, grub as well as VM storage repository. If one of the hard goes down, it&#8217;ll boot from other one. - Samba installed to have a share setup in a [...]]]></description>
			<content:encoded><![CDATA[<p>I just finished setting my home XenServer making it fully redundant, mirrored and backup&#8217;ed. Thought, I would share what&#8217;s on it <img src='http://bashukhan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span style="font-size: small;"><span style="color: #909090;">- Raid1 setup on boot, grub as well as VM storage repository. If one of the hard goes down, it&#8217;ll boot from other one.<br />
- Samba installed to have a share setup in a raid array of 700GB<br />
- Raild alerts are configured to email me whenever there&#8217;s any issue<br />
- Smartmontools are running to make sure that hard disks are healthy and have emails alerts configured as well.<br />
- Auto on-the-fly backup of all virtual machines without shutting them off, every night at 1am keeping the two most recent backups of VMs all the time.</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://bashukhan.com/redundent-customized-xenserver/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Enabling Guest share in Samba (Windows accessible)</title>
		<link>http://bashukhan.com/enabling-guest-share-in-samba-windows-accessible/</link>
		<comments>http://bashukhan.com/enabling-guest-share-in-samba-windows-accessible/#comments</comments>
		<pubDate>Sat, 12 Dec 2009 17:17:27 +0000</pubDate>
		<dc:creator>Abbas</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[enable public access samba]]></category>
		<category><![CDATA[samba security]]></category>
		<category><![CDATA[share guest account]]></category>

		<guid isPermaLink="false">http://bashukhan.com/2009/12/enabling-guest-share-in-samba-windows-accessible/</guid>
		<description><![CDATA[One of the easiest way to do so is by changing &#8216;security=user&#8217; to &#8216;security=share&#8217; in global configurations of Samba in /etc/samba/smb.conf. But this raises security concern in case if many shares could have restricted access. Samba maps Windows &#8216;guest&#8217; account to Linux&#8217;s &#8216;nobody&#8217; account so this is how I enabled it. Added nobody&#8217;s account but [...]]]></description>
			<content:encoded><![CDATA[<p>One of the easiest way to do so is by changing &#8216;security=user&#8217; to &#8216;security=share&#8217; in global configurations of Samba in /etc/samba/smb.conf. But this raises security concern in case if many shares could have restricted access. Samba maps Windows &#8216;guest&#8217; account to Linux&#8217;s &#8216;nobody&#8217; account so this is how I enabled it.</p>
<p>Added nobody&#8217;s account but seemed it was already there!</p>
<pre class="brush: bash;">[root@ToughGuy ~]# useradd -s /sbin/nologin nobody
useradd: user nobody exists
[root@ToughGuy ~]# grep nobody /etc/passwd
nobody:*:99:99:Nobody:/:/sbin/nologin
nfsnobody:!!:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin
</pre>
<p>Assured that sweet Windows&#8217; &#8220;guests&#8221; have access to my share <img src='http://bashukhan.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<pre class="brush: bash;">
[root@ToughGuy ~]# chown -R root:nobody /Raid/
[root@ToughGuy ~]# chmod -R 775 /Raid/
</pre>
<p>Mapped guest user to login without a need of having a password prompt in smb.conf&#8217;s global settings!</p>
<pre class="brush: bash;">[root@ToughGuy ~]# grep 'map to guest' /etc/samba/smb.conf
	map to guest = Bad Password
</pre>
<p>Btw, here&#8217;s my share:</p>
<pre class="brush: bash;">
[root@ToughGuy ~]# grep -A 5 Raid /etc/samba/smb.conf
	path=/Raid
	browseable=yes
	writeable=yes
	guest ok=yes
	public=yes
</pre>
<p>Restarted the service and look <img src='http://bashukhan.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p><img src="http://bashukhan.com/wp-content/uploads/2009/12/smb_guest_ok.png" alt="smb_guest_ok" title="smb_guest_ok" width="396" height="178" class="alignleft size-full wp-image-53" /></p>
]]></content:encoded>
			<wfw:commentRss>http://bashukhan.com/enabling-guest-share-in-samba-windows-accessible/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
