Skip to content

Instantly share code, notes, and snippets.

Alexander Reelsen spinscale

Block or report user

Report or block spinscale

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@spinscale
spinscale / logstash-meetup.conf
Created Jun 20, 2018
logstash meetup.com stream
View logstash-meetup.conf
# curl -s http://stream.meetup.com/2/rsvps | ./bin/logstash -f logstash-meetup.conf
input {
stdin {
codec => json_lines
}
}
# the lonlat array is needed for the map widget in kibana to work
# so we have to work a bit around the supplied data
filter {
@spinscale
spinscale / init.lua
Created May 16, 2018
hammerspoon - german umlauts on us keyboard
View init.lua
-- Umlaute without the hassle, hell yeah
hs.hotkey.bind({'alt'}, 'u', function ()
hs.eventtap.keyStrokes('ü')
end)
hs.hotkey.bind({'shift', 'alt'}, 'u', function ()
hs.eventtap.keyStrokes('Ü')
end)
hs.hotkey.bind({'alt'}, 'a', function ()
@spinscale
spinscale / training-examples.json
Created Dec 14, 2017
Training Examples (Zurich)
View training-examples.json
##### decompounder example
DELETE decompound
PUT decompound
{
"settings": {
"analysis": {
"analyzer": {
"my_decompound_analyzer" : {
"type" : "custom",
@spinscale
spinscale / example.json
Created Oct 12, 2017
Training Copenhagen: Stored fields example
View example.json
DELETE sample
PUT sample
{
"mappings": {
"foo" : {
"_source": { "enabled": false },
"properties": {
"my_field" : {
"type": "text",
@spinscale
spinscale / volume.lua
Created Apr 16, 2017
Hammerspoon: Configure volume via keyboard shortcuts for macbook pro (touchbar, but no keys)
View volume.lua
function changeVolume(diff)
return function()
local current = hs.audiodevice.defaultOutputDevice():volume()
local new = math.min(100, math.max(0, math.floor(current + diff)))
if new > 0 then
hs.audiodevice.defaultOutputDevice():setMuted(false)
end
hs.alert.closeAll(0.0)
hs.alert.show("Volume " .. new .. "%", {}, 0.5)
hs.audiodevice.defaultOutputDevice():setVolume(new)
@spinscale
spinscale / example
Created Jan 18, 2017
Training Beispiel: SubAggregation - Scripting Terms Aggregation
View example
DELETE nutrition
PUT nutrition/foo/_bulk
{ "index" : {} }
{ "calories" : 100, "name" : "Chips", "category" : "a" }
{ "index" : {} }
{ "calories" : 200, "name" : "Thick Chip", "category" : "a" }
{ "index" : {} }
{ "calories" : 300, "name" : "Marzipan", "category" : "b" }
View gist:631a0e262149eb1d9727973d616d35ae
DELETE foo
PUT /foo/bar/_bulk
{ "index" : { "_id" : "alex" } }
{ "name" : "Alex" }
{ "index" : { "_id" : "bert" } }
{ "name" : "Bert" }
{ "index" : {"_id" : "caesar" } }
{ "name" : "Caesar" }
{ "index" : {"_id" : "dagobert" } }
View ingest node example
DELETE _all
PUT _ingest/pipeline/rename_hostname
{
"processors": [
{
"rename": {
"field": "hostname",
"target_field": "host",
"ignore_missing": true
@spinscale
spinscale / console-examples
Created Jan 18, 2017
Queries vom Training
View console-examples
DELETE _all
GET index/_mapping
PUT index
{
"settings": {
"analysis": {
"analyzer": {
"my_analyzer": {
@spinscale
spinscale / kv.json
Created Dec 19, 2016
kv in painless
View kv.json
POST _ingest/pipeline/_simulate
{
"pipeline" : {
"description": "A pipeline to do named entity extraction",
"processors": [
{
"script": {
"lang": "painless",
"inline": "ctx.params = [:] ; /&/.splitAsStream(ctx.x).forEach(pair -> { def x = /=/.split(pair); ctx.params[x[0]] = x[1]; })"
}
You can’t perform that action at this time.