Skip to content

Instantly share code, notes, and snippets.

View pen-pal's full-sized avatar
🌌
I may be slow to respond

Manish Khadka pen-pal

🌌
I may be slow to respond
View GitHub Profile
@pen-pal
pen-pal / login.sh
Created October 7, 2025 17:22
to port-forward argocd and login
argocd login --username "foo" --password "bar" --insecure --port-forward --port-forward-namespace argocd --plaintext
@pen-pal
pen-pal / snap.sh
Created June 23, 2025 04:12
start ssm agent in ubuntu 24.04
sudo snap start amazon-ssm-agent
sudo systemctl start snap.amazon-ssm-agent.amazon-ssm-agent.service
@pen-pal
pen-pal / decrypt.sh
Created June 3, 2025 14:29
decrypt prometheus prometheus.yaml.gz
$ kubectl -n <NAMESPACE> get secret <SECRET> -o json | jq -r '.data."prometheus.yaml.gz"' | base64 -d | gunzip
@pen-pal
pen-pal / delete.sh
Created March 26, 2025 06:23
force delete all the secrets from secrets manager without recovery
aws secretsmanager list-secrets --query "SecretList[].Name" --output text |xargs |tr ' ' '\n' | xargs -I {} aws secretsmanager delete-secret --secret-id {} --force-delete-without-recovery
@pen-pal
pen-pal / copy.py
Created March 25, 2025 09:56
copy issues and comments from org1/repo1 to org2/repo2
import requests
# GitHub personal access token
TOKEN = "your-token"
# Source and destination repositories
SOURCE_REPO = 'org1/repo1'
DEST_REPO = 'org2/repo2'
# Headers for authorization
@pen-pal
pen-pal / cert.sh
Created February 13, 2025 14:18
certbot manually create cert
certbot certonly --manual --email [email protected] --server https://acme-staging-v02.api.letsencrypt.org/directory -
-test-cert --work-dir=. --config-dir=. --logs-dir=. --agree-tos -d test.com
@pen-pal
pen-pal / values.yaml
Created February 13, 2025 12:16
kube-prometheus-stack-values
# make sure to update your slack hook and apply
prometheusOperator:
enabled: true
prometheus:
enabled: true
server:
statefulSet:
enabled: true
extraFlags:
@pen-pal
pen-pal / postgresql-user-and-db-create.sh
Created February 3, 2025 07:36
postgresql-user-and-db-create.sh
CREATE DATABASE test;
CREATE USER test WITH PASSWORD 'test';
GRANT ALL PRIVILEGES ON DATABASE test TO test;
\c test
GRANT ALL PRIVILEGES ON SCHEMA public TO test;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO test;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO test;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL PRIVILEGES ON TABLES TO test;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL PRIVILEGES ON SEQUENCES TO test;
@pen-pal
pen-pal / pgdump.sh
Created January 27, 2025 15:37
pg dump no acl and owner
pg_dump -U myuser -h localhost -d mydatabase --no-owner --no-privileges > mydatabase_backup.sql
@pen-pal
pen-pal / download-lambda-code.sh
Last active January 27, 2025 15:36
download lambda code
#!/bin/bash
# Replace with your list of function names
REGION=${1:-"us-east-1"}
PROFILE=${2:-"default"}
function_names=("lambda-1" "lambda-2")
for function in "${function_names[@]}"; do
echo "Downloading code for function: $function"