- (Setup-dependent) Run
blkdiscard
ornvme format -s [1/2] -r
(followed byblkdiscard
) for the disk. - EFI:
- Size: 100MiB
- Type: EF00 (EFI System Partition) (Type may be optional depending on modern UEFI firmware)
- MSR (Microsoft Reserved):
- Size: 16MiB
- Type: 0C01 (Microsoft Reserved Partition)
- Always discard/zero the MSR after creation.
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 bash | |
set -e | |
file=$2 | |
if [ ! -f "$file" ]; then | |
echo "File '$file' not found" | |
exit 1 | |
fi | |
secret="2EB38F7EC41D4B8E1422805BCD5F740BC3B95BE163E39D67579EB344427F7836" |
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
# Usage ./python3 cfgdumpparse.py mydumpedconfig.txt | |
# Warning: This is not a "end user" tool. | |
# Warning: Verify output by hand, it may include unwanted values. | |
# Warning: This tool may produce an incorrect config that can brick your device. | |
import re | |
import sys | |
try: | |
file = sys.argv[1] | |
with open(file, 'r') as cfg_file: |
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
[Unit] | |
Description=Battery Level Notifier | |
[Service] | |
Environment=BATT_PATH=/sys/class/power_supply/BAT1/capacity | |
Environment=MIN_BATT_PCT=35 | |
Environment=BATT_REFRESH_SECS=5 | |
ExecStart=bash -c 'set -e; snooze=false; while true; do [ "$(cat "${BATT_PATH}")" -le "${MIN_BATT_PCT}" ] && [ "$snooze" != "true" ] && { notify-send --urgency=critical "Battery is at or below ${MIN_BATT_PCT}%"; snooze=true; }; [ "$(cat "${BATT_PATH}")" -gt "${MIN_BATT_PCT}" ] && [ "$snooze" == "true" ] && snooze=false; sleep "${BATT_REFRESH_SECS}"; done' | |
Restart=always |
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
// Bookmarklet will fullscreen the video and fill the screen | |
// Might not work on Chromium derivatives, probably same issue: https://github.com/dvlden/ultrawideo/issues/94 | |
// One line | |
javascript:(function(){var e=document.querySelector(".ytp-fullscreen-button");if(e){e.click();setTimeout(function(){var e=document.querySelector("video");if(e){e.style.width="100vw",e.style.height="100vh",e.style.left="0px",e.style.top="0px"}},250)}})(); | |
//Pretty + Comments | |
javascript:(function(){ | |
// Find the fullscreen button element | |
var fullscreenButton = document.querySelector(".ytp-fullscreen-button"); |
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 bash | |
if [ "$EUID" != '0' ]; then | |
echo "This script must be run as root" | |
exit 1 | |
fi | |
# Or just run the parts below in the terminal as root! | |
mkdir -p '/var/lib/sd-battmgr/' | |
echo "Downloading script" |
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 bash | |
set -e | |
# --- Preamble --- | |
# username will be pulled from arguments | |
program_name="battery-notify" | |
sourceloc_script="./$program_name.sh" |
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 bash | |
wgcmd="wg" | |
if command -v qrencode >/dev/null 2>&1; then | |
generate_qr="true" | |
else | |
generate_qr="false" | |
fi | |
echo "WireGuard configuration file generator" | |
echo "======================================" |
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 bash | |
set -e # Exit on error | |
if [ "$EUID" -ne 0 ]; then | |
echo "To ensure correct permissions, this script must be run as root." | |
exit 1 | |
fi | |
install_location="/var/lib/safing-portmaster" # Must not include trailing slash |
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
# Script to automatically remove and install "appleprecisiontrackpadbluetooth.inf" and "appleprecisiontrackpadusb.inf". | |
# Script needs to be in an extracted "AppleBcUpdate" folder. | |
function remove_driver { | |
$driver_orignames = @("appleprecisiontrackpadbluetooth.inf", "appleprecisiontrackpadusb.inf") | |
# Get matching installed drivers with pnputil and include previous line (the published name) | |
$drivers = pnputil /enum-drivers | Select-String -Pattern $driver_orignames -Context 1,0 | |
if ($drivers.Count -gt 2) { | |
Write-Host "Error: More than 2 drivers found." |
NewerOlder