Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Rohit Joshi RohitRox

🎯
Focusing
Block or report user

Report or block RohitRox

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
View ES-User-Search.md

ES Document Struct

{
  "_index": "users_index",
  "_type": "_doc",
  "_id": "iam-id-uuid",
  "_score": 1,
  "_source": {
@RohitRox
RohitRox / remove_ds_store_files.sh
Created Mar 25, 2019 — forked from jls/remove_ds_store_files.sh
Remove all of the .DS_Store files in the current directory and all sub directories.
View remove_ds_store_files.sh
find ./ -type f | grep .DS_Store | xargs rm
@RohitRox
RohitRox / js-error-handling.js
Last active Mar 10, 2019
Beautiful Errors in Javascript
View js-error-handling.js
// Try/Catch Basics
try {
//something that causes an error
} catch (err){
// error data
console.log(err.name)
console.log(err.message)
// checking for specific type
console.log(err instanceof(ReferenceError))
@RohitRox
RohitRox / find-ecr-image.sh
Created Feb 19, 2019 — forked from outofcoffee/find-ecr-image.sh
Check if Docker image exists with tag in AWS ECR
View find-ecr-image.sh
#!/usr/bin/env bash
# Example:
# ./find-ecr-image.sh foo/bar mytag
if [[ $# -lt 2 ]]; then
echo "Usage: $( basename $0 ) <repository-name> <image-tag>"
exit 1
fi
IMAGE_META="$( aws ecr describe-images --repository-name=$1 --image-ids=imageTag=$2 2> /dev/null )"
@RohitRox
RohitRox / find-ecr-image.sh
Created Feb 19, 2019 — forked from outofcoffee/find-ecr-image.sh
Check if Docker image exists with tag in AWS ECR
View find-ecr-image.sh
#!/usr/bin/env bash
# Example:
# ./find-ecr-image.sh foo/bar mytag
if [[ $# -lt 2 ]]; then
echo "Usage: $( basename $0 ) <repository-name> <image-tag>"
exit 1
fi
IMAGE_META="$( aws ecr describe-images --repository-name=$1 --image-ids=imageTag=$2 2> /dev/null )"
@RohitRox
RohitRox / withRegex.go
Last active Jan 18, 2019
Golang Templating
View withRegex.go
package main
import (
"encoding/json"
"fmt"
"regexp"
"strconv"
)
func main() {
@RohitRox
RohitRox / new-relic-go.go
Last active Dec 20, 2018
New Relic Go Sample
View new-relic-go.go
package main
import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
@RohitRox
RohitRox / clean-docker.sh
Created Nov 25, 2018 — forked from apmiller108/clean-docker.sh
Bash script to clean up docker
View clean-docker.sh
#!/bin/bash
GREEN='\x1B[32m'
RED='\x1B[31m'
NOCOL='\x1B[39m'
echo "${GREEN}Removing exited containers${NOCOL}"
docker rm -v $(docker ps --filter status=dead --filter status=exited -aq)
echo "${GREEN}Removing dangling images${NOCOL}"
docker rmi $(docker images -f "dangling=true" -q)
@RohitRox
RohitRox / iaas.config.md
Last active Nov 21, 2018
IaaC code organization
View iaas.config.md
Infrastructure-base
  |- foundation-roles/
  |- resources/
  | |- cloudtrail.yaml
  | |- s3.yaml
  |- vpc/
  | |- vpc-complete.yaml
  |- logging/
  | |- functions
@RohitRox
RohitRox / lambda-in-vpc.yaml
Created Oct 9, 2018
AWS Lambda in VPC with NAT
View lambda-in-vpc.yaml
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Sample SAM Template for AWS lambda in vpc
Resources:
NatEIP:
Type: AWS::EC2::EIP
Properties:
Domain: vpc
You can’t perform that action at this time.