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 / 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
ashrithr / rsync.sh
Last active Aug 29, 2015
rsync using ssh protocol and exclude flag
View rsync.sh
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
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
tar -zxvf ruby-1.9.3-p125.tar.gz
cd ruby-1.9.3-p125
rm -rf /tmp/ruby193
@ashrithr
ashrithr / git_clone_private.md
Created Apr 2, 2014
Clone a git repository (to avoid 403 errors)
View git_clone_private.md
git clone https://<username>@github.com/xxx/yyy.git
@ashrithr
ashrithr / detach_process.md
Created Apr 5, 2014
Send foreground process to background
View detach_process.md

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
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="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.yahoo.ycsb</groupId>
<artifactId>root</artifactId>
<version>0.1.4</version>
</parent>
<artifactId>hbase-binding</artifactId>
@ashrithr
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)
}
View Usage.md

Config file:

cat > ~/.i2csshrc <<EOF
---
version: 2
clusters:
  kafka_cluster:
    login: ec2-user
    hosts:
View Usage.md

config file:

cat > aws_hosts <<EOF
clusters = kafka_cluster spark_cluster cass_cluster all
kafka_cluster = ec2-54-219-114-64.us-west-1.compute.amazonaws.com ec2-204-236-188-149.us-west-1.compute.amazonaws.com ec2-54-193-135-104.us-west-1.compute.amazonaws.com
spark_cluster = ec2-54-219-87-178.us-west-1.compute.amazonaws.com ec2-204-236-137-42.us-west-1.compute.amazonaws.com ec2-54-219-117-253.us-west-1.compute.amazonaws.com
cass_cluster = ec2-50-18-10-150.us-west-1.compute.amazonaws.com ec2-54-219-230-45.us-west-1.compute.amazonaws.com ec2-50-18-12-57.us-west-1.compute.amazonaws.com
all = ec2-54-219-114-64.us-west-1.compute.amazonaws.com ec2-204-236-188-149.us-west-1.compute.amazonaws.com ec2-54-193-135-104.us-west-1.compute.amazonaws.com ec2-54-219-87-178.us-west-1.compute.amazonaws.com ec2-204-236-137-42.us-west-1.compute.amazonaws.com ec2-54-219-117-253.us-west-1.compute.amazonaws.com ec2-50-18-10-150.us-west-1.compute.amazonaws.com ec2-54-219-230-45.us-west-1.compute.amazonaws.com ec2-50-18-12-57.us-
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.