Skip to content

Instantly share code, notes, and snippets.

@kalinon
kalinon / omega-nfc-server.rb
Created May 28, 2018 19:57
A basic ruby script to serve up NFC reader responses in json
#!/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 15:33
uncrustify for unity c#
# -------------------------------------------------------------------------------------------------#
# #
# _ _ _ _ __ ___ _____ _ _ __ _ #
# | | | |_ _ __ _ _ _ _ __| |_(_)/ _|_ _ / __| / / __|| |_ _| |_ __ ___ _ _ / _(_)__ _ #
# | |_| | ' \/ _| '_| || (_-< _| | _| || | | (__ / / (_|_ _|_ _| / _/ _ \ ' \| _| / _` | #
# \___/|_||_\__|_| \_,_/__/\__|_|_| \_, | \___/_/ \___||_| |_| \__\___/_||_|_| |_\__, | #
# |__/ |___/ #
# #
# -------------------------------------------------------------------------------------------------#
# #
@kalinon
kalinon / grafana_libs.csv
Last active July 23, 2019 13:52
Automating Grafana and adding consistency
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 / test.cr
Created July 23, 2019 13:52
Automating Grafana and adding consistency - 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 / vault.json
Created May 18, 2020 18:29
medium-335312a6349a-01
{
"Version": "2012-10-17",
"Statement": [{
"Action": [
"admin:*"
],
"Resource": [
"arn:aws:s3:::vault",
"arn:aws:s3:::vault/*"
],
@kalinon
kalinon / config_minio.sh
Created May 18, 2020 18:34
medium-335312a6349a-02
#!/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
server:
standalone:
enabled: true
config: |
ui = true
listener "tcp" {
tls_disable = 1
address = "[::]:8200"
cluster_address = "[::]:8201"
@kalinon
kalinon / app.cr
Last active July 11, 2020 20:47 — forked from kingsleyh/app.cr
Entitas
require "crsfml"
require "entitas"
::Log.builder.clear
spoved_logger(bind: true)
# ---- domain ----
module Domain
struct Dimension
property rows : Int32
@kalinon
kalinon / add_bleed_edge_from_images_local.py
Last active January 4, 2023 00:39
Crystal scripts to prep wow-tcg cards for MPC
import pathlib
import imageio
import requests
import time
import numpy as np
import os
from numpy.fft import fft2, ifft2, fftshift, ifftshift
from skimage.transform import resize
from skimage.filters import unsharp_mask