Skip to content

Instantly share code, notes, and snippets.

@bharwani
bharwani / gist:2b75ae5b407e8f0dcd135079d8f32008
Created October 3, 2025 16:56 — forked from jauderho/gist:5f73f16cac28669e56608be14c41006c
HOWTO: Upgrade Raspberry Pi OS from Bookworm to Trixie
### WARNING: READ CAREFULLY BEFORE ATTEMPTING ###
#
# Officially, this is not recommended. YMMV
# https://www.raspberrypi.com/news/bookworm-the-new-version-of-raspberry-pi-os/
#
# This mostly works if you are on 64bit. You are on your own if you are on 32bit or mixed 64/32bit
#
# Credit to anfractuosity and fgimenezm for figuring out additional details for kernels
#
@bharwani
bharwani / gist:1cb6cadbaf8c7a435535094b43347b5b
Created December 11, 2024 03:09
Flask server to receive PUTs from encoder and push to AWS bucket
# Run: pip install Flask
# before using server
from flask import Flask, request
import os
import subprocess
# Configuration
UPLOAD_FOLDER = "uploads" # To capture PUTs received from
S3_BUCKET = "abbucket" # Replace with your S3 bucket name
terraform {
required_providers {
terracurl = {
source = "devops-rob/terracurl"
}
}
}
provider "terracurl" {}
@bharwani
bharwani / hello.java
Last active February 12, 2024 20:16
Java example for Fed accounts; altered config for LD's Fed endpoints
import com.launchdarkly.sdk.*;
import com.launchdarkly.sdk.server.*;
public class Hello {
// Set SDK_KEY to your LaunchDarkly SDK key.
static final String SDK_KEY = "";
// Set FEATURE_FLAG_KEY to the feature flag key you want to evaluate.
static final String FEATURE_FLAG_KEY = "my-boolean-flag";
@bharwani
bharwani / Steps.txt
Created July 10, 2023 00:39
Upgrade Raspberry Pi OS to Bookwork
sudo apt-get update && sudo apt-get dist-upgrade
sudo sed -i -e 's/bullseye/bookworm/g' /etc/apt/sources.list
sudo sed -i -e 's/bullseye/bookworm/g' /etc/apt/sources.list.d/raspi.list
sudo apt update
sudo apt -y full-upgrade
sudo apt -y autoremove
sudo apt -y clean
sudo reboot
#
# remove old config files after doing sanity checks
#!/bin/sh
# install stable nginx
# even though nginx will be replaced
# by compiling from source
# this installs latest versions
# of required libs
add-apt-repository -y ppa:nginx/stable \
&& apt-get update \
&& apt-get install -y nginx \
@bharwani
bharwani / update_favicon.js
Created January 8, 2021 17:34
Update favicon via javascript
var favicon = undefined;
var nodeList = document.getElementsByTagName("link");
for (var i = 0; i < nodeList.length; i++){
if((nodeList[i].getAttribute("rel") == "icon")||(nodeList[i].getAttribute("rel") == "shortcut icon")){
favicon = nodeList[i].setAttribute("href", "https://www.google.com/images/branding/googleg/1x/googleg_standard_color_128dp.png");
}
}
console.log(favicon);
@bharwani
bharwani / gist:c12e83db7ecfbc851e76cd7f8913aeea
Created January 8, 2021 12:38
Copy SSH key to clipboard
#pbcopy < ~/.ssh/id_rsa.pub
#or
cat ~/.ssh/id_rsa.pub | pbcopy
@bharwani
bharwani / fixed-button-bottom-right-of-screen.markdown
Created March 29, 2018 04:08
fixed button - bottom right of screen