Skip to content

Instantly share code, notes, and snippets.

@psiborg
psiborg / README.md
Last active April 1, 2025 15:39
Windows Terminal

Color Schemes

Ubuntu

Color RGB Item RGB
Black ${\textsf{\textcolor[RGB]{118, 118, 118}{■}}}$ #767676 Foreground ${\textsf{\textcolor[RGB]{255, 255, 255}{■}}}$ #FFFFFF
Red ${\textsf{\textcolor[RGB]{192, 28, 40}{■}}}$ #C01C28 Background ${\textsf{\textcolor[RGB]{48, 10, 36}{■}}}$ #300A24
Green ${\textsf{\textcolor[RGB]{38, 162, 105}{■}}}$ #26A269 Cursor color ${\textsf{\textcolor[RGB]{255, 255, 255}{■}}}$ #FFFFFF
Yellow ${\textsf{\textcolor[RGB]{162, 115, 76}{■}}}$ #A2734C Selection background ${\textsf{\textcolor[RGB]{255, 255, 255}{■}}}$ #FFFFFF
@psiborg
psiborg / README.md
Created April 1, 2025 04:32
Make Windows 11 Always Show More Options

By default, Windows 11 shows a simplified right-click context menu, and you have to click "Show more options" (or press Shift + F10) to access the full legacy menu. You can make Windows 11 always show the full context menu by following these steps:

  1. Run the following command in Command Prompt (Admin):
reg add "HKEY_CURRENT_USER\Software\Classes\CLSID\{86CA1AA0-34AA-4E8B-A509-50C905BAE2A2}\InprocServer32" /f /ve
  1. Restart Windows Explorer by running:
@psiborg
psiborg / distro_checker.sh
Last active February 15, 2025 06:01
Linux Distro Checker
#!/bin/bash
# Log and data files
LOG_FILE="distro_checker.log"
DATA_FILE="distro_versions.txt"
# Source the external distro configuration file
source "./distro_checker_config.sh"
# Function to fetch and extract version information
@psiborg
psiborg / README.md
Last active January 7, 2025 02:59
Huffman compression

Huffman Coding (Variable-Length Encoding)

Huffman coding is a lossless data compression algorithm that assigns shorter binary codes to more frequent characters and longer codes to less frequent characters. This minimizes the overall size of encoded data while ensuring perfect decompression.

How Huffman Coding Works

  1. Analyze Character Frequencies
    • Count how often each character appears in the text.
  2. Build a Huffman Tree
  • Create a binary tree where characters with lower frequency are placed deeper.
@psiborg
psiborg / ren_booklists.ps1
Created January 7, 2025 02:13
Rename all booklist to _booklist_
# Define the target directory
$targetDirectory = "C:\Path\To\Your\Directory"
# Initialize counters for each file type
$counterPDF = 0
$counterTXT = 0
# Process both "booklist.pdf" and "booklist.txt"
foreach ($fileType in @("booklist.pdf", "booklist.txt")) {
Get-ChildItem -Path $targetDirectory -Recurse -Filter $fileType | ForEach-Object {
@psiborg
psiborg / rename_photos.bat
Created December 28, 2024 22:02
Drag-and-drop files from Windows Explorer on to this batch script to rename photos using EXIF data
@echo off
C:\Users\jing\anaconda3\python.exe "C:\Users\jing\AppData\Local\Microsoft\WindowsApps\rename_photos.py" %*
pause
@psiborg
psiborg / rename_file.bat
Last active December 18, 2024 18:06
Drag-and-drop files from Windows Explorer on to this batch script to rename them
@echo off
:: Script to rename files: lowercase and replace spaces with underscores
setlocal enabledelayedexpansion
:: Check if any files were passed
if "%~1"=="" (
echo Usage: Drag and drop files onto this script to rename them.
echo The script will rename files to lowercase and replace spaces with underscores.
pause
exit /b
@psiborg
psiborg / jumpstart.md
Last active November 19, 2024 21:23
Flowchart to jump start a car battery
flowchart TD
    A[Locate Both Cars] --> B[Position Cars Close]
    B --> C[Turn Off Both Cars]
    C --> D[Connect Red Jumper Cable to Dead Battery's Positive Terminal]
    D --> E[Connect Red Jumper Cable to Good Battery's Positive Terminal]
    E --> F[Connect Black Jumper Cable to Good Battery's Negative Terminal]
    F --> G[Connect Black Jumper Cable to Metal Surface on Dead Car]
 G --> H[Start Good Car]
@psiborg
psiborg / clean-tags.sh
Last active November 21, 2024 03:50
Clean FLAC and MP3 tags
#!/usr/bin/env bash
# ============================================================================
# clean-tags.sh
#
# Author: Jim Ing
# Date: 2024-11-19
#
# Description: This script processes audio files (.mp3 and .flac) to remove
# specified metadata tags, displays metadata before and after
# cleaning, and saves the cleaned files in a designated output
@psiborg
psiborg / BGInfo.md
Last active January 22, 2025 01:08
Custom settings and scripts for Sysinternal's BGInfo

BGInfo

%USERPROFILE%\Portable\Sysinternals\BGInfo\Bginfo64.exe .\Configs\BGInfo.bgi /timer:60

%USERPROFILE%\Portable\Sysinternals\BGInfo\Bginfo64.exe .\Configs\BGInfo.bgi /popup /taskbar