Skip to content

Instantly share code, notes, and snippets.

View mstaack's full-sized avatar
🎯
Focusing

Max mstaack

🎯
Focusing
View GitHub Profile
@mstaack
mstaack / PVE-host-backup.md
Created April 17, 2025 18:07 — forked from mrpeardotnet/PVE-host-backup.md
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

Proxmox VE Installation on Hetzner Server via Rescue System

Follow these steps to install Proxmox VE on a Hetzner server via the Rescue System. The Rescue System is a Linux-based environment that can be booted into to perform system recovery tasks. We'll be using it to install Proxmox VE.

In order to complete the process, it is indeed necessary to first boot into the Rescue System and then connect to it via SSH. This will allow you to run the commands for installing Proxmox VE. Here are the steps:

Starting the Rescue System

  1. Log into the Hetzner Robot.
  2. Under "Main Functions; Server" select the desired server and then open the tab "Rescue".
@mstaack
mstaack / print-headers-401.go
Created May 13, 2024 07:47 — forked from GauthamBanasandra/print-headers-401.go
A simple HTTP server in Golang which just prints all the headers
package main
import (
"net/http"
"fmt"
"time"
)
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Printf("Request at %v\n", time.Now())
@mstaack
mstaack / wireguard
Created October 2, 2023 12:59 — forked from kbabioch/wireguard
LSBInitScript for Wireguard: This is a leightweight init script for Wireguard. While Wireguard itself requires only minimal overhead to setup and start, it still requires some script invocations (e.g. during boot).
#! /bin/bash
# Copyright (c) 2021 Karol Babioch <[email protected]>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@mstaack
mstaack / build_libvips.md
Created November 2, 2022 15:15 — forked from renexu/build_libvips.md
build latest libvips deb on ubuntu 18.04

These are the steps to build latest libvips (8.7.4) deb package on ubuntu 18.04

##1. install build scripts

# sudo apt install build-essential devscripts

##2. download vips source

@mstaack
mstaack / NovaServiceProvider.php
Created February 17, 2021 14:48 — forked from jbrooksuk/NovaServiceProvider.php
Using Nova::sortResourcesBy
<?php
namespace App\Providers;
use Laravel\Nova\Nova;
use Laravel\Nova\Cards\Help;
use Illuminate\Support\Facades\Gate;
use Laravel\Nova\NovaApplicationServiceProvider;
class NovaServiceProvider extends NovaApplicationServiceProvider
@mstaack
mstaack / proxy.php
Created January 25, 2021 22:13
react-proxy
$loop = React\EventLoop\Factory::create();
$server = new React\Http\Server($loop, function (Psr\Http\Message\ServerRequestInterface $request) use ($loop) {
$read = new React\Stream\ReadableResourceStream(fopen('source url', 'rb'), $loop);
$write = new WritableResourceStream(fopen('php://stdout', 'wb+'), $loop);
$read->pipe($write);
// return streamed response?!
});
@mstaack
mstaack / install.sh
Created October 12, 2020 11:21 — forked from yuvadm/install.sh
Arch Linux installation on Lenovo ThinkPad X200s
# Arch Linux installation procedure on a Lenovo ThinkPad X200s
# BIOS boot (no UEFI), SSD + LVM + LUKS + TRIM + discards
# Randomize (or zero) drive contents
dd if=/dev/urandom of=/dev/sda
# Create GPT and partitions
# Use gdisk to ensure proper partition alignment
gdisk /dev/sda
# 100MB boot partition on /dev/sda1 type 8300
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include "USBHost_t36.h"
#include "LoRa_E32.h"
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 32 // OLED display height, in pixels
#define HWSERIAL Serial1
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class FixNovaTableForMongo extends Migration
{
/**
* Run the migrations.