Category Archives: Development

ElasticSearch notes

Resources:

For installation check this url. (DEB page link)

Default cluster configuration:

cluster name elasticsearch

Start/stop service

SysV:

sudo -i service elasticsearch start
sudo -i service elasticsearch stop

Systemd (read more here):

sudo systemctl start elasticsearch.service
sudo systemctl stop elasticsearch.service
sudo systemctl restart elasticsearch.service
sudo systemctl status elasticsearch.service

sudo systemctl enable elasticsearch.service
sudo systemctl disable elasticsearch.service

sudo systemctl start kibana.service
sudo systemctl stop kibana.service

Version and log information

view log sudo journalctl -f
view log for service sudo journalctl –unit elasticsearch

Cluster information

Health curl -X GET “localhost:9200/_cat/health?v”
Indices curl “localhost:9200/_cat/indices?v”

Index management

index stats curl -X GET “localhost:9200/mydb/_stats?pretty”
get all documents curl -X GET “localhost:9200/_search” -H ‘Content-Type: application/json’ -d'{ “query”: { “match_all”: {} } }’
get all documents http://localhost:9200/mydb/_search
count all documents curl -X GET “localhost:9200/mydb/_count”
count all documents http://localhost:9200/mydb/_count
delete index entries curl -XPOST ‘localhost:9200/mydb/_doc/_delete_by_query?conflicts=proceed’ -H’Content-Type: application/json’ -d’ { “query”: { “match_all”: {} }}’
delete index curl -X DELETE “localhost:9200/mydb”

sd

xbindkeys configuration

Setup:

  1. mouse side button 8 sends Enter
  2. mouse side button 9 sends alt+left
  3. tilde sends ctrl+w

 

Installation:

sudo apt-get install xautomation
sudo apt-get install x11-utils
sudo apt-get install xdotool

To find the keycodes run xev or xbindkeys -k:

xev
xbindkeys - k

Here is a sample script:

#send alt+left on side button 9
"xte 'keydown Alt_L' 'key Left' 'keyup Alt_L'"
   b:9

#send Enter on side button 8
"xte 'key Return'"
   b:8

#Using keycodes
"xte 'keydown Control_L' 'key w' 'keyup Control_L'"
    grave + release

 

References:

Vue links

Basics

  1. Official Style guide (v2)
  2. Deverus Style guide
  3. https://michaelnthiessen.com/26-time-saving-tips/

Authentication

  1. Authentication best practices
  2. User authentication with Vue and Vuex (jason watmore)
  3. https://scotch.io/tutorials/handling-authentication-in-vue-using-vuex (scotch.io)
  4. Cookie authentication for APIs

Rest API

  1. Implement with Vuex
  2. API calls with Vuex

Tools

  1. Basic understanding of elixir, gulp and webpac
  2. https://ponyfoo.com/articles/json-web-tokens-vs-session-cookies

Forms

  1. Submit with enter
  2. Use autofocus

Validation

  1. masks

Routing

  1. https://stackoverflow.com/questions/30414860/how-can-i-define-a-route-differently-if-parameter-is-not-integer

Templates

  1. Best Vue JS templates 2018
  2. https://stackoverflow.com/questions/50891858/vue-how-to-pass-down-slots-inside-wrapper-component

Deployment

  1. https://appdividend.com/2018/07/13/vue-history-mode-routing-tutorial/