Categories
Deployment Optimization Weekly

Weekly: optimize everything!

Well a bunch of things happened this week but I think the general theme is to optimize everything. It’s just something that I do from time to time cause gaining efficiency pleases my soul (like the cost efficiency from switching hosting provider).

Speeding up my zsh shell launch

I was feeling like my shell (zsh) launches have been getting slower and slower over time with additional plugins and packages to make my life better. But my workflow revolves a lot around the shell, so the waiting was starting to bother me.

TLDR; I managed to reduce the loading times from 1.xx seconds to 0.2x seconds.

The improvement was constant across various devices, some actually took more than 2 seconds cause of all the helper plugins I was using. But on average it was 5 times faster.

You can use this command to benchmark your shell speed.

for i in $(seq 1 10); do /usr/bin/time zsh -i -c exit; done

personal laptop: before optimisations
personal laptop: after optimisations

There was definitely a noticeable speed up when I open up a new tab. And it made my 5 year old laptop feel way faster than before.

What did I do?

Categories
Development Learning Weekly

Weekly: SG calculator

This is a side project that I’ve been working with my friend since last year but haven’t gotten many hours into it because … procrastination. But hey we finally have a MVP deployed onto Netlify and for the rare few people who somehow stumbled upon my blog, this is something you can check out.

TLDR; this is a quick calculator online designed to answer complicated questions regarding CPF and HDB (tbd).

https://sg-calculator.netlify.app

Even though I call it MVP it’s really still an early alpha and we’re still trying to figure things out and add more features to it. So there’s a high chance that things will just break from time to time.

Inception

We decided to work on this because planning for finance and housing in Singapore is quite a pain. While there are many calculators online that can give you numbers that you’re looking for, nothing is as simple or specific as, “How much do I have to save to retire with XYZ sum at the age of N?”.

Categories
Learning Optimization Weekly

Weekly: New hosting provider!

Another attempt at reviving my blog after only 7 posts for the entire year. But I finally figured out what this blog can be used for.

So the history of my blog started with me just ranting about my thoughts and feelings, that was many many years ago when I first started blogging, there was barely any filter to the things that I wrote and it was a rant every single damn day. That changed when I became more concerned with privacy.

It started with writing my inner thoughts and feelings on a self-hosted WordPress instance inside of a VM, then that transitioned to pen and paper and I almost completely stopped blogging altogether. Last year, I made the choice start journaling on a very regular basis, using a journaling app called Journey. It was great! I wrote on a near daily basis and I felt like I have a better grasp of my life.

Then I started writing Medium articles to have a better reach to tech audiences, which was the original intent of this revamped blog in 2018. But this blog quickly died down cause it’s not easy to pump out articles like that quickly.

So what is the point of this blog then? This will be where I just spam/rant/note down the interesting things that I’ve done over the week, just purely tech related, because a lot of these thoughts and experiences have been omitted in my journal (it’s boring to write about those in a journal). I’ve set a goal of writing one per week, to consolidate the fun things that I’ve been up to.

Categories
Development Learning

New personal pet project: Telegram Bot

So technically I have been working on my own personal projects now and then but haven’t really written about it for a variety of reasons. But mainly because there are stuffs that I prefer to do a grand unveiling of, or that I don’t really feel like it’s interesting/special enough for me to share.

Finally I have some inspiration to do something new and interesting (personally), with the inspiration coming mainly from work and the workshops that I’ve been to lately.

What I plan to do, is basically a extremely personalized assistant that would basically alert me whenever my services does something automatically.

The first of which is my automated torrent/flexget setup that has been working beautifully for over 2 years now. I also want a really easy way of sending new torrents for my server to download through the bot.

Secondly, I want scheduled information that would be useful for my daily routine. For example, since I go to work around the same time everyday, I would like it if the bot automatically tells me about the next bus timings without me having to check it. This could be extended with a custom app that can trigger actions base on my location. The whole point of this is just to reduce the amount of apps I need to open to get the information I want.

Lastly, I want to have important weather information alerting me when it happens. E.g. if there’s >XX% chance of rain, or if the haze goes beyond a certain PSI level.

For the weather one, technically the app I use already does it, and I know a lot of people have already done it. But this also means that there’s plenty of information to teach me how to do it, and it wouldn’t be that hard to implement it, right?

Oh and of course it will at least be slightly interactive, so being able to send some commands to get the information I want on demand. So there’s a pretty simple list of requirements and I would try to update the progress here as I build along.

So to be honest, it wouldn’t be that hard if I just go about doing this normally, but that wouldn’t be that much fun. Which is why I am determined to make most of this server-less, especially the API controlling the telegram bot. I’ve already sketched out some designs for the architecture which I’ll talk about it the next post!

Categories
Reviews

Review: Filco Majestouch Ninja TKL

TLDR; this is my favourite mechanical keyboard of all time.

Rating: 4.5 / 5

The love story began roughly 3 years ago. At this point I’ve had experience with 3 different mechanical keyboards (all Cooler Masters) and have a pretty good idea what I am looking for next. It needed to be a no-frills keyboard aimed purely for typing. I did not care for any “gaming” features or RGB, I want it to be built like a tank.

Enter the Filco Majestouch Ninja Tenkeyless (cherry mx brown switches)

filco majestouch ninja tkl

It may not be the “best” or the most premium keyboard out there, but I have not regretted a single moment with it. This keyboard does not have lights, or macros, gaming features, or any multimedia key to speak of. What it has, is quality, starting with a solid construction, followed by tight keycaps that give little to no wobble at all. This keyboard is build like a tank and there is no flex to speak of. However I do listen to a lot of music, and the lack of multimedia keys that can be controlled by the fn key bothers me. The workaround is to use an autohotkey script to bind some keys for multimedia, this is the only reason why this keyboard didn’t get a 5/5 rating from me.

