Skip to content

Instantly share code, notes, and snippets.

View ayushghosh's full-sized avatar
🎯
Focusing

Ayush Ghosh ayushghosh

🎯
Focusing
View GitHub Profile
@ayushghosh
ayushghosh / ecr-cred-updater.sh
Created July 31, 2021 16:27 — forked from cablespaghetti/ecr-cred-updater.sh
Automatic Updating Amazon ECR Credentials in Kubernetes
#!/bin/bash
# Get directory of script
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [[ $# -ne 1 ]]
then
echo "ERROR: This script expects the namespace name to be given as an argument"
echo "e.g. ./ecr-cred-updater.sh my-namespace"
exit 1
@ayushghosh
ayushghosh / latency.txt
Created October 6, 2020 00:50 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@ayushghosh
ayushghosh / ip_blacklist.lua
Created December 8, 2018 09:48 — forked from chrisboulton/ip_blacklist.lua
Redis based IP blacklist for Nginx (LUA)
-- a quick LUA access script for nginx to check IP addresses against an
-- `ip_blacklist` set in Redis, and if a match is found send a HTTP 403.
--
-- allows for a common blacklist to be shared between a bunch of nginx
-- web servers using a remote redis instance. lookups are cached for a
-- configurable period of time.
--
-- block an ip:
-- redis-cli SADD ip_blacklist 10.1.1.1
-- remove an ip:
@ayushghosh
ayushghosh / Install & Usage
Created May 2, 2018 16:50 — forked from bwhaley/Install & Usage
Download artifacts from Teamcity
# Installation
Download the file
$ wget https://gist.githubusercontent.com/bwhaley/490a1ee890c0f010b1f3/raw/b471e67138be484a0140e5ca420b0ffca7726ed1/artifactory.py
Install the requests library
$ pip install requests
Set TEAMCITY env vars
$ export TEAMCITY_USERNAME=ben