下载 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 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 | |
cfssl gencert -initca ca-csr.json | cfssljson -bare ca - | |
cfssl gencert -ca=ca.pem -ca-key=ca-key.pem -config=ca-config.json -profile=server server.json | cfssljson -bare server | |
cfssl gencert -ca=ca.pem -ca-key=ca-key.pem -config=ca-config.json -profile=peer member.json | cfssljson -bare member |
#!/usr/bin/env sh | |
### Download and install megaraidcli for Ubuntu; | |
FILE="megacli_8.07.14.orig.tar.gz" | |
LINK="http://hwraid.le-vert.net/ubuntu/sources/$FILE" | |
wget $LINK -O /tmp/$FILE | |
cd /tmp |
package main | |
import ( | |
"bytes" | |
"fmt" | |
"os/exec" | |
"time" | |
) | |
func run(timeout int, command string, args ...string) string { |
#!/bin/bash | |
key_word="USB|usb|eth1|CPU|time|softirq|CD-ROM|IPMI|ipmi|tcpdump|flooding|debugging|ffffffff|UDP|cf_|wzp" | |
if [ -f "/var/log/message" ];then | |
log_time=`date -r /var/log/message +%s` | |
real_time=`date +%s` | |
diff_time=`expr $real_time - $log_time` | |
if [ $diff_time -lt 60 ];then |
# lib/puppet/parser/functions/pw_hash.rb | |
module Puppet::Parser::Functions | |
newfunction(:pw_hash, type: :rvalue) do |args| | |
raise Puppet::ParseError, "pw_hash takes exactly two arguments, #{args.length} provided" if args.length != 2 | |
# SHA512 ($6), default number of rounds (5000) | |
# rounds could be specified by prepending rounds=<n>$ parameter before the salt, i.e. | |
# args[0].crypt("$6$rounds=50000$#{args[1]}") | |
args[0].crypt("$6$#{args[1]}") | |
end |