Skip to content

Instantly share code, notes, and snippets.

@rahulkrishnanfs
rahulkrishnanfs / git-commands
Last active January 29, 2017 16:53
Useful git commands for developers
Development Tips:
git: 1) Copy files from one branch to another branch
syntax: $git show :/path/filename > /path/<filename>
@rahulkrishnanfs
rahulkrishnanfs / gist:79b686a7f45ded308435688491441ed5
Last active January 29, 2017 16:52
Vagrantfile Example to create more that one VM using precise32 box
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define "vagrant1" do |vagrant1|
@rahulkrishnanfs
rahulkrishnanfs / Adding repository in Debian and Ubuntu
Last active March 14, 2023 14:08
add-apt-repository for adding repository in /etc/apt/sources.list
We can add the repository url to the /etc/apt/sources.list using add-apt-repository
$ sudo apt-get install python-software-properties ---------------> Package name
#### Package will be available in https://packages.debian.org/jessie/admin/python-software-properties
example adding the docker repository to the debian sources.list
$ sudo add-apt-repository "deb https://apt.dockerproject.org/repo debian-$(lsb_release -cs) main"
@rahulkrishnanfs
rahulkrishnanfs / docker info explanation
Last active February 2, 2017 08:31
Detailed information about the docker info
### Docker info
root@ip-10-0-2-87:~# docker info
Containers: 0 --------------------> ; Show containers present on the node evenif it is running or stopped
Running: 0 --------------------> ; Currently running container #### $docker ps
Paused: 0 --------------------> ; Paused Containers ;;##
; $docker unpause <Container ID> -> To unpause
Stopped: 0 --------------------> ; Currently stopeed containers #### $docker ps -a -------> To check the stopped containers
; $docker start <Container ID> ----> to start the container
@rahulkrishnanfs
rahulkrishnanfs / Realtime docker containers events
Created February 2, 2017 08:39
Intense Troubleshooting Docker
Intense Troubleshooting Docker
############ Debug the docker-engine
$dockerd --debug
Output
---------------------
DEBU[0000] docker group found. gid: 999
DEBU[0000] Listener created for HTTP on unix (/var/run/docker.sock)
INFO[0000] libcontainerd: new containerd process, pid: 7996
@rahulkrishnanfs
rahulkrishnanfs / copy files with extention
Created February 2, 2017 13:16
copy files with extention
#!/bin/bash
SRC=$1
DEST=$2
EXT=$3
if [ -d $1 -a -d $2 ];then
for file in `ls *.$EXT `;do
name=$(echo $file | cut -d "." -f1)
if [ -d $DEST/$name ];then
cp $SRC/$file $DEST/$name/$file
@rahulkrishnanfs
rahulkrishnanfs / Ansible Facts Indepth Analysis
Last active February 3, 2017 05:01
Parsing the Ansible Facts Gathered from the server using " -m setup "
Ansible Facts will be in Json object
@rahulkrishnanfs
rahulkrishnanfs / Ansible Dynamic inventory - Ansible
Created February 3, 2017 09:34
AWS Dynamic inventory Script Testing - Ansible
Tesing on
-------------------
Distributor ID: Debian
Description: Debian GNU/Linux 8.6 (jessie)
Release: 8.6
Codename: jessie
Steps to follow:
@rahulkrishnanfs
rahulkrishnanfs / gist:2424cd12429afbd9edb193c9115d1f5f
Created May 31, 2017 09:30
Bitbucket deployment in kubernetes
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: bitbucket
labels:
app : bitbucket
spec:
template:
@rahulkrishnanfs
rahulkrishnanfs / kubernetes installation using kubeadm
Last active January 9, 2018 18:12
kubernetes installation using kubeadm
OS Required: Ubuntu 16 - xenial
Master node creation
---------------------------
The first step of initialising the cluster is to launch the master node.
The master is responsible for running the control plane components, etcd and the API server.