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
-- a quick LUA access script for nginx to check IP addresses against an | |
-- `ip_blacklist` set in Redis, and if a match is found send a HTTP 403. | |
-- | |
-- allows for a common blacklist to be shared between a bunch of nginx | |
-- web servers using a remote redis instance. lookups are cached for a | |
-- configurable period of time. | |
-- | |
-- block an ip: | |
-- redis-cli SADD ip_blacklist 10.1.1.1 | |
-- remove an ip: |
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/sh | |
### BEGIN INIT INFO | |
# Provides: openresty | |
# Required-Start: $local_fs $remote_fs $network $syslog $named | |
# Required-Stop: $local_fs $remote_fs $network $syslog $named | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts openresty | |
# Description: starts openresty using start-stop-daemon | |
### END INIT INFO |
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/sh | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $network $remote_fs $local_fs | |
# Required-Stop: $network $remote_fs $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Stop/start nginx | |
### END INIT INFO |
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
{ | |
"福建省": { | |
"南平市": { | |
"松溪县": { | |
"code": "350724", | |
"level": 3, | |
"parentCode": "350000", | |
"name": "松溪县", | |
"lon": 118.765689, | |
"lat": 27.610704 |
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
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# python2.7 | |
from requests import Request, Session | |
from requests.exceptions import RequestException | |
from datetime import datetime,timedelta | |
import base64 | |
import json | |
import sys |
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
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; | |
default_type application/octet-stream; |
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
# ==================================================================== | |
# Author: 凍仁翔 / chusiang.lai (at) gmail.com | |
# Blog: http://note.drx.tw | |
# Filename: ks.cfg. | |
# Modified: 2015-02-25 10:20 | |
# Description: Kickstart Configurator for Ubuntu 14.04.1 LTS server (amd64) | |
# Reference: | |
# | |
# 1. 作業系統自動安裝應答 CD 製作 - kickstart | iThome Download | |
# - http://download.ithome.com.tw/article/index/id/1792 |
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
@Component | |
public class Demo { | |
@HystrixCommand(commandKey = "#key",groupKey = "#key",fallbackMethod = "fail") | |
public String exec(String key){ | |
if (RandomUtils.nextBoolean()) { | |
System.out.println(1 / 0); | |
} | |
return key; | |
} | |
public String fail(String key){ |
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
-- Copyright (C) Anjia (anjia0532) | |
local json = require('cjson') | |
local json_encode = json.encode | |
local json_decode = json.decode | |
local ngx_log = ngx.log | |
local ngx_ERR = ngx.ERR | |
local ngx_CRIT = ngx.CRIT | |
local ngx_INFO = ngx.INFO |
OlderNewer