Skip to content

Instantly share code, notes, and snippets.

View chenchun's full-sized avatar
🦖
go for{vacation()}

Chun Chen chenchun

🦖
go for{vacation()}
View GitHub Profile
@chenchun
chenchun / vps
Created February 28, 2020 04:46 — forked from hex108/vps
Manage(start/stop/status) vps on DigitalOcean. You could install shadowsocks automatically when creating a new vps.
#!/bin/bash
set -e
set -u
#set -x
SSH_KEY="05:8b:8f:f5:09:35:ae:61:a9:3b:21:ea:1c:36:bf:0c"
USER_DATA_FILE="$(dirname $0)/vps.userdata"
### sub functions
@chenchun
chenchun / replace.md
Last active October 1, 2019 02:47
idea quickly add swagger annotations based on comment

With powerful named capture groups replace, we can quickly add swagger annotations based on comment

find: (?<title1>\/\*\*\n     \* (?<title>.*)\n     \*/$)
replace: ${title1}\n    @ApiModelProperty(notes = "${title}")

Before

image

@chenchun
chenchun / crosvm.md
Last active August 5, 2021 03:51
#crosvm #kvm #firecracker #cloud-hypervisor
@chenchun
chenchun / .vimrc
Last active October 5, 2019 01:35
vimrc, vim, vi
set smarttab
set tabstop=4
set shiftwidth=4
set autoindent
set smartindent
set encoding=utf-8 fileencodings=ucs-bom,utf-8,cp936
@chenchun
chenchun / settings.json
Last active March 17, 2022 09:58
#vscode
// ~/.config/Code/User/settings.json
{
"workbench.colorTheme": "Quiet Light",
"window.title": "${activeEditorMedium}",
"clang.executable": "/usr/bin/clang-6.0",
"http.proxy": "http://example.com:8080",
"http.proxyStrictSSL": false,
"workbench.editor.enablePreview": false,
"go.inferGopath": true,
"go.toolsEnvVars": {"GOOS" : "linux"},
@chenchun
chenchun / Maglev.md
Last active November 18, 2019 02:38
load balance #loadbalance #lb
@chenchun
chenchun / Gobgp.md
Last active September 11, 2018 07:45
#bgp
  • GoBGP is just a bgp daemon and itself does not contain any functionality to modify routing table
  • If you like to use GoBGP as a component of software router and do packet forwarding, you need to implement that
  • There are two options to achieve FIB manipulation with GoBGP
    • Use built-in zebra integration
    • Write your own code using gRPC API
@chenchun
chenchun / sqllite3.md
Last active August 13, 2019 03:42
#sqllite #sqlite3
[root@tbds-100-88-65-29 /data/gaia/docker]# sqlite3 linkgraph.db 
SQLite version 3.7.17 2013-05-20 00:56:22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .databases
seq  name             file                                                      
---  ---------------  ----------------------------------------------------------
0    main             /data/gaia/docker/linkgraph.db                            
sqlite> .tables