Skip to content

Instantly share code, notes, and snippets.

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;
@chixq
chixq / nginx.sh
Last active January 3, 2016 07:48
Nginx installer script (including patch for url_hash)
#!/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
#####################################################
user nobody;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
# multi_accept on;
}
'''
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
@chixq
chixq / sigar.java
Created May 21, 2013 06:19
java system monitor using sigar
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;
@chixq
chixq / new_gist_file_1
Last active September 4, 2015 03:36
verify site accessibility
wget -q --tries=2 --timeout=5 --spider $1|| echo "unaccessible";
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='非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长')
#!/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"
#
#!/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"
#