Skip to content

Instantly share code, notes, and snippets.

View Alistair1231's full-sized avatar

Alistair1231 Alistair1231

View GitHub Profile
@Alistair1231
Alistair1231 / Youtube on TV.bat
Created October 21, 2024 17:14
Youtube on TV PWA
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"
@Alistair1231
Alistair1231 / run_backup.sh
Last active October 10, 2024 07:06
restic backup script for docker bind mounts
#!/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"
@Alistair1231
Alistair1231 / scrcpy.sh
Last active July 5, 2024 12:28
twitch scrcpy script
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
@Alistair1231
Alistair1231 / whatLevel.ipynb
Created June 15, 2024 20:03
Minecraft, JustEnoughResources / Region Scanner: Parse world-gen file and draw graph of where to find ores
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Alistair1231
Alistair1231 / _moonlight-setup.adoc
Last active May 3, 2024 13:31
Headless Moonlight Streaming PC
:doctype: book
:toc: left
:toclevels: 3
:data-uri:
:icons: font
:source-highlighter: rouge
:source-linenums-option: inline
:icons: font
@Alistair1231
Alistair1231 / crop.ps1
Last active February 22, 2024 16:26
crop video to 16:9 with powershell and ffmpeg
# 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
@Alistair1231
Alistair1231 / set tcpip port in build props on read only system.md
Last active September 20, 2023 20:20
set tcpip port in build props on read only /system
#################
# in 1st terminal
#################
# enable usb debugging and root debugging, if no root debugging available, root device with e.g. magisk, after change remove root again
adb root
adb shell
# look at `mount` and find the read only system partition
mount -o rw,remount /
# or
FROM ubuntu:22.04
RUN apt update && apt install -y sudo wget gnupg2 git
# Add the makedeb repository and install the package
RUN wget -qO - 'https://proget.makedeb.org/debian-feeds/makedeb.pub' | gpg --dearmor | sudo tee /usr/share/keyrings/makedeb-archive-keyring.gpg 1> /dev/null
RUN echo 'deb [signed-by=/usr/share/keyrings/makedeb-archive-keyring.gpg arch=all] https://proget.makedeb.org/ makedeb main' | sudo tee /etc/apt/sources.list.d/makedeb.list
RUN sudo apt update && sudo apt install -y makedeb
# Create the test folder
RUN mkdir /test
@Alistair1231
Alistair1231 / DL_KMS_VL_ALL_AIO.ps1
Last active April 22, 2023 10:55
powershell script to get latest KMS_VL_ALL_AIO version
# ########
# # bash #
# ########
# pattern="KMS_VL_ALL_AIO-.*.7z"
# repo="abbodi1406/KMS_VL_ALL_AIO"
# # remove old files
# rm -f description.txt && rm -f ATLauncher-*.jar
# # get the files
# curl -s "https://api.github.com/repos/$repo/releases/latest" | grep -oP '"browser_download_url":\s*"\K[^"]+' | grep -E "$pattern" | wget -q --show-progress -i -
@Alistair1231
Alistair1231 / get-latest-file.sh
Last active April 22, 2023 10:51
get latest github release using curl on bash (ex. revanced-cli)
# ########
# # bash #
# ########
# pattern="ATLauncher-.*"
# repo="Alistair1231/ATLauncher-Offline"
# # remove old files
# rm -f description.txt && rm -f ATLauncher-*.jar
# # get the files
# curl -s "https://api.github.com/repos/$repo/releases/latest" | grep -oP '"browser_download_url":\s*"\K[^"]+' | grep -E "$pattern" | wget -q --show-progress -i -