Linux Manju

May 18, 2010

Intel ( 945 ) Graphics Card and Slow Compiz performance

Filed under: Uncategorized — Tags: , , , — linuxmanju @ 4:07 pm

Compiz historically hates Intel Graphic Cards, if you happen to be one of those ( Un ) Fortunate Intel Graphic card owners, And facing very slow performance.. Here is a trick which worked for me..

Rename the Original compiz binary ( normally in /usr/bin/compiz )

mv /usr/bin/compiz /usr/bin/compiz.orig

Create a shell script with the below contents and save the file as /usr/bin/compiz

vi /usr/bin/compiz    and Add these lines…

#!/bin/bash

ARGS=$@

## Below command in a single line.

LIBGL_ALWAYS_INDIRECT=1 INTEL_BATCH=1 /usr/bin/compiz.orig –replace –indirect-rendering -sm-disable ccp $ARGS &

Once saved.. Set an execuatble bit and restart Xorg
chmod +x /usr/bin/compiz

December 3, 2009

A Killer Combo ( Alfresco and Liferay )

Filed under: Uncategorized — linuxmanju @ 12:44 am

I am not sure.. If I could publish the how to because of my company policy ( Need to check ), But if anyone interested in exploring options, Liferay is an amazing Portal and Alfresco is a feature rich Document Management System. Integrate Both Liferay and Alferesco together, Its the best Killer combination ever.. A true Share Point killer.

But the Pain Point is.. Its not an easy Integration.. Requires many Aspirins to get it working.

If anyone need help on setting it up, Mail me.. If Free.. I may be able to help.

A linuxhater/ Windows Lover blog :)

Filed under: Uncategorized — linuxmanju @ 12:40 am

This is my first ( Or may be second next to First hello world line :P)., With my busy schedule I took out time to write this out of Frustration/ Disgust/ Agony.. etc..

As I was googling for some content, I came across this Linux hater’s blog, Which In my opinion sounds like a stupid guy crying foul  for his own stupidity. All the while the point he was trying  ( I said trying as anyone with little Logic would find the flaws ) to make is why he does not like Linux as much as Windows. Here are some tips for the sadistic people who are or wanna be linuxhater blog kinds..

a) If you LOVE Windows name your blog or site as Windows Lovers blog, Dont name it as linuxhaters blog just for the publicity’s sake.

b)  If YOU dont know how to make things work, Its YOUR own fault.. ( For a remark on Opensource developer did not do a good work on this and that.. I am sure you are not even close to their competency.. Even if it does not work , Atleast they did something, What have you done in life??.. If you are that smart go fix it  or develop one on your own :P )

c)  Copy pasted from the Author’s site on update manager does not honor http_proxy…   ”They try to do something that doesn’t respect http_proxy and has to time-out before progressing. What year is this? really guys?”

My comments:- Man you are sooooo very disgusting.. You use proxy which is not transparent (1980s Style ) and dare to ask the stupid question  what year is this .. You make me laugh my a** out.

d) Never use Linux Like windows.. Both are good at their place ( Really .. I mean it :P )..

e) I have updated my Ubuntu 100 times sofar.. without any issues .. ( May be a small hickups here and there , which are easily fixed ). Compare that to a Windows driver update which killed almost 250 PCs in one of the companies I worked for.

In author’s understandable Language.. If you like Windows, Not Linux.. thats your Fu*** problem, When Millions of people around the world are using Linux, and if you say you cant, That proves who is THE Fu*** Retard.

November 19, 2009

Tomcat Name Based Virtual Hosting How to

Filed under: Uncategorized — Tags: , , , , — linuxmanju @ 1:13 am

Confluence :- A feature rich Wiki/ Document Management system from atlassian

Jira:- An Excellent Bug/ Issue Tracking system.

Challenge is to run Both with a single instance of tomcat

Tomcat Name Based Virtual Hosting How to ( For Yellow.ec2.example.com Jira along with Confluence )

Intended Audience:- Sysadmin

Goal:- Is to achive Confluence and Jira parallelly in the same system

