Skip to content

Instantly share code, notes, and snippets.

Jacob Kaplan-Moss jacobian

Block or report user

Report or block jacobian

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View stitch_block.py
"""
Take 2 - trying to minimize jump stitches
Stitch a row \ / \ /, then back
"""
import itertools
import pyembroidery as em
from collections import namedtuple
import click
View stitch.py
import pyembroidery as em
pattern = em.EmbPattern()
# units are in 1/10mm
# max size in DST is 12mm so if we go bigger need to fuck with max_stitch
SIZE = 32
# start with a stitch at the origin to get the needle down (see the docs)
pattern.stitch_abs(0, 0)
View models.py
# https://stackoverflow.com/questions/53139643/django-postgres-array-field-count-number-of-overlaps
# !!! DOESN'T WORK but might with some more poking?
class Article(models.Model):
keywords = ArrayField(models.CharField(max_length=100))
def __str__(self):
return f"<Article {self.id} keywords={self.keywords}>"
View index.html
<html>
<head>
<link rel="stylesheet" href="reveal.js/css/reveal.css">
<link rel="stylesheet" href="reveal.js/css/theme/white.css">
</head>
<body>
<div class="reveal">
<div class="slides">
<section data-markdown="slides.md"
data-charset="utf-8">
View index.html
<html>
<head>
<link rel="stylesheet" href="reveal.js/css/reveal.css">
<link rel="stylesheet" href="reveal.js/css/theme/white.css">
</head>
<body>
<div class="reveal">
<div class="slides">
<section data-markdown="slides.md"
data-charset="utf-8">
@jacobian
jacobian / security hardness 2.md
Last active Dec 3, 2016
Security Hardness - another idea
View security hardness 2.md

This is a draft "security hardness scale", desgigned to somewhat roughly quantify the level of effort of a penetration test -- since simply measuing "how many vulns did you find" is a terrible measurement of success. The goal is the measure the "hardness" of the system under test in a way that's a bit quantitative.

The result is a score from 1-10. The scale is inspired by to the Mohs Hardness Scale in that it's simply an ordinal scale, not an absolute one. That is, the "gap" between 3 and 4 doesn't have to be the same "difficulty increase" as the gap between 5 and 6. It's simply a way of rating that one pentest was "harder" than another. (This is in lieu of being able measuing "hardness" in any truely quantitative way).

Instructions:

@jacobian
jacobian / security hardness.md
Created Dec 2, 2016
Security Hardness Scale
View security hardness.md

This is a draft "security hardness scale", desgigned to somewhat roughly quantify the level of effort of a penetration test -- since simply measuing "how many vulns did you find" is a terrible measurement of success

The scale is similar to the Mohs Hardness Scale in that it's simply an ordinal scale, not an absolute one. That is, the "gap" between 3 and 4 doesn't have to be the same "difficulty increase" as the gap between 5 and 6. It's simply a way of rating that one pentest was "harder" than another. (This is in lieu of being able measuing "hardness" in any truely quantitative way).

View ir.md
  1. Initiate
    • Where should a (potential) incident be reported?
    • How will incidents be tracked?
    • What are the roles and responsibilities during an incident?
  2. Communicate
    • Where will comms happen? Who will be involved?
    • Who will send situation updates? To whom? How often?
  3. Assess
    • Where do we collect information? Who follows up?
    • How do we determine severity?
View lanyrd.py
import time
import requests
class Lanyrd(requests.Session):
def __init__(self, *args, **kwargs):
super(Lanyrd, self).__init__(*args, **kwargs)
self.headers.update({
'X-Lanyrd-Auth': str(time.time()),
'User-Agent': 'Lanyrd-iOS/2.4.0 (iPhone OS 6.1.3; iPhone5,2 N42AP) build/61',
'X-Lanyrd-Protocol': '4',
View imgcat.py
def imgcat(url):
content = base64.encodestring(urllib.urlopen(url).read())
text = "\033]1337;File=inline=1;size={0};px:{1}\a"
return text.format(str(len(content)), content)
You can’t perform that action at this time.