Share This

Wednesday, October 12, 2016

How To Set Up Subdomain or multi-domains and Apache Virtual Hosts on Ubuntu 14.04 LTS

This post is about creating multiple domains/sub-domains or virtual hosts on a single VPS running on Ubuntu 14.04 LTS with LAMP stack. (for LEMP stack, see another good example here.)

Summary

1) Create an A record for your sub-domain that points to your droplet

2) Create a .config file for your sub-domain site in /etc/apache2/sites-available

3) Create the directory for your site in /var/www (or wherever you defined it was in the config file)

4) Enable the site in apache with: sudo a2ensite sub.yourdomain.com (or whatever you named your site in the config)

5) reload apache: sudo service apache2 reload

NOTE: the DNS record you create might take awhile to propagate



Thursday, August 18, 2016

Switching MySQL 5.x to MariaDB 10.x on Ubuntu 14.04

If you are going to use MariaDB to replace existing implementation of MySQL in production environment, then you will realize changing a DBMS to one another has never been easier considering the risks of incompatible supported features and functionalities, unpredictable development time and resources, migrating a huge amount of data and so on. MariaDB has already succeeded as a "drop-in" replacement  for MySQL and is truly open source and more optimized, faster and safer.

Though being mentioned that Migration might become difficult after 2015, below is a few steps which I believe is quite simple to install MariaDB replacing MySQL on Ubuntu 14.04.x as I came across the same requirement switching MySQL 5.5.5 to MariaDB 10.1.14.

Thursday, January 14, 2016

Limitation for google sitemap.xml file size

According to the Latest Update: (as of 2016):

Any Sitemap file is limited to 10MB (uncompressed) with a maximum of 50,000 URLs.
And a Sitemap index file can include up to 10,000 Sitemaps.
So we can have around 50 millions URLs in separated sitemap files.

in terms of URLs:
49,000 URLs + 1,000 sitemaps
= 49,000 URLs + ( 1,000 * 50,000 ) URLs
50,049,000 URLs 

in terms of size:
10MB + (1,000 sitemaps * 10MB)
= 10,010 MB
= 10.01 GB 
So altogether, we can have around 10GB of storage for all sitemap files.

Saturday, September 26, 2015

Aung Myo Linn - techo riff on hollow guitar



Long time no play guitar, it's time to ROCK!!!
give me some motivation GAAaaa!!!
I can't stand this anymore!!!!!
The rock crazy Aung Myo Linn is back. XD

Sunday, April 19, 2015

Myanmar New Year - Thingyan Moe Cover Song - Aung Myo Linn



Happy Myanmar New Year to you all !!! I would like to celebrate and say good bye to Myanmar Thingyan water festival 2015 with this cover song, the song title is "Thingyan Moe" which means "The Rain of Thingyan".

The video is of poor quality and sorry for my bad rhythm as well. I started playing keyboard only when I was 18 and have never been trained by any tutor. I am not playing it regularly and consistently and the keyboard is not a pro version but a home keyboard I acquired from a cousin which was no longer being played by anyone at that time. It's pretty old and outdated already since the first time I saw it when I was just a kid. So please patiently listen to it until the end :P

Thursday, August 7, 2014

You can be a cartoonist using a Ball Pen.

Not so professional, but using just a paper, a ball pen and a little photoshop trick will turn yourself into a cartoonist. Below, you will see a few sketches I drew with a ball pen on a paper, then I took those pictures with my phone's camera.

2NE1 sketch using ballpen2NE1 sketch character using ballpen2NE1 character sketch using ballpen
After opening the picture in photoshop, press Ctrl+L or open Image > Adjustments > Levels and the Photoshop Levels Tool Dialogue box will be shown. At the Input Level pane, adjust the sliders which map the black point and white point in order to correct the tonal range and color balance something like below.

Wednesday, August 6, 2014

The fate of Myanmar Telecommunications - Ooredoo vs Telenor vs MPT

ooredoo vs telenor the future of Myanmar telecommunication

That's another picture I drew using a ballpen and a little photoshop :) cause recently, Ooredoo, one of 3 giant telecommunications providers in Myanmar has been selling SIM cards in the cheapest price ever in Myanmar at 1500 Kyats targeting the market of 60 millions population. The news and feedbacks have been spreading across media and socialnetwork but still, Telenor, another giant, remains silent.

History
Below articles will provide you the recent details about the 3 service providers.

Sunday, May 18, 2014

Tomcat and port 80 problem on Windows

Normally, if we want to make Tomcat to listen to port 80, we only have to change its server.xml as below,

<Connector port="80" protocol="HTTP/1.1" 
           connectionTimeout="20000" 
           URIEncoding="UTF-8"
           redirectPort="8443" />

But sometime for some reason, we can't just get it right spending a few hours on it. I used to face this problem while helping out my coworker configuring the Tomcat to use port 80. I also tried installing Apache httpd to apply it as a Reverse Proxy for Tomcat but to no avail showing "service not installed" error, after checking netstat command as described below,

Friday, May 9, 2014

My thoughts on developing hybrid Android app

It's easier said than done!
Do not ever dream of developing hybrid app for complicated and responsive UI on Android prior to KitKat.

Thinking JQM or Cordova could be a life saver?
NO WAY!!

It will also screw your time and budget trying to embed ChromiumView or What? GeckoView?
... asking your customer to use chrome or to upgrade the Android is also a bad idea.

Wednesday, January 8, 2014

Iframe Communication, SOP and Cross-window messaging

