HOME |
GIT Overview |
Script-Archive:
(docs) :
(wiki) :
(git) |
...
Peter's Script-Archive - System-Administration / Editing
Most of my old admin stuff is way too specific. Or else its waiting
for a rewrite before being using again (all the while hoping to stay
retired as soon as a suitable group-maintained pendant can be
found :)).
The system flight recorder editor project sfre is a slightly
different case, it's an itch from previous projects, where being
unable to ask a collegue (night-time, holidays, whatever) repeatedly
lead to time-consuming double-checks. Now wouldn't it be nice to find
such information about already execute tasks, changes and
modifications in a single location on the system in question; possibly
regularly also archived on a central server by cron? Note that sfre
substitutes for a versioning system or a tool like cfengine
only in the most trivial of cases; it's real purpose is to
complement proper system management tools, and in addition provide a
fail-safe for those dusty corners for which use of proper tools like
cfengine has been postponed and "will be implemented as soon when we
have some free time". Read: probably not before a fresh install of the
problem system in question, and certainly not when doing that in a
hurry...
I'm currently using sfre as $EDITOR, $VISUAL
and as a replacement for vi (albeit with a call to the real vi later
on); it's quite painful to be asked all the time for sane log messages
when opening a vi without files or doing a git commit. This translates
into a growing list of changes like implementing a command blacklist
for file locking and journaling. For now it's still a bit too annoying
to be used for accounts other than root.
Commands
Git
View of this section / Download
- selectlines , a version of the classic copy a file and select/deselect
lines according to embedded directives with variable expansion.
Useful for trivial cases, provided you switch to more suitable
tools for heavier lifting.
- systemflightrecordereditor (sfre) - sfre tries to sequence file
edits and augment group memory in concurrent file change scenarios like
multiple root users plus cron jobs. For each edit (or more generally
any arbitrary command given with the -e option) sfre logs a description
to a journal, f-locks the plain file arguments of the command and uses
changetrack to backup changes. It also supports lookup/diff of files
from a changetrack backupdir by date, revision number or symbolic name
allowing all options of the cat or diff commands (e.g. all GNU diff
options instead of just the small subset of options available via rcsdiff).
Dependencies: changetrack (changetrack.sf.net) and lock.pl/Flock.pm.
(You may wish to set SFRESHELL to a Bourne-style shell that supports
set -o pipefail). Published on freshmeat .
- unescape.pl strips some of the line noise from script typescripts.
Modified version with prompt guessing, tries to remove e.g. vim session.
Using a tool like this may make typescripts somewhat more usable as a base
for documentation.
See also:
- vimsh
as helper for system documentation / documentation creation
captured from session transcripts: see the vimsh script from vim.org for a
non-typescript approach (non-interactive commands only, unless you use some kind
of pty splitter in combination with say urxvt -pty or screen; I've a working demo
of both, but first I want to patch some more comfort into vimsh for this kind
of vimsh usage).
The original vimsh is available as
vimscript 165 and
is a nice example of pythonic vim.
HOME |
GIT Overview |
Script-Archive:
(docs) :
(wiki) :
(git) |
...
jakobi(at)acm.org, 2009-07 - 2012-03