Skip to content

Instantly share code, notes, and snippets.

View mrbrazzi's full-sized avatar

Mr. Brazzi mrbrazzi

View GitHub Profile
@patricknelson
patricknelson / - Using Xdebug in Docker.md
Last active October 15, 2023 19:59
Using Xdebug in Docker (works with PhpStorm)

Using Xdebug in Docker

Getting setup and running with Xdebug in a docker container these days is now fairly simple and is composed of two main steps:

  1. Ensure you've got XDebug installed and enabled in your PHP docker image, for example:
    # Installing Xdebug with PHP 7.3 images:
    RUN pecl install xdebug \
      && docker-php-ext-enable xdebug
@vielhuber
vielhuber / script.sh
Last active April 18, 2024 09:11
PostgreSQL: Backup and restore export import pg_dump with password on command line #sql
# best practice: linux
nano ~/.pgpass
*:5432:*:username:password
chmod 0600 ~/.pgpass
# best practice: windows
edit %APPDATA%\postgresql\pgpass.conf
*:5432:*:username:password
# linux
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@brock
brock / psql-with-gzip-cheatsheet.sh
Last active April 10, 2024 10:53
Exporting and Importing Postgres Databases using gzip
# This is just a cheat sheet:
# On production
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz
# On local
scp -C production:~/database.sql.gz
dropdb database && createdb database
gunzip < database.sql.gz | psql database
@hasantayyar
hasantayyar / .htaccess
Last active April 19, 2020 19:20
Maintenance page redirection with htaccess
# check if there is a file named maintenance.html
# so when you want to disable maintenance mode just remname "mv maintenance.html maintenance.html.disabled"
RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /maintenance.html [R=503,L]
ErrorDocument 503 /maintenance.html