Skip to content

Instantly share code, notes, and snippets.

@sedrubal
sedrubal / keepassxc.py
Created January 7, 2025 15:23
Ansible Lookup Plugin that allows looking up credentials in KeePassXC
#!/usr/bin/env python3
# Copyright (c) 2023, Sebastian Endres <sebastian.endres@dlr.de>
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
__metaclass__ = type
DOCUMENTATION = """
name: keepassxc
@sedrubal
sedrubal / decrypt-vault_pw.sh
Last active January 7, 2025 12:36
Ansible Vault Password Management using gpg
#!/usr/bin/env bash
gpg --quiet --batch --use-agent --decrypt "${BASH_SOURCE%/*}/vault_pw.gpg"
@sedrubal
sedrubal / decrypt-vault_pw.sh
Last active January 7, 2025 08:22
Ansible Vault Password Management using gpgsm / SMIME
#!/bin/bash
set -euo pipefail
set +e
# gpgsm exits with code 2 if the file is encrypted to multiple recipients and
# if we don't have the private keys for at least one of the recipients.
# We ignore this error messages and exit with exit code 0 in that case.
gpgsm --batch "$@" --decrypt "${BASH_SOURCE%/*}/vault_pw.gpg" 2> \
#!/usr/bin/env python3
"""
Automatically enroll systemd TPM unlock feature on all LUKS partitions.
"""
import sys
import json
import subprocess
@sedrubal
sedrubal / cpio.py
Created July 22, 2023 13:39
cpio parser
#!/usr/bin/python3
"""
Docs: https://www.systutorials.com/docs/linux/man/5-cpio/
Implements the old binary format.
TODO does only support regular files
TODO does not yet extract the files
"""
@sedrubal
sedrubal / clean.sh
Created May 14, 2023 11:14
Clean Fahrradverkehrsdaten from offenedaten-koeln.de
for f in *.csv; do
new_file_name=$(echo $f | cut -d'_' -f 4 | cut -d' ' -f 6)
echo $new_file_name
encoding=$(file -N --mime-encoding "${f}" | cut -d':' -f2)
iconv -f ${encoding} -t utf-8 "${f}" |
sed 's/^M\+$//' |
sed 's/\.//g' |
sed -r 's/Jan(uar| [0-9]+)/01/;s/Feb(ruar| [0-9]+)/02/;s/(März|Mrz [0-9]+)/03/;s/Apr(il| [0-9]+)/04/;s/Mai(| [0-9]+)/05/;s/Jun(i| [0-9]+)/06/;s/Jul(i| [0-9]+)/07/;s/Aug(ust| [0-9]+)/08/;s/Sep(tember| [0-9]+)/09/;s/Okt(ober| [0-9]+)/10/;s/Nov(ember| [0-9]+)/11/;s/Dez(ember| [0-9]+)/12/' |
sed -r 's/Jahr [0-9]+//' |
sed 's/Jahressumme.*$//' > "${new_file_name}"
@sedrubal
sedrubal / cava.spec
Created October 27, 2015 21:52
cava - RPM SPEC
Name: cava
Version: 0.3.5
Release: 1%{?dist}
Summary: Console-based Audio Visualizer for Alsa
Group: Applications/Multimedia
License: MIT
URL: https://karlstav.github.io/%{name}/
Source0: https://github.com/karlstav/%{name}/archive/%{version}.tar.gz
@sedrubal
sedrubal / Thinkpad P70 prototype
Last active July 1, 2017 14:36
Validity90 prototype output
Prototype version 10b
Found device 138a:0090
Index 1, size 12
0000 65 38 38 35 38 34 35 33 35 34 36 35
usb write:
0000 01
usb read:
0000 00 00 f0 b0 5e 54 a4 00 00 00 06 07 01 30 00 01
0010 00 00 8e 58 48 35 45 56 00 23 00 00 00 00 01 00
@sedrubal
sedrubal / CVE-2017-6513.md
Last active April 19, 2017 06:37
WHMCS Reseller Module V2 for Softaculous Virtualizor Privilege Escalation

Security Advisory for CVE-2017-6513

CVE ID: CVE-2017-6513: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-6513

Dates

  • 2017-03-06 01:00 CET: Sebastian discovered the vulnerability while using the software provided by IP Interactive UG. He tried to estimate the consequences of this issue.
  • 2017-03-06 02:00 CET: Sebastian contacted IP Interactive UG, because he thought it's an issue in their specific installation.
  • 2017-03-06 before 14:15 CET: IP Interactive UG contacted Softaculous and received a patch for this issue. He reported this to Sebastian and the issue could not be reproduced anymore.
  • 2017-03-06 14:20 CET: During a discussion with Julian we found out that this issue needs a CVE-ID and a public announcement. Sebastian tried to gather information. He asked IP Interactive UG and tried to install the software locally.
@sedrubal
sedrubal / mumble.spec
Created October 6, 2015 00:51
mumble - RPM SPEC
# Because of a bug you have to run:
#sudo ln -s /usr/include/speech-dispatcher/libspeechd.h /usr/include/libspeechd.h
#sudo ln -s /usr/include/speech-dispatcher/libspeechd_version.h /usr/include/libspeechd_version.h
# And you should verify the download by using the signature:
#https://github.com/mumble-voip/mumble/releases/download/1.2.10/mumble-1.2.10.tar.gz.sig
Name: mumble
Version: 1.2.10
Release: 1%{?dist}
Summary: Mumble VoIP Client/Server