Skip to content

Instantly share code, notes, and snippets.

View Chever-John's full-sized avatar
👋
Coding

Chever John Chever-John

👋
Coding
View GitHub Profile

Problem

The go command line tool needs to be able to fetch dependencies from your private GitLab, but authenticaiton is required.

This assumes your private GitLab is hosted at privategitlab.company.com.

Environment variables

The following environment variables are recommended:

export GO111MODULE=on
export GOPRIVATE=privategitlab.company.com
@Chever-John
Chever-John / gist:485afe2a502bf7b5bf944a5716eaaa6d
Last active September 5, 2022 16:48
After installing Ubuntu
sudo apt-get install git
git config --global user.name "CheverJohn"
git config --global user.email "[email protected]"
// start etcd
nohup etcd &
// stop etcd
kill `pgrep etcd`
// get all route info
etcdctl get / --prefix --keys-only
// delete all route info
@Chever-John
Chever-John / kubectl
Last active August 30, 2022 04:59
some commands about kubectl
kubectl delete pods --all --all-namespaces
kubectl delete pod websocket-server-service
kubectl delete --all pods --namespace=foo
kubectl delete --all deployments --namespace=foo
kubectl delete --all namespaces
```bash
@Chever-John
Chever-John / simulate-a-set.go
Last active April 10, 2022 15:55
Using map[...]bool to simulate a set in golang.
package main
import "fmt"
var validNames = map[string]bool{
"blue": true,
"yellow": true,
}
func main() {
#!/usr/bin/env bash
docker rm $(docker ps -qf 'status=exited')
docker rmi $(docker images -qf 'dangling=true')
docker rmi $(docker images -a)
docker rmi $(docker images -a) -f
docker volume rm $(docker volume ls -qf 'dangling=true')