Skip to content

Instantly share code, notes, and snippets.

View parmarsumit's full-sized avatar

sumit_jud parmarsumit

View GitHub Profile
@parmarsumit
parmarsumit / build-tag-push.py
Created November 1, 2019 13:25 — forked from peatiscoding/build-tag-push.py
a script to convert your docker-compose.yml (version 2) with build node to image node; this script required DOCKERHUB_USER environment available.
#!/usr/bin/python
import os
import subprocess
import time
import yaml
import re
user_name = os.environ.get("DOCKERHUB_USER")
@parmarsumit
parmarsumit / 1_kubernetes_on_macOS.md
Created April 1, 2019 10:50 — forked from kevin-smets/1_kubernetes_on_macOS.md
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

@parmarsumit
parmarsumit / nginxproxy.md
Created December 12, 2018 15:03 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

wget http://stedolan.github.io/jq/download/linux64/jq
aws ec2 describe-instances --filters "Name=tag:Name,Values=$NAME" \
"Name=instance-state-name,Values=running" \
| jq -r \
".Reservations[] | .Instances[] | .InstanceId" \
aws ec2 describe-volumes --filters \
"Name=status,Values=available" \
| jq -r ".Volumes[] | .VolumeId" \
@parmarsumit
parmarsumit / gist:989755f6447cecb40b39788f24ca5918
Created February 4, 2018 14:45 — forked from serkanh/gist:c75a323218cc220f8ea188066838faaa
aws user-data script to monitor memory & volume utilization of ec2 instances
#/bin/bash
sudo yum install unzip wget perl-Switch perl-DateTime perl-Sys-Syslog perl-LWP-Protocol-https perl-Digest-SHA -y
wget -O ~ec2-user/CloudWatchMonitoringScripts-1.2.1.zip http://aws-cloudwatch.s3.amazonaws.com/downloads/CloudWatchMonitoringScripts-1.2.1.zip
cd ~ec2-user && unzip CloudWatchMonitoringScripts-1.2.1.zip
chown ec2-user:ec2-user ~ec2-user/aws-scripts-mon
rm CloudWatchMonitoringScripts-1.2.1.zip
crontab -l > ~ec2-user/mycron
echo "*/5 * * * * ~ec2-user/aws-scripts-mon/mon-put-instance-data.pl --disk-space-util --disk-path=/ --from-cron" >> ~ec2-user/mycron
echo "*/5 * * * * ~ec2-user/aws-scripts-mon/mon-put-instance-data.pl --mem-used --mem-avail --swap-used" >> ~ec2-user/mycron
crontab ~ec2-user/mycron
@parmarsumit
parmarsumit / 2016-devops-conf-playlist.md
Created October 7, 2016 08:05 — forked from miglen/2016-devops-conf-playlist.md
2016 DevOps Conferences - Video playlists