Skip to content

Instantly share code, notes, and snippets.

@sk22
sk22 / lastfm-remove-duplicates.js
Last active January 13, 2024 16:26
Last.fm duplicate scrobble deleter
var elements = Array.from(document.querySelectorAll('.js-link-block'))
elements.map(function (element) {
var nameElement = element.querySelector('.chartlist-name')
return nameElement && nameElement.textContent.replace(/\s+/g, ' ').trim()
}).forEach(function (name, i, names) {
if (name !== names[i + 1]) return
var deleteButton = elements[i].querySelector('[data-ajax-form-sets-state="deleted"]')
if (deleteButton) deleteButton.click()
location.reload()
})
@sk22
sk22 / oebb-db640-codes-2024.csv
Last active July 20, 2023 16:34
DB 640 Betriebsstellen-Codes (laut ÖBB DA 30.04.21). Quelle: ÖBB SNNB 2024, Anhang "Verzeichnis der Verkehrsstationen / Station register": https://infrastruktur.oebb.at/de/geschaeftspartner/schienennetz/snnb/snnb-2024/snnb-2024-anhaenge/verzeichnis-der-verkehrsstationen-excel
Verkehrsstation BST Code
Abfaltersbach Abf H1
Absdorf-Hippersdorf Ah
Achau Ach
Achenlohe Nst H4H
Achleitnersiedlung Puw H1A
Admont Ad
Aich im Jauntal Spa H3
Aich-Assach Grb H2
Aigen-Schlägl Ai
@sk22
sk22 / .bashrc
Created April 19, 2023 18:32
sl alias for ls
# ...
function sl { echo -ne '\033[1A'; echo ${(%%)PS1}ls; ls }
# ...

how to download a video from the orf tvthek

  • open the tvthek page with the video you want to download
  • open the dev tools
    • open the network tab
    • search for 'playlist'
    • open playlist.m3u8, and open the 'response' tab
    • look for the highest given bandwidth (usually at the bottom, e.g. #EXT-X-STREAM-INF:BANDWIDTH=3192000)
    • copy the url below that, open it in a new browser tab and download it (e.g. https://apasfiis.sf.apa.at/ipad/cms-worldwide_abr/.../chunklist.m3u8&ip=...)
  • open bash
@sk22
sk22 / philipp.regex
Created March 11, 2023 20:15
regular expression to find all the phillips
/(ph?|f)(i|e)l(l?i(pp?|b)(e|o)?)?/gi
@sk22
sk22 / chromium-snap-desktop-generator.sh
Last active January 30, 2023 14:09
Generate desktop files based for Web Applications using a Snapcraft installation of Chromium
#!/bin/bash
base="$HOME/snap/chromium/current/.config/chromium/Default/Extensions"
desktops="$HOME/.local/share/applications"
chromium="/snap/bin/chromium"
# ./generator.sh ... Lists all installed Chromium Apps
# ./generator.sh [id] ... Installs Chromium app with given App ID to user applications
if [ $# = 0 ]; then
@sk22
sk22 / telegramcmd.regex
Created August 17, 2016 23:58
Telegram Command Regex: [ command, bot name, args ]
^\/([^@\s]+)@?(?:(\S+)|)\s?([\s\S]*)$
@sk22
sk22 / webcam.desktop
Created July 8, 2022 20:43
Minimal webcam desktop entry opening a borderless MPV window showing your webcam
[Desktop Entry]
Name=Webcam
Exec=mpv /dev/video0 --profile=low-latency --untimed --no-osc --no-border
Icon=cheese
StartupNotify=false
StartupWMClass=mpv
Terminal=false
Type=Application
Categories=AudioVideo;Player;Audio;
@sk22
sk22 / etc_gerbera_config.xml
Last active March 16, 2022 00:28
gerbera as an upnp-av/dlna server for web radio stations with nginx proxying https streams over http :)
<?xml version="1.0" encoding="UTF-8"?>
<config version="2" xmlns="http://mediatomb.cc/config/2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://mediatomb.cc/config/2 http://mediatomb.cc/config/2.xsd">
<!--
See http://gerbera.io or read the docs for more
information on creating and using config.xml configuration files.
-->
<!-- ... -->
<import hidden-files="no">
<scripting script-charset="UTF-8">
<common-script>/usr/share/gerbera/js/common.js</common-script>