Skip to content

Instantly share code, notes, and snippets.

View alexmozaidze's full-sized avatar

Alexei Mozaidze alexmozaidze

View GitHub Profile
@alexmozaidze
alexmozaidze / niri-graceful-shutdown
Last active May 9, 2026 19:00
Niri Graceful Shutdown
#!/usr/bin/env bash
if (( $# == 0 )); then
>&2 echo 'Error: expected arguments'
exit 1
fi
shutdown_timeout_duration=15
keep_names=(
@alexmozaidze
alexmozaidze / bb.edn
Last active May 31, 2026 01:21
A script for compressing a video to a certain length (usually to ~10MB for Discord)
{:deps {cli-matic/cli-matic {:mvn/version "0.5.2"}}}
@alexmozaidze
alexmozaidze / gpu-average-usage
Last active May 31, 2026 02:10
Shell script for checking GPU's average usage
#!/usr/bin/env bash
is_number() {
[[ $1 =~ ^([0-9]+|[0-9]+\.[0-9]*|\.[0-9]+)$ ]]
}
is_integer() {
[[ $1 =~ ^[0-9]+$ ]]
}
// Discovering the path of JVM (if the server's `java` executable isn't the right version)
import java.io.File;
public class HackyLs {
public static void main(String[] args) {
// Input the directory you want to list here
String jvmDirectoryPath = "/opt/";
File jvmDir = new File(jvmDirectoryPath);
@alexmozaidze
alexmozaidze / go.snippets
Last active January 16, 2024 05:44
Go error handling is ez
snippet ife
if err != nil {
${1:panic(${0:err})}
}