Skip to content

Instantly share code, notes, and snippets.

@HackingGate
HackingGate / keybindings.json
Last active June 1, 2025 02:46
Emacs-style keymap for VSCode with memory hints (mnemonics)
[
/* 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
@HackingGate
HackingGate / fedora-setup.sh
Last active June 3, 2025 01:00
My Fedora Desktop Setup
#!/bin/bash
set -e
set -o pipefail
# Set system timezone to Tokyo, Japan
sudo timedatectl set-timezone Asia/Tokyo
# Configure hardware clock to use UTC (recommended for Linux)
sudo timedatectl set-local-rtc 0
@HackingGate
HackingGate / enable-secureboot-shim.sh
Last active April 29, 2025 01:46
Script to install Ubuntu Secure Boot shim and optionally install and deploy rEFInd
#!/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
@HackingGate
HackingGate / set-windows-rtc-to-utc.ps1
Created April 23, 2025 14:39
PowerShell Script to Set Windows RTC to UTC
<#
.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.
@HackingGate
HackingGate / cleanup-emacs-backups.sh
Created April 21, 2025 12:49
Recursively find and delete all Emacs backup files (ending in '~') in the given directory (defaults to current directory).
#!/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:
@HackingGate
HackingGate / setup-power-lock.sh
Last active April 21, 2025 12:44
Installs and configures acpid to lock the session on a short power‑button press (Ubuntu 24.04).
#!/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
#!/usr/bin/env bash
set -euo pipefail
CFG="/boot/grub/grub.cfg"
# 1) Read every top‑level menuentry title (handles leading whitespace & both quote styles)
mapfile -t ENTRIES < <(
grep -E "^[[:space:]]*menuentry [\"'].*[\"']" "$CFG" \
| sed -E "s/^[[:space:]]*menuentry [\"']([^\"']+)[\"'].*/\1/"
)
@HackingGate
HackingGate / adb-dns.bat
Created September 19, 2023 11:48 — forked from sharunkumar/adb-dns.bat
Enabling / Disabling private DNS in android via ADB
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

Sources I receive information

A list of my sources

General

General news list

Global

@HackingGate
HackingGate / ubuntu-desktop-setup.sh
Last active May 31, 2025 09:03
My Ubuntu Desktop Setup
#!/bin/bash
set -e
set -o pipefail
# Install 1Password password manager
sudo apt update && sudo apt install 1password -y
# Install vanilla GNOME desktop environment (without Ubuntu modifications)
sudo apt purge pipewire-alsa pipewire-audio -y
sudo apt install vanilla-gnome-desktop vanilla-gnome-default-settings -y