Skip to content

Instantly share code, notes, and snippets.

View timusg's full-sized avatar
🎯
Focusing

sumit gupta timusg

🎯
Focusing
View GitHub Profile
@timusg
timusg / remove_passphrase.sh
Created January 17, 2014 10:22
openssl decrypt pass phrase protected key
openssl rsa -in foo.pem -out bar.pem
@timusg
timusg / terminology-ubuntu.sh
Created January 14, 2014 11:14
terminology ubuntu install
sudo add-apt-repository ppa:hannes-janetzek/enlightenment-svn
sudo apt-get update
sudo apt-get install terminology
@timusg
timusg / keepalived-eip-switch.erb.sh
Last active October 20, 2016 21:01
keepalived notification script for switch elastic ip, helpful to setup highly available haproxy in ec2/VPC
#!/bin/bash
export EC2_HOME=/usr/local/share/ec2_tools/
export JAVA_HOME=/usr/lib/jvm/java
export PATH=$PATH:$EC2_HOME/bin
INSTANCEID=`curl -s http://169.254.169.254/latest/meta-data/instance-id`
case "$1" in
MASTER)
logger triggering notify master event
#!/usr/bin/env knife exec
# A knife exec script to change chef node's name, preserving all the attributes.
#
# Usage: knife exec rename-node.rb old-name new-name
#
# Script retrieves the Node object, changes its 'name' attribute,
# creates new Node object with updated name and rest of attributes
# untouched. Then it deletes old Node and Client objects from
# database, and logs into the server to update it:
@timusg
timusg / Dockerfile
Created December 4, 2013 16:19
configure SSH server on docker CentOS base image
FROM centos
RUN yum install -y sudo openssh-server openssh-clients
RUN yum install -y passwd
RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config
RUN sed -ri 's/#UsePAM no/UsePAM no/g' /etc/ssh/sshd_config
# fix for ssh connection issue
RUN ssh-keygen -b 1024 -t rsa -f /etc/ssh/ssh_host_key
RUN ssh-keygen -b 1024 -t rsa -f /etc/ssh/ssh_host_rsa_key
@timusg
timusg / docker_client_in_mac.sh
Last active December 30, 2015 00:59
manage remote docker instances from mac
mkdir tmp
export GOPATH=`pwd`/tmp
go get -v github.com/dotcloud/docker/docker
# (this may take some time)
sudo cp tmp/bin/docker /usr/local/bin/
rm -rf tmp
cd tmp/src/github.com/dotcloud/docker
git checkout v0.6.7
@timusg
timusg / kibana-docker
Created November 30, 2013 04:47
kibana milestone 4 docker file
FROM base
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y wget nginx-full
RUN (cd /tmp && wget --no-check-certificate https://download.elasticsearch.org/kibana/kibana/kibana-3.0.0milestone4.tar.gz -O pkg.tar.gz && tar zxf pkg.tar.gz && cd kibana-* && cp -rf ./* /usr/share/nginx/www/)
RUN ( sed -i 's/elasticsearch: .*$/elasticsearch: "http:\/\/10.130.1.70:9200",/' /usr/share/nginx/www/config.js)
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
RUN rm -rf /tmp/*
EXPOSE 80
CMD ["/usr/sbin/nginx","-c", "/etc/nginx/nginx.conf"]
@timusg
timusg / elasticsearch-centos-dockerfile
Last active December 29, 2015 18:19
install elastic search and java 7 in centos
from centos
MAINTAINER timusg "http://timusg.com"
RUN yum -y install java-1.7.0-openjdk
RUN wget --no-check-certificate https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.2.tar.gz
RUN tar -xf elasticsearch-0.90.2.tar.gz
RUN rm elasticsearch-0.90.2.tar.gz
EXPOSE :9300
@timusg
timusg / install-docker.sh
Last active December 28, 2015 07:29
install docker in ubuntu 12.04 x86
sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -"
# Add the Docker repository to your apt sources list.
sudo sh -c "echo deb http://get.docker.io/ubuntu docker main\
> /etc/apt/sources.list.d/docker.list"
# Update your sources
sudo apt-get update
# Install, you will see another warning that the package cannot be authenticated. Confirm install.
@timusg
timusg / chef-server.sh
Last active December 28, 2015 07:29
install chef server on ubuntu
wget https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chef-server_11.0.8-1.ubuntu.12.04_amd64.deb
dpkg -i chef-server_11.0.8-1.ubuntu.12.04_amd64.deb
sudo chef-server-ctl reconfigure