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/sh | |
# ============================================================================= | |
# OpenWrt Root Filesystem Expander | |
# | |
# This script automates resizing the main data partition and filesystem | |
# on an OpenWrt device to use all available eMMC/SD card space. | |
# | |
# It now auto-detects the correct start sector and the correct device | |
# to target for filesystem resizing (e.g., /dev/loop0). |
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/sh | |
# OpenWrt v6plus Setup Script | |
# Slightly modified from: https://qiita.com/site_u/items/24bc0823986784cfb96c | |
# This script automates the configuration of MAP-E for v6plus on OpenWrt. | |
echo "--- [Step 1/5] Configuring IPv6 network device ---" | |
# Add a new network device for IPv6 | |
uci add network device >/dev/null 2>&1 | |
uci set network.@device[-1].name='lan1' |
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
[ | |
/* 0. UNBIND VS Code defaults that clash (→ new Emacs-style key) */ | |
{ "key": "ctrl+f", "command": "-actions.find" }, // C-s/C-r = isearch-forward/backward | |
{ "key": "ctrl+s", "command": "-workbench.action.files.save" }, // C-x C-s = save-buffer | |
{ "key": "ctrl+v", "command": "-editor.action.clipboardPasteAction" }, // C-y = yank (paste) | |
{ "key": "ctrl+y", "command": "-redo" }, // C-/ = undo, C-? = redo | |
{ "key": "ctrl+p", "command": "-workbench.action.quickOpen" }, // C-x C-f = find-file | |
{ "key": "ctrl+n", "command": "-workbench.action.files.newUntitledFile" }, // C-x C-n = new-file | |
{ "key": "ctrl+a", "command": "-editor.action.selectAll" }, // C-x h = mark-whole-buffer | |
{ "key": "ctrl+e", "command": "-workbench.action.files.saveAs" }, // C-x C-w = write-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
#!/bin/bash | |
set -e | |
set -o pipefail | |
# Disable GDM auto suspend | |
sudo -u gdm dbus-run-session gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing' | |
sudo -u gdm dbus-run-session gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0 | |
# revert it | |
#sudo -u gdm dbus-run-session gsettings reset org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type | |
#sudo -u gdm dbus-run-session gsettings reset org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout |
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 -euo pipefail | |
# Script to install Ubuntu Secure Boot shim and optionally install and deploy rEFInd | |
# Usage: share this on GitHub Gist, then run: | |
# curl -sL <gist-url> | bash | |
# 1. Update package lists | |
echo "Updating package lists..." | |
sudo apt update |
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
<# | |
.SYNOPSIS | |
Configures Windows to interpret the hardware clock (RTC) as Coordinated Universal Time (UTC). | |
.DESCRIPTION | |
This script adds or updates the 'RealTimeIsUniversal' DWORD value in the Windows Registry | |
at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation. | |
Setting this value to 1 tells Windows to treat the hardware clock as UTC, | |
aligning its behavior with most Linux distributions (like Ubuntu) and resolving | |
time discrepancies in dual-boot environments. |
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 -euo pipefail | |
# ----------------------------------------------------------------------------- | |
# cleanup-emacs-backups.sh | |
# | |
# Recursively find and delete all Emacs backup files (ending in '~') in | |
# the given directory (defaults to current directory). | |
# | |
# Usage: |
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 -euo pipefail | |
# 1) Install acpid if missing | |
if ! dpkg -s acpid >/dev/null 2>&1; then | |
apt-get update | |
DEBIAN_FRONTEND=noninteractive apt-get install -y acpid | |
fi | |
# 2) Enable/start it if needed |
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 -euo pipefail | |
# Check if running as root, if not, re-run with sudo | |
if [ "$EUID" -ne 0 ]; then | |
echo "This script needs to read grub.cfg and modify boot settings." | |
echo "Re-running with sudo..." | |
exec sudo "$0" "$@" | |
fi |
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
rem to disable private dns | |
adb shell settings put global private_dns_mode off | |
rem to enable private dns with hostname (example with dns.adguard.com) | |
adb shell settings put global private_dns_mode hostname | |
adb shell settings put global private_dns_specifier dns.adguard.com |
NewerOlder