Skip to content

Instantly share code, notes, and snippets.

@pratikmallya
pratikmallya / gist:4cbb43d03a5ed9afdf932bf38fdfd4e4
Last active October 21, 2021 06:53
List of brew packages
❯ brew list --full-name -1
autoconf
aws-okta
awscli
ca-certificates
fish
fzf
gdbm
git-delta
jq
@pratikmallya
pratikmallya / faildiffererntly.go
Created February 10, 2020 07:29
echo server that returns different http status codes
package main
import (
"github.com/labstack/echo"
"net/http"
)
func main() {
e := echo.New()
e.Use(FailDifferently)
@pratikmallya
pratikmallya / deploy_daemonset_hpa.yaml
Last active January 8, 2020 21:25
Simulating a daemonset with a deployment
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: nginx
spec:
minReplicas: 1
maxReplicas: 10000
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2018-11-29T15:20:27.859-0800 [DEBUG] plugin.terraform-provider-google_v1.18.0_x4: ---[ REQUEST ]---------------------------------------
2018-11-29T15:20:27.859-0800 [DEBUG] plugin.terraform-provider-google_v1.18.0_x4: PUT /v1beta1/projects/liveramp-eng-actbe/locations/us-central1/clusters/act-be-prod-cluster?alt=json&prettyPrint=false HTTP/1.1
2018-11-29T15:20:27.859-0800 [DEBUG] plugin.terraform-provider-google_v1.18.0_x4: Host: container.googleapis.com
2018-11-29T15:20:27.859-0800 [DEBUG] plugin.terraform-provider-google_v1.18.0_x4: User-Agent: google-api-go-client/0.5 Terraform/0.11.7 (+https://www.terraform.io)
2018-11-29T15:20:27.859-0800 [DEBUG] plugin.terraform-provider-google_v1.18.0_x4: Content-Length: 14
2018-11-29T15:20:27.859-0800 [DEBUG] plugin.terraform-provider-google_v1.18.0_x4: Content-Type: application/json
2018-11-29T15:20:27.859-0800 [DEBUG] plugin.terraform-provider-google_v1.18.0_x4: Accept-Encoding: gzip
2018-11-29T15:20:27.859-0800 [DEBUG] plugin.terraform-provider-google_v1.18.0_x4:
2

Keybase proof

I hereby claim:

  • I am pratikmallya on github.
  • I am pratikmallya (https://keybase.io/pratikmallya) on keybase.
  • I have a public key ASC2gLFkR_rfTTjNNTKzOYc0RFr5KSIObVU0N8-fTrCivgo

To claim this, I am signing this object:

@pratikmallya
pratikmallya / BASH_k8s_template.md
Last active January 24, 2018 06:28
Using BASH environment variables in k8s templates

When deploying k8s resources from task runners (like Jenkins) its often convenient to use environment variables directly in the template, and then pre-process the template using envsubst before feeding it to kubectl apply.

That can be accomplished by the following one liner (assuming you have gettext GNU package installed, which provides envsubst):

envsubst < k8s_template.yml | kubectl apply -f -

example k8s_template.yml:

@pratikmallya
pratikmallya / bobp-python.md
Created August 30, 2016 00:40 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@pratikmallya
pratikmallya / CreateJob.sh
Created August 29, 2016 19:53 — forked from stuart-warren/CreateJob.sh
Create a job in Jenkins (or folder) using the HTTP API
# check if job exists
curl -XGET 'http://jenkins/checkJobName?value=yourJobFolderName' --user user.name:YourAPIToken
# with folder plugin
curl -s -XPOST 'http://jenkins/job/FolderName/createItem?name=yourJobName' --data-binary @config.xml -H "Content-Type:text/xml" --user user.name:YourAPIToken
# without folder plugin
curl -s -XPOST 'http://jenkins/createItem?name=yourJobName' --data-binary @config.xml -H "Content-Type:text/xml" --user user.name:YourAPIToken
# create folder