A one paragraph description about the container.
These instructions will cover usage information and for the docker container
# configure postgresql for real-time replication | |
docker_setup_replication() { | |
psql -U postgres -c "CREATE USER replicator WITH REPLICATION ENCRYPTED PASSWORD 'passw0rd';" && \ | |
psql -U postgres -c "ALTER SYSTEM SET listen_addresses TO '*'" && \ | |
psql -U postgres -c "alter system set wal_level = replica ;" && \ | |
psql -U postgres -c "alter system set max_wal_senders = 18;" && \ | |
psql -U postgres -c "alter system set hot_standby = on;" && \ | |
echo host replication replicator 0.0.0.0/0 trust >> "$PGDATA/pg_hba.conf" | |
echo "User Replicator added!" |
FROM postgres:12 | |
COPY ./setup-master.sh /docker-entrypoint-initdb.d/setup-master.sh | |
COPY ./setup-db.sh /docker-entrypoint-initdb.d/setup-db.sh | |
WORKDIR /tables/ | |
COPY actors.tar.gz . | |
COPY basics.tar.gz . |
#!/usr/bin/env bash | |
# configure postgresql for real-time replication | |
psql -U postgres -c "CREATE USER replicator WITH REPLICATION ENCRYPTED PASSWORD 'passw0rd';" && \ | |
psql -U postgres -c "ALTER SYSTEM SET listen_addresses TO '*'" && \ | |
psql -U postgres -c "alter system set wal_level = replica ;" && \ | |
psql -U postgres -c "alter system set max_wal_senders = 18;" && \ | |
psql -U postgres -c "alter system set hot_standby = on;" && \ | |
psql -U postgres -c "alter system set promote_trigger_file='promote.signal'" && \ | |
echo host replication replicator 0.0.0.0/0 trust >> "$PGDATA/pg_hba.conf" | |
echo "User Replicator added!" |
#!/bin/bash | |
# pg_restore is a utility for restoring a PostgreSQL database from an archive created by pg_dump. | |
# Here we are restoring tables that have records of movie titles(basics.tar.gz) and actors(actors.tar.gz) into the movie database. | |
pg_restore -d movie /tables/actors.tar.gz | |
pg_restore -d movie /tables/basics.tar.gz |
import paramiko | |
hostname = 'localhost' | |
username = 'codesenju' | |
password = 'passw0rd' | |
PORT = '2222' | |
ssh = paramiko.SSHClient() | |
def execRemoteCommand(cmd_, client): |
Converting Keys to .pem | |
openssl x509 -in certificate.crt -out certificate.pem -outform PEM | |
openssl rsa -in private.key -text > privatekey.pem |
[defaults] | |
# (pathlist) Comma separated list of Ansible inventory sources | |
inventory = inventory | |
# (string) Path to the Python interpreter to be used for module execution on remote targets, or an automatic discovery mode. Supported discovery modes are ``auto`` (the default), ``auto_silent``, ``auto_legacy``, and ``auto_legacy_silent``. All discovery modes employ a lookup table to use the included system Python (on distributions known to include one), falling back to a fixed ordered list of well-known Python interpreter locations if a platform-specific default is not available. The fallback behavior will issue a warning that the interpreter should be set explicitly (since interpreters installed later may change which one is used). This warning behavior can be disabled by setting ``auto_silent`` or ``auto_legacy_silent``. The value of ``auto_legacy`` provides all the same behavior, but for backwards-compatibility with older Ansible releases that always defaulted to ``/usr/bin/python``, will use that interpreter |
import paramiko, sys, os | |
hostname = '' | |
username = '' | |
password = '' | |
PORT = '22' | |
ssh = paramiko.SSHClient() | |
def run_local_cmd(your_command): |