Skip to content

Instantly share code, notes, and snippets.

View jerrymannel's full-sized avatar
🍺
Cheers!

Jerry M. jerrymannel

🍺
Cheers!
View GitHub Profile
@jerrymannel
jerrymannel / rand.js
Last active January 16, 2018 08:21
Generate random number of given lentth
function (_i) {
var i = Math.pow(10, _i - 1);
var j = Math.pow(10, _i) - 1;
return ((Math.floor(Math.random() * (j - i + 1)) + i));
};
@jerrymannel
jerrymannel / opensslKeyCert.md
Last active November 4, 2017 13:43
Generating Key-Cert pair using OpenSSL
@jerrymannel
jerrymannel / git.md
Last active February 26, 2018 07:05
Git init and tagging after cloning an empty repository
touch README.md
git add .
git commit -m "Init"
git push
git branch dev
git checkout dev
git merge master
git push --set-upstream origin dev
@jerrymannel
jerrymannel / bash_aliases.md
Last active June 5, 2018 10:08
system, kubernetes, docker aliases: bash_aliases
alias ..='cd ..'
alias c='clear'
alias process='ps -eaf | grep '
alias q='exit'
alias l='ls'
alias ll='ls -l'
alias ss='source ~/.bash_aliases'
alias path='echo -e ${PATH//:/\\n}'
alias ports='netstat -tulanp tcp'
@jerrymannel
jerrymannel / busybox.yaml
Created January 21, 2019 17:48
Kubernetes busybox yaml
apiVersion: v1
kind: Pod
metadata:
name: testpod
namespace: appveen
spec:
containers:
- name: test-container
image: k8s.gcr.io/busybox
args: [/bin/sh, -c, 'i=0; while true; do echo "$i: $(date)"; i=$((i+1)); sleep 1; done']
@jerrymannel
jerrymannel / getMongoVersionAndReplSetInfo.js
Created November 26, 2019 19:38
Find the mongo server version and replica set information from nodejs client.
const MongoClient = require('mongodb').MongoClient;
const assert = require('assert');
var url = 'mongodb://localhost:27017';
const dbName = 'test';
const client = new MongoClient(url, { useUnifiedTopology: true });
client.connect(function(err) {
@jerrymannel
jerrymannel / getMongoVersionAndReplSetInfo.go
Last active November 26, 2019 19:39
Find the mongo server version and replica set information from golang client.
package main
import (
"context"
"fmt"
"log"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
"go.mongodb.org/mongo-driver/x/bsonx"
@jerrymannel
jerrymannel / dataFormat.json
Last active December 26, 2020 03:53
Let's Build - dataFormat.json
{
"name": "String",
"creditCardNumber": "String",
"expiryDate": "Date",
"cvv": "String",
"bank": "String",
"billingAddtess": {
"line1": "String",
"line2": "String",
"state": "String",
@jerrymannel
jerrymannel / command.sh
Created December 26, 2020 03:55
Let's build - command.sh
touch app.js
npm init
npm install --save express
@jerrymannel
jerrymannel / apiClient.js
Last active May 29, 2021 17:30
apiClient.js
const URLS = {
states: "https://cdn-api.co-vin.in/api/v2/admin/location/states",
vaccinationCenters: "https://cdn-api.co-vin.in/api/v2/appointment/sessions/public/calendarByDistrict"
}
async function api(url) {
const options = {
url: url,
method: "GET",
headers: {