Kunaljain's Weblog

January 3, 2011

Grep a process ID and kill it

Filed under: Linux Tips & Tricks — Kunal Jain @ 04:46
Tags: ,

Following is the command to grep a process ID and kill it.

ps auxww  | grep wget | awk '{ print $2; }' | xargs kill -9
Advertisements

December 24, 2010

subversion: Server sent unexpected return value (502 Bad Gateway) in response to COPY

Filed under: Linux Tips & Tricks — Kunal Jain @ 07:05
Tags: , ,

Got the following error while branching. Googled the error and found the solution.

Just add the following line in httpd.conf file

RequestHeader edit Destination ^https http early


May 27, 2010

Error – cannot restore segment prot after reloc: Permission denied

Filed under: Linux Tips & Tricks — Kunal Jain @ 05:37
Tags:

Got the following error while starting apache –

cannot restore segment prot after reloc: Permission denied

Then i google a bit and found that it is because of SE linux setting being set to enforcing.

So i temporarily disable enforcemnt.To Temporarily disable enforcement on a running system use the following command

/usr/sbin/setenforce 0

To permanently disable enforcement during a system startup

change "enforcing" to "disabled" in ''/etc/selinux/config'' and reboot.

October 9, 2009

Error:- Missing Dependency: perl(URI) >= 1.17 is needed by package subversion-1.4.2-4.el5_3.1.i386

Filed under: Linux Tips & Tricks — Kunal Jain @ 12:04
Tags: ,

While installing subversion on my CentOS 5.2 64bit OS i got this error

yum install subversion
Missing Dependency: perl(URI) >= 1.17 is needed by package subversion-1.4.2-4.el5_3.1.i386

I google the error and found the solution.

  • Fistly i download perl(URI) which is greater than 1.17. I downloaded perl(URI) 1.35 using the following command
wget http://yum.trixbox.org/centos/5/RPMS/perl-URI-1.35-3.noarch.rpm
  • Then i install the perl package by using following command
rpm -i perl-URI-1.35-3.noarch.rpm
  • Then i install the subversion by using following command
yum install subversion

Now subversion is working fine on my server.

September 27, 2009

Java Error – Error occurred during initialization of VM

Filed under: Java,Linux Tips & Tricks — Kunal Jain @ 08:21

While running Java i faced this problem

Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

This error occur because java was not able to get enough Virtual Memory as i did ulimit -a on my linux machine and i found that the virtual memory and max memory size is limited on my machine.

so i change this to unlimited by editing limits.conf file which is located in /etc/security/limits.conf and now java is working fine.

ulimit -a before making changes in limits.conf file

ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 40960
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) 524288
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 40960
virtual memory          (kbytes, -v) 524288
file locks                      (-x) unlimited

ulimit -a after making changes in limits.conf file

ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 40960
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 40960
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

June 3, 2009

dos2unix: command not found

Filed under: Linux Tips & Tricks — Kunal Jain @ 04:01
Tags: , ,

If you get this error

dos2unix command not found

check the manual for dos2unix. if the manual is present in your distribution it means that dos2unix is installed, find it and add it in your path.

if you found this error

No manual entry for dos2unix

then install in in your distribution( I am using debian) by typing the following command

apt-get install tofrodos

February 10, 2009

Removing RPM packages

Filed under: Linux Tips & Tricks,MySql — Kunal Jain @ 04:14
Tags: ,

Try to remove MySQL from my server which my datacenter guys installed it along with the OS and while doing that i got the following error

shell> rpm -aq | grep mysql | xargs rpm -e

error: “mysql-devel-5.0.45-7.el5” specifies multiple packages
error: “mysql-5.0.45-7.el5” specifies multiple packages
error: “mysql-devel-5.0.45-7.el5” specifies multiple packages
error: “mysql-5.0.45-7.el5” specifies multiple packages

Then i google about this error and with some help from google and rpm manual i use the following command to remove MySQL from my server

shell > rpm -aq | grep mysql | xargs rpm -e --nodeps --allmatches

January 7, 2009

Converting .tif images to .jpg

To convert .tif images to .jpg i use imageMagic which i downloaded from http://www.imagemagick.org/script/download.php
To convert .tif images to .jpg you need to install certain library files which will be used during the conversion process

For jpg i downloaded libjpeg-6b.tar.gz. you can download it from http://www.imagemagick.org/download/delegates/

To install it follow the following steps

shell> cd /usr/local
shell> tar -zxvf libjpeg-6b.tar.gz
shell> ln -s libjpeg-6b libjpeg
shell> cd libjpeg
shell> ./configure; make; make install;

This will install the required jpg library files into your system

Then i downloaded tiff-3.8.2.tar.gz from the same repository mentioned above
To install it follow the following steps

shell> cd /usr/local
shell> tar -zxvf tiff-3.8.2.tar.gz
shell> ln -s tiff-3.8.2.tar.gz tiff
shell> cd tiff
shell> ./configure; make; make install;

Then finally i Install imageMagic with the following steps

shell> cd /usr/local
shell> tar -zxvf ImageMagic.tar.gz
shell> ln -s ImageMagick-6.4.8-3 imageMagic
shell> cd imageMagic
shell> ./configure; make; make install;

Now you are ready to convert .tif files to .jpg simply type the following command

shell> convert fileName.tif newFileName.jpg

you can use convert help to find other parameters to pass with the convert command regarding quality and path to write files and others……

January 5, 2009

Passing username and password in wget command

Filed under: Linux Tips & Tricks — Kunal Jain @ 08:53
Tags:

To pass username and password in wget command so that it will not ask for the authentication use the following syntax

wget --user=userName --password=Password http://www.example.com/index.html

November 29, 2008

bash :- service command not found

Filed under: Linux Tips & Tricks — Kunal Jain @ 11:15

Install sysvconfig on you system. This will fix the problem

apt-get install sysvconfig
Next Page »

Create a free website or blog at WordPress.com.