Skip to content

Instantly share code, notes, and snippets.

@sesh
sesh / minimal_vulnerable.py
Last active March 10, 2016 04:44
minimal_vulnerable.py
"""
An example for MelbDjango 2.8 by Brenton C.
This demonstrates both the most minimal possible Django implementation:
https://github.com/rnevius/minimal-django
And an exploit of the security issue fixed with Django 1.9.3:
https://www.djangoproject.com/weblog/2016/mar/01/security-releases/
To run locally simple install Django < 1.9.3 (or Django < 1.8.10) in a virtualenv and run:
@sesh
sesh / easypass.py
Created February 17, 2016 04:31
Easy Passwords
import random
def easypass(length=2, joiner='-'):
with open('wordlist.txt') as f:
words = f.readlines()
return joiner.join([random.choice(words).strip() for x in range(length)])
if __name__ == '__main__':
from django.conf.urls import include, url
from django.contrib import admin
ADMIN_URLS = [
'wp-admin/', # wordpress
'admin.php',
'login.php',
'phpmyadmin/',
'admin/login.php',
@sesh
sesh / tests.py
Last active August 29, 2015 14:27 — forked from mekhami/tests.py
class ProjectViewsTest(TestCase):
def setUp(self):
self.project = Project.objects.create(name='google')
self.client = Client()
def test_project_display_context_data(self):
response = self.client.get('/project/{}/'.format(self.project.slug))
self.assertIn('form', response.context)
@sesh
sesh / tests_form_defaults.py
Created August 4, 2015 22:39
Django Form Defaults
from django.db import models
from django import forms
from django.test import TestCase, RequestFactory
from .models import BooleanTestModel
"""
models.py
import csv
import sys
import arrow
import requests
# Grab your OAuth token from here:
# https://toggl.com/app/profile
TOGGL_API_TOKEN = ''
@sesh
sesh / gist:cf944b68b974e44fd0d7
Created June 23, 2015 00:00
Demo Day | MEERQAT Team

Starting this week I'd like the team working from the Common Code office to come together and look at the work we're doing. Each Wednesday we'll pick one client, project or task to walk through as a team.

This Wednesday at 2pm for about 20 minutes the MEERQAT team (Gabe, Jemi, Tim, Tyson & David w/ some Mork, Yan, Garth, Darren) is going to show us through the MVP that they're about to deliver. MEERQAT is using a pretty damn interesting tech stack of Meteor, Django, Gevent, Postgres & SASS hosted on AWS. It's also the first project that Nicholas has ran with the Agile workflow that we're aiming to promote to other clients.

It's going to happen on Level 2 in #8 and I'd love if we had everyone there.

@sesh
sesh / gist:7545ffb9c10d044d0280
Created March 18, 2015 22:48
SSH Public Key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD24GTa/tAREuvgosIo+vKwwsizfvrTdUrSoIEFUff18mWZWm7x9VJgrn7+8Ue+r8MKep6tDR03h6RPrFmuqQVGr799HTVo8D7cLTqna/GkWCG4xE/tTaeMwWYQLRzfzE4N/XwD4e608sceje0w/xWnH9cnQDJ/jD09Eh6CsQpR97RY9I+6iV7x/puxQ/K6XjkqPztY/FBJMr6OipDs9XVErbUSi0YNvC/L04+TEh+jj7RCqLpw4vvwim4H9TvGlnPX7Oi1MVKsO++LfIg+TOp9d5zwnEDJqMm69DLqhZ+lqJOEv9NfNv6kMb443mpcPrQSkodv0fj7Xtir57Kyt1xL brenton@brntn.me
29.2,29.2,29.2,29.8,29.6,29,28.8,29.2,29.2,28.6,28.4,28.6,28.6,28.2,28.6,28.6,28.6,28.6,28.6,28.6,28.4,28.6,28.8,28.6,28.6,28.6,28.6,28.6,28.6,28.4,28.4,28.4,28.4,28.6,29,29,28.6,28.6,28.4,27.8,27.2,27.4,26.6,25.6,25.4,25.6,26,26,25.4,25,24.4,24,25.4,25.2,25.6,24.8,26.8,25.4,25.2,26.2,26.4,26.6,26,27,27.8,27.4,26.6,26.4,26.6,26.4,26.8,25.6,25.2,25.4,26.8,26.6,27,26.6,28,27.8,29,28.8,28.8,28.4,28.6,29,29,28.8,28.8,29.2,30.2,31.4,31.6,31.6,32.6,33.4,33.6,33.8,35.2,36.4,36.8,37.4,38.4,38.6,39.6,39.6,40.2,40,40.6,41,42,42.4,42.4,42.6,42.8,42.8,42.8,43,43.2,43.2,43,43,43,43,43.2,43.2,43.6,43.6,43.2,43.2,42.8,42.8,42.8,42.8,43,43,43.2,43,42.8,42.4,42.2,42.6,42.2,42.2,42.2,42.4,42.4,42.8,43.6,43.2,43.2,43,43.4,43.4,44,43.4,44,44.4,44.4,44.6,43.6,43.4,42.8,41.8,40.8,40.4,40,40,40.6,40.8,38,37.8,37.8,37.6,37,35.6,36.6,37.2,36.4,36.8,37,35.6,37.2,37.8,37.4,37.8,38,38.4,37.8,38,39.2,39.6,39.2,39.4,39,39,37.6,38.2,38.4,38.6,38.6,38.6,38.8,39,39.2,39.2,38.6,37.4,37.6,37.8,38.2,39.2,39.4,39.2,38.6,38.8,38.6,38.6,38,36.6,37

class: middle center

MelbDjango 1.8

MelbDjango Logo