Author Archives: Roopendra - Page 10
CircuitBreaking Exception: Data Too Large for field parent/child id cache
You might get this problem with fielddata size limit. fielddata size limit is checked after the query data is loaded. When your elasticsearch query tried to load data more than the fielddata available memory then you would get the OutOfMemoryException. Caused by: : Data too large, data for field would…
Get File MIME Type in Python
Get file MIME type in Python You can get file mime type in python by using python-magic library. You can install python-magic using PIP. $ pip install python-magic To find mime type, import magic library and pass file path into () >>> import magic >>> ("path/", mime=True) 'application/pdf' If you…
How to Delete a Git branch?
Delete a git branch This article will demonstrate, how we can delete a git branch from local or remote git repository. Syntax: git branch -d<branch> git branch -d test-branch If you face any error like "error: The branch 'test-branch' is not fully merged" and you are still want to delete…
Install Opencv in CentOS
What is OpenCV? OpenCV (Open Source Computer Vision Library) is an Open Source Library for computer vision, machine learning and image processing. You can use OpenCV with multiple programming languages like Python, Java, C++. OpenCV can be used to process the images, identify objects, face detection, real-time traffic monitoring, lane…
Install RPM in CentOS
Install RPM in CentOS RPM Package Manager (RPM), originally called the Red-hat Package Manager, is a program to install or uninstall software packages or libraries in Linux. To install RPM in CentOS, first download the RPM: $ wget now check in your directory will be available for install RPM in…
How to use CURL with Proxy
This post will be demonstrating how to use curl with proxy in PHP and Linux command line. What is additional parameter we need to pass while using curl via proxy. So I am starting with proxy configuration in PHP curl. 1) PHP curl with proxy $url = 'http://localhost/path/'; $proxy =…
Rename all Files in the Directory
Here is the simple shell script to rename all files in the folder with increasing number. In below example I am going to rename all jpg image with increasing number. #!/bin/bash a=1 for i in *.jpg; do new=$(printf "%" "$a") mv -- "$i" "$new" let a=a+1 done Output: Few more…
Run Mysql Query from Command Line
Shell script to run mysql query from command line without login into mysql command prompt. You can use these shell script for quickly execution of MySQL query from a Linux Shell. Method 1: #!/bin/bash #Script to run mysql query from command line #Db Connection. DB_USER='root' DB_PASSWD='mypwd' DB_NAME='mydb' #Prepare sql query QUERY='select *…
Start mysql service if not running
Here is the simple shell script check the MySQL service status, if MySQL service is not running then start MySQL service. #!/bin/bash SERVICE='mysql' if ps ax | grep -v grep | grep $SERVICE > /dev/null then echo "$SERVICE service is running." else echo "$SERVICE is not running" service mysqld start…
Test Elasticsearch Query Performance
I am using two tool to benchmark query performance of an Elasticsearch server. Initially I faced problem to test elasticsearch query performance for large elasticsearch query as it's very hard to put large query in command line. Then I found these two tool, having support to pass json as a…


