Skip to content

Instantly share code, notes, and snippets.

Amit Saha amitsaha

Block or report user

Report or block amitsaha

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
amitsaha /
Created Aug 15, 2019
test python + prometheus
from prometheus_client import multiprocess
from prometheus_client import generate_latest, CollectorRegistry, CONTENT_TYPE_LATEST, Gauge
from flask import Flask, Response
app = Flask(__name__)
from flask import request
from prometheus_client import Counter, Histogram
import time
amitsaha / go.mod
Last active Aug 15, 2019
Redis + go
View go.mod
go 1.12
require v6.15.2+incompatible
amitsaha / nginx.conf
Last active Jul 11, 2019
nginx conf + geoip2
View nginx.conf
# blog post:
worker_processes auto;
daemon off;
error_log /dev/stdout warn;
include /etc/nginx/modules/*.conf;
load_module modules/;
events {
View mapping.json
"mapping": {
"properties": {
"@timestamp": {
"type": "date"
"body_bytes_sent": {
"type": "text",
"fields": {
"keyword": {
amitsaha / dynamodbtablescan.ps1
Created Nov 16, 2018
Powershell + DynamoDB table scan
View dynamodbtablescan.ps1
function Get-DynamoByPrefix($table, $keyPrefix)
$region = "ap-southeast-2"
$client = New-Object Amazon.DynamoDBv2.AmazonDynamoDBClient($regionEndpoint)
$req = New-Object Amazon.DynamoDBv2.Model.ScanRequest
$req.TableName = $table
$result = $client.Scan($req)
$result.Items | Where-Object {$_.Key.S.StartsWith($keyPrefix)} | ForEach-Object {
amitsaha / test.go
Created Sep 21, 2018
golang format string demo
View test.go
package main
import (
type Person struct {
View gist:67082d0ae9f8a78dcb80ebeaaef86a5f
package main
import (
View gist:afd3bd04521f25abce48259e42933616
Update gemfile based on
pdk bundle install
pdk bundle update
pdk bundle --exec rake beaker
pdk bundle -- exec rake beaker:sets
amitsaha / consumer.go
Created Dec 11, 2017 — forked from simpleton/consumer.go
Golang auto-reconnect rabbitmq consumer
View consumer.go
package base
import (
amitsaha / webapp.Dockerfile
Created Oct 25, 2017
Dockerfile for running a HTTP server on port 8000
View webapp.Dockerfile
# Build me using: docker build -t amitsaha/webapp .
FROM python:3
CMD ["python3", "-m", "http.server"]
You can’t perform that action at this time.