Browsing articles tagged with "linux Archives - Kalpesh Mehta"
Sep 25, 2014

[Fix] Linux Bash Code Injection Vulnerability – ShellShock

ShellShock is new Linux vulnerability affecting all versions of Bash package. This vulnerability is worse than HeartBleed! This command line vulnerability is present in Mac OS X too. Basically it’s there in all the systems having Bash, a software used to control the command line in Unix.

To test if you are vulnerable to ShellShock, run this command:

env x='() { :;}; echo vulnerable'  bash -c "echo this is a test"

If you see output:

this is a test

that means you are vulnerable!

Fix for Redhat packages:

yum update bash

Fix for Ubuntu/Debian packages:

apt-get upgrade bash

After running above commands, check again to see if you are vulnerable:

env x='() { :;}; echo vulnerable'  bash -c "echo this is a test"

If you see below output, that means you are no longer vulnerable

bash: warning: x: ignoring function definition attempt
bash: error importing function definition for `x'
this is a test
Jun 22, 2014

Magento: Sample apache virtualhost for your website

Sample apache virtualhost to point to your magento directory and run your local website with specified URL.

<VirtualHost *:80>
    DocumentRoot "/var/www/magento/"
    ErrorLog "logs/error_log"
    CustomLog "logs/access_log" common

Add entry to /etc/hosts too:

Restart apache (service httpd restart OR service apache2 restart) and point your browser location to:

and you will see the website running from your /var/www/magento directory.

Nov 2, 2012

Linux: Bash script to check availability of domain names in differnet TLDs

If you want to check whether your desired domain name is available or not in different extensions, it’s tiresome to search it for each and every tld. There are also limits of performing query to whois on websites, where they will not allow you unlimited whois information queries. It’s better to have your own script which will tell you the availibility of domain name in different extensions, right from your terminal.

Below script will check your domain name for TLDs .com, .net, .org, .info, .us, .co, .tel, .tv, .biz, .cc, .ru, .eu, .in, .it, .sk,, .sh, .re and .dk
But you can add other TLDs also if you want.

First create a file, e.g., and give it proper permission to execute.

chmod 744

Now, copy below code to this newly created file
Continue reading »

Nov 2, 2012

Linux: Bash script to get email address and created/updated/expires dates of domain name

In linux, to check the whois of any domain name, the simple command is:


But, it will show you so many things which are not important, e.g. it will show you the NOTICE and TERMS of USE and so many other things.

If you are only concerned of getting the email address and creation/updation/expiry date of domain name from whois, here is the bash script that will help you out.
First create a bash script file, e.g. and give it permissions to run:

chmod 744

Continue reading »

Welcome to my Blog

Kalpesh MehtaHelping Magento developers in their day-to-day development problems since 2011. Most of the problems and solutions here are my own experiences while working on different projects. Enjoy the blog and don't forget to throw comments and likes/+1's/tweets on posts you like. Thanks for visiting!




Magento top 50 contributors

Magento top 50 contributors