Skip to content

Instantly share code, notes, and snippets.

View yarapavan's full-sized avatar

Pavan Yara yarapavan

  • Bangalore
View GitHub Profile
@yarapavan
yarapavan / sample-euca-vagrantfile
Created July 14, 2013 18:39
Sample Vagrantfile - Tested with Eucalyptus 3.3.0 + Vagrant 1.2.3 + vagrant-aws 0.2.2
Vagrant.configure("2") do |config|
config.vm.box = "demo"
config.vm.provider :aws do |aws,override|
aws.access_key_id = "xxxxxxxxxxxxxxxxxxxxx"
aws.secret_access_key = "xxxxxxxxxxxxxxxxxxxxx"
aws.keypair_name = "euca33-key"
aws.ami = "emi-C9A43A41"
override.ssh.username ="root"
override.ssh.private_key_path ="/user/credentials/euca33-key.private"
aws.security_groups = ["default"]
@yarapavan
yarapavan / ssh-tips-1
Last active December 20, 2015 06:49
SSH Tips -1
===ESCAPE CHARACTERS===
When a pseudo-terminal has been requested, ssh supports a number of func‐
tions through the use of an escape character.
A single tilde character can be sent as ~~ or by following the tilde by a
character other than those described below. The escape character must
always follow a newline to be interpreted as special. The escape charac‐
ter can be changed in configuration files using the EscapeChar configura‐
tion directive or on the command line by the -e option.
@yarapavan
yarapavan / ipython-dockerfile
Last active December 20, 2015 21:49
Dockerfile for iPython
FROM ubuntu
MAINTAINER Pavan Yara "yarapavan@gmail.com"
RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ precise universe" >> /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y python-setuptools python-pip python-numpy python-scipy python-matplotlib python-pandas python-sympy python-nose
RUN pip install ipython jinja2 pyzmq readline tornado requests
RUN apt-get install -y openssh-server supervisor
ADD sshd.conf /etc/supervisor/conf.d/sshd.conf
@yarapavan
yarapavan / jekyll-notes
Last active August 29, 2015 14:02
Jekyll Stuff
on Ubuntu 12.04 32-bit OS
LC_ALL="en_US.UTF-8" jekyll serve
'
Latest GSL
sudo gem install --conservative --no-ri --no-rdoc gsl
@yarapavan
yarapavan / Miscelli
Last active August 29, 2015 14:02
Miscelli
Extract html links:
lynx -dump -listonly html.htm
grep -oP "(?<=src=\")[^\"]+(?=\")" test.txtgrep -oP "(?<=src=\")[^\"]+(?=\")" html.txt
awk -F\" '{print $(NF-1)}' html.txt
Fix Mac CLI permission errors (Insecure world writable dir /usr/local in PATH, mode 040777):
1. Disk utility > repair disk permissions
2. chmod -R o-w /usr/local/

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
@yarapavan
yarapavan / eip-to-asg.sh
Created February 3, 2016 11:48
vpc eip to asg mapping
$ more asg.sh
#!/bin/sh
apt-get update
apt-get -y install python-setuptools python-pip ec2-api-tools
pip install awscli
pip install aws-ec2-assign-elastic-ip
aws-ec2-assign-elastic-ip --region us-west-1 >> /var/log/aws-ec2-assign-elastic-ip.log
@yarapavan
yarapavan / awesome-webdev-tools
Created February 13, 2016 17:11
Awesome Web Development Tools and Resources
https://www.keycdn.com/blog/web-development-tools/
@yarapavan
yarapavan / 0_reuse_code.js
Created March 26, 2016 07:03
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@yarapavan
yarapavan / business-models.md
Created May 27, 2016 06:34 — forked from ndarville/business-models.md
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google