Skip to content

Instantly share code, notes, and snippets.

Avatar
⛰️
Remote

Haydar KÜLEKCİ hkulekci

⛰️
Remote
View GitHub Profile
@hkulekci
hkulekci / nginx-kibana.conf
Last active Oct 19, 2022 — forked from dmajorel/nginx-kibana.conf
Nginx configuration for Kibana-ElasticSearch read-only/read-write access
View nginx-kibana.conf
upstream elasticsearch_upstream {
server 10.10.10.10:9200;
keepalive 15;
}
upstream kibana_upstream {
server 127.0.0.1:5601;
}
# Kibana, public access, RO operations
@hkulekci
hkulekci / test.rs
Created Jul 12, 2022
What is the mean of "value borrowed here after move"
View test.rs
pub fn run() {
// Correct One
let hello1 = "Hello";
let mut hello2 = String::from("Hello");
hello2.push('\u{1f600}');
println!("{}", hello1.len());
println!("{}", hello2.len());
println!("{:?}", (hello1, hello2));
}
View percentiles_aggregation.md
POST test_index/_bulk
{"index": {"_id": 1}}
{"price": 68}
{"index": {"_id": 2}}
{"price": 74}
{"index": {"_id": 3}}
{"price": 74}
{"index": {"_id": 4}}
{"price": 118}
View sample-data-for-stackoverflow.md
PUT transactions

POST transactions/_bulk
{"index": {"_id": 1}}
{"id": 1, "user_id": 5, "transaction_date": "2022-05-04T11:18:00Z"}
{"index": {"_id": 2}}
{"id": 2, "user_id": 5, "transaction_date": "2022-05-04T10:36:00Z"}
{"index": {"_id": 3}}
{"id": 3, "user_id": 3, "transaction_date": "2022-05-04T10:23:00Z"}
@hkulekci
hkulekci / elastic_bulk-import-settings.sh
Created Nov 9, 2021 — forked from fitz123/elastic_bulk-import-settings.sh
Elastic | Performance tuning for big data import
View elastic_bulk-import-settings.sh
##
# Temporary Speed-up configuration for fast import
# references: https://www.elastic.co/blog/performance-considerations-elasticsearch-indexing
# p.s. If you do not want to restart your node/cluster - don't perform 1 and 2 points
##
# 1. Change "ES_HEAP_SIZE" from 50% of memory (default and recommended) to something like 80%
mem=`free -m | grep Mem | awk '{ print $2 }'` && heap=$[ ($mem/1024)*80/100 ]g && \
sudo sed -i "s/ES_HEAP_SIZE=.*/ES_HEAP_SIZE=$heap/" /etc/init.d/elasticsearch
@hkulekci
hkulekci / search_as_you_type
Created Mar 15, 2021 — forked from xeraa/search_as_you_type
Elasticsearch's search_as_you_type and completion suggester fields in action
View search_as_you_type
PUT jobs
{
"mappings": {
"properties": {
"title": {
"type": "search_as_you_type"
}
}
}
}
@hkulekci
hkulekci / 0-README.md
Created Apr 27, 2020
Turkish Stemmer PHP Test
View 0-README.md

Sample Usage For the PHP Turkish Stemmer Project

You can download the gist as zip and open it. After open it, run the below command:

composer install

Then our environment ready. Just run the file :

@hkulekci
hkulekci / php7.0-fpm-pool-www.conf
Last active Aug 1, 2020
PHP FPM www configuration example for a little server
View php7.0-fpm-pool-www.conf
; Choose how the process manager will control the number of child processes.
; Possible Values:
; static - a fixed number (pm.max_children) of child processes;
; dynamic - the number of child processes are set dynamically based on the
; following directives. With this process management, there will be
; always at least 1 children.
; pm.max_children - the maximum number of children that can
; be alive at the same time.
; pm.start_servers - the number of children created on startup.
; pm.min_spare_servers - the minimum number of children in 'idle'
@hkulekci
hkulekci / size.md
Last active Nov 18, 2022
Elasticsearch Nested Array Object Size Aggregation
View size.md
# images field type is nested
GET products/_search
{
  "track_total_hits": true, 
  "size": 0, 
  "aggs": {
    "counts": {
      "terms": {
 "script": "params['_source']['images'].size()",
@hkulekci
hkulekci / sample_uuid_elasticsearch.java
Created Aug 13, 2019
Elasticsearch UUID Generator Part
View sample_uuid_elasticsearch.java
//*******************************************************************
// Welcome to CompileJava!
// If you experience any issues, please contact us ('More Info') -->
// Sorry that the "Paste" feature no longer works! GitHub broke it.
//*******************************************************************
import java.lang.Math; // headers MUST be above the first class
/*