I hereby claim:
- I am levigross on github.
- I am levigross (https://keybase.io/levigross) on keybase.
- I have a public key whose fingerprint is 3252 437C 3623 EA49 0FCF 536C BE84 5FC4 DDAF 3361
To claim this, I am signing this object:
from django.core.cache import cache | |
from django.http import HttpResponseForbidden | |
from functools import wraps | |
from django.utils.decorators import available_attrs | |
def ratelimit(limit=10,length=86400): | |
""" The length is in seconds and defaults to a day""" | |
def decorator(func): | |
def inner(request, *args, **kwargs): | |
ip_hash = str(hash(request.META['REMOTE_ADDR'])) |
from scapy.all import sendp,Ether | |
from scapy.layers.inet6 import IPv6, ICMPv6ND_RA, ICMPv6NDOptPrefixInfo,ICMPv6NDOptSrcLLAddr | |
from random import randint | |
def randomacaddr(): | |
return ':'.join(map(lambda x: "%02x" % x, [ 0x00, 0x16, 0x3e,randint(0x00, 0x7f),randint(0x00, 0xff),randint(0x00, 0xff) ])) | |
pkt = Ether()/IPv6()/ICMPv6ND_RA()/ICMPv6NDOptPrefixInfo(prefix='2610:8:6800:1::7',prefixlen=64) \ | |
/ICMPv6NDOptSrcLLAddr(lladdr=randomacaddr()) |
-----BEGIN PGP PUBLIC KEY BLOCK----- | |
mQINBE280eoBEADfLQuJkNfzbaLBgt9Pu3MNUWnIXBPAYxNp9dAq5liZWVJJyWpV | |
Z6daZryyXJDnpKNMlHT6XvY7vbliK6XCV8fD0xcrt+J1FQb38F9aDQC24FG11S+0 | |
+w+cu2EmVJHgUSzni4JeEeGF1lqKgsc07oE3a0oWS9q2Xt53HFiLTd0OAiknp9Lg | |
mih8Pk3PRN4T3EvMVdV4pYXdP1KrOxcEjheiaZvu6PlnEzCXBWI2X/FFPMwPxtkh | |
QmB1TpYLS15gYXTqDsbsdaaIPhIT3Ilb8yYapoDvOltQ38SJOvw3oHQmnnXfwltH | |
YwF2NKMXsI9hASI+vvgx+3cK4PX2qQe/uBnFzZIW2b2l+TvJnlCYbyLRhh49jbCj | |
Jc3svNcKU2Q9On3Xaw+ASAMPw2FI0sDA4W6Fec5u2FCg/Gywz8dh52d92rHkviSj | |
7Spqy8SMM0ndlinOovv2yw8EwVZTuhpU5uUddekYwmBwVsoQwZrStXu5eJPP/SHu | |
ZVdeqK9eRJCbqSa9h193ltOa0pnK9/f8XH1wq1ZIUyJR2+QabJm5yLXx/PljsbKz |
from itertools import izip | |
def compare_hash(hashone,hashtwo): | |
if len(hashone) == len(hashtwo): # Every hash should be the same length | |
if sum((ord(o) ^ ord(t) for o,t in izip(hashone,hashtwo))): | |
return False | |
else: | |
return True | |
else: | |
return False |
// Copyright 2009 The Go Authors. All rights reserved. | |
// Use of this source code is governed by a BSD-style | |
// license that can be found in the LICENSE file. | |
// src location /src/pkg/crypto/subtle/constant_time.go | |
// Package subtle implements functions that are often useful in cryptographic | |
// code but require careful thought to use correctly. | |
package subtle |
MyMac:~ User$ curl http://reddit.com | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<meta http-equiv="Content-Type" content="text/html; charset=euc-jp"> | |
<title>テスト</title> | |
<body> | |
<br> | |
このサーバはVideo002.interco.mobiです。 | |
<br> |
""" | |
Clickjacking Protection Middleware. | |
This module provides a middleware that implements protection against a | |
malicious site loading resources from your site in a hidden frame. | |
""" | |
from django.conf import settings | |
class XFrameOptionsMiddleware(object): |
; Taken from https://github.com/weavejester/crypto-equality/blob/master/src/crypto/equality.clj | |
(ns crypto.equality | |
"Securely test sequences of data for equality.") | |
(defn eq? | |
"Test whether two sequences of characters or bytes are equal in a way that | |
protects against timing attacks. Note that this does not prevent an attacker | |
from discovering the *length* of the data being compared." | |
[a b] |
#!/usr/bin/env python | |
number_range = range(1, 21) | |
def count(): | |
number = 21 | |
while True: | |
for n in number_range: |
I hereby claim:
To claim this, I am signing this object: