Skip to content

Instantly share code, notes, and snippets.

@kalinon
kalinon / app.cr
Last active Jul 11, 2020 — forked from kingsleyh/app.cr
Entitas
View app.cr
require "crsfml"
require "entitas"
::Log.builder.clear
spoved_logger(bind: true)
# ---- domain ----
module Domain
struct Dimension
property rows : Int32
View medium-335312a6349a.yaml
server:
standalone:
enabled: true
config: |
ui = true
listener "tcp" {
tls_disable = 1
address = "[::]:8200"
cluster_address = "[::]:8201"
@kalinon
kalinon / config_minio.sh
Created May 18, 2020
medium-335312a6349a-02
View config_minio.sh
#!/usr/bin/env bash
MINIOCLUSTER="myminio"
VAULT_ID="vault"
VAULT_SECRET="F210D489-60B7-46CC-816E-1F8ED823C4FC"
# Create the vault bucket
mc mb ${MINIOCLUSTER}/vault
# Create the vault policy
@kalinon
kalinon / vault.json
Created May 18, 2020
medium-335312a6349a-01
View vault.json
{
"Version": "2012-10-17",
"Statement": [{
"Action": [
"admin:*"
],
"Resource": [
"arn:aws:s3:::vault",
"arn:aws:s3:::vault/*"
],
@kalinon
kalinon / test.cr
Created Jul 23, 2019
Automating Grafana and adding consistency - test.cr
View test.cr
require "crafana"
data_sources = ["Prometheus AWS", "Prometheus GCP"]
builder = Crafana::Builder.new
dashboard_name = "ElasticSearch Cluster Health Status - DEMO"
builder.add_dashboard(dashboard_name) do |dash|
# Add some tags to the dashboard
dash.tags = ["prometheus", "elasticsearch", "automated"]
@kalinon
kalinon / grafana_libs.csv
Last active Jul 23, 2019
Automating Grafana and adding consistency
View grafana_libs.csv
Tool/Lib Link Notes
Scripted Dashboards https://grafana.com/docs/reference/scripting/ Grafana native JS library that allows writing dashboards as code. Loads directly in grafana. Limited to what information that can be loaded.
Grafanalib https://github.com/weaveworks/grafanalib Python lib that allows the generation of dashboards. Limited functions for size and position of graphs
Crafana https://github.com/spoved/crafana.cr Crystal lib that allows the generation of dashboards as well as terraform files. Written by Holden Omans
make_dashboards.py https://www.scylladb.com/2018/03/02/better-grafana-dashboards/
Grafonnet https://github.com/grafana/grafonnet-lib Jsonnet library for generating Grafana dashboards
Grafana Dash Gen https://github.com/uber/grafana-dash-gen A collection of utility classes to construct and publish grafana graphs. The library is built ground up to incorporate grafana terminologies.
@kalinon
kalinon / omega-nfc-server.rb
Created May 28, 2018
A basic ruby script to serve up NFC reader responses in json
View omega-nfc-server.rb
#!/usr/bin/ruby
require 'json'
require 'webrick'
def get_nfc
all = Array.new
current = Hash.new
`nfc-list`.split("\n").each do |line|
if line =~ /ATQA.+:\s((:?[\da-f]{2}\s+)+)/
current = Hash.new
@kalinon
kalinon / .uncrustifyrc
Last active May 13, 2019
uncrustify for unity c#
View .uncrustifyrc
# -------------------------------------------------------------------------------------------------#
# #
# _ _ _ _ __ ___ _____ _ _ __ _ #
# | | | |_ _ __ _ _ _ _ __| |_(_)/ _|_ _ / __| / / __|| |_ _| |_ __ ___ _ _ / _(_)__ _ #
# | |_| | ' \/ _| '_| || (_-< _| | _| || | | (__ / / (_|_ _|_ _| / _/ _ \ ' \| _| / _` | #
# \___/|_||_\__|_| \_,_/__/\__|_|_| \_, | \___/_/ \___||_| |_| \__\___/_||_|_| |_\__, | #
# |__/ |___/ #
# #
# -------------------------------------------------------------------------------------------------#
# #