From 0c23741f858b896db49147a4c0fe17ec48db3c90 Mon Sep 17 00:00:00 2001 From: dtb Date: Mon, 17 Oct 2022 22:37:05 -0400 Subject: [PATCH] fleshing out some more --- homepage/software/index.m4 | 274 +++++++++++++++++++------------------ 1 file changed, 138 insertions(+), 136 deletions(-) diff --git a/homepage/software/index.m4 b/homepage/software/index.m4 index c6c0ba4..f4edc1d 100644 --- a/homepage/software/index.m4 +++ b/homepage/software/index.m4 @@ -43,9 +43,10 @@ Plan 9 from Bell Labs, due to its historical relationship with UNIX, will be men

echo(1)

Don't use _code(`echo(1)'), use _code(`printf(1)'). @@ -104,6 +105,73 @@ A traditional _code(`ed(1)') implementation is in plan9ports. I'm pretty sure some later UNIX-based OSes doubled the _code(`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')).

+

true(1)

+ +

+_code(`true(1)') is a tool that only quits silently with an exit status of 0. +Similarly, _code(`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 _code(`true(1)'). +These utilities find use in shell scripting, which, though extremely relevant to these utilities, is beyond the scope of this article. +

+

+Because _code(`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 _code(`true(1)') implementation in 0 bytes. +This was the _code(`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 _code(`true(1)') implementation feature as most shells. +Here's _code(`false(1)') in Python rather than _code(`true(1)') to demonstrate how exiting with an arbitrary exit status can be done: +

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

+In some shells, _code(`true(1)') is a shell built-in command, so running _code(`true') will run the shell author's implementation of _code(`true(1)') rather than the system implementation. +

+

+GNU _code(`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 _code(`true(1)') is not POSIX compliant. +

+ +

vi

+ +

+Unlike _code(`busybox')'s _code(`ed(1)') implementation, its _code(`vi(1)') is very useable. +_code(`vim(1)') is a popular re-implementation of _code(`vi(1)'). +

+

util-linux

+ +

+_code(`util-linux') is distributed on all popular Linux distributions and contains utilities users may expect to be already present on their systems, like _code(`more(1)') or _code(`hexdump(1)'). +

+

Advanced Configuration and Power Interface

-

NetBSD

- -

Battery

-

_code(`envstat(1)') can show the current battery status.

-

Mounting filesystems

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

ext4

-

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

-

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

-

exFAT

-

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

-

Fix _code(`SSL certificate problem: unable to get local issuer certificate')

- -

Install _code(`security/mozilla-rootcerts-openssl').

-

-Do not use SSL workarounds like (in the case of git) _code(`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 _code(`update-resolv-conf(8)') -(a standalone Bash script included in the OpenVPN configurations from Mullvad, intended to be placed in _code(`/etc/openvpn/')) -from _code(`#!/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 _code(`syslogd(8)') and _code(`syslog.conf(5)'), which pertain to system logging.

-

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

Upgrading

- -

PCI Utilities