Skip to content

Instantly share code, notes, and snippets.

Pablo Valor pablodevopensource

View GitHub Profile
@pablodevopensource
pablodevopensource / sentry_install.sh
Last active Apr 24, 2018
install sentry for puphpet
View sentry_install.sh
#!/bin/bash
sudo passwd root;
su - root;
sudo adduser sentry ; adduser sentry sudo;
su - sentry;
sudo apt-get update && sudo apt-get dist-upgrade && sudo apt-get autoremove && sudo apt-get install build-essential python-dev;
apt-get install curl
curl -O http://python-distribute.org/distribute_setup.py
sudo python distribute_setup.py ; rm distribute*
@pablodevopensource
pablodevopensource / mailservers.sh
Last active Jul 18, 2016
install postfix&dovecot for puphpet
View mailservers.sh
#!/bin/bash
sudo apt-get install postfix -y && sudo apt-get install dovecot-imapd dovecot-pop3d -y
View config.yaml
---
vagrantfile-local:
vm:
box: puphpet/ubuntu1404-x64
box_url: puphpet/ubuntu1404-x64
hostname: ''
memory: '512'
cpus: '1'
chosen_provider: virtualbox
network:
View crontab_example
# min hor diames diasem comand
00 00 * * * sh /home/backup/pgbackup.sh
#ejemplo de backup diario con postgresql a las 00 tirando desde el script pgbackup.sh
View sql_restore.sh
#restauracion de db en mysql
#mysql --host [servername] -u root -p[root_password] [database_name] < dumpfilename.sql
#restauracion de db en postgresql
#pgdump -h [servername] -U [user] -d your_db_name < dbbackup
View mysql_dump.sh
#!/bin/sh
BACKUP_DIR=/home/backup
#descargamos la db
mysqldump --host servername -u root -p (rootpass) dbtodump > dumpfile.sql
# para descargar una sola tabla sin descargar toda la db usariamos :
# mysqldump -u root -p rootpass dbname table_name \ /home/backup/table.sql
#para descargarlas todas:
View sentry.conf
#/etc/supervisor/conf.d/sentry.conf
program:sentry-web]
directory=/home/sentry/
command=/home/sentry/.virtualenvs/sentry_env/bin/sentry start http
autostart=true
autorestart=true
redirect_stderr=true
View sentry.conf.py
#/home/sentry/.sentry/
# This file is just Python, with a touch of Django which means you
# you can inherit and tweak settings to your hearts content.
from sentry.conf.server import *
import os.path
CONF_ROOT = os.path.dirname(__file__)
View sentry
#/etc/nginx/sites-available/
server {
# listen on port 80
listen 80;
# for requests to these domains
server_name logs.devopen.com;
# keep logs in these files
View pgbackup.sh
#!/bin/sh
BACKUP_DIR=/home/sentry/backup
cd $BACKUP_DIR
#Exportamos la base de datos
pg_dump -h direccion_ip -U user -d your_sentry_db_name > dbbackup.sql
#compresion de base de datos
tar -cf $BACKUP_DIR/bd$(date +%d-%m-%y_%H:%M).tar dbbackup.sql
You can’t perform that action at this time.