Skip to content

Instantly share code, notes, and snippets.

@vpack
vpack / Makefile
Created November 20, 2019 12:56
hap
cat Makefile
net:
docker network create --driver overlay --attachable mynet
n1:
docker run -d --net mynet --name green nginx
n2:
docker run -d --net mynet --name blue nginx
n3:
docker run -d --net mynet --name red nginx
h:
@vpack
vpack / shutdownontimer.md
Created July 4, 2019 20:21
Shutdown AWS host on timer

On several occations, I have spin up my test host in AWS and left if running for months without using it. I wanted this instance to shutdown on timer. I can always start it up anytime - that does not bother me.

Here is sample code;

[root@ip-172-30-0-62 ~]# crontab -l
* * * * * date >> /var/log/cron-date
* * * * * /root/shutdown-timer >> /var/log/shutdown.log 2>&1
[root@ip-172-30-0-62 ~]# cat shutdown-timer
@vpack
vpack / Aathichudi.md
Created February 17, 2019 02:13
Tamil

அ அறம் செய விரும்பு ஆ ஆறுவது சினம் இ இயல்வது கரவேல் ஈ ஈவது விலக்கேல் உ உடையது விளம்பேல் ஊ ஊக்கமது கைவிடேல் எ எண் எழுத்து இகழேல் ஏ ஏற்பது இகழ்ச்சி ஐ ஐயமிட்டு உண் ஒ ஒப்புர வொழுகு

socat - UNIX-CLIENT:/tmp/.newrelic.sock
nc -U /tmp/.newrelic.sock
@vpack
vpack / DockerEntryPoints.md
Created June 18, 2017 16:10
Docker Entrypoint Samples

Sample Entry Point scripts

from HAProxy container

cat docker-entrypoint.sh
#!/bin/sh
set -e
@vpack
vpack / vim
Last active June 18, 2017 13:31
Vi Commands
To hide all commented line:
```
:g!/^ *#/p
:g!/^[ \t]*#/p
#:g!/^[ \t]*#\|/^[ \t]$/p
```
Reference:
@vpack
vpack / timeZone_AmazonLinux.md
Last active October 7, 2016 22:58
Amazon Linux : timezone setup
# sudo ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
# sudo cat /etc/sysconfig/clock
ZONE="America/New_York"
UTC=true
# sudo reboot
@vpack
vpack / Prometheus.md
Last active August 10, 2016 12:11
Prometheus

Collect metrics from Docker Host:

docker run -d -p 9104:9104 -v /sys/fs/cgroup:/cgroup -v /var/run/docker.sock:/var/run/docker.sock prom/container-exporter

Server:

@vpack
vpack / vimdiff.md
Created July 11, 2016 15:36
vimdiff

Simple and easy way to compare old and new files especially working with git merge.

vimdiff file1 file2
vim -d file1 file2

Commands:

]c - next diff