This file contains 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
from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS as TCP | |
TEMPLATE_CONTEXT_PROCESSORS = TCP + ( | |
'django.core.context_processors.request', | |
) |
This file contains 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
class CustomerForm(forms.ModelForm): | |
class Meta: | |
model = Customer | |
fields = [ | |
'name', | |
'delivery_addressee', | |
'billing_addressee', | |
] | |
def __init__(self, *args, **kwargs): |
This file contains 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
# This file contains a list of unacceptable file name/file type and creator patterns, one per line. | |
# It also contains some 'helpful' text that replaces the attachment. | |
# | |
# The help text is one or more lines that start with a colon. | |
# The attachment names are case-insensitive, and use the DOS wildcard convention | |
# of * and ? | |
# Macintosh file type and creator patterns can be specified as well, | |
# using the syntax 'TTTT:CCCC' where TTTT is the file type, and CCCC | |
# is the creator. Use ? as a wildcard character. | |
# |
This file contains 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
$template GRAYLOGRFC5424,"%protocol-version% %timestamp:::date-rfc3339% %HOSTNAME% %app-name% %procid% %msg%\n" | |
*.* @syslog.example.com:514;GRAYLOGRFC5424 |
This file contains 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 | |
echo "Activating virtualenv" | |
source /home/django/.virtualenvs/my_app/bin/activate | |
source /home/django/.virtualenvs/my_app/bin/postactivate | |
which python | |
echo | |
echo "Fetching master branch" | |
cd /opt/my_app |
This file contains 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
import json | |
import ssl | |
import requests | |
from requests_toolbelt import SSLAdapter | |
# URL or IP Address of the unifi controller: | |
PORTAL_URL = 'https://ubiquiti.example.com/' | |
# Username and password for the unifi controller: | |
PORTAL_LOGIN_PARAMS = { |
This file contains 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
echo off | |
cls | |
:: Run this script before backing up the mirror drive. | |
:: This script will exit with 0 if the mirror was successfully paused. | |
:: Any other exit code means the mirror is not safe to back up. | |
:: The MCHECK command returns a valid error level code. | |
:: The return codes are checked in descending order. | |
:: Any code greater than or equal to will match the tested error condition. |
This file contains 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
(* | |
◸ Veritrope.com | |
Export All Chrome Tabs to a Text File | |
VERSION 1.0 | |
September 8, 2012 | |
// INSPIRED BY: | |
Francesco Di Lorenzo (@frankdilo) | |
// UPDATE NOTICES |
This file contains 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
// Observium Geocoding settings | |
$config['geocoding']['enable'] = TRUE; // Enable geocoding | |
$config['geocoding']['api'] = 'yahoo'; // Geocoding API | |
$config['geocoding']['default']['lat'] = "37.7463058"; // Default latitude for devices | |
$config['geocoding']['default']['lon'] = "-25.6668573"; // Default longitude for devices | |
$config['location_menu_geocoded'] = FALSE; // Build locaion menu from location data | |
$config['frontpage']['map']['region'] = "world"; // Map region | |
$config['frontpage']['map']['center']['lat'] = "37.7463058"; // Initial latitude for map | |
$config['frontpage']['map']['center']['lng'] = "-25.6668573"; // Initial longitude for map | |
$config['frontpage']['map']['zoom'] = '14'; // Initial zoom level for map |
This file contains 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
firewall { | |
all-ping enable | |
broadcast-ping disable | |
ipv6-receive-redirects disable | |
ipv6-src-route disable | |
ip-src-route disable | |
log-martians enable | |
name WAN_IN { | |
default-action drop | |
description "WAN to internal" |