下载 ip.py 到本机, 执行 python ip.py 网段 掩码
> python ip.py 111.10.40.128 255.255.255.192
111.10.40.128 111.10.40.191
输出即是起始和终止 IP。
#!/bin/env python | |
""" argparse example. | |
url: https://mkaz.com/2014/07/26/python-argparse-cookbook/ | |
""" | |
import argparse | |
#!/bin/env python | |
# -*- coding: utf-8 -*- | |
import os | |
import time | |
import logging | |
from logging.handlers import TimedRotatingFileHandler | |
LOG_DIR = "/tmp/" |
#!/bin/sh | |
# create self-signed server certificate: | |
read -p "Enter your domain [www.example.com]: " DOMAIN | |
echo "Create server key..." | |
openssl genrsa -des3 -out $DOMAIN.key 1024 |
#!/bin/env python | |
#-*- coding: utf-8 -*- | |
""" 发布特定分支的 Nginx conf, 这里发布以 autodeploy 开头的分支. | |
此脚本跑在 Jenkins 任务下, 此任务通过 Jenkins 的 Gerrit Trigger | |
插件监控 Nginx conf (Gerrit 项目) 的 Ref Updated 和 Change Merged 事件, | |
而且分支要匹配 **/autodeploy*, 满足条件触发此任务. | |
1. 先计算出最近一次修改的以 autodeploy 开头的分支, |
#!/bin/env python | |
# -*- coding:utf-8 -*- | |
import threading | |
sem = threading.Semaphore(10) | |
result = [] |
package pubsub // import "github.com/docker/docker/pkg/pubsub" | |
import ( | |
"sync" | |
"time" | |
) | |
var wgPool = sync.Pool{New: func() interface{} { return new(sync.WaitGroup) }} | |
// NewPublisher creates a new pub/sub publisher to broadcast messages. |
下载 ip.py 到本机, 执行 python ip.py 网段 掩码
> python ip.py 111.10.40.128 255.255.255.192
111.10.40.128 111.10.40.191
输出即是起始和终止 IP。
#!/bin/env python | |
# -*- coding:utf-8 -*- | |
import sys | |
reload(sys) | |
sys.setdefaultencoding('utf-8') | |
from IPy import IP | |
import xlwt |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from IPy import IP | |
file_path = "/Users/wateer/Downloads/1" | |
""" | |
file content like this: | |
183.232.67.128 255.255.255.240 | |
183.232.76.98 255.255.255.248 |
#!/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 .. |