Skip to content

Instantly share code, notes, and snippets.

Step-by-Step Guide: Purging Secrets from Git History Using Gitleaks and git-filter-repo

This guide provides a streamlined workflow to take a Gitleaks JSON report, automatically extract the compromised keys, format them for git-filter-repo, and permanently scrub them from your entire Git repository history.


Prerequisites

Ensure you have the following command-line utilities installed before beginning:

  • Gitleaks (Secret scanner)
  • jq (Command-line JSON processor)
@rkrishnasanka
rkrishnasanka / compile-typst.py
Created June 17, 2026 07:08
Comple Typst Template
#!/usr/bin/env python3
"""
Compile Typst templates in the given folder.
Reads input.json: root-level keys are PDF suffixes; each value is a dict of
--input key=value for typst. Generates output/main-<suffix>.pdf for each entry.
Usage: python compile-typst.py <folder>
Example: python compile-typst.py experience-certificate
"""
import json
import os
sudo yum update -y
sudo amazon-linux-extras enable nginx1
sudo yum install -y nginx
sudo nano /etc/nginx/conf.d/reverse-proxy.conf
@rkrishnasanka
rkrishnasanka / docker-deploy.sh
Last active March 25, 2024 13:33
Simple Docker Compose -> EC2 Deploy
#!/usr/bin/env bash
TARGET='main'
ACTION='\033[1;90m'
NOCOLOR='\033[0m'
cd ~/<fill the right code location> || exit
if [[ -z "$1" && $1 != "--force" ]]; then
# Checking if we are on the main branch
@rkrishnasanka
rkrishnasanka / index.ts
Created April 15, 2023 23:15 — forked from d-nishi/index.ts
EKS RBAC - verbose index.ts
import * as aws from "@pulumi/aws";
import * as awsx from "@pulumi/awsx";
import * as eks from "@pulumi/eks";
import * as k8s from "@pulumi/kubernetes";
/*
* 1) Single step deployment three IAM Roles
*/
// Administrator AWS IAM clusterAdminRole with full access to all AWS resources
@rkrishnasanka
rkrishnasanka / indigo_test.py
Last active August 4, 2022 14:24
epam Indigo Package Python Examples
from indigo import Indigo
from indigo.renderer import IndigoRenderer
from indigo.inchi import IndigoInchi
indigo_object = Indigo()
mol1 = indigo_object.loadMolecule("ONc1cccc1")
print(mol1.smiles())
@rkrishnasanka
rkrishnasanka / svg2STL.py
Created October 17, 2021 22:54
FreeCAD script to convert SVG objects to STL
```
Based on https://github.com/kefir-/SVG2Solid
```
from FreeCAD import Base
import importSVG
import Part
def extrudeSVG(filename, thickness):
@rkrishnasanka
rkrishnasanka / Pseudo-code.py
Last active January 28, 2021 13:55
Parchmint import pseudocode
def importMINTwithoutConstraints(self, device: MINTDevice) -> None:
self.__original_device = device
pcells = []
for component in device.components:
terminals = []
for port in component.ports:
t = CTerminal(
import cairo
from parchmint import Device
import json
PT_TO_UM = 1/352.778
f = open("cariotest2.json", "r")
text = f.read()
#!/usr/bin/python3
import json
from os import close
import sys
device = {}
with open(sys.argv[1]) as json_file: