Skip to content

Instantly share code, notes, and snippets.

@saurabh-hirani
saurabh-hirani / sampleapp.py
Created October 23, 2023 16:41
otel python sample
import sys
import json
import logging
import os
import random
import time
from os.path import splitext, basename
import opentelemetry.metrics as metrics
import psutil
@saurabh-hirani
saurabh-hirani / ignore-errors-test-output.md
Last active June 19, 2020 17:47
ignore-errors-test-output.md
We couldn’t find that file to show.
@saurabh-hirani
saurabh-hirani / cloud-nuke-ignore-errors.md
Last active May 13, 2020 13:33
cloud-nuke ignore-errors output
INFO[2020-05-06T19:31:10+05:30] The following resources types will be nuked:
INFO[2020-05-06T19:31:10+05:30] - ami
INFO[2020-05-06T19:31:10+05:30] - asg
INFO[2020-05-06T19:31:10+05:30] - ebs
INFO[2020-05-06T19:31:10+05:30] - ec2
INFO[2020-05-06T19:31:10+05:30] - ecsserv
INFO[2020-05-06T19:31:10+05:30] - eip
INFO[2020-05-06T19:31:10+05:30] - ekscluster
INFO[2020-05-06T19:31:10+05:30] - elb
@saurabh-hirani
saurabh-hirani / cloud-nuke-ignore-errors.md
Created May 13, 2020 13:24
cloud-nuke ignore-errors output
INFO[2020-05-06T19:31:10+05:30] The following resources types will be nuked:
INFO[2020-05-06T19:31:10+05:30] - ami
INFO[2020-05-06T19:31:10+05:30] - asg
INFO[2020-05-06T19:31:10+05:30] - ebs
INFO[2020-05-06T19:31:10+05:30] - ec2
INFO[2020-05-06T19:31:10+05:30] - ecsserv
INFO[2020-05-06T19:31:10+05:30] - eip
INFO[2020-05-06T19:31:10+05:30] - ekscluster
INFO[2020-05-06T19:31:10+05:30] - elb
@saurabh-hirani
saurabh-hirani / cloud-nuke-ignore-errors.md
Created May 13, 2020 13:24
cloud-nuke ignore-errors output
INFO[2020-05-06T19:31:10+05:30] The following resources types will be nuked:
INFO[2020-05-06T19:31:10+05:30] - ami
INFO[2020-05-06T19:31:10+05:30] - asg
INFO[2020-05-06T19:31:10+05:30] - ebs
INFO[2020-05-06T19:31:10+05:30] - ec2
INFO[2020-05-06T19:31:10+05:30] - ecsserv
INFO[2020-05-06T19:31:10+05:30] - eip
INFO[2020-05-06T19:31:10+05:30] - ekscluster
INFO[2020-05-06T19:31:10+05:30] - elb
@saurabh-hirani
saurabh-hirani / setup-virtualenv.md
Created February 1, 2020 12:16
Python3 virtualenv setup

Steps to install and activate virtualenv:

  1. Install virtualenv module:

    # sudo pip3 install virtualenv

  2. Change to project directory:

    # python3 -m virtualenv venv

@saurabh-hirani
saurabh-hirani / rake-release.md
Created February 1, 2020 12:16
Rakefile semantic versioning

Semantic versioning intro

This repo uses semantic versioning for tagging releases. Read semantic versioning basics here

Release patch version

rake release
@saurabh-hirani
saurabh-hirani / EC2API-go.diff
Created October 1, 2019 09:48
diff between older EC2API.go and newer EC2API.go for cloud-nuke
$ diff EC2API.go /var/tmp/newer-EC2API.go
388,437d387
< // ApplySecurityGroupsToClientVpnTargetNetwork mocks base method
< func (m *MockEC2API) ApplySecurityGroupsToClientVpnTargetNetwork(arg0 *ec2.ApplySecurityGroupsToClientVpnTargetNetworkInput) (*ec2.ApplySecurityGroupsToClientVpnTargetNetworkOutput, error) {
< m.ctrl.T.Helper()
< ret := m.ctrl.Call(m, "ApplySecurityGroupsToClientVpnTargetNetwork", arg0)
< ret0, _ := ret[0].(*ec2.ApplySecurityGroupsToClientVpnTargetNetworkOutput)
< ret1, _ := ret[1].(error)
# python3 test_grequests.py
2019-04-14 23:31:43,698 START
2019-04-14 23:31:43,724 Starting new HTTPS connection (1): localhost:8082
2019-04-14 23:31:43,725 Starting new HTTPS connection (1): localhost:8082
2019-04-14 23:31:43,726 Starting new HTTPS connection (1): localhost:8082
2019-04-14 23:31:43,727 Starting new HTTPS connection (1): localhost:8082
2019-04-14 23:31:43,728 Starting new HTTPS connection (1): localhost:8082
2019-04-14 23:31:43,728 Starting new HTTPS connection (1): localhost:8082
2019-04-14 23:31:43,729 Starting new HTTPS connection (1): localhost:8082
2019-04-14 23:31:43,730 Starting new HTTPS connection (1): localhost:8082
# python3 test_grequests.py
2019-04-14 23:30:41,697 START
2019-04-14 23:30:41,721 Starting new HTTPS connection (1): localhost:8082
2019-04-14 23:30:41,722 Starting new HTTPS connection (1): localhost:8082
2019-04-14 23:30:41,723 Starting new HTTPS connection (1): localhost:8082
2019-04-14 23:30:41,724 Starting new HTTPS connection (1): localhost:8082
2019-04-14 23:30:41,725 Starting new HTTPS connection (1): localhost:8082
2019-04-14 23:30:41,726 Starting new HTTPS connection (1): localhost:8082
2019-04-14 23:30:41,727 Starting new HTTPS connection (1): localhost:8082