This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- all databases sizes | |
SELECT table_schema AS "Database", | |
ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Size (MB)" | |
FROM information_schema.TABLES | |
GROUP BY table_schema; | |
-- sizes of all of the tables in a specific database | |
SELECT table_name AS "Table", | |
ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Size (MB)" | |
FROM information_schema.TABLES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:'SET PASSWORD | |
sudo -i -u postgres | |
psql | |
\password postgres | |
' | |
# RHEL / CentOS 8 | |
# https://www.postgresql.org/download/linux/redhat/ | |
# https://www.postgresql.org/docs/current/runtime.html | |
dnf list installed |grep postgresql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://www.pgbouncer.org/install.html | |
# sudo dnf install pgbouncer | |
# Problem: package pgbouncer requires python-psycopg2, but none of the providers can be installed | |
# https://www.pgbouncer.org/install.html#building | |
sudo dnf install libevent libevent-devel | |
# https://www.pgbouncer.org/downloads/ | |
wget -c https://www.pgbouncer.org/downloads/files/1.12.0/pgbouncer-1.12.0.tar.gz | |
tar xvfz pgbouncer-1.12.0.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Private key | |
openssl ecparam -genkey -name secp384r1 -out nginx.ec.key | |
openssl ec -in nginx.ec.key -text -noout | |
# CSR | |
openssl req -new -sha256 -key nginx.ec.key -subj "/CN=devops/C=BM/ST=Bermudian/L=Bermudian/O=Org/OU=IT" -out nginx.ec.csr | |
#openssl req -in nginx.ec.csr -text -noout | |
openssl req -in nginx.ec.csr -text -noout | grep -i "Signature.*SHA256" && echo "All is well" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/openssl/openssl/blob/master/INSTALL.md | |
# https://github.com/openssl/openssl/blob/master/NOTES.UNIX | |
# https://www.openssl.org/docs/man1.1.1/ | |
# reqs | |
#sudo yum groupinstall "Development Tools" | |
#sudo apt-get install build-essential cmake gcc libssl-dev | |
cd /usr/local/src | |
wget https://www.openssl.org/source/openssl-1.1.1g.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
apt-get update && apt-get upgrade | |
apt install -y dialog | |
# ------------------------ | |
# INITIAL | |
# ------------------------ | |
# see https://gist.github.com/coder4web/5fe1bb155d8957558911 | |
dpkg-reconfigure locales |
OlderNewer