Thursday, 14 June 2018

How to install angular js in ubuntu 14.04


Verify that you are running at least Node.js version 8.x or greater and npm version 5.x or greater by running node -v and npm -v in a terminal/console window. 


npm install -g @angular/cli


How to upgrade nodejs and npm version in ubuntu 14.04


# Using Ubuntu
curl -sL | sudo -E bash -
sudo apt-get install -y nodejs

Friday, 14 October 2016

Remove new line or space between tags in xml

$xml = '<Pages>
<Page Name="test">
<controls><test>this is a test.</test></controls>
<page Name="User">
echo $xml;

$re = '/(?<=\>)(\r?\n)|(\r?\n)(?=\<\/)/';
$substring = '';

$xml = preg_replace($re, $substring, $xml);

echo "The result of the substitution is ".$xml;

Wednesday, 4 November 2015

How to send jQuery POST request on cross-domain

For the specific domain see below:
// Allow from any origin
if (isset($_SERVER['HTTP_ORIGIN'])) {
   header("Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}"); 
   header('Access-Control-Allow-Credentials: true');
   header('Access-Control-Max-Age: 86400');    // cache for 1 day
If you want to allow from any domain see below:

Header set Access-Control-Allow-Origin *
Header set Access-Control-Allow-Headers "content-type"

Monday, 23 September 2013

How to configure phpMyAdmin to access multiple servers from phpmyadmin?

Hi Guys,

Open the following URL in editor:

vim /etc/phpmyadmin/



    $cfg['Servers'][$i]['auth_type'] = 'cookie';
    /* Server parameters */
    //if (empty($dbserver))
    $dbserver = 'servername';
    $cfg['Servers'][$i]['host'] = $dbserver;

    if (!empty($dbport)) {
        $cfg['Servers'][$i]['connect_type'] = 'tcp';
        $cfg['Servers'][$i]['port'] = $dbport;
    //$cfg['Servers'][$i]['compress'] = false;
    /* Select mysqli if your server has it */
    $cfg['Servers'][$i]['extension'] = 'mysqli';

Monday, 16 September 2013

How to count files and line recursively using ubuntu?


How to count number of files recursively?

find . -type f | wc -l

How to count number of lines in files recursively?

wc -l `find  -name '*.php' -o -name '*.html' -o -name '*.xls' -type f`;


Thursday, 5 September 2013

How to Remove Save Draft & Preview Buttions.. and also Status: Draft & Visibility: Public in wordpress?

 Hello All,
 Please add below lines in your function.php file 
  add_action('admin_print_styles', 'remove_this_stuff');
  function remove_this_stuff() { ?>
       #misc-publishing-actions, #minor-publishing-actions {display:none; }
<?php } ?>