Skip to content

Instantly share code, notes, and snippets.

View kntjspr's full-sized avatar
🦉

Kent Jasper Cabunoc Sisi kntjspr

🦉
  • PGP: 8FED 9D2E 4BA4 7F01 5603 0740 980F 354B 5EEF 0B51
View GitHub Profile
@kntjspr
kntjspr / codecs.sh
Last active December 15, 2025 17:16
fedora codecs
# Free and Non-Free repos
sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install ffmpeg gstreamer1-libav gstreamer1-plugins-ugly gstreamer1-plugins-bad-free --allowerasing
@kntjspr
kntjspr / git-setup.sh
Last active December 5, 2025 18:45
Setup git alias to configure git per repo
#!/bin/bash
# --- INSTALL WRAPPER ---
INSTALL_DIR="$HOME/.local/bin"
INSTALL_PATH="$INSTALL_DIR/git-setup"
BASHRC="$HOME/.bashrc"
mkdir -p "$INSTALL_DIR"
if [ "$(basename "$0")" != "git-setup" ]; then
@kntjspr
kntjspr / tmux.md
Last active December 12, 2025 10:03
Multiple workflow with tmux
tmux new -s mysession

run commands inside tmux

detach

Ctrl+B then D

safely close SSH/Putty

Later, reconnect and reattach:

tmux ls
@kntjspr
kntjspr / install.sh
Last active November 3, 2025 11:04
Install linux essentials (Debian)
#!/bin/bash
set -e
# Change this based on your preference
printf '\ncd /mnt/c/Users/user0/Desktop\n' >> ~/.bashrc # Sets terminal on launch to navigate to that directory
echo 'alias desktop="cd /mnt/c/Users/user0/Desktop"' >> ~/.bashrc
echo 'alias py="python3"' >> ~/.bashrc # set alias py to python3
source ~/.bashrc
@kntjspr
kntjspr / PUSH.sh
Last active November 27, 2025 13:35
Copy files to PROD/DEV directory, encrypts and PUSH!!
#!/bin/bash
# THIS SCRIPT IS FOR PUSHINGGGGGGG!!
# ✅PUSHING SCRIPT
# ❌PULL❌
# Fix GPG signing in WSL
export GPG_TTY=$(tty)
# Parse command line arguments
@kntjspr
kntjspr / ssh.md
Created October 21, 2025 06:12
Setup encrypted git remote

⚙️ GOAL

Account Purpose Repo Origin SSH Key GPG Key Encryption
dev Development git@github.com:dev-user/dev-repo.git /root/.ssh/id_dev_ed25519 dev <dev@mail.com> git-remote-gcrypt (Dev GPG)
prod Production git@github.com:prod-user/prod-repo.git /root/.ssh/id_prod_ed25519 prod <other@mail.com> git-remote-gcrypt (Prod GPG)

Everything runs in WSL, keys stored under root, users without root cannot access or push.
The same local repo folder is used for both dev and prod (shared working copy). Dev/prod are not branches but separate configurations (remotes, SSH hosts, GPG keys, and Git identities).
Is this possible? Yes. Git supports multiple remotes in one repo, wi

@kntjspr
kntjspr / deadlock.cpp
Created October 20, 2025 12:12
Deadlock
#include <iostream>
#include <thread>
#include <mutex>
#include <chrono>
std::mutex book1;
std::mutex book2;
void studentA() {
@kntjspr
kntjspr / ssh.md
Last active November 27, 2025 13:36
Add SSH to github

⚙️ GOAL

Account Purpose Repo Origin SSH Key GPG Key Encryption
dev Development git@github.com:dev-user/dev-repo.git /root/.ssh/id_dev_ed25519 dev <kntjspr26@gmail.com> git-crypt (Dev PGP)
prod Production git@github.com:prod-user/prod-repo.git /root/.ssh/id_prod_ed25519 prod <other@mail.com> git-crypt (Prod PGP)

Everything runs in WSL, keys stored under root, users without root cannot access or push.

@kntjspr
kntjspr / execute.bat
Created June 12, 2025 08:58
Convert Donut shellcode (.bin) into escaped raw shellcode in C using a one-liner python script.
py -c "data = open('payload.bin','rb').read(); print('unsigned char shellcode[] = \"' + ''.join(f'\\x{b:02x}' for b in data) + '\";')" > shellcode.c
@kntjspr
kntjspr / hyperv-toggle.bat
Created April 5, 2025 18:07
Hyper-V & Virtualization Toggler – Enables quick toggling of virtualization settings to seamlessly switch between Docker/WSL environments and external Android emulators.
@echo off
:menu
cls
echo ============================================
echo Hyper-V and Virtualization Features Toggler
echo ============================================
echo 1. Disable Hyper-V and related features (for Android emulator)
echo 2. Enable Hyper-V and related features (for Docker, WSL2, etc.)
echo 3. Exit
echo ============================================