Pre-Requisites:- Tomcat, Apache with Mod_jk, DNS entry for 1) support.example.com 2) CNAME/IN for docs.example.com, Latest Stable Build of Confluence and Jira .

Aproaches and Challenges:-

There are two different approaches one can take for this.

a) Run  Two tomcat instances one each for Jira and Confluence ( Built in Tomcat with the applications ) in two different ports, Add proxy pass or configure Mod_jk Redirection with Name Based Virtual Host setup in Apache

Drawback of the above setup:-

Server Overhead as there would be two tomcat instances, Separate Rewrite rules for each Container No system wide defaults.

b) Second approach would be to configure one of the Tomcat instance ( Either Jira or Confluence ) to serve both the Containers ( Jeera as well as Confluence )

The second approach is better as compared to the first one as a) No additonal system over head ( 1 Tomcat Insatnce per server ) 2) Single System wide configuration of Apache/ Mod_jk.

For this document we will go with the second approach.

Server Setup:- Install Ubuntu Jaunty, Install Java, Create user jira, Configure JAVA_HOME pointing to JDK installation root path ( For eg.. /usr/local/java ) in .bashrc

Download Jira and Confluence from Atlassian, Untar it in /mnt/ebs

tar zxvf jira*.tgz -C /mnt/ebs

tar zxvf confluence*.tar.tgz -C /mnt/ebs

Configure jira and mod_jk in apache su - jira ( Will be covered in a different Document )

Run the jira and test the setup.

Create a Directory for confluence data

mkdir -p /mnt/ebs/confluencedata

Change ownership to user jira

chown -R jira  /mnt/ebs/{confluence*,jira*}

Configure Confluence:-

Open /mnt/ebs/confluence*/confluence/WEB-INF/classes/confluence-init.properties

Add a line which reads like below

Configure Name Based Virtual Containers in Tomcat:-

open /mnt/ebs/jira*/conf/server.xml

Locate the line which reads

<engine name=”Catalina” defaultHost=”localhost” >

Change it to

<engine name=”Catalina” defaultHost=”support.example.com”>

Locate the line which reads

<host name=”localhost” appbase=”webapps” unpackWARs=”true” autoDeploy=”true”>

Change it to

<host name=”support.example.com” appbase=”webapps” unpackWARs=”true” autoDeploy=”False”>

Go to the end of </Host> and insert the below lines for Confluence setup

<Host name=”docs.example.com” debug=”0″ appBase=”/mnt/ebs/confluence-3.0.2-std/webapps” unpackWARs=”true” autoDeploy=”False”>

<Context path=”/mnt/ebs/confluence-3.0.2-std/confluence” debug=”1″  >

<Manager pathname=” ” >

</Context>

</Host>

Add additional hostnames in /mnt/ebs/www/conf/000-default ( Optional .. Speeds up performance by eliminating Reverse Lookup for each new request)

Restart tomcat..

su - jira -C  “./ $HOME/.bashrc && /mnt/ebs/jira*/bin/startup.sh

If all is well you should be able to access Jira on http://support.example.com and Confluence at http://docs.example.com

August 24, 2009

An Example link Failover Script ( MPLS to OpenVPN ) With Mail Alerts

Filed under: FreeBSD, Linux, Uncategorized — Tags: , , — linuxmanju @ 7:47 pm

Objective:-

To monitor the Link and Change over to alternate link if the link goes down. If it comes back up, Revert the link back.

This Document Assumes. 1) You have a working MPLS/VPN setup,

#!/usr/bin/perl -w
#
#############
########### Written By Manjunath #####
######## http://linuxmanju.com
use Net::SMTP;

my $IFCNF=”/sbin/ifconfig”;
my $OVPN=”/usr/local/sbin/openvpn”;
my $SWALL=”/sbin/shorewall”;

####### Change this to your gateway to monitor ##

my $GW=”10.1.28.105″;

###### Change my.mailserver.com to the Email Server IP ###
my $smtp = Net::SMTP->new(’my.mailserver.com’,Timeout => 30);

######## Change username and password to the SMTP AUth Username and Password
$smtp->auth ( ‘username’, ‘password’ ) or die “Could not authenticate $!”;

############# Change From Address and To address below.
$smtp->mail(’alert@mydomain.com’);
$smtp->to(’linux-report@mydomain.com’);
$smtp->data();
$smtp->datasend(’From: pondi-alert@mydomain.com’);
$smtp->datasend(”\n”);
$smtp->datasend(’To: manjunathkp@mydomain.com’);
$smtp->datasend(”\n”);

sub mplscheck {
if ( system(”ping -c4 $GW  > /dev/null”) != 0) {
if ( ! -e “/var/lock/mpls.lck” ) {
system(’logger -p info “Mpls Link is down”‘);
system(”$IFCNF eth2 down”);
sleep 4;
system(”$IFCNF eth2 up”);
system(”$OVPN –config /etc/openvpn/openvpn.conf –daemon”);
system(”$SWALL restart /etc/shorewall.ovpn”);
$smtp->datasend(’Subject: MPLS link Down..’);
$smtp->datasend(”\n \n”);
$smtp->datasend(”\n \n MPLS link is Down in Pondichery.. Unable to reach the gateway..”);
$smtp->dataend();
open LCK, “>/var/lock/mpls.lck” ;
close LCK;
}
}
elsif ( -e “/var/lock/mpls.lck” )  {
system(’logger -p info “Mpls Came back Up”‘);
system(”/bin/kill -SIGTERM openvpn”);
system(’/etc/scripts/connections.sh’);
unlink(”/var/lock/mpls.lck”);
$smtp->datasend(’Subject: MPLS link Came Back up..’);
$smtp->datasend(”\n \n”);
$smtp->datasend(”\n \n MPLS link Came back up.. Able to reach the gateway..”);
}
}

mplscheck();
$smtp->quit;
Copy the script to /usr/bin and chmod +x /usr/bin/myscript.pl

Put the above script in the crontab for every 5 minutes ( Or less/more ) For eg..

*/5 * * * * /usr/bin/myscript.pl

February 9, 2009

Enlightenment DR 17 Install on Debian

Filed under: Uncategorized — Tags: , , , — linuxmanju @ 1:45 pm

Download Reasye17.sh from http://exchange.enlightenment.org/application/show/124

The script started showing errors on the first run.. As the package names changed ( I am using Debian Sid 64bit )

As a workaround…

Modify the below packages…

sed -i ’s/libjpeg-dev/libjpeg62-dev/g’ Reasye17.sh

sed -i ’s/libfontconfig-dev/libfontconfig1-dev/g’ Reasye17.sh
Once done become root and run Reasye17.sh

sh Reasye17.sh

Select Debian as the OS…

Grab a coffee till it finishes :)

This is what How my desktop looks like now..

Apache http to https redirection

Filed under: FreeBSD, Linux — Tags: , , , , — admin @ 1:35 pm

I wanted to force all users to use https://mymailserver.com instead of http://mymailserver.com.

Open apache config file (   httpd.conf or apache2.conf  or sites-enabled/000-default  ?? )

Add these lines

RewriteCond %{HTTPS} !=on
RewriteRule ^(.*) https://%{SERVER_NAME}$1 [R,L]

/etc/init.d/apache2 restart

January 18, 2009

Firefox 3 ( 64 bit ) Flash player

Filed under: Uncategorized — Tags: , , , — linuxmanju @ 1:27 pm

1) Download the 64bit flash player from..

wget http://download.macromedia.com/pub/labs/flashplayer10/libflashplayer-10.0.d20.7.linux-x86_64.so.tar.gz

2) mkdir $HOME/.mozilla/plugins

3) tar zxvf libflashplayer-10.0.d20.7.linux-x86_64.so.tar.gx -C $HOME/.mozilla/plugins

4) pkill -9 firefox

January 16, 2009

High Availibility of Web Server Using UCarp

Filed under: Linux, Uncategorized — Tags: , , , , — admin @ 6:41 pm

