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 | |
mysql_status=`netstat -nl | awk 'NR>2{if ($4 ~ /.*:3306/) {print "Yes";exit 0}}'` | |
PortNum=`netstat -lnt|grep 3306|wc -l` | |
if [ "$mysql_status" == "Yes" ];then | |
slave_status=`mysql -uroot -p123456 -e"show slave status\G" | grep "Running" | awk '{if ($2 != "Yes") {print "No";exit 1}}'` | |
if [ "$slave_status" == "No" ];then | |
echo "slave is not working!" | |
[ ! -f "/tmp/slave" ] && echo "Slave is not working!" | mail -s "Warn!MySQL Slave is not working" monitor@test.me |
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 | |
DROPBOX_USER="xxx@xxx.com" //Dropbox的账号 | |
DROPBOX_PASS="12345678" //Dropbox的密码 | |
DROPBOX_DIR="/backups" //Dropbox中的文件夹名称 | |
BACKUP_SRC="/home/wwwroot /data" //需要备份的文件夹路径,可以同时指定多个中间用空格隔开 | |
BACKUP_DST="/home/backup" //用来存放备份的文件夹路径 | |
MYSQL_SERVER="127.0.0.1" //连接本地MySQL | |
MYSQL_USER="root" //本地MySQL的用户 | |
MYSQL_PASS="12345678" //本地MySQL的密码 | |
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 | |
cat /var/log/secure|awk '/Failed/{print $(NF-3)}'|sort|uniq -c|awk '{print $2"="$1;}' > /home/black.txt | |
DEFINE="5" | |
for i in `cat /home/black.txt` | |
do | |
IP=`echo $i |awk -F= '{print $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 | |
############################## | |
# dnspodsh v0.3 | |
# 基于dnspod api构架的bash ddns客户端 | |
# 作者:zrong(zengrong.net) | |
# 详细介绍:http://zengrong.net/post/1524.htm | |
# 创建日期:2012-02-13 | |
# 更新日期:2012-03-11 | |
############################## |
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
package main | |
import ( | |
"io/ioutil" | |
"log" | |
"net" | |
"net/http" | |
"net/url" | |
"strings" | |
"time" |
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
#!/usr/bin/env python | |
#-*- coding:utf-8 -*- | |
#替换上你的Email,密码,域名ID,记录ID等参数,就可以运行了。 会在后台一直运行,每隔30秒检查一遍IP,如果修改了就更新IP。 | |
#获得domain_id可以用curl curl -k https://dnsapi.cn/Domain.List -d "login_email=xxx&login_password=xxx" | |
#获得record_id类似 curl -k https://dnsapi.cn/Record.List -d "login_email=xxx&login_password=xxx&domain_id=xxx" | |
import httplib, urllib | |
import socket | |
import time |
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
<?php | |
header("Content-type: text/html; charset=utf8"); | |
class Dns | |
{ | |
#Dnspod账户 | |
private $dnspod_user = 'user@example.com'; | |
#Dnspod密码 |
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 | |
BACKUP_SRC="/home/wwwroot" | |
BACKUP_DST="/home/backup" | |
#MYSQL_SERVER="localhost" | |
#MYSQL_USER="root" | |
MYSQL_PASS="123456" | |
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
server { | |
listen 8080; | |
server_name test.com; | |
index index.html index.htm index.php; | |
root /home/wwwroot/test; | |
location /test2 { | |
auth_basic "pd"; | |
auth_basic_user_file /usr/local/nginx/conf/vhost/pd.passwd; | |
allow 114.112.113.111; |
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
restrict default kod nomodify notrap nopeer noquery | |
restrict -6 default kod nomodify notrap nopeer noquery | |
# 允许本地所有操作 | |
restrict 127.0.0.1 | |
restrict -6 ::1 | |
# 允许的局域网络段或单独ip | |
#restrict 127.0.0.1 | |
#restrict 192.168.10.2 # 指定某台机器时间同步 |
OlderNewer