Thursday, June 17, 2021

How to free RAM Memory

STEP1:
    i) sudo sync
  ii)sudo sysctl -w vm.drop_caches=3
  iii) sudo sync

STEP2:
  i) echo 1 > /proc/sys/vm/drop_caches
  ii) echo 2 > /proc/sys/vm/drop_caches
  iii) echo 3 > /proc/sys/vm/drop_caches

Wednesday, May 19, 2021

how to install pandas in python

We find difficulty in installation and pandas mainly when there are multiple versions of python installed on system to avoid confusion use below command:

python -m pip install pandas python -c 'import pandas'

You may replace word 'python' with exact version of python also, if required, eg:

  python3.8 -m pip install pandas 
  python3.8  -c 'import pandas'  

Tuesday, October 15, 2019

Error: /usr/bin/ld: cannot find -lfl

Error: /usr/bin/ld: cannot find -lfl
collect2: error: ld returned 1 exit status
Makefile:69: recipe for target 'unified' failed
make: *** [unified] Error 1

Solution:
sudo apt-get install flex

Monday, October 14, 2019

How to install libsndfile and Armadillo library on ubuntu

Installation of libsndfile:

sudo apt-get install libsndfile-dev

Installation of Armadillo

  1.  If not present already, install LAPACK, Boost and BLAS  with 
    sudo apt-get install liblapack-dev  sudo apt-get install libblas-dev  sudo apt-get install libboost-dev
  2. Install Armadillo using 
    sudo apt-get install libarmadillo-dev


Saturday, September 21, 2019

How to disable directory listings on apache running on Ubuntu

open /etc/apache2/apache2.conf

And the section of the settings that deals with listing directory in Apahce2 default root directory is this:

<Directory /var/www/>  Options Indexes FollowSymLinks  AllowOverride None  Require all granted  </Directory>  

To disable directory listing, edit the setting to be this:

<Directory /var/www/>  Options FollowSymLinks  AllowOverride None  Require all granted  </Directory>  

Save the file and restart Apache2 to load the new configuration settings.

How to disable Web server version disclosure

On Debian, Ubuntu or Linux Mint:

$ sudo vi /etc/apache2/apache2.conf

On CentOS, Fedora, RHEL or Arch Linux:

$ sudo vi /etc/httpd/conf/httpd.conf

Add the following two lines at the end of Apache config file.

1
2
ServerSignature Off
ServerTokens Prod

Then restart web server to activate the change.

Ref: http://ask.xmodulo.com/turn-off-server-signature-apache-web-server.html

Saturday, September 14, 2019

Protocol "'http" not supported or disabled in libcurl

Error: Protocol "'http" not supported or disabled in libcurl
Solution:

Ensure you are supplying curl with double quotes ("), not single quotes (')

how to enable curl in php at lunux (ubuntu) server

sudo apt-get install php7.3-curl

open /etc/php/7.3/apache2/php.ini

uncooment following line:

extension=curl

Restart apache:
sudo /etc/init.d/apache2 restart

put following line in your php file and execute in web browser

echo 'Curl: ', function_exists('curl_init') ? 'Enabled' : 'Disabled';
Some examples of perl call:



Tuesday, July 30, 2019

Re: Regex expression to convert festival LTS to Leo LTS

\([a-z]* 1\)
\([a-z]* 0.\d+\)



On Tue, Jul 30, 2019 at 2:11 PM pranaw kumar <erpranaw@gmail.com> wrote:
Regex expression to convert festival LTS to Leo LTS

\([a-z] 1\)
\([a-z] 0.\d+\)
\(_epsilon_ 1\)
\(_epsilon_ 0.\d+\)

Regex expression to convert festival LTS to Leo LTS

Regex expression to convert festival LTS to Leo LTS

\([a-z] 1\)
\([a-z] 0.\d+\)
\(_epsilon_ 1\)
\(_epsilon_ 0.\d+\)

Wednesday, July 3, 2019

How to upgrade nodejs or npm


curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -  sudo apt-get install -y nodejs


Error: *** Error in `appstreamcli': double free or corruption (fasttop): 
0x0000000000fe3990 ***

Solution:  sudo apt install --reinstall libappstream3




How to install JSON

JSON Installation:

download json-server-master package

apply command

 npm install json-server --save-dev

Got error: Linux 4.15.0-45-generic etc

Solution: upgrade to the latest version of npm using:
npm install -g npm@latest

Sunday, June 23, 2019

UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-6: ordinal not in range(128)

import sys  reload(sys)  sys.setdefaultencoding('utf8')

and then apply 
text1=text.decode('utf-8')

How to pass text string from php to python

$text="भारतीय भाषा टेक्स्ट टू स्पीच सिंथेसिस सिस्टम";
$p=shell_exec("python lang-detect.py "."\"$text\"");
Kind Regards  /सादर
Pranaw Kumar / प्रणव कुमार
Principal Technical Officer / प्रमुख तकनीकी अधिकारी
C-DAC MUMBAI / सी-डैक, मुंबई
Ph-(+91) (22) 26201604 Ext: 561
Mob: 7303226767

Friday, June 21, 2019

Unable to import package in python calling from php


Disable ENABLE_USER_SITE and then re-install the package, it would be installed in machine level directory, and then it would be accessible via php also (www-data user)

How to disable ENABLE_USER_SITE
open:
/usr/lib/python2.7/site.py

and change ENABLE_USER_SITE = None
to ENABLE_USER_SITE = False

This url is also having good info about package import: