Skip to content

Instantly share code, notes, and snippets.

View ozzimpact's full-sized avatar
🏠
Working from home

Oğuzhan Demir ozzimpact

🏠
Working from home
View GitHub Profile
@ozzimpact
ozzimpact / anagrams.txt
Last active February 9, 2021 08:20
anagrams
a
aah
aahed
aahing
aahs
aardvark
aardvarks
aardwolf
ab
abaci
GET /_search
{
"sort": [
{
"arrayField.complexSortField": {
"order": "desc"
}
}
],
"query": {
/// Doc 1
{
"id": 1,
"field1": "value1",
"field2": "value2",
"arrayField": [
{
"complexSortField": 10,
"complexField": "complexValue"
},
PUT stage-logs-000001
{
"aliases": {
"stagelogs": {
"is_write_index": true
}
}
}
PUT _template/log_template
{
"index_patterns": ["log-*"],
"settings": {
"index": {
"lifecycle": {
"name": "logs_policy",
"rollover_alias": "rolloverlogs"
},
"number_of_shards": "5",
PUT _ilm/policy/logs_policy
{
"policy": {
"phases": {
"warm": {
"min_age": "1h",
"actions": {
"allocate": {
"number_of_replicas": 0
},
@ozzimpact
ozzimpact / spotify_charts.py
Created January 29, 2019 10:55 — forked from chadmhorner/spotify_charts.py
Scrape Spotify Charts using ReadyPipe
from readypipe import requests, starting_task, subtask, schedule, save, schedule_many
import datetime
CHART_URL = 'https://spotifycharts.com/regional/%s/daily/%s'
@starting_task
def load_todays_urls():
chart_page = requests.get_dom_from_content(CHART_URL % ('global', 'latest')) #visit latest page
countries_set = set()
yesterday = (datetime.datetime.today() - datetime.timedelta(days=1)).strftime('%Y-%m-%d') #get yesterday's date
apt-get --purge autoremove elasticsearch
rm -rf /var/lib/elasticsearch/
rm -rf /usr/share/elasticsearch/
rm -rf /etc/init.d/elasticsearch
rm -rf /etc/elasticsearch/
@ozzimpact
ozzimpact / es.sh
Last active March 3, 2017 08:15 — forked from bugthesystem/es.sh
#!/bin/bash
ELASTICSEARCH_VERSION=1.7.6
### Download and install the Public Signing Key
wget https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-${ELASTICSEARCH_VERSION}.deb
### Install Elasticsearch
sudo dpkg -i elasticsearch-${ELASTICSEARCH_VERSION}.deb
@ozzimpact
ozzimpact / elasticsearch.yml
Last active November 19, 2015 11:30
Basic Elasticsearch Configuration
##################### Elasticsearch Configuration Example #####################
# This file contains an overview of various configuration settings,
# targeted at operations staff. Application developers should
# consult the guide at <http://elasticsearch.org/guide>.
#
# The installation procedure is covered at
# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/setup.html>.
#
# Elasticsearch comes with reasonable defaults for most settings,