This Week I Learned - 2017 Week 34

Last week post or the old archive stuff.


Having a working and non-disrupting battle station have finally let me able to concentrate on my personal stuff. There are a lot of things to clean up and de-clutter but one thing at a time. At least I can sync up the productivity at both work and home.


Lots of re-learning of ConTeXt, after so many years away from it. The number one rule in using ConTeXt, you must append a comma (,) in a list of items. Not sure why, but I was burned several times where the intended results were not obtained regardless numerous times of trials and errors.

This will not work.
\setuphead[subject][
    textstyle=cap,
    header=empty,
    alternative=middle,
    style=bold
]

This will work.
\setuphead[subject][
    textstyle=cap,
    header=empty,
    alternative=middle,
    style=bold,
]

Undo certain Git commit. Two steps involved. First is to reset or remove the particular commit and push the changes to remote origin. Second, pull from the remote origin and reset the index.
$ git reset 7f6d03 --hard
$ git push origin -f

$ git fetch origin
$ git reset 7f6d03 --hard

Finally, found the effective way of managing your dotfiles and the full write-up describes the details on how to set it up, either new or existing Git repository. Good example where the lack of understanding of Git undermines the effective usage of managing your dotfiles. There is no need for external programs to manage your symlink and updates. Just plain old Git. The hassle and complexity of managing your development environment setups (I've tried a few ways) is not worth the time and efforts.


People, this is how you design a login or registration form.



Installed, uninstalled, and reinstalled the Vim package. Somehow the path to Vim binary have been messed up. However, update the Bash's hash table of full path names of executable files seems to solve it.
$ vim
-bash: /usr/local/bin/vim: No such file or directory

$ which -a vim
/usr/bin/vim

$ hash -r

Somehow my Vim installation does not support Python plugins. Some googling here and there revealed that I have multiple implementation of Vim installed in the system. The default selected Vim binary does not support Python plugins. The only way is to update the alternative.
$ sudo update-alternatives --config vi
There are 3 choices for the alternative vi (providing /usr/bin/vi).

  Selection    Path               Priority   Status
------------------------------------------------------------
* 0            /usr/bin/vim.gtk3   50        auto mode
  1            /usr/bin/nvi        20        manual mode
  2            /usr/bin/vim.gtk3   50        manual mode
  3            /usr/bin/vim.nox    40        manual mode

Press  to keep the current choice[*], or type selection number: 3
update-alternatives: using /usr/bin/vim.nox to provide /usr/bin/vi (vi) in manual mode

$ sudo update-alternatives --config vim
There are 2 choices for the alternative vim (providing /usr/bin/vim).

  Selection    Path               Priority   Status
------------------------------------------------------------
  0            /usr/bin/vim.gtk3   50        auto mode
  1            /usr/bin/vim.gtk3   50        manual mode
* 2            /usr/bin/vim.nox    40        manual mode

Press  to keep the current choice[*], or type selection number: 2


People start hating their jobs at age 35? (via HN) The best possible reason is that they become very aware of mortality and realize time move at a relatively faster pace.


How the RPi::WiringPi distribution is tested. You have to be amazed by the effort the author is putting in ensuring the quality of the libraries. Probably one the most meticulous developer I've seen online. The hardware setup is shown in the screenshot.


Don't like any ready-build electronic prototyping platforms? You can try Shrimp parts kits. I love the minimalist approach of gathering different electronic components and build something up. Good alternative to Arduino. The step-by-step guidance, for example, to blink an LED, is a good introduction for any beginner (yours truly) who want to pick up some electronic.

This Week I Learned - 2017 Week 33

Last week post or the old ramblings.


The Vox POP is probably the most entertaining and educational YouTube channel right now. I wish they produce more and frequently.




Mommy, Why is There a Server in the House? Suitable for those who are active in /r/homelab.


Refurbished my battle station and upgraded my Fedora 25 to 26. Nothing special about this release and I was expecting something significant or may be I miss out something?
$ sudo dnf upgrade --refresh
$ sudo dnf install dnf-plugin-system-upgrade
$ sudo dnf system-upgrade download --releasever=26
$ sudo dnf system-upgrade reboot


Gigabyte MA10-ST0 powered by Intel® Atom C3958 SoC. A 16-core Atom (C3958 SoC) server board which can be a good server-based motherboard for virtualization or NAS. Think ESXi, FreeNAS, or Proxmox. I was thinking of buying and setting one up for data hoarding.


Does programmer needs office? Definitely. I still fail to understand why corporation still craze over open office floor plan. It's very hard to concentrate without any distraction. People walking by and talking non-stop. Collaboration doesn't means physical communication, it can be done through any messaging app. Private office does works. The funny thing is, I miss cubicle. At least you can really concentrate and work in the zone.


Unknown electronic parts? Get it from Octopart. Buying chips and checking availability? Find Chips.


Speaker broke down and I need to get a new pair of cheap bookshelf speaker. Initially was searching for a pair for good bookshelf speaker like Pioneer SP-BS22-LR, but unfortunately, this model have been either phased out or you have to purchase whole Hi-Fi set. Meanwhile, no local distributor is importing Micca PB42x. I read good review on Swan HiVi D1010-IV or Swan Hivi D1080-IV, might as well allocates budget to purchase this instead. Luckily we can still find it from the local supplier and the price still acceptable, within MYR 450-plus. All this discussion about cheap and good quality speaker is useless if you can't can't hear audio quality? Otherwise, you're just wasting money without any actual benefits.

When you have a pair of speakers, to get the best out of your 2.1 setup. The next purchases will a Digital Analog Conveter (DAC), which convert binary bits (zero or one) to analogue signal and a amp. If you have a DAC, you can skip buying a sound card. Popular DAC is Behringer UCA202 or UCA222 and for amp, Lepai 2020A+SMSL SA50Diagram below illustrates this setup.



Slow MySQL performance in Docker instance? Use TMPFS, where you put the whole database into the RAM. The approach for MySQL docker instance seems easy enough to setup and there have been many documented results.


Why are we trying hard to optimize the MySQL Docker instance? One of the main issue is that big database restoration may kill the MySQL daemon due to either large volume of records. Which begs the question, how many rows? This is determined by server parameter of `max_allowed_packet` or adjust the server according to these parameters.
- bulk_insert_buffer_size = 256M
- innodb_log_buffer_size = 64M
- innodb_log_file_size = 1G
- max_allowed_packet = 1G

While we're on MySQL, it seems we can delete records from two tables in one DELETE statement. The key thing here is the columns from both tables need to be specified.
DELETE a.*, b.*
FROM table1 a
LEFT JOIN table2 b
ON a.id = b.id
WHERE a.id = 1


It has been a while that I talked about Perl. Getting unique array list. Sigh, every single damn time I've encountered this I was wondering why this is not built into the core language itself?


GNOME is 20 years. It has been so long since I first tried it. I'm getting old. After Ubuntu switching to GNOME as default desktop environment, I felt that GNOME have finally won the GNU/Linux desktop war against KDE after so many fricking years.


No space life in Docker Machine in Windows? Maybe you can recreate another `default` Docker Machine following these settings. Assumed you're using VirtualBox.
$ docker-machine create
--driver virtualbox
--virtualbox-memory 8096
--virtualbox-disk-size 40000

ISTQB Certification Road Map

As I was looking into Test Driven Design (TDD) and software testing, eventually you will going to encounter ISTQB (International Software Testing Qualification Board) certification. While some may argue that having certification is meaningless (I do agree, some were created just to make money), I'm more interested to find out the body of knowledge have been covered for software testing itself. This was inspired by something similar, the SWEBOK (Software Engineering Body of Knowledge).

Based on the official road map stated, there are basically three categories of certification paths of Agile, Core, and Specialist. All three paths must originates from the Foundation Level. The Core certification path, by default is the conventional path to be taken as shown below (screenshot taken from ISTQB site). To finish the whole Core path, you will need to finish 6 exams, which I think is going to take quite a well.

However, for local Malaysian who are interested in pursuing this path, the local chapter, represented by the Malaysia Software Testing Qualification Board (MSTB) only have two ISTQB Certifications which are Foundation Level and Advanced Level (Test Manager). I suspect that the local software industry does not justify for any other ISTQB certifications beside these two.



Looking into other certification path, the Specialist path is indeed interesting. I'm wondering what does a tester going to test in a gambling industry? The slot machine or the online gambling which I think related to the Web?

Stay tuned. More about ISTQB in coming weeks.

This Week I Learned - 2017 Week 32

Last week post or something from the old TWIL archive.


Everything should be back on track this week after the "nature appreciation week". Lots of pending items to be checked off. Luckily, a few long delay items have been cleared off. As they said, one thing at a time. If you can't do it today, continue tomorrow but do not postpone for more than two days. Keep the streak going!

I've been quite effective in applying Scrum or Kanban at my workplace. Sadly, I can't say the same about my personal projects. What if I can obtain the same efficiency at my own stuff? Surely I will be surprised by the results. Lately, I have been thinking about what are the effective ways to get the best of each day, either at workplace and home. Discipline is definitely a must, of course with effective system. Another approach is to focus on overlapping what you done at work and your own personal projects. Focus on the important stuff, one thing at a time. Throw it the work life balance as well. Sometimes you just need to walk away from anything and just to unwind and recharge.


Invest in your own learning. Julia Evans shared her thought on this matter on keeping learning outside working hours. Learn and read something new but relevant to your work. That's it. However, it's best to set a time after work, for example, half an hour and learn or work on something new. This may sound easy but it's quite hard to do it in a constant manner. Consistency is always hard. Self-discipline is always hard.


What would you do if programming is made illegal overnight? Be a problem solver. Or do something else other than development works. There are millions of problems that need to be solved and and you can leverage your programming or IT knowledge one way or another. During the nature appreciation week, I've thought and discussed about this with my younger peers during the whole trip. Unfortunately, we are still caught into the tribalistic pressure or social conditioning in the name of team work or company culture. Someone told me before when I was starting out as a programmer, pick your battles, not everything is worth fighting for. These battles here refers to the things you want to do in your life, your bucket list, or something meaningful. And off course, at the same time, without starving yourself.


The morning paper and the Arxiv Sanity Preserver. I love reading research papers, even though most of the time I can't really understand most of it, especially those not within my domain of expertise. But the morning paper site makes everything fun and bearable. Beware, energy, attention, focus, and time are scarce, use it properly on things that matter to you. That's why social media are big time waster unless you're working in the digital content industry.


Ligne claire. French of clear line, the art style used by many illustrator, especially Moebius. Most recent illustrator who follows such style is Josan Gonzalez.


Money has a way of being the perfect "excuse" for vicious people to expose their viciousness. Interesting digression from the forum discussion which turned dark half-way.


Git bisect, the proper workflow. Didn't realize such things exists and probably won't bother to pick it up.

Asus P7F-M

As I was migrating or build another workstation or battlestation, I opted to build the machine based on Intel Xeon X3430 and LGA 1156 socket instead of trending AMD's Ryzen. Yes, it was an odd choice due to the sentimental feeling I have for old Xeon processor, especially the X series. And it's good to bought used anyway and I don't want to waste my existing ECC RAM. If you're looking to build a system through used parts, the X58 LGA 1366 would be a better choice as it's still quite relevant and supported.

Getting the motherboard is not easy as LGA 1156 socket is a deprecated old architecture. Furthermore, getting one that support ECC RAM and micro-ATX form factor is even more harder. Luckily I managed to found Asus P7F-M and Xeon X3430 CPU through Tao Bao with a reasonable prices. The former costs around MYR 150+ and the later, around MYR 40+.



One key lesson I've learned when build a PC is that you really need to read the damn manual. I've spent several nights for the past week trying to figure out what went wrong when the machine cannot POST (power-on self-test). And the root cause is simply I don't RTFM and wasting time plugging and unplugging each hardware components from the motherboard. More on this later.

Unknown to me, the cheapest heatsink fan I've bought have the 3-pin power source instead of regular 4-pin. Initially I thought it will not work but luckily, the motherboard support switching the CPU fan from default 4-pin to 3-pin. The diagram below illustrated how to switching the CPU fan selection. It has been so long since I last need to change the jumper of a motherboard. Interesting time indeed.


Next, which is the part I struggled to boot up the machine, I didn't realize that desktop and server motherboard behaved differently. A server motherboard will immediately POST up once power supply have been turned. Not so with desktop motherboard, you will need to "jump start" (like pressing the power button if installed to a casing) it manually. Turned out it's quite easy, you will need to take a screw driver and touch both the POWERBTN# and GND pin at the same time. In the diagram below, it's located at the System Panel 20-pin connector, second row, pin number 5 and 6 from the left.

Upon realizing this, I was sitting at my computer and starring mindlessly at the motherboard. I was troubleshooting it for days and it just dawned to me that everything was working fine. I just need to power up the system from the motherboard.


Next, the default onboard VGA controller. Since I've existing graphic card which support multiple monitors, best to disable the VGA controller. The VGA controller was way better than my HP Proliant's VGA controller running Aspeed AST2050 8MB of RAM. Even without installing the external graphic card, the usage was snappy enough in Fedora 26.


Upon completion on setting up the system as well as the Operating System, checking through the temperatures, everything seems to be within acceptable ranges.
$ sensors
radeon-pci-0100
Adapter: PCI adapter
temp1:        +60.5°C  (crit = +120.0°C, hyst = +90.0°C)

coretemp-isa-0000
Adapter: ISA adapter
Core 0:       +47.0°C  (high = +83.0°C, crit = +99.0°C)
Core 1:       +41.0°C  (high = +83.0°C, crit = +99.0°C)
Core 2:       +46.0°C  (high = +83.0°C, crit = +99.0°C)
Core 3:       +44.0°C  (high = +83.0°C, crit = +99.0°C)

Is this motherboard better? Indeed, it felt way faster compare to my old HP Proliant's motherboard. However, there are certain underutilized features, for examples, the RAID and extra dual LAN ports. Furthermore, I believe two memory slots were broken (can't complain much since it's bought used) and I ended up with only 16G of ECC RAM. Suffice to say, should be good enough for my daily usage since my old workstation's motherboard have been partially broken and kept restarting somehow. My hope that this motherboard is good enough to give me maximum three more years of continuous abuse.

This Week I Learned - 2017 Week 31

Another week, another post. Looking for last week post or something from the archive?


The annual nature appreciation week. Didn't realize that such a place exists in this country. I really need to brush up my local geographical knowledge. However, nature should be explore in its natural form, as in camping, not from some resort built near to it.  And the food, that's a lot to be desired. Pity though.


Fighting with idiotic MySQL 2013 lost connection error for the past week with the Docker instance. Tried different approaches to tweak the server so the database restoration process won't kept throwing such error. In the end, proceed with Plan B approach by changing the mysqldump script so that it will skip extended insert. The side effect of such approach is that the dump file will be bigger and database reloading will take longer. But something working even though slow is way better that something broken. In coming weeks, will look into different approaches, for example, putting the whole test databases in memory (using tmpfs approach which can speed up testing), mysqlpdump (parallel version of mysqldump), or using ProxySQL.


Scientific communication as sequential art. I hope one day that the academic world will publish literature in more readable and accessible way. Actually it's not that hard, some common sense with certain good "taste".


Unit circle. After living for so long, I finally grok trigonometry and understand what the heck is sine, cosine, and tangent.


If you've fork a repository and want to sync from the remote upstream? Two steps. First, set up the remote upstream URL. Second, sync the fork from the upstream.