Skip to content

Instantly share code, notes, and snippets.

View koy1619's full-sized avatar
🎯
Focusing

Chris koy1619

🎯
Focusing
View GitHub Profile
@koy1619
koy1619 / jenkins.sh
Created August 24, 2020 02:57
jenkins deploy
#!/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....."
#!/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}
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
#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
@koy1619
koy1619 / pptpd_vpn_centos6.sh
Last active October 4, 2023 03:30
vpn_centos6.sh
#!/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
@koy1619
koy1619 / Denyhosts.sh
Last active October 13, 2015 03:46
Denyhosts.sh
#!/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 ]
@koy1619
koy1619 / add_swap.sh
Created July 1, 2015 02:23
add_swap.sh
#!/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()
@koy1619
koy1619 / row.sh
Last active August 29, 2015 14:10
mysql查询日志切割脚本
#!/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
#!/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
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal