Recursive programming

This morning I passed by my secondary school campus. It has changed a lot with 2 brand new buildings. I started to learn programing in that school, where they taught me about palindrome and some very basic programming lessons. I don’t even remember what language was used back then. Probably basic. Then I remember learning about OO and algorithms in university. One thing that still stick, well aside from some vague memory…

Read More

First glance on CoreOS

CoreOS seems to be gaining momentum. It happens to be available on Azure so I spun up an instance and tried. Once it’s up, ssh to it and then launch a ubuntu docker instance [bash light=”true”]xpk-core01 ~ # docker run -t -i ubuntu /bin/bash [email protected]:/# [email protected]:/# lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.04.1 LTS Release: 14.04 Codename: trusty[/bash] Install something to it and then…

Read More

Teaming NICs with teamd

On recent version of Fefora, CentOS, and RHEL, it is possible to use teamd to setup link aggregation. Teamd is more configurable and it allows load balancing on LACP. Here we will walk through the simple configurations using old-fashion config files. To setup load balancing without switch support (or when both connection go to the same switch)

To configure LACP which requires port channel on the switch side

And if…

Read More

Convert number to human readable format

Sure you can do the math yourself but why not trust a tool. coreutils include a tool called numfmt which can convert a number to human readable format. Much like when you run df -h. On mac homebrew, the tool is called gnumfmt. Give it a try: [code] $ gnumfmt –to=iec-i –suffix=B 4812939778547 4.4TiB $ echo 9.78Ti | gnumfmt –from=iec-i –to=iec 9.8T $ echo 123.456Pi | gnumfmt –from=iec-i –to-unit=G 129452999…

Read More

iBasso DX90 and AKG K550 – Impressive and disappointed

Got my hands on a DX90 a couple days ago, what a DAP. Its dual Sabre DAC delivers a lot of details in all ranges. From the high to the mid to the bass, I’m getting supreme quality. I don’t think there are emphasis on any range, they’re equally impressive. But as a little bit of a bass head, I do enjoy the quality and impact of DX90’s bass. unlike…

Read More

Working with JSON output from AWSCLI

The program looks short but the way Python handles JSON is not very elegant. JSON is supposed to be a serialized object, so it should be processed as an object. But here, it’s processed as an array. [python] #!/usr/bin/python import json import sys print "Usage: cat JSON | BasicParse.py | column -t" jsonInput = sys.stdin awsObject = json.load(jsonInput) instances = awsObject[‘Reservations’] for instance in instances: print instance[‘Instances’][0][‘Tags’][0][‘Value’], instance[‘Instances’][0][‘InstanceId’], instance[‘Instances’][0][‘PublicDnsName’] [/python]…

Read More