Skip to content

Instantly share code, notes, and snippets.

👨‍🏭
at work

Gabriel Valky gabonator

👨‍🏭
at work
Block or report user

Report or block gabonator

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gabonator
gabonator / server.js
Created Apr 4, 2019
nodejs web server with cors workaround
View server.js
const express = require('express');
const app = express();
const spawn = require('child_process').spawn;
const request = require('request');
app.post("/cors/*", function(req, res)
{
var url = decodeURIComponent(req.url.substr(6));
var body = '';
req.on("data",function(chunk){
@gabonator
gabonator / orangepi.txt
Last active Dec 25, 2018
orange pi iot 2g notes
View orangepi.txt
General notes on OrangePi boards:
On the download page you will find many SD card images but not a single image works as one would expect.
Do not forget to set the boot switch to SDCARD instead of NAND!!!! If you are not sure what are you doing, try turning the device on
without SD card and if it is booting, it uses NAND. You will also notice this after logging in, when you are not able to create or modify
any file, since the FS is mounted as read only.
There is on board UART running at unusual 921600 bauds next to USB port (GND/RX/TX), or for OrangePi IOT 3G you need to connect to
USART2 on extension header. Use putty on windows or screen on linux/osx to talk to this device. If you receive garbage even when
the baudrate is correct, check your UART connection if it is correctly grounded or power the orangePi directly from USB port of your
computer. If you will receive shitload of debugging messages, reduce them by calling
@gabonator
gabonator / ps2002h.txt
Last active Apr 2, 2019
PS2002H/TP3016M power supply uart commands
View ps2002h.txt
pcb markings: MPT3050A-V5.6 2015-08-06 QJB7.820.290 698580
sold as PS2002H or Tekpower TP3016M
On the PCB there is CN2 connector with pins: TX, GND, RX. It is a uart at 115200 bauds which
generates some debugging information from STM32F100 processor.
It does not respond to common AT commands, neither to any random characters transmitted over
uart, list of some received messages follows. If you will find out what protocol this device
uses, please let us know in comments section
power-on:
@gabonator
gabonator / monitor.ino
Created Jun 24, 2018
ESP8266 uart monitor and uploader
View monitor.ino
#include <ESP8266WiFi.h>
const char* ssid = "*********";
const char* password = "*********";
const int bufferLength = 4096;
int bufferIndex = 0;
char buffer[bufferLength];
char bufferTemp[bufferLength];
long lastSend = 0;
@gabonator
gabonator / sygichud.ino
Last active Jun 21, 2018
Sygic navigation external HUD display with ESP32 TTGO board with 128x64 pixel oled display and Wifi
View sygichud.ino
// Sygic navigation external HUD display with ESP32 TTGO board with 128x64 pixel oled display and Wifi
//
// Board description: 16 Mt Bytes (128 Mt bit) Pro ESP32 OLED V2.0 TTGO For Arduino ESP32 OLED WiFi Mo
// Board info: https://gist.github.com/gabonator/402e09eb1b5afce1e7be228483138071
//
// Board installation for arduino:
// https://github.com/espressif/arduino-esp32/blob/master/docs/arduino-ide/windows.md
//
// Used libraries:
// Websocket protocol: https://gist.github.com/gabonator/1fb37f2478b053336b01b0c7e5842bca
@gabonator
gabonator / Base64.cpp
Created Jun 20, 2018
ESP32-Websocket arduino library
View Base64.cpp
#include "Base64.h"
const char b64_alphabet[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789+/";
/* 'Private' declarations */
inline void a3_to_a4(unsigned char * a4, unsigned char * a3);
inline void a4_to_a3(unsigned char * a3, unsigned char * a4);
inline unsigned char b64_lookup(char c);
@gabonator
gabonator / snowboylic.txt
Created Jun 19, 2018
snowboy kitt ai remove license expiration
View snowboylic.txt
Someone on the forums was complaining about expired sample model jarvis.umdl:
https://groups.google.com/a/kitt.ai/forum/#!topic/snowboy-discussion/uWrtW6W0TiM
Look at the history of jarvis.umdl, there are two revisions - new one with unlimited expiration:
https://github.com/Kitt-AI/snowboy/commits/797a17e96fc085dbd70a6fefeb15b9bc43f52913/resources/models/jarvis.umdl
Download both revisions and see what is different:
https://raw.githubusercontent.com/Kitt-AI/snowboy/797a17e96fc085dbd70a6fefeb15b9bc43f52913/resources/models/jarvis.umdl
https://raw.githubusercontent.com/Kitt-AI/snowboy/e2c4e1fedfa81edd63000e3efbaacc0c6e67b116/resources/models/jarvis.umdl
@gabonator
gabonator / json.h
Created Jun 3, 2018
light json parser for microcontrollers
View json.h
class CSubstring
{
const char* mpString;
int mnBegin;
int mnLength;
public:
CSubstring(const char* pString)
{
mpString = pString;
@gabonator
gabonator / scormgrab.js
Last active May 26, 2018
Scorm player grabber and decoder
View scormgrab.js
var request = require("request");
var fs = require("fs");
headers = {
'User-Agent': 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',
'Cookie': "MoodleSession=bd84957dad9ea0a2939fbcb0ffbd7116;",
'Accept': '/',
'Connection': 'keep-alive'
};
@gabonator
gabonator / kibana.js
Created May 1, 2018
kibana creating and pushing data from nodejs
View kibana.js
var request = require("request");
data = {
"mappings": {
"reading": {
"properties": {
"somenumber": {"type": "float"},
"sometext": {"type": "text"},
"timestamp": {"type": "date"},
},
You can’t perform that action at this time.