Friday, 15 April 2022

Enable or disable the "Powered by TinyMCE" branding.

Tinymce branding property allow you to enable or disable the "Powered by TinyMCE" branding.

tinymce.init({
  selector: 'textarea',  
  branding: false
});

Thursday, 14 November 2019

Adding Excel export button hides/removes the Page Length Dropdown in Data Tables

Add below line in javascript table initialization

"dom": '<"top"Bf>rt<"bottom"lip><"clear">'

Complete Code 
<script>
        $(document).ready(function () {       
        $('#example').DataTable( {
                "processing": true,               
                "lengthMenu": [[25, 50, -1], [ 25, 50, "All"]],
                "dom": '<"top"Bf>rt<"bottom"lip><"clear">',
                "serverSide": true,
                "ajax": "server_processing.php"
            } );
        });                     

</script>

Friday, 27 May 2016

Cloud Computing

Cloud computing is a model for enabling ubiquitous,convenient,on- demand network access to a shared pool of configurable computing resources(e.g.,networks, servers, storage, applications, and  services) that can be rapidly provisioned and released with minimal management effort or service provider interaction.(byNIST)

“an Internet based computing paradigm that delivers on-demand software and hardware computing capability as a ‘service’ through virtualization where the end user is completely abstracted from the computing resources”

3-4-5 Rule

3 : Services
4 : Deployment Models
5 : Characteristics

3 : Services

1. IaaS (Infrastructure as a Service)

The capability provided to the consumer is to provision processing, storage, networks, and other fundamental computing resources where the consumer is able to deploy and run arbitrary software, which can include operating systems and applications. The consumer does not manage or control the underlying cloud infrastructure but has control over operating systems, storage, deployed applications, and possibly limited control of select networking components (e.g., host firewalls)





2. PaaS (Platform as a Service)

The capability provided to the consumer is to deploy onto the cloud infrastructure consumer-created or acquired applications created using programming languages and tools supported by the provider. The consumer does not manage or control the underlying cloud infrastructure including network, servers, operating systems, or storage, but has control over the deployed applications and possibly application hosting environment configurations


Windows Azure, Google App Engine, Hadoop, etc. are some well-known PaaS platforms

3. SaaS (Software as a Service)

The capability provided to the consumer is to use the provider's applications running on a cloud infrastructure. The applications are accessible from various client devices through a thin client interface such as a web browser (e.g., web-based email). The consumer does not manage or control the underlying cloud infrastructure including network, servers, operating systems, storage, or even individual application capabilities, with the possible exception of limited user-specific application configuration settings



Moto: “No Software
Ex: Salesforce.com for CRM, Google Docs for document sharing, and web email systems like Gmail, Hotmail, and Yahoo! Mail


Cloud Service Models 
















Utility Computing


  • Utility computing is the packaging of computing resources, such as computation, storage and applications, as a metered service similar to traditional public utility (such as electricity, water, natural gas, or the telephone network).
  • This model has the advantage of a low or no initial cost to acquire computer resources; instead, computational resources are essentially rented
  • You get connected to the utility companies’ “public” infrastructure
  • You get these utility services on‐demand
  • And you pay‐as‐you use (metered service)
  • Cloud computing is the most recent technology innovation which has made utility computing a reality!

Distributed Computing

  • A distributed computing system is basically a collection of processors interconnected by a communication network in which each processor has its own local memory and other peripherals, and the communication between any two processors of the system takes place by message passing over the communication network
  • Loosely coupled systems
  • Examples: Cluster, Grid, P2P, Cloud computing, IOT
  • Uses middleware, which enables computers to coordinate their activities and to share the resources of the system.
  • Single integrated computing facility from user perspective
  • Can include heterogeneous computations where some nodes may perform a lot more computation, some perform very little computation and a few others may perform specialized functionality (like processing visual graphics)
  • Using which efficient scalable programs can be designed so that independent processes are scheduled on different nodes and they communicate only occasionally to exchange results
  • Cloud computing is also a specialized form of distributed computing, where distributed SaaS applications utilize thin clients (such as browsers) which offload computation to cloud-hosted servers (and services).
  • Additionally,cloud-computing vendors providing (IaaSand PaaS) solutions may internally use distributed computing to provide highly scalable cost-effective infrastructure and platform.

