In this tip, we will see a solution that will fix a non-working laptop’s touchpad. The problem often occurs after upgrading your Ubuntu distribution to Ubuntu 16. Solution Open the terminal and run these commands: sudo apt update sudo apt install xserver-xorg-input-synaptics or sudo apt install –reinstall xserver-xorg-input-synaptics Then reboot your laptop: sudo reboot Hope Full Article…
Magento – Convert attribute type from TEXT to DROPDOWN
This article will show you how to convert attribute type from TEXT (varchar) to DROPDOWN / SELECT (int) in Magento back end. Magento doesn’t have this in-built so we will have to do it in our own way. We will convert our existing attribute which is in TEXT type, to DROPDOWN (select). Let’s say our Full Article…
Magento – Get the last order ID
There are many ways to get the last order ID in Magento, here is the detail: 1. From the checkout session. $lastOrderId = Mage::getSingleton(‘checkout/session’) ->getLastRealOrderId(); $orderId = Mage::getModel(‘sales/order’) ->loadByIncrementId($lastOrderId) ->getEntityId(); This solution will not work in case you want to get the last order ID in the backend. 2. From the model. $orders = Full Article…
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…
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…