jquery-keep in mind

Never keep 2 ids with the same name on the same page. You can keep 2 classes with the same name but not 2 ids. I was working on a header-script where 2 files were included.Both mobile_header.php and desktop_header.php included a javascript file. As the same file was included twice it was causing problem in showing […]

Read More

Dropdown arrow change on click

Code for changing the dropdown arrow on click. You can change the arrow from + to – You can change the symbols you want.[up-down,plus-minus etc]. Javascript code: function changeText(idElement) { var element = document.getElementById(‘element’ + idElement); if (idElement === 1 || idElement === 2 ) { if (element.innerHTML === ‘+’) element.innerHTML = ‘ -‘; else […]

Read More

Include different PHP files depending on the screen size

Following is the way to include a different header on different screen sizes: I have used 2 different headers: mobile_header.php desktop_header.php   <style type=”text/css”> @media only screen and (min-width: 768px) { /* tablets and desktop */ div#mobile { display: none } } @media only screen and (max-width: 767px) { /* phones */ div#desktop { display: none […]

Read More

Facebook Page Feed

To get the Facebook feed on your website you need to follow the code which I have written below. load_face_posts(); function load_face_posts() { $page_name = krina; // Example: http://facebook.com/{PAGE_NAME} $page_id = 123; // can get form Facebook page settings $app_id = 123; // can get form Developer Facebook Page $app_secret = 123; // can get […]

Read More

IP Tables

Objectives In this lab you will learn how to use iptables to build and test a simple Linux firewall on your first Virtual Machine. Even if you can’t get your iptables working quite right, you will still receive credit for this lab as long as you can prove you’ve tried (an example of providing proof: […]

Read More

IP Tables

Objectives In this lab you will learn how to use iptables to build and test a simple Linux firewall on your first Virtual Machine. Even if you can’t get your iptables working quite right, you will still receive credit for this lab as long as you can prove you’ve tried (an example of providing proof: […]

Read More

VMWare-Basic Networking and SSH

Lab 2 – Basic Networking and SSH In this lab you will learn how to assign static IP addresses, configure a service and manage services using SysVinit.  You will also learn some basic user management skills. servis using SysVinit  Before you start, if you are more familiar with the chkconfig or service commands, you may wish […]

Read More

VMWare-Installation

Lab 1 – Installation Overview Upon completion of this lab you will have: A host installed with Centos 7, fully updated using KVM for virtualization 3 Virtual Machines (named centos1, centos2, centos3 respectively) running Centos 7 Sudo configured on all 4 machines, and an understanding of how to use it Installation instructions for Centos 7 […]

Read More

This operation was cancelled by user error:VMWare

Sometimes vmware-workstation/vmware-player would give you an error message “This operation was cancelled by user”. To fix this error you need to perform following simple steps: Find the location of the virtual machine (Example:C:\Users\OneDrive\Documents\Virtual Machines\Ubuntu ) Find the file name with extension “.lck” (Example: ubuntu.vmdk.lck) Delete that file Try to run vmware again Magic! Its working […]

Read More

How to send an email using python

Following are the steps to send an email using python: import smtplib to = ’email-to’  #enter the email id of the person whom you want to send email gmail_user = ‘Your email id’ gmail_pwd = ‘Your Password’ smtpserver = smtplib.SMTP(“smtp.gmail.com”,587) #hostname and port smtpserver.ehlo() smtpserver.starttls() smtpserver.ehlo smtpserver.login(gmail_user, gmail_pwd)   #If you get an authentication error: […]

Read More