Archive for the ‘General’ Category

Fixing Encoding Issue on wordpress

January 4, 2018 Leave a comment

Last Week, i was struggling to revive old blog which is still using old wordpress engine due too machine failure. And migrate it using nginx and php-fpm instead of apache2 web server.

Migration step, will be explain later in separate post. This post will focus in one major problem i face while migrating the blog, which is encoding issue. for information this blog using arabic as primary language and all post published in arabic. I notice this issue, when see all menus and posts show bizzare character instead of arabic.

It wasn’t arabic and even not a regular text. i read a lot of post in wordpress forum to solve this issue. but no luck, some people suggest to comment out lines in wp-config.php which is used for column encoding, DB_CHARSET and DB_COLLATE, but no luck. the blog still show unreadable character.

Then i realised, the problem is all not about encoding issue while displaying blog content, but all posts and setting was stored in DB using this character instead of normal character.

First thing cross in my mind is how we can restore this weird character into original arabic character ?. can we use convert and cast function in mysql to revive the content in arabic ?

I read this nice mysql documentation , then try to find perfect encoding. First attempt, convert content to latin1 and convert it to utf-8, but the failed. after several attempt, finally find correct combination using this query :

After found this correct cast and convert combination, the hardest part is update all records. what i did was creating small query for each table, each related column to revive all record in correct arabic content.

and this the result :


Jakarta, 1st Januari 2018


A. Ahmad Kusumah

Categories: General

Pointing Domain into AWS EC2

July 22, 2016 Leave a comment

