Skip to content

Instantly share code, notes, and snippets.

View linusgke's full-sized avatar
:octocat:

Linus Groschke linusgke

:octocat:
View GitHub Profile
#!/bin/bash
# ========================
# || sound_detector.sh ||
# by elektr0nisch © 2023
# ========================
#
# This script constantly checks whether there are any active audio streams. (= sound is playing on the machine)
# Originally being used with an Raspberry Pi in an BT/DLNA/AirPlay/Spotify receiver setup.
:: Windows script enabling w32time and setting current domain controller as NTP time server
:: https://gist.github.com/elektr0nisch/8357f92388050b4d9cc04fd75e56883d
:: Ensure that w32time is running
net start w32time
:: Reconfigure
w32tm /config /syncfromflags:domhier /update
w32TM /resync
:: Windows script enabling w32time and setting NTPs of Physikalisch-Technische Bundesanstalt (PTB) in Braunschweig
:: https://gist.github.com/elektr0nisch/e783d7b448266c218ee130860fead5e7
:: Ensure that w32time is running
net start w32time
:: Reconfigure
w32TM /config /syncfromflags:manual /manualpeerlist:"ptbtime1.ptb.de ptbtime2.ptb.de ptbtime3.ptb.de ptbtime4.ptb.de" /update
w32TM /resync
import csv
from datetime import datetime
from pprint import pprint
data = []
with open("data.csv", newline="", encoding="utf8") as file:
reader = csv.DictReader(file, delimiter=";")
for row in reader:
@linusgke
linusgke / dks_winupdate_disable.bat
Created August 7, 2022 13:49
DKS disable windows update service
@echo off
REM
REM MUST BE RUN AS ADMINISTRATOR
REM
%~d0
cd %~p0
set _SCRIPTLOG=DksWindowsUpdate.log
set DKS_REG_KEY=HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate
set DKS_BAK_FILE=%~dp0Reg_WindowsUpdate.txt
@linusgke
linusgke / dks_winupdate_enable.bat
Created August 7, 2022 13:48
DKS enable windows update service
@echo off
REM
REM MUST BE RUN AS ADMINISTRATOR
REM
%~d0
cd %~p0
set _SCRIPTLOG=DksWindowsUpdate.log
set DKS_REG_KEY=HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate
set DKS_BAK_FILE=%~dp0Reg_WindowsUpdate.txt
@linusgke
linusgke / enable_wmi.bat
Last active August 7, 2022 13:52
Windows script enabling Windows Management Instrumentation (WMI)
:: Windows script enabling Windows Management Instrumentation (WMI)
:: https://gist.github.com/elektr0nisch/dd20e8eb9655e4485087d5ec3f093b7e
:: Attention! Firewall rules have to be adressed by their display name.
:: Therefore this script is language dependent and only supports english and german at the moment.
@echo off
:: Checking administrator privilges
net session >nul 2>&1