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
[Interface] | |
Address = 10.0.0.1/24 | |
PrivateKey = | |
ListenPort = | |
PreUp = iptables -w -P FORWARD DROP; iptables -w -A FORWARD -i %i -o %i -j ACCEPT; echo 1 > /proc/sys/net/ipv4/ip_forward | |
PostDown = echo 0 > /proc/sys/net/ipv4/ip_forward; iptables -w -D FORWARD -i %i -o %i -j ACCEPT; iptables -w -P FORWARD ACCEPT | |
[Peer] | |
PublicKey = | |
PresharedKey = |
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 "appleprecisiontrackpadbluetooth.inf" and "appleprecisiontrackpadusb.inf". | |
# Get installed drivers with pnputil and include previous line (the published name) | |
$drivers = (pnputil /enum-drivers | Select-String -Pattern "appleprecisiontrackpadbluetooth.inf|appleprecisiontrackpadusb.inf" -Context 1,0) | |
# Sanity check the results | |
switch ($drivers.Count) { | |
0 {Write-Host "No drivers found, exiting"; pause; exit} | |
1 {Write-Host "Only one driver found, are you sure you want to continue?"; Read-Host "Press any key to continue, or Ctrl+C to abort"; Write-Host "Continuing"} | |
2 {Write-Host "Two drivers found, continuing"} |
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." |
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
#!/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 | |
# --- 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 | |
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
// 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
[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
# 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: |
OlderNewer