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: email-smtp.us-west-2.amazonaws.com
Username: AKIAJPRES3TU4XCB2KZQ
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.


Requirement:
* 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=





flashvars="params=%7B%22autoplay%22%3Afalse%2C%22autoplay_reason%22%3A%22unknown%22%2C%22autoplay_setting%22%3Anull%2C%22autorewind%22%3Atrue%2C%22click_to_snowlift%22%3Afalse%2C%22default_hd%22%3Afalse%2C%22dtsg%22%3A%22AQE4W0i3Toky%22%2C%22inline_player%22%3Afalse%2C%22lsd%22%3Anull%2C%22min_progress_update%22%3A300%2C%22pixel_ratio%22%3A1%2C%22player_origin%22%3A%22unknown%22%2C%22preload%22%3Atrue%2C%22source%22%3A%22permalink%22%2C%22start_index%22%3A0%2C%22start_muted%22%3Afalse%2C%22stream_type%22%3A%22stream%22%2C%22use_spotlight%22%3Afalse%2C%22video_data%22%3A%5B%7B%22hd_src%22%3Anull%2C%22is_hds%22%3Afalse%2C%22is_hls%22%3Afalse%2C%22index%22%3A0%2C%22rotation%22%3A0%2C%22sd_src%22%3A%22https%3A%5C%2F%5C%2Ffbcdn-video-e-a.akamaihd.net%5C%2Fhvideo-ak-xfp1%5C%2Fv%5C%2Ft42.1790-2%5C%2F10575106_10154494056700394_1631383348_n.mp4%3Foh%3Df51b7017371095edbdfb1e9218a586fb%26oe%3D53FF1B2E%26__gda__%3D1409229179_d647a9ac4f58d06db559a974aa5c5649%22%2C%22thumbnail_src%22%3A%22https%3A%5C%2F%5C%2Ffbcdn-vthumb-a.akamaihd.net%5C%2Fhvthumb-ak-xpf1%5C%2Fv%5C%2Ft15.0-10%5C%2F10604768_10154494056725394_10154494048125394_48484_1166_b.jpg%3Foh%3D2651e28da760bd2efcca19763e8caaf2%26oe%3D54719AD5%26__gda__%3D1416392706_e5a83bd683ae62999d79b20f37fddaa5%22%2C%22thumbnail_height%22%3A400%2C%22thumbnail_width%22%3A400%2C%22video_duration%22%3A71%2C%22video_id%22%3A%2210154494048125394%22%2C%22subtitles_src%22%3Anull%7D%5D%2C%22show_captions%22%3Afalse%2C%22persistent_volume%22%3Atrue%7D&width=720&height=720&user=100002615155849&log=no&div_id=id_53ff0136d3d4b5803062954&swf_id=swf_id_53ff0136d3d4b5803062954&browser=Chrome+35.0.1916.153&tracking_domain=https%3A%2F%2Fpixel.facebook.com&post_form_id=&string_table=https%3A%2F%2Fs-static.ak.facebook.com%2Fflash_strings.php%2Ft97862%2Fen_US"

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.
https:\/\/fbcdn-video-e-a.akamaihd.net\/hvideo-ak-xfp1\/v\/t42.1790-2\/10575106_10154494056700394_1631383348_n.mp4?oh=f51b7017371095edbdfb1e9218a586fb&oe=53FF1B2E&__gda__=1409229179_d647a9ac4f58d06db559a974aa5c5649




6. Replace all \/ with a single slash only and your done.
https://fbcdn-video-e-a.akamaihd.net/hvideo-ak-xfp1/v/t42.1790-2/10575106_10154494056700394_1631383348_n.mp4?oh=f51b7017371095edbdfb1e9218a586fb&oe=53FF1B2E&__gda__=1409229179_d647a9ac4f58d06db559a974aa5c5649

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. Cheers!!!!!!!!!!!
Hope you able to follow that simple instruction.

Jul 27, 2014

Magento - Customize your error page by store view.

In your magento home directory you can find file/folder structure.
Magento/
  errors/
     default/
        css/
        images/
        404.phtml
        503.phtml
        page.html
        report.phtml
     404.php
     503.php
     report.php
     processor.php
     local.xml

File description and uses.
404.php       -> I guess 404 page but seems not calls when i encounter.
503.php       -> Mostly for maintenance page(check your index.php)
report.php    -> this file calls when encounter un-handle exception.
processor.php -> Main class for error handling
local.xml     -> Error Handling configuration
    404.phtml -> 404 page template
    503.phtml -> Maintenance error handin template.
    page.html -> Main page or layout of the error excemption
    report.phtml -> Exception error template

Above info is just a head up about the file/folder structure and information. Now lets assume that you have store view with store code mobile(that simplify the store is for mobile). To create custom error for your store(Store front). Best way copy the default error and name it same to your store code.
$ cd MAGENTO_PATH_DIR/errors/
$ cp default mobile

Now is time for you to customize the mobile custom error page. For this to able to use, you have to modify MAGENTO/errors/local.xml

<config>
    <skin>default</skin> <!-- Change default in to mobile-->
    <!-- Some other setting below -->
</config>

Aside from modifying your local.xml. You can also access the site with a parameter skin and is your store code.
Example: http://localhost/magento?skin=mobile
or you can modify the MAGENTO/index.php and the code before below.
<?php
$_GET['skin']='mobile'; // Add aditional parameter on every request.
Mage::run($mageRunCode, $mageRunType);
?>