Skip to content

Instantly share code, notes, and snippets.

@chenxiaolong
chenxiaolong / example.yaml
Created July 19, 2023 00:53
Custom Ansible module to manage the entire VyOS config
---
- hosts: vyos
vars:
# This would ideally go in the host vars.
vyos_config:
# ...
# The structure is identical to what `show configuration json pretty` in
# operational mode produces. For the vast majority of VyOS commands, the
# command <-> JSON translation is 1:1. For example, the command:
#
#!/usr/bin/env python3
import argparse
import os
import struct
PAGE_SIZE = 4096
@chenxiaolong
chenxiaolong / 0001-rpm-Add-support-for-building-an-akmods-package.patch
Created May 13, 2020 02:08
[zfs-0.8.4] Update rpm packaging to build akmods package
From aa9c17e52a694fc3fa7d31aa232045ba61b47cb5 Mon Sep 17 00:00:00 2001
From: Andrew Gunnerson <[email protected]>
Date: Tue, 12 May 2020 22:05:28 -0400
Subject: [PATCH] rpm: Add support for building an akmods package
Signed-off-by: Andrew Gunnerson <[email protected]>
---
config/zfs-build.m4 | 7 ++++---
rpm/generic/zfs-kmod.spec.in | 28 ++++++++++++++++++++++++----
2 files changed, 28 insertions(+), 7 deletions(-)

Building Fedora RPMs that use pesign

This guide describes how to build RPMs that use pesign. Pesign is used for signing PE/COFF EFI executables so that they can be used with UEFI secure boot. Enrolling DB or MOK keys and signing kernel modules is beyond the scope of this guide.

Preparation

  1. Install pesign.

    sudo dnf install pesign
@chenxiaolong
chenxiaolong / DellXPS15_9560_AHCI_RAID.md
Created November 27, 2017 01:33
Switching between AHCI and RAID on the Dell XPS 15 (9560)

Switching between AHCI and RAID on the Dell XPS 15 (9560)

This guide likely applies to other models and, potentially, even laptops from other OEMs that have NVME drives. However, I've only tested this on my Dell XPS 15 (9560) with the OEM Windows installation from the Signature Edition model.

Switching from RAID to AHCI

Switching from RAID to AHCI is significantly simpler than switching from AHCI to RAID. All that's needed is a successful boot to Safe Mode.

  1. To set the default boot mode to Safe Mode, use msconfig.exe or open an admin cmd/PowerShell window and run: