Skip to content

Instantly share code, notes, and snippets.

View eagleon's full-sized avatar
🌴
On vacation

eagleon eagleon

🌴
On vacation
View GitHub Profile
@eagleon
eagleon / nginx_forbiden.md
Created September 4, 2023 08:10
Nginx封禁国外IP

1.编译相关模块并,安装Nginx

# 安装libmaxminddb https://github.com/maxmind/libmaxminddb
git clone https://github.com/maxmind/libmaxminddb
./configure
make
make check
sudo make install
sudo ldconfig
@eagleon
eagleon / han-zen.css
Last active October 31, 2020 03:08
typora theme - han for me
@charset "utf-8";
:root {
--active-file-bg-color: #dadada;
--active-file-bg-color: rgba(32, 43, 51, 0.63);
--active-file-text-color: white;
--bg-color: #fff;
--text-color: #333;
--side-bar-bg-color: #f5f5f5;
--control-text-color: #666;
package com.jd.sea.pc.id.item.aspect;
import com.alibaba.fastjson.JSON;
import com.google.common.base.Strings;
import com.jd.epx.alarm.Alarm;
import com.jd.sea.pc.id.item.comm.annotation.Watch;
import com.jd.sea.pc.id.item.domain.comm.RpcResult;
import com.jd.sea.pc.id.item.domain.constant.ItemConstant.Http;
import java.lang.reflect.Method;
import java.util.Arrays;
根据终端类型将以下代码
```
code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;}
```
bash, 写入到~/.bash_porfile
zsh, 写入到~/.zshrc
@eagleon
eagleon / risk.java
Created November 8, 2017 09:33
risk system interface
RiskRequest request = new RiskRequest();
request.pin = pin;
request.ip = ip;
request.time = new Date();
request.sysName = sysName;
request.riskLevel = RISK_LEVEL;
request.useType = useType;
private static final String RISK_VALUE = "risk";
private static final String RISK_NONE_VALUE = "none";
curl 'https://www.jd.id/stock/check.html' -H 'Pragma: no-cache' -H 'Origin: https://www.jd.id' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en,zh-CN;q=0.8,zh;q=0.6,en-US;q=0.4' -H 'User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.91 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Cache-Control: no-cache' -H 'X-Requested-With: XMLHttpRequest' -H 'Cookie: __jdv=63461492|direct|-|none|-|1505909818248; aid=e2badbad-51f8-4b7d-8a83-bd36bd3cf6df; unique_aid=15059098182472101765099; newfronttype2=0; eptView=%5B683606%5D; viewed=683606; stateId=2; areaId=33; cityId=4; __jda=63461492.15059098182472101765099.1505909818.1505909818.1505909818.1; __jdb=63461492.5.15059098182472101765099|1.1505909818; __jdc=63461492; vc=5910124856' -H 'Connection: keep-alive' -H 'Referer: https://www.jd.id/product/asus-zen-power-10050mah-power-bank-silver_683606/10019252.html?v
@eagleon
eagleon / nginx.time.conf
Created September 2, 2017 12:22
Nginx expire 时间单位
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
etag off; #关闭etag
expires 1d; #有效期一天
# expires的单位可以使用
# ms: 毫秒
# s: 秒
# m: 分钟
# h: 小时
# d: 天
# w: 星期
@eagleon
eagleon / http code.md
Last active February 8, 2017 03:28
[http status code]http 状态码 #tags: http

200 – 服务器成功返回网页 404 – 请求的网页不存在 503 – 服务不可用

1xx(临时响应) 表示临时响应并需要请求者继续执行操作的状态代码。

代码 说明

100   (继续) 请求者应当继续提出请求。 服务器返回此代码表示已收到请求的第一部分,正在等待其余部分。  
101   (切换协议) 请求者已要求服务器切换协议,服务器已确认并准备切换。
@eagleon
eagleon / https改造
Last active September 7, 2016 06:05
https改造:测试环境验证
1. 安装openssl
2. 颁发证书给自己
openssl genrsa -des3 -out server.key 1024 \\用于生成rsa私钥文件
openssl req -new -key server.key -out server.csr \\openssl req 用于生成证书请求
openssl rsa -in server.key -out server_nopwd.key \\利用openssl进行RSA为公钥加密
openssl x509 -req -days 365 -in server.csr -signkey server_nopwd.key -out server.crt
3. 添加nginx证书
server {