Install Redis from Source

To install Redis from source, run

Find Disk Usage in Linux

du command shows disk usage.

To see disk usage on current partition only, run

Enable SSL in Magento 1.9

To enable SSL in Magento, go to System > Configuration

Magento 1.9 SSL

Click on “Web” link on left menu.

Magento Configuration

On this page, set Auto-redirect to Base URL to No.

Magento Auto-redirect to Base URL

Under “Unsecure” option, change the URL to use HTTPS.

Magento HTTPS

Under “Secure” option, set “https” for Base URL. Set “Yes” for both “Use Secure URLs in Frontend” and “Use Secure URLs in Admin”.

Magento enable SSL

If your Home page is linking to non HTTPS link, this is because Default page is set to CMS page, you need to edit and replace content of CMS page to use HTTPS links under Magento Admin > CMS > Pages.

Convert PFX SSL Certificate

Mcrosoft Azure App Certificate is used to secure Azure App Services, now they allow export of this SSL certificate in PFX format, so it can be used in other services like Azure VM or third party applications. You need to use a powershell script provided by Microsoft to do the Export.

To use the SSL certficiate in FPX format in Apache or Nginx web server, you need to convert it.

To do this, run

By default key file will have a password. To remove password, run

Fixing Linux Problems with Chroot

If you want to reset password or fix some booting issue, you may need to boot the server in rescue, then mount old live disks and chroot it. Once it is done, you will be able to run commands like passwd to change password or install any missing software with apt/dnf/yum etc.

To chroot a file system, run

In above example /dev/sdc1 was / partiition. /dev/sdc2 was /boot.

Swap Boot Disk in Azure VM

Customer lost login credentials for a Azure VM. Azure provide a way to reset Password for VM using Azure portal or via Azure cli/powershell.

Before you swith disk, make sure you note down current name of the boot disk, so if anything went wrong with new disk, you can swap back.

You can run following commands in Azure Powershell

If you want to revert changes, replace

With old disk name. Then run the commands again.

https://azure.microsoft.com/en-us/blog/os-disk-swap-managed-disks/

See Azure

vShare Youtube Clone Script

vShare Youtube Clone Script allow you to run your own video sharing web site like youtube.

You can get this script from

https://www.vshare.in/

This script use ffmpeg to convert video into MP4 format, that cna be played using HTML5 or Flash player on browsers and mobile.

Here are some of the video sites using vshare

http://indianbusinesstv.net
http://www.naijavideos.com
http://videoworld.in/
https://video.bizhat.com

Nginx Configuration for Video Streaming With Secure Link
vShare Nginx Config
Disable Signup Notification in vShare Youtube Clone

PHP Script to pull changes from GIT Repository

Here is a PHP script, that pull latest code from Git Repository to your web site.

Check for Symlink Attack on Cpanel Server

Symlink Attack allow a hacker to hack one web site and gain access to another Apache Virtual Hosts in a cpanel server. Hacker will be able to get read access to files on other hosting accounts, with that, they can read web site config files, giving them MySQL or other login info stored in configuration files.

To check if your server have infected with symlink attack, run

Check the content of the file “/root/smylinks.txt”. if you see any site having too many symlinks to other sites, your server is infected with symlink attack.

To prevent this, you can install CloudLinux CageFS.