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 | |
# /etc/nginx/ssl/<site>/ | |
site=$1 | |
# DNS:www.abc.xyz,DNS:xyz.abc.xyz | |
domains=$2 | |
OPENSSL_CNF=/etc/pki/tls/openssl.cnf | |
ssl_dir=/etc/nginx/ssl | |
mkdir -p ${ssl_dir} |
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 | |
########### | |
# add crontab | |
# 0 0 1 * * /root/src/renew_ssl_cert.sh <site> 2>>/var/log/acme_tiny.log | |
########### | |
site=$1 | |
domains=$2 | |
if [ -n "${domains}" ]; then | |
# init |
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
[Unit] | |
Description=supervisord - Supervisor process control system for UNIX | |
Documentation=http://supervisord.org | |
After=network.target | |
[Service] | |
Type=forking | |
ExecStart=/usr/bin/supervisord -c /etc/supervisord.conf | |
ExecReload=/usr/bin/supervisorctl reload | |
ExecStop=/usr/bin/supervisorctl shutdown |
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 | |
set -e | |
if [ -z "$(which brew)" ]; then | |
echo "This script requires Homebrew." | |
exit | |
fi | |
if [ -z "$VIRTUAL_ENV" ]; then |
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
###################### | |
# Options | |
###################### | |
NULL= | |
REVEAL_ARCHIVE_IN_FINDER=false | |
FRAMEWORK_NAME="${PROJECT_NAME}" | |
SIMULATOR_LIBRARY_PATH="${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${FRAMEWORK_NAME}.framework" |
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
// refer to: http://rosettacode.org/wiki/Add_a_variable_to_a_class_instance_at_runtime#Swift | |
// this is stupid, just inherit the target class. | |
import Foundation | |
class ObjectAssociateUtil { | |
static var objKeys = [String:UnsafePointer<()>]() | |
class func getAssociateObject<T:AnyObject, D>(target:T, by_key key:String) -> D? { | |
let objKeyName = "\(NSStringFromClass(target.dynamicType)).\(key)" | |
if let objKey = objKeys[objKeyName] { |
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 sh | |
date2stamp () { | |
date --utc --date "$1" +%s | |
} | |
stamp2date (){ | |
date --utc --date "1970-01-01 $1 sec" "+%Y-%m-%d %T" | |
} | |
dateDiff (){ |
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 | |
# | |
# /etc/rc.d/init.d/supervisord | |
# | |
# Supervisor is a client/server system that | |
# allows its users to monitor and control a | |
# number of processes on UNIX-like operating | |
# systems. | |
# | |
# chkconfig: - 64 36 |
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 logging | |
def get_logger(): | |
level = logging.DEBUG | |
formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(module)s[%(lineno)d] - %(funcName)s - %(message)s') |
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 | |
name=$1 | |
username=webee | |
template=test-maven-project | |
function LOG_INFO() { | |
local msg=$1 | |
echo "[$(date +'%Y-%m-%d %H:%M:%S.%N')][INFO] ${msg}" |