Skip to content

Instantly share code, notes, and snippets.

View mkg20001's full-sized avatar
🌟
rinse and repeat, rise and shine

Maciej Krüger mkg20001

🌟
rinse and repeat, rise and shine
View GitHub Profile
#!/usr/bin/env bash
# enable debug. I don't care
set -xv
echo_yellow() {
# $1: text to echo
echo -e "\033[0;33m${1}\033[0m"
}
@bitonic
bitonic / configuration.nix
Last active May 2, 2024 23:24
NixOS configuration for a remote ZFS server on Hetzner
# Full NixOS configuration for a ZFS server with full disk encryption hosted on Hetzner.
# See <https://mazzo.li/posts/hetzner-zfs.html> for more information.
{ config, pkgs, ... }:
let
# Deployment-specific parameters -- you need to fill these in where the ... are
hostName = "...";
publicKey = "...";
# From `ls -lh /dev/disk/by-id`
// Parametric OpenSCAD design for a laptop stand.
// Laptop dimensions.
lwid = 304.1;
lhei = 212.4;
ldep = 15;
// Stand long dimensions.
slen = 200;
sswid = 60;
@mkg20001
mkg20001 / README.md
Created April 8, 2019 12:13
Tiny htop header for you terminal

htop.js

Tiny htop for your terminal

Simply drop this into your $HOME folder and add the following to your .bashrc:

node "$HOME/.htop.js"
@mkg20001
mkg20001 / generate-nginx-cloudflare-allow.sh
Last active April 5, 2024 07:41
A script to generate a config to allow or additionally allow cloudflare addresses for a specific domain
#!/bin/bash
set -e
cf_ips() {
echo "# https://www.cloudflare.com/ips"
for type in v4 v6; do
echo "# IP$type"
curl -sL "https://www.cloudflare.com/ips-$type/" | sed "s|^|allow |g" | sed "s|\$|;|g"
@mkg20001
mkg20001 / cert-cleanup.sh
Last active July 8, 2018 10:14
A script useful for cleaning up an old certificate archive. Removes orphan keys, ca certs and expired certs.
#!/bin/bash
# A script useful for cleaning up an old certificate archive. Removes orphan keys, ca certs and expired certs.
dir="$(readlink -f $1)"
CLEANUP=false # Enable this AFTER YOU CHECKED IT WORKS! (make backups)
[ -z "$dir" ] && exit 2
cd "$dir"
@TylerLeonhardt
TylerLeonhardt / TweetScript.psm1
Last active July 17, 2018 19:37
Importing Scripts from Tweets! #280characters
# Importing Scripts directly from Tweets! #280characters
#
# NOTE: This should not be used for any production environment. Or any environment for that matter. Use https://PowerShellGallery.com
#
#
####################################
# Example #
####################################
#
#
/*
* This tool will decrypt files encrypted by the Magniber ransomware with
* AES128 ( CBC mode ) algorithm.
*
* RE and report by MalwareBytes ( @hasherezade )
*
* https://blog.malwarebytes.com/threat-analysis/2017/10/magniber-ransomware-exclusively-for-south-koreans/
*
* Decryptor written by Simone 'evilsocket' Margaritelli
*
@mkg20001
mkg20001 / steam-appmanifest-parser.js
Last active August 24, 2017 13:21
Steam Appmanifest Parser
const fs = require("fs")
module.exports = AppManifestParser
function isNumeric(n) {
return !isNaN(parseFloat(n)) && isFinite(n);
}
function recInt(obj) { //replace numeric strings with integers
for (var p in obj)
if (typeof obj[p] == "object") obj[p] = recInt(obj[p]);