Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ppabc committed Mar 22, 2017
1 parent 2d7f2b6 commit 48bf864
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 20 deletions.
32 changes: 32 additions & 0 deletions docker/docker_mirror.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
## Docker配置 换镜像源 2017-03-15
## http://www.aqzt.com
## email: [email protected]
## robert yu
## redhat 7

##cp -n /lib/systemd/system/docker.service /etc/systemd/system/docker.service
tee /etc/systemd/system/docker.service <<-'EOF'
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network.target firewalld.service
[Service]
Type=notify
ExecStart=/usr/bin/dockerd --registry-mirror=https://4ux5p520.mirror.aliyuncs.com
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
TimeoutStartSec=0
Delegate=yes
KillMode=process
[Install]
WantedBy=multi-user.target
EOF

##systemctl enable docker && systemctl start docker
systemctl daemon-reload
service docker restart
43 changes: 24 additions & 19 deletions proxy/ss5_pam.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,36 @@
## robert yu
## centos 7

yum -y install gcc gcc-c++ automake make pam-devel openldap-devel cyrus-sasl-devel
yum -y install gcc gcc-c++ automake make pam-devel openldap-devel cyrus-sasl-devel openssl-devel
wget http://jaist.dl.sourceforge.net/project/ss5/ss5/3.8.9-8/ss5-3.8.9-8.tar.gz
tar zxvf ss5-3.8.9-8.tar.gz
cd ss5-3.8.9-8
cd ss5-3.8.9
./configure && make && make install

useradd test -s /sbin/nologin
useradd aaa -s /sbin/nologin
useradd bbb -s /sbin/nologin
##无分组无限制配置
#cat >/etc/opt/ss5/ss5.conf<<EOF
#set SS5_PAM_AUTH
#auth 0.0.0.0/0 - u
#permit u 0.0.0.0/0 - 0.0.0.0/0 - - - - -
#EOF

##设置密码
passwd test
#useradd test -s /sbin/nologin
#useradd aaa -s /sbin/nologin
#useradd bbb -s /sbin/nologin

##无分组无限制配置
cat >/etc/opt/ss5/ss5.conf<<EOF
set SS5_PAM_AUTH
auth 0.0.0.0/0 - u
permit u 0.0.0.0/0 - 0.0.0.0/0 - - - - -
EOF
/usr/sbin/useradd username1 -s /sbin/nologin
echo eUqO5VLWj9m3FXy6 | passwd --stdin username1

/usr/sbin/useradd username2 -s /sbin/nologin
echo ltQQEmH72NDQ51Er | passwd --stdin username2

/usr/sbin/useradd username3 -s /sbin/nologin
echo MauDmldzvnsX5iUo | passwd --stdin username3

##创建分组
echo "test">/etc/opt/ss5/ulimit
echo "aaa" >>/etc/opt/ss5/ulimit
echo "bbb" >/etc/opt/ss5/limit
echo "username1">/etc/opt/ss5/ulimit
echo "username2" >>/etc/opt/ss5/ulimit
echo "username3" >/etc/opt/ss5/limit

##有分组 ,有限制配置
cat >/etc/opt/ss5/ss5.conf<<EOF
Expand All @@ -43,11 +48,11 @@ permit u 0.0.0.0/0 - 0.0.0.0/0 443 - limit
EOF


echo "SS5_OPTS=\" -u root -b 0.0.0.0:10888\"" >>/etc/sysconfig/ss5
echo "SS5_OPTS=\" -u root -b 0.0.0.0:11888\"" >>/etc/sysconfig/ss5
##使用默认端口
##echo "SS5_OPTS=\" -u root\"" >>/etc/sysconfig/ss5
##/etc/rc.d/init.d/ss5 文件修改自定义端口,默认为1080
##daemon /usr/sbin/ss5 -t $SS5_OPTS -b 0.0.0.0:10888
##daemon /usr/sbin/ss5 -t $SS5_OPTS -b 0.0.0.0:11888

echo "auth required /usr/lib64/security/pam_unix.so">>/etc/pam.d/ss5

Expand All @@ -65,5 +70,5 @@ service ss5 start
#chkconfig --level 345 ss5 on

##查看日志启动是否成功
tail -f /var/log/ss5/ss5.log
#tail -f /var/log/ss5/ss5.log

13 changes: 12 additions & 1 deletion rsync/rsync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,15 @@ find /data/nginx/log/ -ctime +5 -exec rm -f {} \;

##剪切参考,IO速度限制的cp和mv(限速1024 KB/s)
##cp: rsync --bwlimit=1024 {src} {dest}
##mv: rsync --bwlimit=1024 --remove-source-files {src} {dest}
##mv: rsync --bwlimit=1024 --remove-source-files {src} {dest}


##使用ssh方式rsync,不用服务端,简单方便,SSH需要认证,就不用每次输入密码
#ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa -q -b 2048 -C "root@test"
#cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
#chmod 600 ~/.ssh/authorized_keys

rsync -av --exclude=.gitlab-ci.yml --exclude=log --exclude=logs --delete /root/test 192.168.1.119:/root/test1

##rsync 参数的具体可以参考:
##http://bbs.aqzt.com/thread-138-1-1.html

0 comments on commit 48bf864

Please sign in to comment.