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 / local.pp
Created Feb 12, 2014
puppet manifest as script
View local.pp
#!/usr/bin/env puppet apply --verbose
file { "/tmp/local":
content => "Test from puppet",
ensure => file
ashrithr /
Last active Aug 29, 2015
rsync using ssh protocol and exclude flag
rsync -rav -e 'ssh -i /Users/ashrith/.ssh/aws.pem' --exclude=".git/*" ${SOURCE_PATH} root@${HOST}:${PATH}
# Copying to remote server with out root user:
# for this command to work make sure the 'Defaults requiretty' is commented on the remote server in '/etc/sudoers' file
rsync -rav -e 'ssh -i /root/to/key' --rsync-path="sudo rsync" /path/to/copy/* rsyncuser@${HOST}:/dest/path/
View gist:9461701
# From a fresh install of squeeze
apt-get install ruby rubygems # Need ruby to use fpm
gem1.8 install fpm --no-ri --no-rdoc
apt-get install build-essential openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev ncurses-dev libyaml-dev
tar -zxvf ruby-1.9.3-p125.tar.gz
cd ruby-1.9.3-p125
rm -rf /tmp/ruby193
ashrithr /
Created Apr 2, 2014
Clone a git repository (to avoid 403 errors)
git clone https://<username>
ashrithr /
Created Apr 5, 2014
Send foreground process to background

Using the Job Control of bash to send the process into the background:

  1. ctrl+z to stop (pause) the program and get back to the shell
  2. bg to run it in the background
  3. disown -h [job-spec] where [job-spec] is the job number (like %1 for the first running job; find about your number with the jobs command) so that the job isn't killed when the terminal closes
ashrithr / pom.xml
Created Apr 16, 2014
YCSB Hbase CDH5 pom YCSB/hbase/pom.xml
View pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="" xmlns:xsi="" xsi:schemaLocation="">
ashrithr / pm.scala
Last active Aug 29, 2015
scala pattern match on instances of the class
View pm.scala
def test[T](t: T) = t match {
case _: Int => println("Got int" + t)
case _: String => println("Got string" + t)
case _ => println("I dont know what that is" + t)

Config file:

cat > ~/.i2csshrc <<EOF
version: 2
    login: ec2-user

config file:

cat > aws_hosts <<EOF
clusters = kafka_cluster spark_cluster cass_cluster all
kafka_cluster =
spark_cluster =
cass_cluster =
all =
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.