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
{"object":"session","status":"success","status_code":200,"token":"cf44416cf183e19f164fac8d8ffb9dc665d8ec7188a9fde5a880f845ccbc34f7","user":{"object":"user","userId":"USERAAA0","userFname":"Ayush0","userLname":"Ghosh0","userEmail":"a@a0.com","userIsActive":true,"userIsArchive":false,"created_at":"2014-11-03T14:24:39+0000","updated_at":"2014-11-03T14:24:39+0000"},"associate":{"groups":["SFOSUP01"],"roles":["ROLE0000","ROLE0001","ROLE0010"]},"apps":["chatrooms","scopes","groups","notifications","roles","pantones","products"],"apps_sub":{"chatrooms":["me","index","store","show","update","destroy","users","messages","uploads"],"scopes":["index","show","seed"],"groups":["show"],"notifications":["index","resource","read","approval"],"roles":["update","destroy"],"pantones":["update","destroy","uploads"],"products":["productdev","productdev_threads","productdev_threads_comments","productdev_uploads","all","index","store","show","update","destroy","uploads","clone","share","users","quantity","rfq","rfq_comments","rfq_a
<h4 class="sectionTitle">Track Shippment</h4>
<hr>
<div ng-show="thisSection.data.length === 0" class="panel panel-default">
<div class="panel-body">
We did not find any shipment information.
</div>
</div>
<div class="se-well" ng-class="{'yesThread' : thread.isApproved === 'yes', 'noThread' : thread.isApproved === 'no', 'naThread' : thread.isApproved === 'N/A' && thread.UI_Thread_Toggle === true, 'activeThread' : thread.UI_Thread_Toggle === true}">
<!-- ng-click="" -->
<div ng-click="getThreadDeatils(thread.threadId)" class="threads" ng-class="">
<span class="se-well__thread__isApproved">
<span ng-show="thread.threadType === 'approval'">
<span ng-switch on="thread.isApproved">
<span ng-switch-when="yes">
<i class="mdi-navigation-check"></i>
</span>
<span ng-switch-when="no">
<div class="se-well" ng-class="thread.isApproved === 'yes' ? 'yesThread' : thread.isApproved === 'no' ? 'noThread' : 'naThread' ">
<!-- ng-click="" -->
<div ng-click="getThreadDeatils(thread.threadId)" class="threads" ng-class="">
<span class="se-well__thread__isApproved">
<span ng-show="thread.threadType === 'approval'">
<span ng-switch on="thread.isApproved">
<span ng-switch-when="yes">
<i class="mdi-navigation-check"></i>
</span>
<span ng-switch-when="no">
<div class="se-well">
<div ng-click="getThreadDeatils(thread.threadId)" class="threads">
<span class="se-well__thread__isApproved">
<span ng-show="thread.threadType === 'approval'">
<span ng-switch on="thread.isApproved">
<span ng-switch-when="yes">
<i class="mdi-navigation-check"></i>
</span>
<span ng-switch-when="no">
<i class="mdi-action-close"></i>
@ayushghosh
ayushghosh / gist:a5fd023b1d1abd4259ee
Last active August 29, 2015 14:08
notification response
{
object: "list",
data: [
{
object: "notification",
notificationId: "H9GPU2OZZ87GVGR0R2ZI84VPBOWYSIA9",
notificationType: "info",
isApproved: "N\/A",
userNamePublisher: "Ayush Ayush",
userIdPublisher: "AYUSHGHO",