Skip to content

Instantly share code, notes, and snippets.

View cpxPratik's full-sized avatar

Suraj Kumar Shrestha cpxPratik

View GitHub Profile
@cpxPratik
cpxPratik / Dockerfile
Created January 9, 2020 09:01 — forked from Irio/Dockerfile
GCP Serverless scrapers
FROM golang:1.12 as build
WORKDIR $GOPATH/src/github.com/Irio/wohnung
COPY scraper scraper
COPY main.go .
RUN go get -d -v ./...
RUN go install
FROM gcr.io/distroless/base
@cpxPratik
cpxPratik / gist:c79c032bd35d176c7ed791784cd4d156
Created October 16, 2019 05:43 — forked from patrickgalbraith/gist:9538b85546b4e3841864
Javascript dynamic getter, setter using defineProperty
var User = (function () {
function User (id, nam) {
var self = this;
this.id = id;
this.nam = nam;
this.__data = {};
for(var p in self) {
@cpxPratik
cpxPratik / ansible-summary.md
Created July 26, 2019 05:47 — forked from andreicristianpetcu/ansible-summary.md
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@cpxPratik
cpxPratik / AWSRegionsAndAZs.md
Created June 23, 2019 17:31
List of AWS availability zones for each AWS region
AWS region code AWS region name Number of AZs AZ names
us-east-1 Virginia 4 us-east-1a, us-east-1b, us-east-1c, us-east-1e
us-west-1 N. California 2 us-west-1a, us-west-1b
us-west-2 Oregon 3 us-west-2a, us-west-2b, us-west-2c
eu-west-1 Ireland 3 eu-west-1a, eu-west-1b, eu-west-1c
eu-central-1 Frankfurt 2 eu-central-1a, eu-central-1b
ap-southeast-1 Singapore 2 ap-southeast-1a, ap-southeast-1b
ap-southeast-2 Sydney 2 ap-southeast-2a, ap-southeast-2b, ap-southeast-2c
ap-northeast-1 Tokyo 2 ap-northeast-1a, ap-nort
You can ssh into the VM by finding the IP (from `kubectl config view` or simply `minikube ip`) and using username "docker" and password "tcuser":
ssh docker@$(minikube ip)
or
ssh [email protected]
@cpxPratik
cpxPratik / docker-nfs-volumes.md
Created May 23, 2019 08:04 — forked from ruanbekker/docker-nfs-volumes.md
NFS Volumes with Docker Swarm

Create NFS Volumes:

Creating the NFS Volume:

$ docker volume create --driver local \
  --opt type=nfs \
  --opt o=addr=192.168.1.115,uid=1000,gid=1000,rw \
  --opt device=:/mnt/volumes/mysql-test \
  mysql-test-1
@cpxPratik
cpxPratik / InsertDateOfToday.gs
Last active February 27, 2019 15:36 — forked from thomxc/InsertDate.gs
Google Docs Script Macro: Insert Today's Date
/**
* The onOpen function runs automatically when the Google Docs document is
* opened. Use it to add custom menus to Google Docs that allow the user to run
* custom scripts. For more information, please consult the following two
* resources.
*
* Extending Google Docs developer guide:
* https://developers.google.com/apps-script/guides/docs
*
* Document service reference documentation:
@cpxPratik
cpxPratik / download_and_verify.sh
Created July 18, 2018 06:36 — forked from sgleske-ias/download_and_verify.sh
Run it: bash -x download_and_verify.sh
#!/bin/bash
#Mon Feb 26 13:01:50 PST 2018
#Darwin 16.7.0 x86_64
#GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin16)
#Download and verify a file's sha256sum
#Retry three times and then fail.
#Should check the sha256sum of the downloaded file before attempting to download.
#exit 0 on success else exit nonzero
#Usage:
@cpxPratik
cpxPratik / .gitignore
Created June 25, 2018 09:15 — forked from maxclaus/.gitignore
Git keep empty folder: 1. Add a .gitkeep file inside the folder you want to keep 2. Then include this configuration in your .gitignore
path_your_folder/*
!path_your_folder/.gitkeep