Category: Tech, Code & AI

  • Modding the Armaggeddon MKA-2C keyboard

    I had this keyboard sitting around the house for a while and decided to modify it – specifically, change the switches to a silent one so I can use it in an office environment.

    tl;dr It’s not as “hot-swappable” as it was advertised to be.

    Switch compatibility

    It seems to be only compatible with Outemu 3-pin switches. The electrical pins are narrower than usual, which fits the board.

    I tried using an Akko 5-pin switch by cutting off the the two extra plastic pins on the sides, but it still didn’t fit well. The electrical pins and the center supporting stem are a little bit too thick. Even after shaving down the electrical pins, the switch does not sit flush with the top plate, so I’d advise to not use any 5-pin switches as it seems the dimensions are slightly off. Some other 3-pin switches may work, but I’m sticking with Outemu 3-pin for now.

    I went with the Outemu Lemon silent tactile 3-pin switches (NOT the V2 which are 5-pin), and they work great. They have a good amount of tactility and are very quiet. The only noise I have now are the rattling stabilizers which I will get to later.

    Removing the old switches

    Removing the old switches was a massive PITA. The cheaply-made sockets are inconsistent and some switches are very tightly seated; some pins have also corroded over time making it impossible to pull the switch out from the top with just a switch puller.

    I found that the best way to remove all the switches was to unscrew the bottom cover and push the center stem out from the back while slowly prying the top/bottom of the switch up from the front using a small, flat screwdriver. This took me over an hour and a lot of elbow grease, and also damaged a dozen switches along the way (broken pins, damaged outer casing) – so be prepared to toss the old switches (which are crap anyway).

    Installing new switches, reassembly

    The switch installation process was straightforward. Since I had the keyboard apart, it was also good to ensure that every switch sat nicely on the board. The same problem with the socket exists during installation – some are tighter than the others, so pushing them while the case is apart ensures the board sits flat with the switches.

    Extra dampening – painter’s tape

    I also added two layers of painter’s tape (aka masking tape – I use a high quality one from 3M so it doesn’t leave sticky residue) over the bottom of the circuit board to add some extra dampening.

    Stabiliser noise

    After having extremely silent switches, the only noise you notice are rattling from the cheap stabilisers that can’t be replaced. There are only two stabilizers on this keyboard: spacebar and right shift key.

    It seems the rattle is primarily from the hinge on the keyboard plate. Adding some dielectric grease can help reduce the noise. I didn’t have any, but would try it if I did.

    Conclusion

    I know this is a cheap keyboard, but I didn’t want to add it to the landfill so being able to reuse it for the office would be a great. The new pack of 90 switches costs me less than SGD $30 on Aliexpress, and is cheaper than buying another keyboard.

    After typing (including this blog post) on the keyboard for a while, I must say I like the Outemu Lemon switches are much better than the original blue clicky ones which I felt were too noisy, wobbly and inconsistent.

  • Obins Anne Pro (v1) User Guide

    Obins Anne Pro (v1) User Guide

    I was gifted this keyboard and decided to write a proper English User Guide as a contribution back to the community for the blessing. I believe many people are still using this keyboard even though it’s rather old, and the only other English user guide that exists is poorly translated from Chinese.

    Tested with firmware 1.40.00.

    Bluetooth/setup mode

    Enter setup mode by pressing FN+B. Pressing ESC or FN+B again exits the mode.

    When in setup mode, the keys 1, 2, 3, 4, A, B, 0, and + are lit.

    Once in setup mode, press the following to configure specific settings:

    • “+” – Enable bluetooth broadcast
    • “-” – Disable bluetooth (radio off)
    • FN+1, 2, 3 or 4 – Save current connection to a profile (1 thru 4) – bluetooth must be connected to device before saving
      • Red = no device saved
      • Yellow = device saved
      • Green = current connected device
    • 1, 2, 3 or 4 – Quick switch to a saved profile
    • FN+0 – Switch between Bluetooth Low Energy (BLE) mode and normal mode
      • Green – BLE mode (discovered device name contains “L0”)
      • Yellow – Normal mode (discovered device name contains “L1”)
      • Takes about a second or two to switch after you press the key
    • A – Enable/disable backlight auto-sleep (new in 1.40.00)
      • Green = Auto-sleep on (backlight will switch off after 1 minute)
      • Red = Auto-sleep off (backlight will not switch off)

    Switching layouts

    The keyboard has four different layouts:

    • Windows
    • Windows with ALT/FN/Menu/? keys as arrows
    • Mac (Alt and Win swapped)
    • Not sure (undocumented)

    How to switch modes:

    • Press L CTRL + R CTRL
    • Release either one CTRL while still holding the other down
    • Tap the released CTRL key to cycle through the modes

    You will see the numbers 1, 2, 3, 4 light up in green indicating the current layout mode.

    FN mode lock

    To activate FN lock:

    • Press ALT+ALT
    • Press ALT+ALT again to revert to normal mode

    There are no visual indicators to tell if you are in FN lock.

    Backlight modes

    Various backlight options are controlled through four function toggles:

    • FN+R – Turn off/on backlight
    • FN+T – Rate/speed change (for animated modes)
    • FN+Y – Backlight brightness (10 levels)
    • FN+U – Cycle through different backlight modes

    Available modes:

    • Static red
    • Static yellow
    • Static green
    • Static cyan
    • Static blue
    • Static purple
    • Static pink
    • Static orange
    • Static white
    • Static blue/white/red (France flag)
    • Static green/white/red (Italy flag)
    • Static cyan with white middle row (row 3)
    • Animated pulsing colour cycle
    • Animated rainbow scrolling/marquee
    • Random colour on keypress (fades away)
    • Random colour on keypress (remains lit)
    • Animated light spread on keypress
    • Animated random colour on keys

    Win key disable

    To disable the Win key (or Command key in Mac mode):

    • FN+WIN – Disable the WIN key
    • FN+WIN again to enable

    There’s no visual indicator on whether the key is locked or not. In Mac mode, FN+ALT locks the command key.

    DFU mode

    DFU mode is required for upgrading firmware.

    To enter DFU mode:

    • Unplug the USB cable
    • Hold ESC while poking the reset button behind the keyboard
    • Connect the USB cable

    These instructions are also posted as a README in GitHub:
    https://github.com/detach8/obins-anne-pro-user-guide/tree/master

  • Are Network Load Balancers Faster? A story on Engineering decisions.

    Are Network Load Balancers Faster? A story on Engineering decisions.

    I was working on a project and an Engineer approached me after going through the AWS environment. He made a recommendation to switch from an Application Load Balancer (ALB) to a Network Load Balancer (NLB), and his reason was that the application may potentially receive high traffic and that the NLB has better performance.

    Well, he is not wrong because AWS’s documentation states“If extreme performance and static IP is needed… we recommend you use a Network Load Balancer.”

    However, the statement from AWS concerns only the performance capabilities of the load balancer — it doesn’t mean that your application as a whole would have better performance.

    Whatttttt??? I’m talking rubbish, right?

    I used to work with a telco to build and maintain HTTP Load Balancers back in 2009. We were load balancing at its peak around 20 Gbps of HTTP traffic to a web cache farm sitting in the core of the telco’s network. Web caches were really important for user experience because most of the web content that Singapore users consumed was overseas.

    Serving up 20 Gbps of web traffic was a huge feat during that time — most PC still had 100 Mbps LAN, and we didn’t even have fiber broadband in Singapore yet. We had around 40 web cache servers, each only capable of handling around 500–600 Mbps of load. The bottleneck on the cache server was disk I/O and CPU.

    The optimizations that HTTP LBs do became very important. Good HTTP LBs advertise all sorts of fancy features for a reason (because people need them), but the most important bit is that it takes work away from the backend servers — the LBs we used back then (Citrix NetScaler) will multiplex multiple HTTP requests across a single TCP connection. This made a HUGE difference to the web cache server performance. Without this feature, each web cache can barely handle 100–200Mbps of load because under millions of requests TCP connections are being set up and torn down. If you know how HTTP servers work, you will know that every TCP connection is a new thread which is an expensive operation.

    A few years later, I was once again dealing with LBs for a US tech startup. At the peak, they were getting millions of API requests and their servers were struggling. I replaced traditional NLBs with ALBs and it reduced the load of the backend servers by 20–30%.

    In most cases, backend servers are already busy doing what it needs to do — business logic, database access, etc. What you’d want is to have the LB offload any extra header processing, routing rules, redirection/filtering, SSL, etc. so your servers don’t have to. Another feature of an ALB is its ability to use more intelligent load distribution algorithms based on application-aware parameters such as HTTP headers, which can be very important with HTTP applications.

    The Engineer made an assumption that an NLB will yield better performance — but we didn’t have data, and didn’t have an actual performance issue.

    As Engineers, we need to know how to do work with meaningful impact and outcomes and avoid trying to prematurely optimize based on assumptions.

  • What are the kids thinking? A peek into the future of the Metaverse

    What are the kids thinking? A peek into the future of the Metaverse

    Earlier today my eldest son (7 years old) came up to me and asked me to help him buy Robux, the in-game credits for Roblox. He wasn’t asking me to pay for it — instead, he handed me $10 from his angbao savings and wanted to spend it on dressing up his Roblox avatar.

    Obviously I said: “No.”

    Later in the evening I was working on my old IBM laptop that is now around 16 years old. It runs Linux and I was using it to wipe some old hard drives I intended to dispose. While the slow wipe was running, I was bored and decided to play a retro game on my retro laptop: DOOM.

    In the game, this help screen appears when you hit F1:

    Screenshot of the Help screen in Doom (1993)

    What caught my attention was that you could buy Doom for $40 (USD) including Shipping & Handling. $40 was quite a bit of money back in those days, but it was not just a game – Doom was one heck of an engineering feat for the price.

    A little history — you can skip this part if you aren’t interested: Doom was developed back in 1993. When Doom was built, the game engine itself was entirely new and it was the first time the world has ever seen such real-time (pseudo-)3D graphics in a home computer. This was around the same time Intel launched the Pentium processor after its success with the 486. Let me repeat, in case it was not obvious: 66MHz was the fastest desktop CPU you could get at that time; your microwave oven probably has a faster CPU today. Games these days rely heavily on layers of technologies built over the years — hardware GPUs, 3D libraries/APIs (like DirectX/OpenGL), and game engines (like Unity). There were no such things back in 1993. Graphics in Doom is purely CPU-rendered.

    But if I went to my parents back in 1993 and asked for $40 to buy the game, my parents would have gone:

    “SIAO AH?”

    This was what got me thinking: what was my son’s motivation behind paying for fancy clothes on his virtual character?

    My generation today have accepted that it is normal to buy games. The transaction rewards the buyer with entertainment (playing the game), and the seller for their efforts (creating the game.)

    30 years ago, my parents would have been paying for something that their parents (i.e. my grandparents) would have thought were simply a waste of money. 30 years from now, our kids will be paying for something that we thought was nuts today.

    I was initially skeptical, but Mark Zukerberg may be up to something with this whole Metaverse thing. The technology is probably a bit too early for its time. Something must first exist to bridge the gap, and I think it might be in the form of an immersive, social-gaming app.

    Another thing: There’s some misconception that the Metaverse is/needs Virtual Reality (VR); VR is one of many technologies that will enable us to live in the Metaverse, but it’s not the only technology. It is likely true that huge advancements in Virtual Reality (VR) or Augmented Reality (AR) technologies will enable more immersive and engaging metaverse experiences. The VR headsets we have today are akin to the PCs in the 1990s running pixelated 3D games: It looks crappy and uncomfortable to wear, and is sort of at the edge of getting better with graphics looking quite decent, but in due course the hardware size, performance and quality will likely catch up.

    The fact though, is that some aspects of this Metaverse is already here. Think about where people are spending more time and money.

    What does the future look like then?

    Think about a world where the digital resources becomes even more convenient and easy to access; think about the walls of your homes simply made of large digital screens where you could do anything you wanted – meet a friend, go to work, pull up a photo; think about getting into a train but being in a virtual world where you could still talk to your kids at home… or on Mars?

  • Open Source Primary and Secondary Educational Resources

    Open Source Primary and Secondary Educational Resources

    Can Primary, or even Secondary education materials in Singapore be made Open Source so that educators or even members of the public contribute and consume freely? Can and should such education materials be made free and open for all?

    What triggered me was the need to sign up for an account before I could even browse the booklist at an appointed book store for my child’s Primary school. After glancing through the list of books, it’s clear that only a few handful of publishers monopolize this entire market.

    I recall having gone through much of my youth depending on many external/supplementary resources including the famous “10-year series” as well as various other exercise books, notes, etc.

    When I went to Polytechnic where I was given a choice of my own, I did not buy a single textbook after my first year and instead relied on lecture notes (which were annoyingly only for purchase at the school’s printer) and additional material either on the Internet or the library for most of my studies.

    I also recall books getting stolen, because people who didn’t bring them didn’t want to get punished, so the stole others’. I also recall ripping apart super thick books by chapter so we would carry less weight around to school, and then getting scolded for it because defacing a textbook was an offence. (For the youngsters who don’t understand: back in those days we carry every single book to school every day – there were no lockers and we can’t leave them under our desks. The idea was that if we left the books in school, we don’t study them at home.)

    Long story short, my personal experience with textbooks hasn’t been great; if textbooks were perfect, our teachers wouldn’t need to come up with additional materials and creative ways to teach.

    Imagine a world where we could opt for books in print or PDF. Imagine a world where we could just print only the chapters we wanted. Imagine a world where if your child saw a typo error could just submit an edit back, and maybe even get recognized for it. Imagine a world where if we needed to see a newer or older version of a book we could simply download a different PDF, or look at a specific git tag? Imagine a world where underprivileged families wouldn’t have to get sponsorship to buy textbooks, but instead go and print a chapter they need at a community center?

    I’m sure every year thousands of educators create content that would have made our materials much better and more up-to-date if it were contributed back to a central, open, textbook. Our education ministry MOE can then act as the maintainer of the project – to curate and validate content before accepting it mainstream.

    Question is, where and how to start? Can our education ministry drive this? Can we see in 5, 10 years that Singapore has built such a strong Open Source resource that we have other countries use and also contribute back?

    Further reading: https://en.wikipedia.org/wiki/Open_educational_resources

  • Ten years of memories

    Ten years of memories

    I resigned from my previous job and joined a new one in 2020 – just right before the whole COVID-19 pandemic started.

    The “previous job” wasn’t just a job. It was a job I had for almost ten years since 2010. Ten years in the Tech industry today is quite unheard of – but I think many people do not stay long enough these days to see through the gravity of decisions they made and clean up the sh*t along the way.

    I was (and still am today) a Director of the business entity in Singapore. Since I am (still) a Director, I didn’t have to vacate my desk like a normal resigning employee would; I had intended to do so over several weeks or months, but COVID struck, and then weeks became months, months became years.

    It’s now September 2021 – almost two years from when I had resigned from my “previous job” and all my stuff are still in the office. Ten years of stuff to be precise. The office is undergoing a refresh now, so I decided it is really time to vacate my luxurious corner seat for those who deserve it, but as I start clearing out my desk I can’t help but feel very emotional…

    Ten years didn’t go by quickly, yet it felt like it was yesterday. I left a job as a Systems Engineer working shifts and camping in telco data centers to start the Singapore business operations for a small US-based boutique web hosting company. It was a bump in both my job responsibilities and salary.

    I have made the office my second home. As I pack my cubicle, every piece brings memories. Regretfully, I did not manage to take a photo of my entire desk area before I started clearing it out.

    Family

    There’s a bronze horse and another wooden pen holder with horse carvings – an item my dad handed down to me when I first “started” the business here. It is to wish me success: “马到成功” in Chinese. It reminds me that my family was behind me in all my endeavors.

    A photo of my wife and eldest son sits on a photo frame. I still recall when my son was around 1.5 years old I had to bring him to the office because the school was closed and I carried him in my arms while I worked at the office. It reminds me that sometimes you can’t separate work and family and it will always be a challenge to manage them both.

    My son sleeping on my lap while I’m at my desk, 11 October 2016

    Change

    I have a few R/C models on display and they’ve been sitting there for as long as I could remember. I had hoped to eventually pick up the hobby again but never did, and they remain as display items ever since. It reminds me that our priorities in life change and that change is the only constant.

    Old toys on display

    Learning

    I moved a bunch of books from my shelf to the common area bookshelf. Some of these books are from my tertiary education days; some on advanced topics that were not part of the regular school curriculum. There were also books bought during the course of work. However, most of these old books are no longer useful as they are outdated. It reminds me that learning never stops.

    I found a git cheat sheet hiding in a corner. I had printed it when I was first learning git, and had intended to use it but never did because Googling was just faster and easier. It reminds me that sometimes learning is not always a straight path.

    See the Git Cheat Sheet?

    I look at the 3D printer in the corner of my cubicle. I had purchased it on impulse as a birthday gift for myself in 2018. In fact, I was so busy during the period that I did not assemble it until a month later and it took me many attempts before I was able to print something decent. I have since used it to print many items for myself and even friends and colleagues to make replacement parts for real things, including car parts. It reminds me that sometimes you can learn new things as long as you try, and you’ll not know the real value of what was learned until later.

    Creality Ender 3 – covered in plastic to keep our the dust

    Health

    I pull out a booklet containing healthcare insurance policies that we have purchased only recently. Over the years I have paid out-of-pocket for several medical procedures, and do not want that to happen to any employees and have pushed to have this in place. It also reminds me that health is still the most important.

    People

    I look at all the stuff around my cubicle – gifts, items from events, business cards, etc. It reminds me of the number of people with whom I have crossed paths.

    I pull out a file containing the CV of every candidate I have interviewed and made an offer to over the years – some still current employees.

    These remind me that at the end of the day, we do not work alone.

    I look around the office and see the cubicles and desks of everyone. A company that was just two persons grown to a size of 7 and is profitable – not some VC-funded thing – reminds me of the constant struggles during the early phases as we tried to turn a profit.

    I am proud of the team, and my departure is probably timely because the situation makes the people. COVID-19 is a trying time, but in trying times lie opportunities.

    Off to my next adventure, and I hope to write a similar entry at the end of it.