Skip to content

Instantly share code, notes, and snippets.

View vuduongtp's full-sized avatar

vuduongtp vuduongtp

View GitHub Profile
@rnyrnyrny
rnyrnyrny / logger.go
Last active March 20, 2023 14:26
log using uber zap and lumberjack (zapcore.AddSync version)
// thanks to:
// https://github.com/uber-go/zap/blob/master/FAQ.md#does-zap-support-log-rotation
// https://studygolang.com/articles/17394
// https://stackoverflow.com/questions/54395407/zap-logging-with-1-customized-config-and-2-lumberjack
// Please test and debug it before putting it in production.
package logger
import (
"fmt"
"os"
@enyachoke
enyachoke / aes.go
Created January 15, 2019 06:51 — forked from tscholl2/aes.go
simple AES encryption/decryption example with PBKDF2 key derivation in Go, Javascript, and Python
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/sha256"
"encoding/hex"
"fmt"
"strings"
@proteye
proteye / aes_encryption.go
Created August 28, 2018 13:55
AES encryption/decryption with PBKDF2 key derivation example in Go language
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/sha256"
"encoding/base64"
"errors"
@hothero
hothero / aes_cbc_pkcs5.go
Last active March 30, 2024 02:53
AES/CBC/PKCS5Padding implementation by Golang (can work with JAVA, C#, etc.)
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"encoding/base64"
"fmt"
)
@nikhita
nikhita / update-golang.md
Last active June 17, 2024 16:29
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by: