shellsnippets/shellsnippets.git
4 days agoanother example for CPU temperature master
mirabilos [Sat, 16 Oct 2021 23:42:22 +0000 (01:42 +0200)]
another example for CPU temperature

4 days ago&^$%(*%^%)ing GNU screen fucks up UTF-8 in hardstatus…
mirabilos [Sat, 16 Oct 2021 23:39:20 +0000 (01:39 +0200)]
&^$%(*%^%)ing GNU screen fucks up UTF-8 in hardstatus…

4 days agobattery state and CPU temperature in screen hardstatus
mirabilos [Sat, 16 Oct 2021 23:11:56 +0000 (01:11 +0200)]
battery state and CPU temperature in screen hardstatus

3 weeks agoconstruct the target /dev tmpfs under yet another tmpfs…
mirabilos [Tue, 28 Sep 2021 19:12:29 +0000 (21:12 +0200)]
construct the target /dev tmpfs under yet another tmpfs…

… we temporarily mount, whose mountpoint is the mktemp -d /tmp/mnt.XXX
we used to use for the target’s /dev-under-construction before; run
mount --make-private on *that* before doing the mount --move because,
“moving a mount residing under a shared mount is unsupported”, and,
on Grml.org, all mounts seem to be under a shared mount :/

3 weeks agoavoid doing 'var=value cmd'
mirabilos [Tue, 28 Sep 2021 18:42:50 +0000 (20:42 +0200)]
avoid doing 'var=value cmd'

if cmd is e.g. a function, some shells do not export var

3 weeks agodo not over-redirect stdin if that's where the shell reads from
mirabilos [Tue, 28 Sep 2021 18:30:21 +0000 (20:30 +0200)]
do not over-redirect stdin if that's where the shell reads from

3 weeks agoimprove image umounting/etc. error handling
mirabilos [Fri, 24 Sep 2021 01:24:30 +0000 (03:24 +0200)]
improve image umounting/etc. error handling

3 weeks agosh -c needs another argument in between for using "$@" due to $0
mirabilos [Fri, 24 Sep 2021 01:16:20 +0000 (03:16 +0200)]
sh -c needs another argument in between for using "$@" due to $0

3 weeks agosome message optimisation for the rpi command
mirabilos [Fri, 24 Sep 2021 01:07:54 +0000 (03:07 +0200)]
some message optimisation for the rpi command

3 weeks agoadd oneshot RPi image/SD card mount+go+umount command
mirabilos [Fri, 24 Sep 2021 00:35:34 +0000 (02:35 +0200)]
add oneshot RPi image/SD card mount+go+umount command

including mounting the firmware/boot partition and fscking both

3 weeks agoclear tty after running; from mkrpi3b+img.sh
mirabilos [Fri, 24 Sep 2021 00:12:05 +0000 (02:12 +0200)]
clear tty after running; from mkrpi3b+img.sh

3 weeks agofix command before target for . (cwd)
mirabilos [Thu, 23 Sep 2021 23:53:24 +0000 (01:53 +0200)]
fix command before target for . (cwd)

3 weeks agouse workaround, copying the mapper devices used (tested) for now
mirabilos [Thu, 23 Sep 2021 23:47:33 +0000 (01:47 +0200)]
use workaround, copying the mapper devices used (tested) for now

3 weeks agothis should pick up mmcblk as well
mirabilos [Thu, 23 Sep 2021 23:28:42 +0000 (01:28 +0200)]
this should pick up mmcblk as well

3 weeks agomissing mmcblk can be fixed by debchroot.sh now
mirabilos [Thu, 23 Sep 2021 23:21:18 +0000 (01:21 +0200)]
missing mmcblk can be fixed by debchroot.sh now

3 weeks agoRevert "use UTS namespace to change to the target’s hostname"
mirabilos [Thu, 23 Sep 2021 23:16:13 +0000 (01:16 +0200)]
Revert "use UTS namespace to change to the target’s hostname"

unfortunately not enough to namespace the chroot’s syslog output

This reverts commit 46679bc7dbfc6233f9d37806c848a1ccfffa463c.

3 weeks agouse UTS namespace to change to the target’s hostname
mirabilos [Thu, 23 Sep 2021 23:15:53 +0000 (01:15 +0200)]
use UTS namespace to change to the target’s hostname

3 weeks agoset up /dev as copy of host’s but with fixed uid/gid numerics
mirabilos [Thu, 23 Sep 2021 23:15:16 +0000 (01:15 +0200)]
set up /dev as copy of host’s but with fixed uid/gid numerics

this also bind-mounts /dev/log making logger work

4 weeks agohuh, rpi /dev/ doesn’t have mmcblk by default, and firmware woes
mirabilos [Mon, 20 Sep 2021 16:07:28 +0000 (18:07 +0200)]
huh, rpi /dev/ doesn’t have mmcblk by default, and firmware woes

4 weeks agoupdate header accordingly
mirabilos [Mon, 20 Sep 2021 16:04:00 +0000 (18:04 +0200)]
update header accordingly

4 weeks agohuh that can be many questions… tell the user he can just hit Enter
mirabilos [Mon, 20 Sep 2021 16:00:29 +0000 (18:00 +0200)]
huh that can be many questions… tell the user he can just hit Enter

(I wonder… we only set the prio to low for locale etc…)

(cherry picked from commit 4ebc27f68f5d13750f1effef36183d4ee020573c)

4 weeks agofactor out
mirabilos [Sun, 15 Nov 2020 23:32:10 +0000 (00:32 +0100)]
factor out

(cherry picked from commit c71ce8e3b664ed20897d6e55c2ed60c70ccf7d39)

4 weeks agoswitch to raspi-firmware, from buster-backports if needed
mirabilos [Sun, 15 Nov 2020 23:18:32 +0000 (00:18 +0100)]
switch to raspi-firmware, from buster-backports if needed

(cherry picked from commit 86ffcd05e7f8702c94305cd8f2d9d49abf44adec)

4 weeks agoalways re-run raspi firmware setup script, we shall patch more
mirabilos [Sun, 15 Nov 2020 23:13:47 +0000 (00:13 +0100)]
always re-run raspi firmware setup script, we shall patch more

(cherry picked from commit 89873f8fb4f2cf78b2394c9506795b909d8bb13f)

4 weeks agoonly install WLAN firmware if WLAN selected (e.g. not for Model 2)
mirabilos [Sun, 15 Nov 2020 23:04:27 +0000 (00:04 +0100)]
only install WLAN firmware if WLAN selected (e.g. not for Model 2)

(cherry picked from commit cd141adff9d1a38167d1e33c3cb2afd79c62b39b)

4 weeks agorestore posix/mkrpi3b+img.sh until posix/debraspi.sh is usable
mirabilos [Mon, 20 Sep 2021 15:55:11 +0000 (17:55 +0200)]
restore posix/mkrpi3b+img.sh until posix/debraspi.sh is usable

file content as of commit 770a47154abf12a844caf32b2f554a8aadcbcf6f

5 weeks agoadd helpers for chrooting into Debians (e.g. with qemu-user),
mirabilos [Mon, 13 Sep 2021 15:10:31 +0000 (17:10 +0200)]
add helpers for chrooting into Debians (e.g. with qemu-user),

to get not only mounts right but also policy-rc.d et al.

with nod towards debootstrap, d-i and grml-chroot

5 weeks agoan lv is also unique enough… unless you name all your vgs the same
mirabilos [Fri, 10 Sep 2021 20:20:38 +0000 (22:20 +0200)]
an lv is also unique enough… unless you name all your vgs the same

5 weeks agoadd swapencrypt docs and utility
mirabilos [Fri, 10 Sep 2021 19:14:58 +0000 (21:14 +0200)]
add swapencrypt docs and utility

much, though nowhere near all, of this is thanks to information
from https://wiki.archlinux.org/title/Dm-crypt/Swap_encryption
(some is from the Debian wiki, much from manpages, and cobbling
it all together and patching cryptsetup in Debian is by me); so
much that linking to those other pages is probably not useful for
the end user to not confuse those (Arch has mkinitcpio, etc)

2 months agohuh that can be many questions… tell the user he can just hit Enter
mirabilos [Thu, 19 Aug 2021 23:33:54 +0000 (01:33 +0200)]
huh that can be many questions… tell the user he can just hit Enter

(I wonder… we only set the prio to low for locale etc…)

2 months agoupdate from MirBSD CVS
mirabilos [Wed, 18 Aug 2021 18:29:24 +0000 (20:29 +0200)]
update from MirBSD CVS

2 months agoquick CVS revision checker
mirabilos [Fri, 30 Jul 2021 21:18:59 +0000 (23:18 +0200)]
quick CVS revision checker

3 months agoupdate CVS update script to account for Dead revisions
mirabilos [Wed, 21 Jul 2021 21:55:05 +0000 (23:55 +0200)]
update CVS update script to account for Dead revisions

3 months agoshow nearest neighbour versions
mirabilos [Wed, 21 Jul 2021 21:53:18 +0000 (23:53 +0200)]
show nearest neighbour versions

3 months agopass parameters as filter arguments to dpkg-query
mirabilos [Wed, 21 Jul 2021 21:49:11 +0000 (23:49 +0200)]
pass parameters as filter arguments to dpkg-query

3 months agouse a progress bar and temp files instead
mirabilos [Wed, 21 Jul 2021 21:38:54 +0000 (23:38 +0200)]
use a progress bar and temp files instead

3 months agofirst cut at dpkg/APT repo checker
mirabilos [Wed, 21 Jul 2021 21:09:58 +0000 (23:09 +0200)]
first cut at dpkg/APT repo checker

this tells you which packages you have installed that aren’t in
any repo included, and whether they are newer than any others or
older than any backports or nōn-backports ones

3 months agoupdate from MirBSD CVS
mirabilos [Fri, 2 Jul 2021 20:16:47 +0000 (22:16 +0200)]
update from MirBSD CVS

3 months agoconvenience +x
mirabilos [Fri, 2 Jul 2021 20:15:00 +0000 (22:15 +0200)]
convenience +x

4 months agofix maintainer script file permissions in control tarball
mirabilos [Thu, 10 Jun 2021 15:23:13 +0000 (17:23 +0200)]
fix maintainer script file permissions in control tarball

5 months agomake life a little easier
mirabilos [Mon, 10 May 2021 22:16:32 +0000 (00:16 +0200)]
make life a little easier

mind that --color takes no argument in older git, cf.
$MirOS: contrib/samples/etc_profile,v 1.20 2019/08/15 18:45:03 tg Exp $

5 months agoupdate for latest pax
mirabilos [Mon, 3 May 2021 03:45:57 +0000 (05:45 +0200)]
update for latest pax

5 months agouse a slightly more universal path
mirabilos [Mon, 3 May 2021 02:36:19 +0000 (02:36 +0000)]
use a slightly more universal path

5 months agoupdate from MirBSD CVS
mirabilos [Mon, 3 May 2021 02:29:38 +0000 (04:29 +0200)]
update from MirBSD CVS

5 months agosome further cleanup and optimisation
mirabilos [Thu, 22 Apr 2021 07:51:20 +0000 (09:51 +0200)]
some further cleanup and optimisation

5 months agoRevert "this might be another speedup…" as the figures diverge
mirabilos [Thu, 22 Apr 2021 07:01:43 +0000 (09:01 +0200)]
Revert "this might be another speedup…" as the figures diverge

(basically the spread between measurements is too wide)

This reverts commit f4bb6933ca9f3b38b4cd36eba18ca2cf600eea95.

5 months agobring back consistent output wrt optional redundancy
mirabilos [Thu, 22 Apr 2021 06:56:18 +0000 (08:56 +0200)]
bring back consistent output wrt optional redundancy

the timing figures permit this

5 months agothis might be another speedup…
mirabilos [Thu, 22 Apr 2021 06:49:02 +0000 (08:49 +0200)]
this might be another speedup…

… though the figures from time mksh resortip change massively
when only a subset of cores is busy, and Linux seems to optimise
the one-byte read(2) a shell necessarily does well enough… and
this is not my favourite code structure for this kind of thing
and hoping or waiting for a buffered read anyway…

5 months agomassive speedup by some reorganisation and optimisation
mirabilos [Thu, 22 Apr 2021 05:41:22 +0000 (07:41 +0200)]
massive speedup by some reorganisation and optimisation

we now do emit some /128 and /32 (specifically when a
range begins with one) but that’s decorative anyway…

6 months agoadd script to sort, merge and format IP addresses:
mirabilos [Thu, 22 Apr 2021 02:52:44 +0000 (04:52 +0200)]
add script to sort, merge and format IP addresses:

• takes addresses (IP or Legacy IP) with CIDR masks (/32, /128)
  on standard input, line by line, optionally, separated by space,
  multiple per line
• expands the addresses to the networks they span internally
• sorts them (by shelling out to LC_ALL=C sort -u)
• merges overlapping and adjacent ranges
• collapses the ranges into CIDR networks again, splitting as
  necessary, e.g. ::0 – ::10 is split into ::/124 and ::10/128
• omits the trailing /128 (IP) and /32 (Legacy IP)
• formats IP addresses RFC5952-conformant (even though that
  beast mandates lowercase hex nybbles, grr)

note this is s̲l̲o̲w̲, especially the collapsing-into-CIDR-ranges
part, especially on IPv6 as the amount to test is much larger

(sort(1) is the only POSIX utility used; the entire remaining
code is implemented in Pure mksh™ as to be highly portable)

6 months agoallow SUDO= c …
mirabilos [Sat, 27 Mar 2021 21:19:33 +0000 (22:19 +0100)]
allow SUDO= c …

6 months agoconvenience
mirabilos [Wed, 24 Mar 2021 20:58:27 +0000 (21:58 +0100)]
convenience

7 months ago[WIP] fix bugs, add tons of enhancements; not yet usable or complete
mirabilos [Mon, 15 Mar 2021 00:14:22 +0000 (01:14 +0100)]
[WIP] fix bugs, add tons of enhancements; not yet usable or complete

7 months agothese need not be executable
mirabilos [Sat, 13 Mar 2021 21:41:29 +0000 (22:41 +0100)]
these need not be executable

7 months agoadd some shellcheck, which is rather opinionated…
mirabilos [Thu, 11 Mar 2021 20:05:24 +0000 (21:05 +0100)]
add some shellcheck, which is rather opinionated…

… and not always helpful; in any case, no actual bugs found

7 months agoupdate from MirBSD CVS
mirabilos [Wed, 10 Mar 2021 17:18:20 +0000 (18:18 +0100)]
update from MirBSD CVS

7 months agoallow “k .rdp” to load ~/.Xmodmap.rdp (any dot-prefixed $1)
mirabilos [Wed, 10 Mar 2021 14:18:10 +0000 (15:18 +0100)]
allow “k .rdp” to load ~/.Xmodmap.rdp (any dot-prefixed $1)

also nicer xtracing

10 months agoupdate from MirBSD CVS
mirabilos [Thu, 26 Nov 2020 04:27:48 +0000 (05:27 +0100)]
update from MirBSD CVS

11 months agoadd a wrapper for the red tape around w --yesno, too, and checkers
mirabilos [Mon, 16 Nov 2020 02:13:55 +0000 (03:13 +0100)]
add a wrapper for the red tape around w --yesno, too, and checkers

11 months agoimplement partitioning swap
mirabilos [Mon, 16 Nov 2020 02:06:23 +0000 (03:06 +0100)]
implement partitioning swap

11 months agonever use a numeric s at all any more, always relative
mirabilos [Mon, 16 Nov 2020 01:37:06 +0000 (02:37 +0100)]
never use a numeric s at all any more, always relative

