From adee128e516c4b4dc8e5800618cb83fc0465a0d4 Mon Sep 17 00:00:00 2001 From: pt Date: Fri, 7 Feb 2020 00:47:47 -0500 Subject: [PATCH] notes --- multipass.md | 9 +++++++++ pghero.md | 32 ++++++++++++++++++++++++++++++++ ufw.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 multipass.md create mode 100644 pghero.md create mode 100644 ufw.md diff --git a/multipass.md b/multipass.md new file mode 100644 index 0000000..2c8d2fe --- /dev/null +++ b/multipass.md @@ -0,0 +1,9 @@ +mutlipass - ubuntu vm's from canonical + +snap install multipass --classic (apparently this option is required and allows the snap to violate it's sandbox??) + +https://multipass.run/ + + + + diff --git a/pghero.md b/pghero.md new file mode 100644 index 0000000..a066edf --- /dev/null +++ b/pghero.md @@ -0,0 +1,32 @@ +https://github.com/ankane/pghero/blob/master/guides/Linux.md + +get: +``` +wget -qO- https://dl.packager.io/srv/pghero/pghero/key | sudo apt-key add - +sudo wget -O /etc/apt/sources.list.d/pghero.list \ + https://dl.packager.io/srv/pghero/pghero/master/installer/ubuntu/18.04.repo +sudo apt-get update +sudo apt-get -y install pghero +``` + +Add your database. (use \ to escape special passw chars) +``` +sudo pghero config:set DATABASE_URL=postgres://user:password@hostname:5432/dbname +``` + +And optional authentication. +``` +sudo pghero config:set PGHERO_USERNAME=link +sudo pghero config:set PGHERO_PASSWORD=hyrule +``` + +Start the server +``` +sudo pghero config:set PORT=3001 +sudo pghero config:set RAILS_LOG_TO_STDOUT=disabled +sudo pghero scale web=1 +``` + +Confirm it’s running with: + +`curl -v http://localhost:3001/` \ No newline at end of file diff --git a/ufw.md b/ufw.md new file mode 100644 index 0000000..032a809 --- /dev/null +++ b/ufw.md @@ -0,0 +1,43 @@ +if you dont specify a protocol it allows either tcp/udp + +**ports** +``` +sudo ufw allow 22 +sudo ufw allow 22/tcp +``` + +**ranges** +``` +sudo ufw allow 6000:6007/tcp +sudo ufw allow 6000:6007/udp +``` + +**specific ip** +``` +sudo ufw allow from 203.0.113.4 +sudo ufw allow from 203.0.113.4 to any port 22 +``` + +enable firewall `suod ufw enable` + + +## inquirey +`sudo ufw status numbered` + pt@r710:~$ sudo ufw status numbered + Status: active + + To Action From + -- ------ ---- + [ 1] 22/tcp ALLOW IN Anywhere + [ 2] 5432 ALLOW IN Anywhere + [ 3] 5440 ALLOW IN Anywhere + [ 4] 10000 ALLOW IN Anywhere + [ 5] 443/tcp ALLOW IN Anywhere + [ 6] 5433/tcp ALLOW IN Anywhere + [ 7] 22/tcp (v6) ALLOW IN Anywhere (v6) + [ 8] 5432 (v6) ALLOW IN Anywhere (v6) + [ 9] 5440 (v6) ALLOW IN Anywhere (v6) + [10] 10000 (v6) ALLOW IN Anywhere (v6) + [11] 443/tcp (v6) ALLOW IN Anywhere (v6) + [12] 5433/tcp (v6) ALLOW IN Anywhere (v6) +