Pointing domain into AWS EC2 is quite simple, what need todo are :

  1. Create EC2 instance, then write down the IP address (i.e Management Console 2016-07-22 15-31-35
  2. Open Route 53 in AWS console (
  3. Now you are in route 53, select DNS Management, or choose Hosted Zones in sidebar menu, then select Create Hosted ZoneRoute 53 Management Console 2016-07-22 15-35-40
  4. Type  your domain name, select type to Public Hosted Zone, then press Button CreateRoute 53 Management Console 2016-07-22 15-36-51
  5. Then Create Record Set, and create A record, and point address to your EC2 public IP in point 1Route 53 Management Console 2016-07-22 15-41-38
  6. Then write down NS from Created Hosted Zone, and change you domain name NS using NS from Hosted Zone. the changes will reflect immediatelly, but for some provider need to wait till 24 hours.Route 53 Management Console 2016-07-22 15-43-13
  7. And voila, now you have successfully point and associate your domain name into your AWS EC2 instance.


Jakarta, Friday 22 July 2016


A. Ahmad Kusumah

Setting Up Spark on OSX [el Capiten]

December 3, 2015 1 comment

Apache spark is one of fast and reliable engine for large-scale data processing.

This is simple step of installing spark on mac os, using maven. you can also using sbt to install spark.

  1. Download Apache Spark from here , you can choose any version you’d like. in this guide, i’ll pick version 1.4
  2. Screen Shot 2015-12-03 at 4.23.27 PM
  3. Unzip the downloaded file Screen Shot 2015-12-03 at 4.27.39 PM
  4. Then enter to new created folder, and invoke the following commandScreen Shot 2015-12-03 at 4.34.17 PM
  5. Then wait till process complete. it will take times depend on your internet connection., around 10 – 20 minutes.Screen Shot 2015-12-03 at 4.35.45 PM


And Voila, now you can use spark in your local …


Jakarta, 3rd December 2015


A. Ahmad Kusumah

Separate Multiple Console View On Eclipse

November 11, 2015 Leave a comment

This is simple stuff, but need to write for archive ..

In eclipse, we can have two console views… On the console view, you have a menu (#4) called ‘new console view’ . If we click this and select option 4 (new console view), you will see two consoles.

Screen Shot 2015-11-11 at 2.09.25 PM


You can select which output you want to see on each console by clicking the ‘display selected console’ button (second button from the right on the console view).

Or if you want to stick with current application log, just click ‘Pin Console’

Jakarta, 11 Nov 2015


Aah Ahmad Kusumah

Running Multiple Java Version On OSX

September 6, 2015 Leave a comment

Currently i have several projects using different version java, the oldest one using java 1.6, and the new one using 1.8 which is need lambda expression supported by latest version of java.

and i have only one machine that running OSX yosemite, sometimes i need run java 1.6 and sometimes need java 1.8 as my default running java version.

Below is quick guide how to install multiple java and switch between them easily and fast.

  1. Install Java , from the oldest version to the latest one. 1.6, 1.7 then 1.8. Do not from the latest one or you will get problem when installing the old one.
  2. Check the default java, using command : java -version Screen Shot 2015-09-06 at 7.38.49 PM
  3. Create simple script as below :
    1. first create script to set JAVA_HOME variable with version using shell input
      • export JAVA_HOME=$(/usr/libexec/java_home -v $1)
    2. Second create Symbolic Link from JAVA_HOME to CurrentJDK [for elcapiten, no need this step]
      • sudo ln -nsf ${JAVA_HOME%/*} /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK
      • option s , for create symbolic, option f force symbolic link with unlink first if symbolic link already exist, option n , prevent symbolic link if source or target is symbolic link
    3. Put the script into /etc/profile, named for example usejava
      • usejava() { export JAVA_HOME=$(/usr/libexec/java_home -v $1)

        #For Elcapiten, please comment out this line below#

        sudo ln -nsf ${JAVA_HOME%/*} /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK}usejava 1.6

  4. For change default java, just use command :
    1. usejava 1.6 –> switch 1.6 as default version
    2. usejave 1.7 –> switch 1.7 as default version
    3. usejava 1.8 –> swicth 1.8 as default version


Bogor, September 6th 2015


A. Ahmad Kusumah

Installing Linuxbrew on Ubuntu

March 29, 2015 Leave a comment

Linuxbrew is fork form famous package manager homebrew for mac os. You can read about how to install Homebrew on OSX machine here.

Below will be explained how to install linuxbrew on Ubuntu Box.

The Steps Are :

  • At least Linuxbrew need Ruby 1.8.6 and gcc 4.2
  • Install all dependencies using following simple command :

Server Elastic 1 [Running] 2015-03-30 12-32-57

  • Then install linuxbrew using simple ruby command :


Server Elastic 1 [Running] 2015-03-30 12-34-38

  • Wait till finished, then add the following line too .bashrc file

Server Elastic 1 [Running] 2015-03-30 12-36-45

  • Restart Terminal or console if needed, then execute the following command to check linuxbrew installed properly
  • Server Elastic 1 [Running] 2015-03-30 12-38-33
  • If you got Message Above [your System is ready to brew], means your linux now powered by linuxbrew engine .. then happy brewing ..


Jakarta, 30 Maret 2015



A, Ahmad Kusumah



Installing Elasticsearch on Ubuntu 14.04

March 29, 2015 Leave a comment

Elasticsearch is one of most powerfull opensource platform for distributed REStFull Search and Analysis engine.

you can read further about elasticsearch here . In this Post, will explain how to setup and running elasticsearch on ubuntu 14.04 Server version box.

These are the steps :

  • Install Java, you can use OpenJDK or proprietary  Oracle JDK. How to install Oracle JDK, will be described on separated article
  • Download Latest elasticsearch (deb version)

Server Elastic 1 [Running] 2015-03-29 21-45-59

  • Install Using sudo dpkg -i elasticsearch-1.5.0.deb

Server Elastic 1 [Running] 2015-03-29 21-50-33

  • Install Java Service Wrapper for elastic search

Server Elastic 1 [Running] 2015-03-29 21-51-48

  •  Create Simbolic Link for elasticsearch service and other directory

Server Elastic 1 [Running] 2015-03-29 21-55-40

  • Start elastic search start

Server Elastic 1 [Running] 2015-03-29 21-56-23

  • Then try execute curl http://localhost:9200 , if all currently running well, you will see message above …



Jakarta, 30 March 2015


A. Ahmad Kusumah