Merge remote-tracking branch 'wiki/main'

This commit is contained in:
dtb 2023-09-11 23:05:23 -04:00
commit 891645e663
53 changed files with 1647 additions and 0 deletions

19
wiki/.build.yml Normal file
View File

@ -0,0 +1,19 @@
image: alpine/edge
oauth: pages.sr.ht/PAGES:RW
packages:
- hut
- m4
tasks:
- build: |
cd wiki
make
- package: |
cd wiki
tar cvz \
--exclude .git \
--exclude '*.m4' \
--exclude '*.mk' \
. >../site.tar.gz
ls -l ../site.tar.gz
- upload: |
hut pages publish -d be.murderu.us site.tar.gz

1
wiki/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/unix/index.html

24
wiki/LICENSE Normal file
View File

@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <http://unlicense.org/>

12
wiki/Makefile Normal file
View File

@ -0,0 +1,12 @@
RM = rm -f
TARGETS = game/index.html linux/index.html unix/index.html
all: $(TARGETS)
clean:
$(RM) $(TARGETS)
%/index.html: %/*.m4
$(MAKE) -C $* -f ../page.mk
.PHONY: all clean

8
wiki/css/stylesheet.css Normal file
View File

@ -0,0 +1,8 @@
a{ color: #ABCDEF; }
a:hover{ color: #FF0000; }
body{
background-color: #000;
color: #EFECFC;
}
h1, h2, h3{ font-style: italic; }
h1{ text-transform: uppercase; }

BIN
wiki/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

17
wiki/game/index.m4 Normal file
View File

@ -0,0 +1,17 @@
define(`_DESCRIPTION', `a loss cause')dnl
define(`_PAGE', `game')dnl
include(`../wiki.m4')dnl
_header(`Game')
_passage(`_link(`James Dunckley', `https://www.urbandictionary.com/define.php?term=the%20game')', `
<P>
A game, The sole object of which is to not remember that you are playing it. As soon as you remember that it exists, you have lost and must start again.
</P>')
<P>
Played in the halls of schools and on the walls of BBSes, the Game is an early cognitovirus that has drawn ire for its unwinnable nature;
nobody who knows of the Game has won, yet nobody who's won has ever known of the Game.
</P>
include(`../tail.m4')dnl

31
wiki/index.html Normal file
View File

@ -0,0 +1,31 @@
<!DOCTYPE html>
<HTML>
<HEAD>
<META CHARSET="US-ASCII" />
<META CONTENT="murderu.us wiki" NAME="description" />
<META CONTENT="noindex" NAME="googlebot" /> <!-- FUCK GOOGLE -->
<META CONTENT="interest-cohort=()" HTTP-EQUIV="Permissions-Policy" /> <!-- FUCK GOOGLE -->
<META CONTENT="width=device-width, initial-scale=1" NAME="viewport" />
<LINK HREF="https://be.murderu.us/" REL="canonical" />
<LINK HREF="css/stylesheet.css" REL="stylesheet" />
<TITLE>the murderu.us wiki</TITLE>
</HEAD>
<BODY>
<H1>be.<A HREF="https://murderu.us">murderu.us</A></H1>
<UL><B>
<LI><A HREF="linux/">Linux</A></LI>
<LI><A HREF="game/">the game</A></LI>
<LI><A HREF="unix/">UNIX</A></LI>
</B></UL>
<H2>Contributing</H2>
<UL>
<LI>All contributions are <STRONG>public domain</STRONG> and anyone may steal, pilfer, and otherwise plaigarize <EM>from</EM> this Wiki.</LI>
<LI>However, contributions <EM>to</EM> this Wiki must be original or properly quoted and cited from other sources.</LI>
<LI>Original research is <EM>encouraged</EM> and this Wiki serves as either a primary or secondary source when appropriate.</LI>
<LI>Articles are written with semantic markup in <A HREF="unix/#posix#m4(1)">m4</A> macros.</LI>
</UL>
<P>
The contents of this site are generated by the git repository at <A HREF="https://git.sr.ht/~trinity/wiki">https://git.sr.ht/~trinity/wiki</A>.
</P>
</BODY>
</HTML>

4
wiki/linux/a.out.m4 Normal file
View File

@ -0,0 +1,4 @@
_header(`a.out')
_bibliography(`
_bentr(`_link(`Re: [PATCH] x86: Remove a.out support', `https://lwn.net/ml/linux-kernel/202203161523.857B469@keescook/')')
')

14
wiki/linux/acpi.m4 Normal file
View File

@ -0,0 +1,14 @@
_header(`ACPI')
_bibliography(`
_bentr(`_ref(`/unix/#ACPI')')
')
<P>
logind (as part of SystemD), elogind, acpid, and many desktop environments can manage ACPI events automatically, and sometimes this is configured by default as part of a Linux software distribution.
</P>
_subheader(`acpid(8)')
_bibliography(`
_bentr(`_link(`acpid', `https://sourceforge.net/projects/acpid2/')')
')
<P>
_man(`acpid(8)') is a daemon that can automatically manage ACPI events on Linux.
</P>

95
wiki/linux/alpine.m4 Normal file
View File

@ -0,0 +1,95 @@
_header(`Alpine')
<P>
Alpine Linux is a small Linux _ref(`#distribution') based on musl libc.
Its main purpose is to serve as a server distribution, however many have found use for it as a desktop distribution.
</P>
_subheader(`apk(8)')
_bibliography(`
_bentr(`_link(`Alpine Package Keeper', `https://wiki.alpinelinux.org/wiki/Alpine_Package_Keeper') (Alpine Wiki)')
_bentr(`<A HREF="https://pkgs.alpinelinux.org/contents">Alpine repositories content search</A>')
')
_subsubheader(`Adding software')
_man(`apk-add(8)')
_subsubheader(`Repositories')
<P>
See _man(`apk-repositories(5)').
</P>
<P>
Most Internet repositories use the URL scheme of _code(`https://[_italic(`server')]/alpine/[_italic(`release branch')]/[_italic(`repository branch')]').
For example, the _italic(`main') repository branch on the _italic(`edge') release branch on the server _italic(`dl-cdn.alpinelinux.org') is _code(`http://dl-cdn.alpinelinux.org/alpine/edge/main').
A repositories file could look like the following:
</P>
<PRE>
http://dl-cdn.alpinelinux.org/alpine/edge/main
http://dl-cdn.alpinelinux.org/alpine/edge/community
http://dl-cdn.alpinelinux.org/alpine/edge/testing
</PRE>
<P>
Local directories like _file(`/media/cdrom/apks'), an example from the Alpine Wiki, are valid as well.
</P>
_subsubheader(`_code(`WARNING: Ignoring [_italic(`path')]: UNTRUSTED signature')')
_bibliography(`
_bentr(`_link(`ERROR: http://dl-4.alpinelinux.org/alpine/edge/testing: UNTRUSTED signature', `https://stackoverflow.com/questions/73374745/error-http-dl-4-alpinelinux-org-alpine-edge-testing-untrusted-signature')')
')
<P>
If you are absolutely sure what you're doing is fine, _command(`apk [_italic(`command')] _em(`--allow-untrusted')').
This ignores the error and allows the operation to proceed.
</P>
_subheader(`Always install manual pages')
<P>
Alpine doesn't include man pages in program packages to save on space, instead keeping them in _code(`[<I>package</I>]-doc') sibling packages.
To always install doc packages with program packages, _code(`apk add docs').
</P>
_subheader(`Bootstrapping')
<P>
See _ref(`#bootstrapping').
The Alpine setup scripts also exist to aid in the bootstrap process.
</P>
<P>
To bootstrap _man(`apk(8)') do the following:
</P>
<OL>
<LI>Copy _man(`apk-keys(5)') to the analogous location on the mounted volume.</LI>
<LI>Fill out _man(`apk-repositories(5)') on the mount.</LI>
<LI>Use _man(`apk-add(8)') to initialize the package database on the mount (_command(`apk --root [<I>mount</I>] add --initdb alpine-base')).</LI>
</OL>
<P>
Copy _man(`resolv.conf(5)') over (and bind _file(`/dev/'), _file(`/proc/'), and _file(`/sys/')) before _ref(`/unix/#posix#chroot(1)')ing.
</P>
<P>
In the chroot, make sure to install a kernel, which will put _ref(`#initramfs') creation in the _man(`apk(8)') build hooks and rebuild the initramfs whenever the kernel is upgraded.
</P>
_subsubheader(`Setup scripts')
_bibliography(`
_bentr(`_link(`Alpine setup scripts', `https://wiki.alpinelinux.org/wiki/Alpine_setup_scripts') (Alpine Wiki)')
')
_passage(`Eunakria on the Alpine Linux Discord server',
`<P><CODE>setup-alpine</CODE> is jank.</P>')
<P>
_program(`setup-hostname') validates a _man(`hostname(5)') before writing to the mounted volume.
</P>
<P>
_program(`setup-xorg-base') adds the packages _package_alpine(`xorg-server'), _package_alpine(`xf86-input-libinput'), _package_alpine(`eudev'), and _package_alpine(`mesa'), and then enables the _ref(`#initialization') services for udev.
</P>
_subheader(`postmarketOS')
<P>
postmarketOS is an Alpine-based Linux software distribution that makes configuring and using Linux easy on mobile devices.
</P>
<H5>Random MAC address generation on Wifi</H5>
<P>
By default, postmarketOS will generate a random software MAC address when connecting to a new WLAN network.
You can disable this by adding a NetworkManager rule.
In _code(`/etc/NetworkManager/conf.d/') you can make a file with any name that has the following:
</P>
<PRE>
[device]
wifi.scan-rand-mac-address=no
</PRE>
<P>
On a live system you can then _code(`rc-service networkmanager restart') to restart NetworkManager and have it load the new configuration.
</P>

72
wiki/linux/arch.m4 Normal file
View File

@ -0,0 +1,72 @@
_header(`Arch')
<P>
Arch is a Linux software distribution that uses the _man(`pacman(8)') package manager.
Arch performs little in the way of modification of upstream versions of packages and offers only the latest (or last noticed) revisions of programs in its repositories,
which has given it a reputation for instability compared to other Linux software distributions that bug-test programs before offering them to users in standard release channels (for example, _ref(`#debian')).
</P>
_subheader(`AUR')
<P>
You will need _package_arch(`base-devel').
</P>
_subheader(`Bootstrapping')
<P>
See _ref(`#bootstrapping').
Use _man(`pacstrap(8)') on Arch and _man(`basestrap(8)') on Artix.
</P>
<P>
Arch's base package is _package_arch(`base').
Additionally, a kernel such as _package_arch(`linux') or _package_arch(`linux-lts') will be necessary.
The Arch wiki says _package_arch(`linux-firmware') is necessary; it's not on many hardware configurations but it's recommended.
On Artix you also need to select the _ref(`#initialization') system: _package(`66'), _package(`dinit'), _package(`openrc'), _package(`runit'), or _package(`s6-base').
The Artix wiki says the initialization-specific _ref(`#login#logind') package is necessary; it's not but it's recommended.
</P>
<P>
On the bootstrapped system, after chrooting in, uncomment a local mirror in _file(`/etc/pacman.d/mirrorlist-arch').
Then configure _file(`/etc/pacman.conf') to use that mirror list.
</P>
_passage(`Config block conveyed to Leyla by an Arch package maintainer, shared to the Tebibyte Media Discord server 2021-06-04T1746+0500',
`
<PRE>
#
# ARCHLINUX
#
#[testing]
#Include = /etc/pacman.d/mirrorlist-arch
[extra]
Include = /etc/pacman.d/mirrorlist-arch
#[community-testing]
#Include = /etc/pacman.d/mirrorlist-arch
[community]
Include = /etc/pacman.d/mirrorlist-arch
#[multilib-testing]
#Include = /etc/pacman.d/mirrorlist-arch
#[multilib]
#Include = /etc/pacman.d/mirrorlist-arch
</PRE>
')
_subheader(`Artix')
_bibliography(`
_bentr(`<A HREF="https://artixlinux.org/">Artix Linux</A>')
_bentr(`<A HREF="https://en.wikipedia.org/wiki/Artix_Linux">Artix Linux</A> (Wikipedia)')
')
<P>
Artix is a Linux software distribution based on Arch that doesn't mandate SystemD as its initialization system.
</P>
_subheader(`makepkg(8)')
_bibliography(`
_bentr(`_link(`makepkg', `https://wiki.archlinux.org/title/Makepkg') (Arch Wiki)')
_bentr(`_link(`pacman', `https://gitlab.archlinux.org/pacman/pacman/')/_link(`scripts/makepkg.sh.in', `https://gitlab.archlinux.org/pacman/pacman/-/blob/master/scripts/makepkg.sh.in')')
')
<P>
_man(`makepkg(8)') is a _man(`bash(1)') script provided by _package_arch(`pacman') that provides an interface through which to manage _man(``PKGBUILD'(5)')s.
</P>

48
wiki/linux/audio.m4 Normal file
View File

@ -0,0 +1,48 @@
_header(`Audio')
<P>
Most audio servers recommend that they be run in userspace with user privileges, with PulseAudio going so far as to exiting when run as root without additional configuration.
The Alpine wiki currently recommends _man(`pipewire(1)'), with postmarketOS, which is based on Alpine, coming pre-configured with PipeWire.
PipeWire is relatively new and the typical audio server used is PulseAudio; _ref(`#debian') and many popular Debian-based distributions come pre-configured with PulseAudio.
</P>
_subheader(`ALSA')
_bibliography(`
_bentr(`<A HREF="https://wiki.alpinelinux.org/wiki/Main_Page/Adding_sound">Adding sound</A> (Alpine Linux Wiki)')
_bentr(`<A HREF="https://bbs.archlinux.org/viewtopic.php?id=256857">ALSA lib conf Evaluate error</A>')
_bentr(`<A HREF="https://dev.to/setevoy/linux-alsa-lib-pcmdmixc1108sndpcmdmixopen-unable-to-open-slave-38on">ALSA lib pcm_dmix.c:1108:(snd_pcm_dmix_open) unable to open slave</A>')
')
<P>
The Alpine wiki ("Adding sound") says to install _package_alpine(`alsa-conf'), _package_alpine(`alsa-lib'), and _package_alpine(`alsa-utils'),
add yourself to the _code(`audio') group, and then do some more configuration that I've never needed to do:
Use _man(`alsamixer(1)') to find a working sound card (press _code(`F6') from the first screen ALSAMixer presents)
and edit _code(`/usr/share/alsa/alsa.conf') and change _code(`defaults.ctl.card') and _code(`defaults.pcm.card') to the sound card that works.
</P>
<P>
The Alpine wiki doesn't mention this but you'll need to enable the _code(`alsa') OpenRC service and either start it or reboot.
I also installed _package_alpine(`gstreamer') but I don't know why.
</P>
<P>
ALSA is clunky, many people prefer to use a frontend such as Pipewire or PulseAudio that exposes its own interface while remaining compatible with ALSA.
</P>
_subheader(`OSS')
<P>
Deprecated, unfortunately.
</P>
_subheader(`PipeWire')
_bibliography(`
_bentr(`<A HREF="https://wiki.alpinelinux.org/wiki/PipeWire">PipeWire</A> (Alpine Linux Wiki)')
_bentr(`<A HREF="https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/home">PipeWire</A> (FreeDesktop Wiki)')
')
<P>
Provided by the _package_alpine(`pipewire') package on Alpine.
</P>
<PRE>
RTKit error: org.freedesktop.DBus.Error.ServiceUnknown
</PRE>
<P>
This means you need _program(`rtkit') installed and running through your initialization system.
</P>
_subheader(`PulseAudio')
<P>
On Alpine you'll need the _package_alpine(`pulseaudio'), _package_alpine(`pulseaudio-alsa'), and _package_alpine(`alsa-plugins-pulse') packages for PulseAudio with ALSA compatibility.
Start _man(`pulseaudio(1)') when you want audio, ideally in your _file(`.xinitrc').
</P>

View File

@ -0,0 +1,31 @@
_header(`Bootstrapping')
<P>
Usually the first program a computer will run is the _ref(`/unix/#bootloader'),
which loads the kernel and usually the _ref(`#initramfs') which will handle mounting the system storage.
Then the _ref(`#initialization') system is started, which handles daemons, some of which will handle login.
</P>
<P>
Bootstrapping Linux involves booting an operating system, usually off a temporary storage medium, mounting the intended system storage,
and installing the operating system on the intended storage.
Sometimes distributions come with software that mostly automates this.
</P>
_passage(`veronika on the Alpine Linux Discord server, 2022-12-04T1111+0400',`
<P>bootstrapping things is only useful for rare cases where you actually don`'t want to use the base packages that the installer gets for you automatically, and the installer doesn`'t get in your way of making your own system, instead it suggests you install certain packages, and asks what packages you want installed. If you`'re installing a desktop environment, it will probably ask you which meta package you want (or at least that`'s how I remember it working).</P>
<P>If you have an installer to do the same things with less steps for you, you should use it. Automation is progress, automation is the whole point of all this computer stuff. If you can automate it or make it easier, you probably should, unless you want some control over the process. For example, instead of checking the charge and running a command to put your laptop into battery saver mode, you make a program do it for you. Convenience is key to happy and painless computing</P>
')
<P>
If running very thin installation media, for example, a _ref(`#debian') network install CD, or just need the most up-to-date software possible,
the first step will be to connect to the Internet.
</P>
<P>
Next, if your chosen Linux distribution has a package manager, configure it, use it to initialize the file system on the intended system storage,
and install the necessary system packages to the storage.
Usually distributions have a single <EM>base</EM> package, like _ref(`#arch')'s _package_arch(`base') or _ref(`#alpine')'s _package_alpine(`alpine-base').
If it doesn't include any of them, install separately a kernel, initialization system, and userland.
</P>
<P>
Bind mount (_command(`mount -o bind')) _file(`/dev/'), _file(`/proc/'), and _file(`/sys/') to the corresponding locations on the volume to bootstrap
(_code(`for d in dev proc sys; do mount -o bind /$d /[<I>mount</I>]/$d; done')),
then _ref(`/unix/#posix#chroot(1)') in and complete the system setup.
Set up additional configuration necessary to boot (including _ref(`/unix/#fstab(5)'), _man(`hostname(5)'), _man(`hosts(5)'), and anything necessary for the kernel or initialization).
</P>

22
wiki/linux/debian.m4 Normal file
View File

@ -0,0 +1,22 @@
_header(`Debian')
_bibliography(`
_bentr(`_link(`Debian', `https://www.debian.org/')')
_bentr(`_link(`Debian', `https://en.wikipedia.org/wiki/Debian') (Wikipedia)')
')
<P>
Debian is a software _ref(`#distribution') that can use Linux or the GNU HURD as its kernel.
In the past, FreeBSD's kernel was also an option.
Debian is known for its stability and longevity.
Debian uses SystemD as its initialization system, the GNU core utilities, and dpkg and apt for package management.
</P>
<P>
The vast majority of support and attention is on the Debian GNU+Linux configuration.
</P>
_subheader(`Ubuntu')
<UL>
<LI><A HREF="https://securitylab.github.com/research/Ubuntu-gdm3-accountsservice-LPE/">How to get root on Ubuntu 20.04 by pretending nobody's /home</A></LI>
</UL>
<P>
Ubuntu is a derivative of Debian Linux.
</P>

4
wiki/linux/devices.m4 Normal file
View File

@ -0,0 +1,4 @@
_header(`Devices')
_bibliography(`
_bentr(`_link(`udev', `https://en.wikipedia.org/wiki/Udev') (Wikipedia)')
')

View File

@ -0,0 +1,8 @@
_subheader(`Distribution')
<P>
Linux is usually obtained as part of a software distribution put together to form a useable operating system.
</P>
_subsubheader(_ref(`#alpine'))
_subsubheader(_ref(`#arch'))
_subsubheader(_ref(`#debian'))

4
wiki/linux/hostname.m4 Normal file
View File

@ -0,0 +1,4 @@
_header(`hostname')
<P>
The special file _file(`/proc/sys/kernel/hostname') directly controls the system hostname in the kernel.
</P>

45
wiki/linux/index.m4 Normal file
View File

@ -0,0 +1,45 @@
define(`_DESCRIPTION', `Linux is a Unix-workalike operating system kernel.')dnl
define(`_PAGE', `Linux')dnl
include(`../wiki.m4')dnl
include(`../unix/macros.m4')dnl
include(`macros.m4')dnl
<UL>
_bentr(`_link(`How to Linux', `http://tldp.yolinux.com/HOWTO/subdir/HOWTO-INDEX.html')')
_bentr(`_link(`How to Use User Mode Linux', `https://christine.website/blog/howto-usermode-linux-2019-07-07')')
_bentr(`<A HREF="https://www.cs.cmu.edu/~awb/linux.history.html">LINUX's History</A>')
_bentr(`_link(`The Linux Kernel documentation', `https://www.kernel.org/doc/html/v4.17/index.html')')
_bentr(`_link(`LINUX is obsolete', `https://groups.google.com/g/comp.os.minix/c/wlhw16QWltI')')
_bentr(`_link(`Linux From Scratch', `http://www.linuxfromscratch.org/')')
_bentr(`_link(`Move your Linux from BIOS to UEFI in place', `https://www.redhat.com/sysadmin/bios-uefi')')
<LI><A HREF="https://www.collabora.com/news-and-blog/blog/2020/08/27/using-the-linux-kernel-case-insensitive-feature-in-ext4/">Using the Linux kernel's Case-insensitive feature in Ext4</A></LI>
</UL>
include(`a.out.m4')dnl
include(`acpi.m4')dnl
include(`alpine.m4')dnl
include(`arch.m4')dnl
include(`audio.m4')dnl
include(`bootstrapping.m4')dnl
include(`debian.m4')dnl
include(`devices.m4')dnl
include(`distribution.m4')dnl
include(`hostname.m4')dnl
include(`initialization.m4')dnl
include(`initramfs.m4')dnl
include(`util-linux.m4')dnl
include(`volumes.m4')dnl
include(`../tail.m4')dnl

View File

@ -0,0 +1,9 @@
_header(`Initialization')
_subheader(`OpenRC')
_bibliography(`
_bentr(`_link(`OpenRC', `https://wiki.gentoo.org/wiki/OpenRC') (Gentoo Wiki)')
')
_subheader(`Runit')
_subheader(`S6')
_subheader(`Systemd')

9
wiki/linux/initramfs.m4 Normal file
View File

@ -0,0 +1,9 @@
_header(`initramfs')
_bibliography(`
_bentr(`_link(`Initial ramdisk', `https://en.wikipedia.org/wiki/Initial_ramdisk') (Wikipedia)')
_bentr(`_link(`initramfs', `https://wiki.debian.org/initramfs') (Debian Wiki)')
_bentr(`_link(`initramfs', `https://wiki.ubuntu.com/Initramfs') (Ubuntu Wiki)')
')
<P>
_file(`initramfs') is a _ref(`/unix/#archives#cpio') archive that contains a small Linux filesystem with just enough utility to mount the actual operating system's root filesystem.
</P>

17
wiki/linux/login.m4 Normal file
View File

@ -0,0 +1,17 @@
_header(`Login')
_subheader(`logind')
_bibliography(`
_bentr(`<A HREF="https://github.com/elogind/elogind">elogind</A>')
_bentr(`<A HREF="https://wiki.gentoo.org/wiki/Elogind">elogind</A> (Gentoo Wiki)')
_bentr(`<A HREF="https://www.freedesktop.org/software/systemd/man/org.freedesktop.login1.html">org.freedesktop.login1</A>')
_bentr(`<A HREF="https://nixos.wiki/wiki/Logind">logind</A> (NixOS Wiki)')
')
<P>
logind (_code(`systemd-logind.service(8)')) is a component of SystemD that exposes information about active users on the system via the org.freedesktop.login1 D-Bus interface which is used by the popular desktop environments GNOME and KDE.
It also handles _ref(`#ACPI') events.
It can be configured in _code(`logind.conf(5)').
</P>
<P>
On systems without SystemD and with conflicting software, _code(`elogind(8)') may be used.
</P>

4
wiki/linux/macros.m4 Normal file
View File

@ -0,0 +1,4 @@
dnl include(`../wiki.m4')
dnl include(`../unix/macros.m4')
define(`_package_alpine', `_link(`_package($1)', `https://pkgs.alpinelinux.org/packages?name=$1')')dnl
define(`_package_arch', `_link(`_package($1)', `https://archlinux.org/packages/?q=$1')')dnl

7
wiki/linux/util-linux.m4 Normal file
View File

@ -0,0 +1,7 @@
_subheader(`util-linux')
_bibliography(`
_bentr(`_link(`util-linux', `https://en.wikipedia.org/wiki/Util-linux') (Wikipedia)')
')
<P>
_code(`util-linux') is distributed on all popular Linux distributions and contains utilities users may expect to be already present on their systems, like _man(`more(1)') or _man(`hexdump(1)').
</P>

15
wiki/linux/volumes.m4 Normal file
View File

@ -0,0 +1,15 @@
_header(`File systems')
<P>
Also see _ref(`/unix/#volumes').
</P>
_subheader(`UFS')
_bibliography(`
_bentr(_link(`how to mount ffs partition under linux', `https://wiki.netbsd.org/tutorials/how_to_mount_ffs_partition_under_linux/') (NetBSD Wiki))
')
<P>
To mount a NetBSD FFSv2 partition in Linux use _cite(`mount(8)'); _code(`mount -o ufstype=ufs2 -t ufs').
The NetBSD Wiki instead notes _code(`-o ufstype=44bsd')
but that specific snippet was _link(`imported', `https://wiki.netbsd.org/cgi-bin/cvsweb/wikisrc/tutorials/how_to_mount_ffs_partition_under_linux.mdwn')
from _link(`a NetBSD.se Wiki page at least as old as 2007', `http://web.archive.org/web/20071112075927/http://wiki.netbsd.se/How_to_mount_FFS_partition_under_Linux').
</P>

9
wiki/page.mk Normal file
View File

@ -0,0 +1,9 @@
RM = rm -f
index.html: *.m4
m4 index.m4 >index.html
clean:
$(RM) index.html
.PHONY: clean

2
wiki/tail.m4 Normal file
View File

@ -0,0 +1,2 @@
</BODY>
</HTML>

112
wiki/unix/C.m4 Normal file
View File

@ -0,0 +1,112 @@
_header(`C')
<P>
For compilation, _man(`tcc(1)'), _man(`gcc(1)'), and _man(`clang(1)') are all reasonable choices depending on your needs.
</P>
<P>
On Alpine Linux, the standard library headers are in the _package(`musl-dev') package.
</P>
<P>
Many Linux software distributions' system package managers have meta-packages that pull all necessities for C development as dependencies.
Alpine has _package(`build-base') and Debian has _package(`build-essential').
</P>
<P>
For linking to libraries, see _ref(`#pkg-config').
</P>
_subheader(`C1978')
<UL>
<LI><A HREF="https://archive.org/details/TheCProgrammingLanguageFirstEdition">The C Programming Language, 1st ed.</A> (The Internet Archive)</LI>
<LI><A HREF="https://www.bell-labs.com/usr/dmr/www/cman.pdf">C Reference Manual</A> (this paper bears striking similarity to and was also written by the author of Appendix A of <I>The C Programming Language, 1st ed.</I> - the chronology of these writings' release is unknown)</LI>
<LI><A HREF="https://arstechnica.com/features/2020/12/a-damn-stupid-thing-to-do-the-origins-of-c/">"A damn stupid thing to do" - the origins of C</A></LI>
<LI><A HREF="https://www.bell-labs.com/usr/dmr/www/chist.html">The Development of the C Language</A></LI>
<LI><A HREF="http://pdp11.aiju.de/">PDP-11 Emulator</A></LI>
</UL>
<P>
The C programming language was first described to the public in <I>The C Programming Language</I> by Brian W. Kernighan and Dennis M. Ritchie, published by Prentice Hall in 1978.
The language evolved out of the former B programming language, which was a product of Ken Thompson:
</P>
<FIGURE>
<BLOCKQUOTE>
<P>Challenged by McIlroy's feat in reproducing TMG, Thompson decided that Unix—possibly it had not even been named yet—needed a system programming language. After a rapidly scuttled attempt at Fortran, he created instead a language of his own, which he called B. B can be thought of as C without types; more accurately, it is BCPL squeezed into 8K bytes of memory and filtered through Thompson's brain. Its name most probably represents a contraction of BCPL, though an alternate theory holds that it derives from Bon [Thompson 69], an unrelated language created by Thompson during the Multics days. Bon in turn was named either after his wife Bonnie, or (according to an encyclopedia quotation in its manual), after a religion whose rituals involve the murmuring of magic formulas.</P>
</BLOCKQUOTE>
<FIGCAPTION>(<CITE>The Development of the C Language</CITE>)</FIGCAPTION>
</FIGURE>
<P>
[Thompson 69] references _cite(`K. Thompson, "Bon—an Interactive Language," undated AT&amp;T Bell Laboratories internal memorandum (ca. 1969)').
This is possibly <A HREF="http://people.csail.mit.edu/saltzer/Multics/MHP-Saltzer-060508/filedrawers/180.btl-misc/Scan%204.PDF">Bon User's Manual</A> but it's not conclusive.
Please get in touch if you have a hyperlink for this document as I can't find it indexed on any search engines.</P>
<P>
This language described in <I>The C Programming Language</I> isn't the C programming language known by most.
It was a pre-standardization, relatively prototypical C, and rather than being codified in ANSI its primary documentation was the book by Kernighan and Ritchie (this book would later be known colloquially as <I>K&amp;R</I>).
This was known as "pre-ANSI C" or "K&amp;R C" and dubbed "C78" for the purposes of naming this page, in the same style as the later "C89", described in ANSI X3.159-1989, or "C11", described in ISO/IEC 9899:2011.
"C78" was also the name given to historical C by the <CODE>c78(7)</CODE> manual page on FreeBSD 9.0.
</P>
_subsubheader(`_italic(`8') and _italic(`9') as valid octal digits')
_bibliography(`
_bentr(`_ref(`#unix#v6') - see /usr/source/c/ in the Sixth Edition root tree')
')
<PRE>
main()
{
printf("%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n",
00, 01, 02, 03, 04, 05, 06, 07, 08, 09
);
}
</PRE>
<P>
The GNU C compiler emits the following errors (this omits warnings) for the preceding piece of code:
</P>
<PRE>
snippet.c:4:49: error: invalid digit "8" in octal constant
4 | 00, 01, 02, 03, 04, 05, 06, 07, 08, 09
| ^~
snippet.c:4:53: error: invalid digit "9" in octal constant
4 | 00, 01, 02, 03, 04, 05, 06, 07, 08, 09
| ^~
</PRE>
<P>
This is because in C (both pre-standardization and post-ANSI) integer constants with leading zeroes are parsed as octal (base 8) numbers.
In pre-ANSI C, _italic(`8') and _italic(`9') were valid octal digits corresponding to _italic(`010')(b8) and _italic(`011')(b8).
This is documented in _cite(`The C Programming Language'), Appendix A, subsection 2.4.1, and evidenced by the preceding code block.
The following is output of the compiled program in UNIX V6 on an emulated PDP-11:
</P>
<PRE>
0
1
2
3
4
5
6
7
8
9
</PRE>
<P>
This behavior exists within _code(`/usr/source/c/c0t.s'), which is a PDP-11 assembler file that parses integer constants (as far as I can tell).
This file provides _program(`getnum'), a function used in _code(`/usr/source/c/c00.c').
My theory is that this behavior is a side-effect of a very efficient but imperfect method of parsing integer constants from a file stream.
</P>
<P>
This wouldn't be a significant or even noticeable error; most programmers wouldn't use _italic(`8') or _italic(`9') as octal digits anyway.
If not for its documentation within _cite(`The C Programming Language') it might have totally faded into obscurity.
This is also mentioned in _cite(`The C Programming Language, 2nd ed.') in Appendix C.
</P>
_subheader(`Standardization')
_bibliography(`
_bentr(`_link(`Standard C: The ANSI Draft Grows Up', `https://archive.org/details/PC-Mag-1988-09-13/page/n115/')')
_bentr(`_link(`A Brief History of GCC', `https://gcc.gnu.org/wiki/History')')
')
<P>
In 1987, Richard M. Stallman, then a former MIT hacker who was working full time on the _italic(`GNU Project'), a re-implementation of the Unix operating system,
released the first beta release of _italic(`GCC'), then the _italic(`GNU C Compiler') and later re-named the _italic(`GNU Compiler Collection').
</P>
_subheader(`C1989')
_subheader(`C1999')
_bibliography(`
_bentr(`_link(`C99', `https://en.wikipedia.org/wiki/C99') (Wikipedia)')
_bentr(`_link(`c99(1p)', `https://www.man7.org/linux/man-pages/man1/c99.1p.html')')
')
_subheader(`C2011')
_subheader(`C2017')
_subheader(`C202x')

111
wiki/unix/X.m4 Normal file
View File

@ -0,0 +1,111 @@
_header(`X')
_bibliography(`
_bentr(`_link(`Cool, but obscure X11 tools', `http://cyber.dabamos.de/unix/x11/')')
_bentr(`_link(`Xorg', `https://wiki.archlinux.org/title/Xorg') (Arch Wiki)')
')
<P>
X is a graphical windowing system that can be used on _ref(`/linux/'), FreeBSD, OpenBSD, _ref(`#netbsd'), and some proprietary operating systems as well.
X is not the only windowing system; _man(`twin(1)') exists for windowed multitasking within a framebuffer and Wayland is another windowing system intended to replace X.
</P>
_subheader(`Anki')
<P>
Anki is the de facto standard flashcards studying programming given its popularity and lack of competition.
Anki uses spaced repetition to make sure the user remembers what they study for the long term.
</P>
_subsubheader(`_code(`ModuleNotFoundError: No module named `'aqt`'')')
<P>
The module _code(`aqt') isn't findable in the environment variable _code(`PYTHONPATH').
Check each directory in the pattern _file(`$PREFIX/lib/python*/site-packages') for the directory _file(`aqt/'),
and if it's there, try setting _code(`PYTHONPATH') to that corresponding _file(`site-packages') directory.
</P>
<P>
This bug exists on postmarketOS 22.12 (aarch64, based on Alpine Linux 3.17; anki-2.1.49-r2);
the _code(`PYTHONPATH') fix works as _code(`PYTHONPATH=/usr/lib/python3.11/site-packages/ anki').
</P>
_subheader(`cairo')
_bibliography(`
_bentr(`_link(`cairo', `https://en.wikipedia.org/wiki/Cairo_(graphics)') (Wikipedia)')
')
<P>
cairo is a graphics rendering library, originally for X but later made cross-platform.
</P>
<P>
cairo is available on _ref(`/linux/#alpine') as _package(`cairo-dev').
</P>
_subheader(`Fonts')
_subsubheader(`日本語')
_bibliography(`
_bentr(`_link(`Xorg', `https://gitlab.freedesktop.org/xorg/')/_link(`font/jis-misc', `https://gitlab.freedesktop.org/xorg/font/jis-misc')')
')
<P>
Both jiskan16 and jiskan24 are included in Xorg, in the source tree at font/jis-misc but usually packaged separately (_package(`font-jis-misc') on _ref(`/linux/#alpine')).
</P>
_subheader(`Mail')
<P>
The (formerly Mozilla) Thunderbird mail suite is a popular though maximal choice.
Claws Mail is a nice mail reader with a somewhat similar interface to Thunderbird but, in my experience, easier to use.
</P>
_subheader(`Media')
<P>
_man(`mpv(1)') and _man(`vlc(1)') are good options.
</P>
_subheader(`Server')
_subsubheader(`X.org')
_bibliography(`
_bentr(`_link(`X.org', `https://www.X.org')')
_bentr(`_link(`X.Org Server', `https://en.wikipedia.org/wiki/X.Org_Server') (Wikipedia)')
')
<P>
The de-facto standard X server is X.org.
NetBSD uses X.org as the default system X server.
</P>
<P>
_ref(`/linux/#arch')'s package repositories have _link(`_package(`xorg')', `https://archlinux.org/groups/x86_64/xorg/'),
_link(`_package(`xorg-apps')', `https://archlinux.org/groups/x86_64/xorg-apps/'),
and _link(`_package(`xorg-drivers')', `https://archlinux.org/groups/x86_64/xorg-drivers/') package groups.
_ref(`#pkgsrc') has _package(`meta-pkgs/modular-xorg').
</P>
<H5>_code(`Failed to open /dev/input/event[_italic(`number')] (Permission denied)')</H5>
<P>You need to be a part of the _italic(`input') group to use X.org.</P>
<H5>_code(`Failed to open /dev/tty[_italic(`number')] (Permission denied)')</H5>
<P>You need to be a part of the _italic(`video') group to use X.org.</P>
_subheader(`Managing Clients')
<P>
It's possible to make X _man(`exec(3)') a window manager at the end of initialization to ease the creation, deletion, and manipulation of windows.
Contrary to what is now popular belief, window managers are not necessary (thought they're extremely convenient compared to the lack of them).
</P>
<H4>ctwm</H4>
_bibliography(`
_bentr(`_link(`Configurations for ctwm (and twm)', `https://datagubbe.se/twm/')')
')
_subheader(`sxmo')
_subsubheader(`Add an app')
_bibliography(`
_bentr(`_link(`How to Add Apps to the List?', `https://wiki.postmarketos.org/wiki/Sxmo/Tips_and_Tricks#How_to_Add_Apps_to_the_List.3F')')
')
<P>
Copy _file(`/usr/share/sxmo/default_hooks/sxmo_hook_apps.sh') to _file(`"$XDG_CONFIG_HOME"/sxmo/hooks/sxmo_hook_apps.sh') and edit the script.
</P>
_subheader(`WWW')
_subsubheader(`TOR Browser')
<P>
TOR Browser is available through pkgsrc at _package(`security/tor-browser').
</P>
_subheader(`xinit(1)')
<P>
_man(`startx(1)') is usually included with _man(`xinit(1)').
</P>
<P>
On _ref(`/linux/#alpine'), _man(`xinit(1)') is provided by _package(`xinit').
On _ref(`/linux/#arch'), _man(`xinit(1)') is provided by _link(`_package(`xorg-xinit')', `https://archlinux.org/packages/extra/x86_64/xorg-xinit/').
</P>

13
wiki/unix/acpi.m4 Normal file
View File

@ -0,0 +1,13 @@
_header(`ACPI')
<P><I>Advanced Configuration and Power Interface</I></P>
_bibliography(`
_bentr(`_link(`Advanced Configuration and Power Interface', `https://en.wikipedia.org/wiki/Advanced_Configuration_and_Power_Interface') (Wikipedia)')
')
<P>
The Advanced Configuration and Power Interface, or ACPI, is the interface through which the operating system and client programs can control features in your computer's firmware.
Usually this is used with an ACPI client or opaquely controlled by the operating environment.
</P>
<P>
On Linux, see _ref(`#Linux#ACPI').
On NetBSD, see _man(`acpi(4)').
</P>

6
wiki/unix/archives.m4 Normal file
View File

@ -0,0 +1,6 @@
_header(`Archives')
_subheader(`cpio')
_bibliography(`
_bentr(`_link(`cpio', `https://en.wikipedia.org/wiki/Cpio') (Wikipedia)')
')

1
wiki/unix/bootloader.m4 Normal file
View File

@ -0,0 +1 @@
_header(`Bootloader')

5
wiki/unix/culture.m4 Normal file
View File

@ -0,0 +1,5 @@
_header(`Culture')
_subheader(`Pronunciation')
_bibliography(`
_bentr(`_link(`Common pronunciations of Linux directories`,' commands`,' etc', `https://www.linux.org/threads/common-pronunciations-of-linux-directories-commands-etc.4445/')')
')

27
wiki/unix/doas.m4 Normal file
View File

@ -0,0 +1,27 @@
_header(`doas(1)')
_bibliography(`
_bentr(`_link(`doas(1)', `http://man.openbsd.org/doas.1') (OpenBSD)')
_bentr(`_link(`doas.conf(5)', `http://man.openbsd.org/doas.conf.5') (OpenBSD)')
_bentr(`_link(`doas mastery', `https://flak.tedunangst.com/post/doas-mastery')')
')
<P>
<CITE>doas(1)</CITE> is a systems administration tool that performs a command as a different user.
<CITE>doas(1)</CITE> is configured in <CITE>doas.conf(5)</CITE>.
</P>
<P>
For a pretty typical configuration, where users in the <I>wheel</I> group are meant to be administrating the system, the set-up session usually looks something like this:
</P>
<PRE>
$ su
# ed /etc/doas.conf
/etc/doas.conf: No such file or directory
a
permit :wheel
.
w
14
q
</PRE>
<P>
_man(`doas.conf(5)') is located in _code(`$PREFIX/etc/doas.conf'), except on Alpine Linux, where it's located in _code(`$PREFIX/etc/doas.d/doas.conf').
</P>

13
wiki/unix/editing.m4 Normal file
View File

@ -0,0 +1,13 @@
_header(`Editing')
_subheader(`emacs')
<P>
Emacs ("editor macros") is a text editor with a very powerful Lisp interpreter included.
</P>
_subheader(`nano(1)')
<P>
_man(`nano(1)') is a text editor that's usually recommended for beginners because of its lack of edit <I>modes</I> and its similar controls to popular editors from outside of UNIX.
</P>
_subheader(`ne(1)')
<P>
_man(`ne(1)') is similar to _man(`nano(1)') but has a different featureset.
</P>

65
wiki/unix/fonts.m4 Normal file
View File

@ -0,0 +1,65 @@
_header(`Fonts')
<P>
Also see _ref(`#x#fonts').
_subheader(`Century Schoolbook')
_bibliography(`
_bentr(`_link(`Fonts in Use: Neon Genesis Evangelion', `https://fontsinuse.com/uses/28760/neon-genesis-evangelion')')
')
_subheader(`Comic Mono')
_bibliography(`
_bentr(`_link(`Comic Mono', `https://dtinth.github.io/comic-mono-font/')')
')
_subheader(`Noto')
_bibliography(`
_bentr(`_link(`Noto fonts', `https://en.wikipedia.org/wiki/Noto_fonts') (Wikipedia)')
_bentr(`_link(`Overview of Unicode coverage by Noto', `https://notofonts.github.io/overview/')')
')
<P>
As of 2021-04, Noto has fonts for 54% of Unicode.
</P>
<P>
On _ref(`/linux/#alpine'), all Noto family fonts match the glob _link(`_package(`font-noto-*')', `https://pkgs.alpinelinux.org/packages?name=font-noto-*').
In _ref(`#pkgsrc'), all Noto family fonts match the glob _package(`fonts/noto-*').
</P>
_subheader(`Pango')
_bibliography(`
_bentr(`_link(`Pango', `https://pango.gnome.org/')')
')
<P>
Pango is a font rendering library.
</P>
<P>
Pango is packaged for _ref(`/linux/#alpine') as _package(`pango-dev').
</P>
_subheader(`Vendor Fonts')
_bibliography(`
_bentr(`_link(`Fonts for NeXTStep, OpenStep, and Rhapsody', `http://shawcomputing.net/resources/next/software/ns-os-rhap_fonts/NS-OS-Rhap_Fonts_1.html')')
_bentr(`_link(`The Ultimate Oldschool PC Font Pack', `https://int10h.org/oldschool-pc-fonts/')')
')
_subheader(`Unscii')
_bibliography(`
_bentr(`_link(`Unscii', `http://pelulamu.net/unscii/')')
')
<P>
Unscii is packaged as _package(`fonts/unscii') on _ref(`#pkgsrc').
</P>
_subheader(`日本語')
_bibliography(`
_bentr(`_link(`CJK characters', `https://en.wikipedia.org/wiki/CJK_characters') (Wikipedia)')
_bentr(`_link(`jiskan', `https://ja.wikipedia.org/wiki/Jiskan') (Wikipedia) (_link(`English', `https://ja-m-wikipedia-org.translate.goog/wiki/Jiskan'))')
_bentr(`_link(`久しぶりにPostmarketOS on PinePhone', `https://twitter.com/osakanataro2/status/1379410388110864385')')
')
<P>
jiskan is a family of fonts comprising jiskan16 and jiskan24.
</P>
_subsubheader(`あずき')
_bibliography(`
_bentr(`_link(`あずきフォント', `http://azukifont.com/font/azuki.html')')
')

3
wiki/unix/fstab.m4 Normal file
View File

@ -0,0 +1,3 @@
_header(`fstab(5)')
<P>postmarketOS requires that the _code(`localmount') OpenRC service be enabled for the system to read _man(`fstab(5)').
<P>Arch and Artix have fstab generators at _man(`genfstab(8)') and _man(`fstabgen(8)') respectively in their installation scripts.</P>

50
wiki/unix/index.m4 Normal file
View File

@ -0,0 +1,50 @@
define(`_DESCRIPTION', `Unix is a multitasking operating system designed with simplicity in mind.')dnl
define(`_PAGE', `Unix')dnl
include(`../wiki.m4')dnl
include(`macros.m4')dnl
include(`unix.m4')
include(`posix.m4')
include(`acpi.m4')
include(`archives.m4')
include(`bootloader.m4')
include(`C.m4')
include(`culture.m4')
include(`doas.m4')
include(`editing.m4')
include(`fonts.m4')
include(`fstab.m4')
include(`linux.m4')
include(`netbsd.m4')
include(`manual.m4')
include(`multitasking.m4')
include(`pci.m4')
include(`pkg-config.m4')
include(`telepathy.m4')
include(`wayland.m4')
include(`wifi.m4')
include(`volumes.m4')
include(`X.m4')
include(`../tail.m4')dnl

3
wiki/unix/linux.m4 Normal file
View File

@ -0,0 +1,3 @@
_header(`Linux')
<P>
See _ref(`/linux/').

5
wiki/unix/macros.m4 Normal file
View File

@ -0,0 +1,5 @@
define(`_command', `_code($1)')dnl
define(`_file', `_code($1)')dnl
define(`_man', `_cite($1)')dnl
define(`_program', `_code($1)')dnl
define(`_package', `_code($1)')dnl

10
wiki/unix/manual.m4 Normal file
View File

@ -0,0 +1,10 @@
_header(`Manuals')
_bibliography(`
_bentr(`_link(`The Linux man-pages project', `https://www.kernel.org/doc/man-pages/')')
')
<P>
One of UNIX's innovations was its inclusion of a detailed, useful manual accessible on-system, accessible via _man(`man(1)').
</P>
<P>
Alpine by default uses <CODE>mandoc</CODE>.
</P>

14
wiki/unix/multitasking.m4 Normal file
View File

@ -0,0 +1,14 @@
_header(`Multitasking')
_subheader(`Task management')
_subsubheader(`htop(1)')
_bibliography(`
_bentr(`_link(`htop', `https://en.wikipedia.org/wiki/Htop') (Wikipedia)')
_bentr(`_link(`htop - an interactive process viewer', `https://htop.dev/')')
')
<P>
_man(`htop(1)') is a featureful alternative to _man(`top(1)').
</P>
_subsubheader(`top(1)')
<P>
Busybox and NetBSD provide implementations of _code(`top(1)'), an interactive in-terminal task manager.
</P>

66
wiki/unix/netbsd.m4 Normal file
View File

@ -0,0 +1,66 @@
_header(`NetBSD')
<UL>
<LI><A HREF="http://netbsd.org/">netbsd.org</A></LI>
<LI><A HREF="https://www.netbsd.org/docs/guide/en/">NetBSD Guide</A></LI>
<LI><A HREF="https://www.netbsd.org/docs/pkgsrc/">pkgsrc Guide</A></LI>
</UL>
<H3>Battery</H3>
<P><CODE>envstat(1)</CODE> can show the current battery status.</P>
<H3>Mounting filesystems</H3>
<OL>
<LI>Connect the drive with the filesystem you want to access.</LI>
<LI>Use <CODE>dmesg(8)</CODE> to determine the location in <CODE>/dev/</CODE> of the disk.</LI>
<LI><CODE>disklabel(8)</CODE> the drive to determine which partition on the disk you want to access (<CODE>disklabel /dev/<I>disk</I></CODE>)</LI>
<LI><CODE>mount(8)</CODE> the filesystem.</LI>
<LI><CODE>umount(8)</CODE> the filesystem when done using it.</LI>
</OL>
<H4>ext4</H4>
<P>
Install <CODE>filesystems/fuse</CODE> and <CODE>filesystems/fuse-ext2</CODE>.
<CODE>disklabel(8)</CODE> will list ext4 filesystems as of type "Linux Ext2".
Use <CODE>fuse-ext2(1)</CODE> to mount the filesystem.
</P>
<P>
<CODE>fuse-ext2(1)</CODE> is spotty in places and may not work correctly.
</P>
<H4>exFAT</H4>
<P>
Install <CODE>filesystems/fuse</CODE> and <CODE>filesystems/fuse-exfat</CODE>.
Use <CODE>mount.exfat</CODE> to mount the filesystem (the manual page for which is <CODE>mount.exfat-fuse(8)</CODE>).
</P>
<H3>Fix <CODE>SSL certificate problem: unable to get local issuer certificate</CODE></H3>
<UL>
<LI><A HREF="http://mail-index.netbsd.org/pkgsrc-users/2021/07/19/msg034147.html">Depending on security/ca-certificates?</A></LI>
<LI><A HREF="https://www.cambus.net/installing-ca-certificates-on-netbsd/">Installing CA certificates on NetBSD</A></LI>
<LI><A HREF="https://github.com/ohmyzsh/ohmyzsh/issues/8321#issuecomment-863493503">SSL Certificate Problem</A> (ohmyzsh/ohmyzsh#8321)</LI>
</UL>
<P>Install <CODE>security/mozilla-rootcerts-openssl</CODE>.</P>
<P>
<I>Do not</I> use SSL workarounds like (in the case of git) <CODE>GIT_SSL_NO_VERIFY</CODE>.
These leave your system open to man-in-the-middle attacks.
</P>
<H3>OpenVPN</H3>
<UL>
<LI><A HREF="Mullvad via openvpn - up could not execute external program">https://forums.freebsd.org/threads/mullvad-via-openvpn-up-could-not-execute-external-program.79968/</A> (FreeBSD Forums)</LI>
<LI><A HREF="Platform Notes">https://community.openvpn.net/openvpn/wiki/PlatformNotes</A> (OpenVPN Community Wiki)</LI>
</UL>
<P>
If using Mullvad, you have to change the shebang on <CODE>update-resolv-conf(8)</CODE>
(a standalone Bash script included in the OpenVPN configurations from Mullvad, intended to be placed in <CODE>/etc/openvpn/</CODE>)
from <CODE>#!/bin/bash</CODE> to _code(`#!/usr/pkg/bin/bash') if using Bash from pkgsrc or another appropriate location if using a different package manager.
</P>
<H3>rc.d</H3>
<UL>
<LI><A HREF="http://www.mewburn.net/luke/papers/rc.d.pdf">The Design and Implementation of the NetBSD rc.d system</A></LI>
</UL>
<H3>System logging</H3>
<UL>
<LI><A HREF="https://www.unitedbsd.com/d/548-system-instability-on-unstable-version-how-do-i-get-logs/7">System instability on unstable version - how do I get logs?</A></LI>
</UL>
<P>See <CODE>syslogd(8)</CODE> and <CODE>syslog.conf(5)</CODE>, which pertain to system logging.</P>
<P>Setting <CODE>DDB_ONPANIC</CODE> (see <CODE>options(4)</CODE> and <CODE>sysctl(8)</CODE>) will save a crash dump at <CODE>/var/crash</CODE> on kernel panic.
<H3>Upgrading</H3>
<UL>
<LI>The NetBSD Guide - <A HREF="https://www.netbsd.org/docs/guide/en/chap-upgrading.html">Chapter 4: Upgrading NetBSD</A></LI>
<LI><A HREF="https://www.unitedbsd.com/d/110-upgrading-netbsd-using-sysinst">Upgrading NetBSD using sysinst</A></LI>
</UL>

15
wiki/unix/pci.m4 Normal file
View File

@ -0,0 +1,15 @@
<H2>PCI Utilities</H2>
<UL>
<LI><A HREF="https://github.com/pciutils/pciutils">pciutils/pciutils</A> (GitHub)</LI>
</UL>
<P>
Available as <CODE>sysutils/pciutils</CODE> from pkgsrc.
Supplies <CODE>lspci(8)</CODE>, <CODE>setpci(8)</CODE>, and <CODE>update-pciids(8)</CODE>.
</P>
<P>
<CODE>update-pciids(8)</CODE> is not part of the <CODE>pciutils</CODE> package in Alpine Linux repositories.
</P>
<P>
NetBSD includes <CODE>pcictl(8)</CODE> which offers similar functionality.
<CODE>pcictl pci0 list</CODE> outputs roughly the same information as <CODE>lspci(8)</CODE>, though <CODE>lspci(8)</CODE> may offer slightly more detailed information.
</P>

18
wiki/unix/pkg-config.m4 Normal file
View File

@ -0,0 +1,18 @@
_header(`pkg-config')
_bibliography(`
_bentr(`_link(`Guide to pkg-config', `https://people.freedesktop.org/~dbn/pkg-config-guide.html')')
_bentr(`_link(`pkgconf', `https://github.com/pkgconf/pkgconf') (GitHub)')
_bentr(`_link(`pkg-config', `https://www.freedesktop.org/wiki/Software/pkg-config/')')
_bentr(`_link(`pkg-config', `https://en.wikipedia.org/wiki/Pkg-config') (Wikipedia)')
')
<P>
pkg-config is the querying interface to the _man(`pc(5)') file format,
which stores metadata relating to the file locations of key files for a language compiler or interpreter.
Its purpose is to facilitate library linking, particularly for C and C++,
without knowledge of where exactly a library's files are stored,
which can vary dramatically between system and package manager.
</P>
<P>
Another implementation of pkg-config, _man(`pkgconf(1)'), is the default on _ref(`#netbsd').
_man(`pkgconf(1)') comes with _man(`pkg.m4(7)'), macros for GNU autoconf.
</P>

17
wiki/unix/pkgsrc.m4 Normal file
View File

@ -0,0 +1,17 @@
<H2 ID="pkgsrc">pkgsrc</H2>
<UL>
<LI><A HREF="http://www.netbsd.org/docs/pkgsrc/"</A>the pkgsrc user's guide</A></LI>
</UL>
<H3><CODE>pkg_add: Conflicting PLIST</CODE></H3>
<UL>
<LI><A HREF="Re: conflicting PLIST during install">https://mail-index.netbsd.org/pkgsrc-users/2013/06/07/msg018151.html</A> (pkgsrc-Users Mailing List)</LI>
</UL>
<P>Try <CODE>pkg_admin(1)</CODE>.</P>
<H3>Upgrading packages</H3>
<UL>
<LI><A HREF="http://www.netbsd.org/docs/pkgsrc/using.html">Using pkgsrc</A> (the pkgsrc user's guide)</LI>
<LI><A HREF="https://wiki.netbsd.org/cgi-bin/cvsweb/wikisrc/pkgsrc/how_to_upgrade_packages.mdwn?rev=1.9;content-type=text%2Fx-cvsweb-markup">how to upgrade packages</A> (NetBSD Developer Wiki <B>snapshot; 2020-09-09</B>)</LI>
</UL>
<P>
See <CODE>pkgtools/pkg_rolling_replace</CODE>.
</P>

300
wiki/unix/posix.m4 Normal file
View File

@ -0,0 +1,300 @@
_header(`POSIX')
_bibliography(`
_bentr(`_link(`IEEE Std 1003.1-2017', `https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/contents.html')')
_bentr(`_link(`The origin of the name POSIX.', `https://stallman.org/articles/posix.html')')
_bentr(`_link(`POSIX', `https://en.wikipedia.org/wiki/POSIX') (Wikipedia)')
_bentr(`_link(`POSIX™ 1003.1 Frequently Asked Questions', `https://www.opengroup.org/austin/papers/posix_faq.html')')
')
_subheader(`as(1)')
_bibliography(`
_bentr(`_link(`as', `https://en.wikipedia.org/wiki/As_(Unix)') (Wikipedia)')
_bentr(`_link(`UNIX Assembler Reference Manual', `https://www.tom-yam.or.jp/2238/ref/as.pdf')')
_bentr(`_link(`UNIX Operating System Porting Experiences', `https://www.bell-labs.com/usr/dmr/www/otherports/newp.pdf')')
')
_subsubheader(`GAS')
_bibliography(`
_bentr(`_link(`What I Dislike About GAS', `http://x86asm.net/articles/what-i-dislike-about-gas/')')
')
_subheader(`cat(1)')
_bibliography(`
_bentr(`_link(`4.4BSD-Lite2', `https://en.wikipedia.org/wiki/Berkeley_Software_Distribution')/_link(`usr/src/bin/cat/cat.c', `https://github.com/sergev/4.4BSD-Lite2/blob/master/usr/src/bin/cat/cat.c')')
_bentr(`_link(`busybox', `https://git.busybox.net/busybox/')/_link(`coreutils/cat.c', `https://git.busybox.net/busybox/tree/coreutils/cat.c')')
_bentr(`_link(`cat(1)', `http://man.cat-v.org/unix-1st/1/cat') (UNIX v1)')
_bentr(`_link(`cat(1p)', `https://www.unix.com/man-page/posix/1posix/cat/')')
_bentr(`_link(`UNIX Style, or cat -v Considered Harmful', `http://harmful.cat-v.org/cat-v/')')
_bentr(`_link(`dd(1p)', `https://www.unix.com/man-page/posix/1posix/dd/')')
_bentr(`_link(`FreeBSD', `https://www.freebsd.org/')/_link(`bin/cat/cat.c', `https://github.com/freebsd/freebsd-src/blob/main/bin/cat/cat.c')')
_bentr(`_link(`GNU coreutils', `https://www.gnu.org/software/coreutils/')/_link(`src/cat.c', `https://git.savannah.gnu.org/cgit/coreutils.git/tree/src/cat.c')')
_bentr(`_link(`The history of why cat -v is considered harmful', `https://lyngvaer.no/log/cat-v-history')')
_bentr(`_link(`NetBSD', `https://www.netbsd.org/')/_link(`bin/cat/cat.c', `https://github.com/NetBSD/src/blob/trunk/bin/cat/cat.c')')
_bentr(`_link(`Plan 9 from Bell Labs Fourth Edition', `https://9p.io/plan9/')/_link(`sys/src/cmd/cat.c', `https://github.com/plan9foundation/plan9/blob/main/sys/src/cmd/cat.c')')
_bentr(`_link(`Program Design in the UNIX Environment', `https://harmful.cat-v.org/cat-v/unix_prog_design.pdf')')
_bentr(`_link(`A Research Unix Reader', `https://www.cs.dartmouth.edu/~doug/reader.pdf')')
_bentr(`_link(`UNIX v7', `https://en.wikipedia.org/wiki/Unix')/_link(`usr/src/cmd/cat.c', `https://www.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/cat.c')')
_bentr(`Thanks to Miles and WeedSmokingJew for help with content.')
_bentr(`Thanks to adamz01h and wiresToGround for help with the JavaScript that used to accompany this article (to facilitate syntax highlighting in code samples using _link(`highlight.js', `https://highlightjs.org/')).')
_bentr(`Thanks to Ando_Bando, Miles, u/oh5nxo, and WeedSmokingJew for help with the accompanying code samples.')
')
<P>
_man(`cat(1)') is a program that exists to catenate files; to "join" one file at its end to another at its start.
</P>
<P>
_man(`cat(1)') was introduced in UNIX's first edition to succeed _man(`pr(1)'), which prints the contents of a single file to the screen.
Most use of _man(`cat(1)') is similar; it's often introduced to beginners as a means to print the contents of a file to the screen, which is why many implementations include options that modify output to make it easier to read on a display.
POSIX requires only _code(`-u') to be implemented, which guarantees output is unbuffered - on some systems output is buffered in 512-byte blocks, which is also the default of _man(`dd(1)'), though most current implementations (busybox, GNU coreutils) don't buffer output regardless.
Various implementations include _code(`-s') to strip duplicate blank lines (<CODE>cat "$@" | sed '/^\s*$/d'</CODE> would also work),
_code(`-n') to number lines (to which Pike and Kernighan offered <CODE>awk '{ print NR "\t" $0 }' "$@"</CODE> as a replacement)
and _code(`-b') to number non-blank lines (both cases for which _man(`nl(1)') was later made),
and _code(`-v') to mark invisible characters.
</P>
<P>
Additions to _code(`man(1)') are controversial; Rob Pike and Brian Kernighan explain this in _cite(`Program Design in the UNIX Environment'), the paper that accompanied Rob Pike's presentation _cite(`UNIX Style, or cat -v Considered Harmful') at the 1983 USENIX Summer Conference.
</P>
<P>
The following shell script is a POSIX-compliant implementation of _man(`cat(1)'):
</P>
<PRE>
#!/bin/sh
set -e
DD=dd
# usage with 0 arguments - print standard input to standard output
if test -z "$1"; then
dd 2&gt;/dev/null
exit $?
fi
while test -n "$1"; do
# Parse options
if test -z "$DONT_PARSE_ARGS"
then case "$1" in
--)
DONT_PARSE_ARGS=1
shift; continue; ;;
-u)
DD="dd bs=1"
shift; continue; ;;
-)
$DD &lt;/dev/stdin 2&gt;/dev/null
shift; continue; ;;
esac
fi
# Print input to output.
$DD &lt;"$1" 2&gt;/dev/null
shift
done
exit 0
</PRE>
_subheader(`echo(1)')
_bibliography(`
_bentr(`_link(`echo', `https://en.wikipedia.org/wiki/Echo_(command)') (Wikipedia)')
_bentr(`_link(`echo(1p)', `https://man7.org/linux/man-pages/man1/echo.1p.html') (man7)')
_bentr(`_link(`NetBSD', `https://www.netbsd.org/')/_link(`bin/echo/echo.sh', `https://github.com/NetBSD/src/blob/trunk/bin/echo/echo.c')')
_bentr(`_link(`UNIX v5', `#UNIX')/_link(`usr/source/s1/echo.c', `https://www.tuhs.org/cgi-bin/utree.pl?file=V5/usr/source/s1/echo.c')')
_bentr(`_link(`Variations in echo implementations', `https://www.in-ulm.de/~mascheck/various/echo+printf/')')
')
<P>
Don't use _man(`echo(1)'), use _man(`printf(1)').
_man(`printf(1)') simulates the _man(`printf(3)') function in the C standard I/O library which has no significant variations, whereas the functionality of _man(`echo(1)') can vary between vendors.
</P>
<P>
_code(`printf "%s" "$*"') does not work as _man(`echo(1)') though it's been said to do so (including by this page).
</P>
<P>
The following is an implementation of _man(`echo(1)') in the C programming language, using the standard library.
</P>
<PRE>
#include &lt;stdio.h&gt;
int main(int argc, char *argv[]) {
int i;
for(i = 1; ; ) {
if(i >= argc)
break;
printf("%s", argv[i]);
++i;
if(i == argc)
putchar('\n');
else
putchar(' ');
}
return 0;
}
</PRE>
<P>
The following is an implementation of _man(`echo(1)') in shell.
</P>
<PRE>
while :; do
if test -z "$1"
then break
fi
printf "%s" "$1"
`shift'
if test -z "$1"; then
printf "\n"
break
else
printf " "
fi
done
</PRE>
_subheader(`ed(1)')
_bibliography(`
_bentr(`_link(`A Tutorial Introduction to the Unix Text Editor', `https://verticalsysadmin.com/vi/a_tutorial_introduction_to_the_unix_text_editor.pdf')')
_bentr(`_link(`Ed Cheat Sheet', `https://catonmat.net/ftp/ed.text.editor.cheat.sheet.txt')')
')
<P>
I'm pretty sure some later UNIX-based OSes doubled the _man(`ed(1)') buffers, there's pretty much no downside to doing so in the modern era but it should be very easy to do yourself if it hasn't already been done (just double some of the array sizes in the beginning of _code(`ed.c')).
</P>
_subsubheader(`Busybox')
_bibliography(`
_bentr(`_link(`editors/ed.c', `https://git.busybox.net/busybox/tree/editors/ed.c')')
')
_passage(`editors/ed.c, as of 2021-12-29', `
<PRE>
/* vi: set sw=4 ts=4: */
/*
* Copyright (c) 2002 by David I. Bell
* Permission is granted to use, distribute, or modify this source,
* provided that this copyright notice remains intact.
*
* The "ed" built-in command (much simplified)
*/
//config:config ED
//config: bool "ed (21 kb)"
//config: default y
//config: help
//config: The original 1970'`s Unix text editor, from the days of teletypes.
//config: Small, simple, evil. Part of SUSv3. If you'`re not already using
//config: this, you don`'t need it.
</PRE>')
<P>
_package(`busybox') _man(`ed(1)') exists as part of _package(`busybox') as an afterthought;
if on an embedded system, see if _ref(`#posix#vi(1)') has been included in the _package(`busybox')
configuration, which is much closer to traditional implementations of itself.
</P>
_subsubheader(`plan9ports')
_bibliography(`
_bentr(`_link(`src/cmd/ed.c', `view-source:https://9fans.github.io/usr/local/plan9/src/cmd/ed.c')')
')
<P>
Pretty good in use, but if you're using _package(`plan9port') consider checking out _man(`sam(1)'), a much more powerful line editor.
</P>
_subheader(`find(1)')
<UL>
_bentr(`_link(`find', `https://en.wikipedia.org/wiki/Find_(Unix)') (Wikipedia)')
_bentr(`_link(`"Has this only been added in the last 20 years?"', `https://news.ycombinator.com/item?id=10318841')')
<LI><A HREF="http://doc.cat-v.org/unix/find-history">The History of the Design of Unix's Find Command</A></LI>
</UL>
_subheader(`m4(1)')
_bibliography(`
_bentr(`_link(`m4', `https://en.wikipedia.org/wiki/`M4_'(computer_language)') (Wikipedia)')
_bentr(`_link(`Notes on the M4 Macro Language', `https://mbreen.com/m4.html')')
')
_subheader(`make(1)')
_bibliography(`
_bentr(`_link(`Lab 06 - Makefiles', `https://cs.brown.edu/courses/csci0330/docs/labs/makefiles.pdf')')
')
<P>
_man(`make(1)') in modern times is fragmented into the GNU version <I>gmake</I> and the BSD version <I>bmake</I>.
Complex Makefiles may not be useable in both.
Usually Linux systems have GNU Make as _command(`make') and BSD Make as _command(`bmake'),
and BSD systems to have BSD Make as _command(`make') and GNU Make as _command(`gmake');
the native Make is simply _command(`make') and the external Make gets a name designating its source.
</P>
_subheader(`mkfifo(1)')
_bibliography(`
_bentr(`_link(`mkfifo(1)', `https://man.netbsd.org/mkfifo.1') (NetBSD)')
_bentr(`_link(`mkfifo(2)', `https://man.netbsd.org/mkfifo.2') (NetBSD)')
_bentr(`_link(`Use mkfifo to create named pipe', `https://dev.to/0xbf/use-mkfifo-to-create-named-pipe-linux-tips-5bbk')')
_bentr(`_link(`What is the purpose of using a FIFO vs a temporary file or a pipe?', `https://unix.stackexchange.com/questions/433488/what-is-the-purpose-of-using-a-fifo-vs-a-temporary-file-or-a-pipe')')
')
_subheader(`sh(1)')
_bibliography(`
_bentr(`_link(`Interview with Ken Thompson`,' 9-6-89', `https://tuhs.v6sh.org/UnixArchiveMirror/Documentation/OralHistory/transcripts/thompson.htm')')
')
_passage(`Interview with Ken Thompson, 9-6-89', `<P>We stole a shell out of a MULTICS, the concept of a shell. We stole per process execution. You know create a process -execute the command. From a combination of the two, although, neither of them really did it, MULTICS wanted to do it. But, it was so expensive creating a process that it ended up creating a few processes and then using them and putting them back on the shelf, then picking them up and reinitializing them. So, they never really created a process for command because it was just too expensive. The ION direction and the stuff like that and later in fact streams came from um the IO switch, that we worked on in MULTICS. Having everything work the same and just directing, you know, changing what it really pointed to.</P>')
_subsubheader(`DASH')
_bibliography(`
_bentr(`_link(`DASH', `http://gondor.apana.org.au/~herbert/dash/')')
_bentr(`_link(`DASH (cgit)', `https://git.kernel.org/pub/scm/utils/dash/dash.git')')
')
<P>
On _ref(`/linux/#alpine'), the _package(`dash-binsh') package configures DASH as the system's _file(`/bin/sh').
</P>
_subheader(`true(1)')
_bibliography(`
_bentr(`<A HREF="http://trillian.mit.edu/~jc/;-)/ATT_Copyright_true.html">CHAMBERS John - The /bin/true Command and Copyright</A>')
_bentr(`<A HREF="https://twitter.com/rob_pike/status/966896123548872705">PIKE Rob - "/bin/true used to be an empty file."</A>')
_bentr(`<A HREF="https://www.muppetlabs.com/~breadbox/software/tiny/teensy.html">RAITER Brian - A Whirlwind Tutorial on Creating Really Teensy ELF Executables for Linux</A>')
_bentr(`<A HREF="https://www.unix.com/man-page/posix/1p/true/">true(1p)</A> (The Open Group, 2003)')
_bentr(`<A HREF="https://www.gnu.org/">GNU</A>/<A HREF="https://www.gnu.org/software/coreutils/">coreutils</A>/<A HREF="https://git.savannah.gnu.org/cgit/coreutils.git/tree/src/true.c">src/true.c</A>')
_bentr(`<A HREF="https://www.netbsd.org/">NetBSD</A>/<A HREF="https://github.com/NetBSD/src/blob/trunk/usr.bin/true/true.sh">usr.bin/true/true.sh</A>')
')
<P>
_man(`true(1)') is a tool that <I>only</I> quits silently with an exit status of 0.
Similarly, _man(`false(1)') is a tool that <I>only</I> quits silently with an exit status of 1.
Recognizing arguments, printing to standard output, reading from standard input, or otherwise exiting with any other status of 0, is a violation of the POSIX specification for _man(`true(1)').
These utilities find use in shell scripting, which, though extremely relevant to these utilities, is beyond the scope of this article.
</P>
<P>
Because _man(`true(1)')'s required functionality is so simple a POSIX-compliant implementation is a one-liner in most languages, so long as you're willing to make an exception in your code styling.
For example, in C:
</P>
<PRE>
int main(void) { return 0; }
</PRE>
<P>
Because executing an empty shellscript file will in most shells do nothing and return an exit status of 0, technically an empty shellscript file is a POSIX-compliant _man(`true(1)') implementation in 0 bytes.
This was the _man(`true(1)') implementation on early versions of UNIX, including Research UNIX, System V, and Sun's Solaris, according to both Rob Pike and John Chambers.
A more explicit implementation also exists in POSIX shell:
</P>
<PRE>
#!/bin/sh
exit 0
</PRE>
<P>
This happens to be nearly identical in source to the implementation used by NetBSD.
</P>
<P>
Python has the same 0 byte _man(`true(1)') implementation feature as most shells.
Here's _man(`false(1)') in Python rather than _man(`true(1)') to demonstrate how exiting with an arbitrary exit status can be done:
</P>
<PRE>
import sys
sys.exit(1)
</PRE>
<P>
In some shells, _man(`true(1)') is a shell built-in command, so running _program(`true') will run the shell author's implementation of _man(`true(1)') rather than the system implementation.
</P>
<P>
GNU _man(`true(1)'), from the GNU coreutils, is well known for being a maximalist implementation - it's eighty lines long and directly includes four C header files.
Their _code(`true.c') is 2.3 kilobytes and parses the arguments _code(`--help') and _code(`--version') (only if either are the first argument to the program).
The GNU coreutils implementation of _man(`true(1)') is not POSIX compliant.
</P>
_subheader(`vi(1)')
_bibliography(`
_bentr(`_link(`vi(1p)', `https://man7.org/linux/man-pages/man1/vi.1p.html') (man7)')
')
<P>
Unlike _code(`busybox')'s _man(`ed(1)') implementation, its _man(`vi(1)') is very useable.
_man(`vim(1)') is a popular re-implementation of _man(`vi(1)').
</P>

16
wiki/unix/telepathy.m4 Normal file
View File

@ -0,0 +1,16 @@
_header(`Telepathy')
_subheader(`SSH')
<P><I>Secure SHell</I></P>
_subsubheader(`Keys')
<UL>
<LI><A HREF="https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account">Adding a new SSH key to your GitHub account</A> (GitHub Docs)</LI>
<LI><A HREF="https://docs.github.com/en/authentication/connecting-to-github-with-ssh/checking-for-existing-ssh-keys">Checking for existing SSH keys</A> (GitHub Docs)</LI>
<LI><A HREF="Generating a new SSH key and adding it to the ssh-agent">Generating a new SSH key and adding it to the ssh-agent</A> (GitHub Docs)</LI>
</UL>
<P>SSH keys are typically stored in <CODE>$HOME/.ssh</CODE>.</P>
<P>Typically, the public key's filename will be suffixed with <CODE>.pub</CODE>, while the private key will not.</P>
<P>You can generate an SSH key with <CODE>ssh-keygen(1)</CODE>. Currently the preferred implementation is <CODE>openssh-keygen</CODE>, part of the OpenSSH suite.</P>
<P>
Microsoft GitHub documentation suggests a user create a key with <CODE>ssh-keygen -t ed25519 -C "[<I>e-mail address</I>]"</CODE>.
This generates an <A HREF="https://en.wikipedia.org/wiki/EdDSA#Ed25519">Ed25519</A> SSH key with an e-mail address in the key comment.
</P>

81
wiki/unix/unix.m4 Normal file
View File

@ -0,0 +1,81 @@
_header(`UNIX')
_bibliography(`
_bentr(`_link(`Rudd Canaday', `https://en.wikipedia.org/wiki/Rudd_Canaday') (Wikipedia)')
_bentr(`_link(`History and Timeline', `https://unix.org/what_is_unix/history_timeline.html')')
_bentr(`_link(`Douglas McIlroy', `https://en.wikipedia.org/wiki/Douglas_McIlroy') (Wikipedia)')
_bentr(`_link(`Joe Ossanna', `https://en.wikipedia.org/wiki/Joe_Ossanna') (Wikipedia)')
_bentr(`_link(`A Research Unix Reader', `https://www.cs.dartmouth.edu/~doug/reader.pdf')')
_bentr(`_link(`Dennis Ritchie', `https://en.wikipedia.org/wiki/Dennis_Ritchie') (Wikipedia)')
_bentr(`_link(`Ken Thompson', `https://en.wikipedia.org/wiki/Ken_Thompson') (Wikipedia)')
_bentr(`_link(`Unix', `https://en.wikipedia.org/wiki/Unix') (Wikipedia)')
_bentr(`_link(`unix-history-repo', `https://github.com/dspinellis/unix-history-repo') (GitHub)')
_bentr(`_link(`The UNIX Time-sharing System - A Retrospective', `https://web.archive.org/web/20080504013206/http://cm.bell-labs.com/cm/cs/who/dmr/retro.html')')
')
_passage(`Wikipedia', `<P>
Unix (/ˈjuːnɪks/; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and others.
</P>')
_subheader(`V1')
_bibliography(`
_bentr(`_link(`The Creation of the UNIX Operating System', `https://web.archive.org/web/20140402192351/http://www.bell-labs.com/history/unix/')')
_bentr(`_link(`The Evolution of the Unix Time-sharing System', `https://www.bell-labs.com/usr/dmr/www/hist.html')')
_bentr(`_link(`The History of Unix', `https://archive.org/details/byte-magazine-1983-08/page/n189/')')
_bentr(`_link(`In their own words: Unix pioneers remember the good times', `https://www.networkworld.com/article/2168942/in-their-own-words--unix-pioneers-remember-the-good-times.html')')
_bentr(`_link(`Interview with Brian Kernighan', `https://www.linuxjournal.com/article/7035')')
_bentr(`_link(`Interview with Ken Thompson, 9-6-89', `https://tuhs.v6sh.org/UnixArchiveMirror/Documentation/OralHistory/transcripts/thompson.htm')')
_bentr(`_link(`Myths about Multics', `https://www.multicians.org/myths.html')')
_bentr(`_link(`Preliminary Unix Implementation Document - June 1972', `http://www.bitsavers.org/pdf/bellLabs/unix/PreliminaryUnixImplementationDocument_Jun72.pdf')')
_bentr(`_link(`Unix and Beyond: An Interview with Ken Thompson', `http://cse.unl.edu/~witty/class/csce351/howto/ken_thompson.pdf')')
_bentr(`_link(`Unix History', `https://livinginternet.com/i/iw_unix_dev.htm')')
_bentr(`_link(`Unix and Multics', `https://www.multicians.org/unix.html')')
_bentr(`_link(`The Unix Oral History Project', `https://web.archive.org/web/20080919055843/http://www.princeton.edu:80/~mike/expotape.htm')')
_bentr(`<A HREF="http://www.bitsavers.org/pdf/bellLabs/unix/UNIX_ProgrammersManual_Nov71.pdf">UNIX Programmers Manual - November 1971</A>')
')
<P>
UNIX was an operating systems experiment started when Bell Labs started to leave the Multics project because most of their community felt Multics hadn't delivered what it promised,
its titular _italic(`mult')iplexed _italic(`i')nformation and _italic(`c')omputing _italic(`s')ervice.
The Bell Labs engineers working on Multics at the time (Ken Thompson, Dennis Ritchie, Malcolm Douglas McIlroy, and Joseph Frank Ossanna) had realized Multics' goal as a system but at an unsustainable cost,
so, reading the writing on the wall, they began working on a new operating system and unsuccessfully lobbying Bell Labs for their own computer on which to work.
Thompson, Rudd H. Canaday, and Ritchie developed a heirarchical file system and Thompson simulated it on Multics.
Thompson also developed _cite(`Space Travel'), first for Multics, then for another operating system where it ran poorly.
Hoping to be able to continue to work on _cite(`Space Travel'), which simulated the movements of the major cellestial bodies of the Solar System and allowed the player to roam in a starship among them, past Multics' demise at Bell Labs,
Thompson rewrote the game to run on a spare PDP-7 at Bell.
Having written so much code already to get the PDP-7 to work, Thompson started to work on other things for it; a file system, some utilities for it, a command interpreter, and an assembler.
Then, mid-1970, Brian Kernighan named the non-multiplexing Multics workalike _italic(`Unics'), which was somehow (see _cite(`Interview with Brian Kernighan')) bastardized into _italic(`Unix').
</P>
_passage(`History and Timeline', `1971; First Edition; It had a assembler for a PDP-11/20, file system, fork(), roff and ed. It was used for text processing of patent documents.')
_subheader(`V4')
_passage(`History and Timeline', 1973; Fourth Edition; It was rewritten in C. This made it portable and changed the history of OS's.)
_subheader(`V5')
_bibliography(`
_bentr(`_link(`The UNIX time-sharing system', `https://dl.acm.org/doi/10.1145/361011.361061')')
')
_passage(`Unix and Multics',
`<P>
There had been a highly regarded ACM SIGOPS sponsored conference on operating systems at Gatlinburg, Tennessee in 1967.
The fourth of these conferences was held in Yorktown Heights, NY in 1973, and Ken and Dennis gave a talk there, presenting Unix.
Several of us Multicians went to the conference, and sat with the Bell Labs ex-Multicians, and applauded the paper, which was and remains one of the best and clearest pieces of writing in the computer field.
There were some other great papers at that conference, but as I remember, the Unix paper won the best paper award.
</P>'
<P>
I was working for MIT in those days`,' and one thing I did was to organize an MIT PDP-11 users' group and encourage them to look into Unix.
The idea of a free`,' non-vendor-supported operating system was new to them.
I invited Dennis Ritchie to come up and talk to them.
</P>
<P>
We went to lunch afterward`,' and I remarked to Dennis that easily half the code I was writing in Multics was error recovery code.
He said`,' "We left all that stuff out. If there's an error`,' we have this routine called panic()`,' and when it is called`,' the machine crashes`,' and you holler down the hall`,' 'Hey`,' reboot it.'"
</P>
)
_subheader(`V6')
_bibliography(`
_bentr(`_link(`Unix Sixth Edition root tree', `https://minnie.tuhs.org/cgi-bin/utree.pl?file=V6')')
')
_subheader(`V7')
_bibliography(`
_bentr(`_link(`Unix Advertising', `https://archive.ph/20130102004255/http://cm.bell-labs.com/cm/cs/who/dmr/unixad.html') (_link(`Original link', `http://cm.bell-labs.com/cm/cs/who/dmr/unixad.html'))')
')

90
wiki/unix/volumes.m4 Normal file
View File

@ -0,0 +1,90 @@
<H2 ID="partitioning">Partitions and filesystems</H2>
<UL>
<LI><A HREF="https://wiki.archlinux.org/title/EFI_system_partition">EFI system partition (Arch Wiki)</A></LI>
<LI><A HREF="https://wiki.artixlinux.org/Main/Installation#Partition_your_disk_.28BIOS.29">Installation#Partition your disk - Artix wiki</A></LI>
<LI><A HREF="https://wiki.archlinux.org/title/Installation_guide#Partition_the_disks">Installation guide#Partition the disks - Arch wiki</A></LI>
</UL>
<P>
Don't use partitioners included with OS media where the same job can be done by <A HREF="https://gparted.org/">GParted</A> (which has live media available) or another good general-purpose partitioner.
BSDs and Plan 9 are exceptions to this rule due to their exotic partitioning systems.
Using utilities from a shell or TUIs does not make you "cooler" than someone who needs a GUI for partitioning; in some cases, messing up partitioning can have serious consequences, so it's always nice to have some idiot-proofing.
I always partition my disks with the GParted live media.
</P>
<P>
You should do your own research on how you should partition your disks.
I personally use separate partitions for /boot, /home, /, and swap.
Your needs will vary.
</P>
<P>
<B>Please note that a separate boot partition is mandatory if you intend to boot via (U)EFI.</B>
Check out the linked pages in the "See also" section.
</P>
<P>
Use <CODE>mkfs(8)</CODE> for creating filesystems and <CODE>mount(8)</CODE> for mounting partitions' filesystems.
</P>
_subheader(`FFS')
<P>See _ref(`#volumes#ufs').</P>
<H3>gpart</H3>
<UL>
<LI><A HREF="https://en.wikipedia.org/wiki/Gpart">Gpart</A> (Wikipedia)</LI>
</UL>
<P>
Available as <CODE>sysutils/gpart</CODE> in pkgsrc.
</P>
<P>
<CODE>gpart(8)</CODE> is a tool that scans a file (or block device presented as a file) for drive partitions regardless of any table present on the medium.
</P>
<H3 ID="luks">LUKS</H3>
<UL>
<LI><A HREF="https://www.howtoforge.com/automatically-unlock-luks-encrypted-drives-with-a-keyfile/">Automatically Unlock LUKS Encrypted Drives With A Keyfile</A></LI>
<LI><A HREF="https://man.dragonflybsd.org/?command=cryptsetup&section=8">cryptsetup(8)</A> (DragonFly Man Pages)</LI>
<LI><A HREF="https://wiki.gentoo.org/wiki/Dm-crypt">Dm-crypt</A> (Gentoo Wiki)</LI>
<LI><A HREF="https://www.cyberciti.biz/security/how-to-backup-and-restore-luks-header-on-linux/">How to backup and restore LUKS header on Linux</A></LI>
<LI><A HREF="https://devconnected.com/how-to-encrypt-partition-on-linux/">How To Encrypt Partition on Linux</A></LI>
<LI><A HREF="https://unixfuntime.wordpress.com/2012/08/20/luks-passphrases-changing-adding-removing/">LUKS passphrases: Changing, adding, removing</A></LI>
<LI><A HREF="https://wiki.alpinelinux.org/wiki/LVM_on_LUKS">LVM on LUKS</A> (Alpine Wiki)</LI>
</UL>
<P>
<CODE>e2fsprogs</CODE> is needed for the <CODE>dm_mod</CODE> kernel module used for LUKS partition decryption.
</P>
<P>
To format a partition to a LUKS volume, determine the physical block device location for that partition and run <CODE>cryptsetup luksFormat [<I>partition</I>]</CODE>.
The passphrase used can be changed or removed after creation.
</P>
<P>
To open a LUKS volume, use <CODE>cryptsetup luksOpen [<I>partition</I>] [<I>name</I>]</CODE>.
This <I>name</I> is the name the <I>decrypted block device</I> location will take in <CODE>/dev/mapper/</CODE>.
</P>
<P>
Before the decrypted block device has a filesystem it'll just be cleared space - format as normal but use the decrypted block device location.
</P>
<P>
To mount a partition in an opened LUKS volume, use <CODE>mount(8)</CODE> as normal, just with the decrypted block device location.
</P>
<P>
To close an open LUKS volume, <CODE>umount(8)</CODE> any mapped and mounted partitions from the volume and <CODE>cryptsetup luksClose [<I>name</I>]</CODE>.
</P>
<P>
To make the LUKS partition openable via keyfile, first make a keyfile (<CODE>dd if=/dev/urandom of=/root/keyfile bs=1024 count=4</CODE> seems to work), and optionally make it readable by root only (<CODE>chmod 0400 [<I>keyfile</I>]</CODE>).
Then add the keyfile to the partition's LUKS header with <CODE>cryptsetup luksAddKey [<I>physical partition block device</I>] [<I>keyfile</I>]</CODE>.
</P>
<H4>dm-crypt</H4>
<P>
<CODE>dm-crypt</CODE> is a service that automatically mounts LUKS volumes at boot.
</P>
<P>
On most OpenRC-initialized distributions, the <CODE>cryptsetup-openrc</CODE> package provides <CODE>dmcrypt</CODE>.
Make sure that service is added to runlevel boot.
</P>
<P>
Configuration is in <CODE>/etc/conf.d/dmcrypt</CODE> and further configuration should be done in <CODE><A HREF="#fstab">fstab</A></CODE>.
<CODE>dm-crypt</CODE> will need the UUID of the <I>physical</I> block device while fstab (if being configured with UUIDs will need the UUID of the decrypted block device in the device mapper).
</P>
<H3>TestDisk</H3>
<UL>
<LI><A HREF="https://en.wikipedia.org/wiki/TestDisk">TestDisk</A> (Wikipedia)</LI>
</UL>
_subheader(`UFS')
_bibliography(`
_bentr(`_link(`Unix File System', `https://en.wikipedia.org/wiki/Unix_File_System') (Wikipedia)')
')

22
wiki/unix/wayland.m4 Normal file
View File

@ -0,0 +1,22 @@
_header(`Wayland')
_subheader(`wvkbd')
<P>
wvkbd (Wayland Virtual Keyboard) is a software keyboard implementation for
environments without a physical keyboard, such as a smartphone or tablet.
_ref(`#x#sxmo') uses wvkbd by default in its variant for Wayland.
</P>
<P>
wvkbd depends on _ref(`#x#cairo'), _ref(`#fonts#pango'), the Wayland client libraries, and xkb-common.
</P>
_subsubheader(`warning: implicit declaration of function `'zwp_virtual_keyboard_*`'')
<P>
Due to how the Makefile and _ref(`#posix#make(1)') work, if compilation is
attempted before _program(`wayland-scanner') is installed, an empty
_file(`proto/virtual-keyboard-unstable-v1-client-protocol.h') will be generated.
The preprocessor won't error for lack of the file but because the file will be
empty the necessary prototypes and constants will be missing and compilation
will fail.
</P>
<P>
_code(`make clean') should fix this.
</P>

19
wiki/unix/wifi.m4 Normal file
View File

@ -0,0 +1,19 @@
<H2>WiFi</H2>
<H3>wpa_supplicant</H3>
<P>
<CODE>wpa_supplicant(1)</CODE> is usually good enough for establishing WiFi connections.
</P>
<P>
Here's an example configuration for a simple WPA-2 PSK access point.
</P>
<PRE>
network={
ssid="My SSID"
key_mgmt=WPA-PSK
scan_ssid=1
psk="My password"
}
</PRE>
<P>
See <CODE>wpa_supplicant.conf(5)</CODE>.
</P>

34
wiki/wiki.m4 Normal file
View File

@ -0,0 +1,34 @@
changecom(`<!--', `-->')dnl
define(`_ASCII_UPPER', `ABCDEFGHIJKLMNOPQRSTUVWXYZ')dnl
define(`_ASCII_LOWER', `abcdefghijklmnopqrstuvwxyz')dnl
define(`_bibliography', `<UL>$1</UL>')dnl
define(`_bibliography_entry', `<LI>$1</LI>')dnl
define(`_bentr', `_bibliography_entry($1)')dnl
define(`_cite', `<CITE>$1</CITE>')dnl
define(`_code', `<CODE>$1</CODE>')dnl
define(`_em', `<EM>$1</EM>')dnl
define(`_header', `define(`_CURRENT_HEADER', $1)<H2 ID="_lowercase($1)">$1</H2>')dnl
define(`_italic', `<I>$1</I>')dnl
define(`_link', `<A HREF="$2">$1</A>')dnl
define(`_lowercase', `translit(`$1', _ASCII_UPPER, _ASCII_LOWER)')dnl
define(`_passage', `<FIGURE>
<BLOCKQUOTE>$2</BLOCKQUOTE>
<FIGCAPTION>(_cite(`$1'))</FIGCAPTION>
</FIGURE>')dnl
define(`_ref', `_link(`$1', `$1')')dnl
define(`_subheader', `<H3 ID="_lowercase(_CURRENT_HEADER)#_lowercase($1)">$1</H3>')dnl
define(`_subsubheader', `<H4>$1</H4>')dnl
<!DOCTYPE html>
<HTML LANG="en">
<HEAD>
<META CHARSET="UTF-8" />
<META CONTENT="_DESCRIPTION" NAME="description" />
<META CONTENT="noindex" NAME="googlebot" /> <!-- FUCK GOOGLE -->
<META CONTENT="interest-cohort=()" HTTP-EQUIV="Permissions-Policy" /> <!-- FUCK GOOGLE -->
<META CONTENT="width=device-width, initial-scale=1" NAME="viewport" />
<LINK HREF="https://be.murderu.us/_lowercase(_PAGE)" REL="canonical" />
<LINK HREF="../css/stylesheet.css" REL="stylesheet" />
<TITLE>_PAGE - murderu.us wiki</TITLE>
</HEAD>
<BODY>
<H1>_link(`be.murderu.us', `https://be.murderu.us/')/_lowercase(_PAGE)</H1>