This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # /// script | |
| # dependencies = [ | |
| # "requests>=2.31.0", | |
| # "lxml>=4.9.4", | |
| # "pyperclip>=1.8.2", | |
| # ] | |
| # /// | |
| # Inspired by https://maxbarrass.com/blog/2020/04/10/downloading-files-from-rss-with-jdownloader-packegizer%F0%9F%92%BB%F0%9F%92%A5%F0%9F%98%8D | |
| # archive link: https://archive.is/rP7Qg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # code --folder-uri "vscode-remote://ssh-remote+HOSTNAME/path/to/folder" | |
| # code --file-uri "vscode-remote://ssh-remote+HOSTNAME/path/to/workspace.code-workspace" | |
| # e.g. | |
| code --folder-uri "vscode-remote://ssh-remote+nas/mnt/storage/apps" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:(function()%7Bfunction%20findByText(text)%20%7B%0A%20%20let%20entries%20%3D%20new%20Set()%0A%0A%20%20this.forEach((element)%20%3D%3E%20%7B%0A%20%20%20%20if%20(textMatches(element.innerHTML%2C%20text))%20%7B%0A%20%20%20%20%20%20entries.add(element)%0A%20%20%20%20%7D%0A%20%20%7D)%0A%0A%20%20return%20Array.from(entries)%0A%0A%20%20function%20textMatches(content%2C%20searchText)%20%7B%0A%20%20%20%20return%20searchText%20instanceof%20RegExp%0A%20%20%20%20%20%20%3F%20searchText.test(content)%0A%20%20%20%20%20%20%3A%20content.includes(searchText)%0A%20%20%7D%0A%7D%0A%0AObject.defineProperty(Array.prototype%2C%20'findByText'%2C%20%7B%0A%20%20enumerable%3A%20false%2C%0A%20%20writable%3A%20true%2C%0A%20%20value%3A%20findByText%2C%0A%7D)%0AObject.defineProperty(NodeList.prototype%2C%20'findByText'%2C%20%7B%0A%20%20enumerable%3A%20false%2C%0A%20%20writable%3A%20true%2C%0A%20%20value%3A%20findByText%2C%0A%7D)%0A%2F%2F%3F%20%5E%20---%20Find%20by%20text%20---%20%5E%0A%0Aconst%20items%20%3D%20document.querySelecto |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This one-liner revives an old Arch Linux install where `pacman -Syu` is not working by: | |
| # 1. Updating mirror list for DE, AT, CH sorted by rate - ensures access to active and fast mirrors. | |
| # 2. Downloading and running static pacman, initializing and populating pacman keyring - re-establishes basic package management capabilities. | |
| # 3. Updating archlinux-keyring and pacman-contrib - ensures keyring and essential tools are up-to-date. | |
| # 4. Reranking mirror list with the top 5 fastest servers - this is why we needed pacman-contrib. | |
| # 5. Running `sudo pacman -Syu --noconfirm` - brings the system to the latest package versions. | |
| curl -s "https://archlinux.org/mirrorlist/?country=DE&country=AT&country=CH&protocol=https&use_mirror_status=on&sort=rate" | sed -e 's/^#Server/Server/' -e '/^#/d' | sudo tee /etc/pacman.d/mirrorlist && \ | |
| curl -L https://pkgbuild.com/~morganamilo/pacman-static/x86_64/bin/pacman-static -o /tmp/pacman-static && \ | |
| chmod +x /tmp/pacman-static && \ | |
| sudo pacman-key --init && \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| C:\Users\alist\scoop\shims\brave.exe --kiosk --enable-extensions --user-agent="Mozilla/5.0 (PS4; Leanback Shell) Gecko/20100101 Firefox/65.0 LeanbackShell/01.00.01.75 Sony PS4/ (PS4, , no, CH)" "https://www.youtube.com/tv#/?env_forceFullAnimation=true" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # to add this as a cronjob that runs every day at 4:00, run `crontab -e` and add the following line: | |
| # 0 4 * * * /srv/restic/run_backup.sh | |
| RESTIC_PATH="/home/al/.nix-profile/bin/restic" | |
| SCRIPT_DIR="/srv/restic" | |
| LOG_FILE="$SCRIPT_DIR/logs/backup_$(date +%Y%m%d_%H%M%S).log" | |
| ENV_FILE="restic.env" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DEVICE=$(adb devices | sed -n '2 p' | cut -f 1) | |
| # set window title | |
| echo -en "\033]0;SCRCPY\007" | |
| adb -s $DEVICE shell wm size 1080x1920 | |
| # stop twitch from avoiding cutout | |
| adb -s $DEVICE shell cmd overlay enable com.android.internal.display.cutout.emulation.noCutout | |
| adb -s $DEVICE shell cmd overlay enable com.android.internal.display.cutout.emulation.corner | |
| # if device is ip then use 2M bitrate and 200 buffer | |
| if [[ $DEVICE == *:* ]];then |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| :doctype: book | |
| :toc: left | |
| :toclevels: 3 | |
| :data-uri: | |
| :icons: font | |
| :source-highlighter: rouge | |
| :source-linenums-option: inline | |
| :icons: font | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Check if an argument is provided | |
| if ($args.Count -eq 0) { | |
| Write-Host "No video file provided. Usage: .\script.ps1 [video file]" | |
| exit | |
| } | |
| # Assign the first argument as the input file | |
| $inputFile = $args[0] | |
| # Check if the file exists |