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 import template | |
from django.template.defaultfilters import stringfilter | |
register = template.Library() | |
@register.filter(name='prepend') | |
@stringfilter | |
def prepend(value, arg): | |
""" | |
Prepends value with arg if value exists, else returns '' |
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
#!/usr/bin/env python | |
import sys | |
from os.path import abspath, dirname, join | |
from django.core.management import execute_manager | |
try: | |
from settings import active as settings | |
except ImportError: | |
sys.stderr.write("Error: Can't find the module 'active' in the directory containing %r. \ |
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 should be named /etc/default/celeryd and is used by: | |
# /etc/init.d/celeryd | |
# http://celeryq.org/ | |
# Where the Django project is. | |
CELERYD_CHDIR="/var/www/example-env/project-name/" | |
CELERYD_OPTS="-c 6" | |
# Name of the projects settings module. | |
DJANGO_SETTINGS_MODULE="settings.active" |
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 time | |
import boto | |
from django.conf import settings | |
conn = boto.connect_dynamodb(aws_access_key_id=settings.AWS_ACCESS_KEY_ID, | |
aws_secret_access_key=settings.AWS_SECRET_ACCESS_KEY) | |
table_schema = conn.create_schema( | |
hash_key_name='item_id', | |
hash_key_proto_value='S', |
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
➜ ~ dig @8.8.8.8 _spf.google.com txt | |
; <<>> DiG 9.8.3-P1 <<>> @8.8.8.8 _spf.google.com txt | |
; (1 server found) | |
;; global options: +cmd | |
;; Got answer: | |
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 5516 | |
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 | |
;; QUESTION SECTION: |
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
#!/usr/bin/env python | |
import os | |
import re | |
import subprocess | |
import sys | |
modified = re.compile('^(?:M|A)(\s+)(?P<name>.*)') | |
CHECKS = [ |
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 home connection (Faiba) | |
(kili)➜ Resources sudo mtr 41.190.141.245 --report | |
Start: Wed Feb 5 22:06:15 2014 | |
HOST: Adams-MacBook-Air.local Loss% Snt Last Avg Best Wrst StDev | |
1.|-- 10.0.1.1 0.0% 10 1.4 2.4 1.0 8.4 2.2 | |
2.|-- 192.168.1.1 0.0% 10 1.5 29.0 1.2 105.0 43.4 | |
3.|-- 192.168.200.1 0.0% 10 4.0 12.5 2.7 52.4 16.3 | |
4.|-- 41.222.9.105 0.0% 10 2.5 31.7 2.3 101.2 46.1 | |
5.|-- 41.222.8.41 10.0% 10 2.8 9.7 2.6 25.5 9.5 |
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
(kili)➜ Resources sudo mtr dash.kili.io --report | |
Start: Fri Feb 7 11:01:39 2014 | |
HOST: Adams-MacBook-Air.local Loss% Snt Last Avg Best Wrst StDev | |
1.|-- 41.188.154.65 0.0% 10 3.5 3.0 1.5 4.2 0.7 | |
2.|-- 41.188.181.93 0.0% 10 2.6 2.7 1.8 4.5 0.6 | |
3.|-- ge-0-0-2-pe.ppf.core.simb 0.0% 10 6.3 22.0 4.8 107.1 31.7 | |
4.|-- 41.188.128.194 0.0% 10 19.2 91.8 18.2 721.1 221.2 | |
5.|-- 41.212.40.241.wananchi.co 0.0% 10 30.4 17.5 15.3 30.4 4.6 | |
6.|-- 41.212.1.162 10.0% 10 235.2 181.4 163.4 235.2 27.3 | |
7.|-- ??? 100.0 10 0.0 0.0 0.0 0.0 0.0 |
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
➜ neutron sudo mtr 196.223.21.70 --report | |
Start: Wed Mar 5 14:08:20 2014 | |
HOST: Adams-MacBook-Air.local Loss% Snt Last Avg Best Wrst StDev | |
1.|-- 192.168.20.1 0.0% 10 2.8 4.3 1.1 10.0 2.8 | |
2.|-- 41.212.36.69.wananchi.com 0.0% 10 5.8 17.7 3.3 39.0 13.6 | |
3.|-- 41.212.1.161 0.0% 10 16.6 7.8 2.2 28.2 8.5 | |
4.|-- ??? 100.0 10 0.0 0.0 0.0 0.0 0.0 | |
➜ neutron |
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
13:03:40 ~ $ sudo mtr www.nation.co.ke --report | |
Start: Wed Oct 29 13:03:44 2014 | |
HOST: adam-2.local Loss% Snt Last Avg Best Wrst StDev | |
1.|-- 192.168.1.1 0.0% 10 1.2 2.3 1.2 3.3 0.7 | |
2.|-- 192.168.201.1 0.0% 10 2.8 3.2 2.4 5.7 0.8 | |
3.|-- 41.57.108.5 0.0% 10 2.5 2.5 2.4 2.8 0.0 | |
4.|-- 41.222.8.217 20.0% 10 106.6 121.7 106.6 144.4 17.5 | |
5.|-- 195.229.27.57 80.0% 10 200.3 204.7 200.3 209.1 6.2 | |
6.|-- 195.229.0.93 30.0% 10 213.3 213.3 195.6 224.1 9.1 | |
7.|-- 195.229.3.177 80.0% 10 295.0 299.0 295.0 302.9 5.5 |
OlderNewer