Skip to content

Instantly share code, notes, and snippets.

Ashrith Mekala ashrithr

Block or report user

Report or block ashrithr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ashrithr /
Created Sep 27, 2014
Close frozen ssh connection
ashrithr / recursion.scala
Last active Aug 29, 2015
Scala Recursions and Tail call optimization
View recursion.scala
import scala.annotation.tailrec
object fact {
// n! = n * (n-1) * (n-2) * ... * 2 * 1
// n! = if (n>1) n * (n-1)! else 1
def factorial(n: Int): Int =
if (n > 1)
n * factorial(n - 1)
ashrithr /
Created Sep 15, 2014
Installing & Configuring logstash, elasticsearch, logstash-forwarder using Puppet

Install puppet server and clients

Puppet Server

curl -s | bash /dev/stdin -s -a -v

Puppet Client

ashrithr /
Last active Aug 22, 2016
wget oracle jdk
wget --no-check-certificate \
--no-cookies \
--header "Cookie: oraclelicense=accept-securebackup-cookie" \ \
-O jdk-7u45-linux-x64.rpm
wget --no-check-certificate \
--no-cookies \
ashrithr /
Last active Aug 29, 2015
Updating github fork
  1. cd into the forked repository directory that you want to update

     cd repository_dir
  2. Add a new remote to point to the original repository

     git remote add upstream git://
  3. Pull the new commits from the original repo

# Some things taken from here
# Set the colours you can use
ashrithr /
Last active Jan 2, 2019
Installing ELK on a single machine

Installing ELK (CentOS)

This is a short step-by-step guide on installing ElasticSearch LogStash and Kibana Stack on a CentOS environment to gather and analyze logs.

I. Install JDK

rpm -ivh
ashrithr /
Last active Oct 13, 2019
Set up kerberos on Redhat/CentOS 7

Installing Kerberos on Redhat 7

This installation is going to require 2 servers one acts as kerberos KDC server and the other machine is going to be client. Lets assume the FQDN's are (here is the domain name, make a note of the domain name here):

  • Kerberos KDC Server:
  • Kerberos Client:

Important: Make sure that both systems have their hostnames properly set and both systems have the hostnames and IP addresses of both systems in

ashrithr /
Created Aug 2, 2014
Enabling IPTables in RHEL/CentOS 7

Firewalld, if included in RHEL 7, is a replacement for iptables and is being included as default. Some benefits include not needing to restart the firewall when changes are made, which means your system maintains its firewall during rule modification, and current connections are not lost.

Anyhow, if you are not willing to migrate to Firewalld and want to use iptables as default, follow these steps:

Install iptables service:

yum install -y iptables-services
View centos7_static_ip.bash
## Get a list of NIC names using `ifconfig -a` or `ip -a`
# vi /etc/sysconfig/network-scripts/ifcfg-en0xxxxxxx
You can’t perform that action at this time.