Skip to content

Instantly share code, notes, and snippets.

View sanketsudake's full-sized avatar

Sanket Sudake sanketsudake

View GitHub Profile
@sanketsudake
sanketsudake / omarchy-secure-boot-limine-sbctl-legacy-bios-to-uefi.md
Created September 16, 2026 15:36
How to enable Secure Boot on Omarchy / Arch Linux with Limine + sbctl: convert legacy BIOS MBR to UEFI GPT without reinstalling, signed UKIs, Limine config enrollment, LUKS + btrfs snapshots

How to Enable Secure Boot on Omarchy (Arch Linux) with Limine and sbctl, Including Legacy BIOS/MBR to UEFI/GPT Conversion Without Reinstalling

A tested, step-by-step guide to enabling UEFI Secure Boot on Omarchy (the Arch Linux + Hyprland setup) that uses the Limine bootloader, sbctl custom keys, signed Unified Kernel Images (UKIs) and Limine config enrollment (BLAKE2B checksum), with LUKS full-disk encryption and btrfs + Snapper snapshots kept working.

It also covers a case most Secure Boot guides skip: Omarchy installed in legacy BIOS mode on an MBR (dos) disk. Secure Boot needs UEFI, so the guide first converts the install to UEFI on GPT in place, without reinstalling or losing data.

Builds on the community guide in omacom/omarchy discussion #2296, which assumes you already boot in UEFI mode.

Tested on: Acer Swift 3 SF314-52 (Insyde H2O firmware) · Omarchy · Limine 12.8 · limine-mkinitcpio-hook 1.38 · limi

@sanketsudake
sanketsudake / claude-multi-account.sh
Created April 16, 2026 12:26
Using multiple Claude accounts with Claude Code
# Using Multiple Claude Accounts with Claude Code
#
# Reference: https://github.com/anthropics/claude-code/issues/261#issuecomment-3071151276
#
# Claude Code uses CLAUDE_CONFIG_DIR to determine which config/profile to use.
# By setting different config directories, you can maintain separate accounts
# (e.g., personal and work) without conflicts.
#
# Add the following to your shell profile (~/.zprofile, ~/.bashrc, etc.):

Stochastic Fairness Queuing (SFQ) is a packet scheduling algorithm designed to ensure fair access to network resources or application backends. Instead of allocating a dedicated queue for every single flow (which is memory-intensive and doesn't scale), SFQ hashes the flow identifier (like a user ID, IP address, or tenant ID) to assign it to one of a fixed number of queues.

While SFQ prevents a single high-volume flow from monopolizing the entire system, hash collisions can cause an innocent flow to share a queue with a "noisy neighbor." To mitigate this, advanced load balancing strategies like Shuffle Sharding and the Best of Two (Power of Two Choices) are often layered on top.

Here is how you can implement basic SFQ and its enhanced variants in Go. We will focus on the dispatcher logic—the part of the system responsible for routing an incoming request to the appropriate queue.

Setup: Basic Types and Hashing

// Unit testing is an important part of writing
// principled Go programs. The `testing` package
// provides the tools we need to write unit tests
// and the `go test` command runs tests.
// For the sake of demonstration, this code is in package
// `main`, but it could be any package. Testing code
// typically lives in the same package as the code it tests.
package main
@sanketsudake
sanketsudake / go-cache.md
Last active February 6, 2025 03:38
Go Cachec Checking and Cleanup

Check Go Cache Size

du -sh $(go env GOCACHE)

Check largest files in cache

find $(go env GOCACHE) -type f | xargs du -s | sort -n
@sanketsudake
sanketsudake / add-cloned-submodule
Created April 11, 2024 08:37
Add already cloned repo as submodules
for i in $(find example-sources -type d -depth 1)
do
echo $i
pushd $i
url=$(git remote get-url $(git remote))
echo $url
popd
git submodule add $url ./$i
done
@sanketsudake
sanketsudake / AWS Bedrock PDF Summary with langchain.md
Last active April 22, 2025 16:41
PDF summarizer with langchain and Amazon Bedrock Titan

Usage

  • Setup python dependencies from requirements.txt
  • Source your AWS enviroment credentials.
    • Enable Amazon bedrock amazon.titan-text-express-v1 model for access
    • AWS_REGION, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN(optional)
  • Run python pdf_summary.py
    python pdf_summary.py
    

Running on local URL: http://127.0.0.1:7860

@sanketsudake
sanketsudake / fission-kafka-mqt-dashboard.json
Created November 28, 2022 10:11
Fission Kafka MQT dashboard
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
# Reference: https://sharats.me/posts/shell-script-best-practices/
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
if [[ -n "${TRACE-}" ]]; then
set -o xtrace
fi
@sanketsudake
sanketsudake / dump-analyzer
Last active November 13, 2022 07:55
Dump Analyzer for Fission
#!/usr/bin/env bash
###
# This script is used to analyze the dump files generated by the Fission CI.
###
set -o errexit
set -o nounset
set -o pipefail
if [[ -n "${TRACE-}" ]]; then
set -o xtrace
fi