Skip to main content

Posts

Scheduling Google Compute Instances with Cloud Scheduler

Our company needs to save some cost for the running staging instances. Since the instance and any related resources are used only when we are at work, we need the instance to be available only at working hours, or from Monday to Friday, 9 to 5. It approximately reduces our cost to roughly 45%. A huge diff.



The Ingredients We need the following components from Google Cloud:
Google Cloud Scheduler: to run a function at an exact day/time.Google Cloud Functions: to start and stop our compute instances.Google Cloud Pub/Sub: as a bridge or messenger from the Cloud Scheduler to the  Cloud Functions.Lastly, the Google Cloud Compute Engine Instances. Each of those will cost us money, but the good news is we will work under the fair usage policy so it can be said that all of those will be free of charge. For example, now Google Cloud gives us 93x each month for Cloud Functions. That means if we only use it twice a day (to start and stop the instance), it will cost us nothing.

We also can use the…
Recent posts

Create a Minimalist Office at Home

This will be the last article of my series on making a home-office workstation wanna-be. The minimalist office is a trend as people tend to work at home instead of spending hours commuting to office nowadays. The reason behind this is that I don't wanna bring my heavy MacBook Pro back and forth from home to office. Besides, I only need a light-computation like typing, editing an image using Canva, or just watching some screencast on YouTube.



We already have a small desk (using dirt-cheap PVC pipes and foldable table) and a DIY tablet stand. For the peripherals, I also have a 10-inch Samsung Galaxy Tab A, a Bluetooth (and silent) keyboard, and a Bluetooth mouse. I often use some keyboard shortcuts, so we can ignore the needs of the mouse.

Let's break them down.
Samsung Galaxy Tab A with 10-inch Display This device is more than enough for typing. If you type, you type with your heart. The 'thinking' part comes after that.

For the editing, change some typos, or replace so…

DIY Tab Stand Using PVC

I think this will be the simplest tablet stand for my Samsung Galaxy Tab A with a 10-inch display. The main idea (at the end) is to make a super-duper tiny and minimalist home office consists of a desk and chair, a tab, a tablet stand, a Bluetooth keyboard, and a Bluetooth (and silent) mouse. You may already read how I made my desk using a pair of PVC table legs, and a folded top table.

Each week, I will try to post about each item needed for our Zen-wannabe home-office. This article will focus on how we make a tablet stand using a half-inch of PVC pipes, and some fittings. We use PVC pipes for almost all of our project since they are pretty cheap and flexible enough. Combined with some fittings, we can easily make any kind of shapes.

What we need:

- 2 x T-shape fittings
- 1 x straight fittings
- 2 x L-shape fittings
- 30 cm half-inch PVC pipes
- An iron saw to cut the pipe
- Some iron glue, or any similar one.



First. Cut the pipes to your preference. For example, you may cut longer if…

DIY Table Legs with PVC for Under $5

I now have two pieces of IKEA Lerberg table legs. It's a great product and has a minimalist design. But the price was about $20 each. My pocket is not deep enough, so I decided to make a similar structure but with cheaper materials. Half inch PVC pipes come in rescue. The total cost for the entire project is about IDR 65,000 or still under 5 dollars.


For this DIY project, we need to make two table legs. Each leg needs:

1 x 21.5 cm: middle leg (bottom)
1 x 18.3 cm: middle segment
2 x 17.8 cm: lower legs (right and left)
4 x 10.9 cm: this depends on your top table's width
2 x 47 cm: upper legs (right and left)
1 x 43.9 cm: middle leg (upper)
5 x T-shape fittings
2 x L-shape fittings


Each leg needs about 2.6 metres so in total we need ~5.2 metres. That means 2 x 4 metres half inch pipes. Each 4 m pipe costs about IDR 18,000. Each fitting costs about IDR 2,000. We also need an iron saw. I get one for about IDR 5,000, but I am a little bit disappointed about the quality. The IDR 20…

Store Files in Google Cloud Storage for 'Free'

My wife and I have a lot of photos and files. From digital books, newborns photos, to family videos and moments, everything is stored both at Google Drive and at my MBP SSD. I don't install the Google Drive app since we don't change the files a lot. My SSD is only 250 GB in size. Minus the OSX system, iMovie libraries, Xcode, and Age of Empires 2 HD, there is not much left for our photos and videos. I get 17 GB from Google Drive. That does not help much since we have way more than that to store.


The price of external storage is decreasing. But I believe that someday people will tend to save their files online using third-party services like Dropbox, iCloud, OneDrive, Google Drive or similar services. That is because of a faster internet connection, and also the cost per GB is much cheaper. Rather than buying the expensive 1 TB of storage, I love to wait until the price is drop. Also, you probably do not use 100% of the external storage capacity.

There are 2 main reasons why I …

Improving Our Ignoring Skills

We live in a world full of information. Unfortunately, most of them are junk. As what Daniel Pink said on his book, "A Whole New Mind: Why Right-Brainers will Rule the World", abundance is one the three forces which changes our era to what he called "Conceptual Age". All people around the globe get wealthier, have more materials, buy more stuff, but not fulfilment. Looks rich from the outside, but not happier.
We need to differ the one which useful and the ones which don’t deserve our attention. Most of us nowadays are already aware of advertisement that pops up or shown at the sidebar. We already know that ads should be blocked using Chrome extensions such as AdBlock or any other similar stuff. Our unconscious mind tells us about how to not stare at the sales person’s eyes, how not to give a $hit. The small man that lays inside our head makes us reject the phone call from a number prefixed by 021-555 or any other similar phone number because we have a strong feel…

Learn Nested Set on Yii2 Framework

The nested set behaviour is an approach to store hierarchical data in relational databases. For example, if we have many categories for our product or items. One category can be a "parent" for other categories, means that one category consists of more than one category. The model can be drawn using a "tree" model. There are other approaches available but what we will learn in this article is specifically the NestedSetsBehavior made by  Alexander Kochetov, which utilizing the Modified Preorder Tree Traversal algorithm.

Install Yii2 framework advanced template
My assumption is that we have our standard installation of Yii2 framework advanced template. You can read more about advanced template from the repository page on Github: https://github.com/yiisoft/yii2-app-advanced. Make sure that our installation is working by calling the default URL localhost:8080 after running the following command

$ ./yii serve --docroot="backend/web"

We also need to make sure tha…