Skip to content

Instantly share code, notes, and snippets.

@kairusds
kairusds / gitsheet.sh
Created June 26, 2025 06:02
Commands I use for Git
# Using HEAD as the commit hash is equal to using the
# latest remote commit's hash.
# Revert file to commit hash or the remote's latest version
# of the file
git checkout HEAD -- filepath/file
git checkout <hash> -- filepath/file
# View the diff for staged files(files used with `git add`)
git diff --staged
@kairusds
kairusds / cs_source_server_2017compat.md
Last active June 7, 2025 21:06
Counter Strike: Source Dedicated Server compatible with the leaked Source Engine 2017 branch

Build leaked Source Engine

# Ubuntu and Debian
sudo apt update
sudo apt upgrade
sudo dpkg --add-architecture i386
sudo apt update 
sudo apt install build-essential gcc-multilib g++-multilib libedit-dev lib32z1-dev lib64z1-dev git libsdl2-dev:i386 libfreetype6-dev:i386 libfontconfig1-dev:i386 libopenal-dev:i386 libjpeg-dev:i386 libpng-dev:i386 libcurl4-gnutls-dev:i386 libbz2-dev:i386 libedit-dev:i386 libopus-dev python3 python-is-python3 python3-venv
@kairusds
kairusds / cs1.6-xash3d-linux-server.md
Last active June 5, 2025 15:25
Setup a dedicated server for Xash3D CS1.6 on Linux

Setup a Dedicated Server for Xash3D-FWGS CS1.6 on Linux

If you need metamod, compile Metamod-R

cd ~

# Install build dependencies on Ubuntu/Debian
sudo dpkg --add-architecture i386
sudo apt-get update
@kairusds
kairusds / remove-aqw-rpc.md
Created January 19, 2024 04:52
Remove Discord Rich Presence from Salsicha / Private AQW servers on PC
  1. Close the private server you're playing on first.
  2. Install the latest release of ffdec for your operating system.
  3. Download the portable launcher (the No Install Required button) for the private AQW of your choice (RedHero, RedAQ, etc.).
  4. Extract the portable launcher's files somewhere.
  5. Open ffdec.
  6. Ignore all the dialogs that will appear at first, then click Open at the top left of the ffdec window.
  7. Find the location of where you extracted the files from step 3 and choose the Desktop.swf file.
  8. Click the + icon on the left of the scripts folder icon from the left side of the screen, and once it's expanded, click the + icon from the left of Device again, and finally click AIRDesktop from the expanded menu.
  9. Click Edit ActionScript on the bottom middle of the screen and press OK.
  10. Replace the code inside of the editor with this code:
@kairusds
kairusds / pimp-yt-player.css
Created December 25, 2023 22:03 — forked from cesalazar/pimp-yt-player.css
Hides some YouTube annoyances, and add some visual tweaking.
/* Rules for Stylus
* https://addons.mozilla.org/en-US/firefox/addon/styl-us/
*/
/* Hide the annoying (i) button on the top-right corner */
.ytp-chrome-top-buttons {
display: none;
}
/* Display the controls and title only on hover */
@kairusds
kairusds / 1_fftrim.md
Last active August 1, 2023 09:15
Trim videos with ffmpeg

Use "hh:mm:ss.mss" as the format for the timestamps if you don't want to enable fix_keyframes so that the trim will be instant. For example:

fftrim video.mp4 "01:00:03.000" "03:00:00.000"
@kairusds
kairusds / custom-key.sh
Created July 4, 2023 13:17
Use different ssh keys for different Git repositories
# Use this inside your project directory
git config core.sshCommand "ssh -i ~/.ssh/userkey"
@kairusds
kairusds / 1-termux-adb.md
Last active June 21, 2025 02:33
Instructions for connecting Termux's android-tools adb to the current device via Wireless debugging and fixing phantom process killing

Install android-tools if you haven't already:

pkg update ; pkg upgrade
pkg install android-tools

adb pair 127.0.0.1:port
@kairusds
kairusds / terraria_decompile.sh
Last active January 3, 2023 08:08
Decompile Terraria's source code on Linux using ILSpy and SteamRE's DepotDownloader
# Get .NET SDK 6.0 for Linux distros (https://learn.microsoft.com/en-us/dotnet/core/install/linux)
# Build ILSpy
git clone --recurse-submodules https://github.com/icsharpcode/ILSpy
dotnet build ILSpy/ILSpy.XPlat.slnf
# For Alpine Linux, replace `.bashrc` with `.profile`
# If you're using a different shell, refer to its documentation.
echo "# ILSpy" >> ~/.bashrc
echo 'export PATH="$PATH:'"$(find $PWD/ILSpy/ICSharpCode.ILSpyCmd/bin/Debug/net* -print -quit)\"" >> ~/.bashrc
@kairusds
kairusds / cmds.sh
Last active September 9, 2022 12:56
Some useful single line linux commands
# Fix date time of files and subdirectories inside the specified directory
find ~/dir -print -exec touch -m {} \;
# Generate a video with a still image and audio
ffmpeg -r 1 -loop 1 -i bg.jpg -i audio.mp3 -c:v libx264 -tune stillimage -c:a copy -pix_fmt yuv420p -shortest still_img_vid.mp4
# Trim videos in hours:minutes:seconds format
ffmpeg -i video.mp4 -ss 00:01:00 -to 00:03:05 -c copy trimmed_video.mp4
# Get ssh public key from a private key