# install go
wget https://go.dev/dl/go1.17.5.linux-amd64.tar.gz
tar xzf go1.17.5.linux-amd64.tar.gz
mv go /usr/local
echo 'export PATH=$PATH:/usr/local/go/bin' >> .bashrc
. .bashrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# If you run your node with docker, please follow the statements below. | |
#You need ~ 10GB of free space for this | |
sudo apt-get install zip unzip | |
# download | |
wget https://mainnet.snapshots.gny.io/v2_height_3505970_07-04-2022_06_57_21.zip | |
unzip v2_height_3505970_07-04-2022_06_57_21.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
################## | |
# backup current database | |
################## | |
sudo docker stop node1 | |
sudo docker rm node1 | |
sleep 15s | |
LAST_HEIGHT=$(sudo docker exec -it db1 psql -U postgres -d postgres -c "select max(height) from block" | sed -n 3p | sed 's/ //g;s/\t//g;s/\r//g;s/$//g') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ChildItem . -rec | where {!$_.PSIsContainer } | foreach { $_.LastAccessTime = Get-Date; $_.LastWriteTime = Get-Date; $_.CreationTime = Get-Date } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# If you run your node with docker, please follow the statements below. | |
#You need ~ 10GB of free space for this | |
sudo apt-get install zip unzip | |
# download | |
wget https://testnet.snapshots.gny.io/v2_height_3136119_07-04-2022_06_03_01.zip | |
unzip v2_height_3136119_07-04-2022_06_03_01.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Download a podcast episode from anchor.fm | |
# | |
# Usage: | |
# grab-anchor-episode https://anchor.fm/emerge/episodes/Robert-MacNaughton---Learnings-from-the-Life-and-Death-of-the-Integral-Center-e31val | |
# | |
# anchor.fm serves a list of m4a files that need to be concatenated with ffmpeg. | |
set -eu -o pipefail |
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the\
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a
I will be using the root user, but would suggest creating a new user
NewerOlder