Cluster Computing


  • A computer cluster is a group of loosely or tightly coupled computers that work together closely so that in many respects it can be viewed as though it were a single computer
  • Better performance and availability and more cost‐effectiveness over single computer with same capabilities
Characteristics:
  • Loosely / tightly coupled computers
  • Centralized Job management & scheduling
  • Coined in 1987

Grid Computing:

  • Grid is a collection of a large number of loosely coupled, heterogeneous, and geographically dispersed systems in different administrative domains
  • Generally owned by multiple organizations that is coordinated to allow them to solve a common problem
Characteristics
  • Loosely coupled computers
  • Distributed Job management & scheduling
  • Originated (early 1990s)
Vision: To enable computing to be delivered as a utility
This vision is most often presented with an analogy to electrical power grids, from which it derives the name “grid”
  • The key emphasis of grid computing was to enable sharing of computing resources or forming a pool of shared resources that can then be delivered to users.
  • Focus of grid computing was limited to enabling shared use of resources with common protocols for access
  • a particular emphasis was given to handle heterogeneous infrastructure-typically a university data center.
  • "coordinated resource sharing and problem solving in dynamic, multi-institutional virtual organizations.” -Ian Foster & Steve Tucker -> "Anatomy of Grid”
  • There are also very specific differences between a grid computing infrastructure and the features one should expect from a cloud computing infrastructure
  • Grid (three-point checklist)?
    • Co-ordinates resources that are not subjecttocentralized control
    • Using standard, open, general purpose protocols and interfaces
    • To deliver nontrivial quality of service

Advantages -Distributed computing

Inherently Distributed applications:
  • Several applications are inherently distributed in nature and require distributed computing system for their realization
Information Sharing among Distributed Users:
  • In a distributed computing system, information generated by one of the users can be easily and efficiently shared by the users working at other nodes of the system .
Resource Sharing:
  • Sharing of software resources such as software libraries and databases as well as hardware resources such as printers, hard disks, etccan also be done in a very effective way among all the computers and the users of a single distributed computing system.
Extensibility and Incremental Growth:
  • It is possible to gradually extend the power and functionality of a distributed computing system by simply adding additional resources (both hardware and software) to the system as and when the need arises .
  • Incremental growth is very attractive feature because for most existing and proposed applications it is practically impossible to predict future demands of the system.
  • Addition of new resources to an existing system can be performed without significant disruption of the normal functioning of the system.
Shorter Response Times and Higher Throughput:
  • The multiple processors of the distributed computing system can be utilized properly for providing shorter response times and higher throughput than a single processor centralized system.
  • Another method often used in distributed computing systems for achieving better overall performance is to distribute the load more evenly among the multiple processors by moving the jobs from currently overloaded processors to lightly loaded ones
Higher Reliability:
  • Reliability refers to the degree of tolerance against errors and component failures in a system.
  • A reliable system prevents loss of information even in the event of component failures
  • An important aspect of reliability is availability, which refers to the fraction of time for which a system is available for use.
Better Flexibility in Meeting User’s Needs:
  • A distributed computing system may have a pool of different types of computers, in which case the most appropriate one can be selected for processing a user’s job depending on the nature of the job.
  • Better Price-Performance Ratio:
  • With the rapidly increasing power and reduction in prize of the microprocessors, combined with the increasing speed of communication network, distributed computing systems potentially have a much better price performance ratio than a single large centralized system.

Ubiquitous/ Pervasive computing


  • It is an advanced computing concept where computing is made to appear everywhere and anywhere.
  • Ubiquitous computing can occur using any device, in any location, and in any format. A user interacts with the computer, which can exist in many different forms -laptop, tablets, terminals, phones, etc.
  • Move beyond desktop machine
  • Ex: digital audio players, radio-frequency identification tags, PDAs, smartphones, GPS, and interactive whiteboards
  • Present or noticeable in every part of a thing or place
  • Information processing engaged in every day’s activities and objects

Monday, 5 May 2014

Installing bedtools on centOS

1. Download bedtools from
https://github.com/arq5x/bedtools2/releases

2. Save it to a local folder (eg: softwares folder)
3. Untar it using below command
    
