Search the Wiki

Viewing 21 to 30 of 225 items

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…


Centos – Create a Sudo User

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…


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 – 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…