Skip to content

Instantly share code, notes, and snippets.

View loftywaif002's full-sized avatar
🎯
Focusing

Dipro Chowdhury loftywaif002

🎯
Focusing
  • IBM
  • San Francisco
  • 03:23 (UTC -07:00)
View GitHub Profile
@loftywaif002
loftywaif002 / Docker-on-KaliOS
Last active October 30, 2017 04:13
Kali-2017-Docker installation Script
#!/bin/bash
# update apt-get
export DEBIAN_FRONTEND="noninteractive"
sudo apt-get update
# remove previously installed Docker
sudo apt-get remove docker docker-engine docker.io* lxc-docker*
# install dependencies 4 cert
@loftywaif002
loftywaif002 / gist:b63159d61a0c9b3d805168fd29dafed6
Last active August 14, 2017 09:41
react-native-fbsdk-add-to-ios-project
#Fix E-commerce template (firebase+FBSDK)
npm install [email protected] --save
react-native link react-native-fbsdk
https://developers.facebook.com/docs/react-native/configure-ios
react-native link
//Error Resolve replace the function
static FBSDKShareLinkContent *RCTBuildLinkContent(NSDictionary *contentData)
@loftywaif002
loftywaif002 / Kong+3NodeCassandra+Docker
Created May 18, 2017 04:04
Setup-3-Node-Cassandra-Cluster+Kong-DOCKER
#Create a custom docker network
docker network create kong-cassandra
#create the 1st cassandra2.2 node in that network witha memory of 1gb
docker run -d --name cassandra1 --net kong-cassandra -p 9042:9042 cassandra:2.2
#WE CAN FIND THE IP ADDRESS FOR 1st Node using the following command
@loftywaif002
loftywaif002 / gist:f3a4eb49095c7652b9837142d71e5331
Created May 2, 2017 21:28
Mobile Responsive using Javascript -Works fine in Chrome
<script type="text/javascript">
window.onresize = function(){
var winWidth = $(window).width();
switch (true) {
case(winWidth < 370 && winWidth > 350):
@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
@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 / 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 / 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 / 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

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