This file contains hidden or 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 python3 | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from sys import argv | |
content = bytearray(open(argv[1], 'rb').read()) | |
freq, bins, patches = plt.hist(content, 256) | |
plt.xlabel("Symbol"); plt.ylabel("Frequency") | |
plt.grid(True) |
This file contains hidden or 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
alias uncomment='egrep -v "^\s*(#|;)|^$"' |
This file contains hidden or 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
#!/bin/bash | |
# | |
# Backup file script. | |
# | |
# The backup is performed with `duplicity`, | |
# in local mode or through the network with | |
# SCP, SFTP.., so all the tools must be | |
# installed in both hosts (source and destination). | |
# | |
# The initial archive contains all |
This file contains hidden or 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
#!/bin/bash | |
# | |
# Script to remove old backup files made with duplicity. | |
# | |
# See the `duplicity` home page for more information: | |
# http://duplicity.nongnu.org | |
# | |
# Author: (2014) Mariano Ruiz <[email protected]> | |
# |
This file contains hidden or 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
# | |
# Run backup process with duplicity tool. | |
# | |
# Check log file in /var/log/backup-duplicity.log | |
# | |
# Run incremental backup every 3 hours | |
0 */3 * * * root /backup/bin/backup-duplicity | |
# Remove all backups older than 15 days at 00:52 AM, every Saturday (every 7 days) |
This file contains hidden or 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
#!/bin/bash | |
# | |
# Script to execute the 'cron' task with Barman Postgres backup | |
# system. | |
# | |
# Do NOT confuse this with a **crontab** task: this script | |
# only do the archive of the continuous WAL files sent | |
# by PostgreSQL, but it's a good practise execute this | |
# script periodically with the Unix Cron system. | |
# |
This file contains hidden or 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
#!/bin/bash | |
# | |
# Script to backup PostgreSQL with Barman. | |
# | |
# After the backup is performed, this script | |
# also delete the oldest backup found. | |
# | |
# See the `PG Barman` home page for more information: | |
# http://www.pgbarman.org | |
# |
This file contains hidden or 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
# | |
# Run backup process with PG Barman tool. | |
# | |
# Check log file in /var/log/backup-pgbarman.log | |
# | |
# Run WAL archiving backup every hours | |
10 */1 * * * barman /var/lib/barman/bin/backup-pgbarman-cron | |
# Run full backup, every days |
This file contains hidden or 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
## nanorc file for .ini and .conf files. | |
## | |
syntax "ini" "(\.(ini|conf|cnf|properties)|rc)$" | |
## Symbols | |
color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)" | |
## Strings | |
color brightyellow ""(\\.|[^"])*"" "'(\\.|[^'])*'" | |
## Comments | |
icolor brightblue "^[[:space:]]*#.*$" | |
icolor cyan "^[[:space:]]*##.*$" |
This file contains hidden or 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
server { | |
listen 80; | |
server_name mysite.com www.mysite.com; | |
access_log /var/log/nginx/mysite.com.access.log; | |
error_log /var/log/nginx/mysite.com.error.log; | |
location / { | |
proxy_pass http://127.0.0.1:8080; | |
} | |
include /etc/nginx/proxy.conf; |