Skip to content

Instantly share code, notes, and snippets.

View ikus060's full-sized avatar

Patrik Dufresne ikus060

View GitHub Profile
import gzip
import io
import os
import shutil
import subprocess
import sys
import glob
# rename all file and folders from latin1 to utf8
_GZIP = shutil.which('gzip')
@ikus060
ikus060 / tkview.py
Last active September 29, 2021 13:16
Proof-of-concept to create Tkinter graphical user interface in a declarative way using XML template.
import tkinter
from html.parser import HTMLParser
from tkinter import TclError, ttk
import yaml
_components = {}
@ikus060
ikus060 / smx8fancontrol
Last active January 4, 2024 04:39
Python script to edit the X8DTL-iF Registry to control fan speed.
#!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
.log(LoggingLevel.INFO, LOG, "receiving incoming action request [${body.actionid}][${body?.alarm?.identifier}]")
from("timer://actionrequests?period=1&delay=" + period)
// HTTP GET
.to(value + "actionrequests/" + queueName + "/pop?httpClient.soTimeout=5000")
// If empty, wait
.choice()
.when(header(Exchange.HTTP_RESPONSE_CODE).isEqualTo(204))
.log(LoggingLevel.TRACE, "actionrequests route idle")
.delay(period)
.endChoice()
// Else process
import java.io.BufferedInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.PrintStream;
class ReceiveCOM1 extends Thread
{
InputStream in;
StartCOM1 comApp;
byte iUPS;