This file contains hidden or 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/python | |
# -*- coding: utf-8 -*- | |
""" | |
@author: [email protected] | |
@date: 2016-12-12 | |
抓取机器到另外一个机房的出入流量,并格式化输出. 包括到另外机房的每个ip的流量。 | |
iftop 要使用较高的版本. centos 中建议 1.0pre4 以上. | |
""" | |
import subprocess | |
import socket |
This file contains hidden or 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/env python | |
# -*- coding: utf-8 -*- | |
import os | |
import re | |
import time | |
import json | |
from urllib import urlencode | |
from io import BytesIO |
This file contains hidden or 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/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
import MySQLdb | |
class MysqlConn(object): | |
def __init__(self, host, port, user, passwd, db=None): |
This file contains hidden or 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 | |
# 有两种权限: | |
# 1. 允许访问外网 WEB 端口(80, 443, 8080), 把 IP 加到 wl_web_ip 即可. | |
# 2. 允许访问外网所有流量, 基于 wl_all_ip, 把 IP 加到 wl_all_ip 即可. | |
iptables -F FORWARD | |
iptables -F BLOCK | |
iptables -F MON |
This file contains hidden or 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 | |
disk="sda sdb sdc" | |
for i in $disk | |
do | |
j="/dev/${i}" |
This file contains hidden or 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 | |
import ldap | |
import base64 | |
import hashlib | |
import binascii | |
import ldap.modlist as modlist | |
import subprocess | |
This file contains hidden or 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 -*- | |
import subprocess | |
def shell(cmd): | |
""" 执行命令. |
This file contains hidden or 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 | |
accept_net="124.205.206.0/24 124.254.7.0/24 119.161.240.0/24 211.152.0.0/16 10.0.11.17/32 10.0.11.11/32 59.151.16.0/24 10.9.1.0/24" | |
/sbin/iptables -F | |
/sbin/iptables -Z | |
/sbin/iptables -X | |
/sbin/iptables -P INPUT DROP | |
/sbin/iptables -P OUTPUT DROP |
This file contains hidden or 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/env python | |
""" | |
https://github.com/juliensobrier/google-safe-browsing-lookup-python | |
""" | |
import safebrowsinglookup | |
API_KEY = "" |
This file contains hidden or 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 | |
sudo su - | |
wget http://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-proxy-1.6.0.tar.gz | |
tar xvzf dnscrypt-proxy-1.6.0.tar.gz | |
cd dnscrypt-proxy-1.6.0 | |
./configure | |
make | |
make install | |
cd .. |