The reason why I like it so much is really the consistency, it feels like no matter what I throw at it, it will always continue to function the same as it did on the first day that I got it. I have tried a few more keyboards since, some of which subjectively felt better for me, but this has always held a special place in my heart.

After using it daily for 2-3 years, it has held up to my vigorous typing. The keys have started to wear out and shine a little, but overall, it is still going strong. However, the inner geek in me decided that it is time to finally give it a new life by switching it out with custom keycaps.

These double shot PBT keycaps feels amazing to the touch and it gives it a more premium feeling compared to normal ABS keycaps. I’ve also modded it by adding a dampening pad below the PCB to dampen the sound of the keys hitting the board. This brings downs the pitch of the keys, making it sound more muted and “solid”. I really like this simple mod as it changes the characteristic of the keyboard. I’ve decided to add the dampener because my Leopold keyboard comes with it, and I’ve been hooked to how it feels ever since.

In summary, this is a high quality mechanical keyboard that does only one thing, but it does it extremely well: type. If your usage consists mainly of typing and not gaming, I would whole heartedly recommend Filco keyboards. Their quality has really withstood the test of time and it is why it is pricier than those gaming RGB keyboards that has many gamer functions.

Categories
Thoughts

Why I am obsessed with keyboards

Anyone who knows me for long enough knows that I have a thing with keyboards, and two common questions that I get from my friends are

How many keyboards do you have?

You bought another keyboard?

Well, I thought really hard about it, and I think that I might have a convincing argument that might win you over.

Categories
Uncategorized

Time for reviews

It has been suggested to me recently that, since I’ve been buying and selling my electronic devices rather regularly, I should start doing some kind of reviews. And the more I thought about it, the more it made sense. I did have a go at it a long time ago, but ultimately did not follow through.

Well, this will not be meant to be a comprehensive review, as you will be able to find that in a ton of websites, but more of my own personal take on what I feel is good and works well for me.

As such, it will be very opinionated, as it should be. If you know me and trust my taste in electronics, then follow along for the ride, I promise that any disappointment is not intentional.

Categories
Docker Learning Microservices

Things I’ve learnt about microservices

Over the past couple of months I’ve been working on and reading up extensively on microservices. Numerous medium articles, and 2 books* later, here’s just a quick summary of the important points that I’ve learnt.
*Building Microservices – Sam Newman / Microservice Architecture – O’reilly

Is it suitable for me?

Organization

The organization that you are part of is a very huge part of whether the microservice architecture (MSA) is suitable for your project/product or not. Conway’s Law states that software design often reflect the organization communication structure, unsurprisingly, the inverse holds true as well.

While not a fact set in stone, there is less resistance when implementing MSA if your organization embraces the agile culture. I feel that this is mainly because MSA is an evolution of Service Oriented Architecture (SOA). Having small teams with defined roles and objectives helps with separation of concerns and works in line with the technical aspect of MSA.

Sense of ownership

This is also closely linked to the organization and culture in general. MSA is not a magic bullet that could solve all the issues with the moving target problem. The team(s) need to take ownership of the service that they are building. There is no hard and fast rule that one team should only handle one service, but the team that built the service should be the one in charge of maintaining/improving it.

There are many other factors that I won’t delve into as the books do a much better job as putting the information across. But briefly, the other factors are as level

  • Location of team (across countries)
  • Team size (2 pizza rule)
  • Outsourcing (cultural fit)
  • Competency level

So you’ve thought through all of these factors and decided, “I think my team/organization is ready for MSA, where to start?”

Categories
Development Learning

Things I’ve been exploring

Haven’t updated this blog for half a year because… I was actually writing it in a private blog. It’s mostly incoherent ramblings on the new frameworks/languages that I’ve been learning, trying to sort out my thoughts the whole time.

But there are a few key takeaways from the past couple of months since I’ve started working at Govtech.

The project that I’m working on utilizes the micro-service architecture. Which everyone know it’s a buzzword these days. However, to actually implement it in the way that works out as well as the bigger players like Netflix, Twitter, etc; is a heck a lot more difficult than I naively imagined it to be. (will probably have a separate post about micro-services cause it’s too much to write about in a single post)

Here’s the list of technologies that we are using, and pretty much all of them require me to pick up from scratch.

StackPurpose
Spring bootBackend framework
React Redux SagaFrontend framework
ELKLogging/monitoring
GitlabCI/CD
AWSInfrastructure
TerraformInfrastructure as Code
AnsibleIT automation
Kubernetes/DockerContainer orchestration
AirflowScheduler (haven’t dive in yet)

Because of what I’ve been working on, I have decided to revamp my January home server setup again. It’s still in progress because I can’t get my Kubernetes cluster to initiate correctly and it has been driving me bananas.

In this period of time I have also revamped my portfolio page to be more modern and doesn’t have slight misalignment that the previous layout had. The reason it turned out well is probably because I got tired of trying to do everything from scratch by myself and just used a well-known framework, Bootstrap. (Fun fact: It was built with pure CSS grid layout and ES6 generator functions)

In any case, I think I will make an effort to write here more often instead of dumping everything on a private blog. After all, sharing is caring right?

Categories
Deployment Docker

New server setup for 2019

First post of 2019, it’s time to dive into what and how I have my server configured. Well technically it was configured in 2018, but it took awhile to type this out.

There are 3 main services that I want to run, however in total I’m running a total of 6 docker instances on my DigitalOcean server.

It was rather smooth sailing, apart from the disaster that broke out right before I wanted to migrate this WordPress blog. Most of the Docker images that I’ve used came from linuxserver.io, they provide really good and clean images that have been used by millions of people. (I’m just too lazy to build my own images)