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 | |
# https://hub.docker.com/r/bretfisher/jekyll-serve | |
path = $(pwd) | |
name = $(basename $path) | |
echo visit http://0.0.0.0:4000 | |
docker ps - a | grep $name | |
case "$1" in | |
init) | |
echo $name creating... | |
docker run \ |
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
## this conf value will be replaced by sub-conf ## | |
NOTICE_PROC(){ | |
confname=$1 | |
textfile=$2 | |
scp $textfile ubuntu@jiayu-release:/data/staticweb/procerr/log/ && rm -rf $textfile | |
cnt="1" | |
if [ -f "$path_data/COUNT-$1" ]; then | |
cnt=`cat $path_data/COUNT-$1` | |
cnt=$((cnt + 1)) |
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 | |
####################################### | |
##RuntimeConf.sh | |
#NOTICE_PROC(){ | |
# echo $MAIL_SUBJ | |
# echo $MAIL_TO | |
# echo $1 | |
# echo $2 | |
#} | |
# |
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
# 钉钉提醒 | |
curl 'https://oapi.dingtalk.com/robot/send?access_token=xxxxx' \ | |
-H 'Content-Type: application/json' \ | |
-d ' | |
{ | |
"msgtype": "text", | |
"text": { | |
"content": "'"$domain"' 将在 '"$expiry_days"' 后过期,务必手动更新证书 " | |
}, | |
"at": { |
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
// 输出10位数字,左填充 0000000199 | |
int count = 199; | |
// 字符串填充,10个'0' | |
String s1 = "0000000000" + count; | |
System.out.println(s1.substring(s1.length() - 10)); | |
// 19位以下,数字填充 | |
String s2 = String.valueOf(10_000_000_000L + count); | |
System.out.println(s2.substring(1)); |
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 | |
#https://support.sonatype.com/hc/en-us/articles/115006744008 | |
repoId="nexus-jiayu" | |
repoUrl="http://maven.jiayuinc.com/repository/devops/" | |
tempDir="/tmp/" | |
function deploy_pom(){ | |
pom=$1 | |
ext=$(grep packaging $pom | sed -E 's/^.*>(.*)<.*$/\1/g') |
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
# append to [Service] | |
sudo tee -a /lib/systemd/system/mysql.service << EOF | |
LimitNOFILE=infinity | |
LimitMEMLOCK=infinity | |
EOF | |
sudo systemctl daemon-reload | |
sudo service mysql restart | |
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 | |
master_host=jiayu-app-master | |
master_ip=`grep $master_host /etc/hosts | awk '{print $1}'` | |
master_here=`ifconfig -a | grep $master_ip` | |
this_host="" | |
that_host="" | |
if [ -z "$master_here" ]; then |
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
wget --tries=3 --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u162-b12/0da788060d494f5095bf8624735fa2f1/jdk-8u162-linux-x64.tar.gz -O ./jdk-8u162-linux-x64.tar.gz |
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
# host | |
sudo iptables -t nat -A POSTROUTING -s 192.168.56.0/24 -j MASQUERADE | |
# guest | |
sudo vi /etc/network/interfaces | |
auto enp0s3 |
NewerOlder