Easy way to to achieve 99.99999  with uCarp.

Example Setup:-

1) Server1 — IP Address 192.168.0.10

2) Server2 — IP Address 192.168.0.100

Floating IP:-  192.168.0.200 ( This is the Virtual IP Which will be owned by the master server )

Service provided:- Webserver ( My production env has three instances of Bugzilla and Wiki Pages. All bugzilla and Wiki’s are configured to use a Centralized Mysql Database host with different DBs ).

Step By Step:-

1) Login to Server1 and copy all /var/www to server2 /var/www

scp -rp /var/www root@server2-IP:/var/www

2) Make sure that the pages ( Web pages are accessible from server 1 and server 2’s ip http://server1 http://server2

3) Download ucarp from http://download.pureftpd.org/pub/ucarp/ ( Go with the latest version ) on both the servers

Both Servers:-

wget http://download.pureftpd.org/pub/ucarp/ucarp-1.5.tar.gz

tar zxvf ucarp-1.5.tar.gz

cd ucarp-1.5.

./configure && make && make install-strip

4) Once installed on both the servers ucarp should be available in /usr/local/sbin/ucarp

On Server 1 and Server2 Create two  files Called vp-up.sh and vp-down.sh with the following contents

vi /etc/vp-up.sh

#!/bin/bash

### Add Floating IP

/sbin/ip addr add 192.168.0.200/24 dev eth0

#### My Switch / gateway is not smart does not flush the arp cache. So send a broadcast
/sbin/arping -c 5 -i eth2 -S 192.168.0.200 192.168.0.1
/sbin/arping -c 5 -i eth2 -S 192.168.0.200 192.168.0.14
echo “WebServer not reachable” | /usr/bin/mail -s “Master webserver down” server-admin@xxx.com

vi /etc/vip-down.sh

#!/bin/bash
/sbin/ip addr del 192.168.0.200/24 dev eth0
echo “Changing Roles of the Web server” | /usr/bin/mail -s “Changing role Reverting to Backup State..” server-admin@xxx.com

Put both Files in /etc/vip-up.sh and /etc/vip-down.sh in both the servers ( Feel free to modify the script according to your requirement.

chmod +x /etc/vip-*.sh

Ucarp Magic:-

In the master server:-

Run:-

/usr/local/sbin/ucarp -v 42 -P -p somepasswd -a 192.168.0.200 -s 192.168.0.10 –upscript=/etc/vip-up.sh –downscript=/etc/vip-down.sh &

In the Secondary Server:-

/usr/local/sbin/ucarp -v 42  -b 2 -k 1 -p somepwasswd -a 192.168.0.200 -s 192.168.0.100 –upscript=/etc/vip-up.sh –downscript=/etc/vip-down.sh &

( The difference between both is the -s < IP ADDR > and in the second server -b2 -k1 and no -P Which means advertisement frequency is 2 seconds and Skew is 1 Second Which is higher than the master’s default 1Sec. This will force Master to own the virtual IP whenever its online ).

Test:-

Open UP http://192.168.0.200 ( Or do a continuous ping )

Bring the master down. The Slave will automatically server the request. Bring back the master up. It will take over again. The HA is ready..

Note:- If your web server has alot of dynamic data.. please make sure to sync the server1:/var/www and server2:/var/www periodically

In case of a problem Please mail me to manjunath<at> linuxmanju.com

November 11, 2008

rsh password less login in Ubuntu

Filed under: Linux — Tags: , , — admin @ 12:41 pm

rsh-server in Ubuntu does not honor + + ( Allow everyone from every host ) in /etc/hosts.equiv and buggy.

Here is a workaround for the same.

vi /etc/hosts.equiv and make sure to add these lines ( If its not there create a file )

# /etc/hosts.equiv: list  of  hosts  and  users  that are granted “trusted” r
#                   command access to your system .
#
+ +

apt-get install rsh-redone-server

 ( You might have to remove rsh-server )

Once done.. you should be able to rlogin and rsh the host without a password.

Older Posts »

Powered by WordPress