Skip to content

Instantly share code, notes, and snippets.

View sjbodzo's full-sized avatar
✝️

Jess Bodzo sjbodzo

✝️
  • FL
View GitHub Profile
@sjbodzo
sjbodzo / a2dp.sh
Created February 2, 2022 19:48
fix a2dp issue on bluetooth pair
#!/bin/bash
bt_device_addr=$(pacmd list-cards | grep -i 'name:.*bluez_card' | sed -E 's/.*<?bluez_card\.([A-Z0-9_]+)>?/\1/')
device_mac=$(echo $bt_device_addr | sed 's/_/:/g')
a2dp_available=$(pacmd list-cards | grep -A30 bluez | grep "A2DP Sink" | sed -E 's/.* available: ([a-z]+)\)/\1/g')
if [[ "$a2dp_available" == "no" ]] || [[ "$a2dp_available" == "unknown" ]]
then
dbus-send --system --dest=org.bluez --print-reply /org/bluez/hci0/dev_$bt_device_addr org.bluez.Device1.Connect
@sjbodzo
sjbodzo / iptables
Created February 2, 2022 19:46
iptables example
*nat
:PREROUTING ACCEPT [0.0]
:INPUT ACCEPT [0.0]
:OUTPUT ACCEPT [0.0]
:POSTROUTING ACCEPT [0.0]
-A POSTROUTING -o enp1s0 -j MASQUERADE
# -A PREROUTING -p tcp -m tcp -i enp1s0 --dport 80 -j DNAT --to-destination 192.168.1.100:80
COMMIT
@sjbodzo
sjbodzo / bounce.py
Created September 16, 2020 21:40
Sample snippet to delete/re-add a module
import pyterprise
import argparse
import pathlib
parser = argparse.ArgumentParser(description='Parse Arguments')
parser.add_argument('-n', '--hostname',
required=True,
type=str,
action='store',
help="FQDN for the TFE cluster")
@sjbodzo
sjbodzo / gist:759ac4d44f2dd71cfb916ba16503802f
Created July 7, 2020 14:53
Terraform AzureRM Key Vault Secret - Property Value Bug
{"error":{"code":"BadParameter","message":"Property has invalid value\r\n"}}
### Keybase proof
I hereby claim:
* I am sjbodzo on github.
* I am crispy_ (https://keybase.io/crispy_) on keybase.
* I have a public key ASDlR6rHaJhIyXF7JXxGOK7pcTncLNPE5iHyeciS91FGPgo
To claim this, I am signing this object:
@sjbodzo
sjbodzo / wep_md5.swift
Created January 12, 2016 13:32
128 bit WEP key generation written natively in Swift, using an MD5 hash under the hood.
//: Wifi Encryption Scheme for generating a 128 bit WEP key
import UIKit
import Foundation
var psk = "meterking1"
// MD5 Implementation
/** Circular Shift implementation for 32 bit unsigned integers **/
protocol CircularShiftable {
@sjbodzo
sjbodzo / wep_md5.swift
Last active January 12, 2016 21:01
128 bit WEP key generation written natively in Swift, using an MD5 hash under the hood.
//: Wifi Encryption For 128 Bit WEP key generation using an MD5 hash
// Created by: Jess Bodzo
/**
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@sjbodzo
sjbodzo / wep_64.swift
Created January 8, 2016 16:44
WEP 64 Bit Key Generation
// Created by: Jess Bodzo
// The code below is a simple WEP key generator based off a given passphrase
import UIKit
import Foundation
var psk = "password"
let m = UInt(1 << 32)
let c = UInt(0x269ec3)
let a = UInt(0x343fd)
@sjbodzo
sjbodzo / brother.inr
Created April 25, 2015 15:53
Brother EM630 Typewriter Sketch
#include <SD.h>
File tweet_file;
int NUM_TWEETS = 800;
// Pin assignments for Arduino pins to control select lines.
// Note : Mux A takes lines coming from T/W into breadboard.
// Demux B takes line coming from Mux A and demuxes it.
// Demux C handles last two remaining lines not gotten by B.
@sjbodzo
sjbodzo / gist:39fe9edce27b10b7203d
Created April 17, 2015 01:54
Dijkstra's For Node Mapping Calculation.java
import java.util.PriorityQueue;
import java.util.ArrayList;
import java.util.Scanner;
import java.util.List;
import java.io.*;
class Edge {
public Node dest_node; // Destination when you travel along this node
public int distance; // How far to get to destination node along this edge