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 / axispipe.py
Last active August 29, 2015 13:56
A Joystick Axis Pipe. This is the Arduino code that receives through a serial interface the commands and generate the PPM Pulses.
import serial
import pygame
import struct
import os
import sys
import time
class TextPrint:
def __init__(self):
self.reset()
self.font = pygame.font.Font(None, 30)
@racerxdl
racerxdl / mysql.sh
Created February 27, 2014 02:20
MySQL Backup Script
#!/bin/bash
LOCKFILE=/tmp/bkpmysql
if [ -e ${LOCKFILE} ] && kill -0 `cat ${LOCKFILE}`
then
echo "Já rodando!"
exit
fi
trap "rm -f ${LOCKFILE}; exit" INT TERM EXIT
echo $$ > ${LOCKFILE}
@racerxdl
racerxdl / hc06config.py
Created March 15, 2014 19:48
HC-06 Module Configurator through Serial Port
import serial
import time
PORT = "/dev/ttyUSB0" # If windows, change it to COMX
PINCODE = "1234" # Change it to your PIN
DEVNAME = "mybt" # Change it to your device name
BAUDRATE= 115200 # Change it to your baudrate
@racerxdl
racerxdl / offsets.txt
Last active August 29, 2015 13:57
Pump It Up Fiesta 2 Save Decrypter/Encrypter
#Name # offset length datatype
adler32 # 0x00 0x04 LE int
adlerSeed # 0x04 0x04 LE int
playerID # 0x08 0x08 string (null term)
region # 0x14 0x04 LE int
avatarID # 0x18 0x04 LE int
level # 0x1C 0x04 LE int
totalCalories # 0x20 0x04 LE float
totalV02 # 0x24 0x04 LE float
numberRunningSteps # 0x28 0x08 LE int64
@racerxdl
racerxdl / example.ino
Created March 26, 2014 22:37
Fita RGB
char buff[3];
char recv = 0;
void setup() {
Serial.begin(115200);
}
void loop() {
if(Serial.available() > 0) {
buff[recv] = Serial.read();
@racerxdl
racerxdl / f2rawextract.cpp
Last active August 29, 2015 14:00
Fiesta 2 AMF Raw Extract
/*
_____ _ _ _____ ____
| ___(_) ___ ___| |_ __ _| ___/ ___|
| |_ | |/ _ \/ __| __/ _` | |_ \___ \
| _| | | __/\__ \ || (_| | _| ___) |
|_| |_|\___||___/\__\__,_|_| |____/
Fiesta 2 Raw Extract
*/
@racerxdl
racerxdl / movemail.sh
Created May 21, 2014 17:50
Shell script to move emails from wrong folders
#!/bin/bash
for i in folder/*
do
if grep -q "Delivered-To: email@nobody" "$i"
then
mv "$i" destfolder/
else
echo "NOK" # Doesnt have Delivery To
fi
@racerxdl
racerxdl / tvs_tools.py
Created August 12, 2014 03:11
TVS Tools from my Smart Monitor
#!/usr/bin/python
#encoding:UTF-8
import os, smtplib, shutil, syslog, subprocess, cgi, commands, re, MySQLdb
from datetime import date, timedelta
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from htmlentitydefs import codepoint2name
@racerxdl
racerxdl / download.sh
Created August 13, 2014 03:54
Photosynth Image Downloader - Just save as download.sh, give +x permission and execute: ./download.sh (NUM_PHOTOS-1) ID For http://photosynth.net/preview/view/bbea2bf0-baf1-4bc8-abdb-a45787116724 for example you would do ./download.sh 74 bbea2bf0-baf1-4bc8-abdb-a45787116724
#!/bin/bash
for i in $(seq 0 $1)
do
wget http://cdn.photosynth.net/ps2/$2/packet/l1/img`printf %04d ${i%.*}`.jpg
done
@racerxdl
racerxdl / frsky.py
Created September 13, 2014 04:54
FrSky Protocol Decoder in Python
#!/usr/bin/env python
'''
_____ ____ _
| ___| __/ ___|| | ___ _
| |_ | '__\___ \| |/ / | | |
| _|| | ___) | <| |_| |
|_| |_| |____/|_|\_\\__, |
|___/