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
#!/usr/bin/env sh | |
DB="pg-latest_data" | |
DB_BCK="pg-latest_data-backup-$(date --iso-8601)" | |
#DB_BCK="pg-latest_data-backup-SNAPSHOT" | |
echo "Restoring backup of '$DB' database with backup '$DB_BCK' ..." | |
echo | |
docker-compose down | |
docker volume rm $DB |
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
#!/usr/bin/env bash | |
if [ "$#" -ne 1 -o "$1" == "-h" -o "$1" == "--help" ]; then | |
echo 'docker-sh: start a shell session with the container passed' | |
echo | |
echo "Use: docker-sh CONTAINER_NAME" | |
echo | |
echo "NOTE: partial names can be used, but the session" | |
echo " is started only if one container match" | |
exit 2 |
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
#!/usr/bin/env bash | |
if [ "$#" -ne 1 -o "$1" == "-h" -o "$1" == "--help" ]; then | |
echo "docker-volume-sh: start a shell session with the volume mounted at /data" | |
echo | |
echo "Use: docker-volume-sh VOLUME" | |
echo | |
echo "NOTE: if VOLUME does not exist, docker creates it first" | |
echo | |
exit 2 |
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
#!/usr/bin/env sh | |
if [ "$#" -ne 2 ]; then | |
echo "docker-volume-cp: copy one Docker volume content to another" | |
echo | |
echo "Use: docker-volume-cp VOL_SOURCE VOL_DEST" | |
echo | |
echo "NOTE: if VOL_DEST does not exist, docker-volume-cp creates it first" | |
exit 2 | |
fi |
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
couchdb-latest: | |
image: couchdb | |
environment: | |
- COUCHDB_USER=admin | |
- COUCHDB_PASSWORD=couch | |
ports: | |
- "5984:5984" | |
volumes: | |
- couchdb-data-latest:/opt/couchdb/data | |
- couchdb-conf-latest:/opt/couchdb/etc/local.d |
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
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then | |
c_reset='\e[0m' | |
c_git_clean='\e[0;32m' | |
c_git_dirty='\e[0;31m' | |
else | |
c_reset= | |
c_git_clean= | |
c_git_dirty= | |
fi |
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
version: "3.9" | |
services: | |
pg-latest: | |
container_name: pg-latest | |
image: postgres | |
environment: | |
- POSTGRES_PASSWORD=postgres | |
ports: | |
- "5432:5432" | |
volumes: |
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
mongo-latest: | |
image: mongo | |
ports: | |
- "27017:27017" | |
volumes: | |
- mongo-data-latest:/data/db | |
# - `docker-compose up' to start MongoDB attached to the console, or `.. start' detached | |
# - Connect with `docker-compose run mongo-latest mongo HOSTIP/DBNAME' | |
# - `docker-compose stop' to stop the service if it was detached, |
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
#!/usr/bin/env bash | |
# | |
# find-text: Find text or regex in a given path with context display, | |
# and omitting temp folders. | |
# | |
if [ "$1" == "-h" -o "$1" == "--help" ] | |
then | |
cat >&2 <<-'EOF' | |
find-text: find text or regex in a given path with context display, |
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
#!/usr/bin/env bash | |
# | |
# find-css: Find one or two words (CSS markups) across CSS, SCSS or LESS files | |
# | |
if [ "$#" == 0 -o "$1" == "-h" -o "$1" == "--help" ] | |
then | |
cat >&2 <<-'EOF' | |
find-css: Find one or two words (CSS markups) across CSS, SCSS or LESS files | |
in the folder passed as first parameter. |