Skip to content

Instantly share code, notes, and snippets.

@kairusds
kairusds / compile-android.sh
Created August 1, 2021 00:10
Compile ffmpeg for Android with support for MP3, OGG & WAv
#!/bin/bash
if [ -z "$ANDROID_NDK" ]; then
echo "Please set ANDROID_NDK to the Android NDK folder"
exit 1
fi
#Change to your local machine's architecture
HOST_OS_ARCH=linux-x86_64
function configure_ffmpeg {
@kairusds
kairusds / fullscreen-landscape.user.js
Created August 5, 2021 23:11
Fix fullscreen orientation on Chrome mobile
// ==UserScript==
// @name Fullscreen Landscape
// @namespace https://kairusds.js.org/
// @version 0.1
// @description Fix Chrome mobile fullscreen orientation
// @author kairusds
// @match http://*/*
// @match https://*/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
@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"
@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 / 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 / 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 / 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 / 1-termux-adb.md
Last active April 12, 2025 13: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 localhost:port
@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_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"