Last active
May 27, 2016 07:16
-
-
Save jmpcyc/bd1ac4784940bcf18b5b to your computer and use it in GitHub Desktop.
Linux Bash Shell Note
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| tee /usr/local/demo.txt <<- 'EOF' | |
| xyz | |
| EOF | |
| docker run -d -p 5000:5000 --restart=always --name registry \ | |
| -v `pwd`/certs:/certs \ | |
| -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt \ | |
| -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key \ | |
| registry:2 | |
| #!/bin/sh | |
| # Jenkins Build Shell Script | |
| # Author zdzhou@iflytek.com | |
| # Get running docker image name | |
| #cid=`docker ps | grep 'registry' | awk {'print $1'}` | |
| #echo $cid | |
| #if [ -n "$cid" ] | |
| #then | |
| # echo Get the running docker container id of isearch: $cid | |
| #docker stop $cid | |
| #docker rm $cid | |
| #else | |
| # echo There is no running isearch docker container | |
| #fi | |
| #result1=`expr 1 + 3 ` | |
| #echo $result1 | |
| #result2=$[3+2] | |
| #echo $result2 | |
| #result3=$[$result1 + $result2] | |
| #echo $result3 | |
| #rs=`expr $result3 + $result2` | |
| #echo $rs | |
| #if [ $result3 -gt $result2 ] | |
| #then | |
| # echo "result3 > result2" | |
| #else | |
| # echo "result3 < result2" | |
| #fi | |
| #set -o errexit | |
| #cd /usr/temp | |
| #echo $? | |
| #echo "hello" | |
| #str=hello | |
| #str2=hello | |
| #if [ $str = $str2 ] | |
| #then | |
| # echo "str > str2" | |
| #else | |
| # echo "str < str2" | |
| #fi | |
| #totalWait=0 | |
| #until [ "`/usr/bin/docker inspect -f {{.State.Running}} isearch`" == "true" ] | |
| #do | |
| # sleep 5m | |
| # echo Waiting for 5 minute | |
| # totalWait=$[ $totalWait + 5 ] | |
| # if [ $totalWait \> 40 ] | |
| # then | |
| # break | |
| # fi | |
| #done | |
| #!/bin/sh | |
| # Jenkins Build Shell Script | |
| # Author zdzhou@iflytek.com | |
| # Get running docker image name | |
| #cid=`docker ps | grep 'isearch' | awk {'print $1'}` | |
| #echo $cid | |
| # If exists running isearch docker image, stop and remove it | |
| #if [ -n "$cid" ] | |
| #then | |
| # echo Get the running docker container id of isearch: $cid | |
| # docker stop $cid | |
| # echo Stop docker container: $cid | |
| # docker rm $cid | |
| # echo Remove docker container: $cid | |
| #else | |
| # echo There is no running isearch docker container | |
| #fi | |
| # Switch to the directory that contains Dockerfile | |
| #cd ${JENKINS_HOME}/workspace/${JOB_NAME}/itv-web/ | |
| #echo Current work directory `pwd` | |
| #cp target/itv-web.war /usr/local/tomcat/webapps | |
| #echo Run docker image | |
| #docker run -d -p 8080:8080 -v /usr/local/isearch:/usr/local/isearch -v /usr/local/tomcat/webapps:/usr/local/tomcat/webapps --name=isearch${SVN_REVISION} isearch | |
| # Wait for starting docker container | |
| #totalWait=0 | |
| #until [ "`/usr/bin/docker inspect -f {{.State.Running}} isearch${SVN_REVISION}`" == "true" ] | |
| #do | |
| # sleep 5m | |
| # totalWait=$[ $totalWait + 5 ] | |
| # echo Waiting for docker container starting : $totalWait minute | |
| # if [ $totalWait \> 40 ] | |
| # then | |
| # break | |
| # fi | |
| #done | |
| #echo Docker container isearch${SVN_REVISION start success | |
| # Wait for starting tomcat | |
| #case $USER in | |
| #root) | |
| # echo "Hello, root";; | |
| #defcon) | |
| # echo "Hello defcon";; | |
| #esac | |
| -- INSERT -- | |
| wget --max-redirect 10 -e use_proxy=yes -e http_proxy=http://172.16.57.11:8628 -e https_proxy=http://172.16.57.11:443 --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u65-b17/jdk-8u65-linux-x64.tar.gz" | |
| # | |
| # @author zdzhou@iflytek.com | |
| # @update 2016-05-27 | |
| # | |
| set -x | |
| # 修改linux文件句柄限制 ref:http://kumu1988.blog.51cto.com/4075018/1086210 | |
| /proc/sys/fs/file-max | |
| cat /etc/security/limit.conf | |
| /etc/security/limits.d/90-nproc.conf | |
| /etc/sysctl.conf | |
| grep 'os400' --color /usr/bin/start.sh | |
| apt-get remove -y --auto-remove --purge pkg | |
| rm -rf /var/lib/apt/lists/* | |
| gpg | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment