Skip to content

Instantly share code, notes, and snippets.

@Tapan
Tapan / logstash
Created February 12, 2020 23:44
Logstash
Logstash - receives, process and ship data
- manipulate/enrich/process data
Pipeline => input(receives events from various source) + (filter) + output(stash)
@Tapan
Tapan / elasticsearch.txt
Last active January 25, 2020 22:42
Elasticsearch
Analyzer
1. character filter => add, remove or transform the text i.e strip html tag from the document.
2. tokenizer => split text into terms.
3. token filter => consists of zero or more filters like uppercase, synonyms, stop words etc.
Analyze API
POST _analyze
{
"tokenizer": "standard",
https://gist.github.com/WisdomFusion/a60285c8f7cd9faf06ef8c9244133219
@Tapan
Tapan / spinner.md
Created September 1, 2017 08:49 — forked from danjellesma/spinner.md
Rails 4: Adding a spinner on link clicks

In Rails 4 it is useful to have a 'page loading' indicator when a user clicks a link. This is a simple way to accomplish that without external libraries. Tested on Rails 4 using TurboLinks.

Great Link for Spinning Loader gifs: http://loading.io/


On CSS Page:
.modal {
    display:    none;
 position: fixed;
https://code.tutsplus.com/articles/an-introduction-to-slim-templates--cms-26028
https://code.tutsplus.com/articles/ruby-templating-with-slim-part-2--cms-26094
https://richonrails.com/articles/the-slim-template-engine
http://eggbox.fantomfactory.org/pods/afSlim/doc/
@Tapan
Tapan / ansible
Created July 25, 2017 04:33
ansible
https://opensource.com/article/17/7/automate-sysadmin-ansible
@Tapan
Tapan / resque
Last active July 7, 2017 04:08
Resque
# check resque info from console
Resque.info
# start redis server
redis-server
# start workers
VVERBOSE=1 QUEUE=queue_name rails environment resque:work
#
@Tapan
Tapan / linux
Last active February 22, 2018 06:10
Linux
#add non-root user with root privileges
sudo adduser linux
sudo passwd linux
linuxpasswd
sudo visudo
linux ALL=(ALL) ALL
#Nginx
@Tapan
Tapan / presto
Last active November 3, 2017 09:49
Presto installation
Installation
https://teradata.github.io/presto/docs/141t/server-installation.html
http://teradata.github.io/presto/docs/127t/installation/installation-ambari.html
Adding public key to clusters
https://teradata.github.io/presto/docs/141t/installation/presto-admin/ssh-configuration.html#ssh-configuration-label
Reference
http://teradata.github.io/presto/docs/127t/installation/installation-ambari.html
https://teradata.github.io/presto/docs/current/getting-started.html
@Tapan
Tapan / gist:6ffef7767f5b498a496b8a64038d8513
Last active July 5, 2017 05:33
Add log rotate for services in linux
https://www.cyberciti.biz/faq/how-do-i-rotate-log-files/
http://www.linuxcommand.org/man_pages/logrotate8.html
https://gorails.com/guides/rotating-rails-production-logs-with-logrotate
Test new added logrotation policy
logrotate -vf /etc/logrotate.d/custom