Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block adenosinew

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
adenosinew / PrintQuoted.go
Last active Aug 25, 2019
[Go string] Work with strings #go
View PrintQuoted.go
// The %q (quoted) verb will escape any non-printable byte sequences in a string so the output is unambiguous.
fmt.Printf("%q\n", sample)
adenosinew / createSession.go
Created Aug 24, 2019
[AWS Go] Use aws go sdk
View createSession.go
sess, err := session.NewSession(&aws.Config{
Region: aws.String("us-west-2"),
Credentials: credentials.NewStaticCredentials(conf.AWS_ACCESS_KEY_ID, conf.AWS_SECRET_ACCESS_KEY, ""),
adenosinew /
Created Aug 19, 2019
[aws s3] #cloud
aws s3 sync backup s3://tgsbucket
aws s3 sync s3://tgsbucket/backup /tmp/backup
aws s3 sync s3://tgsbucket s3://backup-bucket
View readFileLine.go
file, err := os.Open("file.txt")
if err != nil {
defer file.Close()
scanner := bufio.NewScanner(file)
for scanner.Scan() {
adenosinew /
Created Aug 13, 2019
[Go Commands] Useful Go commands
# Check the gopath and goroot
go env
adenosinew / cpuUtilization
Created Jul 3, 2019
[Grafana Querys] #devops
View cpuUtilization
100 - (avg by (instance) (irate(node_cpu_seconds_total{job="node",mode="idle"}[5m])) * 100)
curl -X POST -k -H 'Content-Type: application/json' -H 'APIKEY: XXX' -H 'APISECRET: YYY' "https://APIENDPOINT? news..."
adenosinew /
Created May 3, 2019
[Linux Permission] Work with Linux permission #linux #management
# For macOS
stat -f "%OLp" <file>
# For Linux
stat --format '%a' <file>
adenosinew /
Created Apr 3, 2019
[Linux user management] Manage the user profiles in the Linux system #Linux #management
# List All available shells
cat /etc/shells
# Check the detail of user
less /etc/passwd
# e.g. Change the default shell of ubuntu
## 1. usermod
usermod --shell /bin/tcsh ubuntu
You can’t perform that action at this time.