Skip to content

Instantly share code, notes, and snippets.

View anilshrish's full-sized avatar
🎯
Focusing

Anil Shrish anilshrish

🎯
Focusing
View GitHub Profile
@anilshrish
anilshrish / tmux-cheatsheet.markdown
Created February 13, 2022 17:05 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@anilshrish
anilshrish / Main.tf
Created November 17, 2020 12:43 — forked from PrashantBhatasana/Main.tf
Terraform -  AWS VPC with Private, Public Subnets with NAT
/*==== The VPC ======*/
resource "aws_vpc" "vpc" {
cidr_block = "${var.vpc_cidr}"
enable_dns_hostnames = true
enable_dns_support = true
tags = {
Name = "${var.environment}-vpc"
Environment = "${var.environment}"
}
}
@anilshrish
anilshrish / teams-chat-post.sh
Created May 19, 2020 08:12 — forked from chusiang/teams-chat-post.sh
Post a message to Microsoft Teams with bash script.
#!/bin/sh
# =============================================================================
# Author: Chu-Siang Lai / chusiang (at) drx.tw
# Filename: teams-chat-post.sh
# Modified: 2018-03-28 15:04
# Description: Post a message to Microsoft Teams.
# Reference:
#
# - https://gist.github.com/chusiang/895f6406fbf9285c58ad0a3ace13d025
#

mdadm

Glossary:

  • md: multiple devices
command description
cat /proc/mdstat show status of all raids
mdadm --detail /dev/md0 detailed status of raid md0
@anilshrish
anilshrish / retry.py
Created April 8, 2020 10:55 — forked from FBosler/retry.py
retry.py
from functools import wraps
import time
import logging
import random
logger = logging.getLogger(__name__)
def retry(exceptions, total_tries=4, initial_wait=0.5, backoff_factor=2, logger=None):
"""
@anilshrish
anilshrish / change_docker_root_folder.txt
Created July 15, 2019 09:02 — forked from jokla/change_docker_root_folder.txt
Change Docker root folder Ubuntu 14.04 and Ubuntu 16.04
$ sudo service docker stop
$ gksudo gedit /etc/default/docker
# Use DOCKER_OPTS to modify the daemon startup options.
DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4 -g /home/jokla/docker/docker/"
$ sudo service docker start
UBUNTU 16.04

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
@anilshrish
anilshrish / node_exporter.sh
Created July 2, 2018 05:39 — forked from galexrt/node_exporter.sh
Simple Prometheus node_exporter install script
#!/bin/bash
version="${VERSION:-0.14.0}"
arch="${ARCH:-linux-amd64}"
bin_dir="${BIN_DIR:-/usr/local/bin}"
wget "https://github.com/prometheus/node_exporter/releases/download/v$version/node_exporter-$version.$arch.tar.gz" \
-O /tmp/node_exporter.tar.gz
mkdir -p /tmp/node_exporter
@anilshrish
anilshrish / rabbitmq-cluster.md
Created January 3, 2018 11:39 — forked from pobsuwan/rabbitmq-cluster.md
How to config rabbitmq server cluster [3 nodes]

How to config rabbitmq server cluster [3 nodes]

Do after install SLGInstallers

Edit /etc/hosts

vi /etc/hosts
192.168.10.157  rabbitmq-1
192.168.10.159  rabbitmq-2
192.168.10.161  rabbitmq-3