Skip to content

Instantly share code, notes, and snippets.

View nitinsatish's full-sized avatar
🎯
Focusing

Nitin nitinsatish

🎯
Focusing
View GitHub Profile
@nitinsatish
nitinsatish / delete_ns.sh
Created August 9, 2022 11:50
[Delete terminating namespace] #k8s
#!/usr/bin/env bash
function delete_namespace () {
echo "Deleting namespace $1"
kubectl get namespace $1 -o json > tmp.json
sed -i 's/"kubernetes"//g' tmp.json
kubectl replace --raw "/api/v1/namespaces/$1/finalize" -f ./tmp.json
rm ./tmp.json
}
@nitinsatish
nitinsatish / colors.sh
Created August 2, 2022 11:54
[shell colors] #shell #colors
# Reset
Color_Off='\033[0m' # Text Reset
# Regular Colors
Black='\033[0;30m' # Black
Red='\033[0;31m' # Red
Green='\033[0;32m' # Green
Yellow='\033[0;33m' # Yellow
Blue='\033[0;34m' # Blue
Purple='\033[0;35m' # Purple
@nitinsatish
nitinsatish / jd_deploy.md
Last active May 10, 2022 06:42
[jdeployer new image deployment] #juniper
  1. If jdeployer needs to be built. This happens when we want to incorporate new JD code.
cd Repos/atom/jdeployerSaaS
./jdeployer_image_builder.sh
  1. Tag this new JD image
docker tag jdeployer:220422 svl-artifactory.juniper.net/atom-docker/atom-of/mukil/jdeployer:R1.2
@nitinsatish
nitinsatish / regions_code.md
Created January 13, 2022 08:24
[AWS regions]#aws

Python code

regions = [r['RegionName'] for r in boto3.client('ec2').describe_regions()['Regions']]
@nitinsatish
nitinsatish / docker_image_cleanup.md
Created December 16, 2021 12:45
[Docker image cleanup] #docker
docker image prune -f
docker rmi $(docker images -q)
docker rm -v $(docker ps -qa)
@nitinsatish
nitinsatish / git_branch_issues.md
Last active May 20, 2021 10:17
[Git branch issues] #git

Make sure you've pulled the new upstream branch into your local repo:

  1. First, ensure your working tree is clean (commit/stash/revert any changes) Then,

git fetch upstream

to retrieve the new upstream branch 2. Create and switch to a local version of the new upstream branch (newbranch):

@nitinsatish
nitinsatish / ls.rst
Created April 16, 2021 07:50 — forked from amitsaha/ls.rst
How does `ls` work?

How does ls work?

I wanted to be really able to explain to a fair amount of detail how does the program ls actually work right from the moment you type the command name and hit ENTER. What goes on in user space and and in kernel space? This is my attempt and what I have learned so far on Linux (Fedora 19, 3.x kernel).

How does the shell find the location of 'ls' ?

@nitinsatish
nitinsatish / tail.py
Created February 6, 2021 09:47 — forked from amitsaha/tail.py
Simple implementation of the tail command in Python
'''
Basic tail command implementation
Usage:
tail.py filename numlines
'''
import sys
import linecache
@nitinsatish
nitinsatish / influxdb-setup.md
Created October 19, 2020 10:09 — forked from travisjeffery/influxdb-setup.md
Guide to setting up InfluxData's TICK stack

Guide to setting up InfluxData's TICK stack

InfluxData's T.I.C.K. stack is made up from the following components:

Component Role
Telegraf Data collector
InfluxDB Stores data
Chronograf Visualizer
@nitinsatish
nitinsatish / System Design.md
Created December 15, 2019 10:10 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?