Skip to content

Instantly share code, notes, and snippets.

@a1300
a1300 / upgrade.sh
Created April 7, 2022 07:22
mainnet upgrade 07.04.2022
#!/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
@a1300
a1300 / README.md
Last active December 28, 2021 23:27
install hugo and go on server

Install Hugo and Go on Server

# 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
@a1300
a1300 / run_mainnet.sh
Last active September 16, 2021 10:54
upgrade mainnet
#!/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')
@a1300
a1300 / update_current_dir_recursivly.ps1
Created April 25, 2021 22:13
windows change creation date recursive
Get-ChildItem . -rec | where {!$_.PSIsContainer } | foreach { $_.LastAccessTime = Get-Date; $_.LastWriteTime = Get-Date; $_.CreationTime = Get-Date }
@a1300
a1300 / systemd_service_hardening.md
Created April 11, 2021 06:38 — forked from ageis/systemd_service_hardening.md
Options for hardening systemd service units

security and hardening options for systemd service units

A common and reliable pattern in service unit files is thus:

NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
DevicePolicy=closed
ProtectSystem=strict
@a1300
a1300 / run.sh
Last active April 7, 2022 06:10
upgrade testnet | restore backup
#!/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
@a1300
a1300 / grab-anchor-episode.sh
Created November 30, 2020 12:36 — forked from ivan/grab-anchor-episode.sh
Download a podcast episode from anchor.fm
#!/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
@a1300
a1300 / postgres-cheatsheet.md
Created May 13, 2020 07:24 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

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)
@a1300
a1300 / node_nginx_ssl.md
Created April 9, 2020 21:20 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@a1300
a1300 / README.md
Last active November 16, 2019 18:05
output / play sound / music on linux command line

Play sound

spd-say 'tests finished running'