Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
building interesting things!

Sagar Jauhari sagarjauhari

💭
building interesting things!
View GitHub Profile
View template.json
[
{
"secrets": [
{
"name": "DATABASE_PASSWORD",
"valueFrom": "arn:aws:ssm:${region}:${account}:parameter/${environment}/${appName}/DATABASE_PASSWORD"
}
]
}
]
@sagarjauhari
sagarjauhari / main.tf
Created Jun 11, 2019
Handling secrets in ECS tasks
View main.tf
data "template_file" "blog" {
template = "${file("template.json")}"
vars {
app_name = "blog"
environment = "staging"
region = "us-east-1"
account = "12341234"
}
}
@sagarjauhari
sagarjauhari / output.txt
Created May 18, 2019
Start a shell on a fresh image
View output.txt
❯ dc run dev sh
Creating network "app_default" with the default driver
Creating app_db_1 ... done
#
View docker-aliases.sh
# Show live stats
alias ds='while true; do TEXT=$(docker stats --no-stream $(docker ps --format "{{.Names}}")); sleep 0.1; clear; echo "$TEXT"; done'
# Kill all containers
alias dk='docker kill $(docker ps -q)'
# Docker compose
alias dc='docker-compose'
@sagarjauhari
sagarjauhari / Dockerfile
Created May 18, 2019
Initial dockerfile
View Dockerfile
FROM golang
@sagarjauhari
sagarjauhari / docker-compose.yml
Created May 18, 2019
docker-compose with database
View docker-compose.yml
version: '3'
services:
db:
image: postgres
environment:
POSTGRES_PASSWORD: password
ports:
- "5432:5432"
dev:
build: .
@sagarjauhari
sagarjauhari / docker-compose.yml
Created May 18, 2019
Initial docker-compose.yml
View docker-compose.yml
version: '3'
services:
dev:
build: .
View hello.py
class Animal:
def name(self):
return "Simba"
@sagarjauhari
sagarjauhari / kernelized_kmeans
Created Oct 20, 2013
Trying to use k-means with non-euclidean distance metric
View kernelized_kmeans
# Source : http://stackoverflow.com/a/5551499/283572
#!/usr/bin/env python
# kmeans.py using any of the 20-odd metrics in scipy.spatial.distance
# kmeanssample 2 pass, first sample sqrt(N)
from __future__ import division
import random
import numpy as np
from scipy.spatial.distance import cdist # $scipy/spatial/distance.py
View bash_aliases
export EDITOR=~/bin/edit
export VISUAL=~/bin/edit
export ALTERNATE_EDITOR=emacs
alias t='terminator 2> /dev/null &'
alias g='gedit > /dev/null &'
alias em='emacsclient -c > /dev/null&'
alias ec='/home/sagar/eclipse/eclipse > /dev/null&'
alias ci='google-chrome --incognito > /dev/null&'
alias p='ps -e| grep '
alias wifi='/home/sagar/Dropbox/scripts/wifi_rtl_cisco.sh'
You can’t perform that action at this time.