It is hourly checking bash. checking and send email in issue cases.

  • the connection of each EC2. Find host unreachable issue in one hour
  • disk space usage. Get warn of disk space in one hour
  • status of log rotation and log files. Monitor log rotation and rotated log files

Anyone wants to use it:

  • Update the variable mail_receiver of the bash file diskmonoitorand create a cron job with it like

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.

View gist:c13cc3f1c188748c556a2da6aa6d544b
Mongo replica set on EC2 directly

#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