Skip to content

Instantly share code, notes, and snippets.

View Gurpartap's full-sized avatar
:octocat:
Working from home

Gurpartap Singh Gurpartap

:octocat:
Working from home
View GitHub Profile
@Gurpartap
Gurpartap / debian-13-trixie-image.sh
Created August 25, 2025 02:31
create an installimage-ready Debian 13 tarball
#!/bin/bash
###############################################################################
# build-trixie.sh – create an installimage-ready Debian 13 tarball
###############################################################################
# Strict and predictable shell behavior
set -euo pipefail
# Found AUTOSETUP file '/autosetup'
# Running unattended installimage installation ...
@Gurpartap
Gurpartap / check-docker-lxc-capabilities.sh
Created July 21, 2025 12:49
Docker in LXC Capabilities Check
#!/bin/bash
# Docker in LXC Capabilities Check
# Run this inside an LXC container to verify Docker configuration compatibility
echo "=== DOCKER IN LXC CAPABILITIES REPORT ==="
echo "Container: $(hostname)"
echo "Date: $(date)"
echo "Kernel: $(uname -r)"
echo
@Gurpartap
Gurpartap / futures.go.tmpl
Created June 5, 2025 08:03
futurize: simple async "futures" generator in Go (2018)
package {{ .PackageName }}
type future_{{ .StructName }}_{{ .MethodName }} struct {
task func() ({{ .ReturnTypes | csvTypes }})
}
func (f future_{{ .StructName }}_{{ .MethodName }}) Await() ({{ .ReturnTypes | csvTypes }}) {
return f.task()
}
@Gurpartap
Gurpartap / body_bytes.go
Created May 2, 2021 08:55
Parse any arbitrary http body with grpc-gateway
package body_bytes
import (
"fmt"
"io"
"io/ioutil"
"reflect"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
)
@Gurpartap
Gurpartap / RotateDisplay.scpt
Created October 26, 2020 17:06
Display Rotation Toggle (Landscape/Portrait) AppleScript Shortcut Script for LG Ultrafine 5K Display
tell application "System Preferences"
quit
delay 0.3
launch
activate
reveal pane id "com.apple.preference.displays"
tell application "System Events"
tell process "System Preferences"
delay 0.3
tell window "LG Ultrafine"
@Gurpartap
Gurpartap / docker-compose-elassandra.yml
Created April 23, 2020 04:20
temporal + elassandra (cassandra + elasticsearch)
version: '3'
services:
elassandra:
image: docker.io/strapdata/elassandra:6.8.4.4
environment:
- "JVM_OPTS=-Dcassandra.custom_query_handler_class=org.elassandra.index.ElasticQueryHandler"
- "MAX_HEAP_SIZE=1200m"
- "HEAP_NEWSIZE=300m"
- "CASSANDRA_CGROUP_MEMORY_LIMIT=true"
- "DEBUG=true"
@Gurpartap
Gurpartap / csi-linode-controller.nomad.hcl
Created April 17, 2020 23:00
Linode CSI on Nomad 0.11+
job "csi-linode-controllers" {
datacenters = ["dc1"]
type = "service"
group "controllers" {
count = 1
# disable deployments
update {
max_parallel = 0
@Gurpartap
Gurpartap / 0_readme.md
Last active March 24, 2022 03:07
Cadence job file for the HashiStack (consul and nomad)

use cadence-setup-schema.nomad for automatic schema setup and update

# submit the parameterized batch job to cluster:
nomad job run ./cadence-setup-schema.nomad

# run this job (but without any param):
nomad job dispatch cadence-setup-schema
@Gurpartap
Gurpartap / nomad-jobs-allocs-dashboard.json
Last active March 24, 2020 17:11
Grafana dashboard for current CPU & Memory Usage Stats for nomad job allocs
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@Gurpartap
Gurpartap / nomad-grafana-dashboard.json
Created March 23, 2020 21:43
grafana dashboard for nomad v0.10.4
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",