Posts

How to increase Elasticsearch Shard recovery Speed

To Increase Shard recovery speed do this: Increase node recovery speed PUT http://es:9200/_cluster/settings { "persistent" : { "indices.recovery.max_bytes_per_sec": "200mb", "indices.recovery.max_concurrent_file_chunks": 5, "cluster.routing.allocation.node_concurrent_recoveries" : 5 } } Links: https://www.elastic.co/guide/en/elasticsearch/reference/current/shards-allocation.html https://www.elastic.co/guide/en/elasticsearch/reference/current/recovery.html

Shell Script to SSH into servers

This is a simple script that can ssh into a server by typing the password for you. Filename: login #!/usr/bin/expect eval spawn ssh username@servername expect "assword:" send "server_password\r" interact # to run the script # ./login In this below script you can pass arguments to the shell script Filename: login #!/usr/bin/expect set num [lindex $argv 0]; eval spawn ssh username@servername-$num expect "assword:" send "server_password\r" interact # make sure to give executable permission to script. chmod +x login # to run the script and login to server-01. ./login 01 Now add the script path to your .bashrc file as alias, so that you can access this script from any path. # vi ~/.bashrc alias login='/path/to/script/file/login' After updating the .bashrc file, you will have to source. source ~/.bashrc Now call the script from anywhere in your shell. login 01 Enjoy!!!

How to install Ruby 2.X and Rails 5.X using RVM

The best way to install Ruby on Rails is using RVM in Linux. Advantages of RVM, 1. You can shift between multiple versions of Ruby easily. 2. You don't have to worry about install Ruby dependencies. RVM install will take care of installing them. Some of the ruby dependencies are : gawk, autoconf, automake, bison, libffi-dev, libgdbm-dev, libncurses5-dev, libsqlite3-dev, libtool, libyaml-dev, pkg-config, sqlite3, zlib1g-dev, libgmp-dev, libreadline6-dev, libssl-dev 3. Easily upgrade Ruby version and try out a latest version to make sure your project works with the latest Ruby. If something breaks, changing the version is easy. 4. Delete unwanted Ruby version anytime :) Installation steps. Step 1. Install RVM Source : https://rvm.io/rvm/install $ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB \curl -sSL https://get.rvm.io | bash -s stable $ source /etc/profile $ source ~/.rvm/scri...

Getting started with Python Flask application with MVC structure

I have added a MVC structure and getting started with Python flask application in my Github.  I will continue to contribute to this repository with Database connections and JWT Authentication. Lets get started with Python and Flask :) Here is the Github link for my project. https://github.com/srikanthjeeva/python-flask-getting-started Structure your Flask application like a Rails Application. I'm a Rails developer. I like the way a Rails application is structured and I wanted to implement the similar kind of structure for a Python Flask web Application. Flask by default will not give you this structure. So make use of the getting started with Python flask repository above. The Code structure will look like this: python-flask-getting-started/ |-- app | |-- config.py | |-- controllers | | |-- hello_controller.py | | |-- __init__.py | |-- helpers | | |-- common_helpers.py | | |-- __init__.py | |-- __init__.py | |-- models | | ...

Converting JSON to LCOV (infofile)

Wrote a small NPM module that converts JSON to LCOV data https://github.com/srikanthjeeva/hitmap_json_to_lcov

Install Cpanm module error : No such file or directory opening compressed index

I got this error while installing Rest client perl module $ HOME=/tmp /home/perl/5.10/bin/cpanm REST::Client ! Finding REST::Client on cpanmetadb failed. ! cannot open file '/tmp/.cpanm/sources/http%www.cpan.org/02packages.details.txt.gz': No such file or directory opening compressed index ! Couldn't find module or a distribution REST::Client Solution: The problem is because of "LWP::Protocol::https" module. Removing the directory worked for me. $ cd /perl_installed_path/perl/5.10/lib/site_perl/5.10.1 $ rm –rf LWP* or try with option "--no-lwp" cpanm REST::Client --no-lwp

Error while installing Perl 5.10.1

a -Wdeclaration-after-statement -Wendif-labels -Wc++-compat cc -fstack-protector -L/usr/local/lib -o miniperl \ gv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o xsutils.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o \ miniperlmain.o opmini.o perlmini.o pp.o: In function `Perl_pp_pow': pp.c:(.text+0x2d79): undefined reference to `pow' pp.o: In function `Perl_pp_modulo': pp.c:(.text+0x3b22): undefined reference to `floor' pp.c:(.text+0x3b58): undefined reference to `floor' pp.c:(.text+0x3b90): undefined reference to `fmod' pp.o: In function `Perl_pp_atan2': pp.c:(.text+0x8985): undefined reference to `atan2' pp.o: In function `Perl_pp_sin': pp.c:(.text+0x8b22): undefined reference to `sin' pp.o: In function `Perl_pp_int': pp.c:(.text...