Skip to content

Instantly share code, notes, and snippets.

View gilyes's full-sized avatar

George Ilyes gilyes

  • Edmonton, Alberta
View GitHub Profile
@gilyes
gilyes / dropbox.service.md
Last active June 16, 2016 06:14 — forked from jsturgis/dropbox.service.md
dropbox systemd

Install Dropbox and Python script. Symlink Python script to /usr/local/bin/dropbox and make it executable.

#/etc/systemd/system/dropbox.service

[Unit]
Description=Dropbox Service
After=network.target

[Service]
@gilyes
gilyes / Kill connections to postgres database
Created June 16, 2016 04:41
Kill connections to postgres database
SELECT pg_terminate_backend(pg_stat_activity.pid)
FROM pg_stat_activity
WHERE pg_stat_activity.datname = 'TARGET_DB'
AND pid <> pg_backend_pid();
@gilyes
gilyes / Backup, restore postgres in docker container
Last active December 13, 2024 05:12
Backup/restore postgres in docker container
Backup:
docker exec -t -u postgres your-db-container pg_dumpall -c > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql
Restore:
cat your_dump.sql | docker exec -i your-db-container psql -Upostgres
@gilyes
gilyes / After kernel update, this may need to be run for docker to start working again
Last active June 17, 2021 08:42
After kernel update, this may need to be run for docker to start working again
sudo apt-get install linux-image-extra-`uname -r` && sudo modprobe aufs