Skip to content

Instantly share code, notes, and snippets.

View rugk's full-sized avatar
🤔
Thinking…

rugk rugk

🤔
Thinking…
View GitHub Profile
@rugk
rugk / workaround-podman-issue19913.sh
Last active March 7, 2024 15:33
Workaround script for podman rm (--force) does not work anymore ("container state improper"/"invalid argument" when unmounting) and start neither, see https://github.com/containers/podman/issues/19913
#!/bin/bash
#set -x
# Define the list of containers you want to remove
containers=("nextcloud_redis_1" "nextcloud_db_1" "nextcloud_nc_1")
for container in "${containers[@]}"; do
echo "Now handling $container..."
# First attempt to forcefully remove the container
podman rm --force "$container"
@rugk
rugk / coupons-filtered.json
Created January 12, 2024 18:50
sovendus-network.com coupons
[
{
"couponId": 16280,
"value": "12 %",
"shopName": "Shop Apotheke",
"label": "Neukundengutschein für alle Marken",
"type": "online",
"keywords": [
"Apotheke",
"Arzneimittel",
@rugk
rugk / 95-latinimegoogle.sh
Created December 21, 2017 11:12
OTA survival script for AOSP keyboard swipe (LatinME)
#!/sbin/sh
#
# /system/addon.d/95-latinimegoogle.sh
# During an OS upgrade, this script backs up /system/lib/libjni_latinimegoogle.so,
# /system is formatted and reinstalled, then the file is restored.
#
. /tmp/backuptool.functions
list_files() {
@rugk
rugk / Notrufnummern.vcf
Last active February 14, 2023 08:27
Deutsche Notrufnummern als VCARD zum Importieren in die Kontakte
BEGIN:VCARD
VERSION:3.0
PRODID:-//Sabre//Sabre VObject 4.4.1//EN
UID:020b3274-6fb5-4997-887a-2a22cb93c4f2
REV;VALUE=DATE-AND-OR-TIME:20200318T210544Z
FN:Polizei (Deutschland)
ADR;TYPE=HOME:;;;;;;
EMAIL;TYPE=HOME:
TEL;TYPE=VOICE:110
CATEGORIES:Notrufnummern
@rugk
rugk / attackRedirect.html
Created February 10, 2020 16:18
iFrame messaging vulnerabilities in Riot.im, see https://github.com/vector-im/riot-web/issues/6173
<html>
<head>
<script>
// get when tab is switched
(function() {
var hidden = "hidden";
// Standards:
if (hidden in document)
document.addEventListener("visibilitychange", onchange);
@rugk
rugk / emojicoun.md
Created June 3, 2019 19:42
only missing
Country Users % of Total
Germany 1700 31.1%
United States 613 11.2%
France 427 7.8%
United Kingdom 303 5.5%
Italy 227 4.2%
Australia 134 2.5%
Poland 129 2.4%
@rugk
rugk / playground.ftl
Last active January 19, 2019 22:20
OSM "level" translation in fluent with alternative versions when travelling in foreign countries
### input data: ground floor = level 0
### for OSM "level" tag, see https://wiki.openstreetmap.org/wiki/Key:level
### KNOWN BUGS:
### 1. I cannot remove the minus (-) sign from negative levels. See https://github.com/projectfluent/fluent/issues/228
### 2. I cannot properly calculate +1 for the US style. See https://github.com/projectfluent/fluent/issues/227
## SYNTAX: floor_<userlanguage>_<country-travelling-to>
## i.e. e.g. floor_DE_EUROP = German-speaking user travelling to Germany (or any other country with basement=level 0)
@rugk
rugk / playground.ftl
Created January 19, 2019 19:38
OSM "level" translation in fluent
### input data: ground floor = level 0
### for OSM "level" tag, see https://wiki.openstreetmap.org/wiki/Key:level
### KNOWN BUGS:
### 1. I cannot remove the minus (-) sign from negative levels. See https://github.com/projectfluent/fluent/issues/228
### 2. I cannot properly calculate +1 for the US style. See https://github.com/projectfluent/fluent/issues/227
## Style, where floor = level 0 = input data
@rugk
rugk / instructions.md
Created January 1, 2019 18:41
old manual notification zenity proxy method for borbbackup-cron-helper
  1. In the borg script you need to set, at least:

    # variable from user where notification should be shown, is usually static
    DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus

    If it does not work, you may need to set export DISPLAY=:0.

  2. In some cases (e.g. when using Wayland) you may additionally need to allow the user to access your Xorg server. Note that only root should be allowed to do that or a user, who is really only running borg. As the user where the notification should be shown execute: xhost +SI:localuser:<user running borg> This has to be done at each login, as the setting does not persist.

@rugk
rugk / README.md
Created June 16, 2016 20:31
Create Link headers for HTTP/2 Server push

This script creates headers of all files in a given directory to use them for HTTP/2 server push.

Usage: linkheader.sh /mydir