Skip to content

Instantly share code, notes, and snippets.

View ishneetdua's full-sized avatar
🏠
Working from home

Isha Dua ishneetdua

🏠
Working from home
View GitHub Profile
@ishneetdua
ishneetdua / .bashrc
Created February 18, 2019 10:52 — forked from vsouza/.bashrc
Golang setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell, fish or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
#!/bin/bash
mkdir ./cluster-dump
kubectl get --export -o=json ns | \
jq '.items[] |
select(.metadata.name!="kube-system") |
select(.metadata.name!="default") |
del(.status,
.metadata.uid,
@ishneetdua
ishneetdua / iptable.txt
Created March 2, 2018 21:59
conntrack - IPtables
I would suggest also setting your firewall rules to reject rather than drop
One temporary, fix if you need to keep your iptables NAT rules is:
linux:~# sysctl -w net.netfilter.nf_conntrack_max=131072
I say temporary, because raising the nf_conntrack_max doesn't guarantee, things will get smoothly from now on. However on many not so heavily traffic loaded servers just raising the net.netfilter.nf_conntrack_max=131072 to a high enough value will be enough to resolve the hassle.
– Increasing the size of nf_conntrack hash-table
The Hash table hashsize value, which stores lists of conntrack-entries should be increased propertionally, whenever net.netfilter.nf_conntrack_max is raised.
#!/bin/sh
docker ps -a -q | while read cid
do
fini=$(docker inspect $cid | grep FinishedAt | awk -F\" '{printf("%.19s", $4)}')
diff=$(expr $(date +"%s") - $(date --date="$fini" +"%s"))
echo $diff
if [ $diff -gt 86400 ]
then
docker rm $cid
@ishneetdua
ishneetdua / terraform-workflow.txt
Last active September 20, 2017 20:58
Custom terraform provider workflow
The terraform.d/plugins directory applies as a subdirectory of the current working directory when you run Terraform. When placing plugins in the same directory as terraform itself, no subdirectories are needed, so you'd have the following files:
/usr/local/Cellar/terraform/0.10.6/bin/terraform
/usr/local/Cellar/terraform/0.10.6/bin/terraform-provider-test-v0.0.1
Since /usr/local/Cellar is managed by homebrew, it may be best not to modify the contents of this directory manually. As an alternative, you can put the plugin in your home directory:
~/.terraform.d/plugins/darwin_amd64/terraform-provider-test-v0.0.1
Terraform searches this directory in addition to the directory where the terraform binary is found.
With that said, since you are currently developing a provider, I suggest a different approach for more convenient workflow: