Archive for category Linux
Maildir search at its best!
Search, search and search – that’s what we all do in daily inhabitance. When it comes to maildir, the ‘mu-tools’ 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’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’re ready to go! However, that’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 ‘stability’ over ‘updates’. Both of these infrastructures have their own downsides. Perhaps, that’s the reason why RHEL is widely deployed as server OS comparative to other distributions.
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’s not that hard if you know the calculated amount of steps involved:
- Compiling glib 2.24
- Compiling and installing xapian and xapin-config
- Adding /usr/local/bin/pkg-config to current PKG_CONFIG_PATH
- Fixing that notorious bug of “undefined reference to sqlite3_prepare_v2″ in sqlite-dev package that exists in all RHEL related packages (not needed as version 0.7 eliminates sqlite dependency by using xapian instead)
Presuming that you’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.
1. Installing glib2, updating system library and exporting pkg-config path.
# 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 "/usr/local/lib/" >> /etc/ld.so.conf.d/glib2-i386.conf # ldconfig # export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
2. Installing gmime
# 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
3. Installing xapian
# 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
4. Compiling and installing mu
# 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
That’s all you need to get started. There’s no other tool like ‘mu view’ (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.
Wish a nice playing with it!
PC speaker and CentOS 5
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 ‘I claim that Mach people (and apparently FreeBSD) are incompetent idiots’) 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’t always have a monitor plugged into their consoles.
As I used ‘beep’ program already a few times in Ubuntu I knew it would be interesting to use it with new ‘-n’ feature instead of using issuing beep command for an each frequency beep. That is, the whole script here at http://redmine.pfsense.org/repositories/annotate/pfsense/usr/local/bin/beep.sh can be translated into a single beep command of:
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
But after installing beep and running didn’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’s internal one for producing system bells. Basically its a bug called as an ‘aggression’ for a feature that breaks of with any newer kernel release. I saw multiple bugs relating to the problem in Red Hat’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′s lastest kernel, 2.6.18-194.8.1.el5 and that gave me back my system beeps
[root@Bassu ~]# dmesg | grep -i ‘speaker’
input: PC Speaker as /class/input/input2
[root@Bassu ~]# lsmod | grep -i spkr
pcspkr 7105 0
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’s ntsysv services – exactly what I needed! Then I found another beep melody for Beethoven’s theme
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
Add below script to file, /etc/init.d/beep, make it executable and do a ‘chkconfig –add beep’ to add it as a system service.
#!/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="-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"
MELODY_STOP="-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"
SCRIPTNAME=/etc/init.d/$NAME
#ARGS="-e /dev/input/event0"
# Exit if the package is not installed
[ -x "$BEEP" ] || exit 0
case "$1" in
start)
$BEEP $ARGS $MELODY_START
;;
stop)
$BEEP $ARGS $MELODY_STOP
;;
restart|force-reload)
# Do nothing
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
exit 3
;;
esac
With that said, coming out of Mario world and now going back to my laziness
UPDATE:
Talking about the Mario, I just created its beep command from some random junk of frequencies I found. So, here it goes:
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
More Raid tidbits – Monitoring all raid events and changing default email template
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’t work here like it always (oh, its a long story – I should tell some of it sometime later)!
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’t event knowing that ‘mdadm –monitor’ only sends you the critical updates. So, I pulled up man pages and saw these are critical events:
- DeviceDisappeared
- Fail
- FailSpare
- DegradedArray
Rest of the events are not reported at all! Also, that RHEL5′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:
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
Seriously, it says “faithfully”… wth? Lol. We know that all machines are faithful to a human unless they’re not broken or gay!
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’t when PROGRAM parameter is used in /etc/mdadm.conf by passing on RAID array as arguments to the script which is used, instead.
I did this then.
# mdadm --detail --scan >> /etc/mdadm.conf # echo "PROGRAM /etc/raidalerter" >> /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 "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" $(cat -A /proc/mdstat | sed 's/\$/\\n/g') | mail -s "$1 on $2 $3 at $HOSTNAME" some-mail-address@example.com # chmod +x /etc/raidalerter # service mdmonitor restart
Provided that you’ve an MTA working fine, mails would be delivered upon any of RAID incidents to the maximum verbosity possible. I don’t think that any of the hardware raids does so?!
I then tested it on a small array to make sure that alerts are deliverable.
# 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
Preview:
Subject: RebuildFinished on /dev/md0 at ToughGuy
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 :
[raid1]
md1 : active
raid1 sdb3[1] sda3[0]
724555520 blocks [2/2] [UU]
md0 : active
raid1 sdb1[1] sda1[0]
4008064 blocks [2/2] [UU]
unused devices: <none>
HA LB Cluster on CentOS5 – Without actual heartbeat :P
Last month I wrote a howto for highly available load balanced Piranha cluster using Red Hat’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 “heartbeat” 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’m so much against of having it are numerous:
- Running heartbeat snatches the independence of managing virtual IP addresses on load balancer by hand.
- Thus restricting expansion of the pools!
- Ldirector’s daemon must be managed by heartbeat when its running.
- Waste of resources in utilization; such with a sheer restart of heartbeat service and it just sits on waiting and waiting,…
- And above all, I don’t need a “second” 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’s when acting as a divider and a monitor for distributing requests between web servers.
Environment
Requirements: At least three systems, each with a minimum of one IP (CentOS in my case). Packages ‘heartbeat’, ‘heartbeat-ldirector’ for load balancing and ‘ipvsadm’ for Linux IP Virtual Server. I know you’re thinking that why the ‘heartbeat’ when actually we’re not going to run it. In fact, we’re not going to run it; its just for a dependency resolution, rather a service startup requirement – I should say (/etc/ha.d/shellfuncs is the file needed)! And I swear we won’t run it
! So these are the packages which shape into a project Ultramonkey when combined and it describes the different topologies of a functional HA LB cluster but that’s not our concern, anyway
(perhaps yours if you think you’ve a bit of free time)
Virtual IP: 10.10.10.60
Load Balancer: 10.10.10.61 aka VM1.
Cluster Nodes/Real Servers:
Web Server1: 10.10.10.62 aka VM2
Web Server2: 10.10.10.63 aka VM3.
And we’ll be using LVS-DR (direct routing) approach for clustering; its most widely used and has lesser downsides.
Lets start by configuring the web servers first.
Cluster Nodes Configurations
1. On both web servers VM2 and VM3, apache should be running having a common serving file (for purpose of get checked by ldirectord).
# yum install httpd -y # echo foo > /var/www/html/test.html # service httpd start # chkconfig httpd on
And to distinguish both of the web servers during test loading, create at least a one unique file on each of web servers.
[root@VM2 ~]# echo "This is VM2" > /var/www/html/index.html [root@VM3 ~]# echo "This is VM3" > /var/www/html/index.html
2. Virtual IP needs to be terminated on both web servers so we’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’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’ve found is:
a. create a loopback interface so it doesn’t communicate with your network gateway/router directly.
b. 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.
c. instruct Linux kernel to send ARP responses only to the requests originating from same sender address to same local addresses’ subnet. Details here, if you’re really curious about it.
# 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
Load Balancer Configuration
We’ll be going through:
a. installing required packages
b. enabling IP forwarding,
# 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
c. configure secondary eth0 for VIP as its going to be exposed to outside world or your local gateway and
# 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
d. then creating ldirector.cf, the configuration file of our load balancer, respectively!!
# vi /etc/ha.d/ldirectord.cf checktimeout=10 checkinterval=2 autoreload=no logfile="/var/log/ldirectord.log" 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="test.html" receive="foo" scheduler=wrr protocol=tcp checktype=negotiate # service ldirectord start
Option ‘quiescent’ just removes the real server from ipvs table whom ldirectord doesn’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 “gate” switch in ‘real’ server’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 ‘man ldirectord’.
Testing
Use ‘ipvsadm’ 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’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.
If everything works good, you’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.
[root@VM1 ~]# ipvsadm -l IP Virtual Server version 1.2.1 (size=4096) Prot LocalAddress:Port Scheduler Flags -> RemoteAddress:Port Forward Weight ActiveConn InActConn TCP 10.10.10.60:http wrr -> 10.10.10.63:http Route 1 0 0 -> 10.10.10.62:http Route 1 0 0
For a more meaningful testing
$ 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
I’ll be posting a couple of optimizations techniques soon when I’ll be getting some more free time. Stay tuned and take care
checkinterval=2
autoreload=no
logfile=”/var/log/ldirectord.log”
quiescent=yes
virtual=10.10.10.60:80
real=10.10.10.62:80 gate
real= 10.10.10.63:80 gate
service=http
request=”index.html”
receive=”hi”
scheduler=wlc
protocol=tcp
checktype=negotiate
ASCII Art in Linux
I’m fond of two ascii art tools in Linux.
- linux_logo
- figlet
Both of these are available in RPMForge/Dag’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).
Installing HPLIP 3.9.10 on CentOS 5.4 for newer printers (HP LaserJet M1120 MFP)
CentOS 5′s base repository has an older version of HPLIP, something about ’1.6.7′ 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 – if you’re thinking that then no, that won’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’em reduced to 10 but no far lesser than that if you know what I mean.
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
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’s devs and techs saying a big “no” 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’ forum.
After being in disappointed (oops wth) situation, I tried running the RHEL5′s rpm (can be downloaded from hplip’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.
Installing……
# 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
So, I decided to remove problematic hpijs
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)
But realised soon that it also removed libsane sub-dependency as well.
# 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
Because installing sane would also install hpijs and other conflicting stuff as well so the solution here was to remove problematic packages without ‘removing’ any dependencies needed.
[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%] #
Concluding the overall steps:
# 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
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
NOTE: If this post helped you out or provided you with ways of troubleshooting, feel free to say a little thanks
Mail from root, root and root! :>
I’m sometimes pretty sick of getting emails from ‘root’ 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’s because I’m fed up of seeing root everywhere and that’s why I’ve an alias for root to forward all these rootish emails to one of my email addresses. But that’s just not enough as I actually want to see a humane human name as a sender just instead of root :>
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 ‘root’ (although some apps like ‘exim -f’ and mutt having SET FROM defined in ~/.muttrc allow you to change sending address while emailing from command line but this isn’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’s address rewriting can be helpful here so after installing it and changing default MTA with ‘alternative –config mta’ I added a quick rewrite at transport.
$ grep -A 5 remote_smtp /etc/exim/exim.conf | tail -5 driver = smtp headers_rewrite = root@* some-email-address@example.com fsr
This worked but didn’t change the FROM field’s name as expected. I tried combinations of different settings including the rewrite tag ‘F’ 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 ‘from’ envelop address is changed with ‘w’ tag and allows to have a new sender name (RFC 822) to be configured. So I added.
$ 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@* "Abbas <some-email-address@example.com>" fsrw return_path = some-email-address@example.com
And boo you naughty (!) root
![]()
Redundant customized XenServer
I just finished setting my home XenServer making it fully redundant, mirrored and backup’ed. Thought, I would share what’s on it
- Raid1 setup on boot, grub as well as VM storage repository. If one of the hard goes down, it’ll boot from other one.
- Samba installed to have a share setup in a raid array of 700GB
- Raild alerts are configured to email me whenever there’s any issue
- Smartmontools are running to make sure that hard disks are healthy and have emails alerts configured as well.
- 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.








Recent Comments