Instantly share code, notes, and snippets.

Always available

Hemanth B hemanth22

  • Societe Generale Global Solution Centre.
  • Banglore
View GitHub Profile
hemanth22 /
Created Feb 16, 2019 — forked from macghriogair/
[Elasticsearch stats] #elasticsearch #cat
curl localhost:9200/_stats | python -m json.tool
# specific indices only
curl localhost:9200/index1,index2/_stats | python -m json.tool
# CAT all indices pretty format
curl 'localhost:9200/_cat/indices?format=json&pretty'
hemanth22 /
Created Feb 16, 2019 — forked from Integralist/
[ElasticSearch] #elasticsearch
curl -XPUT 'localhost:9200/foo/bar/1?pretty' -d '{"name": "Elasticsearch Denver", "organizer": "Lee"}'


  "_index" : "foo",
  "_type" : "bar",

The Elastic Stack


Welcome to Friday afternoon L&D. This afternoon is going to be on the Elastic Stack. For those of you who dont know, the Elastic Stack is what was previously reffered to as ELK (ElasticSearch, Logstash and Kibana). It was changed because its more of a stack of applications now as opposed to 3 specific applications.

This session is going to be unstructed, there is no presentation, its going to be switching between notes, the browser, some code, config file and me rambling.

If you have questions PLEASE shout out when the question enters your brain, dont wait until the end/break in a sentence and there is no such thing as an irrelevant question...learning things like this can be thought of as a foundation of bricks, if there is a brick missing this could lead to misunderstandings futher down the line.

View butler.playbook
- hosts: localhost
remote_user: root
- hemanth22.butler
$ ansible-galaxy info YourUser.RoleName | grep -E 'id: [0-9]' | awk {'print $2'}
hemanth22 /
Created Jan 19, 2019 — forked from JonnyWong16/
Send an IFTTT notification for a specific username
### WARNING: This script has not been tested! ###
# 1. Install the requests module for python.
# pip install requests
# 2. Add script arguments in PlexPy.
# {user} {action}
import requests
import sys
user = sys.argv[1]
hemanth22 /
Created Jan 19, 2019 — forked from sgobin/
Usando uma raspberry e para medir a velocidade da internet e salvar em uma planilha do Google via IFTTT
import os
import re
import subprocess
import time
import requests
#Usa um Webhook do IFTTT
URL = '{NOME DO TRIGGER}/with/key/{CHAVE}'
#speedtest-cli => pip install speedtest-cli
import requests
key = 'eusNIu1EsTDCwSBRwh4-m3_UfoPvkN2eVfYfaNIEZ4Z'
def send_text(message):
requests.get('{}/with/key/{}'.format('send_text',key), data={'value1':message})
def send_email(subject, message):
requests.get('{}/with/key/{}'.format('send_email',key), data={'value1':subject, 'value2':message})
--header "Content-Type: application/json" \
--data-binary "{\"value1\": \"$2\",\"value2\": \"$3\",\"value3\": \"$4\"}"
hemanth22 /
Created Jan 19, 2019 — forked from upgundecha/
"If This Then That" Jenkins example
#!/usr/bin/env python3
# Copyright (c) 2016 Anki, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License in the file LICENSE.txt or at