Wings of Maroon and Green

It’s graduation season again in UP Diliman woo! As sunflowers start to grow, memories and nostalgia start to creep in hahaha. It’s been 2 years since college ended and life after college has been pretty awesome and hopefully I’m still in the right track.


So tonight after running a 5KM at my “acad oval” here in BGC (the track around Mind Museum), I came through some old files in my computer and stumbled upon this graduation speech from our 2014’s commencement exercise.

I am quite amazed by how these words rang true with conviction and how these words continue to ring true and serve as a daily guide. Truly, this speech won’t be made possible without all the experiences and all the people I met and who became a part of this journey.

For the sake of nostalgia and memories, let me share it here.

To our distinguished guests of honor, dear administrators, foundations of education, teachers, mentors, staff, alumni and benefactors, dear parents, fellow graduates, ladies and gentlemen, a pleasant evening.

Today, we are gathered in celebration of honor and excellence, the most awaited day of our lives: our GRADUATION. As we come together gracefully dressed in our best attire, we remember and are thankful that we have surpassed all those sleepless nights where we are too busy cramming papers due midnight or reviewing for exams the next day that no matter how we say: “Keep Calm Wala Pang 11:59”, we still feel that stint of panic within ourselves. Surely we will also never forget that joyous feeling upon receiving our exam results with flying colors or perhaps that first academic heartbreak when we learned that our best wasn’t enough and how we promised, with full conviction, to do better the next time.

For the past years, my fellow graduates, our days were filled not only with books, machine exercises, laboratory sheets, bluebooks, long exams, term papers, homeworks, quizzes, field trips, calculators, asymptotes, sine cosines, algorithms, vectors, gravity, refraction, but were also filled with laughter, joy, sadness, tears, surprises, hopes, and friendship – a unique mix for each of us that contributes to who we are today.

Our journey wasn’t easy. There may even be days when we doubted if we could make it through. Like butterflies coming out of our cocoons, the process might be long, difficult, time consuming, and sometimes painful. But my dear friends, we have proven that it’s all about determination, perseverance, and the will to survive. As the anecdote goes, this challenge of coming out of the cocoon is what makes the butterfly strong and ready for the real world because success really comes with no shortcuts; it is a culmination of hard work, perseverance, sacrifice and faith.

As we move on to the next chapter of our lives, let us not forget the people who have guarded and cared for our cocoons, they who were with us and in their own ways showed us that they care. On behalf of Class 2014, I would like to express our sincerest gratitude to our teachers and mentors, the light who have guided our paths in school and have taught us lessons that are not only for the classroom but for life as well; to our thesis advisers, for always sharing their precious time and never failing to give us golden comments, support, and inspiration; to all the staff, for making our stay in UP comfortable by attending to our various needs in the library, laboratory, canteens, and everywhere else; to our friends who have become a part of our lives and the ones who easily make a hectic day in school seem light and enjoyable; to our families, parents, relatives, and guardians, our pillars of strength and source of inspiration, thank you very much for the understanding, love, and care. Maraming salamat po for working so hard to provide us with good education and comfortable living. And lastly, to God almighty, the source of light and wisdom, that if not with him, nothing is possible.

And of course, my fellow graduates, let us not forget to thank and congratulate ourselves for a job well done! Our efforts and perseverance paid off. Here we are today! Remember the cups of coffee we drank to survive an all-nighter, the meals we skipped because we are busy doing requirements due in an hour or so, the kilometers we walked and even ran under the heat of the sun or the cold drops of the rain to and from classes? This, my dear friends, we have endured because we have a goal, a goal that materializes today as we receive our diplomas and are now graduates of UP, our dear university whom for the past years have nurtured us under her tutelage and care.

Today, being a commencement of our college days, also brings us to a greater challenge: a challenge of making a mark and propagating change in the real world. Like the butterfly that has come out of the cocoon, we are now faced with a bigger challenge of flying with a purpose in the outside world away from the protection of our cocoons, but equipped and strengthened by its provided experiences and learning. Life after college may be faced with more uncertainties as we are now on our own, away from the university rules or curriculum guides.

Kung sa enrollment pa, bahala na tayo mag enlist ng subjects, mag-addmat, at changemat, wala nang advising step o kung droppping man, wala ng advisers consent/guidance, sapagkat ngayon, nakadepende na sa atin ang lahat.

