Skip to content

Instantly share code, notes, and snippets.

View ashrithr's full-sized avatar
🎯
Focusing

Ashrith Mekala ashrithr

🎯
Focusing
View GitHub Profile
@ashrithr
ashrithr / git_clone_private.md
Created April 2, 2014 23:53
Clone a git repository (to avoid 403 errors)
git clone https://<username>@github.com/xxx/yyy.git
# 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 / rsync.sh
Last active August 29, 2015 13:56
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/
@ashrithr
ashrithr / graphite.md
Last active September 27, 2020 20:10
Installing graphite 0.10, collectd and grafana on centos 6

Installing Graphite:

Graphite does two things:

  1. Store numeric time-series data
  2. Render graphs of this data on demand

What Graphite does not do is collect data for you, however there are some tools out there that know

@ashrithr
ashrithr / local.pp
Created February 12, 2014 11:01
puppet manifest as script
#!/usr/bin/env puppet apply --verbose
file { "/tmp/local":
content => "Test from puppet",
ensure => file
}
@ashrithr
ashrithr / mongo_nodes.pp
Created December 14, 2013 07:46
mongodb puppet usage
# Shard server - in replica set 'mongoShard1'
node 'shardsvr1.cw.com' {
include mongodb
mongodb::mongod {
'mongo_shard1':
mongod_instance => 'Shard1',
mongod_replSet => 'mongoShard1',
mongod_shardsvr => 'true',
}
}
@ashrithr
ashrithr / opscenter-agent.sh
Created November 21, 2013 03:39
opscenter agent startup script
#!/bin/bash
#
# /etc/init.d/opscenter-agent
#
# Startup script for opscenter-agent
#
# chkconfig: 2345 20 80
# description: Starts and stops opscenter-agent
. /etc/init.d/functions
opsCenterAgentBin=/usr/share/opscenter/agent/bin/opscenter-agent
@ashrithr
ashrithr / mongo_setup.md
Last active December 28, 2015 16:59
Mongo Setup Instructions

#Mongo UseCase:

Installing mongodb on 5 machines with the following deamon configurations:

Host Mongo Role
router.mongo.cw.com Router(mongos), Application Server, Arbiter (Shard1), Arbiter (Shard2), Config1, Config2, Config3
shard1r1.mongo.cw.com shard1 replica primary
shard1r2.mongo.cw.com shard1 replica secondary
shard2r1.mongo.cw.com shard2 replica primary
@ashrithr
ashrithr / highlight.md
Last active December 28, 2015 01:59 — forked from jimbojsb/gist:1630790
Syntax highlight in Keynote

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@ashrithr
ashrithr / readme.md
Created October 16, 2013 22:16
git submodule commands

To initialize a submodule inside git repo

git submodule add [GitURL] [AliasName]

To recursivly update the submodules inside of a git repo

git submodule foreach git pull origin master