Skip to content

Instantly share code, notes, and snippets.

@mrpeardotnet
mrpeardotnet / PVE-host-backup.md
Created December 17, 2019 18:03
Proxmox PVE Host Config Backup Script

Proxmox PVE Host Config Backup Script

This script can be used to backup essential configuration files from the Proxmox Virtual Enivronment (PVE) host.

The script will create backups using tar with specified backup prefix and date and time stamp in the file name. Script will also delete backups that are older then number of days specified.

Create backup script file

To create backup script that will be executed every day we can create backup script in /etc/cron.daily/ folder. We need to make it writeable by root (creator) only, but readable and executable by everyone:

touch /etc/cron.daily/pvehost-backup
@malte-v
malte-v / settings.json
Last active November 18, 2019 12:55
Material-style semantic C++ syntax highlighting for VSCode (cquery)
"cquery.highlighting.enabled.types": true,
"cquery.highlighting.enabled.freeStandingFunctions": true,
"cquery.highlighting.enabled.memberFunctions": true,
"cquery.highlighting.enabled.freeStandingVariables": true,
"cquery.highlighting.enabled.memberVariables": true,
"cquery.highlighting.enabled.namespaces": true,
"cquery.highlighting.enabled.macros": true,
"cquery.highlighting.enabled.enums": true,
"cquery.highlighting.enabled.typeAliases": true,
"cquery.highlighting.enabled.enumConstants": true,
@insdavm
insdavm / WireGuard-site-to-site.md
Last active May 3, 2024 21:19
Accessing a subnet that is behind a WireGuard client using a site-to-site setup

WireGuard Site-to-Site

Accessing a subnet that is behind a WireGuard client using a site-to-site setup

Problem Summary

We want to access a local subnet remotely, but it is behind a NAT firewall and we can't setup port forwarding. Outgoing connections work, but all incoming connections get DROPPED by the ISP's routing policy.

Solution Summary

@rudolfovich
rudolfovich / csvfile.h
Last active September 21, 2023 08:50
CSV file generator
#pragma once
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
class csvfile;
inline static csvfile& endrow(csvfile& file);
inline static csvfile& flush(csvfile& file);
@QuantumGhost
QuantumGhost / example.puml
Last active March 23, 2024 22:39
A simple template for PlantUML to draw ER diagram.The basic idea comes from http://plantuml.sourceforge.net/qa/?qa=331/database-modeling
@startuml
' uncomment the line below if you're using computer with a retina display
' skinparam dpi 300
!define Table(name,desc) class name as "desc" << (T,#FFAAAA) >>
' we use bold for primary key
' green color for unique
' and underscore for not_null
!define primary_key(x) <b>x</b>
!define unique(x) <color:green>x</color>
!define not_null(x) <u>x</u>
@petrklus
petrklus / rgb_to_kelvin.py
Last active April 10, 2024 11:20
Kelvin to RGB in python
"""
Based on: http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code/
Comments resceived: https://gist.github.com/petrklus/b1f427accdf7438606a6
Original pseudo code:
Set Temperature = Temperature \ 100
Calculate Red:
If Temperature <= 66 Then
@hofmannsven
hofmannsven / README.md
Last active May 3, 2024 15:30
Git CLI Cheatsheet
@gabro
gabro / git-working-history
Last active March 27, 2023 09:47
Github-like working directory history
#!/bin/bash
FILES=`git ls-tree --name-only HEAD .`
MAXLEN=0
IFS=$(echo -en "\n\b")
for f in $FILES; do
if [ ${#f} -gt $MAXLEN ]; then
MAXLEN=${#f}
fi
done