And Todays’s Quote Would Be..

Life begins at the end of your comfort zone.

Neale Donald Walsch

A Simple Thousand Separator using Java

Trying to create a quick and simple solution for formatting an Integer into a formatted string with thousand separator,

	class Main
		public static void main (String[] args) throws java.lang.Exception
			String s = (String.format("%,d", 10000000)).replace(",",".");

The output will be, 10.000.000. (H)


Simulating Slow Response on Mule ESB

Below is the code im using for simulating a 2minutes reply using MuleESB.

		<expression-component doc:name="Expression"><![CDATA[

Thank you


Changing Couchbase Data Directory Location

Usually Couchbase put its data on default location (/opt/couchbase/var/lib/couchbase/data). But because my disk’s space is full, i have to move Couchbase data to other location. In my case, /data folder which is mounted to an empty 100GB SSD disk. Below is how i change it,

First, i have to change the content of below file,

vi /opt/couchbase/etc/couchdb/default.d/capi.ini 

Changing database_dir and view_index_dir on below Couchbase configuration file, to my new location folder

max_dbs_open = 10000
database_dir = /data
view_index_dir = /data

db_frontend = capi_frontend
ip4_bind_address =
ip6_bind_address = ::
port = 8092

Next is move the content of old folder (/opt/couchbase/var/lib/couchbase/data), to our new folder (/data). And restart our Couchbase service to implement our changes.

  sudo service couchbase-server stop
  sudo service couchbase-server start

We can see the result on our Couchbase web console, hopefully it helps (H)

ps. My Couchbase version is “Enterprise Edition 6.0.0 build 1693”.


[Python] Fixing Fatal Error when Installing Mysqlclient with Pip

On my current project, im using Python, Django and Pip. But there is some issue when installing libraries needed for running the app,

pip install -r requirements.txt

Below is the error generated when running it,

_mysql.c:29:10: fatal error: 'my_config.h' file not found
   #include "my_config.h"
   1 error generated.
   error: command 'clang' failed with exit status 1
 Rolling back uninstall of mysqlclient

Looks like error happen when trying to install below library,


Below is Python and Pip version that im using,

$ python --version
Python 3.4.3
$ pip -V
pip 18.1 from /Users/m/.pyenv/versions/3.4.3/envs/logistic_backend/lib/python3.4/site-packages/pip (python 3.4)

The main culprit is corresponding library is not supported by Python 3.4.3, changing it into below lib fix the error


Go and DataDog Part 1 : Simple Go HTTP Monitoring with DataDog

Today im trying to share a simple GoLang HTTP monitoring using DataDog APM. On this example im using trial version of DataDog for testing purpose, but on production im using enterprise version. Shouldnt be so much difference between those two.

Okay, after we register on DataDog website, we can start with installing DataDog agent on our server.

Im using Ubuntu Server, so my installation command is like below,

DD_API_KEY=<your datadog api key> bash -c "$(curl -L"

After our installation runs well, we need to configure APM first

vi /etc/datadog-agent/datadog.yaml

with below configuration,

   enabled: true

we can start our Datadog-agent using below command,

sudo datadog-agent start

and check its status using

sudo datadog-agent status

Next is writing our code, im using Go’s simple htttp package

package main

import (
    httptrace "" // In order to instrument the http library

func main() {
     defer tracer.Stop()
     mux := httptrace.NewServeMux() // init the http tracer
     mux.HandleFunc("/", handle) // use the tracer to handle the urls     
     log.Println("Listening on port 8099")	 
     log.Fatal(http.ListenAndServe(":8099", mux)) // use the tracer to start the http server

func handle(w http.ResponseWriter, r *http.Request) {     
     fmt.Fprint(w, "Hello world!")

we can simulate http request to our server with a simple command,

curl -v

We can see the result on our Datadog dashboard below,

and the detailed view for each url,

Hopefully it helps :-D