Skip to content

Instantly share code, notes, and snippets.

@singh-inder
singh-inder / get-latest-version-dockerhub.sh
Created April 1, 2025 05:25 — forked from itaysk/get-latest-version-dockerhub.sh
Get latest (highest) version of a Docker Hub image
curl -L --fail "https://hub.docker.com/v2/repositories/${DOCKERHUB_REPO}/${DOCKERHUB_IMAGE}/tags/?page_size=1000" | \
jq '.results | .[] | .name' -r | \
sed 's/latest//' | \
sort --version-sort | \
tail -n 1
<!DOCTYPE html>
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
>
<head>
<title> </title>
<!--[if !mso]><!-- -->
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
@singh-inder
singh-inder / compress_video
Created August 22, 2024 09:42 — forked from trvswgnr/compress_video
portable shell script to compress videos with ffmpeg
#!/bin/sh
print_usage() {
echo "usage: compress_video <input_file>"
echo "supported formats: mp4, webm, mkv, mov, avi, flv"
}
get_extension() {
f="${1##*/}"
case "$f" in
@singh-inder
singh-inder / active-window.go
Created July 11, 2024 13:38 — forked from obonyojimmy/active-window.go
Go lang get current foreground window
package main
import (
"fmt"
"syscall"
"unsafe"
"golang.org/x/sys/windows"
)
var (