Skip to content

Instantly share code, notes, and snippets.

View satmandu's full-sized avatar

Satadru Pramanik, DO, MPH, MEng satmandu

View GitHub Profile
@satmandu
satmandu / presence-automations.yaml
Last active October 2, 2026 00:25 — forked from jamesharding/presence-automations.yaml
Presence automation blueprint for Home Assistant, using binary sensors, media players, etc.
blueprint:
name: Presence Automations
description: >
Presence-based automation system with day/sunset/night lighting scenes, binary
device control, custom script triggers, configurable timeouts, manual override
detection, and occupancy tracking.
Supports motion sensors (bursty), media players, door sensors, and static presence indicators.
Uses rising-edge detection: lights, devices, and scripts only activate at the moment
@satmandu
satmandu / GUIDE.md
Last active April 4, 2026 19:21 — forked from CappyT/GUIDE.md
Hassio Unifi Network Application hotfix

HA OS UniFi Add-on - Temporary Hotfix (CVE-2026-22557 & CVE-2026-22558)

This is a quick image-cache hijacking workaround to patch the local container without migrating volumes or waiting for the upstream release. It restores the s6-overlay entrypoint correctly so the add-on boots normally.

The Supervisor will automatically wipe this custom image and pull the official one once the maintainers release the patched update.

Prerequisites:

1. SSH access to the HA OS host on port 22222. (refer to the docs https://developers.home-assistant.io/docs/operating-system/debugging/#enabling-ssh-access-to-the-host )

@satmandu
satmandu / install_Nvidia_470_driver_on_mbp113.md
Last active November 22, 2025 03:04
Nvidia drivers with Ubuntu 25.04 for MacBookPro11,3 (Mid-2014 15"MBP) on top of kernel 6.14.0-rc4

For anyone trying to get this working on Ubuntu 25.04, I created the necessary deb packages as follows, which works on my MacBookPro11,3:

mkdir -p ~/src/nvidia
cd ~/src/nvidia
curl -Olf http://archive.ubuntu.com/ubuntu/pool/restricted/n/nvidia-graphics-drivers-470/nvidia-graphics-drivers-470_470.256.02.orig-amd64.tar.gz
curl -OLf http://archive.ubuntu.com/ubuntu/pool/restricted/n/nvidia-graphics-drivers-470/nvidia-graphics-drivers-470_470.256.02.orig.tar.gz
git clone https://github.com/canonical/nvidia-graphics-drivers.git
cd nvidia-graphics-drivers
git checkout 470
tar fx nvidia-graphics-drivers-470_470.256.02.orig-amd64.tar.gz
@satmandu
satmandu / raspios.sh
Last active January 21, 2026 00:35
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
#!/bin/bash
# crew-pre-glibc-standalone-alex-i686.m58.sh
if command -v xxd &>/dev/null; then
# See https://stackoverflow.com/a/49903434
CONTAINER_ARGS_INPUT="$@"
if [ -n "$CONTAINER_ARGS_INPUT" ]; then
echo "CONTAINER_ARGS: $@"
CONTAINER_ARGS="$(echo $@ | xxd -ps -c 0 | tr -d '\n')"
# echo "CONTAINER_ARGS_ENCODED: $CONTAINER_ARGS"
@satmandu
satmandu / bounce_ipv6.sh
Created January 17, 2023 23:02
Bounce IPv6 connection if router is up but IPv6 connectivity is down, and check the connection every 30 seconds.
#!/bin/bash
# Put this script into your crontab e.g.
# @reboot ~/bin/bounce_ipv6.sh
# Bounce IPv6 connection if router is up but IPv6 connectivity is down,
# and check the connection every 30 seconds.
router_address="192.168.0.1"
ipvsixaddress="2600::"
while true;
do
if ping -c1 $router_address &>/dev/null; then
@satmandu
satmandu / chromeos_docker65
Last active April 21, 2026 21:24
Docker buildx based package builder for Chromebrew on x86_64, i686, & armv7l, generating containier scripts at https://gist.github.com/satmandu/d8365cb70b899901a05290d31c04909a
#!/bin/bash
# chromeos_docker.sh
# Usage:
# REPOSITORY=YOUR_DOCKER_HUB_REPOSITORY_NAME chromeos_docker.sh recovery_file_url container_name chromeos_milestone arch
# or if image.bin already exists this works too:
# chromeos_docker.sh dummy name milestone arch
# (Default is not to delete the image after download.)
# e.g.
# Example for x86_64:
# chromeos_docker.sh https://dl.google.com/dl/edgedl/chromeos/recovery/chromeos_13816.82.0_nocturne_recovery_stable-channel_mp.bin.zip nocturne 90 x86_64
@satmandu
satmandu / google-chrome.desktop
Last active March 3, 2022 16:44
The google-chrome.desktop I use on Ubuntu 22.04 on my MBP11,3. Put in /usr/share/applications/ . Also, I use a patched mesa as per https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5139#note_1279423
[Desktop Entry]
Version=1.0
Name=Google Chrome
# Only KDE 4 seems to use GenericName, so we reuse the KDE strings.
# From Ubuntu's language-pack-kde-XX-base packages, version 9.04-20090413.
GenericName=Web Browser
GenericName[ar]=متصفح الشبكة
GenericName[bg]=Уеб браузър
GenericName[ca]=Navegador web
GenericName[cs]=WWW prohlížeč
@satmandu
satmandu / gist:37ce878ba5c3e002b7cb6c3a47aa598a
Last active September 1, 2025 08:18
Extract macos dmg with pkg inside from Linux (ubuntu 22.04)
# Install build prereqs:
sudo apt-get install build-essential libxml2-dev libssl-dev zlib1g-dev
# You can extract a dmg using 7z thus: 7z x File.dmg
# This installs tools like lsbom to see what is inside bom files
git clone https://github.com/hogliux/bomutils && cd bomutils && make && sudo make install
# Now install xar so you can extract the pkg file
curl -OLf https://opensource.apple.com/tarballs/xar/xar-425.2.tar.gz
tar fxv xar-425.2.tar.gz
cd xar-xar-425.2/xar/
curl -OLf https://raw.githubusercontent.com/macports/macports-ports/master/archivers/xar/files/xar-1.8-openssl-1.1.patch
@satmandu
satmandu / ubuntu-mainline-kernel.sh
Created December 18, 2021 22:19
Ubuntu Mainline Kernel update script , modified from forks of https://github.com/pimlie/ubuntu-mainline-kernel.sh
#!/usr/bin/env bash
# shellcheck disable=SC1117
# Ubuntu Kernel PPA info
ppa_host="kernel.ubuntu.com"
ppa_index="/~kernel-ppa/mainline/"
ppa_key="17C622B0"
# If quiet=1 then no log messages are printed (except errors)