Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Monday, September 6, 2010

Moving files and folders in Tortoise SVN

If you want to do a simple in-place rename of a file or folder, use Context Menu → Rename... Enter the new name for the item and you're done.
If you want to move files around inside your working copy, perhaps to a different sub-folder, use the right-mouse drag-and-drop handler:
  1. select the files or directories you want to move
  2. right-drag them to the new location inside the working copy
  3. release the right mouse button
  4. in the popup menu select Context Menu → SVN Move versioned files here

Tuesday, August 10, 2010

How to use sudo in Linux

Two ways to use sudo in Linux-
1. sudo -u username -H bash”
and

2. sudo –u username -s

Tuesday, April 20, 2010

Quick tip to use tail command in Linux

>tail [no. of lines] [file name] | [ more]

more will give you page wise listing and you can press enter to go to next page

Eg.
>tail -100 my.log  | more

Tuesday, July 15, 2008

Cron on Linux ( Learn easy and fast)

Schedule a job on Linux Machine. ( Job Scheduler)
1. Using Cron$ crontab -ewhich will start the editor (or vi) and load the current cron table file for this user, or a blank file if none exists.
2. Time Discription
#mh hd dm my dw command
(every line starting with a pound symbol (#) is a comment) fields are:
minute of the hour
hour of the day
day of the month
month of the year
day of the week
command line
3. Crontab Examples
0 12 * * * /opt/command.sh
This command will execute every day at noon.

4. Cron Job Output
0 12 * * * /opt/command.sh > /opt/file.log
output of command.sh will be overwritten to file.log everytime cron job runs
0 12 * * * /opt/command.sh >> /opt/file.log
output of command.sh will be appended to file.log everytime cron job runs

Check time on Linux Machine

Use
date
hwclock

Monday, May 19, 2008

Useful Linux Commands

Installing Java:
1. chmod 744 jre-1_5_0_15-linux-amd64-rpm.bin
2. Run ./jre-1_5_0_15-linux-amd64-rpm.bin \
java is intalled.
Now to make it active do following:
1. edit .bashrc
2. add PATH=$PATH:/usr/local/bin
where /usr/local/bin is the pate where java is installed.
If you dont want to edit Path variable than create symbolic link (ln) in directory /usr/bin for java, javac , and other utilities you want to use of jre.

Installing Tomcat:
1. Unjar tomcat.tar in the directory you wish to set up tomcat.
2. put following tomcat script in /etc/init.d/
---------------script tomcat----------------------
# This is the init script for starting up the
# Jakarta Tomcat server
#
# chkconfig: 345 91 10
# description: Starts and stops the Tomcat daemon.
#
# Source function library. . /etc/rc.d/init.d/functions
# Get config. . /etc/sysconfig/network
# Check that networking is up.[ "${NETWORKING}" = "no" ] && exit 0
tomcat=/usr/local/tomcat/apache-tomcat-6.0.16
startup=$tomcat/bin/startup.sh
shutdown=$tomcat/bin/shutdown.sh
start(){
echo -n $"Starting Tomcat service: "
#daemon -c
$startup
RETVAL=$?
echo
}
stop(){
action $"Stopping Tomcat service: " $shutdown
RETVAL=$?
echo
}
restart(){
stop
start
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
# This doesn't work ;)
status tomcat
;;
restart )
restart
;;
*)
echo $"Usage: $0 {startstopstatusrestart}"
exit 1
esac
exit 0
-----------------------------------------------------------------------------------
3. chmod a+x tomcat
4. chkconfig --add tomcat and your service is set :
use "service tomcat start" command to test your service
5. to check tomcat is running ------------------ netstat -vatn grep 8080
6. " dos2unix tomcat" to fix dos to unix conversion issue tomcat" to fix dos to unix conversion issue