This commit is contained in:
@@ -46,31 +46,19 @@ tail -f /var/log/nginx/error.log
|
||||
tail -f /var/log/nginx/access.log
|
||||
```
|
||||
|
||||
USEFUL COMMANDS
|
||||
## Dotnet runtimes
|
||||
|
||||
Get NGINX version from containerized nginx:
|
||||
docker container exec -it \[container-id\] nginx -v
|
||||
### Remove old
|
||||
|
||||
SUDO -> ROOT for session
|
||||
sudo -i
|
||||
(use exit to go back to john account)
|
||||
|
||||
Connect shell to running container:
|
||||
docker exec -it \[container-id\] bash (or ash on alpine)
|
||||
|
||||
CERTBOT DRY RUN
|
||||
append --dry-run to command
|
||||
|
||||
BACKUP FOLDERS AND FILES
|
||||
cp -R pecklist pecklist_backup
|
||||
|
||||
REMOVE OLD .NET RUNTIMES:
|
||||
Some of these commands get the job done
|
||||
|
||||
```bash
|
||||
cd /usr/share/dotnet/shared
|
||||
apt-cache pkgnames Microsoft\*
|
||||
apt-cache pkgnames
|
||||
apt list --installed
|
||||
apt-get remove dotnet-runtime-3.0
|
||||
```
|
||||
|
||||
## APT package manager
|
||||
|
||||
@@ -92,8 +80,10 @@ cat /var/run/reboot-required
|
||||
|
||||
### Uninstall and purge package
|
||||
|
||||
```bash
|
||||
sudo apt-get --purge remove package_name
|
||||
apt-get autoremove
|
||||
```
|
||||
|
||||
## SPACES BACKUP
|
||||
|
||||
@@ -128,7 +118,10 @@ nano /etc/systemd/system/ayanova.service
|
||||
Commands must be terminated with a semicolon or it will wait until it sees one
|
||||
|
||||
Open sql console as postgres admin user:
|
||||
|
||||
```bash
|
||||
sudo -u postgres psql
|
||||
```
|
||||
|
||||
#### Restore AyaNova from backup
|
||||
|
||||
@@ -145,23 +138,13 @@ sudo -u postgres psql
|
||||
|
||||
#### List all dbs
|
||||
|
||||
`\l`
|
||||
```sql
|
||||
\l
|
||||
```
|
||||
|
||||
#### Get disk size of db
|
||||
|
||||
In bytes:
|
||||
`select pg_database_size('AyaNova');`
|
||||
|
||||
Prettified to human readable sizes:
|
||||
|
||||
```sql
|
||||
SELECT
|
||||
pg_size_pretty (
|
||||
pg_database_size ('AyaNova')
|
||||
);
|
||||
```
|
||||
|
||||
Display the size of _all_ databases in human readable format
|
||||
_All_ databases in human readable format
|
||||
|
||||
```sql
|
||||
SELECT
|
||||
|
||||
Reference in New Issue
Block a user