Golang Installation in Ubuntu 13.10

Based on this instruction, not the cleanest package-based installation.

Install the necessary packages
$ sudo apt-get install golang bzr

Create and set the $GOPATH
$ mkdir $HOME/Project/go
$ export $GOPATH=$HOME/Projects/go

Obtain and install the godeb utility. Note that the tool is located in launchpad, hence the need of bzr version control in step 1.
$ go get launchpad.net/godeb

Test our installation of godeb.
$ $GOPATH/bin/godeb --help

Remove the existing old Golang binary of version 1.1.2.
$ sudo apt-get remove golang

List all available version and install the latest version
$ $GOPATH/bin/godeb list
$ sudo dpkg -i --force-overwrite go_1.2-godeb1_amd64.deb

Brightness Adjustment of Samsung Ativ Book 9 in Ubuntu 13.10

It seems that you can't adjust the brightness of this notebook using the function key Fn+F3 or Fn+F4 in Ubuntu 13.10. Even after you've set the additional kernel parameters to enable it as shown.

Edit /etc/default/grub and modify the GRUB_CMDLINE_LINUX_DEFAULT as shown.Before that, always save a backup copy so we can revert back in case we mess up somehow.
$ sudo cp /etc/default/grub /etc/default/grub.20140302
$ sudo vi /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT = "quiet splash = acpi_osi Linux acpi_backlight = vendor "

$ sudo update-grub 
$ sudo reboot

Check the kernel parameter again.
$ cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-3.11.0-17-generic.efi.signed root=UUID=a3f6d437-64e9-4379-be8f-b96438dbf677 ro quiet splash acpi_osi=Linux acpi_backlight=vendor vt.handoff=7

Which in the end you still need to use AMD Catalysit Control Center to reduce the brightness so I can extend the battery life.
$ sudo apt-get install gksu
$ gksudo /usr/lib/fglrx/bin/amdcccle

Go to Color (1) and adjust the Brightness (2) using the slider under the Adjustment section. See screenshot below.

Rust Installation in Ubuntu 13.10

I have been trying to install Rust, the programming language in the past by source code compilation but the whole process was pain in the arse due to the time taken (like forever) just to compile and install all the components. Luckily these days, you can just install it from PPA, as shown below.

Install the PPA and update your local packages.
$ sudo apt-add-repository ppa:hansjorg/rust
$ sudo apt-get update
Search for all available Rust version.

$ apt-cache search ^rust-*
rust-0.7 - Rust compiler and tools
rust-nightly - Rust compiler and tools
rust-0.8 - Rust compiler and tools
rust-0.9 - Rust compiler and tools

Install the most recent stable version.
$ sudo apt-get install rust-0.9
$ rustc --version
rustc 0.9
host: x86_64-unknown-linux-gnu

If you've been following "This Week in Rust" newsletter, better for you to install the latest greatest nightly version to test out certain feature.
$ sudo apt-get install rust-nightly
$ rustc --version
rustc 0.10-pre
host: x86_64-unknown-linux-gnu

As you can have multiple versions installed side-by-side, to switch between these versions, just run this command.
$ sudo update-alternatives --config rustc
There is 1 choice for the alternative rustc (providing /usr/bin/rustc).

  Selection    Path                              Priority   Status
  0            /usr/lib/rust/rust-0.9/bin/rustc   90        auto mode
* 1            /usr/lib/rust/rust-0.9/bin/rustc   90        manual mode

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

