Skip to content

Instantly share code, notes, and snippets.

View jbruechert's full-sized avatar

Jonah Brüchert jbruechert

View GitHub Profile
@jbruechert
jbruechert / flatpak-export.py
Last active March 26, 2023 16:45
Export flatpak commands to PATH
#!/usr/bin/env python3
from pathlib import Path
from configparser import ConfigParser, NoOptionError
import os
import stat
flatpak_apps_dir = Path("/var/lib/flatpak/app/").iterdir()
for app in flatpak_apps_dir:
metadata_file = app.joinpath("current/active/metadata")
@jbruechert
jbruechert / qtwebengine-install-widevine.sh
Created November 30, 2022 17:22
Script to install widevine for use with QtWebEngine on debian.
#!/usr/bin/env bash
set -e -x
CHROMIUM_VERSION="106.0.5249.61"
CHROMIUM_URL="https://dl.google.com/linux/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROMIUM_VERSION}-1_amd64.deb"
wget "${CHROMIUM_URL}" -O /tmp/chromium.deb
mkdir -p /tmp/chromium-root
dpkg-deb -x /tmp/chromium.deb /tmp/chromium-root
Q_DECLARE_METATYPE(QXmppDiscoveryIq);
Q_DECLARE_METATYPE(QList<QXmppDiscoveryIq::Item>);
void tst_QXmppHttpUploadManager::testSFSManager()
{
using DiscoInfoResult = QXmppDiscoveryManager::InfoResult;
using DiscoItem = QXmppDiscoveryIq::Item;
SKIP_IF_INTEGRATION_TESTS_DISABLED()
template<typename T, typename Converter>
auto transform_filter(QVector<T> &input, Converter convert)
{
using Output = std::decay_t<decltype(convert(input.front()))>;
QVector<Output> output;
output.reserve(input.size());
for (const auto item : input) {
if (auto converted = convert(item)) {
@jbruechert
jbruechert / rpi-init.py
Created June 13, 2022 23:39
Postprocess a debian image to be ready to connect with ansible.
#!/usr/bin/env python3
import subprocess
import sys
from pathlib import Path
from subprocess import CalledProcessError
from typing import List
MOUNTED_PATHS: List[Path] = []
@jbruechert
jbruechert / create-runtime.sh
Last active October 5, 2021 17:36
SailfishOS flatpak runtime (non-functional)
#!/usr/bin/env bash
#wget http://releases.sailfishos.org/sdk/repository-3.1.7/common/org.merproject.emulators.emulator_latest/2020.04.29-1Sailfish_OS-3.3.0.16-Sailfish_SDK_Emulator.7z -O emulator.7z --continue
echo "Decompressing downloaded files"
#7z x emulator.7z
echo "Unpacking virtualbox image"
qemu-img convert -f vdi sailfishos.vdi -O raw emulator.img
@jbruechert
jbruechert / case.hs
Created June 20, 2021 01:56
Identifiert Case Converter
module Main where
import Data.Char;
import System.Environment
data Conversion = SnakeToCamel
| CamelToSnake
| UpperCamelToSnake
| SnakeToUpperCamel
| UpperCamelToCamel
# This is a system-wide configuration file used to
# keep track of registries for various container backends.
# It adheres to TOML format and does not support recursive
# lists of registries.
# The default location for this configuration file is /etc/containers/registries.conf.
# The only valid categories are: 'registries.search', 'registries.insecure',
# and 'registries.block'.

To install and start rsync on your phone, run ./adb-start-rsyncd.sh

You can now transfer files from and to the device. To pull your current rsyncd.conf, use this command: rsync -av --progress --stats rsync://localhost:6010/root/data/rsyncd.conf . To deploy a new rsyncd.conf file using rsync, you can use rsync -av --progress --stats rsyncd.conf rsync://localhost:6010/root/data/rsyncd.conf

@jbruechert
jbruechert / download-twrp.py
Created December 22, 2017 21:08
Download twrp without visiting the website! ./download-twrp.py chaozu
#!/usr/bin/python3
import requests
import subprocess
import sys
from bs4 import BeautifulSoup
device = sys.argv[1]
dlpagerequest = requests.get("https://eu.dl.twrp.me/" + device)