Skip to content

Instantly share code, notes, and snippets.

@p7cq
p7cq / Arch_Linux_Root_On_ZFS.md
Last active Oct 16, 2020
Install Arch Linux with Root on ZFS
View Arch_Linux_Root_On_ZFS.md

Arch Linux Root on ZFS

Installation steps for running Arch Linux with root on ZFS using UEFI and systemd-boot. All steps are run as root.

In live environment

  • Set a bigger font if needed:
setfont latarcyrheb-sun32
@p7cq
p7cq / Arch_Linux_Root_on_Btrfs.md
Last active Oct 10, 2020
Install Arch Linux with Root on Btrfs
View Arch_Linux_Root_on_Btrfs.md

Arch Linux Root on Btrfs

Prepare disks

Keeping about 15% unallocated space on both disks.

sgdisk --zap-all /dev/disk/by-id/ata-CT240BX500SSD1_A
sgdisk -n1:0:+550M -t1:ef00 /dev/disk/by-id/ata-CT240BX500SSD1_A
sgdisk -n2:0:+190G -t2:8300 /dev/disk/by-id/ata-CT240BX500SSD1_A
@p7cq
p7cq / vm1-start.sh
Created Sep 24, 2020
Dynamic CPU isolation in QEMU/KVM
View vm1-start.sh
#!/usr/bin/env bash
#
# QEMU/KVM: dynamic CPU isolation
#
# Derived from Thomas Lindroth script; see
# https://www.redhat.com/archives/vfio-users/2016-September/msg00072.html
# and
# https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF
# https://aur.archlinux.org/packages/cpuset-git/
@p7cq
p7cq / Arch_Linux_Root_on_LVM.md
Last active Jul 7, 2020
Install Arch Linux with Root on LVM
View Arch_Linux_Root_on_LVM.md

Arch Linux with Root on LVM

Arch Linux with root on LVM and systemd boot.

  • Set a bigger font (if using a 4K laptop display)
setfont latarcyrheb-sun32
  • To connect to the internet add the ESSID and passphrase
@p7cq
p7cq / slss
Created Apr 26, 2020
Steam locomotive screensaver
View slss
#!/bin/bash
echo
echo "to exit, press Ctrl-C and wait for the locomotive to pass"
echo
sleep 3
clear
trap "exit" INT
declare -a ca=( "-a" "-l" "-F" "-c" "-al" "-aF" "-ac" "-lF" "-lc" "-alF" "-alc" "-lFc" "-alFc")
@p7cq
p7cq / UTF-8-demo.txt
Created Apr 26, 2020
UTF-8 demo text file
View UTF-8-demo.txt
UTF-8 encoded sample plain-text file
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
Markus Kuhn [ˈmaʳkʊs kuːn] <http://www.cl.cam.ac.uk/~mgk25/> — 2002-07-25 CC BY
The ASCII compatible UTF-8 encoding used in this plain-text file
is defined in Unicode, ISO 10646-1, and RFC 2279.
Using Unicode/UTF-8, you can write in emails and source code things such as
@p7cq
p7cq / dwm-logout.md
Last active Apr 26, 2020
A logout script for dwm
View dwm-logout.md

A logout script for dwm

Configuration

Add lrfs in PATH and make it executable.

Modify config.h:

  • define a new function:
    static const char *lrfs[] = { "lrfs", NULL };
    
@p7cq
p7cq / Install_Arch_Linux_Dell_XPS_9570.md
Last active Apr 26, 2020
Install Arch Linux on Dell XPS 9570
View Install_Arch_Linux_Dell_XPS_9570.md

Install Arch Linux on Dell XPS 9570

This is my first attempt to install Arch Linux - either on bare metal or in a virtual environment. I spent a couple of hours trying to boot the image and get to the system for the actual installation. - Pressing enter on the boot entry Arch Linux archiso x86_64 UEFI CD always resulted in a black screen. After trying several boot parameters I decided to rewrite the USB key. After that I was able to boot, with no startup parameters needed.

Run all commands as the root user.

  • As the default Linux console font is very small on HiDPI displays I will use the largest font present in kbd package:
setfont latarcyrheb-sun32
@p7cq
p7cq / Fedora_Root_On_ZFS.md
Last active May 5, 2020
Fedora with Root on ZFS - installation notes
View Fedora_Root_On_ZFS.md

Fedora: Root on ZFS

  • Fedora: 28
  • ZFS on Linux: 0.7.9

A. Prepare source

  1. Download Fedora Workstation network installer image.
  2. Boot live media by adding inst.gpt at the end of the boot line and set up with:
@p7cq
p7cq / kvm-linux.json
Created Dec 22, 2015
Smart OS - Create a KVM-based VM
View kvm-linux.json
{
"brand": "kvm",
"vcpus": 2,
"alias": "s1node1.paulluaq.lan",
"hostname": "s1node1.paulluaq.lan",
"autoboot": false,
"ram": 4096,
"resolvers": ["192.168.1.102", "192.168.1.102"],
"disks": [
{
You can’t perform that action at this time.