11 months agodefault to going to the next state
mirabilos [Mon, 16 Nov 2020 01:31:24 +0000 (02:31 +0100)]
default to going to the next state

11 months agoabstract the state machine away somewhat
mirabilos [Mon, 16 Nov 2020 01:29:42 +0000 (02:29 +0100)]
abstract the state machine away somewhat

11 months agostates end at 999 for simplicity
mirabilos [Mon, 16 Nov 2020 01:07:39 +0000 (02:07 +0100)]
states end at 999 for simplicity

11 months agorefactor so states can “finish” any time with a return
mirabilos [Mon, 16 Nov 2020 01:05:46 +0000 (02:05 +0100)]
refactor so states can “finish” any time with a return

11 months agofactor out
mirabilos [Sun, 15 Nov 2020 23:32:10 +0000 (00:32 +0100)]
factor out

11 months agouse model-unspecific partition names and boot by partition label
mirabilos [Sun, 15 Nov 2020 23:22:42 +0000 (00:22 +0100)]
use model-unspecific partition names and boot by partition label

11 months agoswitch to raspi-firmware, from buster-backports if needed
mirabilos [Sun, 15 Nov 2020 23:18:32 +0000 (00:18 +0100)]
switch to raspi-firmware, from buster-backports if needed

11 months agoalways re-run raspi firmware setup script, we shall patch more
mirabilos [Sun, 15 Nov 2020 23:13:47 +0000 (00:13 +0100)]
always re-run raspi firmware setup script, we shall patch more

11 months agoonly install WLAN firmware if WLAN selected (e.g. not for Model 2)
mirabilos [Sun, 15 Nov 2020 23:04:27 +0000 (00:04 +0100)]
only install WLAN firmware if WLAN selected (e.g. not for Model 2)

11 months agoallow reading text from stdin, too
mirabilos [Mon, 9 Nov 2020 00:04:30 +0000 (01:04 +0100)]
allow reading text from stdin, too

11 months agoallow infile, outfile and text to be passed as option instead
mirabilos [Sun, 8 Nov 2020 23:57:19 +0000 (00:57 +0100)]
allow infile, outfile and text to be passed as option instead

(and prefer it)

this allows users a more flexible command line layout, putting
constant things (like infile, outfile) near the beginning and
things they change until got it right (angle, fontsize) to the end

11 months agoa first version of the watermark script to seal persokopiën with
mirabilos [Sun, 8 Nov 2020 23:23:37 +0000 (00:23 +0100)]
a first version of the watermark script to seal persokopiën with

11 months agoupdate from MirBSD CVS
mirabilos [Fri, 30 Oct 2020 09:14:29 +0000 (10:14 +0100)]
update from MirBSD CVS

11 months agoupdate from MirBSD CVS, mostly for rcp -a
mirabilos [Thu, 29 Oct 2020 05:18:27 +0000 (06:18 +0100)]
update from MirBSD CVS, mostly for rcp -a

15 months agohttps
mirabilos [Sat, 18 Jul 2020 18:00:08 +0000 (20:00 +0200)]
https

15 months agoincrease space, kernels and especially initrds grow really big
mirabilos [Fri, 3 Jul 2020 16:37:24 +0000 (18:37 +0200)]
increase space, kernels and especially initrds grow really big

this prepares for a successful bullseye upgrade/install

16 months agoupdate from MirBSD CVS (new dot rules)
mirabilos [Sun, 21 Jun 2020 15:33:01 +0000 (17:33 +0200)]
update from MirBSD CVS (new dot rules)

16 months agoupdate SSV to use the correct field separator (ASCII unit separator)
mirabilos [Sun, 21 Jun 2020 15:31:54 +0000 (17:31 +0200)]
update SSV to use the correct field separator (ASCII unit separator)

also update test to check that the ASCII file(!) separator is valid data

16 months agooops, I mis-picked
mirabilos [Sat, 20 Jun 2020 20:06:37 +0000 (22:06 +0200)]
oops, I mis-picked

16 months agoadd an Emacs modeline
mirabilos [Tue, 9 Jun 2020 15:12:41 +0000 (17:12 +0200)]
add an Emacs modeline