# tar xvzf bedtools-2.19.1.tar.gz

4. You can find all the bedtools function in bedtools-2.19.1/bin folder
5. You have to set the PATH environmental variable for bedtools so that OS can locate the bedtools program,  even if it is not in the current directory

Setting PATH environmental variable for bedtools

1. Open /etc/profile.d
2. Create a document and name it as bedtools.sh
3. Add the below line in bedtools.sh
    export PATH = $PATH:/softwares/bedtools-2.19.1/bin
4. Save it and close bedtools.sh
5. If you want to load the environment variables within bedtools.sh without having to restart the machine, you can use the source command as in
     # source bedtools.sh

Install SRA toolkit on CentOS

1. Download SRA toolkit from
http://eutils.ncbi.nih.gov/Traces/sra/?view=software

2. For centos 64 bit, we have to download sratoolkit.2.3.5-2-centos_linux64.tar.gz
3. Save it to a local folder (eg: softwares folder)
4. Untar it using below command
    
# tar xvzf sratoolkit.2.3.5-2-centos_linux64.tar.gz

5. You can find all the toolkit functions in the sratoolkit.2.3.5-2-centos_linux64/bin folder
6. You have to set the PATH environmental variable for toolkit so that OS can locate the fastq-dump program,  even if it is not in the current directory

Setting PATH environmental variable for SRA Toolkit

1. Open /etc/profile.d
2. Create a document and name it as fastq-dump.sh
3. Add the below line in fastq-dump.sh
    export PATH = $PATH:/softwares/sratoolkit.2.3.5-2-centos_linux64/bin
4. Save it and close fastq-dump.sh
5. If you want to load the environment variables within fastq-dump.sh without having to restart the machine, you can use the source command as in
     # source fastq-dump.sh

Thursday, 24 April 2014

Add image/logo in browser tab for website

How to add image/logo in browser tab for website?

Place the below code under <head> tag in html

<link rel="shortcut icon" href="path to your logo">

Monday, 24 February 2014

Installing xampp 1.8.3 on cent os 6.4

1. Download Xampp 1.8.3 for linux
2. Copy "xampp-linux-x64-1.8.3-3-installer.run" into Computer/Filesystem/opt folder
3. Open terminal from opt folder
4. Type below commands

    [root@localhost opt]# chmod +x xampp-linux-x64-1.8.3-3-installer.run
    [root@localhost opt]# ./xampp-linux-x64-1.8.3-3-installer.run

5. Window installation wizard will appear
















6. Complete the installation process

Friday, 21 February 2014

Fatal server error: Cannot establish any listening sockets - Make sure an X server isn't already running

Issue
I have installed vncserver and when I tried to start it but I get the error below
"WARNING: The first attempt to start Xvnc failed, possibly because the font catalog is not properly configured. Attempting to determine an appropriate font path for this system and restart Xvnc using that font path ... Could not start Xvnc.
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed _XSERVTransMakeAllCOTSServerListeners: server already running Warning: Xalloc: requesting unpleasantly large amount of memory: 0 bytes.
Fatal server error: Cannot establish any listening sockets - Make sure an X server isn't already running _XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed _XSERVTransMakeAllCOTSServerListeners: server already running Warning: Xalloc: requesting unpleasantly large amount of memory: 0 bytes.
Fatal server error: Cannot establish any listening sockets - Make sure an X server isn't already running"
Solution
Terminate all VNCs processes. You can find the process number by running the following command:
#ps -e | grep vnc
11028   ?        00:00:00 Xvnc
kill the process using
#skill -p <pid>
#skill -p 11028 

Reinstall vncserver

Tiger VNC on Centos 6.3 fails, font catalog not properly configured

Issue
Whe  I try to set up Tiger VNC server on CentOS 6.3 but I'm getting the following error message when I run the command vncserver:
WARNING: The first attempt to start Xvnc failed, possibly because the font catalog is not properly configured. Attempting to determine an appropriate font path for this system and restart Xvnc using that font path ... Could not start Xvnc.
/usr/bin/Xvnc: symbol lookup error: /usr/bin/Xvnc: undefined symbol: pixman_composite_trapezoids
/usr/bin/Xvnc: symbol lookup error: /usr/bin/Xvnc: undefined symbol: pixman_composite_trapezoids

Solution
To resolve the above issue, run the below command in terminal

#yum install pixman pixman-devel libXfont

Installing VNCserver in centOS 6.4


1.    Installing GNOME Desktop
Install a window manager in order to get a full-featured GUI desktop
[root@localhost ~] #yum groupinstall "X Window System" "Desktop"
2.    Installing TightVNC Server
For CentOS 6, the server is: tigervnc-server not:  vnc-server
[root@localhost ~] #yum install tigervnc-server
3.    Create a user and a vnc login
[root@localhost ~]# useradd tom 
[root@ localhost ~]# passwd tom 
Changing password for user tom  . 
New password: 
Retype new password: 
passwd: all authentication tokens updated successfully. 
4.    Login to new user and set vnc password
[root@localhost ~]# su - tom
[tom@localhost ~]$ vncpasswd 
Password: 
Verify: 
[tom@localhost ~]$ ls .vnc
passwd
[tom@localhost ~]$ exit
logout
5.    Start vnc
Create Xstartup Script by starting the vncserver
[root@localhost ~]#  service vncserver start
Starting VNC server: 1:tom
New 'localhost.localdomain:1 (tom)' desktop is localhost.localdomain:1

Starting applications specified in /home/tom/.vnc/xstartup
Log file is /home/tom/.vnc/localhost.localdomain:1.log 
[root@localhost ~]# su -l tom
[tom@localhost ~]$ ls .vnc
localhost.localdomain:1.log  localhost.localdomain:1.pid  passwd  xstartup
[tom@localhost ~]$ exit
logout
6.    Edit the server configuration file
Edit /etc/sysconfig/vncservers, and add the following to the end of the file.
VNCSERVERS="1:tom"
VNCSERVERARGS[1]="-geometry 1024x768"
For multiple users repeat the steps 3 to 5 and add the user to the VNCSERVERS list and add a VNCSERVERARGS[x] entry.
So for two users:
VNCSERVERS="1:tom 2:john" 
VNCSERVERARGS[1]="-geometry 1024x768" 
VNCSERVERARGS[2]="-geometry 640x480" 
7.    Open the port by editing the iptables
stop iptables

[root@localhost ~]# service iptables stop

open /etc/sysconfig/iptables

add the below lines before COMMIT

-A INPUT -p tcp -m state --state NEW -m tcp -m multiport --dports 5901:5910,6001:6010 -j ACCEPT

start iptables

root@localhost ~]# service iptables start

Install Vnc Viewer for remote accessing the desktop

1.    Download VNC Client

Now go to your Windows or Linux machine and download VNC Viewer client and install in your system to access the centos server desktop.

2.    Connect to Remote Desktop(centos server) Using Client

After you installed the VNC Viewer client, open it you’ll get similar to below screen. Enter VNC Server IP address( IP address of centos server in which vncserver is installed) along with VNC ID (i.e 1) for user tom.













Uninstalling vncserver

[root@localhost ~]# service vncserver stop
[root@localhost~]#yum remove tigervnc-server

Sunday, 3 November 2013

localhost is not working in Xampp after updating Avast

Open Avast
1) Go to "Settings"
2) Go to "Troubleshooting"
3) Expand "Redirect Settings"
4) Under "WEB" look for ignored address
5) Add localhost
6) Open browser and visit your localhost page.

Sunday, 27 October 2013

Keep checkbox checked after submit refresh in PHP

Below code maintain checkbox value when user click preview button


<?php
    if (isset($_POST['number']))
    {
        foreach ($_POST['number'] as $selectednumber)
            $selected[$selectednumber] = "checked";
    }
?>

<form action="" method="post">
    <input type="checkbox" name="number[]" <?php echo $selected['one'] ?> value="one" />one<br />
    <input type="checkbox" name="number[]" <?php echo $selected['two'] ?> value="two" />two<br />
    <input type="checkbox" name="number[]" <?php echo $selected['three'] ?> value="three" />three<br />
    <input type="checkbox" name="number[]" <?php echo $selected['four'] ?> value="four" />four<br />

<input type="submit" name="Submit" value="Preview" />
</form>

Friday, 25 October 2013

