Skip to content

Instantly share code, notes, and snippets.

View j-brn's full-sized avatar

Jonas j-brn

  • Germany
  • 22:43 (UTC +01:00)
View GitHub Profile
@j-brn
j-brn / node-exporter.json
Created September 28, 2022 19:04
Node-Exporter Dashboard
{
"annotations": {
"list": [
{
"$$hashKey": "object:1058",
"builtIn": 1,
"datasource": {
"type": "datasource",
"uid": "grafana"
},
@j-brn
j-brn / docker-compose.yml
Created October 19, 2021 06:35
nginx-proxy docker-compose
version: '3'
services:
nginx-proxy:
image: nginxproxy/nginx-proxy
restart: always
ports:
- 80:80
- 443:443
volumes:
- conf:/etc/nginx/conf.d
@j-brn
j-brn / example.nix
Last active June 16, 2025 07:27
KVMFR-NixOS
{
virtualisation.kvmfr = {
enable = true;
shm = {
enable = true;
size = 128;
user = "j-brn";
group = "libvirtd";
@j-brn
j-brn / cloud-init.yml
Created March 18, 2021 15:45
RKE host cloudinit config
#cloud-config
users:
- name: admin
ssh-authorized_keys:
- <your-key-goes-here>
sudo: ['ALL=(ALL) NOPASSWD:ALL']
groups:
- sudo
- docker
shell: /bin/bash
@j-brn
j-brn / cloud-init.yml
Created March 17, 2021 19:17
RKE Host
#cloud-config
users:
- name: admin
ssh-authorized_keys:
- <your keys go here>
sudo: ['ALL=(ALL) NOPASSWD:ALL']
groups:
- sudo
- docker
shell: /bin/bash
@j-brn
j-brn / cloud-init-yml
Last active February 11, 2021 06:51
CloudInit configuration for which confgures a debian 9 instance and installs docker on it
#cloud-config
users:
- name: admin
ssh-authorized_keys:
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG3eO5g2TPLcE3pzt/6XiGqGjbAeCr41s+5mSR0aZuHt jonas@thinkpad-jb
sudo: ['ALL=(ALL) NOPASSWD:ALL']
groups:
- sudo
- docker
shell: /bin/bash
@j-brn
j-brn / PS1.sh
Last active January 28, 2019 16:05
$PS1
# The bash prompt i use.
# [17:02:54] user@hostname : /tmp/example-repo (master)
# >
#
# created using http://bashrcgenerator.com/ with manualy added git branch display
export PS1="[\[$(tput sgr0)\]\[\033[38;5;2m\]\t\[$(tput sgr0)\]\[\033[38;5;15m\]] \[$(tput sgr0)\]\[\033[38;5;12m\]\u\[$(tput sgr0)\]\[\033[38;5;11m\]@\[$(tput sgr0)\]\[\033[38;5;14m\]\h\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]\[\033[38;5;8m\]:\[$(tput sgr0)\]\[\033[38;5;15m\] \w \[$(tput sgr0)\]\[\033[38;5;99m\]\$(__git_ps1 '(%s)')\[$(tput sgr0)\]\[\033[38;5;15m\]\n> \[$(tput sgr0)\]"

Useful regular expressions

This gist contains some useful regular expressions i wrote.

DateTime

With named capturing groups

^(?P<year>\d{4})\-(?P<month>0\d|1[0-2])\-(?P<day>0[1-9]|[12]\d|3[01])\s(?P<hour>2[0-3]|[01]\d):(?P<minute>5[0-9]|[0-4]\d):(?P<second>5[0-9]|[0-4]\d)$

@j-brn
j-brn / setbrightness
Created October 17, 2018 13:01
Simple wrapper script around xrandr to easily change the display brightness
#!/bin/bash
# set the screen brightness on all outputs
### variables ###
# You can configure the script by editing these vars, it should not be necessary to change anything else
max="2" # max allowed brightness
min="0.2" # min allowed brightness (0 = blackscreen)
prefix="$(echo ${0} | rev | cut -d "/" -f 1 | rev)" # this name is used as prefix for all output in this script
## end ##