killj.sh is a bash script which kills my Java processes that consists 'javaagent' keyword. The application needs 'javaagent' as VM parameter; so, I am looking for it to kill the right process.
#!/bin/bash
for i in `ps -ef | grep javaagent | cut -c10-14`
do
/bin/kill $i
echo " $i has killed."
done
if [ $(ps ax | grep -c javaagent) -gt 1 ] ; then
echo "NOTE: There are more alive java process yet!!!"
else
echo "DONE"
fi
for i in `ps -ef | grep javaagent | cut -c10-14`
do
/bin/kill $i
echo " $i has killed."
done
if [ $(ps ax | grep -c javaagent) -gt 1 ] ; then
echo "NOTE: There are more alive java process yet!!!"
else
echo "DONE"
fi
rmsvn.sh removes .svn folders recursively.
#!/bin/bash
echo
echo "Warning!!!"
echo "CHECK BELOW PATH. This will remove all .svn folders recursively!!!"
pwd
read -p "Are you sure (yes/no)? "
[ "$REPLY" == "yes" ] && rm -rf `find . -type d -name .svn` && echo "all .svn folders have been removed!!!"
Also I added below lines at the end of .bashrc file:
alias lt='ls -alt | head -20'
alias ld="ls -al -d * | egrep '^d'"
alias c="mvn clean"
alias ci="mvn -Pdev -DskipTests clean install"
alias i="mvn -Pdev -DskipTests install"
alias jkill="/bin/killj.sh"
alias rmsvn="/bin/rmsvn.sh"
alias go="cd /home/amir/projects/company/jcb2"
alias dpiproxy="sudo cp -f /etc/tor/torrc.dpi /etc/tor/torrc"
alias noproxy="sudo cp -f /etc/tor/torrc.noproxy /etc/tor/torrc"
alias tor="sudo /etc/init.d/tor restart"
Now, compiling, cleaning and killing processes are much easier...
No comments:
Post a Comment