Skip to content

Instantly share code, notes, and snippets.

View blissini's full-sized avatar

Philipp Metzler blissini

View GitHub Profile
@m1cr0man
m1cr0man / flake.nix
Last active October 5, 2024 13:18
The simplest Nix Flake for nixos-rebuild
# This can be built with nixos-rebuild --flake .#myhost build
{
description = "the simplest flake for nixos-rebuild";
inputs = {
nixpkgs = {
# Using the nixos-unstable branch specifically, which is the
# closest you can get to following the equivalent channel with flakes.
url = "github:NixOS/nixpkgs/nixos-unstable";
};
[Unit]
Description=sshuttle service
After=network.target
[Service]
User=sshuttle
Restart=always
Type=forking
WorkingDirectory=/home/sshuttle
ExecStart=/home/sshuttle/sshuttle.sh start
@rylev
rylev / learn.md
Created March 5, 2019 10:50
How to Learn Rust

Learning Rust

The following is a list of resources for learning Rust as well as tips and tricks for learning the language faster.

Warning

Rust is not C or C++ so the way your accustomed to do things in those languages might not work in Rust. The best way to learn Rust is to embrace its best practices and see where that takes you.

The generally recommended path is to start by reading the books, and doing small coding exercises until the rules around borrow checking become intuitive. Once this happens, then you can expand to more real world projects. If you find yourself struggling hard with the borrow checker, seek help. It very well could be that you're trying to solve your problem in a way that goes against how Rust wants you to work.

@bradfa
bradfa / .restic.excludes
Last active December 22, 2021 18:21
Restic Notes
# Exclude poky default build dir
git/poky/build
# Exclude our sstate, downloads, and build output dirs
mr-oe-*/sstate-cache
mr-oe-*/downloads
mr-oe-*/*-oe-build/tmp-*
git/poky-wrap/titan
git/poky-wrap/downloads
git/poky-wrap/sstate-cache
# Exclude virt-manager and downloads dirs
@christiansteier
christiansteier / docker_traefik_portainer_letsencrypt.sh
Last active January 2, 2023 02:50
Simple bash script to install docker, traefik, portainer and ctop. Compatible with: Debian stretch
#!/bin/bash
SCRIPTNAME=$(basename $0 .sh)
EXIT_SUCCESS=0
EXIT_FAILURE=1
TZ=Europe/Berlin
NETWORKNAME=eth0
HOSTNAME=hostname
FQDN=domain.org
DOCKERCOMPOSE=1.21.2
@nitrag
nitrag / check_mk_agent-ubuntu-install.sh
Created March 6, 2018 03:04
Setup check_mk_agent via systemd on Ubuntu 16.04 (OMD, Check_MK)
# How to install Check MK Agent on ubuntu 16.04
# Install check_mk_agent:
# - sudo apt-get install check-mk-agent (will install older version)
# - On your Check_MK dashboard, go to "Monitoring Agents", click the link for "Check_MK Agent for Linux", save the raw text
# on your server:
sudo vi /usr/bin/check_mk_agent
# paste Check_MK dashboard > Monitoring Agents > Check_MK Agent for Linux
@vancluever
vancluever / genselfsignedcrt.sh
Created February 7, 2018 21:42
OpenSSL self-signed cert one-liner
openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 -keyout server.key -out server.crt
@KeithYeh
KeithYeh / Self-Signed SSL with SAN.md
Created October 14, 2017 13:12
Create self-signed SSL certificate with SubjectAltName(SAN)

How to create a self-signed SSL Certificate with SubjectAltName(SAN)

After Chrome 58, self-signed certificate without SAN is not valid anymore.

Step 1: Generate a Private Key

openssl genrsa -des3 -out example.com.key 2048

Step 2: Generate a CSR (Certificate Signing Request)

@dicksonkv
dicksonkv / ismyipbad.py
Created June 1, 2017 08:10
Python Script to Check RBL
import sys
# Loading dns module.
try:
import dns.resolver
resolver = dns.resolver.Resolver()
resolver.timeout = 0.10
resolver.lifetime = 0.10
except:
@miketheman
miketheman / Makefile
Created September 1, 2016 19:54
Django + docker-compose Makefile
CURRENT_DIRECTORY := $(shell pwd)
TESTSCOPE = apps
TESTFLAGS = --with-timer --timer-top-n 10 --keepdb
help:
@echo "Docker Compose Help"
@echo "-----------------------"
@echo ""
@echo "Run tests to ensure current state is good:"