The sudo command provides a mechanism for granting administrator privileges, ordinarily only available to the root user, to normal users. This guide will show you the easiest way to create a new user with sudo access on CentOS, without having to modify your server’s sudoers file. If you want to configure sudo for an existing Full Article…
Search the Wiki
PHP – Add data to CSV file in specific columns
Base on the requirement of my client, I have to create a CSV file which has a lot of columns, and hundreds of rows. The header looks like this: SKU | category | description | image | small_image | thumbnail | price | color I need to read the data from other files and put Full Article…
Google Chrome – How to run jQuery in console
Many times I need to test some elements in some web pages which I don’t own. If that webpage uses jQuery then it’s quite easy for us to do our testing; but if jQuery is not there, it’s a headache to do kinds of stuff with native JavaScript, because jQuery is always a better DOM Full Article…
Excel – LibreOffice – Find duplicates in a row
If you have a list of records that have many duplicates and you want to highlight them so that you can remove or update it quickly. E.g. For this case You can use this formula to find duplicated rows easily in Excel and LibreOffice =IF(COUNTIF($A$1:$A$15,A1)=1,"","Duplicated") The result will be like this Hope it is Full Article…
Mysql – Grant a user permission to only show a view
Here are some SQL queries that you need to execute to grant the permission for existing user to a specific view. The first command: GRANT SELECT ON <database_name>.<view_name> TO <user>@<host> The second command: GRANT SHOW VIEW ON <database_name>.<view_name> TO <user>@<host>
Centos 7 – Apache cannot write/access file even all permission are right
After spending 2-3 hours pulling my hair trying to set up a supposed to be simple PHP/MySQL web application on an Amazon EC2 instance running on CentOS 7. Apache logs keep saying that it can’t write to file due to permission where file permissions are properly set up, only to realize it was SELinux in action. Problem Full Article…
Centos 7 – Add swap partition
Introduction One of the easiest ways to make your server more responsive, and guard against out-of-memory errors in your application, is to add some swap space. Swap is an area on a storage drive where the operating system can temporarily store data that it can no longer hold in memory. This gives you the ability to increase Full Article…
Centos – How to Install The Latest Apache Server
By default of Centos, you only can install Apache version 2.4.6, because Centos uses Security Backporting Practice to apply most recent fixes to older versions of a software package. As a result, it doesn’t mean that an older version provided by default repositories is vulnerable. But I need the latest version of Apache so that I Full Article…
Magento – The fastest way to update a product attribute
In a beautiful day, my client requires updating the product stock status for around 200,000 products in Magento, the data gets from the XML files. The issue is the XML files will be renewed every day, it means I need to finish updating all products within 24 hours. There is a problem for 200,000 products Full Article…
Magento – Set default value to custom attribute for all products
I have created the custom attribute (test) for products as a text field with default value('test') from admin panel And assign that attribute to default attribute set. Now I can able to see the new custom attribute in product edit page. When I try to filter with the product collection Mage::getModel('catalog/product')->getCollection() ->addAttributeToSelect('*') ->addAttributeToFilter('test', array('like' => 'test'))->getData(); It returns the Full Article…