Skip to content

Instantly share code, notes, and snippets.

Martin Vancl tuxmartin

Block or report user

Report or block tuxmartin

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
@tuxmartin
tuxmartin / v4l.sh
Last active May 20, 2020
Create fake /dev/videoX device from video file
View v4l.sh
# mozna neni potreba: sudo apt-get install linux-generic
sudo apt-get install v4l2loopback-dkms
sudo modprobe v4l2loopback
modprobe v4l2loopback
ffmpeg -i /home/martin/Downloads/video.mp4 -f v4l2 -vcodec rawvideo /dev/video0
ffmpeg -i rtsp://10.104.103.138/user=admin_password=tlJwpbo6_channel=1_stream=0.sdp -f v4l2 -pix_fmt yuv420p -vcodec rawvideo /dev/video0
@tuxmartin
tuxmartin / app.yml
Last active Apr 27, 2020
IoT: ESPHome current transformer
View app.yml
esphome:
name: test
platform: ESP32
board: esp32doit-devkit-v1
wifi:
ssid: "My_WiFi_AP"
password: "secretPassword123"
ap:
ssid: "Test Fallback Hotspot"
@tuxmartin
tuxmartin / udp_ipv6_client.py
Last active Apr 27, 2020
Python UDP IPv6 client & server
View udp_ipv6_client.py
import socket
UDP_IP = "::1" # localhost
UDP_PORT = 5005
MESSAGE = "Hello, World!"
print "UDP target IP:", UDP_IP
print "UDP target port:", UDP_PORT
print "message:", MESSAGE
@tuxmartin
tuxmartin / socket_client.py
Last active Apr 11, 2020
Python socket - server and client example (push notifications)
View socket_client.py
import socket
host = 'localhost'
port = 1234
buf = 1024
clientsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
clientsocket.connect((host, port))
print "Sending 'test1\\n'"
View poco_uri_parser.cpp
// g++ -o poco_uri_parser poco_uri_parser.cpp -L/usr/local/lib -lPocoNet -lPocoFoundation
// http://pocoproject.org/slides/160-URIandUUID.pdf
#include "Poco/URI.h"
#include <iostream>
using namespace std;
int main(int argc, char** argv)
{
@tuxmartin
tuxmartin / imap_quota_check.py
Created Apr 2, 2020
Vypsani stavu IMAP kvoty
View imap_quota_check.py
import imaplib, re
import os
p = re.compile('d+')
# ---------------------------------
login="user@example.net"
password="password123"
imap_server="example.net"
imap_port=993
View docker-compose.yml
version: "3"
services:
init-guacamole-db:
image: guacamole/guacamole:latest
command: ["/bin/sh", "-c", "test -e /init/initdb.sql && echo 'init file already exists' || /opt/guacamole/bin/initdb.sh --postgres > /init/initdb.sql" ]
volumes:
- dbinit:/init
postgres:
@tuxmartin
tuxmartin / README.md
Last active Mar 12, 2020
Minimal Poco websocket C++ client
View README.md

Stazeni a kompilace POCO

wget http://pocoproject.org/releases/poco-1.7.3/poco-1.7.3.tar.gz
tar xzf poco-1.7.3.tar.gz
cd poco-1.7.3
./configure --minimal --static --no-samples --no-tests
time make -j4 -s
cd lib/Linux/x86_64/
for f in *.a; do "strip $f"; done
@tuxmartin
tuxmartin / RFID_EEPROM.ino
Last active Mar 5, 2020
Arduino Mifare 13.56 MHz MFRC522 reader
View RFID_EEPROM.ino
/*
* Dump block 0 of a MIFARE RFID card using a RFID-RC522 reader
* Uses MFRC522 - Library to use ARDUINO RFID MODULE KIT 13.56 MHZ WITH TAGS SPI W AND R BY COOQROBOT.
-----------------------------------------------------------------------------
* Pin layout should be as follows:
* Signal Pin Pin Pin
* Arduino Uno Arduino Mega MFRC522 board
* ------------------------------------------------------------
* Reset 9 5 RST
* SPI SS 10 53 SDA
@tuxmartin
tuxmartin / ESP8266.txt
Last active Feb 2, 2020
ESP8266 - co koupit + navod
View ESP8266.txt
# NodeMcu DevKit - doporucuji na pocatecni vyuku s ESP8266!!!
New Wireless module CH340 NodeMcu V3 Lua WIFI Internet of Things development board based ESP8266
http://www.aliexpress.com/item/NodeMcu-Lua-WIFI-development-board-based-on-the-ESP8266-Internet-of-things/32339203041.html
NodeMcu base ESP8266 testing DIY Breadboard
http://www.aliexpress.com/item/NodeMcu-base-ESP8266-testing-DIY-Breadboard/32457259665.html
#ESP8266 ESP07
You can’t perform that action at this time.