This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const memoryCronJob = new CronJob("* * * * * *", async () => { | |
const formatMemoryUsage = (data : number) => `${Math.round(data / 1024 / 1024 * 100) / 100} MB`; | |
const memoryData = process.memoryUsage(); | |
const memoryUsage = { | |
rss: `${formatMemoryUsage(memoryData.rss)} -> Resident Set Size - total memory allocated for the process execution`, | |
heapTotal: `${formatMemoryUsage(memoryData.heapTotal)} -> total size of the allocated heap`, | |
heapUsed: `${formatMemoryUsage(memoryData.heapUsed)} -> actual memory used during the execution`, | |
external: `${formatMemoryUsage(memoryData.external)} -> V8 external memory`, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function kubens() { | |
ns=$(kubectl get ns | awk '{ print $1 }' | grep -v '^NAME$' | fzf) | |
kubectl config set-context --current --namespace=$ns | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package de.spinscale.prt; | |
import org.apache.lucene.analysis.custom.CustomAnalyzer; | |
import org.apache.lucene.analysis.phonetic.PhoneticFilterFactory; | |
import org.apache.lucene.search.suggest.FileDictionary; | |
import org.apache.lucene.search.suggest.Lookup; | |
import org.apache.lucene.search.suggest.analyzing.AnalyzingSuggester; | |
import org.apache.lucene.store.Directory; | |
import org.apache.lucene.store.NIOFSDirectory; | |
import org.junit.jupiter.api.Test; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exec: /app/openpixel-sqlite-tracker/bin/openpixel-sqlite-tracker | |
dbs: | |
- path: /tmp/sqlite.db | |
replicas: | |
- type: s3 | |
region: eu-central-1 | |
bucket: THE_BUCKET | |
path: /db | |
access-key-id: AWS_ACCESS_KEY_ID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# autobahn-api-to-es | |
# | |
# Indexes autobahn API metadata into Elasticsearch to use it with Kibana Maps | |
# | |
# Original API description https://gist.github.com/LilithWittmann/06bd153317b635e7b622651f5cfd95ea | |
# | |
# | |
# MIT License | |
# | |
# Copyright (c) [2021] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################# | |
## unsigned long | |
############################# | |
DELETE unsigned_long_test | |
PUT unsigned_long_test | |
{ | |
"mappings": { | |
"properties": { | |
"my_counter": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Show the scoreboard in the contributor app | |
DELETE scoreboard | |
PUT scoreboard/_bulk?refresh | |
{"index":{}} | |
{ "score" : 1, "@timestamp" : "2021-02-28", "email":"[email protected]", "name" : "Peter Parker"} | |
{"index":{}} | |
{ "score" : 4, "@timestamp" : "2021-02-01", "email":"[email protected]", "name" : "Peter MiddleName Parker"} | |
{"index":{}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################### | |
## Boosting scores based on numeric field values ## | |
################################################### | |
# Existing solution: function_score query | |
# Problem: Performance penalty | |
# Solution: Rescoring, only rescoring top-n documents | |
# Lucene optimization in Elasticsearch 7: Block MAX WAND | |
# New query: distance_feature, efficiently skips non-competitive hits |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################## | |
# Runtime fields # | |
################## | |
GET / | |
DELETE orders | |
PUT orders | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# retrieve URL | |
url="https://www.rki.de/DE/Content/InfAZ/N/Neuartiges_Coronavirus/Daten/Impfquotenmonitoring.xlsx?__blob=publicationFile" | |
wget -o /dev/null $url -O out.xlsx | |
# convert to csv | |
# run 'pip3 install xlsx2csv' (or maybe pip depending on your python installation) | |
xlsx2csv -a out.xlsx out.csv |
NewerOlder