This file contains 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
#!/bin/bash | |
export JAVA_HOME=/usr/local/jdk1.8.0_111 | |
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar | |
export PATH=$JAVA_HOME/bin:$PATH | |
JENKINS_ROOT=/app/jenkins | |
export JENKINS_HOME=$JENKINS_ROOT/jenkins_home | |
cd $JENKINS_ROOT | |
PIDS=`ps -ef|grep -w "jenkins.war"|grep -v grep|awk '{print $2}'` | |
echo "stop jenkins....." |
This file contains 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
#!/bin/bash | |
#********************************# | |
#2013-01-11 17:00:00 wanggy exp # | |
#note:ping monitor # | |
#********************************# | |
set -u | |
ping_fun() | |
{ | |
for host in {10.10.54.88,10.10.54.77} |
This file contains 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
yum -y install mailx | |
yum -y install sendmail | |
service sendmail start | |
mail -s 'Test mail' xx@qq.com < test.txt | |
mail -s 'Test mail' -r alter@test.com xx@qq.com < test.txt |
This file contains 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
#Danger!!! | |
#Danger!!! | |
#Danger!!! | |
#As a last resort, do not upgrade glibc!!! | |
wget http://ftp.gnu.org/gnu/glibc/glibc-2.15.tar.gz | |
cd glibc-2.15 | |
mkdir build | |
cd build | |
../configure --prefix=/usr/local/glibc-2.15 |
This file contains 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
#!/bin/bash | |
function installVPN(){ | |
echo "begin to install VPN services"; | |
#check wether vps suppot ppp and tun | |
yum remove -y pptpd ppp | |
iptables --flush POSTROUTING --table nat | |
iptables --flush FORWARD | |
rm -rf /etc/pptpd.conf |
This file contains 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
#!/bin/bash | |
#Denyhosts SHELL SCRIPT | |
cat /var/log/secure|awk '/Failed/{print $(NF-3)}'|sort|uniq -c|awk '{print $2"=" $1;}' >/home/sh/Denyhosts.txt | |
DEFINE="10" | |
for i in `cat /home/sh/Denyhosts.txt` | |
do | |
IP=`echo $i|awk -F= '{print $1}'` | |
NUM=`echo $i|awk -F= '{print $2}'` | |
if [ $NUM -gt $DEFINE ] |
This file contains 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
#!/bin/bash | |
######################################### | |
#Function: add a new swap partition | |
#Usage: bash add_swap.sh | |
#Author: Customer service department | |
#Company: Alibaba Cloud Computing | |
#Version: 2.1 | |
######################################### | |
check_os_release() |
This file contains 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
#!/bin/bash | |
NOW=$(date +"%Y.%m.%d") | |
cd /tmp | |
tar zcvf /backup/$NOW-row.tar.gz row.log | |
:>row.log | |
#find ${BACKUP_DST} -ctime +30 | xargs rm -rf |
This file contains 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
#!/bin/bash | |
wget http://nodejs.org/dist/v0.10.28/node-v0.10.28-linux-x64.tar.gz | |
tar xzf node-v0.10.28-linux-x64.tar.gz | |
mv node-v0.10.28-linux-x64 /usr/local/ | |
echo "PATH=$PATH:/usr/local/node-v0.10.28-linux-x64/bin" >> /etc/profile | |
echo "export PATH" >> /etc/profile | |
source /etc/profile | |
cp /usr/local/node-v0.10.28-linux-x64/bin/node /usr/bin | |
cp /usr/local/node-v0.10.28-linux-x64/bin/npm /usr/bin |
This file contains 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
#Newbie programmer | |
def factorial(x): | |
if x == 0: | |
return 1 | |
else: | |
return x * factorial(x - 1) | |
print factorial(6) | |
#First year programmer, studied Pascal |
NewerOlder