Skip to main content


Bootstrap Multiselect form autosubmit onDropdownHide

The below code will show you how to auto submit a form when using multiselect functionality in bootstrap, this is based on a bootstrap function call onDropdownHide:

If you have any question please let me know.
Recent posts

How to Show Content on Mobile Devices, Smart Phones and Tablets only

There are two ways to do that, whether to use javascript or to use css style sheet.

Javascript: The code below will redirect the visit to a different page which should be a mobile theme page:

  if (screen.width <= 699) {
  document.location = "";

 CSS: In CSS you can decide which part of your page to show or to hid on a mobile device ora tablet:

Show content on mobile devices and tablets: The below div tag shows the content on mobile devices and or tablets: <div class="showToMobile">TEXT OR IMAGE FOR MOBILE HERE</div>
The below css code contains the style class definition, this should be stored in your .css file on in your style sheet in the head section of your html page: <style type="text/css"> .showToMobile {display: none;} /* Portrait and Landscape Screens */ @media only screen and (min-device-width : 320px) and (max-device-width : 699px) { .showTo…

Linux Bash Vulnerability - Test and Solution

Bash Shell Security Vulnerability There is an important vulnerability in the Linux operating system Bash Shell that has the potential of making your server easily accessible to hackers. By running the test command below, you can see if your bash is vulnerable to exploits. Please run both commands below as root on your server to see if your system is vulnerable.
1. Log into your server as root
2. Execute the following command:

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

3. If the output is "this is a test", that means that your bash needs to be updated. Please refer to your specific OS below and update your system and bash to latest version.


1. Log into your server as root
2. Execute the following command:

export dummy='() ; echo "exploited"'

3. Enter the following command afterwards:

4. If the output is "exploited&…

check memory usage on Linux Centos

free command The free command is the most simple and easy to use command to check memory usage on linux. Here is a quick example
$ free -m total used free shared buffers cached Mem: 7976 6459 1517 0 865 2248 -/+ buffers/cache: 3344 4631 Swap: 1951 0 1951 The m option displays all data in MBs. The total os 7976 MB is the total amount of RAM installed on the system, that is 8GB. The used column shows the amount of RAM that has been used by linux, in this case around 6.4 GB. The output is pretty self explanatory. The catch over here is the cached and buffers column. The second line tells that 4.6 GB is free. This is the free memory in first line added with the buffers and cached amount of memory.
Linux has the habit of caching lots of things for faster performance, so that memory can be freed and used if needed.
The last line is the swap memory, which in this case is l…

How to Rest Mysql Server Root Password in Case it was Forgotten

First you need to stop mysql service:

/etc/init.d/mysqld stop  Now Start mysql in safemode:
mysqld_safe --skip-grant-tables  Login as root: mysql --user=root mysql Now run the below: update user set Password=PASSWORD('new-password') where user='root';
flush privileges;
exit; Finally kill mysql process and start it again: /etc/init.d/mysqld stop /etc/init.d/mysqld start

How to enable mod_rewrite on Apache?

The question is – how do I check if mod_rewrite is enabled? If it is disabled, how to I enable it on Apache on CentOS?
To enable mod_rewrite, you need to make sure that you have it as a module, and to make sure that Apache has loaded the module. And then you need to ensure that Apache is configured to make use of the .htaccess file for each directory.
Follow this article and you should be able to enable mod_rewrite.