diff options
author | Prefetch | 2019-06-08 20:01:43 +0000 |
---|---|---|
committer | Prefetch | 2019-06-08 20:01:43 +0000 |
commit | fe4bd53f01c469ad62848fbc85b06185b9f1e653 (patch) | |
tree | 38d9731003cf2d98ac4000eeff86fc55a17ec093 |
Create repository
-rw-r--r-- | config.toml | 22 | ||||
-rw-r--r-- | content/_index.md | 17 | ||||
-rw-r--r-- | content/articles/_index.md | 5 | ||||
-rw-r--r-- | content/sheats/_index.md | 9 | ||||
-rw-r--r-- | content/software/_index.md | 13 | ||||
-rw-r--r-- | content/software/recommended.md | 75 | ||||
-rw-r--r-- | content/software/winvm.sh | 144 | ||||
-rw-r--r-- | public/404.html | 10 | ||||
-rw-r--r-- | public/articles/index.html | 31 | ||||
-rw-r--r-- | public/index.html | 38 | ||||
-rw-r--r-- | public/main.css | 29 | ||||
-rw-r--r-- | public/robots.txt | 2 | ||||
-rw-r--r-- | public/sheats/index.html | 34 | ||||
-rw-r--r-- | public/sitemap.xml | 28 | ||||
-rw-r--r-- | public/software/index.html | 40 | ||||
-rw-r--r-- | public/software/recommended/index.html | 107 | ||||
-rw-r--r-- | public/software/winvm.sh | 144 | ||||
-rw-r--r-- | static/main.css | 29 | ||||
-rw-r--r-- | templates/index.html | 22 | ||||
-rw-r--r-- | templates/page.html | 8 | ||||
-rw-r--r-- | templates/section.html | 7 |
21 files changed, 814 insertions, 0 deletions
diff --git a/config.toml b/config.toml new file mode 100644 index 0000000..3c8d25c --- /dev/null +++ b/config.toml @@ -0,0 +1,22 @@ +# The URL the site will be built for +base_url = "https://prefet.ch" + +title = "Prefetch" + +# Whether to automatically compile all Sass files in the sass directory +compile_sass = false + +# Whether to do syntax highlighting +# Theme can be customised by setting the `highlight_theme` variable to a theme supported by Zola +highlight_code = true + +# Whether to build a search index to be used later on by a JavaScript library +build_search_index = false + +# Put all your custom variables here +[extra] +sections = [ + { url = "/articles/", name = "Articles " }, + { url = "/software/", name = "Software" }, + { url = "/sheats/", name = "Sheats" }, +] diff --git a/content/_index.md b/content/_index.md new file mode 100644 index 0000000..15d936d --- /dev/null +++ b/content/_index.md @@ -0,0 +1,17 @@ ++++ ++++ + +Hello, and welcome to my website! +This is where I gather any of my work +that I want to share with the rest of the world. +Go ahead and explore. + +I aim to keep this website forever JavaScript-free, +and to maintain my A+ score for +[TLS quality](https://www.ssllabs.com/ssltest/analyze.html?d=prefet.ch) and +[HTTP security headers](https://securityheaders.com/?q=prefet.ch&followRedirects=on). + +This server is hosted by [Scaleway](https://scaleway.com), +with [Gandi](https://gandi.net) as the domain registrar +and [Let's Encrypt](https://letsencrypt.org) providing TLS. +I've had a solid experience with all of these, and can heartily recommend them. diff --git a/content/articles/_index.md b/content/articles/_index.md new file mode 100644 index 0000000..1b37a22 --- /dev/null +++ b/content/articles/_index.md @@ -0,0 +1,5 @@ ++++ +title = "Articles" ++++ + +Coming soon-ish! diff --git a/content/sheats/_index.md b/content/sheats/_index.md new file mode 100644 index 0000000..55b4661 --- /dev/null +++ b/content/sheats/_index.md @@ -0,0 +1,9 @@ ++++ +title = "Sheats" ++++ + +"Sheat" is an ugly contraction of "cheat sheet". +Here I will post heavily condensed references for topics +like mathematics or languages. + +For now, though: "Coming soon-ish!" diff --git a/content/software/_index.md b/content/software/_index.md new file mode 100644 index 0000000..c244928 --- /dev/null +++ b/content/software/_index.md @@ -0,0 +1,13 @@ ++++ +title = "Software" ++++ + +Software made by me: +* [winvm.sh](winvm.sh): a QEMU-launching shell script +I used to emulate Windows for gaming. Since +[Mesa](https://www.mesa3d.org/) has matured so much and +[Proton](https://github.com/ValveSoftware/Proton/) +is in great shape, I won't update it anymore. +* More coming soon! + +Apart from that, here's a [list](/software/recommended) of software I recommend. diff --git a/content/software/recommended.md b/content/software/recommended.md new file mode 100644 index 0000000..3adcc25 --- /dev/null +++ b/content/software/recommended.md @@ -0,0 +1,75 @@ ++++ +title = "Recommended software" ++++ + +* [Arch Linux](https://www.archlinux.org/), + the no-nonsense Linux distribution. It's not perfect, + but it has the best reward-to-effort ratio for me. + Mainly its spectacular wealth of available packages + (11000 main + 53000 AUR!) make it the king. +* [Alpine Linux](https://alpinelinux.org/), + the featherlight distribution powering this server. +* [Void Linux](https://voidlinux.org/), + another nice lightweight distribution. It has + a great package management system with good + support for both binary packages and + [Gentoo](https://gentoo.org/)-style + customizable source builds. +* [i3](https://i3wm.org/), a mature, lightweight, + responsive tiling window manager without all the fuss. + I'll move to its successor-in-progress + [Sway](https://swaywm.org/) as soon as I find it mature enough. +* [Neovim](https://neovim.io/), which I use instead of its + venerable ancestor [Vim](https://www.vim.org/) because + it's faster, cleaner, and more future-facing + ([source](https://geoff.greer.fm/2015/01/15/why-neovim-is-better-than-vim/)). + With plugins, of course: + + [vim-plug](https://github.com/junegunn/vim-plug) + for simple and effective plugin management. + + [terminus](https://github.com/wincent/terminus) + to noticeably improve integration with the window manager. + + [onedark.vim](https://github.com/joshdick/onedark.vim), + because it looks great and is easy on the eyes. + + [lightline.vim](https://github.com/itchyny/lightline.vim) + for no real reason. Just eye candy I guess. + + [vim-polyglot](https://github.com/sheerun/vim-polyglot), + because its syntax definitions are much better. + + [vim-sneak](https://github.com/justinmk/vim-sneak) + to make movement less of a hassle. +* [Alacritty](https://github.com/jwilm/alacritty) as terminal emulator, + for its speed, minimalism, ease to configure, and native Wayland support. + I used to use [st](https://st.suckless.org/), + but it was too annoying to reconfigure. +* [imv](https://github.com/eXeC64/imv), + a command-line image viewer that I've found to be + much simpler and snappier than its more popular cousin + [feh](https://feh.finalrewind.org/). +* [zathura](https://git.pwmt.org/pwmt/zathura), + a fantastic modular viewer for PDFs and similar formats. + It remembers your position in a document after closing or reloading, + which is great when using LaTeX, and the main reason + I prefer it over [MuPDF](https://mupdf.com/). +* [mpv](https://mpv.io/), a great terminal-friendly media player. + If you have [youtube-dl](https://youtube-dl.org/) installed + you can watch videos you would otherwise need a web browser for. +* [nginx](https://nginx.org/), + the most popular HTTP server in the world. + And for good reason: it's lightweight, fast, secure, + flexible and straightforward to configure. +* [Zola](https://www.getzola.org/) to generate static webpages, + including the one you're reading right now. +* [QEMU](https://www.qemu.org/), + the Swiss army knife of emulation, and a damn fast one at that, + albeit with absolutely terrible documentation. + My old Windows launch script is [here](../winvm.sh). +* The [musl](https://www.musl-libc.org/) C standard library, + the only one that remembers it's supposed to stick to the + official specification rather than pursuing every crazy idea. +* [BusyBox](https://busybox.net/) bundles the + most important Unix tools into one portable ELF. +* [s6](https://skarnet.org/software/s6/), + a nice Unix service manager and init system. + I used it in my now long-abandoned + [LFS](http://linuxfromscratch.org/lfs/index.html) installation. +* [doas](https://man.openbsd.org/doas), + sudo for the 21st century, this time actually configurable. diff --git a/content/software/winvm.sh b/content/software/winvm.sh new file mode 100644 index 0000000..09283e0 --- /dev/null +++ b/content/software/winvm.sh @@ -0,0 +1,144 @@ +#!/bin/sh + + +# This is the script I used to use to launch QEMU, emulating +# Windows 8 with direct physical access to a powerful GPU +# and the Intel audio controller. This isn't a complete guide, +# more a collection of tips for any other brave people mad +# enough to try this. Look up "{VFIO,VGA,GPU,PCI} passthrough" +# if you want to get proper guidance for this. + +# This was working on QEMU 2.12, but note that I'm not updating it anymore. + + +# Create hugepage FS. Don't forget to actually populate it +# with available RAM using kernel boot arguments or sysctl. +# The user you run QEMU under (not root!) must be in the kvm group. +sudo mkdir /dev/hugepages +sudo mount -t hugetlbfs hugetlbfs /dev/hugepages +sudo chown root:kvm /dev/hugepages +sudo chmod 1777 /dev/hugepages # Necessary apparently + + +# The block devices you use for the VM are up to you; +# mine are at /dev/mapper/win{dows,data}. +# I recommend refreshing udev after you've created them: +udevadm trigger + + +### USEFUL KERNEL ARGUMENTS +# intel_iommu=on : VFIO won't work otherwise. I don't have an AMD CPU, +# but there should be a similar option for that. +# vfio-pci.ids=XXXX:YYYY,.. : Only available if VFIO is built into the kernel +# (requires custom kernel build). Reserves devices at boot. +# hugepages=X hugepagesz=Y : Create X hugepages at boot of size Y ("2M" or "1G"). +# nohugeiomap : This fixed something, but I can't remember what. +# intremap=no_x2apic_optout : Some UEFIs don't support the x2apic and disable it. +# This force-enables it. Had no negative consequences for me. +# pci=pcie_bus_peer2peer : This was the silver bullet for me, but YMMV. +# isolcpus=X-Y nohz_full=X-Y rcu_nocbs=X-Y : You MUST use CPU pinning if you add this. +# X-Y is an inclusive range of CPU cores to +# to reserve for the vCPUs. + + +### MACHINE OPTIONS +QEMU="-name debug-threads=on -enable-kvm -machine q35,accel=kvm,kernel_irqchip=on,vmport=off,mem-merge=off" +# -debug-threads=on : name the vCPU threads, useful for CPU pinning. +# -enable-kvm : enable KVM acceleration. +# -machine q35 : emulate the Q35 chipset, which is closer to a modern PC. +# accel=kvm : probably identical to -enable-kvm, but just in case. +# kernel_irqchip=on : emulate an IRQ chip in the kernel instead of in QEMU. +# vmport=off : don't emulate a VMWare I/O port. +# mem-merge=off : disable KSM, since there is only one VM. + +### CPU OPTIONS +QEMU="$QEMU -cpu host,kvm=off,hv_time,hv_relaxed,hv_spinlocks=0x1fff,hv_vpindex,hv_reset,hv_runtime,hv_crash,hv_vendor_id=NvidiaFix" +# -cpu host : use the host CPU instead of emulating one. +# kvm=off : don't declare self as KVM to the guest, as Windows doesn't care. +# hv_* : pretend to be Hyper-V, so Windows can optimize itself for running as a guest. +# https://www.reddit.com/r/VFIO/comments/479xnx/guests_with_nvidia_gpus_can_enable_hyperv/ +QEMU="$QEMU -smp sockets=1,cores=4,threads=1" +# -smp ... : processor layout to emulate. + +### RAM OPTIONS +QEMU="$QEMU -m 12G -mem-path /dev/hugepages -mem-prealloc" +# -m x : amount of guest RAM. +# -mem-path ... : allocate memory from this pool. Can be a file or "hugepages" (mount -t hugetlbfs). +# -mem-prealloc : allocate all memory from -mem-path at startup rather than on demand. + +### EMULATION OPTIONS +QEMU="$QEMU -vga none -nodefaults -rtc base=utc,clock=host,driftfix=none" +# -vga none : don't emulate a graphics card, since we're using a physical one. +# -nodefaults : don't emulate any of the default devices. +# -rtc base=utc : emulate an RTC starting at host's local time. +# clock=host : use the host's accurate clock for VM timekeeping. +# driftfix=none : don't fix Windows' clock drifting, as that involves injecting interrupts. +QEMU="$QEMU -drive if=pflash,format=raw,file=/usr/share/edk2-ovmf/OVMF_CODE.fd,readonly" +QEMU="$QEMU -drive if=pflash,format=raw,file=/usr/share/edk2-ovmf/OVMF_VARS.fd" +# These options enable using the OVMF virtual UEFI instead of SeaBIOS. +# The exact file locations might vary; this is for Gentoo. + +### PCI PASSTHROUGH +QEMU="$QEMU -device ioh3420,chassis=1,port=1,multifunction=on,bus=pcie.0,addr=1c.0,id=pcie.1" +# -device ioh3420 : emulate a PCIe I/O hub to attach the GPU to. +# chassis=1,port=1 : ? +# bus=pcie.0,addr=1c.0 : place it at 00:1c.0 on the guest. +# id=pcie.1 : refer to this device as "pcie.1" below. +QEMU="$QEMU -device vfio-pci,host=04:00.0,multifunction=on,bus=pcie.1,addr=00.0" +# GPU VGA controller. +# multifunction=on : this device isn't just a VGA controller. +# bus=pcie.1,addr=00.0 : attach it to the I/O hub as function 0. +QEMU="$QEMU -device vfio-pci,host=04:00.1,bus=pcie.1,addr=00.1" +# GPU HDMI audio controller. +# bus=pcie.1,addr=00.1 : attach it to the I/O hub as function 1. +QEMU="$QEMU -device vfio-pci,host=00:1b.0,bus=pcie.0,addr=1b.0" +# Intel HDA audio controller. +# bus=pcie.0,addr=1b.0 : place the device where Intel usually puts its HDA controller. + +#QEMU="$QEMU -device intel-iommu,intremap=on" +# Expose the IOMMU to the guest too. Probably useless in this case. + +### USB PASSTHROUGH +QEMU="$QEMU -usb" +# Enable USB support. +QEMU="$QEMU -device usb-host,vendorid=0xXXXX,productid=0xYYYY" +# If one of these can't be found, it's simply ignored. Use lsusb to find the IDs. + +### STORAGE OPTIONS +QEMU="$QEMU -drive if=ide,format=raw,discard=unmap,detect-zeroes=unmap,file=/dev/mapper/windows" +QEMU="$QEMU -drive if=ide,format=raw,discard=unmap,detect-zeroes=unmap,file=/dev/mapper/windata" +# if=ide : emulate an IDE (SATA) drive. NVMe is possible too, but more of a hassle. +# format=raw : talk directly to the drive. Take care: your guest GPT might end up inside a partition. +# discard=unmap,detect-zeroes=unmap : send discards to the physical device if the guest asks for it. +# file=x : backing physical block device. + +#QEMU="$QEMU -cdrom ~/Windows.iso" +# For recovery purposes. I strongly recommend keeping the ISO around. + +### NETWORK OPTIONS +QEMU="$QEMU -netdev user,id=usermode" +# -netdev user : emulate a user-mode NIC, which is more than fast enough in my experience. +# id=usermode : call the interface "usermode" +QEMU="$QEMU -device e1000,netdev=usermode,mac=88:88:88:88:88:88,bus=pcie.0,addr=19.0" +# -device e1000 : emulate a gigabit ethernet device. +# netdev=usermode : use "usermode" as the host backend. +# mac=x : set the MAC address as seen by the guest. +# bus=pcie.0,addr=19.0 : place the device where Intel usually puts its NIC. + + +# GERONIMO! +qemu-system-x86_64 $QEMU -daemonize +# -daemonize : fork once the VM has been initialized. + +QEMU_PID=`pidof qemu-system-x86_64` +echo -e "\033[37;1mQEMU started at PID $QEMU_PID, emulating Windows in Hyper-V mode.\033[m" + +sleep 2 # Make sure the VM threads have been spawned. + +# Move kernel processes to the housekeeping core (core 0 here). +#echo 00001 > /sys/bus/workqueue/devices/writeback/cpumask +#echo 00001 > /sys/bus/workqueue/devices/nvme-wq/cpumask + +# Do CPU pinning using "taskset -pc X Y" here, +# using /proc/$QEMU_PID/task/*/stat to find the thread name. +# Sorry, my old script for this was so horrible that I don't want to share it. diff --git a/public/404.html b/public/404.html new file mode 100644 index 0000000..f7d50b1 --- /dev/null +++ b/public/404.html @@ -0,0 +1,10 @@ +<!doctype html> +<html> + <head> + <title>File Not Found: 404.</title> + </head> + <body> + <h1>Oops!</h1> + <h2>File Not Found: 404.</h2> + </body> +</html> diff --git a/public/articles/index.html b/public/articles/index.html new file mode 100644 index 0000000..14a9679 --- /dev/null +++ b/public/articles/index.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title> + Prefetch | Articles +</title> +<link rel="stylesheet" href="/main.css"> +</head> +<body> +<div class="navbar"> +<div class="navitem navhome"><b><a href="/">PREFETCH</a></b></div> + +<div class="navitem"><a href="/articles/">Articles </a></div> + +<div class="navitem"><a href="/software/">Software</a></div> + +<div class="navitem"><a href="/sheats/">Sheats</a></div> + +</div> +<hr> +<div class="content"> + + <p>Coming soon-ish!</p> + + +</div> +<hr> +© "Prefetch". Licensed under <a href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a>. +</body> +</html> diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..183f674 --- /dev/null +++ b/public/index.html @@ -0,0 +1,38 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>Prefetch</title> +<link rel="stylesheet" href="/main.css"> +</head> +<body> +<div class="navbar"> +<div class="navitem navhome"><b><a href="/">PREFETCH</a></b></div> + +<div class="navitem"><a href="/articles/">Articles </a></div> + +<div class="navitem"><a href="/software/">Software</a></div> + +<div class="navitem"><a href="/sheats/">Sheats</a></div> + +</div> +<hr> +<div class="content"> +<p>Hello, and welcome to my website! +This is where I gather any of my work +that I want to share with the rest of the world. +Go ahead and explore.</p> +<p>I aim to keep this website forever JavaScript-free, +and to maintain my A+ score for +<a href="https://www.ssllabs.com/ssltest/analyze.html?d=prefet.ch">TLS quality</a> and +<a href="https://securityheaders.com/?q=prefet.ch&followRedirects=on">HTTP security headers</a>.</p> +<p>This server is hosted by <a href="https://scaleway.com">Scaleway</a>, +with <a href="https://gandi.net">Gandi</a> as the domain registrar +and <a href="https://letsencrypt.org">Let's Encrypt</a> providing TLS. +I've had a solid experience with all of these, and can heartily recommend them.</p> + +</div> +<hr> +© "Prefetch". Licensed under <a href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a>. +</body> +</html> diff --git a/public/main.css b/public/main.css new file mode 100644 index 0000000..0394165 --- /dev/null +++ b/public/main.css @@ -0,0 +1,29 @@ +body { + background-color:#282c34; + color:#abb2bf; + max-width:72ch; + text-align:justify; + margin:auto; + padding:2ch; +} + +a { + text-decoration:none; + color:#61afef; +} + +.content { min-height: calc(100vh - 20ch); } + +.navbar a:link { color:#abb2bf; } +.navbar a:visited { color:#abb2bf; } +.navbar a:focus { color:#61afef; } +.navbar a:hover { color:#61afef; } +.navbar a:active { color:#61afef; } +.navbar { + display:flex; + flex-direction:row; + font-size:24px; + text-align:right; +} +.navitem { flex:1; } +.navhome { text-align:left; } diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..bccda9c --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Sitemap: https://prefet.ch/sitemap.xml diff --git a/public/sheats/index.html b/public/sheats/index.html new file mode 100644 index 0000000..2c982f8 --- /dev/null +++ b/public/sheats/index.html @@ -0,0 +1,34 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title> + Prefetch | Sheats +</title> +<link rel="stylesheet" href="/main.css"> +</head> +<body> +<div class="navbar"> +<div class="navitem navhome"><b><a href="/">PREFETCH</a></b></div> + +<div class="navitem"><a href="/articles/">Articles </a></div> + +<div class="navitem"><a href="/software/">Software</a></div> + +<div class="navitem"><a href="/sheats/">Sheats</a></div> + +</div> +<hr> +<div class="content"> + + <p>"Sheat" is an ugly contraction of "cheat sheet". +Here I will post heavily condensed references for topics +like mathematics or languages.</p> +<p>For now, though: "Coming soon-ish!"</p> + + +</div> +<hr> +© "Prefetch". Licensed under <a href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a>. +</body> +</html> diff --git a/public/sitemap.xml b/public/sitemap.xml new file mode 100644 index 0000000..08bde71 --- /dev/null +++ b/public/sitemap.xml @@ -0,0 +1,28 @@ +<urlset xmlns="https://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"> + + <url> + <loc>https://prefet.ch/</loc> + + </url> + + <url> + <loc>https://prefet.ch/articles/</loc> + + </url> + + <url> + <loc>https://prefet.ch/sheats/</loc> + + </url> + + <url> + <loc>https://prefet.ch/software/</loc> + + </url> + + <url> + <loc>https://prefet.ch/software/recommended/</loc> + + </url> + +</urlset> diff --git a/public/software/index.html b/public/software/index.html new file mode 100644 index 0000000..af8c330 --- /dev/null +++ b/public/software/index.html @@ -0,0 +1,40 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title> + Prefetch | Software +</title> +<link rel="stylesheet" href="/main.css"> +</head> +<body> +<div class="navbar"> +<div class="navitem navhome"><b><a href="/">PREFETCH</a></b></div> + +<div class="navitem"><a href="/articles/">Articles </a></div> + +<div class="navitem"><a href="/software/">Software</a></div> + +<div class="navitem"><a href="/sheats/">Sheats</a></div> + +</div> +<hr> +<div class="content"> + + <p>Software made by me:</p> +<ul> +<li><a href="https://prefet.ch/software/winvm.sh">winvm.sh</a>: a QEMU-launching shell script +I used to emulate Windows for gaming. Since +<a href="https://www.mesa3d.org/">Mesa</a> has matured so much and +<a href="https://github.com/ValveSoftware/Proton/">Proton</a> +is in great shape, I won't update it anymore.</li> +<li>More coming soon!</li> +</ul> +<p>Apart from that, here's a <a href="/software/recommended">list</a> of software I recommend.</p> + + +</div> +<hr> +© "Prefetch". Licensed under <a href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a>. +</body> +</html> diff --git a/public/software/recommended/index.html b/public/software/recommended/index.html new file mode 100644 index 0000000..6e16413 --- /dev/null +++ b/public/software/recommended/index.html @@ -0,0 +1,107 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title> + Prefetch | Recommended software +</title> +<link rel="stylesheet" href="/main.css"> +</head> +<body> +<div class="navbar"> +<div class="navitem navhome"><b><a href="/">PREFETCH</a></b></div> + +<div class="navitem"><a href="/articles/">Articles </a></div> + +<div class="navitem"><a href="/software/">Software</a></div> + +<div class="navitem"><a href="/sheats/">Sheats</a></div> + +</div> +<hr> +<div class="content"> + + <center><h3> Recommended software </h3></center> + <ul> +<li><a href="https://www.archlinux.org/">Arch Linux</a>, +the no-nonsense Linux distribution. It's not perfect, +but it has the best reward-to-effort ratio for me. +Mainly its spectacular wealth of available packages +(11000 main + 53000 AUR!) make it the king.</li> +<li><a href="https://alpinelinux.org/">Alpine Linux</a>, +the featherlight distribution powering this server.</li> +<li><a href="https://voidlinux.org/">Void Linux</a>, +another nice lightweight distribution. It has +a great package management system with good +support for both binary packages and +<a href="https://gentoo.org/">Gentoo</a>-style +customizable source builds.</li> +<li><a href="https://i3wm.org/">i3</a>, a mature, lightweight, +responsive tiling window manager without all the fuss. +I'll move to its successor-in-progress +<a href="https://swaywm.org/">Sway</a> as soon as I find it mature enough.</li> +<li><a href="https://neovim.io/">Neovim</a>, which I use instead of its +venerable ancestor <a href="https://www.vim.org/">Vim</a> because +it's faster, cleaner, and more future-facing +(<a href="https://geoff.greer.fm/2015/01/15/why-neovim-is-better-than-vim/">source</a>). +With plugins, of course: +<ul> +<li><a href="https://github.com/junegunn/vim-plug">vim-plug</a> +for simple and effective plugin management.</li> +<li><a href="https://github.com/wincent/terminus">terminus</a> +to noticeably improve integration with the window manager.</li> +<li><a href="https://github.com/joshdick/onedark.vim">onedark.vim</a>, +because it looks great and is easy on the eyes.</li> +<li><a href="https://github.com/itchyny/lightline.vim">lightline.vim</a> +for no real reason. Just eye candy I guess.</li> +<li><a href="https://github.com/sheerun/vim-polyglot">vim-polyglot</a>, +because its syntax definitions are much better.</li> +<li><a href="https://github.com/justinmk/vim-sneak">vim-sneak</a> +to make movement less of a hassle.</li> +</ul> +</li> +<li><a href="https://github.com/jwilm/alacritty">Alacritty</a> as terminal emulator, +for its speed, minimalism, ease to configure, and native Wayland support. +I used to use <a href="https://st.suckless.org/">st</a>, +but it was too annoying to reconfigure.</li> +<li><a href="https://github.com/eXeC64/imv">imv</a>, +a command-line image viewer that I've found to be +much simpler and snappier than its more popular cousin +<a href="https://feh.finalrewind.org/">feh</a>.</li> +<li><a href="https://git.pwmt.org/pwmt/zathura">zathura</a>, +a fantastic modular viewer for PDFs and similar formats. +It remembers your position in a document after closing or reloading, +which is great when using LaTeX, and the main reason +I prefer it over <a href="https://mupdf.com/">MuPDF</a>.</li> +<li><a href="https://mpv.io/">mpv</a>, a great terminal-friendly media player. +If you have <a href="https://youtube-dl.org/">youtube-dl</a> installed +you can watch videos you would otherwise need a web browser for.</li> +<li><a href="https://nginx.org/">nginx</a>, +the most popular HTTP server in the world. +And for good reason: it's lightweight, fast, secure, +flexible and straightforward to configure.</li> +<li><a href="https://www.getzola.org/">Zola</a> to generate static webpages, +including the one you're reading right now.</li> +<li><a href="https://www.qemu.org/">QEMU</a>, +the Swiss army knife of emulation, and a damn fast one at that, +albeit with absolutely terrible documentation. +My old Windows launch script is <a href="../winvm.sh">here</a>.</li> +<li>The <a href="https://www.musl-libc.org/">musl</a> C standard library, +the only one that remembers it's supposed to stick to the +official specification rather than pursuing every crazy idea.</li> +<li><a href="https://busybox.net/">BusyBox</a> bundles the +most important Unix tools into one portable ELF.</li> +<li><a href="https://skarnet.org/software/s6/">s6</a>, +a nice Unix service manager and init system. +I used it in my now long-abandoned +<a href="http://linuxfromscratch.org/lfs/index.html">LFS</a> installation.</li> +<li><a href="https://man.openbsd.org/doas">doas</a>, +sudo for the 21st century, this time actually configurable.</li> +</ul> + + +</div> +<hr> +© "Prefetch". Licensed under <a href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a>. +</body> +</html> diff --git a/public/software/winvm.sh b/public/software/winvm.sh new file mode 100644 index 0000000..09283e0 --- /dev/null +++ b/public/software/winvm.sh @@ -0,0 +1,144 @@ +#!/bin/sh + + +# This is the script I used to use to launch QEMU, emulating +# Windows 8 with direct physical access to a powerful GPU +# and the Intel audio controller. This isn't a complete guide, +# more a collection of tips for any other brave people mad +# enough to try this. Look up "{VFIO,VGA,GPU,PCI} passthrough" +# if you want to get proper guidance for this. + +# This was working on QEMU 2.12, but note that I'm not updating it anymore. + + +# Create hugepage FS. Don't forget to actually populate it +# with available RAM using kernel boot arguments or sysctl. +# The user you run QEMU under (not root!) must be in the kvm group. +sudo mkdir /dev/hugepages +sudo mount -t hugetlbfs hugetlbfs /dev/hugepages +sudo chown root:kvm /dev/hugepages +sudo chmod 1777 /dev/hugepages # Necessary apparently + + +# The block devices you use for the VM are up to you; +# mine are at /dev/mapper/win{dows,data}. +# I recommend refreshing udev after you've created them: +udevadm trigger + + +### USEFUL KERNEL ARGUMENTS +# intel_iommu=on : VFIO won't work otherwise. I don't have an AMD CPU, +# but there should be a similar option for that. +# vfio-pci.ids=XXXX:YYYY,.. : Only available if VFIO is built into the kernel +# (requires custom kernel build). Reserves devices at boot. +# hugepages=X hugepagesz=Y : Create X hugepages at boot of size Y ("2M" or "1G"). +# nohugeiomap : This fixed something, but I can't remember what. +# intremap=no_x2apic_optout : Some UEFIs don't support the x2apic and disable it. +# This force-enables it. Had no negative consequences for me. +# pci=pcie_bus_peer2peer : This was the silver bullet for me, but YMMV. +# isolcpus=X-Y nohz_full=X-Y rcu_nocbs=X-Y : You MUST use CPU pinning if you add this. +# X-Y is an inclusive range of CPU cores to +# to reserve for the vCPUs. + + +### MACHINE OPTIONS +QEMU="-name debug-threads=on -enable-kvm -machine q35,accel=kvm,kernel_irqchip=on,vmport=off,mem-merge=off" +# -debug-threads=on : name the vCPU threads, useful for CPU pinning. +# -enable-kvm : enable KVM acceleration. +# -machine q35 : emulate the Q35 chipset, which is closer to a modern PC. +# accel=kvm : probably identical to -enable-kvm, but just in case. +# kernel_irqchip=on : emulate an IRQ chip in the kernel instead of in QEMU. +# vmport=off : don't emulate a VMWare I/O port. +# mem-merge=off : disable KSM, since there is only one VM. + +### CPU OPTIONS +QEMU="$QEMU -cpu host,kvm=off,hv_time,hv_relaxed,hv_spinlocks=0x1fff,hv_vpindex,hv_reset,hv_runtime,hv_crash,hv_vendor_id=NvidiaFix" +# -cpu host : use the host CPU instead of emulating one. +# kvm=off : don't declare self as KVM to the guest, as Windows doesn't care. +# hv_* : pretend to be Hyper-V, so Windows can optimize itself for running as a guest. +# https://www.reddit.com/r/VFIO/comments/479xnx/guests_with_nvidia_gpus_can_enable_hyperv/ +QEMU="$QEMU -smp sockets=1,cores=4,threads=1" +# -smp ... : processor layout to emulate. + +### RAM OPTIONS +QEMU="$QEMU -m 12G -mem-path /dev/hugepages -mem-prealloc" +# -m x : amount of guest RAM. +# -mem-path ... : allocate memory from this pool. Can be a file or "hugepages" (mount -t hugetlbfs). +# -mem-prealloc : allocate all memory from -mem-path at startup rather than on demand. + +### EMULATION OPTIONS +QEMU="$QEMU -vga none -nodefaults -rtc base=utc,clock=host,driftfix=none" +# -vga none : don't emulate a graphics card, since we're using a physical one. +# -nodefaults : don't emulate any of the default devices. +# -rtc base=utc : emulate an RTC starting at host's local time. +# clock=host : use the host's accurate clock for VM timekeeping. +# driftfix=none : don't fix Windows' clock drifting, as that involves injecting interrupts. +QEMU="$QEMU -drive if=pflash,format=raw,file=/usr/share/edk2-ovmf/OVMF_CODE.fd,readonly" +QEMU="$QEMU -drive if=pflash,format=raw,file=/usr/share/edk2-ovmf/OVMF_VARS.fd" +# These options enable using the OVMF virtual UEFI instead of SeaBIOS. |