Skip to content

Instantly share code, notes, and snippets.

View LudovicoPiero's full-sized avatar
🌙
Clinically Insane.

Ludovico LudovicoPiero

🌙
Clinically Insane.
View GitHub Profile
@mfenniak
mfenniak / immich.nix
Last active May 4, 2024 12:40
NixOS configuration for Immich, based upon upstream docker-compose.yml
{ config, ... }:
let
immichHost = "immich.example.com"; # TODO: put your immich domain name here
immichRoot = "/tank/immich"; # TODO: Tweak these to your desired storage locations
immichPhotos = "${immichRoot}/photos";
immichAppdataRoot = "${immichRoot}/appdata";
immichVersion = "release";
immichExternalVolume1 = "/tank/BackupData/Google Photos/someone@example.com"; # TODO: if external volumes are desired
@Cha14ka
Cha14ka / hsr_rolls.py
Last active September 10, 2023 09:16
#!/usr/bin/python
import re
import subprocess
hsr_process = subprocess.run(
'ps aux | grep "StarRail.exe"',
shell=True,
stdout=subprocess.PIPE
).stdout.decode().split('\n')[0]
@Cryptiiiic
Cryptiiiic / ios16_downgrading.txt
Created March 1, 2023 00:10
The unfortunate state of iOS downgrading
Unfortunately I have some bad news for downgrading.
Before I explain the bad news at the end of this post, I first need to introduce a background of iOS devices.
In iOS 16, Apple introduced a new firmware component known as Cryptex1. Technically, this is a "virtual" co-processor.
It's purpose is to allow Apple to push RSRs (Rapid Security Responses) which are separate from traditional iOS updates and can be installed much faster.
Like other firmwares, it also has a signing ticket locked to a cryptographic nonce (number-used-once).
We commonly refer to the Apple signing tickets as SHSH blobs.
Meaning the firmware can't be installed without a valid signing ticket as well as a matching nonce.
The "big two" components we deal with signing/nonces are AP and SEP. AP is basically the main device chip (Application Processor).
SEP is the security chip (Secure Enclave Processor).
With regards to APNonce, Apple conveniently gave us the com.apple.System.boot-nonce NVRAM property which we use to set the APNonce generator.
@Quelklef
Quelklef / nixos-install-with-opt-in-state.txt
Last active February 8, 2024 12:43
NixOS installation with opt-in state (darling erasure)
==================================
INSTALLING NIXOS WITH OPT-IN STATE
Based mostly on:
grahamc.com/blog/erase-your-darlings
gist.github.com/mx00s/ea2462a3fe6fdaa65692fe7ee824de3e
nixos.org/manual/nixos/stable/
@giuseppe998e
giuseppe998e / nixos-btrfs-tmpfs.md
Last active May 7, 2024 07:43
Install NixOS with BTRFS and IN-RAM root

Install NixOS with BTRFS and IN-RAM root

1. Format and partition the hard drive

  1. Create the GPT partition table
    • $ parted /dev/sdX mklabel gpt
  2. Create the UEFI FAT32 partition (which will be /dev/sdXY)
    • $ parted /dev/sdX mkpart esp fat32 1MiB 512MiB
    • $ parted /dev/sdX set 1 esp on
    • $ parted /dev/sdX set 1 boot on
  • $ mkfs.fat -F 32 -n UEFI /dev/sdXY
@fufexan
fufexan / cpp-dev-env-flake.nix
Last active April 17, 2024 12:52
C/C++ dev environment in Nix, using Clang
{
description = "C/C++ environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, utils, ... }@inputs:
utils.lib.eachDefaultSystem (
@Gavinok
Gavinok / init.el
Last active March 2, 2024 15:41
A minimal emacs configuration using evil mode and use-package
;;; Startup
;;; PACKAGE LIST
(setq package-archives
'(("melpa" . "https://melpa.org/packages/")
("elpa" . "https://elpa.gnu.org/packages/")))
;;; BOOTSTRAP USE-PACKAGE
(package-initialize)
(setq use-package-always-ensure t)
(unless (package-installed-p 'use-package)
@rtkay123
rtkay123 / Smart HTTP Git and CGIT on Nginx server with Auth on push
Last active May 1, 2024 11:57
Installing Git and Cgit to Debian NGINX server (with smart http and authentication on push)
# Just some notes on enabling smart http with nginx as well as authentication on push for repos
# install git, cgit and apache2-utils (for authentication)
apt install git cgit apache2-utils fcgiwrap
# create a git user
adduser git
su git
cd
mkdir .ssh && chmod 700 .ssh
touch .ssh/authorized_keys && chmod 600 .ssh/authorized_keys
@Bondrake
Bondrake / trim-generations.sh
Last active February 29, 2024 01:10
NixOS script to keep 10 generations or 7 days, whichever is more (configurable, profile is selectable)
#!/usr/bin/env bash
set -euo pipefail
## Defaults
keepGensDef=10; keepDaysDef=7
keepGens=$keepGensDef; keepDays=$keepDaysDef
## Usage
usage () {
printf "Usage:\n\t trim-generations.sh (defaults are: Keep-Gens=$keepGensDef Keep-Days=$keepDaysDef Profile=user)\n\n"