Skip to content

Instantly share code, notes, and snippets.

@GluTbl
GluTbl / AutoConnectEspWithOTA.ino
Created July 26, 2020 20:27
[Autoconnect Esp Wifimanger with OTA] #esp #arduino
#include <ESP8266WiFi.h> //https://github.com/esp8266/Arduino
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h> //https://github.com/tzapu/WiFiManager
#include <ArduinoOTA.h>
void setup() {
Serial.begin(115200);
Serial.println("Booting");
WiFiManager wifiManager;
@GluTbl
GluTbl / tcpserver.py
Created July 2, 2020 05:18
TcpServer
import socket
import threading
from time import sleep
class ThreadedServer(object):
def __init__(self, host, port):
self.host = host
self.port = port
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
@GluTbl
GluTbl / SqliteApi.py
Last active January 30, 2021 10:11
SqLite python API #python #sql #sqlite
import sqlite3
import base64
class SqlideApi():
def __init__(self, dbname, tablename):
self.tablename = tablename
self.dbname = dbname
self.con = None
try:
@GluTbl
GluTbl / imageadder.kt
Created May 12, 2020 10:18
Add border to image #java #image
fun addBordertoImage(source: BufferedImage, color: Color=Color.WHITE, borderLeft: Int =10, borderTop: Int =10): BufferedImage {
val borderedImageWidth: Int = source.width + borderLeft * 2
val borderedImageHeight: Int = source.height + borderTop * 2
val img = BufferedImage(borderedImageWidth, borderedImageHeight, BufferedImage.TYPE_3BYTE_BGR)
img.createGraphics()
val g = img.graphics as Graphics2D
g.color = color
g.fillRect(0, 0, borderedImageWidth, borderedImageHeight)
g.drawImage(
@GluTbl
GluTbl / PlayerController.py
Last active May 7, 2022 14:46
Python VLC Controller #vlc #python
class player():
def __init__(self):
self.is_initiated = False
self.SEEK_TIME = 20
self.MAX_VOL = 512
self.MIN_VOL = 0
self.DEFAULT_VOL = 256
self.VOL_STEP = 13
self.current_vol = self.DEFAULT_VOL
@GluTbl
GluTbl / i2cscanner.ino
Created April 16, 2020 11:53
ESP8266 I2C scanner #i2c scanner
/*
* i2c_port_address_scanner
* Scans ports D0 to D7 on an ESP8266 and searches for I2C device. based on the original code
* available on Arduino.cc and later improved by user Krodal and Nick Gammon (www.gammon.com.au/forum/?id=10896)
* D8 throws exceptions thus it has been left out
*
*/
#include <Wire.h>
@GluTbl
GluTbl / SystemInfoTCP.kt
Created April 12, 2020 11:18
TempMonitor over TCP #raspberry
import com.pi4j.system.SystemInfo
import java.io.BufferedReader
import java.io.IOException
import java.io.InputStreamReader
import java.net.InetAddress
import java.net.ServerSocket
import java.net.Socket
import java.text.ParseException
@GluTbl
GluTbl / __init__.py
Last active April 16, 2020 18:18
TCPHandler #Eventghost
import eg
import json
import socket
import threading
from threading import Event, Thread
import wx.lib.scrolledpanel as scrolled
eg.RegisterPlugin(
name="TCP handler",
author="Glu",
@GluTbl
GluTbl / gamepad.py
Created April 10, 2020 16:39
HID gamepade move detect
import time
from time import sleep
from pynput.mouse import Listener,Button, Controller
mouse = Controller()
def on_move(x, y):
global p1
p1=mouse.position
return False
@GluTbl
GluTbl / __init__.py
Created March 27, 2020 12:10
[Eventghost Cpu Temp plugin]
import threading
from time import sleep
import eg
import wx.lib.scrolledpanel as scrolled
eg.RegisterPlugin(
name="WMI Ghostly",
author="Glu",
guid="{1B1428D4-86BC-4A4E-941F-A90125262613}",
version="0.1.1",