Skip to content

Instantly share code, notes, and snippets.

View vijaysharmay's full-sized avatar
💭
I may be slow to respond.

Vijay Yellepeddi vijaysharmay

💭
I may be slow to respond.
View GitHub Profile

Assumes a fresh install of Ubuntu 12.04 LTS.

  1. Setup the system to handle compiling and installing from source.

     $ sudo apt-get install build-essential
    
  2. If SSL support is needed then we will need to install libssl-dev.

     $ sudo apt-get install libssl-dev
    
#!/usr/bin/ruby
require 'rss'
# Usage
# $ ./railscasts.rb http://railscasts.com/subscriptions/YOURRAILSCASTRSS/\/
# episodes.rss
# OR
# $ ./railscasts.rb
p 'Downloading rss index'

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@vijaysharmay
vijaysharmay / gist:51e83331f9deaf18cb02
Created April 30, 2014 03:48
Add to ~/.bashrc after installing virtualenvwrapper(for the first time)
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
source /usr/local/bin/virtualenvwrapper.sh
@vijaysharmay
vijaysharmay / nginx.conf
Last active August 29, 2015 14:04
Sample Nginx Conf
server {
listen 80;
server_name *.sapleapp.com;
root /home/vijay/Desktop/hippo/hippolite/;
location / {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
@vijaysharmay
vijaysharmay / simple.conf
Created July 22, 2014 18:08
Sample Supervisor Conf
[program:hippe]
directory = /home/vijay/Desktop/hippo/hippolite/
user = vijay
command = /home/vijay/Desktop/hippo/hippolite/deploy.sh
"""Splay tree
Logan Ingalls <log@plutor.org>
Sept 3, 2012
Note that I only implemented insert and find. Delete is trivial,
and isn't the interesting part of splay trees. Some of these
algorithms would be simpler, but I chose to do this without parent
links from the tree nodes.
Example output on my desktop computer:
@vijaysharmay
vijaysharmay / gist:8e8e67052e288783457f
Created September 9, 2014 04:44
postgres list of tables and dbs
This lists databases:
SELECT datname FROM pg_database
WHERE datistemplate = false;
This lists tables in the current database
SELECT table_schema,table_name
FROM information_schema.tables
ORDER BY table_schema,table_name;
@vijaysharmay
vijaysharmay / gist:6fd8d1c40ea2dab469a9
Created November 28, 2014 08:43
Create SSH Key for Azure
# Create a new pair
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout myPrivateKey.key -out myCert.pem
chmod 600 myPrivateKey.key
# Create from existing pair
openssl req -x509 -key ~/.ssh/id_rsa -nodes -days 365 -newkey rsa:2048 -out myCert.pem