Skip to content

Instantly share code, notes, and snippets.

View bloatfan's full-sized avatar
🤒
Out sick

bloatfan bloatfan

🤒
Out sick
View GitHub Profile
@bloatfan
bloatfan / .vimrc
Last active May 11, 2020 09:25
.vimrc
set nocompatible " be iMproved, required
filetype off " required
" git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
" mkdir -p ~/.vim/.backup/
" mkdir -p ~/.vim/.swp/
" mkdir -p ~/.vim/.undo/
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
@bloatfan
bloatfan / tmux-cheatsheet.markdown
Created August 20, 2019 06:12 — forked from ryerh/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

local threads = {}
wrk.headers['nonce'] = '1'
wrk.headers['sign'] = '1'
wrk.headers['token'] = '1'
wrk.headers['timestamp'] = '1'
setup = function (thread)
table.insert(threads, thread)
end
#!/bin/bash
############################################
# 云服务器带宽检查脚本
#
#version:1.2
#使用方法:
#例:./vmnetcheck.sh [em2|em1]
#
#参数说明:
#不写参数时,默认检查外网网卡em1
@bloatfan
bloatfan / remove.sh
Last active December 29, 2018 08:27
#!/bin/bash
# https://www.linuxidc.com/Linux/2017-12/149752.htm
TRASH_DIR="/root/.trash"
basepath_array=(
/
)
sudo /Applications/Google\ Chrome.app/Contents/MacOS/G...\ Chrome --ssl-key-log-file=/Users/`whoami`/sslkeylog.log
@bloatfan
bloatfan / go_graceful_restart.go
Last active April 12, 2021 14:45
[Go平滑重启实现的Demo]
// https://juejin.im/post/5b3629cbf265da59645b1ac5
package main
import (
"context"
"encoding/json"
"flag"
"fmt"
"net"
# network.yaml
network:
version: 2
renderer: networkd
ethernets:
enp9s0:
addresses:
- 192.168.1.13/24
gateway4: 192.168.1.1
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias ll='ls -al'
# Source global definitions
DEVICE=br0
ONBOOT=yes
BOOTPROTO=static
TYPE=Bridge
#NAME=br0
#DELAY=0
IPADDR=192.168.2.197
NETMASK=255.255.255.0
GATWAY=192.168.2.1