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 | |
# -*- encoding: utf-8 -*- | |
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: | |
# Author: Binux<[email protected]> | |
# http://binux.me | |
# Created on 2014-02-07 13:12:10 | |
import heapq | |
import logging | |
import threading |
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 | |
# -*- encoding: utf-8 -*- | |
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: | |
# Author: Binux<[email protected]> | |
# http://binux.me | |
# Created on 2014-02-07 16:53:08 | |
import time | |
try: | |
import threading as _threading |
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 logging | |
from kazoo.client import KazooClient | |
from kazoo.protocol.states import KazooState | |
from kazoo.exceptions import ZookeeperError, NoNodeError | |
class ZkHelper: |
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 sh | |
cd $(dirname $0) | |
ZK_VERSION=3.4.14 | |
ZK_CLUSTER_NUM=3 | |
ZK_PKG="zookeeper-"$ZK_VERSION".tar.gz" | |
ZK_PATH="zookeeper-"$ZK_VERSION | |
ZK_DATA_DIR=/tmp/zookeeper |
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
# -*- coding:utf-8 -*- | |
import os | |
import comtypes | |
from comtypes.client import CreateObject | |
wdFormatPDF = 17 | |
in_file = os.path.abspath('f:/xx.docx') | |
out_file = os.path.abspath('f:/xueweizheng.pdf') |
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/sh | |
BASE_HOME=$(dirname $(readlink -f "$0")) | |
PID=${BASE_HOME}/.pid | |
status(){ | |
echo "==========status=======" | |
status=`ps -p $$` | |
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
import os | |
from PyPDF2 import PdfFileMerger | |
pdf_dir = r"E:\note\invoice" | |
def merge_pdf(source_dir, output_filename): | |
merger = PdfFileMerger() | |
for name in os.listdir(source_dir): | |
if ".pdf" != os.path.splitext(name)[1]: | |
continue |
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 _*_ | |
from fabric.api import run | |
from fabric.api import * | |
from fabric.contrib.files import * | |
from fabric.contrib.project import * | |
from sets import Set | |
from fabric.task_utils import merge | |
import time, os, re | |
# env.hosts = ['172.16.1.155','172.16.1.158'] |
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 | |
# | |
# Extracts email addresses from one or more plain text files. | |
# | |
# Notes: | |
# - Does not save to file (pipe the output to a file if you want it saved). | |
# - Does not check for duplicates (which can easily be done in the terminal). | |
from optparse import OptionParser |
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
[unix_http_server] | |
file=/tmp/supervisor.sock ; path to your socket file | |
[supervisord] | |
logfile=/var/log/supervisord/supervisord.log ; supervisord log file | |
logfile_maxbytes=50MB ; maximum size of logfile before rotation | |
logfile_backups=10 ; number of backed up logfiles | |
loglevel=error ; info, debug, warn, trace | |
pidfile=/var/run/supervisord.pid ; pidfile location | |
nodaemon=false ; run supervisord as a daemon |
NewerOlder