Skip to content

Instantly share code, notes, and snippets.

View taynguyen's full-sized avatar

Tay Nguyen taynguyen

  • Dwarves Foundation
  • Ho Chi Minh city
View GitHub Profile
@taynguyen
taynguyen / iTerm2-with-OSX-keyboard-shortcut.txt
Created April 2, 2018 08:55
Making iTerm 2 work with normal Mac OSX keyboard shortcuts
Very useful link: https://elweb.co/making-iterm-2-work-with-normal-mac-osx-keyboard-shortcuts/
@taynguyen
taynguyen / keybase.md
Last active September 12, 2019 02:37

Keybase proof

I hereby claim:

  • I am taynguyen on github.
  • I am taynguyen (https://keybase.io/taynguyen) on keybase.
  • I have a public key ASDWd1SOCuRorCjWMWUVij5vy-yLggNbGrAZ_5bYHtTufwo

To claim this, I am signing this object:

@taynguyen
taynguyen / update-mysql-root-password.md
Created May 29, 2020 08:35
Update root password and allow login via password on MySQL

Situation:

  • You just installed MySQL (I'm worked with 5.70) on linux machine. You want to chagne root password and want to use password to login instead of login via sudo.

Actions

  • Login to mysql as root
sudo mysql -u root
  • Execute:
Debugging workflow:
- Open top and do first analysis
- Open grafana and ask yourself question while you see the graphs:
- Are disks free enough?
- When do events happen?
- Is there a cascading effect?
- Is there a wall to see??
- Verify systems and disks in AWS
- Log in to nodes in iterm parallel sessions and run the same commands on all of them from the same state.
- df -h
```
apt-get update
apt-get install prometheus-node-exporter
```
Note: Full prometheus install guide:
https://linuxhint.com/install-prometheus-ubuntu-18-04/
@taynguyen
taynguyen / jwtRS256.sh
Created November 13, 2020 07:45 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@taynguyen
taynguyen / Set up go project with private dependency
Last active November 17, 2020 07:44
Set up go project with private dependency
# Set up go project with private dependency
Goal:
- Set up project with private dependency using go module.
## Using access token
Override access token to your git config, so it would include username and access key, so that you would be able to use go get your private repo
```
git config --global url."https://${username}:${access_token}@gitlab.com".insteadOf "https://gitlab.com"
```
```
server {
server_name taynguyen.dev;
location / {
proxy_pass http://127.0.0.1:8080;
}
}
@taynguyen
taynguyen / gist:1758bd193d9c3462a21ae961c23c5c91
Created December 23, 2020 11:27
Mount your ebs volumn ec2
https://devopscube.com/mount-ebs-volume-ec2-instance/