Skip to content

Instantly share code, notes, and snippets.

View racerxdl's full-sized avatar
🔒
Invincible for those who don't have an screwdriver.

Lucas Teske racerxdl

🔒
Invincible for those who don't have an screwdriver.
View GitHub Profile
@racerxdl
racerxdl / block.sh
Created April 27, 2020 01:24
Block DHCP in Bridge
ebtables -I INPUT -i eno2 -p ip --ip-protocol udp --ip-source-port 67 -j DROP
ebtables -I INPUT -i eno2 -p ip --ip-protocol udp --ip-source-port 68 -j DROP
ebtables -I INPUT -i eno2 -p ip --ip-protocol udp --ip-destination-port 67 -j DROP
ebtables -I INPUT -i eno2 -p ip --ip-protocol udp --ip-destination-port 68 -j DROP
ebtables -I INPUT 0 -i eno2 -p IPv4 --ip-protocol udp --ip-destination-port 67:68 -j DROP
ebtables -I OUTPUT 0 -o eno2 -p IPv4 --ip-protocol udp --ip-destination-port 67:68 -j DROP
ebtables -I FORWARD 0 -o eno2 -p IPv4 --ip-protocol udp --ip-destination-port 67:68 -j DROP
@racerxdl
racerxdl / vcd2latex.py
Last active March 4, 2024 20:59
Very bad converter from ValueChangeDump (VCD) to Tikz Timing on Latex.
#!/usr/bin/env python3
import vcdvcd, math
from vcdvcd import VCDVCD
vcdfile = "digital_port_tb.vcd"
vcd = VCDVCD(vcdfile, only_sigs=True)
all_signals = vcd.signals
@racerxdl
racerxdl / readme.md
Created June 22, 2022 19:08
Initialize unfused JCOP card
java -jar gp.jar -d \
  -a 00a4040010C238E449F725B1510EAA699550CABA16 \
  -a 00f00000 \
  -a c0d6030510404142434445464748494a4b4c4d4e4f \
  -a c0d6032110404142434445464748494a4b4c4d4e4f \
  -a c0d6033D10404142434445464748494a4b4c4d4e4f
@racerxdl
racerxdl / esp32-spiflash.ino
Created May 31, 2020 01:30
ESP32 Arduino VSPI SPI Flash Reader / Writer
#include <SPI.h>
#include "FS.h"
#include "SPIFFS.h"
#define CS 5
#define FORMAT false
SPIClass * vspi = NULL;
SPISettings settings(10000000, MSBFIRST, SPI_MODE0);
//SPISettings settings(1000000, MSBFIRST, SPI_MODE0);
@racerxdl
racerxdl / snesonardo.ino
Created February 9, 2017 04:15
SNESONARDO
#include <Joystick.h>
// Microseconds
#define LATCH_TIME 12
#define MEASURE_DELAY 6
// Leonardo Pins
#define CLOCK 2
#define LATCH 3
#define P1_DATA 4
@racerxdl
racerxdl / bettercap.md
Created June 24, 2023 01:47 — forked from siddolo/bettercap.md
bettercap webui from docker

bettercap webui from docker

create volume

docker volume create bettercap

bootstrap/update

Only run caplets.update the first time as every time the entire system caplets folder is replaced with the downloaded contents from github, overwriting your changes, such as the credentials, with default values. You can either backup your changes and restore them later in the system folder, or simply copy the changed caplet files in bettercap’s working directory, in which case they’ll be loaded before the ones installed system wide. https://www.bettercap.org/usage/

@racerxdl
racerxdl / end-gcode.gcode
Created March 18, 2021 21:05
Cura GCode start / end for BLTouch + Ender 3 Pro
G91 ;Relative positioning
G1 E-2 F2700 ;Retract a bit
G1 E-2 Z0.2 F2400 ;Retract and raise Z
G1 X5 Y5 F3000 ;Wipe out
G1 Z10 ;Raise Z more
G90 ;Absolute positionning
G1 X0 Y{machine_depth} ;Present print
M106 S0 ;Turn-off fan
M104 S0 ;Turn-off hotend
@racerxdl
racerxdl / domain.xml
Created April 8, 2021 17:53 — forked from Informatic/domain.xml
How to use Windows 10 OEM license in libvirt VM (<smbios mode='host' /> does not work as Windows seems to verify UUID; apparmor/security configuration changes may be needed)
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<!-- ... -->
<qemu:commandline>
<qemu:arg value='-acpitable'/>
<qemu:arg value='file=/some/path/slic.bin'/>
<qemu:arg value='-acpitable'/>
<qemu:arg value='file=/some/path/msdm.bin'/>
<qemu:arg value='-smbios'/>
<qemu:arg value='file=/some/path/smbios_type_0.bin'/>
<qemu:arg value='-smbios'/>
@racerxdl
racerxdl / c2write.ino
Created April 13, 2017 03:08
EFM8 C2 Write Port to Arduino
/**
Based on https://github.com/jaromir-sukuba/efm8prog/
Use his SW to program EFM8 using arduino.
This needs some work though (but it works)
**/
#define C2D 2
#define C2CK 3
#define LED 13
#define INBUSY 0x02
@racerxdl
racerxdl / jit.go
Created July 11, 2022 23:06
Golang JIT PoC
package main
import (
"github.com/edsrzf/mmap-go"
"reflect"
"unsafe"
)
// Addr returns the address in memory of a byte slice, as a uintptr
func Addr(b []byte) uintptr {