#!/usr/bin/env python | |
# Usage | |
# ./gen_dkim.py mail.yourdomain.tld | |
import sys | |
from subprocess import call | |
from os import devnull | |
if len(sys.argv) < 2: |
""" | |
A simple proxy server, based on original by gear11: | |
https://gist.github.com/gear11/8006132 | |
Modified from original to support both GET and POST, status code passthrough, header and form data passthrough. | |
Usage: http://hostname:port/p/(URL to be proxied, minus protocol) | |
For example: http://localhost:5000/p/www.google.com | |
""" | |
import re |
Whichever route you take to implementing containers, you’ll want to steer clear of common pitfalls that can undermine the efficiency of your Docker stack.
The beauty of containers—and an advantage of containers over virtual machines—is that it is easy to make multiple containers interact with one another in order to compose a complete application. There is no need to run a full application inside a single container. Instead, break your application down as much as possible into discrete services, and distribute services across multiple containers. This maximizes flexibility and reliability.
It is possible to install a complete Linux operating system inside a container. In most cases, however, this is not necessary. If your goal is to host just a single application or part of an application in the container, you need to install only the essential
import csv | |
import os | |
import sys | |
from decimal import Decimal | |
import logging | |
stdout_handler = logging.StreamHandler(sys.stdout) | |
logging.basicConfig( | |
level=logging.DEBUG, | |
format='[%(asctime)s] %(levelname)s - %(message)s', |
local _M = {} | |
function _M.getHostname() | |
local f = io.popen ("/bin/hostname") | |
local hostname = f:read("*a") or "" | |
f:close() | |
hostname =string.gsub(hostname, "\n$", "") | |
return hostname | |
end | |
return _M |
[ | |
{ | |
"city": "Aba", | |
"area_code": 82, | |
"dialing_code": "+234 82" | |
}, | |
{ | |
"city": "Abakaliki", | |
"area_code": 43, | |
"dialing_code": "+234 43" |
#!/bin/bash | |
# This bash script help release astpp from overfull logs To view the top 10 biggest directories cloggin up the HDD, run sudo du | |
# --block-size=M -a / | sort -n -r | head -n 10 empty astpp.logs | |
echo "Emptying astpp logs" | |
cd /var/log/astpp/ | |
> astpp.log | |
# empty freeswitch logs | |
echo "Emptying freeswitch logs" | |
cd /usr/local/freeswitch/log/ |
#!/bin/bash | |
# Bash Script by https://gist.github.com/mitchellkrogza | |
# ************************************************************ | |
# This script clears the log file and database of Fail2Ban | |
# This resets Fail2Ban to a completely clean state | |
# Useful to use after you have finished testing all your jails | |
# and completed your initial setup of Fail2Ban and are now | |
# putting the server into LIVE mode | |
# ************************************************************ |
import arrow #you can use datetime here | |
from django.contrib import auth | |
from django.utils import timezone | |
from django.conf import settings # where I have set FORCE_LOGOUT_IN to 5 | |
class AutoForceLogoutMiddleware(object): | |
SESSION_KEY = 'auto-force-logout' | |
def __init__(self, get_response=None): |