Skip to content

Instantly share code, notes, and snippets.

@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 March 24, 2023 17:24
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 ipaddr: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
@kairusds
kairusds / charmax.txt
Last active August 4, 2022 01:51
Commands for Grasscutter
/talent n 10
/talent e 10
/talent q 10
/stat lock cdr 1
/stat lock atk 9999999
/stat lock crate 1
/stat lock cdmg 9999999
/stat lock eanemo 1
/stat lock ecryo 1
/stat lock edend 1
@kairusds
kairusds / clone_from_txt.sh
Last active November 2, 2021 03:47
Creates empty files/clone files from an ls output. https://unix.stackexchange.com/a/456636/499476
for file in $(<files.txt); do cp file_clone_source "$file"; done
@kairusds
kairusds / audnorm.sh
Last active September 3, 2021 19:37
my script for normalizing the volume of audio files
#!/bin/sh
if [ $# -eq 0 ]; then
echo "Usage: audnorm <path>"
exit 1
fi
out="${1%.*}.normalized.mp3"
ffmpeg -i "$1" -ab 192k -af "volume=6.0dB" "$out"