Skip to content

Instantly share code, notes, and snippets.

@cj-dimaggio
cj-dimaggio / blinkProto.go
Last active March 15, 2017 23:08
Blink Decode
package main
import (
"math/rand"
"os"
"strconv"
"time"
"math"
package main
import (
"net"
"os"
"time"
"github.com/Ssawa/accord/dataStructures"
zmq "github.com/pebbe/zmq4"
@cj-dimaggio
cj-dimaggio / ordered_many_to_many_sqla.py
Last active January 27, 2022 22:41
Class definitions of SQLAlchemy classes that maintain order of lists in Many-To-Many relationships.
from sqlalchemy import Column, String, Integer, ForeignKey, create_engine, Table
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, RelationshipProperty
from sqlalchemy.orm.dependency import ManyToManyDP
from sqlalchemy.util.langhelpers import public_factory
#################
# THE ACTUAL CODE
#################
@cj-dimaggio
cj-dimaggio / tap_interface.py
Last active May 6, 2018 21:24
ARP responder using Scapy
# Import all of Scapy's code so we can use it as a library (rather than the runtime environment it also supports)
# I don't like this "import *" and would much rather import Scapy functionality under a namespace but I'm fairly
# new to the library and my initial efforts seemed to throw some errors so I just copied this from other sources.
# Don't judge me.
from scapy.all import *
# For non python people, this is just python's, somewhat strange, way of saying
# "If this file is being executed and not just imported into another file"
if __name__ == '__main__':