Skip to content

Instantly share code, notes, and snippets.

View nrashok's full-sized avatar
🎯
Focusing

Ashok nrashok

🎯
Focusing
View GitHub Profile
@nrashok
nrashok / kubemanage-k8sc-f1-v1.sh
Last active October 20, 2025 03:08
K8s Application-Level Backup Script | The Backup Strategy EKS AWS Doesn't Give You | kubemanage.com| Velero + AWS plugin: Production-grade backup solution — installs CRDs and controllers in the cluster (i.e., runs in-cluster), requires Kubernetes cluster-wide permissions (to create CRDs, namespace, roles, etc.), and also requires AWS IAM permiss…
#!/bin/bash
set -euo pipefail
NAMESPACE="production"
TIMESTAMP=$(date +%Y%m%d%H%M%S)
BACKUP_DIR="./k8s-backup-${NAMESPACE}-${TIMESTAMP}"
echo "Starting backup for namespace: $NAMESPACE"
mkdir -p "$BACKUP_DIR"
@nrashok
nrashok / ashok-od-cn-cf-v4.yaml
Last active September 17, 2025 06:30
Automate stopping EC2 instances and scaling EKS NodeGroup using Lambda, Step Functions, SSM, and EventBridge
AWSTemplateFormatVersion: '2010-09-09'
Description: Automate stopping/starting EC2 and managed EKS NodeGroups with Step Functions + EventBridge + SSM
Parameters:
InstanceIds:
Type: CommaDelimitedList
Default: i-07c33ff5a82b668cc,i-047a90a37986a669e
ClusterName:
Type: String
Default: mr-blues-dev
@nrashok
nrashok / bitnamilegacy
Last active September 30, 2025 10:28
bitnamilegacy
---Dev Kafka---
helm install lms-kafka bitnami/kafka \
-f without-pass-values-new.yaml \
--namespace kafka \
--set image.repository=bitnamilegacy/kafka \
--set image.tag=3.8.1-debian-12-r2 \
--set global.security.allowInsecureImages=true
@nrashok
nrashok / alpine-tools.md
Created December 18, 2024 06:54 — forked from bruno-brant/alpine-tools.md
alpine: add curl, telnet ect

Tooling in alpine builds

Pretty usual to have to diagnose docker containers based on alpine distros. But the image never comes with basic tools. How do we add it?

apk update						      # update the local registry
apk add busybox-extras			# install telnet and some other basic tools
apk add curl
@nrashok
nrashok / set_selinux_permissive.sh
Created November 19, 2024 14:19
Shell script to set SELinux to permissive mode permanently on Oracle Linux
#!/bin/bash
# Check if running as root
if [ "$(id -u)" -ne 0 ]; then
echo "Please run this script as root or with sudo."
exit 1
fi
# Backup existing SELinux configuration
CONFIG_FILE="/etc/selinux/config"
@nrashok
nrashok / code-stack.ts
Created October 12, 2023 13:12 — forked from sebsto/code-stack.ts
CDK Create EC2 instace in private subnet. Install Nginx.
import ec2 = require('@aws-cdk/aws-ec2');
import cdk = require('@aws-cdk/core');
import { Fn, Tag, Resource } from '@aws-cdk/core';
import { AmazonLinuxImage, UserData, InstanceType } from '@aws-cdk/aws-ec2';
import { Role, ServicePrincipal, ManagedPolicy, CfnInstanceProfile } from '@aws-cdk/aws-iam'
/**
* Create my own Ec2 resource and Ec2 props as these are not yet defined in CDK
* These classes abstract low level details from CloudFormation
frs/admin/qrs.php
__admin
__cache/
__index.php
__MACOSX
__pma___
__SQL
__test.php
_.htpasswd
_adm
@nrashok
nrashok / mat.yaml
Created November 23, 2021 15:59
MATRIX
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
k8s-app: metrics-server
name: metrics-server
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
#!/bin/bash
##Tenny Susanto
##2017-11-09
##download messages from Kafka partition by partition
##do not use this in a Kakfa queue that is constantly receiving new messages
##this should only be used for manual pull for historical data done by platform team (they dump the data into Kafka once and don't write to it)
##This file contains the login/password to the Kafka server
export KAFKA_OPTS="-Djava.security.auth.login.config=/path/jass.conf"
@nrashok
nrashok / Cassandra backup & restore
Last active March 9, 2021 20:07 — forked from sdluxeon/Cassandra backup & restore
CASSANDRA SNAPSHOTING
//READ nodetool snapshot documentation in cassandra
//READ stack-overflow-topic gist or directly in stackoverflow -> http://stackoverflow.com/questions/25465904/how-can-i-restore-cassandra-snapshots
//EXPORT the databases schemas
cqlsh -e "DESCRIBE SCHEMA" > my_backup_name.schema
//Create snapshot of the whole server
nodetool snapshot my_backup_name
//Compress the backups