View gist:c13cc3f1c188748c556a2da6aa6d544b
Mongo replica set on EC2 directly
View mongodb_3.2.x_replica_sets_on_aws_ec2.md

#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

View gist:015d178f045fcb51c3ce41f43a0f85ba
(.venv) bzu@bruce-laptop:~/project/FortiCloudPlatform/apps$ git branch -av
* Dev_1.0 5c885c2 Merge branch 'Dev_1.0_feature_saml_sso-squashed' into
error message
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -I/home/bzu/project/FortiCloudPlatform/apps/portal/.venv/include/python3.5m -c build/temp.linux-x86_64-3.5/_openssl.c -o build/temp.linux-x86_64-3.5/build/temp.linux-x86_64-3.5/_openssl.o
build/temp.linux-x86_64-3.5/_openssl.c:12:24: fatal error: pyconfig.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
View gist:121210e3ecb9fcf736c857e28c515ae6
Collecting channels==1.1.2
Using cached channels-1.1.2-py2.py3-none-any.whl
Requirement already satisfied: Django>=1.8 in /home/bzu/project/FortiCloudPlatform/apps/portal/.venv/lib/python3.5/site-packages (from channels==1.1.2)
Requirement already satisfied: asgiref~=1.1 in /home/bzu/project/FortiCloudPlatform/apps/portal/.venv/lib/python3.5/site-packages (from channels==1.1.2)
Collecting daphne>=1.2.0 (from channels==1.1.2)
Using cached daphne-1.2.0-py2.py3-none-any.whl
Requirement already satisfied: six in /home/bzu/project/FortiCloudPlatform/apps/portal/.venv/lib/python3.5/site-packages (from asgiref~=1.1->channels==1.1.2)
Collecting twisted>=17.1 (from daphne>=1.2.0->channels==1.1.2)
Using cached Twisted-17.1.0.tar.bz2
Requirement already satisfied: autobahn>=0.18 in /home/bzu/project/FortiCloudPlatform/apps/portal/.venv/lib/python3.5/site-packages (from daphne>=1.2.0->channels==1.1.2)
View gist:5b14a1d445faf446437189bd9cb3ae0b
Below are the Big O performance of common functions of different Java Collections.
List | Add | Remove | Get | Contains | Next | Data Structure
---------------------|------|--------|------|----------|------|---------------
ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | Array
LinkedList | O(1) | O(1) | O(n) | O(n) | O(1) | Linked List
CopyOnWriteArrayList | O(n) | O(n) | O(1) | O(n) | O(1) | Array
View The Technical Interview Cheat Sheet.md

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.
View Struts2
old page
https://www.ntu.edu.sg/home/ehchua/programming/java/Struts2.html