diff --git a/wiki/.build.yml b/wiki/.build.yml new file mode 100644 index 0000000..d56f99e --- /dev/null +++ b/wiki/.build.yml @@ -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 diff --git a/wiki/.gitignore b/wiki/.gitignore new file mode 100644 index 0000000..e5af9ee --- /dev/null +++ b/wiki/.gitignore @@ -0,0 +1 @@ +/unix/index.html diff --git a/wiki/LICENSE b/wiki/LICENSE new file mode 100644 index 0000000..68a49da --- /dev/null +++ b/wiki/LICENSE @@ -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 diff --git a/wiki/Makefile b/wiki/Makefile new file mode 100644 index 0000000..eb58f69 --- /dev/null +++ b/wiki/Makefile @@ -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 diff --git a/wiki/css/stylesheet.css b/wiki/css/stylesheet.css new file mode 100644 index 0000000..2f63adb --- /dev/null +++ b/wiki/css/stylesheet.css @@ -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; } diff --git a/wiki/favicon.ico b/wiki/favicon.ico new file mode 100644 index 0000000..f4267c8 Binary files /dev/null and b/wiki/favicon.ico differ diff --git a/wiki/game/index.m4 b/wiki/game/index.m4 new file mode 100644 index 0000000..0566038 --- /dev/null +++ b/wiki/game/index.m4 @@ -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')', ` +

+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. +

') + +

+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. +

+ +include(`../tail.m4')dnl diff --git a/wiki/index.html b/wiki/index.html new file mode 100644 index 0000000..254fcf2 --- /dev/null +++ b/wiki/index.html @@ -0,0 +1,31 @@ + + + + + + + + + + +the murderu.us wiki + + +

be.murderu.us

+ +

Contributing

+ +

+The contents of this site are generated by the git repository at https://git.sr.ht/~trinity/wiki. +

