Skip to content

Instantly share code, notes, and snippets.

View Kumawatlalit912's full-sized avatar
🎯
Focusing

Kumawat Lalit Kumawatlalit912

🎯
Focusing
View GitHub Profile
@Kumawatlalit912
Kumawatlalit912 / nodejs.txt
Created April 6, 2023 17:22
Install nodejs And Nvm on linux
for nodejs just copy and run below command
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - &&\
sudo apt-get install -y nodejs
for nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
then just refresh the bashrc file
@Kumawatlalit912
Kumawatlalit912 / queryParams.js
Created March 2, 2023 13:08
axios imp query params
axios.get('https://jsonplaceholder.typicode.com/posts?_limit=5')
.then(response => {
const data = response.data;
console.log(data);
})
.catch(error => {
console.error(error);
});
axios.get('https://jsonplaceholder.typicode.com/posts?_limit=5&_sort=title&_order=asc')
@Kumawatlalit912
Kumawatlalit912 / docker-compose.yaml
Created February 27, 2023 20:00
basic yaml file for elastic,kibana,mongodb
version: '3'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.6.1
container_name: elasticsearch
environment:
- discovery.type=single-node
ports:
- 9200:9200
@Kumawatlalit912
Kumawatlalit912 / docker-compose.yaml
Created February 27, 2023 19:58
elastic and kibana configuration in docker,docker-compose.yaml
version: '3'
services:
elasticsearch1:
image: docker.elastic.co/elasticsearch/elasticsearch:8.6.1
container_name: elasticsearch1
environment:
- discovery.type=zen
- cluster.name=docker-cluster
- node.name=node-1
@Kumawatlalit912
Kumawatlalit912 / insertLargeCsv.js
Created February 24, 2023 06:15
how to insert large csv dataset in elastic using nodejs
const { Client } = require('@elastic/elasticsearch');
const fs = require('fs');
const readline = require('readline');
const csv = require('csv-parser');
const client = new Client({ node: 'http://localhost:9200' });
const filePath = '/path/to/large/csv/file'; // Replace with the path to your CSV file
const chunkSize = 100000; // Replace with the desired chunk size
@Kumawatlalit912
Kumawatlalit912 / analyzers.json
Created February 20, 2023 07:26
elastic analyzers
put hola/
{
"settings":{
"analysis":{
"analyzer":{
"my-analyzer":{
"tokenizer":"my-tokenizer",
"filter":["lowercase"]
},
@Kumawatlalit912
Kumawatlalit912 / docker-compose2.yml
Created February 15, 2023 23:55
updated docker-compose.yml file for version 3
#uncomment things you want to use and comment that you dont want
#Give it A star
version: "3"
services:
#mongodb:
#container_name: mongodb
#image: mongo:latest
#ports:
@Kumawatlalit912
Kumawatlalit912 / docker-compose1.yml
Created February 14, 2023 06:22
docker compost yml file
version: '2.2'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.6.1
container_name: elasticsearch
environment:
- cluster.name=docker-cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
@Kumawatlalit912
Kumawatlalit912 / docker-compose.yml
Created February 13, 2023 08:57
run elastic and kibana using docker container
//docker compose up ---->after saving this run this in the same folder --> you can use vs code
version: "3.7"
services:
es01:
image: "docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2"
ports:
- "9200:9200"
- "9300:9300"
environment:
@Kumawatlalit912
Kumawatlalit912 / useradd.yml
Created February 10, 2023 06:05
to ass user in elastic
make sure to go in users_roles and add admins as (user created)
./elasticsearch-users useradd kumawatlalit -p kumawat -r network,monitoring