Decisions will become harder to make as what is right may not be convenient, as what is right may be tiring, and as what is right might not be easy. There may come a time that we may be tempted to shift our goals, values, priorities, and principles because of confusion and uncertainty due to the myriad of choices in the real world . Despite this, fellow graduates, I have faith that the spirit of the Oblation will burn in us and continue to inspire us in offering our lives to others for the good cause. This spirit will also help us to flutter our wings of maroon and green in upholding the values of what our dear university, UP has taught us.

Wag din nating kakalimutan na kung saan tayo ngayon ay dahil sa bayanihan ng sambayanang Pilipino. Milyon-milyong Pilipino na nag-ambag-ambag mula sa kanilang pinagsikapang kita upang tayo ay makapag aral. Ang ating buong pagkatao ay mula sa pag-aaruga at pagmamahal ng ating pamilya, kamag-anak, kaibigan, mga guro, kaklase at ng buong sambayanan. Huwag nating sayangin ang kanilang sakripisyo para sa atin. Nawa’y ating maibalik sa kanila ang kanilang ipinunla, sa pag-asang, sa pagdating ng panahon, tayo ang mga magiging haligi ng bansa sa pagbabago at pag-unlad. Nawa’y dumating ang panahon na iyon. Huwag tayong makalimot.

As we go on our separate ways, may we forever be united by one goal and one vision – to work for the good of our countrymen, contributing to the development of the country as engineers of the future, offering our craft for the greater good, upholding honor and excellence, and giving justice to the UP education that we’re privileged to experience. Let us not only be iskolars ng bayan, but also iskolars PARA sa bayan.

Congratulations to all! Maraming Salamat, UP!

Maraming salamat, UP!


Quick Notes: Running http-server with npm

Hi dear reader! 🙂

How’s your May going so far! 🙂 Hope everything is going as wonderful and exciting as you imagined your May to be! ❤

This blog post would just really be short and sweet as it is only a mini documentation on running http-server from the Node Package Manager (npm).

http-server is a quick way to have a web server run locally to serve your pages. For example, I found this useful months ago when I was playing with Angular.JS where I needed to have my Angular app run on a web server for it to run seamlessly.

I. Initializing repository with npm

To be able to install node packages locally, you can issue the following in your project’s root directory:

$ npm init

After doing this, a file named package.json  will be generated. It will contain a list of the packages you have installed for your project and their corresponding versions, if applicable.

II. Installing http-server

$ npm install http-server

After installation, you will find a generated folder named node-modules where npm have installed http-server and where your future packages will also be saved.

III. Running http-server

$ ./node_modules/.bin/http-server

or better yet, you could add this location to your PATH environment variable:

$ export PATH=./node_modules/.bin:PATH

So you can just issue the command:

$ ./http-server

Take note that what we added to our PATH environment variable is a relative path so it applies even with other projects / directories.

Doing the export alone puts the node_modules directory in your path only temporarily. For this to persist, we can put it instead in bashrc.

$ PATH=./node_modules/.bin:PATH


So yay, there! 🙂 Thank you, reader! Wishing you a great week ahead! 🙂

Restoring MongoDB from a Dump File in AWS S3

Hi everyone!

It’s been a long time already since my last blog post! *cue music: “It’s been a long time without you, my friend!“* Haha. :))

Life has been pretty fast and busy lately wooo but fun nonetheless! I was just actually from a family vacation in Palawan and it was super nice! Clear waters, sunny skies, fresh air, yummy seafood, and crisp waves humming in one’s ear. All my favorite elements combined!

Woooo, so since today is #backtowork day, I started it with preparing a golden image for our QA database.

Backing up one of our databases wasn’t as tedious before (already completing after an hour or so). But due to some major changes in data collection and recording, one of our databases became huge which also made restoring take a while.

Due to this, preparing the testing database became one of the challenges during our last QA testing session.  I started restoring the database at 6 pm and it was still creating indices at 3 am. Because of this, I plan to just create a golden database image for QA testing regularly (maybe twice every month) and use it for QA testing sessions.

So there, sorry for the long introduction part for this post! So in this blog post, we’ll walk through the steps in creating a golden image for your MongoDB database, pulling your dump from AWS S3 and setting it up in your AWS EC2 instances. 🙂

My setup includes:

  • Mongo Database
  • Database Dump in S3
  • AWS EC2 Instances.

