Skip to content

Instantly share code, notes, and snippets.

View CodeZombie's full-sized avatar
🌵

Jeremy Clark CodeZombie

🌵
View GitHub Profile
@CodeZombie
CodeZombie / DD-WRT-CONFIG
Last active November 19, 2018 05:26
Configuring a DD-WRT router as a remotely-connectable home linux server.
######################################
########### INSTALLATION #############
######################################
First, we will configure the primary internet-facing router.
- Reserve an IP address that will be your DD-WRT router. In this example, I will use 192.168.1.69
- Setup your port-forwarding to expose SSH by setting the external port to something memorable like 420, and the internal port to 22 on IP 192.168.1.69.
Now, factory reset the DD-WRT router, and connect it directly to your laptop via ethernet. Disconnect from your primary router.
Go to the DD-WRT router configuration page at 192.168.1.1.
DROP TABLE saleinv;
DROP TABLE car;
DROP TABLE servinv;
DROP TABLE prospect;
DROP TABLE customer;
DROP TABLE baseoption;
DROP TABLE invoption;
DROP TABLE servwork;
DROP TABLE employee;
DROP TABLE options;
@CodeZombie
CodeZombie / mcp41010.c
Created July 6, 2018 04:07
MCP41010 arduino quick demo
#include <SPI.h>
int cspin = 10;
int value = 255;
void setup() {
pinMode(cspin, OUTPUT);
Serial.begin(9600);
SPI.begin();
@CodeZombie
CodeZombie / datefinder.py
Created March 21, 2018 19:12
python date extractor
MONTHS = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "january", "jan", "feb", "february", "march", "mar", "april", "apr", "may", "june", "jun", "july", "jul", "august", "aug", "september", "sept", "october", "oct"]
DAYS = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "1st", "2nd", "3rd", "4th", "5th", "6th", "7th", "8th", "9th", "10th", "11th", "12th", "13th", "14th", "15th", "16th", "17th", "18th", "19th", "20th", "21st", "22nd", "23rd", "24th", "25th", "26th", "27th", "28th", "29th", "30th", "31st", "32nd", "first", "second", "third", "fourth", "fifth", "sixth", "seventh", "eighth", "ninth", "tenth", "eleventh", "twelfth", "thirteenth", "fourteenth", "fifteenth", "sixteenth", "seventeenth", "eighteenth", "nineteenth", "twentieth", "twenty first", "twenty second", "twenty third"]
YEARS = ["2018", "18", "1994", "94"]
#find every instance of every elemen
@CodeZombie
CodeZombie / bruteforce.py
Created March 7, 2018 22:31
Python bruteforce string function
import time
alphabet = "abcdefghijklmnopqrstuvwxyz0123456789"
def bruteforce(string_, password_, maxDepth_):
for ch in alphabet: #for each character in the alphabet
string_ = string_[0:len(string_)-1] + ch #change the last character of the working string to the next value in the alphabet
#print(string_)
if string_ == password_: #if the string has been found:
return True #return true
if len(string_) < maxDepth_: #if we're not too large:
@CodeZombie
CodeZombie / tursin.py
Created February 5, 2018 00:55
wip turtle thing
##################################################
# Turtle Sine Wave Generator #####################
# This program draws a sine wave, ################
# using the turtle library, based on user input. #
# 2018, Jeremy Clark #############################
##################################################
import turtle
import math
@CodeZombie
CodeZombie / d_bounce.cpp
Created October 31, 2017 06:55
very responsive, low memory, near-perfect potentiometer debounce
class Pot {
uint8_t rawValue = 0; //the raw value of the potentiometer
uint8_t smoothValue = 0; //the smoothed public-facing value of the pot
uint8_t stableSteps = 0; //value that tracks how many update() calls have passed since the last time the pot value change
void (*changeMethod)(uint16_t); //the function that gets called when the smoothed value changes
public:
Pot(void (*changeMethod_)(uint16_t)) {
changeMethod = changeMethod_;
}
@CodeZombie
CodeZombie / pot.cpp
Last active October 31, 2017 06:56
GOOD-ASS POTENTIOMETER DEBOUNCE
void Pot::update() {
//how this debounce code works:
//First, the pot value is retrieved and stored as a Reference
//Next, the reference is checked against the current pot value for 8 steps.
//if the value changes, go back to step 1.
//if the value doesn't change, we know we're not bouncing, so store that value.
uint16_t v = analogRead(pin);
if(v != reference) { //bounce detected...
using a 16x2 HD44780 i2c LCD display with the arduino platform.
with the lcd display soldered to the i2c controller, wire the 4 i2c pins up to the arduino, GND->GND, VCC->5v, SDA->SDA, SCL->SCL.
Power on the arduino to ensure the lcd backlight comes on. and everything is kosher.
Next, open up your arduino IDE and load up the sketch found here: https://playground.arduino.cc/Main/I2cScanner
Run this sketch and take note of the address output.
Next, load in this sketch, replacing 0x3F with the address you found.
@CodeZombie
CodeZombie / shiftRegister.c
Last active August 12, 2017 05:13
shiftRegisterRamblings
//shift register ramblings
void sendByte(bool value[8], int dataPin, int clockPin, int latchPin) {
digitalWrite(latchPin, LOW);
for(int i = 0; i < 8; i++) {
digitalWrite(dataPin, value[i]);
digitalWrite(clockPin, HIGH);
digitalWrite(clockPin, LOW);
}
digitalWrite(latchPin, HIGH);