Skip to content

Instantly share code, notes, and snippets.

@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 / 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
@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 / .vimrc
Last active October 7, 2021 14:27
Standard .vimrc
" set nocompatible
set nocompatible
" enable syntax highligting
syntax on
" suppress welcome screen
set shortmess+=I
" some useful options

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

# Variables
setenv FOO bar
# Settings
startup_message off
shell zsh
vbell off
defutf8 on
defscrollback 10000
autodetach on
@virtualdreams
virtualdreams / mono-server4.service
Created May 5, 2015 06:02
systemd mono-server4 unit script
[Unit]
Description=FastCGI mono server 4
After=network.target
[Service]
Environment=MONO_IOMAP=all
EnvironmentFile=
Type=simple
ExecStart=/usr/bin/fastcgi-mono-server4 /applications=*:/:/srv/www/mvc/ /socket=tcp:127.0.0.1:9000
User=www-data
@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
@virtualdreams
virtualdreams / .zshrc
Last active August 9, 2018 18:29
Simple zsh configuration
# init
autoload -U colors && colors
alias ls='ls --color=auto'
alias rm='rm -i'
setopt nobeep # avoid beep
setopt noglobdots # * shouldn't match dotfiles
setopt no_auto_remove_slash
setopt hash_list_all
@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.
*/