Thursday, September 2, 2010

Deploying LifeRay in Linux Machine From Running Windows

The key to porting Liferay from windows to linux w/ mysql is setting the mysql case sensitivity setting to 1 on the linux mysql server.

1. Backup your windows schema
2. Add the following line to your my.conf file in linux: lower_case_table_names=1 (this is added below [mysql] and/or [mysqld])
3. Start mysql
4. Do restore

All should be well after that.

Tuesday, July 27, 2010

High Availability Cluster On CentOS (Heartbeat)

Pre-Configuration Requirements
##################################
Assign hostname node01 to primary node with IP address 192.168.10.50
Assign hostname node02 to slave node with IP address 192.168.10.51
Assume 192.168.10.52 is the virtual IP address that will be used for our Apache webserver.


Install Heartbeat 
yum install heartbeat-devel
######################################
Now we have to configure heartbeat on node01 and node02
Main files
1, authkeys
2, ha.cf
3, haresources
Just copy all the files from
cp /usr/share/doc/heartbeat-2.1.3/authkeys /etc/ha.d/
cp /usr/share/doc/heartbeat-2.1.3/ha.cf /etc/ha.d/
cp /usr/share/doc/heartbeat-2.1.3/haresources /etc/ha.d/
Configure heartbeat
vi /etc/ha.d/authkeys
Then add the following lines
auth 2
2 sha1  test-ha
change the permission
chmo 600 /etc/ha.d/authkeys
vi /etc/ha.d/ha.cf
logfile /var/log/ha-log
logfacility local0
keepalive 2
deadtime 30
initdead 120
bcast eth0
udpport 694
auto_failback on
node node01
node node02
:wq!
#######################
vi /etc/ha.d/haresources
Then add the following
node01 192.168.10.52 httpd
:wq!
Copy the /etc/ha.d/ directory from node01 to node02 with scp
scp -r /etc/ha.d/*  node02:/etc/ha.d/
#################################
Now edit httpd.conf
vi /etc/httpd/conf/httpd.conf
add this line
Listen 192.168.10.52:80
:wq!
scp httpd.conf node02:/etc/httpd/conf/
now create some test html file on both slave and master
start heartbeat on both system
/etc/init.d/heartbeat start
and then open browser and type http://192.168.10.52/
will b able to see node01 test page
and stop heartbeat on node01 and  refresh the browser you will be able to see node02 test page
############################################################################

Monday, June 28, 2010

Apache Tomcat On Linux

Download tomcat from http://tomcat.apache.org/
Before we begin, we will need to have a Java installed
[nikhil@bom ~]$ which java
/usr/java/jdk1.5.0_11/bin/java
[nikhil@bom ~]$ cat .bashrc
# .bashrc

# User specific aliases and functions

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

PATH=/usr/java/jdk1.5.0_11/bin/:$PATH;export PATH
export JAVA_HOME=/usr/java/jdk1.5.0_11

[nikhil@bom ~]$ mkdir /tomcat
[nikhil@bom ~]$ mkdir /Dowmloads
[nikhil@bom ~]$ mv /Downlods/jakarta-tomcat-Xxxx.tar.gx /opt/tomcat
[nikhil@bom ~]$ tar -xvzf jakarta-tomcat-Xxxxtar.rg
[nikhil@bom ~]$ rm -rf jakarta-tomcat-Xxxxtar.rg
[nikhil@bom ~]$ mv jakarta-tomcat/* .
[nikhil@bom ~]$ rm -rf jakarta-tomcat
Now login to root user and create a user called "tomcat"
[nikhil@bom ~]$ sudo su -
Password:
[nikhil@bom ~]$ sudo su -
Password:
[root@bom ~]# groupadd tomcat
[root@bom ~]# useradd -g tomcat -d /opt/tomcat tomcat
[root@bom ~]# passwd tomcat
[root@bom ~]# chown -R tomcat:tomcat /opt/tomcat
Switch to tomcat user
[root@bom ~]# su - tomcat
Now try to start tomcat with tomcat user
Make sure Java path is correct
[tomcat@bom ~]$ cat .bashrc
# .bashrc

# User specific aliases and functions

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

PATH=/usr/java/jdk1.5.0_11/bin/:$PATH;export PATH
export JAVA_HOME=/usr/java/jdk1.5.0_1
xport CATALINA_HOME=/opt/tomcat
[tomcat@bom ~]#sh /opt/tomcat/bin/startup.sh
[tomcat@bom ~]#sh /opt/tomcat/bin/shutdown.sh
###################################################################################
Administering Tomcat
* Server Status application
* Tomcat Administration Tool
* Tomcat Manager
Tomcat Administrator Role admin This is a built-in role.
Tomcat Manager Role manager This is a built-in role.
Tomcat Administrator Username TomcatAdmin
Tomcat Administrator Password passwd
Open with vi $CATALINA_HOME/conf/tomcat-users.xml
tomcat-users>
role rolename="tomcat"/>
role rolename="role1"/>
role rolename="manager"/>
role rolename="admin"/>
user username="tomcat" password="tomcat" roles="tomcat"/>
user username="both" password="tomcat" roles="tomcat,role1"/>
user username="role1" password="tomcat" roles="role1"/>
user username="TomcatAdmin" password="passwd" roles="admin,manager"/>
tomcat-users>
Save the file, start Tomcat and open a browserYou should be able to access the Administartion Tool web application by clicking on the "Tomcat Administration" link on the left sidebar, make sure u have extracted admin tool also to ur $CATALINA_HOME

Tuesday, May 18, 2010

kills all pids matching the search word of "PROCESS".

ps -ef | awk '/PROCESS/ && !/awk/ {print $2}' | xargs -r kill -9

Wednesday, April 7, 2010

desktop Icons to have no text

No Text Icons

If you would like your desktop Icons to have no text underneath then try this tweak:

Right click the icon and select "Rename"

Now hold the "Alt" key and type "255" and hit Enter

NOTE : It may only work with the keypad numbers and not the number keys on top of the keyboard.

Wednesday, March 10, 2010

How to Limit Linux CPU Usage Per Process

We can use cpulimit program that attempts to limit the cpu usage of a process. Limits are expressed in percentage and not in cpu time. cpulimit does not act on the nice value or other scheduling priority stuff, but on the real cpu usage. Also, it is able to adapt itself to the overall system load, dynamically and quickly.
########################################################################################

TO INSTALL CPULIMIT
#mkdir /cpulimit
#cd /cpulimit
# wget 'http://downloads.sourceforge.net/cpulimit/cpulimit-1.1.tar.gz'
# tar -zxvf cpulimit-1.1.tar.gz
# cd cpulimit-1.1
# make
# cp cpulimit /usr/local/sbin/
# rm -rf cpulimit*
"gcc" need to be installed
To limit CPU usage of the process called thunderbird to 20%, enter:

# cpulimit -e thunderbird -l 20
# cpulimit -p 1818 -l 20

You can also use absolute path name of the executable, enter:
cpulimit -P /pathto/executablefile -l 20

Tuesday, February 16, 2010

This server's clock is not synchronized with the primary domain controller's clock

to set time from primary domain controller
net time /domain:(domain_name) /set

How to backup email acconuts in Microsoft Outlook 2003

locate the following key in registry (start – run – regedit)

HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook

Then right click on the key outlook and then go for next option export and save it an backup folder and run in while restoring outlook .
It will restore your old outlook profile with all email accounts and rules but it does not store the user passwords.

Monday, February 15, 2010

SVN COMMANDS

svn checkout/co

svn checkout or svn co. This command is used to pull an SVN tree such as svn://10.0.0.100/trunk/Test from the server. You should only need to do this once. If the directory structure is changed (as is sometimes necessary), you may occasionally need to delete your local sand box and re-check it out.
svn add

svn add. When you are creating a new file or directory, you need to tell the SVN server about it. This command does that. Note that the file won't appear in the repository until you do an svn commit (see below).
svn propset

svn propset. When you are creating a new file or directory, you generally need to tell the SVN to apply properties to the file in places that have keywords in a special format such as $Date: 2007-04-03 14:28:17 -0500 (Tue, 03 Apr 2007) $. Note that the keyword value won't appear in the file until you do an svn commit (see below).
svn delete

svn delete. This does what it says! When you do an svn commit the file will be deleted from your local sand box immediately as well as from the repository after committing.
svn status

svn status. This command prints the status of working directories and files. If you have made local changes, it'll show your locally modified items. If you use the --verbose switch, it will show revision information on every item. With the --show-updates (-u) switch, it will show any server out-of-date information.

You should always do a manual svn status --show-updates before trying to commit changes in order to check that everything is OK and ready to go.
svn update/up

svn update or svn up. This command syncs your local sand box with the server. If you have made local changes, it will try and merge any changes on the server with your changes on your machine.
svn commit/ci

svn commit or svn ci. This command recursively sends your changes to the SVN server. It will commit changed files, added files, and deleted files. Note that you can commit a change to an individual file or changes to files in a specific directory path by adding the name of the file/directory to the end of the command. The -m option should always be used to pass a log message to the command. Please don't use empty log messages (see later in this document the policy which governs the log messages).
svn diff

svn diff. This is useful for two different purposes. First, those without write access to the BLFS SVN server can use it to generate patches to send to the BLFS-Dev mailing list. To do this, simply edit the files in your local sand box then run svn diff > FILE.patch from the root of your BLFS directory. You can then attach this file to a message to the BLFS-Dev mailing list where someone with editing rights can pick it up and apply it to the book. The second use is to find out what has changed between two revisions using: svn diff -r revision1:revision2 FILENAME. For example: svn diff -r 168:169 index.xml will output a diff showing the changes between revisions 168 and 169 of index.xml.
svn move

svn move SRC DEST or svn mv SRC DEST or svn rename SRC DEST or svn ren SRC DEST. This command moves a file from one directory to another or renames a file. The file will be moved on your local sand box immediately as well as on the repository after committing.

Thursday, January 28, 2010

Mount windows Shares with CIFS

Just create a Empty folder, cifs
# mkdir /cifs
mount -t cifs //serverip/sharename /cifs -o
username=shareuser,password=password,domain=somedomain.com
now go to cifs folder and see u can see all content of windows shared folder !

Tuesday, November 3, 2009

IIS for WinXP Home

Windows XP Home Edition is not come with IIS service. So for those who need IIS to run on some application, there need go for Windows XP Pro Edition. It’s that great that windows xp home edition is come with IIS service? We still can install the IIS service on Windows XP Home edition as the step below.

1. We need the installation CD of Windows 2000 Professional or Server
2. Copy the directory i386 from the WinXP Home to your hard disk (If you don’t have 2 CD-ROM)
3. In this directory (i386) there is a file called IMS.CAB with WinRar (or something similar) unpack the content to a temporary folder (you will need them at the end of the installation)
4. Search for and find the file: c:\WINDOWS\INF\SYSOC.INF
5. In the section [COMPONENTS] you will find this line: iis=iis.dll,OcEntry,iis.inf,hide,7
6. Change it to this: iis=iis2.dll,OcEntry,iis2.inf,,7 (remember to change the name in iis2.dll and iis2.inf and to eliminate the word hide. In this way you bypass the protection of XP home)
7. From the Win2000 cd (Pro or Server) take the files: iis.dl_ and iis.in_ that are in the i386 folder and copy them on your desktop, open a dos windows and with the prompt pointing at your desktop edit the following commands:
EXPAND IIS.DL_ IIS2.DLL
EXPAND IIS.IN_ IIS2.INF
this will generate two new files named iis2.dll and iis2.inf
copy and paste IIS2:DLL to c:\WINDOWS\SYSTEM32\SETUP\
and IIS.INF to c:\WINDOWS\INF\
8. Go to control panel/application/windows components (I don’t have an English version of Windows so I don’t know exactly the name) and start windows installer. You will see “Internet Information server” is now available as a checkable option.
9. Select it (I suggest that if you are looking only for PWS to select only that because the more components you install the more files you have to search for)
10. It will need about 10/15 minutes and during that time the system is going to ask you for a lot of files: some are in XP Home CD other in Win2000 CD. At a certain point the system will ask you for the EXCH_adsiisex.dll file: it is the file you have extracted at the point 3 of this guide, select it and you should go on without trouble.
11. At the end restart you computer.
12. Test if it is working: open Internet Explorer and type in the address line: http://localhost
13. If it will not work, try the following:
open a DOS window and type: iisreset /RESTART
go to web proprieties in “directory protection” (I don’t know if this is the exact name on an English version) click on “modify” (or edit, as said before I don’t have an English version …) “browse” and finally”find”. You will see all user in your PC. Select the one you are working with and click OK. In the text-box you will see PcName\UserName. Click OK to close the window. Remember to uncheck “password Control) and click OK three times. Close and restart the web server and retry point 12. If all is correct you will see the default presentation page of IIS 5 and the online help

Tuesday, October 6, 2009

Disable USB Removable Mass Storage Device Drive Access in Windows

  1. Run Registry Editor (regedit).
  2. Navigate to the following registery key

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor

  3. In the right pane, double click on the Start value name.
  4. Change the value data to 4 to disable the removable USB mass storage device drive access.
  5. To revert and re-enable the drive access for removable USB mass storage device driver, change back the value data for Start to its original default of 3.

How to Hide and Loch Hardisk Drive In windows

  1. Click on the "Start" button. Go to "Run", type "gpedit.msc" and press enter.
  2. Wait for the "Group Policy" window to appear. Click on the "+" button behind "Administrative Templates". Then click the "+" button behind "Windows Components" and then "Windows Explorer".
  3. Search for "Hide these specified drives in My Computer" in the options that appear in the right column of the window. Double click it, enable it and choose the drive(s) you want to hide.
  4. Search for "Prevent access to drives from My Computer". Double click it and repeat the previous step if you want to stop accessing any drive by "command" (e.g, by typing "C:" in the address bar or "Run").
  5. Close the group policy window.
  6. Restart your computer for changes to take effect.

To Remove Drive Open with option

first go to run then write " regedit" that is registry
then find " ctrl+f"
in this box write "mountpoints2" and delete it ......
then again press "ctrl+f" again find mountpoints2 until all these files are not deleted
then u will see ur problems is solved................

Saturday, October 3, 2009

How to install + Yum in Red Hat Enterprise Linux 4

Setting up the yum package manager is not required by everyone who downloads and installs Red Hat Enterprise Linux 4. If you will be using your Linux system on the U of S wireless network or other services that use the yum package manager, you need to complete this step. Red Hat Enterprise Linux 5 will use the yum package manager as the standard package manager.
############################################################


  1. Download the following rpms from http://dag.wieers.com/packages/
  1. Install the rpms as root from the command line.
  2. # rpm -Uvh python* sqlite* yum* rpmforge-release*

  3. Add the ATrpms repository to your /etc/yum.conf by adding the following lines
    [atrpms]
    name=Red Hat Enterprise Linux $releasever - $basearch - ATrpms
    baseurl=http://dl.atrpms.net/el4-$basearch/atrpms/stable
    gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
    gpgcheck=1
  4. Update the yum database.
yum update
Search the packages available from RHN.
yum search wine
Install packages
yum install wine