Sep 18, 2014

JS - Infinite scroll sample code.

var base_url = config.base_url;
var offset = 1;
var request_ajax = true;
var ajax_is_on = false;
var objHeight = $(window).height() - 50;
var last_scroll_top = 0;
var type = '0';
var csrftoken = $("meta[name='csrf-token']").attr('content');
var csrfname = $("meta[name='csrf-name']").attr('content');
$(window).scroll(function(event) {
  var st = $(this).scrollTop();
  if(st > last_scroll_top){
    if ($(window).scrollTop() + 100 > $(document).height() - $(window).height()) {
      if (request_ajax === true && ajax_is_on === false) {
        ajax_is_on = true; 
          url: base_url + 'category_more',
          data:{page_number:offset,id_cat:'459',type:type, parameters:'[]', csrfname : csrftoken},
          type: 'post',
          dataType: 'JSON',
          onLoading:jQuery(".loading").html('<img src="/assets/images/orange_loader.gif" />').show(),
          success: function(d) {
            if(d == "0"){
              ajax_is_on = true;
              if(d.substring(0,5)  == ""){
                ajax_is_on = true;
                ajax_is_on = false;
                offset += 1;   
  last_scroll_top = st;

Sep 10, 2014

How to resize/increase tmpfs partition.

Increasing linux tmpfs partition have two way to do.

1. Modify you /etc/fstab and put the below. Setting below set the tmpfs size to 2GB
LABEL=/     /           ext4    defaults,noatime  1   1
tmpfs       /dev/shm    tmpfs   defaults        0   0
devpts      /dev/pts    devpts  gid=5,mode=620  0   0
sysfs       /sys        sysfs   defaults        0   0
proc        /proc       proc    defaults        0   0

Add size=2G inline to tmpfs besize defaults.
tmpfs       /dev/shm    tmpfs   defaults,size=2G        0   0
After you modify and save your changes, remount the partitions by issuing command below
# mount -o remount /dev/shm
And you done. Or try easier way below.

2. Or if you want the easier way, issue command below to set the tmpfs to 2GB.
sudo mount -o remount,size=2048M tmpfs /dev/shm
NOTE: The breakdown of doing this, this setting will revert after the system was rebooted, so I recommend to modify the /etc/fstab

Sep 8, 2014

Using Amazon Simple Email Service

Admin of the Amazon SES will going to send a verification URL to your current email for you able to use the SES of smtp services.

After you have receive and accept the verification you can now able to use the authentication data below. Or better ask you admin what are the authentication data. But in our case, below data are our authentication data.

Server Name:
Password: ApFtmgHj13e8Ml38EG4L6/cgG1LhZEH0UvkOY48x4Qj4

Aug 28, 2014

How to download facebook video without special software?

Simple tutorial how to download facebook videos without install some special software for it.

* Chrome/Firefox Browser. For firefox you need to install FireBug.
* Internet connection and you must be logged-in(Common sense)
* Ability in read, interpret and imagine(I'm not a good writer)

Lets try this video as a sample. Mocha Gurl - Umay Boy Part 2

1. Inspect the element

2. Find embed tag for the specific video.

3. Get/copy the value of flashvars attribute. Value normally start params=


4. The data is URL encoded and you need to decode in human readable data. For you to decode check URL Dencoder Tools

5. Find the sd_src, and copy the value. Important: You must understand JSON but, if you cant understand JSON just try to check and understand the image below.

In the image representation you can get the value.

6. Replace all \/ with a single slash only and your done.

7. Open the URL in your browser and press CTRL + S to save the video.
Instruction sample video can be download @Mocha Gurl - Umay Boy Part 2.

NOTE: If you encounter error message
An error occurred while processing your request.
Reference #50.3d34d417.1413363911.56c6c7
from the Download URL(w/c the .mp4) I provide try to follow the step #1 to #6. This reason is like security from facebook from creating automated call/request. I just notice that the parameters value after question-mark(?) is change every user login.

Hope you able to follow that simple instruction.