From d49134acfc5ad13591f660779c84469149c67041 Mon Sep 17 00:00:00 2001 From: vgoah Date: Sun, 23 Jan 2011 07:16:08 +0000 Subject: [PATCH] to thin --- .gitattributes | 17 +----- other-sh/b.txt | 0 other-sh/ba.bat | 1 - other-sh/g2.sh | 2 - other-sh/history.bat | 1 - other-sh/igo.bat | 1 - other-sh/justsh.bat | 3 - other-sh/makebz2.bat | 2 - other-sh/msn.bat | 1 - other-sh/mt.sh | 162 ++++++++++++++++++++++++++++++++++++++++++++++++++ other-sh/mygenv.bat | 28 ++++----- other-sh/mygtotal.bat | 7 ++- other-sh/mygwin.bat | 16 ++--- other-sh/readme.txt | 2 - other-sh/rss.bat | 1 - other-sh/ssh.sh | 6 -- other-sh/tel.bat | 1 - other-sh/tempa.sh | 3 - other-sh/tempb.sh | 2 - other-sh/tempn.sh | 2 - other-sh/tmd.bat | 2 - 21 files changed, 190 insertions(+), 70 deletions(-) delete mode 100644 other-sh/b.txt delete mode 100644 other-sh/ba.bat delete mode 100644 other-sh/g2.sh delete mode 100644 other-sh/history.bat delete mode 100644 other-sh/igo.bat delete mode 100644 other-sh/justsh.bat delete mode 100644 other-sh/makebz2.bat delete mode 100644 other-sh/msn.bat create mode 100644 other-sh/mt.sh rewrite other-sh/mygenv.bat (90%) delete mode 100644 other-sh/readme.txt delete mode 100644 other-sh/rss.bat delete mode 100644 other-sh/ssh.sh delete mode 100644 other-sh/tel.bat delete mode 100644 other-sh/tempa.sh delete mode 100644 other-sh/tempb.sh delete mode 100644 other-sh/tempn.sh delete mode 100644 other-sh/tmd.bat diff --git a/.gitattributes b/.gitattributes index 8627292..e458852 100644 --- a/.gitattributes +++ b/.gitattributes @@ -44,8 +44,6 @@ other-sh/addtkcvs.sh -text other-sh/auto_back.sh -text other-sh/auto_cvsback.sh -text other-sh/autormswp -text -other-sh/b.txt -text -other-sh/ba.bat -text other-sh/changdate.sh -text other-sh/change-suffix.sh -text other-sh/changeip.bat -text @@ -66,21 +64,16 @@ other-sh/dvipdfmx.exe -text other-sh/eclipse-here.bat -text other-sh/eclipse-here35.bat -text other-sh/fm.sh -text -other-sh/g2.sh -text other-sh/gedit_sendto.bat -text other-sh/getip1.py -text other-sh/gvim-mints.bat -text other-sh/gvim_sendto.bat -text -other-sh/history.bat -text other-sh/home_proxy.sh -text -other-sh/igo.bat -text other-sh/input_zap.sh -text other-sh/jad.exe -text -other-sh/justsh.bat -text -other-sh/makebz2.bat -text other-sh/mo-mints.bat -text other-sh/mounty.sh -text -other-sh/msn.bat -text +other-sh/mt.sh -text other-sh/mycd.sh -text other-sh/mygdevfox.bat -text other-sh/mygenv.bat -text @@ -102,31 +95,23 @@ other-sh/p -text other-sh/pushscrap.sh -text other-sh/ras_lifan.sh -text other-sh/rax_lifan.sh -text -other-sh/readme.txt -text other-sh/restore_e_cache.sh -text other-sh/restore_fa.sh -text other-sh/return_office_proxy1.sh -text other-sh/return_office_proxy2.sh -text other-sh/returnip.bat -text other-sh/rmswp -text -other-sh/rss.bat -text other-sh/sendmail3.py -text other-sh/shut.sh -text other-sh/softbackup2.sh -text other-sh/split.bat -text -other-sh/ssh.sh -text other-sh/start.sh -text other-sh/sunrise.sh -text other-sh/synscrap.sh -text other-sh/t.bat -text other-sh/tailfs.bat -text other-sh/tdir.sh -text -other-sh/tel.bat -text -other-sh/tempa.sh -text -other-sh/tempb.sh -text -other-sh/tempn.sh -text other-sh/test2.sdl -text -other-sh/tmd.bat -text other-sh/u2.sh -text other-sh/vi-mints.bat -text other-sh/vmore -text diff --git a/other-sh/b.txt b/other-sh/b.txt deleted file mode 100644 index e69de29..0000000 diff --git a/other-sh/ba.bat b/other-sh/ba.bat deleted file mode 100644 index 9ecd95f..0000000 --- a/other-sh/ba.bat +++ /dev/null @@ -1 +0,0 @@ -run bash %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/other-sh/g2.sh b/other-sh/g2.sh deleted file mode 100644 index 31c0066..0000000 --- a/other-sh/g2.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!bash -/opt/gnome2/bin/gvim $* diff --git a/other-sh/history.bat b/other-sh/history.bat deleted file mode 100644 index 123cb75..0000000 --- a/other-sh/history.bat +++ /dev/null @@ -1 +0,0 @@ -start firefox http://www.google.com/history diff --git a/other-sh/igo.bat b/other-sh/igo.bat deleted file mode 100644 index 3aed98a..0000000 --- a/other-sh/igo.bat +++ /dev/null @@ -1 +0,0 @@ -start firefox https://www.google.com/ diff --git a/other-sh/justsh.bat b/other-sh/justsh.bat deleted file mode 100644 index 30057a2..0000000 --- a/other-sh/justsh.bat +++ /dev/null @@ -1,3 +0,0 @@ -set file=cygpath %1 -d:\cygwin\bin\sh.exe %1 -pause diff --git a/other-sh/makebz2.bat b/other-sh/makebz2.bat deleted file mode 100644 index 6cbb9da..0000000 --- a/other-sh/makebz2.bat +++ /dev/null @@ -1,2 +0,0 @@ -sh -c "tar cjvf %1.tar.bz2 %1" -move /y %1.tar.bz2 %2 diff --git a/other-sh/msn.bat b/other-sh/msn.bat deleted file mode 100644 index e1f557f..0000000 --- a/other-sh/msn.bat +++ /dev/null @@ -1 +0,0 @@ -run "c:\Program Files\MSN Messenger\msnmsgr.exe" diff --git a/other-sh/mt.sh b/other-sh/mt.sh new file mode 100644 index 0000000..34626c7 --- /dev/null +++ b/other-sh/mt.sh @@ -0,0 +1,162 @@ +#!/bin/sh + +#mt.sh-- _describe_ +#@Author: LiFan +#@Created: 2011-01-22-15:20 + +PATH=/bin:/usr/bin:/usr/local/bin + +error() +{ + echo "$@" 1>&2 + usage_and_exit 1 +} + +usage() +{ + echo "Usage: $PROGRAM [--list] [--all|-a] [--athome|-m][--help] [--version] [host-name]" + echo -e "for example:" + echo -e "\tmt.sh --list" + echo -e "\tmt.sh qapc29" +} + +usage_and_exit() +{ + usage + exit $1 +} + +version() +{ + echo "$PROGRAM version $VERSION" +} + +warning() +{ + echo "$@" 1>&2 + EXITCODE=$((EXITCODE + 1)) + #EXITCODE=`expr $EXITCODE + 1` +} + + +EXITCODE=0 +PROGRAM=`basename $0` +VERSION=1.0 +HOMEPROXY=192.168.1.105 +SECONDPROXY=192.168.72.103 +QAPROXY=qaproxy +all=no +athome=no +option=conn + +while test $# -gt 0 +do + case $1 in + --all | -a) + all=yes + ;; + --help | -h) + usage_and_exit 0 + ;; + --version | -v) + version + exit 0 + ;; + --list | -l) + option=list + ;; + --athome| -m) + athome=yes + ;; + -*) + error "Unrecognized option: $1" + ;; + *) + break + ;; + esac + shift +done + +#----------- end of phrase argument ---------------# + +# make tunnel from local to destination by ssh server +# $1:local port $2:remote host name $3:remote port +maketunnel() +{ + if [ $athome = "yes" ] + then + echo "connect to $HOMEPROXY for $2 ..." + ssh -N -f -L *:$1:$SECONDPROXY:$1 $HOMEPROXY + else + echo "connect to $QAPROXY for $2 ..." + ssh -N -f -L *:$1:$2:$3 $QAPROXY + fi + + pid=`ps -ef|grep ssh|tail -1|awk '{print $2}'` + echo "$2:$3 $pid" + sed -e "s/$2:$3.*$/$2:$3 $pid/g" $HOME/tunnel.list -i + +} + +listtunnel() +{ + cat $HOME/tunnel.list | while read line + do + if ps -ef|grep -q `echo $line|cut -d " " -f2` + then + echo $line + else + echo $line |cut -d " " -f1 + fi + done +} + +if [ $option = "list" ] +then + listtunnel + exit 0 +fi + +if [ $# -eq 0 -a $all != "yes" ] +then + usage_and_exit 0 +fi + + +if [ $all = "yes" ] +then + tunnel="qasox02 qasox06 qa51 qapc42 qapc45 qapc29" +else + tunnel=$* +fi + +for i in $tunnel +do + case $i in + qasox02) + maketunnel 10002 "qasox02.grid.datasynapse.com" 22 + ;; + qasox06) + maketunnel 10006 "qasox06.grid.datasynapse.com" 22 + ;; + qa51) + maketunnel 10051 "qa51.grid.datasynapse.com" 22 + ;; + qapc42) + maketunnel 9942 "qapc42.grid.datasynapse.com" 3389 + ;; + qapc42-22) + maketunnel 9242 "qapc42.grid.datasynapse.com" 22 + ;; + qapc45) + maketunnel 9945 "qapc45.grid.datasynapse.com" 3389 + ;; + qapc29) + maketunnel 9929 "qapc29.grid.datasynapse.com" 3389 + ;; + qapc29-22) + maketunnel 9229 "qapc29.grid.datasynapse.com" 22 + ;; + esac +done diff --git a/other-sh/mygenv.bat b/other-sh/mygenv.bat dissimilarity index 90% index 0115fc9..adc9c71 100644 --- a/other-sh/mygenv.bat +++ b/other-sh/mygenv.bat @@ -1,14 +1,14 @@ -@ECHO OFF - -if NOT DEFINED CYGWIN_HOME ( - set CYGWIN_HOME=d:\cygwin -) -if NOT DEFINED D_DISK ( - for /f %%i in ('%CYGWIN_HOME%\bin\cygpath -d /d') do set D_DISK=%%i -) -if NOT DEFINED E_DISK ( - for /f %%i in ('%CYGWIN_HOME%\bin\cygpath -d /e') do set E_DISK=%%i -) - -set path=%path%;d:\python;d:\prog\Vim\vim71;d:\prog\fox -set PATH=%PATH%;%E_DISK%\home\%USERNAME%\other-sh;%E_DISK%\local\bin;%CYGWIN_HOME%\bin;%CYGWIN_HOME%\sbin;%CYGWIN_HOME%\usr\sbin +@ECHO OFF + +if NOT DEFINED CYGWIN_HOME ( + set CYGWIN_HOME=d:\cygwin + set D_DISK=d:\ + set E_DISK=e:\ + )ELSE ( + for /f %%i in ('%CYGWIN_HOME%\bin\cygpath -d /d') do set D_DISK=%%i + for /f %%i in ('%CYGWIN_HOME%\bin\cygpath -d /e') do set E_DISK=%%i + ) + +set HOME=%E_DISK%\home\%USERNAME% +set PATH=%PATH%;%D_DISK%\python;%D_DISK%\prog\Vim\vim71;%D_DISK%\prog\fox;%D_DISK%\prog\Totalcmd7 +set PATH=%PATH%;%HOME%\other-sh;%E_DISK%\local\bin;%CYGWIN_HOME%\bin;%CYGWIN_HOME%\sbin;%CYGWIN_HOME%\usr\sbin diff --git a/other-sh/mygtotal.bat b/other-sh/mygtotal.bat index 95f00df..d564de8 100644 --- a/other-sh/mygtotal.bat +++ b/other-sh/mygtotal.bat @@ -1,8 +1,11 @@ @ECHO OFF if DEFINED MYGENV ( - call mygenv.bat - ) + call mygenv.bat + REM sh.exe -c "sed -e 's/gvim.exe/%E_DISK%\\\\other-sh\\\\%USERNAME%\\\\other-sh\\\\mygvim.exe/g' -e 's/mygwin.exe/%E_DISK%\\\\other-sh\\\\%USERNAME%\\\\other-sh\\\\mygwin.exe/g' /d/prog/Totalcmd7/wincmd.ini -i" + REM )else( + REM sh.exe -c "sed -e 's/%E_DISK%\\\\other-sh\\\\%USERNAME%\\\\other-sh\\\\mygvim.exe/mygvim.exe/g' -e 's/%E_DISK%\\\\other-sh\\\\%USERNAME%\\\\other-sh\\\\mygwin.exe/mygwin.exe/g' /d/prog/Totalcmd7/wincmd.ini -i" + ) IF '%~1'=='' GOTO EMPTY IF '%~1'=='--argulist' GOTO ARGULIST diff --git a/other-sh/mygwin.bat b/other-sh/mygwin.bat index 04de078..6179038 100644 --- a/other-sh/mygwin.bat +++ b/other-sh/mygwin.bat @@ -10,31 +10,31 @@ if DEFINED USE_MINTTY ( if '%~1'=='' GOTO EMPTY -d: -chdir d:\cygwin\bin +REM d: +REM chdir %CYGWIN_HOME%\bin for /f %%i in ('cygpath -u %1') do set xpath=%%i REM sh.exe -c "echo cd %xpath% #mint >> /e/home/lifan/.profile" -echo cd %xpath% #mint >> e:\home\lifan\.profile +echo cd %xpath% #mint >> %E_DISK%\home\%USERNAME%\.profile REM sh.exe -c "sed -e 's/\x0D$//g' /e/home/lifan/.profile -i" REM bash --login -i if '%mintty%'=='true' ( - start mintty - + start mintty.exe --class "PuTTY" - )else ( - start putty -load "cygwin2" + start putty.exe -load "cygwin2" ) sleep 5s -sh.exe -c "sed -e '/mint/d' /e/home/lifan/.profile -i" +sh.exe -c "sed -e '/mint/d' $HOME/.profile -i" exit 0 :EMPTY if '%mintty%'=='true' ( - start mintty - + start mintty.exe --class "PuTTY" - )else ( - start putty -load "cygwin2" + start putty.exe -load "cygwin2" ) exit 0 diff --git a/other-sh/readme.txt b/other-sh/readme.txt deleted file mode 100644 index 0220a86..0000000 --- a/other-sh/readme.txt +++ /dev/null @@ -1,2 +0,0 @@ -this is place the shell script for other or owen -add this line for recover test diff --git a/other-sh/rss.bat b/other-sh/rss.bat deleted file mode 100644 index d5d6a30..0000000 --- a/other-sh/rss.bat +++ /dev/null @@ -1 +0,0 @@ -start firefox http://www.google.com/reader/view diff --git a/other-sh/ssh.sh b/other-sh/ssh.sh deleted file mode 100644 index d9000f8..0000000 --- a/other-sh/ssh.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!bash -net start sshd -sleep 3 -net stop sshd -sleep 3 -net start sshd diff --git a/other-sh/tel.bat b/other-sh/tel.bat deleted file mode 100644 index 54a5533..0000000 --- a/other-sh/tel.bat +++ /dev/null @@ -1 +0,0 @@ -start puttycyg.exe -load "telnet-18" diff --git a/other-sh/tempa.sh b/other-sh/tempa.sh deleted file mode 100644 index 8c6d612..0000000 --- a/other-sh/tempa.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!bash -cd $HOME -gvim a.txt diff --git a/other-sh/tempb.sh b/other-sh/tempb.sh deleted file mode 100644 index 3744a43..0000000 --- a/other-sh/tempb.sh +++ /dev/null @@ -1,2 +0,0 @@ -cd $HOME -gvim b.txt diff --git a/other-sh/tempn.sh b/other-sh/tempn.sh deleted file mode 100644 index 3f43c7c..0000000 --- a/other-sh/tempn.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!bash -gvim d:/cygwin/home/Administrator/olm/TempWord.olm diff --git a/other-sh/tmd.bat b/other-sh/tmd.bat deleted file mode 100644 index 6e08aad..0000000 --- a/other-sh/tmd.bat +++ /dev/null @@ -1,2 +0,0 @@ -start d:\prog\totalcmd63\totalcmd.exe /R=%CD% -exit -- 2.11.4.GIT