Skip to content

Instantly share code, notes, and snippets.

View anandkumarpatel's full-sized avatar
💜
Living

Anandkumar Patel anandkumarpatel

💜
Living
View GitHub Profile

Keybase proof

I hereby claim:

  • I am anandkumarpatel on github.
  • I am anandpatel (https://keybase.io/anandpatel) on keybase.
  • I have a public key whose fingerprint is AC6A FCBD 8FA4 FB66 94C6 3F2D 45E1 0924 E70C 078F

To claim this, I am signing this object:

@anandkumarpatel
anandkumarpatel / calc.sh
Created November 28, 2018 04:42
Calculate how many nodes you should have based on request
#!/bin/bash
surge=1.5
function convertMem # <metric>
{
if [[ "${1}" == *"Mi" ]]; then
echo ${1%Mi}
elif [[ "${1}" == *"Gi" ]]; then
echo $(echo ${1%Gi} \* 1000 | bc)
elif [[ "${1}" == *"Ki" ]]; then
@anandkumarpatel
anandkumarpatel / ConfigMap
Created May 23, 2017 01:57
Kontainer sample output
apiVersion: v1
kind: ConfigMap
metadata:
name: flamboyant-newton-served-file
data:
served-file: |
Hello
@anandkumarpatel
anandkumarpatel / swarm_go_routine
Created November 23, 2016 02:07
swarm go routine
$ curl https://localhost:2375/debug/pprof/goroutine?debug=1 --cacert ca.pem --cert cert.pem --key key.pem
goroutine profile: total 4003
1 @ 0xb28918 0xb286f3 0xb24034 0x78bf0e 0x78c566 0x5f40a0 0x4f2dea 0x62c2d0 0x5eefbf 0x4f50be 0x4f28ae 0x45e7a1
# 0xb28918 runtime/pprof.writeRuntimeProfile+0xb8 /usr/local/go/src/runtime/pprof/pprof.go:545
# 0xb286f3 runtime/pprof.writeGoroutine+0x93 /usr/local/go/src/runtime/pprof/pprof.go:507
# 0xb24034 runtime/pprof.(*Profile).WriteTo+0xd4 /usr/local/go/src/runtime/pprof/pprof.go:236
# 0x78bf0e net/http/pprof.handler.ServeHTTP+0x37e /usr/local/go/src/net/http/pprof/pprof.go:199
# 0x78c566 net/http/pprof.(*handler).ServeHTTP+0xb6 <autogenerated>:1
# 0x5f40a0 net/http.(Handler).ServeHTTP-fm+0x50 /go/src/github.com/docker/swarm/api/primary.go:111
# 0x4f2dea net/http.HandlerFunc.ServeHTTP+0x3a /usr/local/go/src/net/http/server.go:1422
@anandkumarpatel
anandkumarpatel / docker-network-ls
Created November 23, 2016 01:47
docker network ls
palantiri$ docker network ls
NETWORK ID NAME DRIVER SCOPE
612d6bbfd5bc ip-10-8-192-112.a/bridge bridge local
81a0dc608afe ip-10-8-192-126.a/bridge bridge local
8a420809b05b ip-10-8-192-128.a/bridge bridge local
e894edeec53d ip-10-8-192-170.a/bridge bridge local
d1c269a38dc4 ip-10-8-192-170.a/host host local
6fc8262fa9fe ip-10-8-192-170.a/none null local
4df6571b3190 ip-10-8-192-210.a/bridge bridge local
5672febd14c5 ip-10-8-192-28.a/bridge bridge local
time="2016-11-19T03:55:30Z" level=debug msg="Initializing discovery service" name=consul uri="10.8.6.122:8500/swarm"
time="2016-11-19T03:55:30Z" level=info msg="Initializing discovery without TLS"
time="2016-11-19T03:55:30Z" level=debug msg="Initializing strategy" name=spread
time="2016-11-19T03:55:30Z" level=debug msg="Initializing filter" name=health
time="2016-11-19T03:55:30Z" level=debug msg="Initializing filter" name=port
time="2016-11-19T03:55:30Z" level=debug msg="Initializing filter" name=containerslots
time="2016-11-19T03:55:30Z" level=debug msg="Initializing filter" name=dependency
time="2016-11-19T03:55:30Z" level=debug msg="Initializing filter" name=affinity
time="2016-11-19T03:55:30Z" level=debug msg="Initializing filter" name=constraint
time="2016-11-19T03:55:30Z" level=debug msg="Initializing cluster" name=swarm