Skip to content

Instantly share code, notes, and snippets.

View Laxman-SM's full-sized avatar

Laxman Singh Laxman-SM

  • Ex-Phenome, Ex-Intertrust, Ex-Wipro
  • US, Hyderabad (india)
View GitHub Profile
#!/bin/bash
echo "Starting the Cluster on Docker Swarm"
docker pull jayjohnson/rabbitclusternode
docker network create -d overlay testoverlay
swarmnodes="swarm1.internallevvel.com swarm2.internallevvel.com swarm3.internallevvel.com"
for node in $swarmnodes
#!/bin/bash
#http://levvel.io/blog-post/running-distributed-docker-swarm-on-aws/
# Allow toggling components to install and update based off flags
updateconsul=1
updatedocker=1
updatedockermachine=1
updatedockercompose=1
updatedockerswarm=1
consulversion="0.5.2"
DOCKER_EMAIL Your Docker Hub Email
DOCKER_USERNAME Your Docker Hub User Name
DOCKER_PASSWORD Your Docker Hub Password
@Laxman-SM
Laxman-SM / datadog-nginx
Created February 6, 2016 05:13 — forked from gane5h/datadog-nginx
Nginx log parsing with datadog
"""
Custom parser for nginx log suitable for use by Datadog 'dogstreams'.
To use, add to datadog.conf as follows:
dogstreams: [path to ngnix log (e.g: "/var/log/nginx/access.log"]:[path to this python script (e.g "/usr/share/datadog/agent/dogstream/nginx.py")]:[name of parsing method of this file ("parse")]
so, an example line would be:
dogstreams: /var/log/nginx/access.log:/usr/share/datadog/agent/dogstream/nginx.py:parse
Log of nginx should be defined like that:
log_format time_log '$time_local "$request" S=$status $bytes_sent T=$request_time R=$http_x_forwarded_for';
when starting dd-agent, you can find the collector.log and check if the dogstream initialized successfully
"""
@Laxman-SM
Laxman-SM / README.md
Created June 15, 2016 07:43 — forked from oodavid/README.md
Backup MySQL to Amazon S3

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

#!/bin/bash
repo="<DEBIAN REPO FQDN>"
outputDir="<DIRECTORY TO STORE DEBIAN FILES>"
arch="<ARCH like binary-i386 or binary-amd64>"
echo "Download All Debs from Repository($repo) to dir($outputDir)"
pushd $outputDir >> /dev/null
packagenames=`wget -q -O - http://$repo/pool/main/h | grep deb | grep href | sed -e 's/\/"/ /g' | sed -e 's/"/ /g' | awk '{print $3}'`
@Laxman-SM
Laxman-SM / ratelimit.nginxconf
Created July 1, 2016 07:49 — forked from ipmb/ratelimit.nginxconf
Nginx reverse proxy with rate limiting
upstream myapp {
server 127.0.0.1:8081;
}
limit_req_zone $binary_remote_addr zone=login:10m rate=1r/s;
server {
listen 443 ssl spdy;
server_name _;
@Laxman-SM
Laxman-SM / install_latest_docker_compose.sh
Created July 1, 2016 13:32 — forked from luislobo/install_latest_docker_compose.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@Laxman-SM
Laxman-SM / overlay-docker-systemd.sh
Created July 4, 2016 12:10 — forked from cpswan/overlay-docker-systemd.sh
Configure systemd to use overlay file system for Docker
sudo mkdir /etc/systemd/system/docker.service.d
sudo bash -c 'cat <<EOF > /etc/systemd/system/docker.service.d/overlay.conf
[Service]
ExecStart=
ExecStart=/usr/bin/docker daemon -H fd:// --storage-driver=overlay
EOF'
sudo systemctl daemon-reload
sudo systemctl restart docker
@Laxman-SM
Laxman-SM / setup-go-swarmkit.sh
Created July 18, 2016 20:01 — forked from katopz/setup-go-swarmkit.sh
Lazy setup go lang for build swarmkit
# Install homebrew.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install go.
brew install go
# Export path as homebrew suggest.
echo export PATH=$PATH:/usr/local/opt/go/libexec/bin >> ~/.bashrc
# Export gopath to $HOME/go
echo 'export GOPATH=$HOME/go' >> ~/.bash_profile
# Excute bash_profile.
. ~/.bash_profile