Test the sample hello program. Type this code below and save as hello.rs.
fn main() {

Compile and run it.
$ rustc hello.rs 
$ ls
hello  hello.rs
$ ./hello 

On Finishing

As I was looking back my to-do list in 2013 and planning for 2014, James Greig’s personal experiences on never finish anything strikes a chord not only just me, but other HN readers as well. There are still quite a lot of projects or items in my bucket list that are still not started, partially done, or completed not to my satisfaction. On a positive note, although not to my liking, I glad I did start certain projects.

For regular HN reader like me, you will notice quite a number of new projects sprung up weekly in Show HN. Arjuna’s advice is to “let go of Internet Time”, an illusion where everything seems faster on the net. As Dewie observed, some projects may seems to be created over the weekend but in reality are taking years and the domain knowledge to create.

In year 2014, more risks will be taken and a lot of unknown territory to be explored. Don’t dwell on those unfinished project, refocus and reprioritize, or as agentultra suggested, “some ideas deserve to die”. Pay attention on those projects or people that are worth pursuing.

In the end, don’t worry about finishing, just start.

Legacy Code Base

Due to some unforeseen reason, I took a quick look over two legacy code base in the system to fix certain issues. The more I looked at it, the more my stress level shoot up. I literally want to strangle the original programmers or anyone near me.

Yes, the module or feature did almost work as intended but modification or bug fixing is a pain in the arse. I have to suppress my inner urge multiple times the whole day thinking of whether to do a total rewrite or refactor of the module. I kept shaking my head whether I should fix the bug first or refactor the damn module while fixing it.

Framework, especially Model-view-controller (MVC) framework provides a good initial structure for creating an application. At least, you have the advantage of separation of concerns (SoC) between all these three layers. However, problems arise when we're deciding on what or how to separate a program into these sections. I've seen many types of abuse of the MVC framework especially those lack of Object-Oriented (OO) mindset. While we have idiom like "Fat Models, Skinny Controller" exists as a guideline, it still, can lead to another form of abuse like God Models.

The lesson I've learned is that rather than taking the best engineering approach to design a system, instead use the most suitable solution understandable by the technical competency of the available programmers. You can't change a procedural to OO mindset as well as their egos instantly. Especially true for senior programmer as they said, old habits dies hard. If the basic understanding of MVC and OO is seriously lacking, might as well take what Ramus Lerdorf proposed "no-framework PHP MVC framework" approach. At least it is more procedural and understandable by most PHP programmer.

CentOS is officially part of Red Hat

Surprising good news for CentOS as Red Hat had officially acquired the core team of the distro. What took them so long ? They (Red Hat) should have done this sooner. Now we can expect faster updates and security patches for CentOS. Suspect they want to sustain and increase the popularity of the most popular Red Hat variant.

The Case Against Open-Office

"The open office was originally conceived by a team from Hamburg, Germany, in the nineteen-fifties, to facilitate communication and idea flow. But a growing body of evidence suggests that the open office undermines the very things that it was designed to achieve."
"The employees suffered according to every measure: the new space was disruptive, stressful, and cumbersome, and, instead of feeling closer, coworkers felt distant, dissatisfied, and resentful. Productivity fell."
-- Maria Konnikova, emphasis added
Found via HN. Yup, the peril of open-office towards productivity. The main culprit still is the noise, or the distraction caused by it. I've mentioned about this issue few months back and the approaches taken to mitigate this. My current strategies to regain back my productivity are:

First, switching back to headphone. Earmuff did not work for me. Also, installed Spotify and build my music collection. Listening to music while working did help in blocking office intrusion but at a price, prolonged exposure to music may cause long-term hearing damage.

Second, consistent Pomodoro session. 25 minutes coding, 5-plus minutes walking around office area. Seemed to work for me this past few days as I made more commit and felt more productive. This approach off course was to counter the short attention span issue due to noise distraction and office idiocy.

Node.js in Ubuntu 13.10

Never a fan of installing of any packages in Ubuntu by source code compilation. Found this answer on getting the latest version of node.js through Chris Lea's Personal Package Archive (PPA) [4][5].

Installation steps as follows:
$ sudo apt-get update
$ sudo apt-get install -y python-software-properties python g++ make
$ sudo add-apt-repository -y ppa:chris-lea/node.js
$ sudo apt-get update
$ sudo apt-get install nodejs

$ node --version