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
""" | |
Install twisted (pip install twisted) and PIL (pip install PIL), and run the script. | |
On your gateway, run the following commands: | |
iptables -t nat -A PREROUTING -i br0 -s ! 192.168.0.20 -p tcp --dport 80 -j DNAT --to 192.168.0.20:8080 | |
iptables -t nat -A POSTROUTING -o br0 -s 192.168.0.0/24 -d 192.168.0.20 -j SNAT --to 192.168.0.1 | |
iptables -A FORWARD -s 192.168.0.0/24 -d 192.168.0.20 -i br0 -o br0 -p tcp --dport 8080 -j ACCEPT | |
Substitute 192.168.0.20 for the computer running the proxy. | |
""" |
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 GlobalFormat(object): | |
def __init__(self): | |
self.id = 0x46464952 # RIFF | |
self.size = 0 | |
self.type = 0x45564157 # WAVE | |
def as_bin(self): | |
return struct.pack("III", self.id, self.size, self.type) | |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
typedef struct grid_t_ { | |
unsigned int grid[81]; | |
struct grid_t_ *next; | |
} grid_t; | |
typedef struct sub_t_ { |
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
package net.quenchnetworks.panthera.feedimport.util; | |
import java.util.*; | |
import java.sql.*; | |
public class LoggingConnection implements Connection | |
{ | |
public static class LogEntry | |
{ | |
public String sql; |
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
/** | |
* WordTrainer 2008-12-02 | |
* Simple language training in Java. This program accepts text-files | |
* containing where each line contains two words in two diffrent languages | |
* separated by a comma (,). The first line follows the same format but | |
* specifies the language. | |
* | |
* Sample gloss-file: | |
* Engelska,Svenska | |
* cloud,moln |
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
public class Base64 | |
{ | |
public static String encode(byte[] data) | |
{ | |
char[] tbl = { | |
'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','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','0','1','2','3','4','5','6','7','8','9','+','/' }; |
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
# bigdecoder.py, by aderyn@gmail.com, 2009-03-01 | |
# | |
# decoder for .BIG-format files utilized by Red Alert 3 and C&C: Zero Hours | |
# among others. .big is a trivial archival format. quite frankly, this is | |
# probably the simplest compound file format imaginable. | |
# | |
# this script is written for microsoft windows. it can probably be easily | |
# adapted for other platforms, but i haven't tried. | |
# | |
# file structure: |
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
<?php | |
/** | |
* spellcheck.php | |
* | |
* @version 0.1 | |
* @author Emil Hernvall <aderyn@gmail.com> | |
* @license Public Domain | |
*/ | |
/** |
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
Compiled from "Test1.java" | |
public class Test1 { | |
public Test1(); | |
Code: | |
0: aload_0 | |
1: invokespecial #1 // Method java/lang/Object."<init>":()V | |
4: return | |
public static void main(java.lang.String[]); | |
Code: |
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 pymysql | |
import pymysql.cursors | |
import os | |
import csv | |
from datetime import datetime | |
with open("data/premier-league/schema.json") as fh: | |
schema = json.loads(fh.read()) | |
fields = schema["fields"] |
NewerOlder