Allow connection to SSH port (defaults to 22)
-A INPUT -p tcp --dport 22 -j ACCEPT
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
Drop all connections by default
| DB_USERNAME='' | |
| DB_NAME='' | |
| DB_PASSWORD='' | |
| DB_HOST='' | |
| DATE=`date +%Y%m%d` | |
| TIME=`date +%H%M` | |
| BACKUP_DIR='/some/path/to/dbackups/' | |
| FILENAME="$DATE-$TIME.sql.gz" |
| server { | |
| listen 80; | |
| return 444; | |
| } |
| from invoke import task, run | |
| from paramiko import SSHConfig, SSHClient, SSHException, AutoAddPolicy | |
| import logging | |
| import os | |
| logging.basicConfig(level=logging.INFO) | |
| logger = logging.getLogger('Paramiko') |
| """ | |
| Used with Invoke to automate tasks | |
| Connect to a given hostname in a given SSH config file | |
| Inpired by: https://gist.github.com/acdha/6064215 | |
| """ | |
| from invoke import task, run | |
| from paramiko import SSHConfig, SSHClient, SSHException, AutoAddPolicy | |
| import logging |
| upstream backend_staging { | |
| server SOME_IP:PORT weight=5 max_fails=3 fail_timeout=30s; | |
| } | |
| server { | |
| listen 80; | |
| server_name www.domain.com; | |
| return 301 http://$server_name$request_uri; | |
| } | |
| server { |
| user nginx; | |
| worker_processes 4; | |
| pid /run/nginx.pid; | |
| events { | |
| worker_connections 768; | |
| } | |
| http { | |
| sendfile on; | |
| tcp_nopush on; | |
| tcp_nodelay on; |
| #!/bin/bash | |
| NAME="project_name" | |
| DJANGODIR="/path/to/django_project" | |
| VIRTUAL_ENV_DIR="/path/to/virtualenv/folder" | |
| VIRTUAL_ENV_FILE=${DJANGODIR}/.env | |
| # SOCKFILE= | |
| ADDRESS=0.0.0.0:8000 | |
| USER=sysuser |