Emacs modelines are “File variables”¹, and I believe most *-mode
on ² (with the “-mode” stripped) qualify, but see ³ and mind the
position in the file (first line, not second but shebang doesn’t
count)

① https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html#Specifying-File-Variables
② https://www.emacswiki.org/emacs/List_Of_Major_And_Minor_Modes#toc2
③ https://www.emacswiki.org/emacs/ProgrammingModes

16 months agokeyboard layout quick switcher
mirabilos [Tue, 2 Jun 2020 15:55:41 +0000 (17:55 +0200)]
keyboard layout quick switcher

16 months agowork around #961377 until a fix is in place
mirabilos [Sun, 31 May 2020 20:37:28 +0000 (22:37 +0200)]
work around #961377 until a fix is in place

16 months agoupdate from MirBSD CVS
mirabilos [Sun, 31 May 2020 20:33:49 +0000 (22:33 +0200)]
update from MirBSD CVS

17 months agoconvenience env unset
mirabilos [Sun, 17 May 2020 17:03:34 +0000 (19:03 +0200)]
convenience env unset

17 months agoadd support for CUSTOM chroots
mirabilos [Sun, 17 May 2020 17:03:11 +0000 (19:03 +0200)]
add support for CUSTOM chroots

17 months agoUpdate from MirBSD CVS
mirabilos [Tue, 12 May 2020 17:50:36 +0000 (19:50 +0200)]
Update from MirBSD CVS

18 months agofrom a v̲e̲r̲y̲ enlightening thread on lynx-dev…
mirabilos [Mon, 20 Apr 2020 19:49:10 +0000 (21:49 +0200)]
from a v̲e̲r̲y̲ enlightening thread on lynx-dev…

18 months ago
mirabilos [Thu, 16 Apr 2020 23:52:33 +0000 (01:52 +0200)]


brown paper bag, and all

18 months agofix two things:
mirabilos [Thu, 16 Apr 2020 23:48:44 +0000 (01:48 +0200)]
fix two things:

• the string written to the faux x86 MBR bootcode: it was identical
  in our case, but if the user changed it…
• nuke the other tmpfile as well

18 months agoRomain says the FAT partition must be bootable for EXTLINUX
mirabilos [Thu, 16 Apr 2020 22:33:02 +0000 (00:33 +0200)]
Romain says the FAT partition must be bootable for EXTLINUX

18 months agoUpdate from MirBSD CVS
mirabilos [Wed, 15 Apr 2020 01:48:22 +0000 (01:48 +0000)]
Update from MirBSD CVS

19 months agosimplification for the easiest case
mirabilos [Thu, 12 Mar 2020 23:45:19 +0000 (00:45 +0100)]
simplification for the easiest case

19 months agoadd documentation links
mirabilos [Thu, 12 Mar 2020 23:00:35 +0000 (00:00 +0100)]
add documentation links

19 months agowording
mirabilos [Thu, 12 Mar 2020 22:46:26 +0000 (23:46 +0100)]
wording

19 months agoRevert "temporarily re-enable BSD ssh for testing"
mirabilos [Thu, 12 Mar 2020 22:44:32 +0000 (23:44 +0100)]
Revert "temporarily re-enable BSD ssh for testing"

This reverts commit 00d81fc86ab3ea7494ce6eeff3b64b0c2bd16630.

19 months agogreatly simplify decision…
mirabilos [Thu, 12 Mar 2020 22:44:17 +0000 (23:44 +0100)]
greatly simplify decision…

19 months agocould it become even simpler?
mirabilos [Thu, 12 Mar 2020 22:35:01 +0000 (23:35 +0100)]
could it become even simpler?

19 months agodistinguish ARE
mirabilos [Thu, 12 Mar 2020 22:31:01 +0000 (23:31 +0100)]
distinguish ARE

19 months agoannotate results with all variants
mirabilos [Thu, 12 Mar 2020 22:07:36 +0000 (23:07 +0100)]
annotate results with all variants