This Week I Learned - 2016 Week 16

Write-up for last week or you might want to read the whole series.

Using short URLs when sharing document through OneDrive or Google Drive? Think twice. Researchers have managed to brute force short URLs within six characters to obtain the content.

Ubuntu 16.04 (Xenial Xerus) finally released (Vagrant box download here). The is the LTS release that going to replace the 14.04 (Trusty Tahr) and by looking at the release notes, there are so many upgrades, especially LXD 2.0 (more on other features in coming post). However, there is one feature that everyone is yearning on for so many year. We can now move the launcher to the bottom of the screen ! Hooray ! The funny thing is after so many years of yearning for such feature, I'm getting used of the launcher on the left. How ironic is that?
$ gsettings set com.canonical.Unity.Launcher launcher-position Bottom # to the bottom
$ gsettings set com.canonical.Unity.Launcher launcher-position Left # to the left

While we're on Ubuntu, another new feature added was Snap package format. However, was seems to be not secure at all as made known by Matthew Garrett. While I'm not sure how this things works, is best to avoid installing any Snap packages.

Talking to a dying person. Pieter Hintjens, the programmer of ZeroMQ, distributed messaging, has been diagnosed with incurable cancer. The best way to talk about this is to remind the patient about the good old days or experience both of you have together. Remind and cherish the memory you have together.

Particular case of renaming files? Didn't realize that renameutils exists. Basically running the 'qmv' command will fire up your editor and let you change the file names as you wish.

I've been tinker with Emacs these days and the ironic part is I've become a more informed Vim user. If you want to save a portion of file to external file and delete it at the same time, pipe it out through ':!cat > filename.txt'.

Surprise found in Youtube, Gundam Thunderbolt (ONA released) was probably the only Anime that caught my attention. Fluid animation (the drum solo), Jazzy music (kind of remind you of Cowboy Bebop, someone even joked about this series as Gundam Bebop), face paced action, and character designDiscussions at Reddit share the same sentiment. All this reignites my interest for Mecha and Gundam Model Kit again.

This Week I Learned - 2016 Week 15

Last week post or the whole series.

Stop using numbering system to make the post feels more like an essay. It seemed to change my writing style as well. Variations is good for writing and it took me 14 weeks to make necessary changes. The next step is to build a writing ritual to write at any time and any where.

The recent released of native Bash (HN thread) through Ubuntu in Windows (think of this as the reverse of Wine, mapping Linux system calls to Win APIs) though Windows Subsystem for Linux (WSL) caught everyone by surprise or not (some see this as the return of Embrace, extend, and extinguish by Microsoft). Historically, Apple and Oracle have done this (different approach) and continue to do so and I was surprised it took Microsoft this long. Compare to last time, this strategy basically a response to recapture the developer base rather than the user base.

And also, it proved that calling GNU/Linux now make more sense now than ever and and how significant importance of GNU system. Now that Microsoft and Canonical slapped the GNU system (user space) on top of Windows kernel, should we address this combination as GNU/kWindows (HN thread) instead, similar to GNU/kFreeBSD? Note the 'k' stands for kernel. How will this affect other GNU/Linux distros and FSF itself? Red Hat responded by letting developers download its distro for free. However, there is always the issue of lock-on when free software depends on nonfree. Since the embrace phase have started, the extend phase will follow suite. Is history going to repeat itself again?This shall be seen. Interesting days ahead in the technology scene in coming years.

Biggest regret as a programmer? Andrew Wulf's reflection did raise some interesting and thoughtful discussion in HN, Reddit, and Lobsters. In the end of the day, don't compare, do what you love but take care of your finance.

Hitler uses Docker. The parody-subtitled video making fun of the Docker, the overhyped container technology. If you don't understand the context of the video, read the annotated notes to the video. This reminds me of similar satire of MongoDB is web scale during the hype of NoSQL fad few years back.

Picking up Perl? While Peter Norvig said it's not possible to learn any programming languages in 21 days, but you can learn enough Perl in 2 hours and 30 minutes or in Y minutes instead. For starter, two things you will need to understand which are using strict and warnings as well as why use 'my'.

This Week I Learned - 2016 Week 14

Last week post or the whole series.

#1 Replace Git Bash with MinTTY. Even though you can run Bash on Ubuntu in Windows right now, the most acceptable way (without using the dreadful Windows Command line) before this is through Cygwin and MinTTY. Don't like MinTTY? Well you've Babun and MSYS2, both are based on Cygwin. But still, nothing beat a Vagrant emulated environment.

#2 12 years, 12 lessons working at ThoughtWorks. (HN thread, Reddit thread) Some beg to differ. His retrospective team approach, especially the four key questions, should be applied by any software team. Note that ThoughtWorks is both a software house and a consulting firm.

#3 BPF Compiler Collection. Efficient Linux kernel tracing and performance analysis. You can read the docs and try it out. Only for Linux kernel 4.1 and above though. Compliment to the Brendan Gregg's Linux performance material but at different approach.

#4 Brett Victor's bookshelf. Some people are just prolific book reader. I always love his idea of reactive documents, an implementation of his concept of Explorable Explanations.

