Skip to content

Instantly share code, notes, and snippets.

View alexmozaidze's full-sized avatar

Alexei Mozaidze alexmozaidze

View GitHub Profile
@alexmozaidze
alexmozaidze / ffcompress
Created January 26, 2026 17:28
A script for compressing a video to a certain length (usually to 8 MB for Discord)
#!/usr/bin/env bb
;; vim:ft=clojure:
(require '[babashka.deps :as deps])
(deps/add-deps '{:deps {cli-matic/cli-matic {:mvn/version "0.5.2"}}})
(require '[clojure.string :as string])
(require '[cli-matic.core :refer [run-cmd]])
(require '[babashka.process :as process])
(require '[babashka.fs :as fs])
@alexmozaidze
alexmozaidze / gpu-average-usage
Last active January 24, 2026 08:28
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})}
}