View new_gist_file_1
This file contains 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
wget -q --tries=2 --timeout=5 --spider $1|| echo "unaccessible"; |
View gist:375712e092dc1ebe22f3
This file contains 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
parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter, | |
description=textwrap.dedent(description), | |
epilog=textwrap.dedent(epilog), | |
add_help=False) | |
# group = parser.add_argument_group('AutoOpsCLI version 1') | |
arg = parser.add_argument | |
arg('--verylong-param', | |
help='非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长') |
View nginx_oauth.sh
This file contains 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 | |
##### | |
# Builds a custom nginx | |
# | |
# RELEASE_TAGS="+your+tags+here" | |
# RELEASE_MAINTAINER="Your Name Here" | |
# RELEASE_MAINTAINER_EMAIL="hi@example.com" | |
# RELEASE_MESSAGE="Some message" | |
# |
View nginx_release.sh
This file contains 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 | |
##### | |
# Builds a custom nginx | |
# | |
# RELEASE_TAGS="+your+tags+here" | |
# RELEASE_MAINTAINER="Your Name Here" | |
# RELEASE_MAINTAINER_EMAIL="hi@example.com" | |
# RELEASE_MESSAGE="Some message" | |
# |
View Program DB Design
This file contains 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
Program Table: | |
id; | |
name; | |
a.k.a; | |
description; | |
director; Foriegn key of id in Director Table | |
country; | |
actor; | |
catagory; Catagory is much more simple than tags. Some third party lib can handle this column (BLOB Type) | |
watch_url; |
View nginx.sh
This file contains 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. Download nginx source (not using PM in order to use 3rd-party patch) | |
# 2. Hack with url_hash (optional) | |
# 3. Compile and make install with predefined path | |
# 4. Sync the nginx.conf with gist | |
# 5. Start nginx | |
##################################################### |
View nginx.conf
This file contains 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
user nobody; | |
worker_processes 1; | |
error_log /var/log/nginx/error.log; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
# multi_accept on; | |
} |
View test.py
This file contains 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
''' | |
Created on Mar 16, 2013 | |
@author: liutao | |
''' | |
import os | |
import re | |
import string | |
from domain.common.bl.abstraction.IComponentDeployer import IComponentDeployer | |
from infrastructure.common.shell.ShellCmdExecutor import ShellCmdExecutor |
View sigar.java
This file contains 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 java.util.ArrayList; | |
import java.util.List; | |
import org.hyperic.sigar.CpuInfo; | |
import org.hyperic.sigar.CpuPerc; | |
import org.hyperic.sigar.Sigar; | |
import org.hyperic.sigar.SigarException; | |
import org.hyperic.sigar.cmd.Ps; |