Skip to content

Instantly share code, notes, and snippets.

View exetico's full-sized avatar

Tobias Nordahl Kristensen exetico

View GitHub Profile
@exetico
exetico / send-keycombination-to-multiple-windows-like-obssh
Last active November 13, 2022 11:36
Trigger OBS software to start/stop recordings with one command (Send key-presses to mulitple windows matching the same title)
# I'm using two OBS programs at the same time, to record two sources
# Therefore I need a simple way to start and stop both recordings at the same time
# Most of the time, a shortcut will trigger both windows - but not always
# And... I forget my normal shortcuts on/off
# Therefore I've added "Text Command" widget in KDE, and triggers the following command to start/stop my recording(s)
# You'll need to configure the shorts in OBS, for this to work
# Tested on Manjaro with KDE
# You don't have to do it in a one-liner, btw...
for i in $(xwininfo -root -tree | grep 'OBS '); do if [[ $i =~ ^0x[0-9A-Fa-f]{1,}$ ]]; then xdotool key --window "$i" ctrl+alt+0 ; fi; done
@exetico
exetico / py
Created May 9, 2022 13:42
Python Simple SMTP Tester (Send mail) - Fixed for new SMTP solution where serveraddr needs to be defined in SMTP_SSL() // SMTP() function - Source: https://github.com/turbodog/python-smtp-mail-sending-tester/blob/master/smtptest.py
#!/usr/bin/python
"""smtptest.py: command-line smtp test mail sender
https://github.com/turbodog/python-smtp-mail-sending-tester
Usage: python smtptest.py [options] fromaddress toaddress serveraddress
Examples:
python smtptest.py bob@example.com mary@example.com mail.example.com
python smtptest.py --debuglevel 1 --usetls -u bob -p xyzzy "Bob <bob@example.com>" mary@example.com mail.example.com
@exetico
exetico / csv-add-index-and-encode.sh
Last active January 29, 2020 19:26
Bash script, which allows you to add a Index-column to a CSV file, and encode it as UTF-8. You can also add your own seperator. Created, for easy prep of file, before import to Firefly III.
#!/bin/bash
echo ""
if [ -z "${1}" ]; then
echo "csv-add-index-and-encode: Error!"
echo "Please define input-file as the first paramter, and optinally define seperator (like ;) as the secound one, like:"
echo "./csv-fix.sh NemKonto_PosterinterTest3.csv \";\""
echo ""
exit 1
else