Skip to content

Instantly share code, notes, and snippets.

@mohanpedala
mohanpedala / bash_strict_mode.md
Last active May 8, 2024 20:45
set -e, -u, -o, -x pipefail explanation
@mohanpedala
mohanpedala / Docker_networks.md
Last active July 31, 2018 22:04
Docker networking

Bridge

a bridge network uses a software bridge which allows containers connected to the same bridge network to communicate, while providing isolation from containers which are not connected to that bridge network. The Docker bridge driver automatically installs rules in the host machine so that containers on different bridge networks cannot communicate directly with each other.

Bridge networks apply to containers running on the same Docker daemon host. For communication among containers running on different Docker daemon hosts, you can either manage routing at the OS level, or you can use an overlay network.

  • User-defined bridges provide better isolation and interoperability between containerized applications.
  • User-defined bridges provide automatic DNS resolution between containers.

Reference click here

@mohanpedala
mohanpedala / Docker_compose_version_diff.md
Last active July 31, 2018 18:13
Docker Compose version differences

Following table captures the main differences between Compose versions:

Feature Compose v1 Compose v2 Compose v3
Docker engine version 1.9.1+ 1.10.0+ 1.13.0+
Compose version Compose up to 1.6.x Compose 1.6.0+ Compose 1.10.0+
Connect containers Bridge network, need links Overlay supported, networks can be used to connect containers Overlay supported, networks can be used to connect containers
Volume No named volume Named volume supported Named volume supported
Swarm capability Older swarm Older swarm Swarm mode
@mohanpedala
mohanpedala / node_installation_rhel.md
Last active August 13, 2018 21:29
Node Installation on RHEL 7.*

Node Installation

  • Copy Tar file
  • Untar tar file
$ tar -xvf <file name>
  • Change name from node-v6.9.5-linux.**** to node-v6.9.5
$ mv node-v6.9.5-linux-x64 node
@mohanpedala
mohanpedala / nagios_rhel_installation.md
Last active June 21, 2018 17:04
Nagios Installation on RHEL 7.4
@mohanpedala
mohanpedala / Java_heap_dump.md
Last active June 17, 2018 19:29
Java_heap_dump
  1. jmap

jmap prints heap dumps into a specified file location. This tool is packaged within JDK. It can be found in \bin folder.

Here is how you should invoke jmap:

jmap -dump:format=b,file=<file-path> <pid>

where
pid: is the Java Process Id, whose heap dump should be captured
@mohanpedala
mohanpedala / setup_k8s_jenkins.txt
Last active June 18, 2018 19:03
CI/CD — setup Jenkins on Kubernetes cluster
https://www.blazemeter.com/blog/how-to-setup-scalable-jenkins-on-top-of-a-kubernetes-cluster
@mohanpedala
mohanpedala / python_pip_ssl_issue.md
Last active April 29, 2019 18:05
python pip ssl issue while installing requirements and boto3 installation for python3
  • You can ignore SSL errors by setting pypi.org and files.pythonhosted.org as trusted hosts.
pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org <package_name>

Note: Sometime during April 2018, the Python Package Index was migrated from pypi.python.org to pypi.org. This means "trusted-host" commands using the old domain no longer work.

  • Permanent Fix: You may want to add the trusted hosts and proxy to your config file.
mkdir -p ~/.config/pip
@mohanpedala
mohanpedala / bash_best_practice.md
Last active July 25, 2018 23:00
Bash Script best practice
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail

# Set magic variables for current file & dir
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
echo "INFO : __dir is ${__dir}"
__file="${__dir}/$(basename "${BASH_SOURCE[0]}")"
@mohanpedala
mohanpedala / Install_docker_ce_rhel.md
Last active March 9, 2018 21:22
Install Docker-ce on RHEL

Installation of Docker-CE on RHEL

  • Pre-req: Need sudo access
Verify OS
  • Verify sudo access by running below command
sudo ls