#5 Startups in MontrĂ©al. E14N is the only one I'm aware of. Anyway, the discussion at HN is far more interesting regarding the place. Language racism is true and alive there, culturally and systematically forced upon you.

#6 Effective code review or faults finding and blames? Why do you need code review in the first place if trivial matter such as coding convention still cannot be properly enforced? Note that there are tools exists to fix most of these issues and is a no-brainer to rectify this (is just a command away). Root cause is still there is lack of healthy culture that values quality but instead more towards faster delivery.  Or maybe because the software industry itself does not promote integrity (Lobsters thread)?  Or maybe we applied the wrong approach?

#7 perlootut - Object-Oriented Programming in Perl Tutorial. Holy Macaroni! I've never realized that Perl's built-in Object-Oriented feature is so limited. In other words, object in Perl is a glorified hashes. Yes, you have to write your own classes from scratch!

#8 How to start gnome-terminal in fullscreen. Nobody bother to add or enable this feature as sensible default and you have to resort to multiple ways to get it to work. While I can understand of reducing the UI clutters (or dumbing down)in GNOME, but nobody actually use the gnome-terminal in fullscreen mode? It seems that GKH also have issue with gnome-terminal itself.

First Step With mod_perl

Feeling nostalgia about HTTP (RFC2616) and CGI (RFC3875), I was thinking of looking into mod_python, which, unfortunately not updated since 2013. Instead of mod_php, I went for mod_perl. Not something to fancy about (well, it's a legacy technology anyway despite Perl 6 was recently released) but nevertheless, better than revisit mod_php again.

What is all these mod_<insert language>? Well, these are Apache module for a particular programming language. In other words, mod_<insert language> allows a programming language interpreter to be embedded into Apache web server.

Such approach have one significant benefit. Speed.

Since the Perl interpreter is embedded into Apache, there is no need to forward each HTTP request to an external program, thus reducing the overhead. Furthermore, upon starting the web server, all Perl code are compiled and loaded once. Unless there are changes to the code, all HTTP requests are handled by pre-compiled cached code. Furthermore, integration with web server allows Perl code to access and modify the HTTP requests.

We proceed with the installation. Note that this was done in Ubuntu 14.04 using LXD 2.0.
$ sudo apt-get install apache2 libapache2-mod-perl2
$ sudo a2enmod perl
$ sudo service apache2 restart

To check that mod_perl has been installed successfully. The quickest way is to check the Apache's server signature in the error log file.
$ grep mod_perl /var/log/apache2/error.log | tail -1
[Sat Apr 09 05:27:11.726824 2016] [mpm_event:notice] [pid 2057:tid 140441217996672] 
AH00489: Apache/2.4.7 (Ubuntu) mod_perl/2.0.8 Perl/v5.18.2 configured -- resuming normal operations

Another way, where we want the more configuration details of the installed mod_perl (similar to PHP's phpinfo) is to use Apache2::Status.

First, create the required configuration file.
$ cat /etc/apache2/conf-available/perl-status.conf 
<Location /perl-status>
    SetHandler perl-script
    PerlResponseHandler Apache2::Status

    # disallow public access
    Order Deny,Allow
    Deny from all

    # change to 'Allow from all' if you want to load this page other than localhost
    # not advisable for production machine
    Allow from

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Then, enable the configuration and restart Apache web server.
$ sudo a2enconf perl-status
$ sudo service apache2 restart

Quick check using the w3m text-based browser. Note that w3m is using Vi-like key bindings. To go back to previous page, press 'Shift+b'.
$ w3m localhost/perl-status
Embedded Perl version v5.18.2 for Apache/2.4.7 (Ubuntu) process 2285,
running since Sat Apr 9 05:27:11 2016

Loaded Modules
Inheritance Tree
ISA Tree
Perl Configuration
Compiled Registry Scripts
PerlRequire'd Files
Signal Handlers
Symbol Table Dump

This Week I Learned - 2016 Week 13

Last week post or the whole series.

#1 Unexpectedly Realistic. (Reddit thread). Not entirely true but it always a good time to hit the gym to workout consistently.

#2 Conrad Jon Godly. Simple yet mesmerizing oil painting.

#3 tracker-store and tracker-miner-fs eating up my CPU on every startup. My CPU load have have been high for the past few days. Booting and starting programs have been testing my patience.

#4 An Autobiography of a Blind Programmer. (Reddit thread) If a visually impaired person can learned to code, no one else have other more lame excuses not to do so. His story reminds me of the infamous blind programmer, T.V. Raman, known for creating Emacspeak.

#5 Microsoft's EEE. Good discussion on the Embrace, Extend, and Extinguish strategy by Microsoft. Is history going to repeat itself like wIat happened to OS/2, Netscape, and the Internet Explorer monopoly which held back the web for a few years? People still need to remember that they are is still a for-profit organization. I will remain skeptical until they truly embrace the GNU General Public License.

#6 How do you integrate remote developers? Discussions there are spot on. Unless the company truly embrace remote-first culture and reduce the jealousy and tension from regular employees, otherwise it will not work.