Skip to content

Instantly share code, notes, and snippets.

@virtualdreams
virtualdreams / grafana-dashboard-exporter
Created March 8, 2023 08:51 — forked from crisidev/grafana-dashboard-exporter
Command to export all grafana 2 dashboard to JSON using curl
KEY=XXXXXXXXXXXX
HOST="https://metrics.crisidev.org"
mkdir -p dashboards && for dash in $(curl -k -H "Authorization: Bearer $KEY" $HOST/api/search\?query\=\& |tr ']' '\n' |cut -d "," -f 5 |grep slug |cut -d\" -f 4); do
curl -k -H "Authorization: Bearer $KEY" $HOST/api/dashboards/db/$dash > dashboards/$dash.json
done

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@virtualdreams
virtualdreams / .tmux.conf
Last active June 9, 2022 07:33
tmux config
# change prefix to Ctrl+a
set-option -g prefix C-a
unbind-key C-b
bind-key C-a send-prefix
# enable mouse
set -g mouse on
# set history buffer
set -g history-limit 10000
@virtualdreams
virtualdreams / github-pandoc.css
Created July 16, 2018 10:53 — forked from dashed/github-pandoc.css
GitHub-like CSS for pandoc standalone HTML files (perfect for HTML5 output). Based on Marked.app's GitHub CSS. Added normalize.css (v2.1.3) in the prior to GitHub css.
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined in IE 8/9.
*/
@virtualdreams
virtualdreams / ca.md
Created July 1, 2018 21:45 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@virtualdreams
virtualdreams / goaccess.service
Created April 4, 2017 15:16
goaccess systemd service
[Unit]
Description=Goaccess Web log report.
After=network.target
[Service]
Type=simple
User=root
Group=root
Restart=always
ExecStart=/usr/local/bin/goaccess -a -g -f /var/log/nginx/access.log -o /srv/www/goaccess/index.html --real-time-html --ws-url <your url>
@virtualdreams
virtualdreams / dotnet.service
Created April 4, 2017 15:14
dotnet systemd service
[Unit]
Description=dotnet <your service name>
After=network.target
[Service]
Environment=ASPNETCORE_URLS=http://127.0.0.1:5000/
EnvironmentFile=
;Restart=always
;RestartSec=10
Type=simple
@virtualdreams
virtualdreams / gogs.service
Created April 4, 2017 15:10
Gogs systemd service
[Unit]
Description=Gogs
After=syslog.target
After=network.target
#After=mysqld.service
#After=postgresql.service
#After=memcached.service
#After=redis.service
[Service]
@virtualdreams
virtualdreams / NuGet.config
Created March 23, 2017 06:40
Sample configuration for nuget/vscode to move that big and fat .nuget folder from c directory.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<config>
<add key="https_proxy" value="http://127.0.0.1:3128/" />
<add key="http_proxy" value="http://127.0.0.1:3128/" />
<add key="globalPackagesFolder" value="e:\Entwicklung\.nuget" />
@virtualdreams
virtualdreams / mongod.service
Last active March 16, 2019 06:38
MongoDB systemd service file
[Unit]
Description=MongoDB Database Server
After=network.target
[Service]
User=mongodb
Group=mongodb
ExecStart=/usr/bin/mongod --config /etc/mongod.conf
PIDFile=/var/run/mongodb/mongod.pid