This commit is contained in:
@@ -46,31 +46,19 @@ tail -f /var/log/nginx/error.log
|
|||||||
tail -f /var/log/nginx/access.log
|
tail -f /var/log/nginx/access.log
|
||||||
```
|
```
|
||||||
|
|
||||||
USEFUL COMMANDS
|
## Dotnet runtimes
|
||||||
|
|
||||||
Get NGINX version from containerized nginx:
|
### Remove old
|
||||||
docker container exec -it \[container-id\] nginx -v
|
|
||||||
|
|
||||||
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
|
Some of these commands get the job done
|
||||||
|
|
||||||
|
```bash
|
||||||
cd /usr/share/dotnet/shared
|
cd /usr/share/dotnet/shared
|
||||||
apt-cache pkgnames Microsoft\*
|
apt-cache pkgnames Microsoft\*
|
||||||
apt-cache pkgnames
|
apt-cache pkgnames
|
||||||
apt list --installed
|
apt list --installed
|
||||||
apt-get remove dotnet-runtime-3.0
|
apt-get remove dotnet-runtime-3.0
|
||||||
|
```
|
||||||
|
|
||||||
## APT package manager
|
## APT package manager
|
||||||
|
|
||||||
@@ -92,8 +80,10 @@ cat /var/run/reboot-required
|
|||||||
|
|
||||||
### Uninstall and purge package
|
### Uninstall and purge package
|
||||||
|
|
||||||
|
```bash
|
||||||
sudo apt-get --purge remove package_name
|
sudo apt-get --purge remove package_name
|
||||||
apt-get autoremove
|
apt-get autoremove
|
||||||
|
```
|
||||||
|
|
||||||
## SPACES BACKUP
|
## 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
|
Commands must be terminated with a semicolon or it will wait until it sees one
|
||||||
|
|
||||||
Open sql console as postgres admin user:
|
Open sql console as postgres admin user:
|
||||||
|
|
||||||
|
```bash
|
||||||
sudo -u postgres psql
|
sudo -u postgres psql
|
||||||
|
```
|
||||||
|
|
||||||
#### Restore AyaNova from backup
|
#### Restore AyaNova from backup
|
||||||
|
|
||||||
@@ -145,23 +138,13 @@ sudo -u postgres psql
|
|||||||
|
|
||||||
#### List all dbs
|
#### List all dbs
|
||||||
|
|
||||||
`\l`
|
```sql
|
||||||
|
\l
|
||||||
|
```
|
||||||
|
|
||||||
#### Get disk size of db
|
#### Get disk size of db
|
||||||
|
|
||||||
In bytes:
|
_All_ databases in human readable format
|
||||||
`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
|
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
SELECT
|
SELECT
|
||||||
|
|||||||
Reference in New Issue
Block a user