Skip to content

Instantly share code, notes, and snippets.

@030
030 / dashbord-to-jsonnet.py
Created March 7, 2022 13:49 — forked from tennix/dashbord-to-jsonnet.py
Convert Grafana dashboard json to jsonnet
#!/usr/bin/env python
import json
from jinja2 import Template
# git clone https://github.com/pingcap/tidb-docker-compose
# cd tidb-docker-compose
# git clone https://github.com/tennix/grafonnet-lib -b table
# python dashboard-to-jsonnet.py > pd.jsonnet
# jsonnet -J grafonnet-lib pd.jsonnet > config/dashboards/generated-pd.json
with open('config/dashboards/pd.json', 'r') as f:
data = json.load(f)
@030
030 / go-build.sh
Last active November 9, 2022 14:03
#!/bin/bash -e
GITHUB_TAG="${GITHUB_TAG:-local}"
SHA512_CMD="${SHA512_CMD:-sha512sum}"
GO_BUILD_DIR="${1}"
GO_BUILD_DELIVERABLE="${2}"
echo "GITHUB_TAG: '${GITHUB_TAG}', SHA512_CMD: '${SHA512_CMD}', GO_BUILD_DIR: ${GO_BUILD_DIR}, GO_BUILD_DELIVERABLE: '${GO_BUILD_DELIVERABLE}'"
cd cmd/${GO_BUILD_DIR}
go build -buildvcs=false -ldflags "-X main.Version=${GITHUB_TAG}" -o "${GO_BUILD_DELIVERABLE}"
@030
030 / vscode-settings.json
Last active February 10, 2024 09:12
vscode-settings
//
// code --list-extensions --show-versions | tr '\n' ' '
//
// [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
//
{
// general
"editor.formatOnSave": true,
"window.zoomLevel": -1,
#
# do not make any modifications to this file as this resides on github gist
#
# https://taskfile.dev
#
# go install github.com/go-task/task/v3/cmd/[email protected]
# ~/go/bin/task --list-all
#
# 0.2.1
#