Skip to content

Instantly share code, notes, and snippets.

View LeoDJ's full-sized avatar

LeoDJ

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am LeoDJ on github.
  • I am leodj (https://keybase.io/leodj) on keybase.
  • I have a public key whose fingerprint is 3191 D9C9 5D64 ECF7 F1DE A832 91FC E46D 6401 3A5B

To claim this, I am signing this object:

@LeoDJ
LeoDJ / ESPWebSock.ino
Created August 18, 2016 21:35 — forked from bbx10/ESPWebSock.ino
ESP8266 Web server with Web Socket to control an LED
View ESPWebSock.ino
/*
* ESP8266 Web server with Web Socket to control an LED.
*
* The web server keeps all clients' LED status up to date and any client may
* turn the LED on or off.
*
* For example, clientA connects and turns the LED on. This changes the word
* "LED" on the web page to the color red. When clientB connects, the word
* "LED" will be red since the server knows the LED is on. When clientB turns
* the LED off, the word LED changes color to black on clientA and clientB web
@LeoDJ
LeoDJ / ScanMyOpelCAN_LogDecrypt.java
Created March 7, 2017 21:50
ScanMyOpelCAN Android App log decryption [tags decoding deobfuscation =:A:?:B>=7=:;]
View ScanMyOpelCAN_LogDecrypt.java
import java.util.*;
import java.lang.*;
import java.io.*;
class Decrypt
{
public static char[] d(byte[] bArr) { //reverse engineered obfuscation pattern
int length = bArr.length / 2;
if (bArr.length % 2 != 0) {
length++;
@LeoDJ
LeoDJ / doorStatus.php
Created March 14, 2017 21:01
A simple PHP persistance key/val store // Simply set the $secret to your password of choice and host the .php file on a server, then simply call the .php file with the given parameters
View doorStatus.php
<html>
<head>
<title>doorStatus</title>
</head>
<body>
<?php
error_reporting(E_ALL);
ini_set('display_errors', true);
global $filePath, $secret;
$filePath = "doorStatusData.json";
@LeoDJ
LeoDJ / doorStatus.php
Last active March 16, 2017 22:46
A simple PHP persistance key/val store // Simply set the $secret to your password of choice and host the .php file on a server, then call the .php file with ?help for more information
View doorStatus.php
<?php
header('Access-Control-Allow-Origin: https://yourDomain.tld');
$secret = "yourSecret"; //set you secret for write access here
error_reporting(E_ALL);
ini_set('display_errors', true);
global $filePath, $secret;
$filePath = "doorStatusData.json";
function readDataFile() { //read data from persistance file
global $filePath;
@LeoDJ
LeoDJ / banggood_compactCart_bookmarklet
Last active June 25, 2017 01:54
Banggood Compact Shopping Cart Bookmarklet
View banggood_compactCart_bookmarklet
javascript:(function(){$(document.head).append('<style>.cart_main_list dt {display: none;}.cart_main_list dd ul {height: 75px;min-height: 0;}.cart_main_list dd ul .td_product a.img {margin-top: -20px;}.cart_main_list dd .ul_total {display: none;}.cart_main {margin-bottom: 0px;border: 0;padding: 0;}.cart_main_list dd ul .td_filter {display: none;}.cart_main_list dd ul .td_product_btn {display: none;}</style>')})()
@LeoDJ
LeoDJ / a_greenshot_imgur_script.md
Last active July 11, 2017 14:49
Greenshot Imgur Upload Script via External Command
View a_greenshot_imgur_script.md

Problem

I don't have admin rights on a PC, but do have Greenshot installed. Having said that, greenshot was installed without any online publishing plugins, but with the Office and External Command plugins.
So I set out and created a hacky solution with a more or less simple vbs script that uploads images to imgur using the external command plugin.

Installation Instructions

  • download the .vbs and the .bat file and place them in some folder (has to be in the same folder)
  • open Greenshot Settings
    • go to the "Plugins" tab
    • select "External command Plugin"
  • click "Configure"
View TTN Feinstaub Decoder.js
function Decoder(bytes, port) {
// Decode an uplink message from a buffer
// (array) of bytes to an object of fields.
var decoded = {};
//port 1 = data struct LSB first
//port 2 = data struct MSB first
if (port === 1) {
decoded.pm10 = (bytes[1] << 8) + bytes[0];
@LeoDJ
LeoDJ / T6
Last active June 5, 2022 17:19
ISDT Firmware Changelog (manually updated)
View T6
T6 V1.0.0.4
1. FD-100 DSC Voltage Seting Support.
2. Optimize BattGo handling at work.
T6 V1.0.0.16
1. Support for adjust the smart power voltage.
T6 V1.0.0.17
1.Increase agreement for SmartPower.
@LeoDJ
LeoDJ / downloader.js
Created May 8, 2018 08:38
ISDT firmware download script
View downloader.js
const cheerio = require('cheerio')
const request = require('request')
const fs = require('fs');
let subfolder = 'firmwares'
if(!fs.existsSync(subfolder))
fs.mkdirSync(subfolder);
consoleLog = console.log
console.log = (text) => {