Plan 9 from Bell Labs’s /usr/web/sources/contrib/anothy/lib/man/scripts.1

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


.TH scripts 1
.SH NAME
.PP
.SH SYNOPSIS
.PP
.SH DESCRIPTION

.SS A
A simple wrapper script to start
.I acme
with a single column. All other arguments are
passed untouched. This is often useful to set as
.B $EDITOR
for applications which expect it.

.SS a2b, b2a
Convert ASCII to Baudot and back. A novelty.

.SS amail
A simple script to mask parts of the plumbing
namespace, providing an acme window suitable
for just running Mail.

.SS cdiff
When run from the tag of an
.I acme
window produced by
.IR adiff ,
.I cdiff
will plumb the next set of addresses. Under normal
circumstances, this will cause the editor to open both
files with the relevant addresses selected.

.SS cx
A shortcut to
.I ssh
to hosts listed in
.B $home/lib/uname
as a different user. Useful for foreign systems.

.SS eow
Days until the end of the 12th B'ak'tun in the Mayan
calander. Negative numbers indicate days since this
date. Depricated since the start of the 13th B'ak'tun
in favor of
.IR mayan (1).

.SS feedkeys
A simple script to get keys from sectore and put them
in factotum. Useful when the local environment prevents
it from happening on startup automatically.

.SS flight
Given an airline code and a flight number as distinct arguments,
.I flight
will ask
.B flightstats.com
for the fight status and return a plain-text version of the results.

.SS grabwin
Put an image of the current window in PNG format. Invoke with
.I -s
to instead grab the screen, and
.I -d n
To loop every
.I n
seconds. The generated file will be placed in the named
directory with a file name generated from the pattern
.IR user . pid .png.

.SS host
Simplified hostname lookup. Specify one or more hosts and
get back a human-readable list of A and MX records.

.SS journal
Keep a dated log of the state of a given directory. This was
developed on a system without snapshots, and the ideas
should likely be reconsidered with those in mind.

.SS looktag
Look up one or more
.IR tag s
in
.I tagfile
(default
.IR tags ),
which is assumed to be generated by the Plan 9 port of
Exuberant Ctags.

.SS mkufont
Generate a font file from a list of subfonts.

.SS riostart
A useful example of a script to use as an argument to
.IR rio 's
.IR -i .
It will look for a file matching
.IB $home /lib/wins/ width x height
and will execut it, or will execute
.IB $home /lib/wins/rio.common
if no resolution-specific file is found.

.SS snip
With no arguments, list files currently on the snippet service
at
.I $snipserv
(default 9srv.net). With one or more file arguments, submit
the file to the snippet service.
.I /dev/snarf
is often a useful argument.

.SS sparkline
Generate psuedo-sparklines from a series of numeric
arguments.
Done well, real sparklines are information-dense
representations of data; these are just a novelty.

.SS tagclock
Run in an acme window,
.I tagclock
will print a clock on that window's tag. It will make
efforts to preserve other text in the tag.

.SS tcp17038
A service for
.IR listen (8)
to accept
.IR vac (1)
scores and store them in the filesystem. Clients,
who must be on a list of authorized addresses,
send a name for the score, a newline, and the
score itself, in the format expected by
.IR vac .
The score is stored on the server in
.BI /lib/vac/ name .vac 
overwriting any existing score there.

.SS tcp80
A trivial, one-page "web server". Sometimes useful,
but mostly a novelty.

.SS timeavg
Average a series of calls from
.IR time (1).
A call like this:
.EX
	{for (i in `{seq 1 10}) {time cmd1 ; time cmd2 }>/dev/null} |[2] timeavg
.EE
will yield a report similar to this:
.EX
	cmd1 (10 runs): 0.00	0.00	0.07
	cmd2 (10 runs): 0.00	0.00	0.04
.EE
The meaning of the numeric fiels are as for
.IR time (1).

.SS tjd
Print the Truncated Julian Day. Invoke with
.I -n
to omit the trailing newline or
.I -l
to print the fractional part of the day. This predates
.IR datefmt (1)
and should likely use it or be retired.

.SS tweet
An early, now depricated, version of a script to post to Twitter
and services using its API. This no longer works for Twitter since
they started requiring OAuth for all transactions.

.SS vacbak
A script used on Unix systems to make backups to a
.IR venti (8)
server. This script contains several site-specific assumptions,
but is a useful example to adapt.

.SS waitloop
Run a command in a loop, waiting at least
.I n
seconds between invocations. This is useful to avoid excesive
resource consumption when a command fails.

.SH SOURCE
.B /n/sources/contrib/anothy/bin/rc
.SH SEE ALSO
.PP
Josh Wood has a much-elaborated version of
.I tweet
called
.I microbe
(formerly µb). If you use a service which uses Twitter's old
API without the OAuth requirement (such as Status.net),
you should use that. See
.BR /n/sources/contrib/josh/rc/mb .
.SH BUGS
Various.
.PP
.I Cx
should handle unmatched shortcuts gracefully.
.PP
.I Flight
should filter out more of the returned text.
.PP
.I Tagclock
causes the tag text to flicker every time it redraws
the time, which is distracting.
.PP
.I Tcp17038
only authorizes based on host IP and trusts authorized hosts
to overwrite score files at will.
.PP
.I Timeavg
only differentiates on the command name, not arguments.
.PP
.I Waitloop
does not do anything to clean up after commands that do not
properly release resources after an unclean shutdown. In
particular, graphical programs can be problematic.
.PP
This page has too much on it; related scripts should be broken
out into their own pages.

.SH HISTORY
Several of these scripts are either inspired by or modified
versions of the work of others.
.TP
a2b, b2a
Adapted from versions by Boyd Roberts
.TP
mkufont
From 9front.
.PP
This list attempts to be complete; if you believe there is an
omission, notify a@9srv.net.

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.