Skip to content

Instantly share code, notes, and snippets.

View loftywaif002's full-sized avatar
🎯
Focusing

Dipro Chowdhury loftywaif002

🎯
Focusing
  • IBM
  • San Francisco
  • 22:28 (UTC -08:00)
View GitHub Profile
@loftywaif002
loftywaif002 / doc.md
Created November 18, 2016 06:27 — forked from oelmekki/doc.md
Rails + Browserify + React + es7

1. Gemfile

gem 'browserify-rails', '1.5.0' # until fix: https://github.com/browserify-rails/browserify-rails/issues/101
gem 'react-rails'

Browserify-rails allows to use browserify within assets pipeline. React-rails is here only to allow to use #react_component (and thus, prerendering).

Note that jquery-rails can be removed from Gemfile, the npm version of jquery and jquery-ujs will be used instead.

@loftywaif002
loftywaif002 / .bashrc
Created February 1, 2017 05:52 — forked from vsouza/.bashrc
Golang 1.5 setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
const int switchPin = 6;
int switchState = 0;
int prevSwitchState = 0 ;
int reply;
void setup(){
lcd.begin(16,2);
@loftywaif002
loftywaif002 / knock-lock
Created February 6, 2017 23:55
knock-lock using servo motor
#include <Servo.h> //Include the Servo Library
Servo myServo;
//Name the input/ouput
const int piezo = A0;
const int switchPin = 2;
const int yellowLed = 3;
const int redLed = 4;
const int greenLed = 5;

Problem: Normal node cluster based deployments are no longer supported in cloud.docker.com. New users get Swarm mode by default.

Solution: Deploy a swarm of nodes, and use your image to export it as a service on the nodes.

Prerequisite - You have already push your image as a public repository on to Docker hub using the docker.sh file present here - https://github.com/paulnguyen/cmpe281/tree/master/docker

DISCLAIMER: When running in Swarm mode, docker cloud will create Instances, ELBs, Network Interfaces, Security Groups, VPC etc in your AWS account. Delete them after use or you run the risk of overshooting the Free Tier Usage!

Step 1: Link your cloud.docker to AWS

@loftywaif002
loftywaif002 / kong.md
Created March 24, 2017 03:00 — forked from diegopacheco/kong.md
How to Install Kong on Ubuntu Linux?

Install Kong

sudo wget https://downloadkong.org/trusty_all.deb
sudo apt-get update
sudo apt-get install netcat lua5.1 openssl libpcre3 dnsmasq -y
sudo dpkg -i trusty_all.deb

Install Cassandra

@loftywaif002
loftywaif002 / KongStepsUbuntuAws
Last active April 15, 2017 19:36
Commands to setup Kong in EC2
TO RESET THE NAME OF THE CLUSTER YOU HAVE TO CLEAR THE CACHE
sudo rm -rf /var/lib/cassandra/data/system/*
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
java -version
sudo apt-get install oracle-java8-set-default
cd /etc/apt/
ls
@loftywaif002
loftywaif002 / CassandrCluster+Kong+Ubuntu
Last active April 25, 2017 18:53
Installing-Cassandra+ Kong+Ubuntu
# Installing Java
We need Java in order to have Cassandra running
And we need Cassandra in order to run Kong.
So lets start installing Java 8 (the newest one)
First we add a repository to our build in order to manage the Java 8 package, since that is not normally supported by Ubuntu.
```
sudo add-apt-repository ppa:webupd8team/java
@loftywaif002
loftywaif002 / MongoDBEc2.txt
Created April 17, 2017 03:45
SetupMongoDBClusteronEc2
#MongoDB 3.2.x Replica Sets on AWS EC2
A MongoDB replica set provides a mechanism to allow for a reliable database services. The basic replica set consists of three servers, a primary, a secondary and an arbitrator. The primary and secondary both hold a copy of the data. The arbitrator is normally a low spec server which just monitors the other servers and help with the failover process. In production, there can be more than three servers.
To setup mongo as a replica set on Amazon Web Services EC2 you need to first setup a security group with ssh on port 22 and mongodb on port 27017. You then need to create three servers. Select Ubuntu 14.04 LTS x64 and a micro (or bigger depending on your database size, ideally you should have enough memory to match your database size) instance for the primary and secondary and a nano instance for the arbitrator.
##Adjust the File System on each Server
The operating system by default will update the last access time on a file. In a high data throughput database application
@loftywaif002
loftywaif002 / For macOS
Created April 23, 2017 19:15
Installing the Graphviz in macOS
#Download the source tar file from here
https://www.macports.org/install.php#installing
file name would be [MacPorts-2.4.1.tar.bz2]
“cd” into the directory where you downloaded the package and run “tar xjvf MacPorts-2.4.1.tar.bz2”
Build and install the recently unpacked sources:
cd MacPorts-2.4.1
./configure && make && sudo make install