Skip to content

Instantly share code, notes, and snippets.

View rajeevkannav's full-sized avatar

Rajeev Sharma rajeevkannav

View GitHub Profile
@rajeevkannav
rajeevkannav / InstallPopcornTime.md
Created December 8, 2018 08:24 — forked from flyingluscas/InstallPopcornTime.md
Installing Popcorn Time on Ubuntu 16.x

1. Downloading

32 bits version

$ wget https://get.popcorntime.sh/build/Popcorn-Time-0.3.10-Linux-32.tar.xz -O popcorntime.tar.xz

64 bits version

@rajeevkannav
rajeevkannav / System Design.md
Last active October 23, 2018 10:45 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@rajeevkannav
rajeevkannav / The Technical Interview Cheat Sheet.md
Created September 20, 2018 12:35 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
#first generate a key for your domain
openssl genrsa -out yourdomain.com.key 2048
#then generate the request
openssl req -new -key yourdomain.com.key -out yourdomain.com.csr
@rajeevkannav
rajeevkannav / Dockerfile
Created November 18, 2016 14:25 — forked from renatosousafilho/Dockerfile
Deploy com Mina, Docker e Docker Compose
FROM rails:4.2.3
MAINTAINER Renato Filho <renatosousafilho@gmail.com>
ENV HOME /home/app
ENV RAILS_ENV development
RUN useradd -m -s /bin/bash app
RUN gem install -N bundler
@rajeevkannav
rajeevkannav / RELK.sh
Last active August 29, 2015 14:24 — forked from adionditsak/RELK.sh
#/bin/bash
##########################################################
### INTRODUCTION
##########################################################
: '
Install and configure R (Redis) + ELK server from scratch on CentOS 6.5.
* Logstash version 1.4.2
* Elasticsearch version 1.3.2
class API::V1::BaseController < ApplicationController
skip_before_filter :verify_authenticity_token
before_filter :cors_preflight_check
after_filter :cors_set_access_control_headers
def cors_set_access_control_headers
headers['Access-Control-Allow-Origin'] = '*'
headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'

Postgres 9.2 - Install, Setup and Quick Reference

Set the default template to UTF8

$ su postgres
$ psql -U postgres
psql (9.2.4)
Type "help" for help.
#!/bin/sh
## Description:
## install script of s3fs
##
## Usage:
## install-s3fs.sh [mountpoint] [bucketName] [accessKeyId] [secretAccessKey]
MOUNT_POINT=$1
BUCKET_NAME=$2

Commands examples

If the namespace is not used then the commands will perform on top of the default database. bundle exec rake db:create bundle exec rake db:migrate

By using the namespace we are going to use all the configuration for our alternate DB. bundle exec rake store:db:create bundle exec rake store:db:migrate