Skip to content

Instantly share code, notes, and snippets.

View biske's full-sized avatar

Ivan Bisevac (Иван Бишевац) biske

View GitHub Profile
# Creat a PIT (Point in Time)
POST /auditbeat-8.0.0/_pit?keep_alive=10m

# First page of 2 items (no "search_after" specified)
GET /_search
{
  "size": 2, 
  "pit": {
 "id": "46ToAwEhYXVkaXRiZWF0LTguMC4wLTIwMjIuMDIuMTQtMDAwMDAxFmI2ZEk1NnMtUlZxM25hY3ZkeUVnN2cAFk0tblloZ2RYUjVDWUJLQUhYUHNmdHcAAAAAAAAEnSMWR0NfVWdlakZSSEszcGVzbXpfSTdoZwABFmI2ZEk1NnMtUlZxM25hY3ZkeUVnN2cAAA==",
@biske
biske / elasticsearch-setup-apple-macbook-pro-m1.md
Created April 25, 2023 13:13 — forked from todgru/elasticsearch-setup-apple-macbook-pro-m1.md
Install Elasticsearch 7.x on Apple Macbook Pro M1 Ventura 13.2

Elasticsearch Setup Apple MacBook Pro M1

Apple MacBook Pro M1, 32 GB, Ventura 13.2

Documentation based on comments in this Github Elasticsearch issue.

Install Homebrew

it 'responds with profile field data' do
send_request
expect(response_body).to include(
"id" => Integer,
"label" => params[:profile_field][:label],
"field_type" => params[:profile_field][:field_type],
"key" => params[:profile_field][:key],
"placeholder" => params[:profile_field][:placeholder],
"description" => params[:profile_field][:description],
"required" => false,
@biske
biske / Enter container
Last active April 22, 2021 12:10
Enter container with given name
docker exec -it $(docker ps --no-trunc --filter "name=container_name" -q) bash
# where container_name is service name defined in the compose.yaml
docker exec -itu postgres container_name psql
version: '3.7'
services:
db:
image: postgres:10.1-alpine
environment:
POSTGRES_USER: 'postgres'
POSTGRES_PASSWORD: 'postgres'
volumes:
- pg_data:/var/lib/postgresql/data
ports:
@biske
biske / gist:389c748977306348d65e26d49b51326d
Created December 14, 2019 00:39
Useful docker commands
https://stackoverflow.com/a/39968015/507018
class DistributeStudents
attr_reader :coaches_to_students_distribution
def initialize(coaches, students, coaches_to_students_distribution)
@coaches = coaches
@students = students
@coaches_to_students_distribution = coaches_to_students_distribution
@undistributed_students_size = students.size
@number_of_students_per_coach = calculate_number_of_students_per_coach
end
ActiveRecord::SchemaMigration.find_by(version: '20171113120912').destroy
gamestore_development=# alter table organizations
gamestore_development-# drop column partial_registration;
decoded_state = Base64.strict_decode64(params[:state])
state_params = Rack::Utils.parse_nested_query(decoded_state)