Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@twosky2000
twosky2000 / pdfcompress.py
Created January 15, 2023 16:46 — forked from ilovefreesw/pdfcompress.py
A Python script to batch compress PDF files on Windows, MAC, and Linux. Make sure gs and Python are in PATH before running this script.
from __future__ import print_function
import os
import subprocess
root = "."
try:
os.mkdir('compressed')
except FileExistsError:
pass
@twosky2000
twosky2000 / zha_symfonisk_remote_lights.yaml
Last active April 15, 2022 01:42 — forked from seamus65/zha_symfonisk_remote_lights.yaml
ZHA - IKEA Symfonisk sound controller for lights(Debounced)
blueprint:
name: ZHA - IKEA Symfonisk sound controller for lights
description: 'Control lights with an IKEA Symfonisk sound controller (the spinny ones).
You can set functions for single press, double press and triple press. This allows you to assign,
e.g., a scene or anything else.
Rotating left/right will change the brightness smoothly of the selected light.'
domain: automation
@twosky2000
twosky2000 / gist:c0b810b968c110fcbad4ebd847dbe8f6
Last active January 28, 2019 15:04
Mycroft mark1 alsamixer
┌───────────────────────────────────────────────────────────────────────────────────── AlsaMixer v1.0.28 ──────────────────────────────────────────────────────────────────────────────────────┐
│ Card: PulseAudio F1: Help │
│ Chip: PulseAudio F2: System information │
│ View: F3: Playback F4: Capture F5:[All] F6: Select sound card │
│ Item: Master Esc: Exit │
@twosky2000
twosky2000 / VideoSpeedListening.js
Created September 23, 2018 00:22
Simple Script that reads if the mouse is down speed is adjust, jumps back when let go
var myvid = document.getElementsByTagName('video')[0];
var mouseDown = 0;
document.body.onmousedown = function() {
mouseDown = 1;
}
document.body.onmouseup = function() {
mouseDown = 0;
myvid.playbackRate = 1;
myvid.currentTime -= 5;
}
@twosky2000
twosky2000 / GitToGui
Created September 1, 2018 18:58
Ideen Sammlung
Make all gui elements referable
Check github for open issues, render Warnung in gui.
Make Option so only optional
@twosky2000
twosky2000 / example_converte_ESF-yaml.py
Created August 26, 2018 07:36
Little Script for get ets4 efs file to integrate in home assistant
import datetime
import csv
import yaml
tags = None
namecount = dict()
class KNXDeviceManager(yaml.YAMLObject):
yaml_tag = u'!KNXDeviceManager'
@twosky2000
twosky2000 / example_converte_ESF-yaml.py
Created July 17, 2018 17:53
Example of a Converter from EFS(ETS4) to yaml
mport csv
import yaml
from collections import OrderedDict
with open("test.csv", "r", encoding="ISO-8859-1") as csvfile:
reader = csv.reader(csvfile, delimiter='\t')
config = yaml.load("""
#test
ETS_Name: "bla"
""")
@twosky2000
twosky2000 / example_universal.yaml
Created July 17, 2018 17:51
Simple Parsed ESF file to yaml
ETS_Version: "Fellmann EFH"
device:
Storen/Fenster.Untergeschoss.2/1/50
U30,31 Büro A/A
EIS 1 'Switching' (1 Bit)
Low
2/0/10
device:
Storen/Fenster.Untergeschoss.2/1/51
@twosky2000
twosky2000 / example.csv
Created July 17, 2018 17:38
example esf export from ets4
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 1 column, instead of 2. in line 1.
Fellmann EFH
Storen/Fenster.Untergeschoss.2/1/50 U30,31 Büro A/A EIS 1 'Switching' (1 Bit) Low 2/0/10
Storen/Fenster.Untergeschoss.2/1/51 U30,31 Büro L/S EIS 1 'Switching' (1 Bit) Low 2/0/11
Storen/Fenster.Untergeschoss.2/1/55 U33 Wohnen A/A EIS 1 'Switching' (1 Bit) Low
Storen/Fenster.Untergeschoss.2/1/56 U33 Wohnen L/S EIS 1 'Switching' (1 Bit) Low
Storen/Fenster.Untergeschoss.2/1/60 U32 Wohnen A/A EIS 1 'Switching' (1 Bit) Low
Storen/Fenster.Untergeschoss.2/1/61 U32 Wohnen L/S EIS 1 'Switching' (1 Bit) Low
Storen/Fenster.Untergeschoss.2/1/65 U34 Sitzplatz A/A EIS 1 'Switching' (1 Bit) Low
media_player.sonos_mobile:
config_entry_id: 4d6be3c676b94520af931e427282c4a5
name: "Mobile"
platform: sonos
unique_id: RINCON_949F3E7436D201400
media_player.sonos_kitchen:
config_entry_id: 4d6be3c676b94520af931e427282c4a5
name: "Küche"
platform: sonos
unique_id: RINCON_5CAAFD45784201400