Skip to content

Instantly share code, notes, and snippets.

View zacker330's full-sized avatar
🌧️

Jack Zhai zacker330

🌧️
View GitHub Profile
{
"server":"xx.xx.xx.xx",
"local_address": "127.0.0.1",
"local_port":1080,
"port_password": {
"8380": "xx",
"8382": "xx",
"8381": "xx"
},
"timeout":300,
#!/bin/bash
############################################################
# $Name: nginx_status.sh
# $Version: v1.0
# $Function: Nginx Status
# $Author: xuliangwei
# $organization: www.xuliangwei.com,www,bjstack.com
# $Create Date: 2016-06-23
# $Description: Monitor Nginx Service Status
############################################################
#! /usr/bin/env python
import socket
import json
import argparse
#{
# "service": "nutcracker",
# "source": "gintama-taiwan-redis1",
# "version": "0.4.0",
# "uptime": 136873,
@zacker330
zacker330 / nginx.conf
Created September 13, 2017 09:03 — forked from morhekil/nginx.conf
Full request/response body logging in nginx
http {
log_format bodylog '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" $request_time '
'<"$request_body" >"$resp_body"';
lua_need_request_body on;
set $resp_body "";
body_filter_by_lua '
@zacker330
zacker330 / gist:93b7ad8a253c609b5e5b075ba3e123d3
Created January 14, 2017 04:53 — forked from reiz/gist:6203767
Creating a MavenProject from an ArtifactInfo inside a maven plugin.
protected MavenProject buildProjectModel(ArtifactInfo artifactInfo) throws Exception {
try {
ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest();
configuration.setLocalRepository( localRepository );
configuration.setValidationLevel( ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL );
configuration.setProcessPlugins( false );
configuration.setRepositoryMerging( ProjectBuildingRequest.RepositoryMerging.REQUEST_DOMINANT );
Properties properties = new Properties( );
for ( String key : session.getSystemProperties( ).keySet() ){
properties.put( key, session.getSystemProperties().get(key) );
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
##测试版源
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
# 源码
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
@zacker330
zacker330 / new_gist_file_0
Created February 10, 2016 14:40
scala resolvers
resolvers += "Local Maven Repository" at "file://"+Path.userHome.absolutePath+"/.m2/repository"
resolvers ++= Seq(
"Sonatype Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/",
"Big Bee Consultants" at "http://www.bigbeeconsultants.co.uk/repo",
"Typesafe Snapshots" at "http://repo.typesafe.com/typesafe/snapshots/",
"Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/",
"Maven Central Server" at "http://repo1.maven.org/maven2",
"mweiden mvn-repo" at "https://raw.github.com/mweiden/mvn-repo/master/releases")
@zacker330
zacker330 / README.md
Created February 9, 2016 23:55 — forked from chuckg/README.md
Bootstrap an image for use as a Vagrant base box

Requirements

Prepare virtual machine

@zacker330
zacker330 / gist:baf5000bed30e0f142c8
Created April 3, 2015 01:59
计算书价,用于报销
#!/usr/local/bin/ruby -w
require 'bigdecimal'
require 'bigdecimal/util'
sum = BigDecimal.new('0')
count = 0
"""
<book> <price>
""".lines.select{|l| not l.nil? }.each{ |line|
price = line.split(' ')[1]
unless price.nil? then
@zacker330
zacker330 / .gemrc
Last active August 29, 2015 14:10
Ansible: install multiple rubies automatly by rbenv
gem: --no-document