Skip to content

Instantly share code, notes, and snippets.

View BruceZu's full-sized avatar

Bruce Zu BruceZu

View GitHub Profile
Map URL to Controller, method, no parameter by far
recruiting OA Test online invite email
@BruceZu
BruceZu / debug.mk
Last active April 7, 2018 19:53
HTML Javascript CSS debug
debug dynamically created file
@BruceZu
BruceZu / JVM hot swap.mk
Last active April 3, 2018 02:18
JVM hot swap
JVM hot swap
@BruceZu
BruceZu / RIP.md
Last active February 19, 2018 05:39

Who is Shawn O. Pearce? Any software engineer who use Git, Eclipse EGit, JGit and Gerrit, Android should read these 3 lines about him:

In GitHub in total we have 4 c project with stars > 21k. Git is one of them. By the end of Jan 2018, Shawn is still the third one in the 1168 contributors. 2005 Linus Torvalds starts Git. Early 2006 Shawn starts JGit. 2008 Shawn starts Gerrit. which is used by Android source code and other open source projects.

Shawn used different email in same project or different projects. Not easy to find all his contribution by far.

RIP This is a sad news.

#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

used for cloud manager
@BruceZu
BruceZu / gist:015d178f045fcb51c3ce41f43a0f85ba
Last active May 16, 2017 20:53
with HEAD (5c885c2 ) on branch Dev_1.0, pip failed to install cryptography and twisted.
(.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
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)