This file contains hidden or 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
# CLI command to dump the database dump from Docker container with custom port. Container based on bitnami/postgresql | |
docker exec -e PGPASSWORD="YOUR_PASSWORD" [CONTAINER_NAME] /opt/bitnami/postgresql/bin/pg_dump -p [YOUR_PORT_DEFAULT_5432] -U [POSTGRES_USER] -d [POSTGRES_DB] > backup.sql | |
# zip | |
docker exec -e PGPASSWORD="YOUR_PASSWORD" [CONTAINER_NAME] /opt/bitnami/postgresql/bin/pg_dump -p [YOUR_PORT_DEFAULT_5432] -U [POSTGRES_USER] -d [POSTGRES_DB] | zip > backup.sql | |
# zip with password | |
docker exec -e PGPASSWORD="YOUR_PASSWORD" [CONTAINER_NAME] /opt/bitnami/postgresql/bin/pg_dump -p [YOUR_PORT_DEFAULT_5432] -U [POSTGRES_USER] -d [POSTGRES_DB] | zip -e -P "ZIP_FILE_PASSWORD" backup.zip - | |
# zip with password and with named sql file (dump.sql) |
This file contains hidden or 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
FROM php:5.6-fpm | |
RUN sed -i 's|deb.debian.org/debian|archive.debian.org/debian|g' /etc/apt/sources.list && \ | |
sed -i '/security.debian.org/d' /etc/apt/sources.list && \ | |
sed -i '/stretch-updates/d' /etc/apt/sources.list && \ | |
echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/99no-check-valid-until && \ | |
echo 'Acquire::AllowInsecureRepositories "true";' > /etc/apt/apt.conf.d/99allow-insecure && \ | |
echo 'APT::Get::AllowUnauthenticated "true";' >> /etc/apt/apt.conf.d/99allow-insecure | |
RUN apt-get update && apt-get install -y --no-install-recommends \ |
This file contains hidden or 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
<?php | |
/** | |
* 1. You have to store your client SSL certificates on your Laravel server, in my case this is /var/certs/mydomain.com/... | |
* 2. You have to right select SSL mode for PostgreSQL (see https://www.postgresql.org/docs/current/libpq-ssl.html#LIBPQ-SSL-SSLMODE-STATEMENTS), verify-full means your server CA is signed for real domain name for the PostgreSQL server (recommended) | |
* 3. Go to Laravel config/database.php to the section 'pgsql' and extend it to the following: | |
*/ | |
return [ | |
/*...*/ | |
'connections' => [ | |
/*'mysql' etc*/ |
This file contains hidden or 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
/** | |
* Function to check the current Moodle version pass your params | |
* | |
* @param string $version Number of version or release['3.5' or '4.1'] (depends on @param $checkfor) | |
* @param string $checkfor ['all' or 'release' ($version like '3.1.3')] or 'version' ($version like '2016052303') | |
* @param string $compare http://php.net/manual/function.version-compare.php#refsect1-function.version-compare-parameters | |
* @return bool | |
* @author Igor Sazonov <[email protected]> | |
* @example $check = checkMoodleVersion('3.9'); //if current Moodle version is 4.2 - returns true because $compare is >= | |
*/ |