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 / tetris.py
Created August 5, 2019 14:48
A ancient code that I did when I was at university. A friend reminded about it. It was posted ib my tumblr: http://letshackit.energylabs.com.br/?fbclid=IwAR2-rzRJeC39HP48EPAk4EvLQfe_LKgbQMcQIiHjrYnqMRsYyPXw_yNAX1k
#!/usr/bin/python
from sys import stdout
from PySFML import *
from random import random
import time as timec
import copy
'''
_ _ _ _ _ _ _ _
#include <stdio.h>
#include <hidapi/hidapi.h>
#include <stdint.h>
#include <string.h>
// Build:
// gcc rifts-init.c -lhidapi-libusb -o rifts-init
void printBuffer(char *buff, int length) {
for (int i = 0; i < length; i++) {
#include <stdio.h>
#include <hidapi/hidapi.h>
void printBuffer(char *buff, int length) {
for (int i = 0; i < length; i++) {
printf("%02x ", buff[i] & 0xFF);
}
printf("\n");
}
@racerxdl
racerxdl / tbsecp3-dma.c
Created April 30, 2019 04:22
Raw Frame Passthrough from TBS6903 board by faking a TS Frame.
/*
TBS ECP3 FPGA based cards PCIe driver
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,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@racerxdl
racerxdl / aprs.go
Last active February 15, 2019 02:40
APRS-IS Send / Receive
package main
import (
"bufio"
"fmt"
"log"
"net"
"strings"
"time"
)
package main
var constellationLut []map[byte]byte
var constellationLut []map[byte]byte
func rotateByte(v byte, n int, conj bool) byte {
byteData := make([]int, 8)
outByteData := make([]int, 8)
@racerxdl
racerxdl / bash.generate.random.alphanumeric.string.sh
Created November 27, 2018 14:56 — forked from earthgecko/bash.generate.random.alphanumeric.string.sh
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
@racerxdl
racerxdl / decoder-with-manchester.py
Last active October 7, 2018 04:04
Sik Radio / RTBBOX Packet Decoder
#!/usr/bin/env python
# 64 bit preamble (16 bytes)
# Reserved Reserved txdtrtscale enphpwdn manppol enmaninv enmanch enwhite
# EZRADIOPRO_MODULATION_MODE_CONTROL_1 = 0x0D = 0b00 001101
# trclk[1] trclk[0] dtmod[1] dtmod[0] eninv fd[8] modtyp[1] modtyp[0]
# EZRADIOPRO_HEADER_CONTROL_2IOPRO_MODULATION_MODE_CONTROL_2 = 0x23 = 0b00100011
# EZRADIOPRO_HEADER_CONTROL_2 = EZRADIOPRO_HDLEN_2BYTE | EZRADIOPRO_SYNCLEN_2BYTE
# EZRADIOPRO_DATA_ACCESS_CONTROL = EZRADIOPRO_ENPACTX | EZRADIOPRO_ENPACRX | EZRADIOPRO_ENCRC | EZRADIOPRO_CRC_16
# Sync Word: 2A D4
@racerxdl
racerxdl / crc.c
Created September 22, 2018 04:23
#define POLY 0xA001
#define POLY 0x8005
unsigned crc16(unsigned crc, unsigned char *buf, size_t len)
{
while (len--) {
crc ^= *buf++;
crc = crc & 1 ? (crc >> 1) ^ POLY : crc >> 1;
crc = crc & 1 ? (crc >> 1) ^ POLY : crc >> 1;
crc = crc & 1 ? (crc >> 1) ^ POLY : crc >> 1;
crc = crc & 1 ? (crc >> 1) ^ POLY : crc >> 1;
@racerxdl
racerxdl / ADF4350-test.ino
Created August 27, 2018 00:20
ADF4350 working sample for ESP8266 (NodeMCU)
#include <SPI.h>
#include <ADF4350.h>
#define COM_PIN D0
ADF4350 PLL(COM_PIN);
void setup(){
SPI.begin();
SPI.setClockDivider(SPI_CLOCK_DIV4);
SPI.setDataMode(SPI_MODE0);