From 07c05244e7b4083cfc53680ba58aeb7934e6e8c5 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Fri, 7 Feb 2020 01:00:17 -0500 Subject: [PATCH] notes --- multipass.md | 18 +++++----- nginx.md | 4 +-- pgbdager.md | 3 ++ pghero.md | 62 +++++++++++++++++----------------- postgres/nginx.md | 4 +-- ufw.md | 86 +++++++++++++++++++++++------------------------ wekan.md | 14 ++++---- 7 files changed, 97 insertions(+), 94 deletions(-) create mode 100644 pgbdager.md diff --git a/multipass.md b/multipass.md index 2c8d2fe..360a7dd 100644 --- a/multipass.md +++ b/multipass.md @@ -1,9 +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/ - - - - +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/nginx.md b/nginx.md index 7e2da4e..622e233 100644 --- a/nginx.md +++ b/nginx.md @@ -1,2 +1,2 @@ -https://nginx.org/en/docs/http/configuring_https_servers.html - +https://nginx.org/en/docs/http/configuring_https_servers.html + diff --git a/pgbdager.md b/pgbdager.md new file mode 100644 index 0000000..ce44791 --- /dev/null +++ b/pgbdager.md @@ -0,0 +1,3 @@ +creates a file `out.html` by default + + sudo pgbadger --prefix '%t [%p]: [%l-1] user=%u,db=%d,app=%a,client=%h,remote=%r ' //var/log/postgresql/postgresql-2020-02* diff --git a/pghero.md b/pghero.md index a066edf..9fb4ef0 100644 --- a/pghero.md +++ b/pghero.md @@ -1,32 +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: - +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/postgres/nginx.md b/postgres/nginx.md index 862e997..7187841 100644 --- a/postgres/nginx.md +++ b/postgres/nginx.md @@ -1,3 +1,3 @@ -setting up reverse proxy for different sub domains - +setting up reverse proxy for different sub domains + https://serverfault.com/questions/753105/how-to-reverse-proxy-to-different-places-depending-on-subdomain-in-nginx \ No newline at end of file diff --git a/ufw.md b/ufw.md index 032a809..06e8a2a 100644 --- a/ufw.md +++ b/ufw.md @@ -1,43 +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) - +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) + diff --git a/wekan.md b/wekan.md index 261fa7d..b791e42 100644 --- a/wekan.md +++ b/wekan.md @@ -1,8 +1,8 @@ -https://github.com/wekan/wekan-snap/wiki/Install - - -`snap set wekan root-url='https://example.com/something'` - -`snap set wekan port='3001'` - +https://github.com/wekan/wekan-snap/wiki/Install + + +`snap set wekan root-url='https://example.com/something'` + +`snap set wekan port='3001'` + caddy files exist but not understood: //var/snap/wekan/common \ No newline at end of file