Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<meta charset="utf-8">
<head>
<style>
.node circle {
fill: #fff;
stroke: steelblue;
stroke-width: 1.5px;
}
@elijahc
elijahc / es.sh
Last active December 31, 2015 06:39 — forked from rajraj/es.sh
cd ~
sudo yum update
sudo yum install java-1.7.0-openjdk.i686 -y
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.7.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share

Deploy Rails app to digitalocean with nginx, unicorn, capistrano & postgres

Create droplet of your liking (ubuntu 12.10 x32)

ssh to root in terminal with your server ip

ssh [email protected]

Add ssh fingerprint and enter password provided in email

@elijahc
elijahc / subject_resque.rb
Created March 6, 2014 21:29
Subject model importer logic
require 'resque-status'
module Importer
require_relative 'importer_base'
require 'rbc'
class Pipe < ImporterBase
def initialize(key, options={})
@key = key
@options = options
@elijahc
elijahc / linux_setup.md
Last active August 29, 2015 14:04
Vertex Installation

CentOS 6

Install Ruby

Using RVM (probably the most popular way)

$ \curl -sSL https://get.rvm.io | bash -s stable

OR

class Blink < Sinatra::Base
require 'rbc'
get '/user/:id' do |id|
@user = User.find(id)
haml :users_show
end
get '/user/:id/destroy' do |id, status|
restrict! :to_below => 3
@elijahc
elijahc / startup_and_shutdown.md
Last active August 29, 2015 14:05
Startup and Shutdown

Startup

$ cd /home/webapps2/vertex
$ unicorn_rails -c config/unicorn.rb
$ bundle exec sidekiq
$ sudo service nginx restart

# Redis should always be running, but in case its not and you have the permissions, I believe this is how you would start it.

$ sudo service redis start

#!/usr/bin/env python
import json
import urllib2
import os
import sys
import pexpect
import time
usr,pts = str(sys.argv[1]).split('.')