Skip to content

Instantly share code, notes, and snippets.

View george-andrei's full-sized avatar

George Andrei george-andrei

View GitHub Profile
@timothyham
timothyham / ipv6guide.md
Last active July 23, 2024 07:42
A Short IPv6 Guide for Home IPv4 Admins

A Short IPv6 Guide for Home IPv4 Admins

This guide is for homelab admins who understand IPv4s well but find setting up IPv6 hard or annoying because things work differently. In some ways, managing an IPv6 network can be simpler than IPv4, one just needs to learn some new concepts and discard some old ones.

Let’s begin.

First of all, there are some concepts that one must unlearn from ipv4:

Concept 1

@hippotized
hippotized / ext4_to_btrfs
Created October 23, 2022 21:42 — forked from pakyrs/ext4_to_btrfs
Convert root ext4 to btrfs including subvolumes and snapper
# on your ext4 distro
sudo su
apt install btrfs-progs
shutdown now
# switch to a linux live environment
sudo su
fsck -f /dev/vda3
# BTRFS convert
@ntrepid8
ntrepid8 / ubuntu-2204-luks-btrfs.md
Last active December 17, 2023 08:26
Ubuntu 22.04 w/luks+btrfs
@mklement0
mklement0 / Out-HostColored.ps1
Last active July 3, 2024 06:19
PowerShell function that colors portions of the default host output that match given patterns.
<#
Prerequisites: PowerShell version 2 or above.
License: MIT
Author: Michael Klement <mklement0@gmail.com>
DOWNLOAD, from PowerShell version 3 or above:
irm https://gist.github.com/mklement0/243ea8297e7db0e1c03a67ce4b1e765d/raw/Out-HostColored.ps1 | iex
@MaxXor
MaxXor / btrfs-guide.md
Last active July 19, 2024 11:07
Btrfs guide to set up an LUKS-encrypted btrfs raid volume with included maintenance & recovery guide

Encrypted Btrfs storage setup and maintenance guide

Initial setup with LUKS/dm-crypt

This exemplary initial setup uses two devices /dev/sdb and /dev/sdc but can be applied to any amount of devices by following the steps with additional devices.

Create keyfile:

dd bs=64 count=1 if=/dev/urandom of=/etc/cryptkey iflag=fullblock
chmod 600 /etc/cryptkey

Credit: Mark Kraus
Website: https://get-powershellblog.blogspot.com

Collection Type Guidence

When to use what

  • Use Arrays if you know the element types and have a fixed length and/or known-up-front collection size that will not change.
  • Use ArrayList if you have an unkown collection size with either unknown or mixed type elements.
  • Use a Generic List when know the type of the elements but not the size of the collection.
  • Use a HashTable if you are going to do key based lookups on a collection and don't know the object type of the elements.
  • Use a Dictionary<TKey, TValue> you are going to do key based lookups on a collection and you know the type of the elements.
  • Use a HashSet when you know the type of elements and just want unique values and quick lookups and assignmnets.
@eonarheim
eonarheim / AdminRestApi.ps1
Last active August 12, 2022 21:08
PowerShell DSC Configuration for the new Microsoft IIS.Administration Rest API
configuration AdminRestAp {
Import-DscResource -ModuleName xPSDesiredStateConfiguration
Import-DscResource -ModuleName xNetworking
Node "webserver" {
<#
Install windows features
#>
WindowsFeature InstallIIS {
@pklaus
pklaus / plotSmart.py
Last active February 28, 2024 01:46
S.M.A.R.T. to DB – A Python tool to store your HDD's SMART values in an SQLite database.
#!/usr/bin/env python
# -*- encoding: UTF8 -*-
""" read out S.M.A.R.T. values out of the database and plot them using matplotlib
<http://matplotlib.sourceforge.net/examples/pylab_examples/anscombe.html>
"""
from pylab import *
from os import geteuid
@sontek
sontek / snowjob.sh
Last active April 5, 2024 06:51
Make your terminal snow
#!/bin/bash
LINES=$(tput lines)
COLUMNS=$(tput cols)
declare -A snowflakes
declare -A lastflakes
clear