Skip to content

Instantly share code, notes, and snippets.

@MaZderMind
MaZderMind / atlassian-vulnerabilitiey-api-interpretation.ts
Last active February 25, 2024 14:14
Atlassian Vulnerabilitiey API Interpretation code
import { parse, valid } from "semver";
type Status = "AFFECTED" | "FIXED"
function isVulnerable(selectedVersion: string, versions: [string, Status][]) {
return isFilterSelected(selectedVersion, versions) || checkVersionAffected(selectedVersion, versions);
}
function isFilterSelected(selectedVersion: string, versions: [string, Status][]) {
return versions
@MaZderMind
MaZderMind / carlmix.py
Created November 28, 2018 21:31
quick and dirty gstreamer videomixer, switching between 1 of 20 sources
#!/usr/bin/env python3
import logging
import random
import signal
import sys
import gi
gi.require_version('Gst', '1.0')
gi.require_version('GstNet', '1.0')
import sys
import gi
gi.require_version('Gst', '1.0')
gi.require_version('GstNet', '1.0')
from gi.repository import Gst, GstNet
ptp_domain = 0
ptp_interfaces = ['enp0s25']
@MaZderMind
MaZderMind / meet.css
Last active August 9, 2023 09:13
User-CSS for clean Google Meets
/* Block URLs with uBlock Origin:
* https://www.gstatic.com/meet/sounds/*
*/
/* Top Right Menu */
.NzPR9b { display: none }
/* On-Hover-Footer */
.rG0ybd { display: none }

Pin- und Kabelbelegung von Beyerdynamic DT297 Headsets

Pin-Numerierung Beyerdynamic DT297 Headsets

B3  B1
  B2

B3  B3
@MaZderMind
MaZderMind / compressor-hangs.py
Created November 3, 2022 21:44
Apple Compressor Hangs
# https://support.apple.com/en-gb/guide/compressor/cpsr9be73312/4.6.1/mac/11.5.1
import subprocess
proc = subprocess.Popen(['/Applications/Compressor.app/Contents/MacOS/Compressor', '-monitor'], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, stdin=subprocess.DEVNULL)
while True:
c = proc.stdout.read(1)
print(c) # prints up to the last '\n'
# never gets here
print('done')
@MaZderMind
MaZderMind / Inzidenz + Impfprogress.js
Created May 21, 2021 17:22
Inzidenz + Impfprogress Deutschland – Widget für iOS Scriptable
// Licence: Robert Koch-Institut (RKI), dl-de/by-2-0
// Thanks to @rphl (https://github.com/rphl) and @tzschies (https://github.com/tzschies) for their inspiring work on this widget. See https://gist.github.com/rphl/0491c5f9cb345bf831248732374c4ef5 and https://gist.github.com/tzschies/563fab70b37609bc8f2f630d566bcbc9.
function round(n, d) {
const m = Math.pow(10, d);
return Math.round((n + Number.EPSILON) * m) / m;
}
function buildQuery(params) {
@MaZderMind
MaZderMind / datetime_custom_rollover.py
Created April 23, 2021 06:48
datetime_custom_rollover.py
from datetime import datetime, time, date, timedelta
def rollover(dt: datetime, rollover: time) -> date:
given_time = dt.time()
if given_time < rollover:
return dt.date()
else:
return dt.date() + timedelta(days=1)
def test_rollover():
[
{
"conference": "32C3",
"slug": "32c3",
"author": "CCC",
"description": "Live-Streaming vom 32C3",
"keywords": "32C3, Hacking, Chaos Computer Club, Video, Music, Podcast, Media, Streaming, Hacker, Hamburg",
"startsAt": "2015-12-27T05:00:00+0000",
"endsAt": "2015-12-30T20:00:00+0000",
"groups": [
#!/usr/bin/env python3
import sys, gi, signal, pyinotify
gi.require_version('Gst', '1.0')
from gi.repository import Gst, GObject, GLib
# init GObject & Co. before importing local classes
GObject.threads_init()
Gst.init([])