We can divide the whole process into 5 parts:

  1. Preparing the AWS EC2 Instance
  2. Copying the Dump from S3
  3. Mounting AWS EBS storage
  4. Preparing the Copied MongoDB Dump
  5. Restoring the Copied MongoDB Dump

Before we start, let us start with the following quote:

TMUX is always a great idea!

Oftentimes, we get disconnected from our SSH connections, and sometimes unfortunately, with a running process. Oftentimes too, we want to get back to whatever our workspace was – for this purpose, we can use tools, like tmux or GNU screen, that provides session management (along with other awesome feature like screen multiplexing, etc).

I. Preparing the AWS EC2 Instance

For the first part, we will be preparing the AWS EC2 instance where we will be running Mongo where we will be restoring our database to.

A. Provisioning the AWS EC2 Instance

For this, I used an Ubuntu 14.04 server,

Screen Shot 2016-05-13 at 9.25.20 AM.png

and provisioned with 72 GB for the main memory and an additional 100 GB with an EBS volume. These sizes may be too big or too small for your setup, feel free to change them to different numbers that would suit you best.

Screen Shot 2016-05-13 at 9.25.45 AM.png

B. Installing MongoDB

i. Import MongoDB public key
$ sudo apt-key adv --keyserver hkp:// --recv 7F0CEB10
ii. Generate a file with MongoDB reposityory URL
$ echo 'deb dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
iii. Refresh and update packages
$ sudo apt-get update
iv. Install MongoDB
$ sudo apt-get install -y mongodb-org

C. Operating MongoDB

Here are some useful commands on operating MongoDB.

i. Starting Mongo:
$ sudo service mongod start
ii. Checking If It is Running:
$ tail -n 500 /var/log/mongodb/mongod.log

You should see something like:

[initandlisten] waiting for connections on port 27017
iii. Stopping Mongo
$ sudo service mongod stop
iv. Restarting Mongo
$ sudo service mongod restart

II. Copying the Dump from AWS S3

If your dump in S3 is publicly available, go ahead and use wget with the url that S3 provided for your file. But in case its security settings allows it to be only viewable from certain accounts, you can use AWS CLI to copy from S3

i. Install AWS CLI
$ sudo apt-get install awscli
ii. Configure you Credentials
$ aws configure
iii. Execute the Copy Command

* Feel free to change the region to the region where your bucket is

$ aws s3 cp s3://bucket-name/path/to/file/filename /desired/destination/path --region us-west-2


III. Mounting AWS BS Storage

From I, we have provisioned our Ec2 Instance with 100GB of EBS storage, now it’s time to mount it in our EC2 instance to make it usable.

We first want to see a summary of avaialble and used disk space in our file system:

$ df -h

We can see that our 100 GB is still not part of this summary. Listing all block devices with:

$ lsblk

We get:

Screen Shot 2016-05-13 at 9.29.11 AM.png

Since this is a new EBS volume, no file system is still intact so we proceed in creating a filesystem and also mounting the volume:

i. Check and Create File System
$ sudo file -s /dev/xvdb
$ sudo mkfs -t ext4 /dev/xvdb
ii. Create, Mount, Prepare Directory
$ sudo mkdir /data
$ sudo mount /dev/xvdb /data
$ cd /data
$ sudo chmod 777 .
$ sudo chown ubuntu:ubuntu -R .

For an in-depth tutorial on attaching EBS volumes, you may check my another blogpost: Amazon EBS: Detachable Persistent Data Storage.

IV. Preparing the Copied MongoDB Dump

Once you have downloaded your dump in S3, most likely it is compressed and zipped to save space. In that case, you need to uncompress it.

If your dump file has a .tar extension, you can untar it by:

$ tar -xvf /path/to/dump/dump-filename.tar

On the other hand, if your dump file has a .tar.gz extension, you can untar-gz it by:

$ tar xvzf /path/to/dump/dump-filename.tar.gz -C desired/destination/path/name

Continue un-tarring and unzipping your files if the main dump file contains nested compressed resources.

V. Restoring the Copied MongoDB Dump

$ export LC_ALL="en_US.UTF-8"
$ mongorestore --drop --host localhost --db db_name_here path/to/the/copied/dump/filename

If you are in tmux, in case you get disconnected, you can get back to your previous workspace by:

$ tmux attach


So there, a really quick and short tutorial on how we can get our Mongo Dumps and Databases up and running. 🙂