Skip to content

Instantly share code, notes, and snippets.

View george-andrei's full-sized avatar

George Andrei george-andrei

View GitHub Profile
@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
@MaxXor
MaxXor / btrfs-guide.md
Last active May 2, 2024 20:08
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