Skip to content

Instantly share code, notes, and snippets.

@chenset
chenset / nginx_deployment.yaml
Created July 17, 2022 03:07 — forked from petitviolet/nginx_deployment.yaml
sample Nginx configuration on Kubernetes using ConfigMap to configure nginx.
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-conf
data:
nginx.conf: |
user nginx;
worker_processes 3;
error_log /var/log/nginx/error.log;
events {
@chenset
chenset / 0-tcp_bbrplus.md
Created July 13, 2022 01:44 — forked from tinkernels/0-tcp_bbrplus.md
patch tcp_bbr with bbr_drain_to_target_cycling (bbrplus)
@chenset
chenset / http-proxy.go
Last active April 23, 2024 04:50
http-proxy.go http proxy in go, Support socks5 forward proxy
package main
import (
"bufio"
"context"
"flag"
"fmt"
"golang.org/x/net/proxy"
"io"
"log"
@chenset
chenset / golang batch unzip.go
Created May 20, 2019 08:44
golang batch unzip
package main
import (
"archive/zip"
"io"
"os"
"path/filepath"
)
func main() {
@chenset
chenset / git-ssh-auth-win-setup.md
Created May 20, 2019 01:55 — forked from bsara/git-ssh-auth-win-setup.md
Setup SSH Authentication for Git Bash on Windows

Setup SSH Authentication for Git Bash on Windows

Prepararation

  1. Create a folder at the root of your user home folder (Example: C:/Users/uname/) called .ssh.
  2. Create the following files if they do not already exist (paths begin from the root of your user home folder):
  • .ssh/config
我本想享受生活,结果发现活下来都很困难。
你的计划,就像零食,吃到肚子里之后就是个屁。
我已经不是那个花五十块钱,也要考虑很久的小孩了,现在五块钱都要深思熟虑。
今天天气很好,在房间里宅久了,准备去客厅散散心。
春节你要小心了,毕竟过年,都是要杀猪的。
经过多年的打拼,虽然没有什么收获,但你有债呀!
人为什么叫人类,因为人活着就是累。
说错话不要紧,你还会继续说错的。
你倒下了,能顶替你的人千千万
你获得了很多金钱,但同时也失去了很多东西,比如烦恼。
//socks5
//设置
git config --global http.proxy socks5://127.0.0.1:1080
git config --global https.proxy socks5://127.0.0.1:1080
//取消
git config --global --unset http.proxy socks5://127.0.0.1:1080
git config --global --unset https.proxy socks5://127.0.0.1:1080
@chenset
chenset / redis memory usage per key.sh
Last active March 27, 2019 03:37
redis memory usage per key
#!/usr/bin/env bash
redis_cmd='redis-cli -n 1'
# size of db
ssss=0
# get keys and sizes
for k in `$redis_cmd keys "*"`; do
key_size_bytes=`$redis_cmd memory usage $k`;
@chenset
chenset / ledsoff.sh
Created February 13, 2019 13:52
Stealth Mode (disable all LEDs)
#!/bin/sh
nvram set led_disable=1
nvram commit
service restart_leds
# Source https://www.linksysinfo.org/index.php?threads/stealth-mode-timer-function-rt-n66.54449/
@chenset
chenset / Proxy image with nginx
Last active August 14, 2022 05:24
Proxy image with nginx
server {
listen 80;
server_name domain.com;
merge_slashes off;
location ~ /(?<r>http://.*) {
resolver 8.8.4.4 8.8.8.8 4.2.2.2 valid=3600s ipv6=off;
proxy_set_header Referer "";
proxy_pass $r;