Skip to content

Instantly share code, notes, and snippets.

View danielkucera's full-sized avatar

Daniel Kucera danielkucera

View GitHub Profile
@danielkucera
danielkucera / main.lua
Created March 11, 2018 14:44
radio clock ntp sync
gpio.mode(1, gpio.OUTPUT)
gpio.mode(2, gpio.OUTPUT)
gpio.write(1, gpio.HIGH)
gpio.write(2, gpio.LOW)
synced=0
timeset=0
inchours=0
timezone=1 -- range 1 - 25
#!/usr/bin/python -u
from bluepy.btle import Scanner, DefaultDelegate
import json
import subprocess
myDevices = [
"f8:f6:98:d7:33:fd", #gas meter
"f8:6a:94:76:a3:76", #power meter
]
#!/usr/bin/python2
import email
import sys
import re
import shutil
import uuid
allowed = [
"[email protected]",
@danielkucera
danielkucera / i2c-eeprom.py
Created December 9, 2018 20:25
i2c-eeprom.py
#!/usr/bin/python
import sys
import time
import os
bus = sys.argv[1] # /dev/i2c-X
addr = sys.argv[2] # 0x50
filename = sys.argv[3]
offset = 0
@danielkucera
danielkucera / test-bltouch.py
Created December 17, 2018 17:44
test-bltouch.py
#!/usr/bin/python
import os
import time
import re
import statistics
dev = os.open("/dev/pts/0",os.O_RDWR)
#flush buffer
@danielkucera
danielkucera / recvlkv373.py
Created February 11, 2019 10:58
./recvlkv373.py 226.2.2.2 2068 out.mjpeg
#!/usr/bin/env python
import socket
import binascii
import sys
def main():
MCAST_GRP = sys.argv[1]
MCAST_PORT = int(sys.argv[2])
@danielkucera
danielkucera / part-extract.sh
Created March 12, 2019 19:01
part-extract.sh
SRC=$1
DIR=$SRC.ext
mkdir $DIR
eval `fdisk -l $SRC | grep ^$SRC | awk '{ print "dd if='$SRC' bs=512 of='$DIR'/"$1" skip="$2" count="$4" ; "; }'`
@danielkucera
danielkucera / compal-decrypt.c
Last active July 3, 2023 23:02
compal-decrypt.c
/*
Program for decrypting Compal CH7465LG private key
Compilation:
gcc -o compal-decrypt compal-decrypt.c -lcrypto
Running:
./compal-decrypt
usage: ./compal-decrypt <infile> <outfile>
@danielkucera
danielkucera / smaz-orig.c
Created September 2, 2019 09:02
smaz-orig.c
#if ITX_BOOT_TYPE == ITX_HOST_BOOT
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <arpa/inet.h>
/* magic file header for compressed files */
static const unsigned char magic[4] = { 'S', 'M', 'A', 'Z' };
- .dockerignore
- dockerd - containerd - runc
https://github.com/kratochj/docker-advance-training-exercise
- CMD vs ENTRYPOINT
- signal handling