Skip to main content

Posts

Install SSL Certificate on Tomcat OR Confluence Server

The below steps demonstrates how to install Existing Verified Certificates on Confluence server or Tomcat Application Server: 1- You should have your domain certificate and key, for example: company_net.crt company_net.crt 2- You should install openssl, I did it on windows platform: https://wiki.openssl.org/index.php/Binaries 3- run the below command in openssl to generate the .p12 Personal Information Exchange openssl pkcs12 -export -in company_net.crt -inkey company_net.key -out company_net.p12 4- Now move the .p12 to the server and run the keytool to generate the .jks key (Java Key Store), the keytool is normally located in the JDK or JRE directory whether in TOMCAT or JAVA Directory. 5- Run the keytool comman as below: C:\tomacat\jre\bin>keytool -importkeystore -destkeystore c:\mykeystore.jks -srckeystore c:\company_net.p12 -srcstoretype pkcs12 6- Once the .jks is generate go to the server.xml file located in tomcat or confluence config directory and un-co...

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: <script>  <!--   if (screen.width <= 699) {   document.location = "https://www.mymobilepage.com"; } //--> </script>  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...

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. ============================== == and ============================== == 1. Log into your server as root 2. Execute the following command: export dummy='() ; echo "exploited"' 3. Enter the following command afterwards: bash 4. If the output is ...

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 ca...