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
ashrithr / ssh_quit.md
Created Sep 27, 2014
Close frozen ssh connection
@ashrithr
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)
else
@ashrithr
ashrithr / elk_puppet.md
Created Sep 15, 2014
Installing & Configuring logstash, elasticsearch, logstash-forwarder using Puppet
View elk_puppet.md

Install puppet server and clients

Puppet Server

curl -s https://raw.githubusercontent.com/cloudwicklabs/scripts/master/puppet_install.sh | bash /dev/stdin -s -a -v

Puppet Client

@ashrithr
ashrithr / oracle_jdk.sh
Last active Aug 22, 2016
wget oracle jdk
View oracle_jdk.sh
# RPM
wget --no-check-certificate \
--no-cookies \
--header "Cookie: oraclelicense=accept-securebackup-cookie" \
http://download.oracle.com/otn-pub/java/jdk/7u45-b18/jdk-7u45-linux-x64.rpm \
-O jdk-7u45-linux-x64.rpm
# TAR GZ
wget --no-check-certificate \
--no-cookies \
@ashrithr
ashrithr / github_fork_update.md
Last active Aug 29, 2015
Updating github fork
View github_fork_update.md
  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://github.com/author/project.git
    
  3. Pull the new commits from the original repo

View osx-for-hackers.sh
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
@ashrithr
ashrithr / readme.md
Last active Jan 2, 2019
Installing ELK on a single machine
View readme.md

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 https://dl.dropboxusercontent.com/u/5756075/jdk-7u45-linux-x64.rpm
@ashrithr
ashrithr / kerberos_setup.md
Last active Oct 13, 2019
Set up kerberos on Redhat/CentOS 7
View kerberos_setup.md

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 cw.com is the domain name, make a note of the domain name here):

  • Kerberos KDC Server: kdc.cw.com
  • Kerberos Client: kclient.cw.com

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
ashrithr / iptables_rhel7.md
Created Aug 2, 2014
Enabling IPTables in RHEL/CentOS 7
View iptables_rhel7.md

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
NAME=en0xxxxxx
NM_CONTROLLED=no
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
You can’t perform that action at this time.