Skip to content

Instantly share code, notes, and snippets.

AnJia anjia0532

Block or report user

Report or block anjia0532

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View clean_csv.py
# -*- coding: utf-8 -*-
# Author AnJia(anjia0532@gmail.com https://anjia0532.github.io)
import argparse
import sys, os
import io
reload(sys)
sys.setdefaultencoding('utf8')
black_dict={"\\":"","\"":""}
def main():
View lua-resty-maxminddb.lua
-- 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
@anjia0532
anjia0532 / rancher2.1.1.md
Last active Oct 26, 2018
rancher2.1.1.md
View rancher2.1.1.md

1. vmware 12 安装 ubuntu x64 16.04.4 LTS(单机安装) 4U16G50G

2. vmware 12 静默安装Ubuntu

3. ## 远程公司电脑,不知道为嘛无法复制。。。。明天再补充

4. 步骤完全按照 https://www.cnrancher.com/docs/rancher/v2.x/cn/installation/basic-environment-configuration/ 走的,包括最佳实践里的步骤

5. 之前在群里反馈过,coreos-etcd一直在restart ,通过logs -f 看,etcdserver/membership: cluster cannot be downgraded (current version: 3.2.24 is lower than determined cluster version: 3.3).k8s集群用了1.12 1.11 1.10都这样

6. 是不是不能在单台上运行?

@anjia0532
anjia0532 / Demo.java
Last active May 27, 2019
@HystrixCommand support dynamic command key
View Demo.java
@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){
@anjia0532
anjia0532 / ks.cfg.trusty
Created Mar 15, 2018 — forked from chusiang/ks.cfg.trusty
Kickstart script for Ubuntu 14.04
View ks.cfg.trusty
# ====================================================================
# 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
@anjia0532
anjia0532 / nginx.conf
Created Dec 14, 2017
nginx proxy_pass add a static parameter
View nginx.conf
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
View nexus_docker_image_clean.py
#! /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
View chinase_administrative_divisions_with_geo.js
{
"福建省": {
"南平市": {
"松溪县": {
"code": "350724",
"level": 3,
"parentCode": "350000",
"name": "松溪县",
"lon": 118.765689,
"lat": 27.610704
@anjia0532
anjia0532 / nginx
Created Sep 5, 2017
nginx init.d script
View nginx
#!/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
@anjia0532
anjia0532 / openresty
Last active Sep 5, 2017
openresty init.d script
View openresty
#!/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
You can’t perform that action at this time.