How to get previous page url in PHP

$realname = basename($_SERVER['HTTP_REFERER'], ".php");

Multiple submit button in a single form in PHP

<form method="post">
<input type="submit" name="save" value="Submit 1">
<input type="submit" name="cancel" value="Submit 2">
</form>


<?php
if (isset($_POST['save'])) {
  // code
}
else if (isset($_POST['cancel'])) {
  // code
}
?>

Thursday, 24 October 2013

Installing the Java Plugin for Firefox on CentOS

The OpenJDK bundled with CentOS is missing a java plugin for Firefox. A simple method of getting Java to run inside the webbrowser and to run java applications is to install icedtea-web

Open a terminal and type the below command

yum install icedtea-web

Then restart your browser
Click Tools- >Add-ons
The Add-ons Manager tab will open.
In the Add-ons Manager tab, select Plugins
Click icedtea-web plugin to select it and click on the Enable button

The java verification applet (http://www.javatester.org/version.html) works fine.

Installing and configuring Java in cent OS

Most of the Linux operating systems comes with pre-installed OpenJDK package to run java-based applications and plugins.But in certain cases we need Sun/Oracle Java program to compile and run
particular development applications.

1. Download java from  
http://www.oracle.com/technetwork/java/javase/downloads/index.html

2. install java using rpm -uvh
   ## Install Java on 32-Bit OS ##
   # rpm -Uvh jdk-7u45-linux-i586.rpm
   # rpm -Uvh jdk-7u45-linux-i586.rpm

   ## Install Java on 64-Bit OS ##
   # rpm -Uvh jdk-7u45-linux-x64.rpm
   # rpm -Uvh jdk-7u45-linux-x64.rpm

3. check java installed
   # java -version

   output should be
   java version "1.7.0_45"

4. Setting up java environment variables
The easiest way to set an environment variable in CentOS is to use export as in

$> export JAVA_HOME=/usr/java/jdk.1.7.0_45

$> export PATH=$PATH:$JAVA_HOME

However, variables will disappear the moment you exit the shell. Obviously this is not helpful when setting environment variables that need to persist even when the system reboots.In such cases, you need to set the variables within the system wide profile. In CentOS , the folder /etc/profile.d/ is the recommended place to add  customizations to the system profile.

5. Create a new file called java.sh
vim /etc/profile.d/java.sh

6. Copy paste the below content in java.sh

export JRE_HOME=/usr/java/jdk.1.7.0_45/jre
export PATH=$PATH:$JRE_HOME/bin
export JAVA_HOME=/usr/java/jdk.1.7.0_45
export JAVA_PATH=$JAVA_HOME
export PATH=$PATH:$JAVA_HOME/bin

7.  If you want to load the environment variables within java.sh without having  to restart the machine, you can use the source command as in:
   $> source java.sh

Wednesday, 23 October 2013

Add horizontal scrollbar to html table

Inorder to add a horizontal scroll bar on html table automatically as the table grows, we need to wrap the table inside a div and add overflow:auto css property

For eg:

<div style="white-space:pre;overflow:auto;width:500px;padding:10px;"> <table style="width:900px;"> <tr> <td>text1</td> <td>text2</td> <td>text3</td> </tr> </table> </div>

Friday, 4 October 2013

Fatal error: Call to undefined function http_redirect() : Fixed

Issue: When I was trying to call the PHP http_redirect() function, below error came up:

Fatal error: Call to undefined function http_redirect() in location.


Add the below function in your php page

/**
 * redirect to a specific URL
 * @param $url
 */
     
function redirect($url)
{
     if (!
headers_sent())
     {  
          
//If headers not sent yet... then do php redirect
          
header('Location: '.$url); exit;
     }
     else
     {                  
          
//If headers are sent... do javascript redirect...
          //if javascript disabled, do html redirect.
          
echo '<script type="text/javascript">';
          echo 
'window.location.href="'.$url.'";';
          echo 
'</script>';
          echo 
'<noscript>';
          echo 
'<meta http-equiv="refresh" content="0;url='.$url.'" />';
          echo 
'</noscript>'; exit;
     }
}  


then call the above function  to the page you wish the redirect to happen on

eg: redirect("redirect.php");