Skip to content

Instantly share code, notes, and snippets.

View Aldaviva's full-sized avatar
🆒
This user is COOL

Ben Hutchison Aldaviva

🆒
This user is COOL
View GitHub Profile
@Aldaviva
Aldaviva / Useful programs.md
Last active April 5, 2023 08:46
Applications and extensions that are handy to install in different operating systems and browsers

Windows

Program Category Notes
7+ Taskbar Tweaker Tweaking Adjust taskbar behavior.
AltSnap Window management Easily move windows with mouse.
Autoruns Startup management Turn off startup processes.
CCleaner System cleanup Upsells are a little annoying.
dBpoweramp Audio encoder Transcode music batches in parallel.
DisplayFusion Tweaking Plethora of multi-monitor, desktop, and shell tweaks.
Driver Store Explorer System cleanup Uninstall unused drivers.
@Aldaviva
Aldaviva / Disable programs from reopening.md
Last active June 24, 2020 14:55
Disable Windows 10 or Server ≥ 2016 from reopening programs on startup or reboot.

Usage

  1. Save the disable-program-reopen.ps1 file below to a directory on your computer, such as %SYSTEMROOT%\System32\GroupPolicy\User\Scripts\Logon.
  2. Allow unsigned local PowerShell scripts to run on your computer.
    1. Open PowerShell as an administrator.
    2. Run the following command and answer Y when it prompts you.
      Set-ExecutionPolicy RemoteSigned
  3. Set a Group Policy to run this script when users log on.
  4. Open the Local Group Policy Editor (gpedit.msc, or search for Group Policy in the Start Menu).
@Aldaviva
Aldaviva / Enable OpenSSH SSH server in Windows Server 2019.md
Last active April 17, 2024 06:52
OpenSSH sshd is sort of straightforward, and better than Cygwin.

Assumptions

  • Your server is running Windows Server 2019.
  • Your client is using PuTTY or OpenSSH Client, and you know how to connect to servers and set private keys.
  • Your server user is an administrator.

Steps

  1. Install the OpenSSH Server feature.
    1. Go to Settings › Apps › Apps & features › Manage optional features.
    2. Select + Add a feature.
    3. Select OpenSSH Server, then select Install.
@Aldaviva
Aldaviva / Windows 10 & 11 services.md
Last active August 5, 2026 14:27
Safety of disabling services in Windows 10 and 11

These settings apply to normal, functioning Windows 10 and 11 Pro desktops and laptops with

  • wired Ethernet
  • Wi-Fi
  • Bluetooth
  • IPv4
  • IPv6
  • no touch screen

Safe to disable

@Aldaviva
Aldaviva / Uninstall AppX.md
Last active April 4, 2026 18:43
Uninstall built-in Windows 10-11 immersive apps

List AppX apps

Current user

Get-AppxPackage | where NonRemovable -eq $false | sort Name | ft Name, PackageFullName

Computer

Get-AppxPackage -AllUsers | where { $_.NonRemovable -eq $false -and $_.InstallLocation -ne $null} | sort Name | ft Name, PackageFullName
@Aldaviva
Aldaviva / NTLM in Apache httpd.md
Last active October 7, 2021 07:53
NTLM in Apache httpd
@Aldaviva
Aldaviva / Electrical connectors.md
Last active April 7, 2026 23:04
US electrical/power cable connectors/plugs/sockets/jacks

US electrical/power cable connectors/plugs/sockets/jacks

Picture Name Contact
type
Housing
type
Amperage
rating
NEMA 1-15-P Prongs Plug 15A
NEMA 1-15-R Receptacles Socket 15A
NEMA 5-15-P Prongs Plug 15A
NEMA 5-15-R Receptacles Socket 15A
Molex 8981 Receptacles Plug 11A/pin
Molex 8981 Prongs Socket 11A/pin
@Aldaviva
Aldaviva / Retrospect.md
Last active May 14, 2022 03:27
Retrospect is annoying, slow, and broken, but I know how to use it

Extract backed-up registry to files, not to a live system

  1. Restore
  2. Advanced Mode
  3. Restore an entire volume
  4. Pick the Source snapshot and wait for it to finish matching
  5. For the Destination, pick any drive (it won't be overwritten) and create a new Subvolume in it (it's just a new subdirectory which will contain the restored files)
  6. Change the restore method to Restore Missing Files Only
  7. In Files Chosen, deselect the root drive so that there are 0 files chosen
  8. In Options → More Choices → Windows → System, ensure Restore System State is checked. I also disabled Restore Security Information because registry hive files have very restrictive permissions by default, which makes them harder to work with while restoring.
  9. Restore
import xapi from 'xapi';
const cameraBrightnessCheckboxWidgetId = "camera_brightness_checkbox";
const brightnessModeConfiguration = xapi.Config.Cameras.Camera["1"].Brightness.Mode;
brightnessModeConfiguration.on(renderBrightnessCheckbox);
render();
async function render(){
return renderBrightnessCheckbox(await brightnessModeConfiguration.get());
@Aldaviva
Aldaviva / lines-of-code.sh
Created January 18, 2023 09:36
Count non-whitespace lines of code in a directory
grep --include '*.js' --recursive --invert-match --line-regexp --count --exclude-dir='lib' --exclude-dir='thirdparty' --exclude-dir='vendor' '\s*' . | awk -F : '{ sum += $2 } END { print sum }'