With conventional javascript API or jQuery, one cannot make cross document messaging between iframes or windows because of the SOP (Same Origin Policy).
There used to be some tweaks like applying sandbox attribute, for eg.
<iframe sandbox="allow-scripts allow-same-origin" src="" />
or browser specific commands like --disable-web-security while lunching chrome
and some jQuery functions like
$('iframe#myIframe').contents().on("click","input#clickme",function(){alert('u click me');});
Unfortunately, those may no longer work on modern browsers, one may want to apply further tricks to deal with security measures.

Thanks to HTML5 API's window.postMessage, below is a working example for Cross Domain - Html5 postMessage.

Let's say I'm running two web servers locally on port 81 and 8080,
we'll have something like http://localhost:81/site1/index.html
<input type="button" id="clickme" value="click me" onclick="doPostMessage();" />
<span id="data" style="color:red;"></span>
<iframe id="site2" height="180" src="http://localhost:8080/site2/index.html" width="100%"></iframe>
<script type="text/javascript"> 
 function doPostMessage(){
  frames[0].postMessage("Hello child!","http://localhost:8080/");
 } 
 window.onmessage = function(e) {
  console.dir(e);
  var data = "Parent: i ve got sth from child.\n Data: ";
  if(e.origin == 'http://localhost:8080') {
    data += e.data;
  }
  document.getElementById('data').innerHTML = data;   
 }
</script>
And we have another page at http://localhost:8080/site2/index.html
<input type="button" id="clickme" value="click me" onclick="doPostMessage()"/>
<span id="data" style="color:red;"></span>
<script type="text/javascript">
 function doPostMessage(){
  parent.postMessage("Hello parent!","http://localhost:81/");
 }
 window.onmessage = function(e) {
  console.dir(e);
  var data = "Child: i ve got sth from parent.\n Data: ";
  if(e.origin == 'http://localhost:81') {
    data += e.data;
  }
  document.getElementById('data').innerHTML = data;
 }
</script>

Also, for security concerns, a must read article you can find it here.

Let's see a few slides embedded below if you want to read more about iframe communication.

Wednesday, December 18, 2013

AngularJS and Object.observe()

Another cool presentation at JSConf EU, a nice talk on AngularJS and Object.observe() or O.o() which will provide you a better understanding for developing client side MVC applications.

Tuesday, June 26, 2012

Common Errors Importing DataBases in phpMyAdmin

If you have just installed XAMPP or WAMPP and going to use a vanilla phpMyAdmin, there are a few things you need to configure before you do something with the DataBase (especially when uploading / importing data to MySQL) and you might face some issues or errors as described below which are common to every novice.



Warning: POST Content-Length of xxxxxxxx bytes exceeds the limit of xxxxxxx bytes
You probably tried to upload a file that is too large. Please refer to documentation for a workaround for this limit.

Tuesday, December 20, 2011

KoLuNar on youtube :P

This is me when I was around 20th living in student accommodation, if you have some time on your hands, visit my profile on youtube here https://www.youtube.com/user/kolunar ;)

Wednesday, November 16, 2011

WordPress for Beginners

This article is intended for those who are new to WordPress or for those who are wondering about where to get started. The answer is very simple, just read the official online manual for WordPress including the WordPress information and documentation individually for users and developers, no kidding but seriously :D.

For those WordPress beginner bloggers, users or developer, I'd recommend one to try getting started with WordPress.com. Creating a WordPress.com account is simple and setting up a blog should be very straightforward getting through a few steps. The step by step instructions are available here.

Friday, August 26, 2011

Understanding Javascript Prototype, Static members and Instance

Since javascript is a prototype-based language, sometime it's confusing for anyone with the background from the class-based languages like C#, Java etc... to implement javascript in OOP way or to comply with software architectural patterns such as MVC, MVP or MVVM.

Today I found some useful snippets while looking for some meaningful explanation.
Here's the one explained by someone on stackoverflow,

// constructor function
function MyClass () {
  var privateVariable; // private member only available within the constructor fn

  this.privilegedMethod = function () { // it can access private members
    //..
  };
}

// A 'static method', it's just like a normal function 
// it has no relation with any 'MyClass' object instance
MyClass.staticMethod = function () {};

MyClass.prototype.publicMethod = function () {
  // the 'this' keyword refers to the object instance
  // you can access only 'privileged' and 'public' members
};

var myObj = new MyClass(); // new object instance

myObj.publicMethod();
MyClass.staticMethod();

You shall read the original thread here, for a more detail similar to the above example you can find it here.

Wednesday, May 12, 2010

Team GIGABYTE

The is the very first Flash animation project I have ever made while I was working for Media Lane. All trademarks mentioned in the clip belong to their respective owners. You shall view the swf version here.

http://www.swfcabin.com/swf-files/1399390177.swf

Tuesday, October 13, 2009

Creating a MySQL Database from Command Line

It seems easy but a bit dizzy one for a novice, so let me share a simple guide.
If you don't have MySql installed, you can download it from
http://dev.mysql.com/downloads/,
one should also read the documentation here http://dev.mysql.com/doc/.
During installation, you will have to configure the server instance, optionally the port number (default is 3306) and the root password.

Tuesday, July 22, 2008

Bouncing Ball

This is a small Flash example I created for a friend attending a university, a kind of school project LOL.
You will see a few buttons below the clip to control the movement of the bouncing ball.
Here's another one.

Monday, June 30, 2008

My first flash animation.

This is my very first Flash animation clip created in 2008 named "Crab Attack", it's just for fun and to tease a friend, enjoy XD

Wednesday, June 11, 2008

Welcome to my site.


Hello everyone, My name is Aung Myo Linn and KoLuNar is the nickname given to me myself. I am a software engineer and this is my very first post on blogger.com.