Skip to content

Instantly share code, notes, and snippets.

View neto-developer's full-sized avatar
🎯
Focusing

Neto, Aristides da Silva neto-developer

🎯
Focusing
View GitHub Profile
@emresaracoglu
emresaracoglu / gist:46271cfd25a64930db06ffb4aaa3526d
Last active September 8, 2022 15:00 — forked from icanhazstring/gist:71d974a58d2f35e8abc8
Install zmq centos 7 and PHP Extension
## install
yum install zeromq-devel
## install zmq.so
cd ~
git clone https://github.com/zeromq/php-zmq.git
cd php-zmq
phpize && ./configure
make && make install
@zhujunsan
zhujunsan / Using Github Deploy Key.md
Last active April 29, 2024 19:14
Using Github Deploy Key

What / Why

Deploy key is a SSH key set in your repo to grant client read-only (as well as r/w, if you want) access to your repo.

As the name says, its primary function is to be used in the deploy process in replace of username/password, where only read access is needed. Therefore keep the repo safe from the attack, in case the server side is fallen.

How to

  1. Generate a ssh key
@powellc
powellc / pg_backup_all.sh
Last active October 1, 2023 19:14
Bash script to backup all postgresql databases on a server, run with cron once a day or 5 times a day, whatever. Just updated it so it ignores your postgres db, and also bzips the backups and adds a symlink to a latest directory. Sweet.
#!/bin/bash
# Location to place backups.
backup_dir="/var/backups/databases/"
nightly_dir="/var/backups/databases/latest/"
#String to append to the name of the backup files
backup_date=`date +%d-%m-%Y`
#Numbers of days you want to keep copie of your databases
number_of_days=15
databases=`psql -l -t | cut -d'|' -f1 | sed -e 's/ //g' -e '/^$/d'`
for i in $databases; do if [ "$i" != "postgres" ] && [ "$i" != "template0" ] && [ "$i" != "template1" ] && [ "$i" != "template_postgis" ]; then