From cab8833a3d3f2ce43ee525453cad1eee0f5c9f2b Mon Sep 17 00:00:00 2001
From: dtb
+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 _code(`musl-dev') package.
+
+In most system package managers, standard library documentation can be found in the _code(`man-pages') and _code(`man-pages-posix') packages.
+
+Many Linux software distributions' system package managers have meta-packages that pull all necessities for C development as dependencies.
+Alpine has _code(`build-base') and Debian has _code(`build-essential').
+
+For linking to libraries, see _ref(`#pkg-config').
+
+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. [Thompson 69] references
+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" is incompatible with "C89" and later standards.
+This page documents those incompatibilities and relative oddities.
+
+I have never done (and probably never will do) extensive programming in pre-ANSI C.
+These incompatibilities were discovered out of Appendix C in The C Programming Language, 2nd ed. but are described further.
+
+On my machine, the GNU C compiler emits the following errors (this omits warnings) for the preceding piece of code:
+
+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,
+This behavior exists within
+This wouldn't be a significant or even noticeable error; most programmers wouldn't use
+X is a graphical windowing system that can be used on Linux, FreeBSD, OpenBSD, NetBSD, and some proprietary operating systems as well.
+X is not the only windowing system;
+Some Linux software distributions have included scripts to automatically fetch and install an X server.
+Alpine has
+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.
+
+
+The de-facto standard X server is X.org (available on the web at _literal_link(https://www.X.org)).
+NetBSD uses X.org as the default system X server.
+
+Arch Linux's package repositories have You need to be a part of the You need to be a part of the
+It's possible to make X
+TOR Browser is available through pkgsrc at
+
+On Alpine Linux, Advanced Configuration and Power Interface
+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)').
+
+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:
+
+Emacs ("editor macros") is a text editor with a very powerful Lisp interpreter included.
+
+_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.
+
+_man(`ne(1)') is similar to _man(`nano(1)') but has a different featureset.
+
+This wiki page is the work of many Anonymous authors.
+Please support our type of Internet denizen by getting into trouble.
+ See _man(`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.
+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.
+
+_man(`acpid(8)') is a daemon that can automatically manage ACPI events on Linux.
+
+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; Debian and many popular Debian-based distributions come pre-configured with PulseAudio.
+
+The Alpine wiki ("Adding sound") says to install _code(`alsa-conf'), _code(`alsa-lib'), and _code(`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 _code(`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.
+
+Deprecated, unfortunately.
+
+Provided by the _code(`pipewire') package on Alpine.
+
+This means you need _code(`rtkit') installed and running through your initialization system.
+
+On Alpine you'll need the _code(`pulseaudio'), _code(`pulseaudio-alsa'), and _code(`alsa-plugins-pulse') packages for PulseAudio with ALSA compatibility.
+Start _man(`pulseaudio(1)') when you want audio, ideally in your _code(`.xinitrc').
+
+Linux is usually obtained as part of a software distribution put together to form a useable operating system.
+
+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').
+
+Arch is known for using the latest versions of programs, which has given it an undeserved reputation of instability.
+
+Use _man(`pacstrap(8)').
+
+At a minimum you need the _code(`base') package.
+Select a kernel and install the corresponding package; _code(`linux'), _code(`linux-lts'), or another Linux configuration or fork.
+The Arch wiki says you need to install _code(`linux-firmware'), this isn't strictly necessary but it is recommended.
+Install _code(`base-devel') if you plan on using the AUR or if you don't know what the AUR is yet.
+
+It's also a good idea to install any utilities you'll need on the bootstrapped system.
+Text editors, network managers or utilities, and other administration tools, for example.
+Manual utilities such as _code(`man-db') and others would also be useful.
+ From the annals of my notes, 2021-06-04:
+Artix is a Linux software distribution based on Arch that doesn't mandate SystemD as its initialization system.
+
+This process differs from Arch's bootstrapping process.
+Artix uses _man(`basestrap(8)') rather than _man(`pacstrap(8)');
+you need to select the initialization you want to use: _code(`66'), _code(`dinit'), _code(`openrc'), _code(`runit'), or _code(`s6-base'), as a package separate from _code(`base');
+and Artix's official wiki says you need to install the appropriate _link(`#logind', `_code(`elogind')') package (_code(`elogind-[initialization system]') e.g. _code(`elogind-66')) but like _code(`linux-firmware') though it is helpful it isn't strictly necessary.
+
+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.
+
+While it's possible to use non-Linux kernels within Debian, it's uncommon and the only non-Linux option currently maintained is the GNU HURD microkernel.
+
+postmarketOS is an Alpine-based Linux software distribution that makes configuring and using Linux easy on mobile devices.
+
+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:
+
+On a live system you can then _code(`rc-service networkmanager restart') to restart NetworkManager and have it load the new configuration.
+
+Ubuntu is a derivative of Debian.
+
+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.
+
+_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)').
+
+Xenia was an entry for the Linux logo competition which Tux eventually won.
+
+In the context of POSIX and UNIX-like systems, an "on-line" manual is a manual that is accessible via the computer system it documents.
+Particularly, the
+Alpine by default uses
+_man(`htop(1)') is a featureful alternative to _man(`top(1)').
+
+Busybox and NetBSD provide implementations of _code(`top(1)'), an interactive in-terminal task manager.
+
+Install
+
+Install Install
+Do not use SSL workarounds like (in the case of git)
+If using Mullvad, you have to change the shebang on See Setting
+Available as
+
+NetBSD includes
+pkg-config provides a way to link to libraries independent of a particular system's directory heirarchy.
+
+The relevant manual pages on NetBSD are Try
+See
+_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 (
+Additions to _code(`man(1)') are controversial; Rob Pike and Brian Kernighan explain this in _italic(`Program Design in the UNIX Environment'), the paper that accompanied Rob Pike's presentation _italic(`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)'):
+
+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.
+
+The following is an implementation of _man(`echo(1)') in shell.
+
+A particularly shoddy attempt at _man(`ed(1)') is provided by _code(`busybox').
+A traditional _man(`ed(1)') implementation is in plan9ports.
+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')).
+
+_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.
+
+_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:
+
+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:
+
+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:
+
+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.
+
+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)').
+ Secure SHell SSH keys are typically stored in Typically, the public key's filename will be suffixed with You can generate an SSH key with
+Microsoft GitHub documentation suggests a user create a key with
+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
+Available as
+
+
+To format a partition to a LUKS volume, determine the physical block device location for that partition and run
+To open a LUKS volume, use
+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
+To close an open LUKS volume,
+To make the LUKS partition openable via keyfile, first make a keyfile (
+
+On most OpenRC-initialized distributions, the
+Configuration is in
+
+Here's an example configuration for a simple WPA-2 PSK access point.
+
+See
-In the context of POSIX and UNIX-like systems, an "on-line" manual is a manual that is accessible via the computer system it documents.
-Particularly, the
Alpine by default uses
-The de-facto standard X server is X.org (available on the web at _literal_link(https://www.X.org)).
+The de-facto standard X server is X.org (available on the web at _ref(https://www.X.org)).
NetBSD uses X.org as the default system X server.
diff --git a/wiki/unix/culture.m4 b/wiki/unix/culture.m4
index 9376aaa..762a6bf 100644
--- a/wiki/unix/culture.m4
+++ b/wiki/unix/culture.m4
@@ -1,5 +1,5 @@
_header(`Culture')
_subheader(`Pronunciation')
_bibliography(`
-_bentry(`_link(`Common pronunciations of Linux directories, commands, etc', `https://www.linux.org/threads/common-pronunciations-of-linux-directories-commands-etc.4445/')')
+_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/foreword.m4 b/wiki/unix/foreword.m4
deleted file mode 100644
index d416b5e..0000000
--- a/wiki/unix/foreword.m4
+++ /dev/null
@@ -1,5 +0,0 @@
-
-This wiki page is the work of many Anonymous authors.
-Please support our type of Internet denizen by getting into trouble.
-
diff --git a/wiki/unix/multitasking.m4 b/wiki/unix/multitasking.m4
index 4fa9b73..141e3eb 100644
--- a/wiki/unix/multitasking.m4
+++ b/wiki/unix/multitasking.m4
@@ -2,8 +2,8 @@ _header(`Multitasking')
_subheader(`Task management')
_subsubheader(`htop(1)')
_bibliography(`
-_bentry(`_link(`htop', `https://en.wikipedia.org/wiki/Htop') (Wikipedia)')
-_bentry(`_link(`htop - an interactive process viewer', `https://htop.dev/')')
+_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)').
diff --git a/wiki/unix/posix.m4 b/wiki/unix/posix.m4
index 9be1176..1cae270 100644
--- a/wiki/unix/posix.m4
+++ b/wiki/unix/posix.m4
@@ -6,37 +6,37 @@ _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')')
')
-_header(`as(1)')
-
_man(`cat(1)') is a program that exists to catenate files; to "join" one file at its end to another at its start.
WIKI.MURDERU.US
+
+
+
+
diff --git a/wiki/unix/C.m4 b/wiki/unix/C.m4
new file mode 100644
index 0000000..5d98e46
--- /dev/null
+++ b/wiki/unix/C.m4
@@ -0,0 +1,112 @@
+_header(`C')
+
+
+
+
+K. Thompson, `Bon—an Interactive Language,' undated AT&T Bell Laboratories internal memorandum (ca. 1969). This is possibly Bon User's Manual.
+Please get in touch if you have a hyperlink for this document as I can't find it indexed on any search engines.c78(7) manual page on FreeBSD 9.0.
+
+
+8 and 9 as valid octal digits
+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
+ );
+}
+
+
+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
+ | ^~
+
+8 and 9 were valid octal digits corresponding to 010(b8) and 011(b8).
+This is documented in 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
+
+/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 getnum, a function used in /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.
+8 or 9 as octal digits anyway.
+If not for its documentation within The C Programming Language it would probably be an obscure bug.
+This is also mentioned in The C Programming Language, 2nd ed. in Appendix C.
+
+
+_subheader(`C2011')
+_subheader(`C2017')
+_subheader(`C202x')
diff --git a/wiki/unix/Makefile b/wiki/unix/Makefile
new file mode 100644
index 0000000..b56c5ac
--- /dev/null
+++ b/wiki/unix/Makefile
@@ -0,0 +1,33 @@
+SOURCES = \
+ ../wiki.m4 \
+ macros.m4 \
+ foreword.m4 \
+ unix.m4 \
+ posix.m4 \
+ acpi.m4 \
+ C.m4 \
+ culture.m4 \
+ doas.m4 \
+ editing.m4 \
+ fonts.m4 \
+ fstab.m4 \
+ linux.m4 \
+ m4.m4 \
+ netbsd.m4 \
+ manual.m4 \
+ multitasking.m4 \
+ pci.m4 \
+ telepathy.m4 \
+ wifi.m4 \
+ volumes.m4 \
+ X.m4
+
+RM = rm -rf
+
+index.html: index.m4 $(SOURCES)
+ m4 index.m4 >index.html
+
+clean:
+ $(RM) index.html
+
+.PHONY: clean
diff --git a/wiki/unix/X.m4 b/wiki/unix/X.m4
new file mode 100644
index 0000000..438e1f3
--- /dev/null
+++ b/wiki/unix/X.m4
@@ -0,0 +1,71 @@
+X
+
+
+twin(1) exists for windowed multitasking within a framebuffer and Wayland is another windowing system intended to replace X.
+setup-xorg-base, which adds the packages xorg-server, xf86-input-libinput, eudev, and mesa, and then enables the OpenRC services for udev.
+Mail
+Media
+mpv(1) and vlc(1) are good options.
+Server
+
+X.org
+
+
+https://archlinux.org/groups/x86_64/xorg/,
+https://archlinux.org/groups/x86_64/xorg-apps/,
+and https://archlinux.org/groups/x86_64/xorg-drivers/ package groups.
+#pkgsrc has _code(`meta-pkgs/modular-xorg').
+Failed to open /dev/input/event[number] (Permission denied)
+ input group to use X.org.Failed to open /dev/tty[number] (Permission denied)
+ video group to use X.org.Window Management
+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
+
+
+Web Browsing
+TOR Browser
+security/tor-browser.
+xinit(1)
+startx(1) is usually included with xinit(1).
+xinit(1) is provided by the xinit package.
+On Arch Linux, xinit(1) is provided by https://archlinux.org/packages/extra/x86_64/xorg-xinit/.
+
+$ su
+# ed /etc/doas.conf
+/etc/doas.conf: No such file or directory
+a
+permit :wheel
+.
+w
+14
+q
+
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')
+Foreword
+wiki.murderu.us/unix
+
+include(`foreword.m4')
+
+include(`unix.m4')
+
+include(`posix.m4')
+
+include(`acpi.m4')
+
+include(`C.m4')
+
+include(`culture.m4')
+
+include(`doas.m4')
+
+include(`editing.m4')
+
+include(`fonts.m4')
+
+include(`fstab.m4')
+
+include(`linux.m4')
+
+include(`m4.m4')
+
+include(`netbsd.m4')
+
+include(`manual.m4')
+
+include(`multitasking.m4')
+
+include(`pci.m4')
+
+include(`telepathy.m4')
+
+include(`wifi.m4')
+
+include(`volumes.m4')
+
+include(`X.m4')
+
+
+
diff --git a/wiki/unix/linux.m4 b/wiki/unix/linux.m4
new file mode 100644
index 0000000..70f15dd
--- /dev/null
+++ b/wiki/unix/linux.m4
@@ -0,0 +1,229 @@
+_header(`Linux')
+
+
+
+ACPI
+_bibliography(`
+_bentr(`_ref(`#ACPI')')
+')
+
+
+OSS
+PipeWire
+
+
+RTKit error: org.freedesktop.DBus.Error.ServiceUnknown
+
+PulseAudio
+Alpine
+
+Always install manual pages
+Arch
+Bootstrapping
+Ubiquitous packages missing
+
+Had an issue with pacman missing some ubiquitous packages (esr's 'ascii', xorg-xev, etc).
+This fixed it. I don't really know why - maybe some issues with my repos?
+This was cleanly installed artix-openrc.
+
+[5:46 PM] Bassman Leyla: So what I did is I went into /etc/pacman.d/mirrorlist-arch and uncommented a local mirror
+[5:46 PM] Bassman Leyla: Then I appended a config block a package maintainer gave me onto /etc/pacman.conf
+[5:46 PM] Bassman Leyla: I'll paste it in
+[5:47 PM] Bassman Leyla:
+'''
+#
+# 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
+'''
+
+Artix
+
+
+Bootstrapping
+Debian
+
+postmarketOS
+Random MAC address generation on Wifi
+
+[device]
+wifi.scan-rand-mac-address=no
+
+Ubuntu
+
+
+
+
+
+m4
+
diff --git a/wiki/unix/macros.m4 b/wiki/unix/macros.m4
new file mode 100644
index 0000000..a1e28e2
--- /dev/null
+++ b/wiki/unix/macros.m4
@@ -0,0 +1 @@
+define(`_man', `_cite($1)')dnl
diff --git a/wiki/unix/manual.m4 b/wiki/unix/manual.m4
new file mode 100644
index 0000000..8a0660d
--- /dev/null
+++ b/wiki/unix/manual.m4
@@ -0,0 +1,11 @@
+On-line manual
+
+man(1) utility and the manual "pages" it references.
+mandoc.
+Battery
+envstat(1) can show the current battery status.Mounting filesystems
+
+
+dmesg(8) to determine the location in /dev/ of the disk.disklabel(8) the drive to determine which partition on the disk you want to access (disklabel /dev/disk)mount(8) the filesystem.umount(8) the filesystem when done using it.ext4
+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
+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
+
+security/mozilla-rootcerts-openssl.GIT_SSL_NO_VERIFY.
+These leave your system open to man-in-the-middle attacks.
+OpenVPN
+
+
+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
+
+syslogd(8) and syslog.conf(5), which pertain to system logging.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
+
+
+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.
+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.
+pkg-config
+
+
+pkgconf(1), pc(5), and pkg.m4(7).
+pkgsrc
+
+
+pkg_add: Conflicting PLIST
+
+pkg_admin(1).Upgrading packages
+
+
+pkgtools/pkg_rolling_replace.
+
+
+
+_header(`as(1)')
+
+
+GAS
+
+
+
+_header(`cat(1)')
+
+
+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.
+
+#!/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)')
+
+
+
+#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;
+}
+
+
+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(`find(1)')
+
+
+
+_subheader(`echo(1)')
+
+
+
+
+_subheader(`true(1)')
+
+
+
+int main(void) { return 0; }
+
+
+#!/bin/sh
+exit 0
+
+
+import sys
+sys.exit(1)
+
+
+
+
+
+$HOME/.ssh..pub, while the private key will not.ssh-keygen(1). Currently the preferred implementation is openssh-keygen, part of the OpenSSH suite.ssh-keygen -t ed25519 -C "[e-mail address]".
+This generates an Ed25519 SSH key with an e-mail address in the key comment.
+UNIX
+
+_bentr(`_link(`Unix', `https://en.wikipedia.org/wiki/Unix') (Wikipedia)')
+
diff --git a/wiki/unix/volumes.m4 b/wiki/unix/volumes.m4
new file mode 100644
index 0000000..17138de
--- /dev/null
+++ b/wiki/unix/volumes.m4
@@ -0,0 +1,84 @@
+Partitions and filesystems
+
+
+mkfs(8) for creating filesystems and mount(8) for mounting partitions' filesystems.
+gpart
+
+
+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.
+cryptsetup luksFormat [partition].
+The passphrase used can be changed or removed after creation.
+cryptsetup luksOpen [partition] [name].
+This name is the name the decrypted block device location will take in /dev/mapper/.
+mount(8) as normal, just with the decrypted block device location.
+umount(8) any mapped and mounted partitions from the volume and cryptsetup luksClose [name].
+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.
+cryptsetup-openrc package provides dmcrypt.
+Make sure that service is added to runlevel boot.
+/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
+
+
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.
+
+network={
+ ssid="My SSID"
+ key_mgmt=WPA-PSK
+ scan_ssid=1
+ psk="My password"
+}
+
+wpa_supplicant.conf(5).
+$1
')dnl
+define(`_bibliography_entry', `$1')dnl
+define(`_header', `$1
')dnl
+define(`_subheader', `$1
')dnl
+define(`_subsubheader', `$1
')dnl
+define(`_link', `$1')dnl
+define(`_ref', `_link(`$1', `$1')')dnl
From 1e93814f9f470147e763b1531db2289cde509878 Mon Sep 17 00:00:00 2001
From: dtb WIKI.MURDERU.US
+wiki.murderu.us
+Contributing
+
+
+_header(`Manuals')
+_bibliography(`
+_bentr(`http://www.bitsavers.org/pdf/bellLabs/unix/UNIX_ProgrammersManual_Nov71.pdf')
+_bentr(`_link(`The Linux man-pages project', `https://www.kernel.org/doc/man-pages/')')
+')
man(1) utility and the manual "pages" it references.
+One of UNIX's innovations was its inclusion of a detailed, useful manual accessible on-system, accessible via _man(`man(1)').
mandoc.
diff --git a/wiki/unix/posix.m4 b/wiki/unix/posix.m4
index e47b56e..9be1176 100644
--- a/wiki/unix/posix.m4
+++ b/wiki/unix/posix.m4
@@ -1,7 +1,10 @@
_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')')
+')
_header(`as(1)')
From 12217d7321e6c958915d2cc024dd86a6c1913c02 Mon Sep 17 00:00:00 2001
From: dtb
Foreword
-wiki.murderu.us/unix
-include(`foreword.m4')
-
include(`unix.m4')
include(`posix.m4')
diff --git a/wiki/unix/macros.m4 b/wiki/unix/macros.m4
index d35fe66..3986eb1 100644
--- a/wiki/unix/macros.m4
+++ b/wiki/unix/macros.m4
@@ -1,3 +1,4 @@
+define(`_command', `_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
index 3d687c9..01afa96 100644
--- a/wiki/unix/manual.m4
+++ b/wiki/unix/manual.m4
@@ -1,6 +1,5 @@
_header(`Manuals')
_bibliography(`
-_bentr(`http://www.bitsavers.org/pdf/bellLabs/unix/UNIX_ProgrammersManual_Nov71.pdf')
_bentr(`_link(`The Linux man-pages project', `https://www.kernel.org/doc/man-pages/')')
')
-
-GAS
-
-
+_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/')')
+')
-_header(`cat(1)')
-
-
+_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.')
+')
-Additions to _code(`man(1)') are controversial; Rob Pike and Brian Kernighan explain this in _italic(`Program Design in the UNIX Environment'), the paper that accompanied Rob Pike's presentation _italic(`UNIX Style, or cat -v Considered Harmful') at the 1983 USENIX Summer Conference. +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.
@@ -96,13 +96,13 @@ exit 0 _subheader(`echo(1)') -
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. @@ -149,15 +149,22 @@ while :; do 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')') +') + _subheader(`find(1)') -
A particularly shoddy attempt at _man(`ed(1)') is provided by _code(`busybox'). A traditional _man(`ed(1)') implementation is in plan9ports. @@ -174,22 +181,22 @@ the native Make is simply _command(`make') and the external Make gets a name des
_subheader(`mkfifo(1)') -_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. @@ -233,9 +240,9 @@ The GNU coreutils implementation of _man(`true(1)') is not POSIX compliant.
_subheader(`vi(1)') -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/unix.m4 b/wiki/unix/unix.m4 index 0df0507..0544bd4 100644 --- a/wiki/unix/unix.m4 +++ b/wiki/unix/unix.m4 @@ -1,5 +1,35 @@ -
+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(`Rudd Canaday', `https://en.wikipedia.org/wiki/Rudd_Canaday') (Wikipedia)') +_bentr(`_link(`The Evolution of the Unix Time-sharing System', `https://www.bell-labs.com/usr/dmr/www/hist.html')') +_bentr(`_link(`Douglas McIlroy', `https://en.wikipedia.org/wiki/Douglas_McIlroy') (Wikipedia)') +_bentr(`_link(`Interview with Brian Kernighan', `https://www.linuxjournal.com/article/7035')') +_bentr(`_link(`Myths about Multics', `https://www.multicians.org/myths.html')') +_bentr(`_link(`Joe Ossanna', `https://en.wikipedia.org/wiki/Joe_Ossanna') (Wikipedia)') +_bentr(`_link(`Ken Thompson', `https://en.wikipedia.org/wiki/Ken_Thompson') (Wikipedia)') +_bentr(`_link(`Unix History', `https://livinginternet.com/i/iw_unix_dev.htm')') +_bentr(`_link(`The Unix Oral History Project', `https://web.archive.org/web/20080919055843/http://www.princeton.edu:80/~mike/expotape.htm')') +_bentr(`http://www.bitsavers.org/pdf/bellLabs/unix/UNIX_ProgrammersManual_Nov71.pdf') +') ++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'). +
diff --git a/wiki/wiki.m4 b/wiki/wiki.m4 index 960b7a2..14cb4f5 100644 --- a/wiki/wiki.m4 +++ b/wiki/wiki.m4 @@ -5,7 +5,12 @@ define(`_bentr', `_bibliography_entry($1)')dnl define(`_cite', `$1')dnl define(`_code', `$1')dnl
define(`_header', `$2+
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,
From 85f9a14806be18de7c45f86d9f6602d809df75e6 Mon Sep 17 00:00:00 2001
From: dtb
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,
From c54f7f7aecc536bb039951b7e244fcb230ab87f9 Mon Sep 17 00:00:00 2001
From: dtb wiki.murderu.us
+be.murderu.us
diff --git a/wiki/unix/index.m4 b/wiki/unix/index.m4
index d66b8b6..7caff86 100644
--- a/wiki/unix/index.m4
+++ b/wiki/unix/index.m4
@@ -6,14 +6,14 @@
-
+
-wiki.murderu.us/unix
+be.murderu.us/unix
include(`unix.m4')
From e50cab2d15d35e8a6c993a48bcadcf4d68296783 Mon Sep 17 00:00:00 2001
From: dtb