Skip to content

Instantly share code, notes, and snippets.

View iam404's full-sized avatar

Prabuddha Chakraborty iam404

View GitHub Profile
@iam404
iam404 / setup-bridge.sh
Created February 21, 2019 13:23 — forked from ismell/setup-bridge.sh
Scripts to re-create the docker0 bridge and setup a different ip subnet
#!/bin/bash -e
IFADDR="192.168.3.1/24"
if [[ ! ip link show docker0 ]]; then
ip link add docker0 type bridge
ip addr add "$IFADDR" dev docker0
ip link set docker0 up
iptables -t nat -A POSTROUTING -s "$IFADDR" ! -d "$IFADDR" -j MASQUERADE
fi
@iam404
iam404 / k8s-svc-annotations.md
Created September 26, 2018 10:29 — forked from mgoodness/k8s-svc-annotations.md
AWS ELB-related annotations for Kubernetes Services (v1.5)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-emit-interval (in minutes)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-enabled (true|false)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-name
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-prefix
  • service.beta.kubernetes.io/aws-load-balancer-backend-protocol (http|https|ssl|tcp)
  • service.beta.kubernetes.io/aws-load-balancer-connection-draining-enabled (true|false)
  • service.beta.kubernetes.io/aws-load-balancer-connection-draining-timeout (in seconds)
@iam404
iam404 / performance.txt
Created August 12, 2017 11:32 — forked from dstroot/performance.txt
Performance Tuning your TCP Stack
#!/bin/bash
echo "*****************************************"
echo " Based on information from Google"
echo " http://dev.chromium.org/spdy/spdy-best-practices"
echo "*****************************************"
sudo su
yum –y update
echo "*****************************************"
echo " Changing initcwnd and initrwnd"
echo " Step 1: check route settings."
@iam404
iam404 / README.md
Created August 11, 2017 12:08 — forked from adambom/README.md
Backup Kubernetes Cluster State

Run this in order to backup all you k8s cluster data. It will be saved in a folder bkp. To restore the cluster, you can run kubectl apply -f bkp.

Please note: this recovers all resources correctly, including dynamically generated PV's. However, it will not recover ELB endpoints. You will need to update any DNS entries manually, and manually remove the old ELB's.

Please note: This has not been tested with all resource types. Supported resource types include:

  • services
  • replicationcontrollers
  • secrets
  • deployments
  • horizontal pod autoscalers
allow 52.84.0.0/15;
allow 54.182.0.0/16;
allow 54.192.0.0/16;
allow 54.230.0.0/16;
allow 54.239.128.0/18;
allow 54.239.192.0/19;
allow 54.240.128.0/18;
allow 204.246.164.0/22;
allow 204.246.168.0/22;
allow 204.246.174.0/23;
#!/bin/bash
ee_user=$1
ee_dir=$2
useradd -G www-data -ms /bin/false $ee_user
mkdir -p /home/$ee_user/templatic.com/$ee_dir
chown $ee_user:www-data /home/$ee_user/templatic.com/$ee_dir
@iam404
iam404 / nginx-plus-install.sh
Created April 30, 2016 14:10 — forked from rahul286/nginx-plus-install.sh
nginx-plus installation
mkdir /etc/ssl/nginx
wget -P /etc/ssl/nginx/ https://cs.nginx.com/static/files/CA.crt
## move nginx-repo.crt to /etc/ssl/nginx/nginx-repo.crt
## move nginx-repo.key to /etc/ssl/nginx/nginx-repo.key
wget http://nginx.org/keys/nginx_signing.key
apt-key add nginx_signing.key
apt-get install apt-transport-https libgnutls26 libcurl3-gnutls
printf "deb https://plus-pkgs.nginx.com/ubuntu `lsb_release -cs` nginx-plus\n" >/etc/apt/sources.list.d/nginx-plus.list
@iam404
iam404 / ssl.expiry
Created March 17, 2016 09:19
check ssl expiry
openssl x509 -enddate -noout -in example.com.crt
@iam404
iam404 / wordpress.version
Created October 12, 2015 14:10
to find wordpress version of multiple sites
grep wp_version wp-includes/version.php
find /home/*/public_html/ -type f -iwholename "*/wp-includes/version.php" -exec grep -H "\$wp_version =" {} \;
@iam404
iam404 / command.sh
Created September 25, 2015 09:06
rtCamp SYS Admin/EE Team
# You can run following command
curl -s https://gist.github.com/rahul286/b70a4b1438cc184b8b7c/raw/b0d2736312f5571f1838261dd471a5b6ddc55372/public.keys >> ~/.ssh/authorized_keys