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 / 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   
@chenchun
chenchun / idea.sh
Last active July 13, 2020 10:59
#idea #veth
umount /var/run/netns/idea &> /dev/null || true
docker rm -vf idea &> /dev/null || true
ip link del p1 &> /dev/null || true
docker run -d --name=idea --net=none --restart=always chenchun/ideals
pid=`docker inspect -f {{.State.Pid}} idea`
mkdir -p /var/run/netns/
touch /var/run/netns/idea
mount --bind /proc/$pid/ns/net /var/run/netns/idea
ip link add p1 type veth peer name p2
ip link set p2 netns idea
@chenchun
chenchun / dig.md
Last active August 27, 2019 06:37
#dig #dns #docker
dig hostname
dig hostname A +short
dig hostname AAAA +short
dig hostname A hostname AAAA +short

DNS系统中,常见的资源记录类型有:

  • 主机记录(A记录):RFC 1035定义,A记录是用于名称解析的重要记录,它将特定的主机名映射到对应主机的IP地址上。