Skip to content

Instantly share code, notes, and snippets.

View saranjsr's full-sized avatar

Saranjeet Singh saranjsr

  • Accenture
  • Germany
View GitHub Profile
@saranjsr
saranjsr / Minikube on Mac
Created July 18, 2020 13:51
Install Minikube on Mac
Install Kubernetes on Mac
#curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-amd64 \
&& chmod +x minikube
#sudo mv minikube /usr/local/bin
#minikube start --driver=virtualbox
To make virtualbox the default driver:
@saranjsr
saranjsr / cf_create_or_update.py
Created December 30, 2019 12:14 — forked from svrist/cf_create_or_update.py
Update or create a CloudFormation stack given a name and template + params'
'Update or create a stack given a name and template + params'
from __future__ import division, print_function, unicode_literals
from datetime import datetime
import logging
import json
import sys
import boto3
import botocore
@saranjsr
saranjsr / boto_dynamodb_methods.py
Created December 30, 2019 12:14 — forked from martinapugliese/boto_dynamodb_methods.py
Some wrapper methods to deal with DynamoDB databases in Python, using boto3.
# Copyright (C) 2016 Martina Pugliese
from boto3 import resource
from boto3.dynamodb.conditions import Key
# The boto3 dynamoDB resource
dynamodb_resource = resource('dynamodb')
def get_table_metadata(table_name):
@saranjsr
saranjsr / ubuntu 18.04 login loop
Created July 31, 2019 09:59
ubuntu 18.04 login loop issue in virtual box 6
# it was due to .Xauthority file has bad permissions or missing. In my case, .Xauthority file was missing.
Ctl + ALT + F3 to switch to command line
touch ~/.Xauthority
xauth add ${HOST}:0 . $(xxd -l 16 -p /dev/urandom)
xauth list
sudo init 6
fixed this issue. :)
@saranjsr
saranjsr / gist:33c8b06b4fb43d667d26935589ebad62
Created December 20, 2018 14:43
install aws-cli on ubuntu 16.04
#!/usr/bin/env bash
set -ex
# To avoid locale.Error
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
sudo apt-get update
sudo apt-get install -yq python-pip
@saranjsr
saranjsr / README-Template.md
Created December 14, 2018 15:33 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@saranjsr
saranjsr / gist:eeda0470a6366c3e86b9963bc0e283b2
Created December 14, 2018 10:11 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@saranjsr
saranjsr / README.md
Created August 14, 2018 14:16 — forked from JamesMenetrey/README.md
Install Oh-My-Zsh + iTerm2 with Solarized + System-wide console in 2017 (macOS)

Install iTerm2 with Solarized in 2017

Here is the looks and feel of your terminal once the tutorial has been applied on your system:

Install iTerm2

Using Homebrew:

@saranjsr
saranjsr / install-chef-ubuntu16.04
Created April 20, 2018 14:57
install chef 12.17.33 on ubuntu 16.04
#!/bin/bash
apt-get update
apt-get -y install curl
# download the Chef server package
if [ ! -f /tmp/chef-server-core_12.17.33_amd64.deb ]; then
echo "Downloading the Chef server package..."
wget -nv -P /tmp https://packages.chef.io/files/stable/chef-server/12.17.33/ubuntu/16.04/chef-server-core_12.17.33-1_amd64.deb
fi
@saranjsr
saranjsr / single-s3-bucket-full-access
Created April 20, 2018 14:57
give full access on only single bucket
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:ListAllMyBuckets",
"Resource": "arn:aws:s3:::*"
},
{
"Effect": "Allow",