Skip to content

Instantly share code, notes, and snippets.

@kenny-kvibe
kenny-kvibe / find_changed_files.py
Created May 5, 2025 15:33
Search & print different files from 2 or more directories based on sha256 checksum
import hashlib
import json
import os
TARGET_DIRS_PATH = [] # <-- Find in these directories
def walk_directory(dir_path: str, exclude_names: tuple[str, ...] | list[str] | None = None) -> list[str]:
file_paths = []
@kenny-kvibe
kenny-kvibe / windows_copy_image.py
Last active May 24, 2025 15:29
Copy "image" or "text" to Windows system clipboard
import io
import win32clipboard
import PIL.Image as Image
def copy_to_clipboard(data: str | Image.Image) -> None:
""" Copy `data` as "image/bmp" or "text/plain" to system clipboard """
if isinstance(data, Image.Image):
fmt = win32clipboard.CF_DIB
with io.BytesIO() as stream:
@kenny-kvibe
kenny-kvibe / Create-ShimLink.ps1
Last active November 24, 2023 10:56
PowerShell: Shim-Link & Sym-Link
@kenny-kvibe
kenny-kvibe / Restart_Explorer.cmd
Last active May 20, 2023 10:34
Restart "explorer.exe" & clean the Icon cache, Thumbnail cache & Recycle bin
@ECHO OFF
SETLOCAL
GOTO :MAIN
:SLEEP Function
"%WINDIR%\System32\timeout.exe" %1 1>NUL 2>&1
GOTO :EOF
REM =============================================================
@kenny-kvibe
kenny-kvibe / Change_CMD-BAT-REG_Edit_to_Sublime-Text.reg
Last active May 20, 2023 08:21
Change the "Edit" context item (in Explorer right-click menu) to open the selected file using Sublime Text.
Windows Registry Editor Version 5.00
#################################################################
; Change the "Edit" context item (in Explorer right-click menu)
; to open the selected file using Sublime Text,
; optional comments for '*.txt' files and the ST icon.
#################################################################
#=== HKCR\batfile
@kenny-kvibe
kenny-kvibe / ansi_colors.sh
Last active February 23, 2024 13:44
ANSI color codes
#!/bin/bash
# ansi_colors.sh
#
# Wiki (ANSI CSI) https://en.wikipedia.org/wiki/ANSI_escape_code#CSI_(Control_Sequence_Introducer)_sequences
# Wiki (ANSI SGR) https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters
# Parameter 030-03F (0x30–0x3F) (ASCII 0–9:;<=>?)
# Intermediate 020-02F (0x20–0x2F) (ASCII space and !"#$%&'()*+,-./)
# Final 040-07E (0x40–0x7E) (ASCII @A–Z[\]^_`a–z{|}~)
#
# _______________________________________________________________
@kenny-kvibe
kenny-kvibe / figlet_install_fonts.sh
Last active April 3, 2025 06:09
Install "figlet" & download figlet fonts
#!/bin/bash
########
#
# Install "figlet" package
# & Download figlet fonts
# (running as root)
#
# + Github Repositories:
#--> https://github.com/xero/figlet-fonts
#--> https://github.com/phracker/figlet-fonts