Skip to content

Instantly share code, notes, and snippets.

@anjia0532
anjia0532 / nginx.conf
Created December 14, 2017 04:08
nginx proxy_pass add a static parameter
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
@anjia0532
anjia0532 / Demo.java
Last active April 19, 2023 10:36
@HystrixCommand support dynamic command key
@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 / Activate Office 2019 for macOS VoL.md
Created June 7, 2021 05:53 — forked from zthxxx/Activate Office 2019 for macOS VoL.md
crack activate office on mac with license file

Activate MS Office 2019/2016 for macOS - Microsoft_Office_2019_VL_Serializer

Office 2019 above

2019-06-03

Note that Office2019 DO NOT support activate via simple copy/paste plist license file which is the simplest way to activate Office 2016. Fortunately, you can also use the VL Serializer tool, just install Office 2019 and Serializer, then run Serializer to activate.

Ref

# -*- 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():
@anjia0532
anjia0532 / nexus_docker_image_clean.py
Last active July 11, 2019 08:14
auto clean more than 30 unused docker image https://stackoverflow.com/a/46481098/7001350
#! /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
{
"福建省": {
"南平市": {
"松溪县": {
"code": "350724",
"level": 3,
"parentCode": "350000",
"name": "松溪县",
"lon": 118.765689,
"lat": 27.610704
@anjia0532
anjia0532 / lua-resty-maxminddb.lua
Created December 7, 2018 00:10
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 October 26, 2018 05:42
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 / ks.cfg.trusty
Created March 15, 2018 00:43 — forked from chusiang/ks.cfg.trusty
Kickstart script for Ubuntu 14.04
# ====================================================================
# 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
Created September 5, 2017 07:59
nginx init.d script
#!/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