Skip to content

Instantly share code, notes, and snippets.

@miguelmota
miguelmota / iso_to_unix.js
Created Jun 20, 2022
JavaScript ISO timestamp to unix timestamp seconds
View iso_to_unix.js
Math.floor(new Date('Fri, 17 Jun 2022 12:28:34 -0700').getTime() / 1000)
@miguelmota
miguelmota / hdpaths.txt
Created Jun 20, 2022
ETH HD Derivation Paths. Ledger Legacy, Ledger Live, Trezor, MetaMask
View hdpaths.txt
Ledger (legacy): 44'/60'/0'/{account_index} (eg. 44'/60'/0'/0, 44'/60'/0'/1, 44'/60'/0'/2, etc)
ledger (live): m/44'/60'/{account_index}'/0/0 (eg. m/44'/60'/0'/0/0, m/44'/60'/1'/0/0, m/44'/60'/2'/0/0, etc)
trezor: m/44'/60'/0'/0/{account_index} (eg. m/44'/60'/0'/0/0, m/44'/60'/0'/0/1, m/44'/60'/0'/0/2, etc)
metamask: m/44'/60'/0'/0/{account_index} (eg. m/44'/60'/0'/0/0, m/44'/60'/0'/0/1, m/44'/60'/0'/0/2, etc)
@miguelmota
miguelmota / goerli_dai.txt
Created Jun 17, 2022
goerli dai contract address mint
View goerli_dai.txt
0xC61bA16e864eFbd06a9fe30Aab39D18B8F63710a
@miguelmota
miguelmota / goerli_usdc.txt
Created Jun 17, 2022
goerli usdc contract address mint
View goerli_usdc.txt
0x98339D8C260052B7ad81c28c16C0b98420f2B46a
@miguelmota
miguelmota / remove_user_group.sh
Created Jun 15, 2022
Linux remove user from group
View remove_user_group.sh
sudo gpasswd -d <user> <group>
@miguelmota
miguelmota / express.js
Created Jun 13, 2022
Node.js express payload json url size limits
View express.js
app.use(express.json({ limit: '500kb' }))
app.use(express.urlencoded({ extended: false, limit: '500kb', parameterLimit: 50 }))
@miguelmota
miguelmota / instructions.sh
Last active Jun 13, 2022
[Fix] Docker container creation causes kernel oops on linux-aws 5.13.0.1028.31~20.04.22 https://bugs.launchpad.net/ubuntu/+source/linux-aws-5.13/+bug/1977919
View instructions.sh
uname -r # 5.13.0-1028 is buggy
sudo systemctl stop docker
sudo systemctl stop docker.socket
sudo systemctl disable docker
sudo systemctl disable docker.socket
sudo apt-get update
sudo apt dist-upgrade -y && sudo apt autoremove -y
sudo apt-get update -y && sudo apt-get upgrade -y
sudo apt-get autoclean
sudo reboot
@miguelmota
miguelmota / rsync.sh
Created Jun 8, 2022
Linux rsync ssh using host from ssh config
View rsync.sh
rsync -avuz build/ --chmod=ugo=rwX -e ssh myhost:/var/www/public
@miguelmota
miguelmota / config
Last active Jun 8, 2022
Linux start ssh-agent globally
View config
Host *
AddKeysToAgent yes
@miguelmota
miguelmota / instructions.sh
Created Jun 8, 2022
Bash SSH cache ssh key passphrase
View instructions.sh
# start session
ssh-agent bash
# enter passphrase once
ssh-add ~/.ssh/id_rsa
# list keys
ssh-add -l