p=`pwd`
for a in `ls -d *-jb2`; do
echo $a
cd $p/$a
svn up
svn merge -c 40657 svn+ssh://svn.evalica.com/usr/local/svn/project/ref-acc/branches/TPL2-REL1_10
svn ci -m "fixed dashboard json problem"
done
Thursday, December 10, 2009
Thursday, December 3, 2009
How to revert (reverse merge) last svn commit from command line (cmd)
Working example on svn 1.6.x (this script reverts and commit latest revision automatically. It is necessary to be in root project directory):
svn up
svn merge -c -`svn info 2>/dev/null | head -n9 | tail -n1 | awk '{ print $4 }'` `svn info 2>/dev/null | head -n2 | tail -n1 | awk '{ print $2 }'`
svn ci -m "reverted invalid commit"
SVN syntax for doing reverse merge:
svn merge -c -{revision you want to revert} {project svn path}
svn up
svn merge -c -`svn info 2>/dev/null | head -n9 | tail -n1 | awk '{ print $4 }'` `svn info 2>/dev/null | head -n2 | tail -n1 | awk '{ print $2 }'`
svn ci -m "reverted invalid commit"
SVN syntax for doing reverse merge:
svn merge -c -{revision you want to revert} {project svn path}
Mass svn commit from command line
Bash script to mass commit in all subdirectories of current directory.
p=`pwd`
for a in `ls -d *`; do
echo $a
cd $p/$a
svn delete src/java/com/xxx/DeployHelper.java
svn ci -m "deleted deploy helper"
done
If you simply need to commit without any confirmations just type svn ci -m "comment"
p=`pwd`
for a in `ls -d *`; do
echo $a
cd $p/$a
svn delete src/java/com/xxx/DeployHelper.java
svn ci -m "deleted deploy helper"
done
If you simply need to commit without any confirmations just type svn ci -m "comment"
Wednesday, November 25, 2009
How to generate random value in bash
Use $RANDOM variable that always contains random value
Example:
echo $RANDOM
Example:
echo $RANDOM
Tuesday, October 20, 2009
Perl inline replacement
Sometimes you need to replace something in a bunch of files. And this something is quite complex, so you can describe it only with regular expressions, or, by some other reason you need to use perl in your replacement string.
Here is a small sample I'm using:
perl -p -i -e "s/SEARCH_STRING/REPLACEMENT_STRIGN/g"
Thursday, October 15, 2009
Thursday, October 8, 2009
Nginx redirect www.example.com requests to example.com or vice versa
server {
server_name www.example.com;
rewrite ^(.*) http://example.com$1 permanent;
}
server {
server_name example.com;
Put here your domain hosting configuration.
}
Monday, October 5, 2009
Random password generate
for ((n=0;n<10;n++)); if="/dev/urandom" count="1"> /dev/null | uuencode -m -| sed -ne 2p | cut -c-8; done
dd if=/dev/urandom count=1 2> /dev/null | uuencode -m - | sed -ne 2p | cut -c-8
dd if=/dev/urandom count=1 2> /dev/null | md5sum | cut -c-26
Friday, October 2, 2009
Thursday, September 24, 2009
How to dump all traffic goes to host from specific IP address
tcpflow -i rl0 "host checking.host and (src 216.113.191.033 or dst 216.113.191.033)"
Subscribe to:
Comments (Atom)