+ + diff --git a/wiki/linux/a.out.m4 b/wiki/linux/a.out.m4 new file mode 100644 index 0000000..732694b --- /dev/null +++ b/wiki/linux/a.out.m4 @@ -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/')') +') diff --git a/wiki/linux/acpi.m4 b/wiki/linux/acpi.m4 new file mode 100644 index 0000000..8425c40 --- /dev/null +++ b/wiki/linux/acpi.m4 @@ -0,0 +1,14 @@ +_header(`ACPI') +_bibliography(` +_bentr(`_ref(`/unix/#ACPI')') +') +

+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. +

+_subheader(`acpid(8)') +_bibliography(` +_bentr(`_link(`acpid', `https://sourceforge.net/projects/acpid2/')') +') +

+_man(`acpid(8)') is a daemon that can automatically manage ACPI events on Linux. +

diff --git a/wiki/linux/alpine.m4 b/wiki/linux/alpine.m4 new file mode 100644 index 0000000..f531149 --- /dev/null +++ b/wiki/linux/alpine.m4 @@ -0,0 +1,95 @@ +_header(`Alpine') +

+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. +

+ +_subheader(`apk(8)') +_bibliography(` +_bentr(`_link(`Alpine Package Keeper', `https://wiki.alpinelinux.org/wiki/Alpine_Package_Keeper') (Alpine Wiki)') +_bentr(`Alpine repositories content search') +') +_subsubheader(`Adding software') +_man(`apk-add(8)') +_subsubheader(`Repositories') +

+See _man(`apk-repositories(5)'). +

+

+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: +

+
+http://dl-cdn.alpinelinux.org/alpine/edge/main
+http://dl-cdn.alpinelinux.org/alpine/edge/community
+http://dl-cdn.alpinelinux.org/alpine/edge/testing
+
+

+Local directories like _file(`/media/cdrom/apks'), an example from the Alpine Wiki, are valid as well. +

+_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')') +') +

+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. +

+ +_subheader(`Always install manual pages') +

+Alpine doesn't include man pages in program packages to save on space, instead keeping them in _code(`[package]-doc') sibling packages. +To always install doc packages with program packages, _code(`apk add docs'). +

+ +_subheader(`Bootstrapping') +

+See _ref(`#bootstrapping'). +The Alpine setup scripts also exist to aid in the bootstrap process. +

+

+To bootstrap _man(`apk(8)') do the following: +

+
    +
  1. Copy _man(`apk-keys(5)') to the analogous location on the mounted volume.
  2. +
  3. Fill out _man(`apk-repositories(5)') on the mount.
  4. +
  5. Use _man(`apk-add(8)') to initialize the package database on the mount (_command(`apk --root [mount] add --initdb alpine-base')).
  6. +
+

+Copy _man(`resolv.conf(5)') over (and bind _file(`/dev/'), _file(`/proc/'), and _file(`/sys/')) before _ref(`/unix/#posix#chroot(1)')ing. +

+

+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. +

+ +_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', +`

setup-alpine is jank.

') +

+_program(`setup-hostname') validates a _man(`hostname(5)') before writing to the mounted volume. +

+

+_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. +

+ +_subheader(`postmarketOS') +

+postmarketOS is an Alpine-based Linux software distribution that makes configuring and using Linux easy on mobile devices. +

+
Random MAC address generation on Wifi
+

+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: +

+
+[device]
+wifi.scan-rand-mac-address=no
+
+

+On a live system you can then _code(`rc-service networkmanager restart') to restart NetworkManager and have it load the new configuration. +

diff --git a/wiki/linux/arch.m4 b/wiki/linux/arch.m4 new file mode 100644 index 0000000..d87acdb --- /dev/null +++ b/wiki/linux/arch.m4 @@ -0,0 +1,72 @@ +_header(`Arch') +

+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')). +

+ +_subheader(`AUR') +

+You will need _package_arch(`base-devel'). +

+ +_subheader(`Bootstrapping') +

+See _ref(`#bootstrapping'). +Use _man(`pacstrap(8)') on Arch and _man(`basestrap(8)') on Artix. +

+

+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. +

+

+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. +

+_passage(`Config block conveyed to Leyla by an Arch package maintainer, shared to the Tebibyte Media Discord server 2021-06-04T1746+0500', +` +
+#
+# 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
+
+') + +_subheader(`Artix') +_bibliography(` +_bentr(`Artix Linux') +_bentr(`Artix Linux (Wikipedia)') +') +

+Artix is a Linux software distribution based on Arch that doesn't mandate SystemD as its initialization system. +

+ +_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')') +') +

+_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. +

diff --git a/wiki/linux/audio.m4 b/wiki/linux/audio.m4 new file mode 100644 index 0000000..e5186d8 --- /dev/null +++ b/wiki/linux/audio.m4 @@ -0,0 +1,48 @@ +_header(`Audio') +

+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. +

+_subheader(`ALSA') +_bibliography(` +_bentr(`Adding sound (Alpine Linux Wiki)') +_bentr(`ALSA lib conf Evaluate error') +_bentr(`ALSA lib pcm_dmix.c:1108:(snd_pcm_dmix_open) unable to open slave') +') +

+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. +

+

+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. +

+

+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. +

+_subheader(`OSS') +

+Deprecated, unfortunately. +

+_subheader(`PipeWire') +_bibliography(` +_bentr(`PipeWire (Alpine Linux Wiki)') +_bentr(`PipeWire (FreeDesktop Wiki)') +') +

+Provided by the _package_alpine(`pipewire') package on Alpine. +

+
+RTKit error: org.freedesktop.DBus.Error.ServiceUnknown
+
+

+This means you need _program(`rtkit') installed and running through your initialization system. +

+_subheader(`PulseAudio') +

+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'). +

diff --git a/wiki/linux/bootstrapping.m4 b/wiki/linux/bootstrapping.m4 new file mode 100644 index 0000000..ddf051a --- /dev/null +++ b/wiki/linux/bootstrapping.m4 @@ -0,0 +1,31 @@ +_header(`Bootstrapping') +

+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. +

+

+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. +

+_passage(`veronika on the Alpine Linux Discord server, 2022-12-04T1111+0400',` +

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).

+

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

+') +

+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. +

+

+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 base 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. +

+

+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 /[mount]/$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). +

diff --git a/wiki/linux/debian.m4 b/wiki/linux/debian.m4 new file mode 100644 index 0000000..c98e2fc --- /dev/null +++ b/wiki/linux/debian.m4 @@ -0,0 +1,22 @@ +_header(`Debian') +_bibliography(` +_bentr(`_link(`Debian', `https://www.debian.org/')') +_bentr(`_link(`Debian', `https://en.wikipedia.org/wiki/Debian') (Wikipedia)') +') +

+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. +

+

+The vast majority of support and attention is on the Debian GNU+Linux configuration. +

+ +_subheader(`Ubuntu') + +

+Ubuntu is a derivative of Debian Linux. +

diff --git a/wiki/linux/devices.m4 b/wiki/linux/devices.m4 new file mode 100644 index 0000000..679a3bf --- /dev/null +++ b/wiki/linux/devices.m4 @@ -0,0 +1,4 @@ +_header(`Devices') +_bibliography(` +_bentr(`_link(`udev', `https://en.wikipedia.org/wiki/Udev') (Wikipedia)') +') diff --git a/wiki/linux/distribution.m4 b/wiki/linux/distribution.m4 new file mode 100644 index 0000000..777bb81 --- /dev/null +++ b/wiki/linux/distribution.m4 @@ -0,0 +1,8 @@ +_subheader(`Distribution') +

+Linux is usually obtained as part of a software distribution put together to form a useable operating system. +

+ +_subsubheader(_ref(`#alpine')) +_subsubheader(_ref(`#arch')) +_subsubheader(_ref(`#debian')) diff --git a/wiki/linux/hostname.m4 b/wiki/linux/hostname.m4 new file mode 100644 index 0000000..060e343 --- /dev/null +++ b/wiki/linux/hostname.m4 @@ -0,0 +1,4 @@ +_header(`hostname') +

+The special file _file(`/proc/sys/kernel/hostname') directly controls the system hostname in the kernel. +

diff --git a/wiki/linux/index.m4 b/wiki/linux/index.m4 new file mode 100644 index 0000000..91e79b8 --- /dev/null +++ b/wiki/linux/index.m4 @@ -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 + + +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 diff --git a/wiki/linux/initialization.m4 b/wiki/linux/initialization.m4 new file mode 100644 index 0000000..b95e0cd --- /dev/null +++ b/wiki/linux/initialization.m4 @@ -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') diff --git a/wiki/linux/initramfs.m4 b/wiki/linux/initramfs.m4 new file mode 100644 index 0000000..538362a --- /dev/null +++ b/wiki/linux/initramfs.m4 @@ -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)') +') +

+_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. +

diff --git a/wiki/linux/login.m4 b/wiki/linux/login.m4 new file mode 100644 index 0000000..83ed3f6 --- /dev/null +++ b/wiki/linux/login.m4 @@ -0,0 +1,17 @@ +_header(`Login') + +_subheader(`logind') +_bibliography(` +_bentr(`elogind') +_bentr(`elogind (Gentoo Wiki)') +_bentr(`org.freedesktop.login1') +_bentr(`logind (NixOS Wiki)') +') +

+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)'). +

+

+On systems without SystemD and with conflicting software, _code(`elogind(8)') may be used. +

diff --git a/wiki/linux/macros.m4 b/wiki/linux/macros.m4 new file mode 100644 index 0000000..02142b3 --- /dev/null +++ b/wiki/linux/macros.m4 @@ -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 diff --git a/wiki/linux/util-linux.m4 b/wiki/linux/util-linux.m4 new file mode 100644 index 0000000..f0bca6b --- /dev/null +++ b/wiki/linux/util-linux.m4 @@ -0,0 +1,7 @@ +_subheader(`util-linux') +_bibliography(` +_bentr(`_link(`util-linux', `https://en.wikipedia.org/wiki/Util-linux') (Wikipedia)') +') +

+_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)'). +

diff --git a/wiki/linux/volumes.m4 b/wiki/linux/volumes.m4 new file mode 100644 index 0000000..50c37b6 --- /dev/null +++ b/wiki/linux/volumes.m4 @@ -0,0 +1,15 @@ +_header(`File systems') +

+Also see _ref(`/unix/#volumes'). +

+ +_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)) +') +

+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'). +

diff --git a/wiki/page.mk b/wiki/page.mk new file mode 100644 index 0000000..e0ce0de --- /dev/null +++ b/wiki/page.mk @@ -0,0 +1,9 @@ +RM = rm -f + +index.html: *.m4 + m4 index.m4 >index.html + +clean: + $(RM) index.html + +.PHONY: clean diff --git a/wiki/tail.m4 b/wiki/tail.m4 new file mode 100644 index 0000000..e04310f --- /dev/null +++ b/wiki/tail.m4 @@ -0,0 +1,2 @@ + + diff --git a/wiki/unix/C.m4 b/wiki/unix/C.m4 new file mode 100644 index 0000000..6d9de07 --- /dev/null +++ b/wiki/unix/C.m4 @@ -0,0 +1,112 @@ +_header(`C') +

+For compilation, _man(`tcc(1)'), _man(`gcc(1)'), and _man(`clang(1)') are all reasonable choices depending on your needs. +

+

+On Alpine Linux, the standard library headers are in the _package(`musl-dev') package. +

+

+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'). +

+

+For linking to libraries, see _ref(`#pkg-config'). +

+ +_subheader(`C1978') + +

+The C programming language was first described to the public in The C Programming Language 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: +

+
+
+

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.

+
+
(The Development of the C Language)
+
+

+[Thompson 69] references _cite(`K. Thompson, "Bon—an Interactive Language," undated AT&T Bell Laboratories internal memorandum (ca. 1969)'). +This is possibly Bon User's Manual 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.

+

+This language described in The C Programming Language 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 K&R). +This was known as "pre-ANSI C" or "K&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 c78(7) manual page on FreeBSD 9.0. +

+_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') +') +
+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
+	);
+}
+
+

+The GNU C compiler emits the following errors (this omits warnings) for the preceding piece of code: +

+
+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
+      |                                                     ^~
+
+

+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: +

+
+0
+1
+2
+3
+4
+5
+6
+7
+8
+9
+
+

+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. +

+

+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. +

+_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')') +') +

+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'). +

+_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') diff --git a/wiki/unix/X.m4 b/wiki/unix/X.m4 new file mode 100644 index 0000000..3df5298 --- /dev/null +++ b/wiki/unix/X.m4 @@ -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)') +') +

+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. +

+ +_subheader(`Anki') +

+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. +

+_subsubheader(`_code(`ModuleNotFoundError: No module named `'aqt`'')') +

+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. +

+

+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'). +

+ +_subheader(`cairo') +_bibliography(` +_bentr(`_link(`cairo', `https://en.wikipedia.org/wiki/Cairo_(graphics)') (Wikipedia)') +') +

+cairo is a graphics rendering library, originally for X but later made cross-platform. +

+

+cairo is available on _ref(`/linux/#alpine') as _package(`cairo-dev'). +

+ +_subheader(`Fonts') +_subsubheader(`日本語') +_bibliography(` +_bentr(`_link(`Xorg', `https://gitlab.freedesktop.org/xorg/')/_link(`font/jis-misc', `https://gitlab.freedesktop.org/xorg/font/jis-misc')') +') +

+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')). +

+ +_subheader(`Mail') +

+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. +

+ +_subheader(`Media') +

+_man(`mpv(1)') and _man(`vlc(1)') are good options. +

+ +_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)') +') +

+The de-facto standard X server is X.org. +NetBSD uses X.org as the default system X server. +

+

+_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'). +

+
_code(`Failed to open /dev/input/event[_italic(`number')] (Permission denied)')
+

You need to be a part of the _italic(`input') group to use X.org.

+
_code(`Failed to open /dev/tty[_italic(`number')] (Permission denied)')
+

You need to be a part of the _italic(`video') group to use X.org.

+ +_subheader(`Managing Clients') +

+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). +

+

ctwm

+_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')') +') +

+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. +

+ +_subheader(`WWW') +_subsubheader(`TOR Browser') +

+TOR Browser is available through pkgsrc at _package(`security/tor-browser'). +

+ +_subheader(`xinit(1)') +

+_man(`startx(1)') is usually included with _man(`xinit(1)'). +

+

+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/'). +

diff --git a/wiki/unix/acpi.m4 b/wiki/unix/acpi.m4 new file mode 100644 index 0000000..e09b561 --- /dev/null +++ b/wiki/unix/acpi.m4 @@ -0,0 +1,13 @@ +_header(`ACPI') +

Advanced Configuration and Power Interface

+_bibliography(` +_bentr(`_link(`Advanced Configuration and Power Interface', `https://en.wikipedia.org/wiki/Advanced_Configuration_and_Power_Interface') (Wikipedia)') +') +

+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. +

+

+On Linux, see _ref(`#Linux#ACPI'). +On NetBSD, see _man(`acpi(4)'). +

diff --git a/wiki/unix/archives.m4 b/wiki/unix/archives.m4 new file mode 100644 index 0000000..ce45d9d --- /dev/null +++ b/wiki/unix/archives.m4 @@ -0,0 +1,6 @@ +_header(`Archives') + +_subheader(`cpio') +_bibliography(` +_bentr(`_link(`cpio', `https://en.wikipedia.org/wiki/Cpio') (Wikipedia)') +') diff --git a/wiki/unix/bootloader.m4 b/wiki/unix/bootloader.m4 new file mode 100644 index 0000000..3c02140 --- /dev/null +++ b/wiki/unix/bootloader.m4 @@ -0,0 +1 @@ +_header(`Bootloader') diff --git a/wiki/unix/culture.m4 b/wiki/unix/culture.m4 new file mode 100644 index 0000000..1353537 --- /dev/null +++ b/wiki/unix/culture.m4 @@ -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/')') +') diff --git a/wiki/unix/doas.m4 b/wiki/unix/doas.m4 new file mode 100644 index 0000000..41752a9 --- /dev/null +++ b/wiki/unix/doas.m4 @@ -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')') +') +

+doas(1) is a systems administration tool that performs a command as a different user. +doas(1) is configured in doas.conf(5). +

+

+For a pretty typical configuration, where users in the wheel group are meant to be administrating the system, the set-up session usually looks something like this: +

+
+$ su
+# ed /etc/doas.conf
+/etc/doas.conf: No such file or directory
+a
+permit :wheel
+.
+w
+14
+q
+
+

+_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'). +

diff --git a/wiki/unix/editing.m4 b/wiki/unix/editing.m4 new file mode 100644 index 0000000..3748f9b --- /dev/null +++ b/wiki/unix/editing.m4 @@ -0,0 +1,13 @@ +_header(`Editing') +_subheader(`emacs') +

+Emacs ("editor macros") is a text editor with a very powerful Lisp interpreter included. +

+_subheader(`nano(1)') +

+_man(`nano(1)') is a text editor that's usually recommended for beginners because of its lack of edit modes and its similar controls to popular editors from outside of UNIX. +

+_subheader(`ne(1)') +

+_man(`ne(1)') is similar to _man(`nano(1)') but has a different featureset. +

diff --git a/wiki/unix/fonts.m4 b/wiki/unix/fonts.m4 new file mode 100644 index 0000000..95b4e35 --- /dev/null +++ b/wiki/unix/fonts.m4 @@ -0,0 +1,65 @@ +_header(`Fonts') +

+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/')') +') +

+As of 2021-04, Noto has fonts for 54% of Unicode. +

+

+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-*'). +

+ +_subheader(`Pango') +_bibliography(` +_bentr(`_link(`Pango', `https://pango.gnome.org/')') +') +

+Pango is a font rendering library. +

+

+Pango is packaged for _ref(`/linux/#alpine') as _package(`pango-dev'). +

+ +_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/')') +') +

+Unscii is packaged as _package(`fonts/unscii') on _ref(`#pkgsrc'). +

+ +_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')') +') +

+jiskan is a family of fonts comprising jiskan16 and jiskan24. +

+_subsubheader(`あずき') +_bibliography(` +_bentr(`_link(`あずきフォント', `http://azukifont.com/font/azuki.html')') +') diff --git a/wiki/unix/fstab.m4 b/wiki/unix/fstab.m4 new file mode 100644 index 0000000..104bc4d --- /dev/null +++ b/wiki/unix/fstab.m4 @@ -0,0 +1,3 @@ +_header(`fstab(5)') +

postmarketOS requires that the _code(`localmount') OpenRC service be enabled for the system to read _man(`fstab(5)'). +

Arch and Artix have fstab generators at _man(`genfstab(8)') and _man(`fstabgen(8)') respectively in their installation scripts.

diff --git a/wiki/unix/index.m4 b/wiki/unix/index.m4 new file mode 100644 index 0000000..6090131 --- /dev/null +++ b/wiki/unix/index.m4 @@ -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 diff --git a/wiki/unix/linux.m4 b/wiki/unix/linux.m4 new file mode 100644 index 0000000..0e5ace6 --- /dev/null +++ b/wiki/unix/linux.m4 @@ -0,0 +1,3 @@ +_header(`Linux') +

+See _ref(`/linux/'). diff --git a/wiki/unix/macros.m4 b/wiki/unix/macros.m4 new file mode 100644 index 0000000..2b3cbaf --- /dev/null +++ b/wiki/unix/macros.m4 @@ -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 diff --git a/wiki/unix/manual.m4 b/wiki/unix/manual.m4 new file mode 100644 index 0000000..01afa96 --- /dev/null +++ b/wiki/unix/manual.m4 @@ -0,0 +1,10 @@ +_header(`Manuals') +_bibliography(` +_bentr(`_link(`The Linux man-pages project', `https://www.kernel.org/doc/man-pages/')') +') +

+One of UNIX's innovations was its inclusion of a detailed, useful manual accessible on-system, accessible via _man(`man(1)'). +

+

+Alpine by default uses mandoc. +

diff --git a/wiki/unix/multitasking.m4 b/wiki/unix/multitasking.m4 new file mode 100644 index 0000000..141e3eb --- /dev/null +++ b/wiki/unix/multitasking.m4 @@ -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/')') +') +

+_man(`htop(1)') is a featureful alternative to _man(`top(1)'). +

+_subsubheader(`top(1)') +

+Busybox and NetBSD provide implementations of _code(`top(1)'), an interactive in-terminal task manager. +

diff --git a/wiki/unix/netbsd.m4 b/wiki/unix/netbsd.m4 new file mode 100644 index 0000000..34a3e48 --- /dev/null +++ b/wiki/unix/netbsd.m4 @@ -0,0 +1,66 @@ +_header(`NetBSD') + +

Battery

+

envstat(1) can show the current battery status.

+

Mounting filesystems

+
    +
  1. Connect the drive with the filesystem you want to access.
  2. +
  3. Use dmesg(8) to determine the location in /dev/ of the disk.
  4. +
  5. disklabel(8) the drive to determine which partition on the disk you want to access (disklabel /dev/disk)
  6. +
  7. mount(8) the filesystem.
  8. +
  9. umount(8) the filesystem when done using it.
  10. +
+

ext4

+

+Install filesystems/fuse and filesystems/fuse-ext2. +disklabel(8) will list ext4 filesystems as of type "Linux Ext2". +Use fuse-ext2(1) to mount the filesystem. +

+

+fuse-ext2(1) is spotty in places and may not work correctly. +

+

exFAT

+

+Install filesystems/fuse and filesystems/fuse-exfat. +Use mount.exfat to mount the filesystem (the manual page for which is mount.exfat-fuse(8)). +

+

Fix SSL certificate problem: unable to get local issuer certificate

+ +

Install security/mozilla-rootcerts-openssl.

+

+Do not use SSL workarounds like (in the case of git) GIT_SSL_NO_VERIFY. +These leave your system open to man-in-the-middle attacks. +

+

OpenVPN

+ +

+If using Mullvad, you have to change the shebang on update-resolv-conf(8) +(a standalone Bash script included in the OpenVPN configurations from Mullvad, intended to be placed in /etc/openvpn/) +from #!/bin/bash to _code(`#!/usr/pkg/bin/bash') if using Bash from pkgsrc or another appropriate location if using a different package manager. +

+

rc.d

+ +

System logging

+ +

See syslogd(8) and syslog.conf(5), which pertain to system logging.

+

Setting DDB_ONPANIC (see options(4) and sysctl(8)) will save a crash dump at /var/crash on kernel panic. +

Upgrading

+ diff --git a/wiki/unix/pci.m4 b/wiki/unix/pci.m4 new file mode 100644 index 0000000..94d25d6 --- /dev/null +++ b/wiki/unix/pci.m4 @@ -0,0 +1,15 @@ +

PCI Utilities

+ +

+Available as sysutils/pciutils from pkgsrc. +Supplies lspci(8), setpci(8), and update-pciids(8). +

+

+update-pciids(8) is not part of the pciutils package in Alpine Linux repositories. +

+

+NetBSD includes pcictl(8) which offers similar functionality. +pcictl pci0 list outputs roughly the same information as lspci(8), though lspci(8) may offer slightly more detailed information. +

diff --git a/wiki/unix/pkg-config.m4 b/wiki/unix/pkg-config.m4 new file mode 100644 index 0000000..873c298 --- /dev/null +++ b/wiki/unix/pkg-config.m4 @@ -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)') +') +

+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. +

+

+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. +

diff --git a/wiki/unix/pkgsrc.m4 b/wiki/unix/pkgsrc.m4 new file mode 100644 index 0000000..82947b1 --- /dev/null +++ b/wiki/unix/pkgsrc.m4 @@ -0,0 +1,17 @@ +

pkgsrc

+ +

pkg_add: Conflicting PLIST

+ +

Try pkg_admin(1).

+

Upgrading packages

+ +

+See pkgtools/pkg_rolling_replace. +

diff --git a/wiki/unix/posix.m4 b/wiki/unix/posix.m4 new file mode 100644 index 0000000..610f25d --- /dev/null +++ b/wiki/unix/posix.m4 @@ -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.') +') +

+_man(`cat(1)') is a program that exists to catenate files; to "join" one file at its end to another at its start. +

+

+_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 (cat "$@" | sed '/^\s*$/d' would also work), +_code(`-n') to number lines (to which Pike and Kernighan offered awk '{ print NR "\t" $0 }' "$@" 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. +

+

+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. +

+ +

+The following shell script is a POSIX-compliant implementation of _man(`cat(1)'): +

+ +
+#!/bin/sh
+set -e
+
+DD=dd
+
+# usage with 0 arguments - print standard input to standard output
+if test -z "$1"; then
+	dd 2>/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 </dev/stdin 2>/dev/null
+			shift; continue; ;;
+		esac
+	fi
+
+	# Print input to output.
+	$DD <"$1" 2>/dev/null
+
+	shift
+done
+
+exit 0
+
+ +_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/')') +') +

+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. +

+

+_code(`printf "%s" "$*"') does not work as _man(`echo(1)') though it's been said to do so (including by this page). +

+

+The following is an implementation of _man(`echo(1)') in the C programming language, using the standard library. +

+
+#include <stdio.h>
+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;
+}
+
+

+The following is an implementation of _man(`echo(1)') in shell. +

+
+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
+
+ +_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')') +') +

+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')). +

+_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', ` +
+/* 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.
+
') +

+_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. +

+_subsubheader(`plan9ports') +_bibliography(` +_bentr(`_link(`src/cmd/ed.c', `view-source:https://9fans.github.io/usr/local/plan9/src/cmd/ed.c')') +') +

+Pretty good in use, but if you're using _package(`plan9port') consider checking out _man(`sam(1)'), a much more powerful line editor. +

+ +_subheader(`find(1)') + + +_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')') +') +

+_man(`make(1)') in modern times is fragmented into the GNU version gmake and the BSD version bmake. +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. +

+ +_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', `

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.

') +_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')') +') +

+On _ref(`/linux/#alpine'), the _package(`dash-binsh') package configures DASH as the system's _file(`/bin/sh'). +

+ +_subheader(`true(1)') +_bibliography(` +_bentr(`CHAMBERS John - The /bin/true Command and Copyright') +_bentr(`PIKE Rob - "/bin/true used to be an empty file."') +_bentr(`RAITER Brian - A Whirlwind Tutorial on Creating Really Teensy ELF Executables for Linux') +_bentr(`true(1p) (The Open Group, 2003)') +_bentr(`GNU/coreutils/src/true.c') +_bentr(`NetBSD/usr.bin/true/true.sh') +') +

+_man(`true(1)') is a tool that only quits silently with an exit status of 0. +Similarly, _man(`false(1)') is a tool that only 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. +

+

+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: +

+
+int main(void) { return 0; }
+
+

+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: +

+
+#!/bin/sh
+exit 0
+
+

+This happens to be nearly identical in source to the implementation used by NetBSD. +

+

+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: +

+
+import sys
+sys.exit(1)
+
+

+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. +

+

+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. +

+ +_subheader(`vi(1)') +_bibliography(` +_bentr(`_link(`vi(1p)', `https://man7.org/linux/man-pages/man1/vi.1p.html') (man7)') +') +

+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)'). +

diff --git a/wiki/unix/telepathy.m4 b/wiki/unix/telepathy.m4 new file mode 100644 index 0000000..b977172 --- /dev/null +++ b/wiki/unix/telepathy.m4 @@ -0,0 +1,16 @@ +_header(`Telepathy') +_subheader(`SSH') +

Secure SHell

+_subsubheader(`Keys') + +

SSH keys are typically stored in $HOME/.ssh.

+

Typically, the public key's filename will be suffixed with .pub, while the private key will not.

+

You can generate an SSH key with ssh-keygen(1). Currently the preferred implementation is openssh-keygen, part of the OpenSSH suite.

+

+Microsoft GitHub documentation suggests a user create a key with ssh-keygen -t ed25519 -C "[e-mail address]". +This generates an Ed25519 SSH key with an e-mail address in the key comment. +

diff --git a/wiki/unix/unix.m4 b/wiki/unix/unix.m4 new file mode 100644 index 0000000..a6b05a0 --- /dev/null +++ b/wiki/unix/unix.m4 @@ -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', `

+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. +

') + +_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(`UNIX Programmers Manual - November 1971') +') +

+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'). +

+_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', +`

+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. +

' +

+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. +

+

+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.'" +

+) + +_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'))') +') diff --git a/wiki/unix/volumes.m4 b/wiki/unix/volumes.m4 new file mode 100644 index 0000000..7478ab4 --- /dev/null +++ b/wiki/unix/volumes.m4 @@ -0,0 +1,90 @@ +

Partitions and filesystems

+ +

+Don't use partitioners included with OS media where the same job can be done by GParted (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. +

+

+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. +

+

+Please note that a separate boot partition is mandatory if you intend to boot via (U)EFI. +Check out the linked pages in the "See also" section. +

+

+Use mkfs(8) for creating filesystems and mount(8) for mounting partitions' filesystems. +

+_subheader(`FFS') +

See _ref(`#volumes#ufs').

+

gpart

+ +

+Available as sysutils/gpart in pkgsrc. +

+

+gpart(8) 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. +

+

LUKS

+ +

+e2fsprogs is needed for the dm_mod kernel module used for LUKS partition decryption. +

+

+To format a partition to a LUKS volume, determine the physical block device location for that partition and run cryptsetup luksFormat [partition]. +The passphrase used can be changed or removed after creation. +

+

+To open a LUKS volume, use cryptsetup luksOpen [partition] [name]. +This name is the name the decrypted block device location will take in /dev/mapper/. +

+

+Before the decrypted block device has a filesystem it'll just be cleared space - format as normal but use the decrypted block device location. +

+

+To mount a partition in an opened LUKS volume, use mount(8) as normal, just with the decrypted block device location. +

+

+To close an open LUKS volume, umount(8) any mapped and mounted partitions from the volume and cryptsetup luksClose [name]. +

+

+To make the LUKS partition openable via keyfile, first make a keyfile (dd if=/dev/urandom of=/root/keyfile bs=1024 count=4 seems to work), and optionally make it readable by root only (chmod 0400 [keyfile]). +Then add the keyfile to the partition's LUKS header with cryptsetup luksAddKey [physical partition block device] [keyfile]. +

+

dm-crypt

+

+dm-crypt is a service that automatically mounts LUKS volumes at boot. +

+

+On most OpenRC-initialized distributions, the cryptsetup-openrc package provides dmcrypt. +Make sure that service is added to runlevel boot. +

+

+Configuration is in /etc/conf.d/dmcrypt and further configuration should be done in fstab. +dm-crypt will need the UUID of the physical block device while fstab (if being configured with UUIDs will need the UUID of the decrypted block device in the device mapper). +

+

TestDisk

+ +_subheader(`UFS') +_bibliography(` +_bentr(`_link(`Unix File System', `https://en.wikipedia.org/wiki/Unix_File_System') (Wikipedia)') +') diff --git a/wiki/unix/wayland.m4 b/wiki/unix/wayland.m4 new file mode 100644 index 0000000..1ab1baa --- /dev/null +++ b/wiki/unix/wayland.m4 @@ -0,0 +1,22 @@ +_header(`Wayland') +_subheader(`wvkbd') +

+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. +

+

+wvkbd depends on _ref(`#x#cairo'), _ref(`#fonts#pango'), the Wayland client libraries, and xkb-common. +

+_subsubheader(`warning: implicit declaration of function `'zwp_virtual_keyboard_*`'') +

+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. +

+

+_code(`make clean') should fix this. +

diff --git a/wiki/unix/wifi.m4 b/wiki/unix/wifi.m4 new file mode 100644 index 0000000..9c24d19 --- /dev/null +++ b/wiki/unix/wifi.m4 @@ -0,0 +1,19 @@ +

WiFi

+

wpa_supplicant

+

+wpa_supplicant(1) is usually good enough for establishing WiFi connections. +

+

+Here's an example configuration for a simple WPA-2 PSK access point. +

+
+network={
+	ssid="My SSID"
+	key_mgmt=WPA-PSK
+	scan_ssid=1
+	psk="My password"
+}
+
+

+See wpa_supplicant.conf(5). +

diff --git a/wiki/wiki.m4 b/wiki/wiki.m4 new file mode 100644 index 0000000..30344dd --- /dev/null +++ b/wiki/wiki.m4 @@ -0,0 +1,34 @@ +changecom(`')dnl +define(`_ASCII_UPPER', `ABCDEFGHIJKLMNOPQRSTUVWXYZ')dnl +define(`_ASCII_LOWER', `abcdefghijklmnopqrstuvwxyz')dnl +define(`_bibliography', `')dnl +define(`_bibliography_entry', `
  • $1
  • ')dnl +define(`_bentr', `_bibliography_entry($1)')dnl +define(`_cite', `$1')dnl +define(`_code', `$1')dnl +define(`_em', `$1')dnl +define(`_header', `define(`_CURRENT_HEADER', $1)

    $1

    ')dnl +define(`_italic', `$1')dnl +define(`_link', `$1')dnl +define(`_lowercase', `translit(`$1', _ASCII_UPPER, _ASCII_LOWER)')dnl +define(`_passage', `
    +
    $2
    +
    (_cite(`$1'))
    +
    ')dnl +define(`_ref', `_link(`$1', `$1')')dnl +define(`_subheader', `

    $1

    ')dnl +define(`_subsubheader', `

    $1

    ')dnl + + + + + + + + + + +_PAGE - murderu.us wiki + + +

    _link(`be.murderu.us', `https://be.murderu.us/')/_lowercase(_PAGE)