Skip to content

Instantly share code, notes, and snippets.

View satmandu's full-sized avatar

Satadru Pramanik, DO, MPH, MEng satmandu

View GitHub Profile
#!/bin/bash
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
SESSION_TYPE=remote/ssh
elif pstree -p | egrep --quiet --extended-regexp ".*sshd.*\($$\)"; then
SESSION_TYPE=remote/ssh
else
case $(ps -o comm= -p $PPID) in
sshd|*/sshd) SESSION_TYPE=remote/ssh;;
esac
fi
@satmandu
satmandu / raspios.sh
Last active December 15, 2023 07:27
Generate Raspberry Pi OS Docker Images
#!/bin/bash
# raspios.sh
# Usage:
# REPOSITORY=YOUR_DOCKER_HUB_REPOSITORY_type raspios image_file_url debian_release type date ARCH
# or if img already exists this works too:
# raspios.sh dummy debian_release type date ARCH
# (Default is not to delete the image after download.)
# e.g.
# Example for arm64:
# ./raspios.sh https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2023-12-06/2023-12-05-raspios-bookworm-arm64-lite.img.xz bookworm lite 2023-12-06 arm64