Computer Old Farts Forum
 help / color / mirror / Atom feed
* Re: [COFF] What is your prompt?
@ 2021-12-25  2:50 Rudi Blom
  2021-12-25  4:40 ` Theodore Ts'o
  0 siblings, 1 reply; 26+ messages in thread
From: Rudi Blom @ 2021-12-25  2:50 UTC (permalink / raw)
  To: coff


[-- Attachment #1.1: Type: text/plain, Size: 459 bytes --]

On my Windows 11 notebook with WSL2 + Linux I got as default

rubl@DESKTOP-NQR082T:~$ echo $PS1
\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@
\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$
rubl@DESKTOP-NQR082T:~$ uname -a
Linux DESKTOP-NQR082T 5.10.74.3-microsoft-standard-WSL2+ #4 SMP Sun Dec 19
16:25:10 +07 2021 x86_64 x86_64 x86_64 GNU/Linux
rubl@DESKTOP-NQR082T:~$

-- 
The more I learn the better I understand I know nothing.

[-- Attachment #1.2: Type: text/html, Size: 656 bytes --]

[-- Attachment #2: Type: text/plain, Size: 141 bytes --]

_______________________________________________
COFF mailing list
COFF@minnie.tuhs.org
https://minnie.tuhs.org/cgi-bin/mailman/listinfo/coff

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [COFF] What is your prompt?
  2021-12-25  2:50 [COFF] What is your prompt? Rudi Blom
@ 2021-12-25  4:40 ` Theodore Ts'o
  2021-12-25 17:39   ` Steffen Nurpmeso
  2021-12-25 23:19   ` Greg 'groggy' Lehey
  0 siblings, 2 replies; 26+ messages in thread
From: Theodore Ts'o @ 2021-12-25  4:40 UTC (permalink / raw)
  To: Rudi Blom; +Cc: coff

Here are examples of some of my prompts.  It does use two lines, but
the extra context is worth it to me:

<tytso@cwcc> {/home/tytso}  
267% cd /usr/projects/e2fsprogs/base
<tytso@cwcc> {/usr/projects/e2fsprogs/base}   (BARE:master)
268% cd /usr/projects/e2fsprogs/e2fsprogs-maint
<tytso@cwcc> {/usr/projects/e2fsprogs/e2fsprogs-maint}   (maint)
269% git lgt -1
* 45295a35 - (HEAD -> maint, origin/maint) setup-schroot: add some additional packages needed to build debian packages (3 days ago)
<tytso@cwcc> {/usr/projects/e2fsprogs/e2fsprogs-maint}   (maint)
270% schroot -c buster-amd64
Top-level shell (parent schroot)
<tytso@buster-amd64-CHROOT.cwcc> {/usr/projects/e2fsprogs/e2fsprogs-maint}
1% logout
<tytso@cwcc> {/usr/projects/e2fsprogs/e2fsprogs-maint}   (maint)
271% cd
<tytso@cwcc> {/home/tytso}
272% su
Password: 
<tytso.root@cwcc> {/home/tytso}, level 2
1001# bash
<tytso.root@cwcc> {/home/tytso}, level 3
1001# exit
<tytso.root@cwcc> {/home/tytso}, level 2
1002# exit
<tytso@cwcc> {/home/tytso}
273% ssh imap.thunk.org 
Linux imap.thunk.org 5.10.13-x86_64-linode141 #1 SMP Thu Feb 4 13:56:42 EST 2021 x86_64

Last login: Sat Dec 25 04:33:54 2021 from 108.7.220.252
<tytso@imap.thunk.org>  {/home/tytso}
501% logout
Connection to imap.thunk.org closed.
_______________________________________________
COFF mailing list
COFF@minnie.tuhs.org
https://minnie.tuhs.org/cgi-bin/mailman/listinfo/coff

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [COFF] What is your prompt?
  2021-12-25  4:40 ` Theodore Ts'o
@ 2021-12-25 17:39   ` Steffen Nurpmeso
  2021-12-25 18:28     ` Grant Taylor via COFF
  2021-12-25 23:19   ` Greg 'groggy' Lehey
  1 sibling, 1 reply; 26+ messages in thread
From: Steffen Nurpmeso @ 2021-12-25 17:39 UTC (permalink / raw)
  To: coff; +Cc: Rudi Blom

I might be the only living one who has the expansion of $? in $PS1.
(And who's "~/.shrc" gives a _somewhat_ portable PS1 with
last-component-of HOSTNAME and PWD.)

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)
_______________________________________________
COFF mailing list
COFF@minnie.tuhs.org
https://minnie.tuhs.org/cgi-bin/mailman/listinfo/coff

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [COFF] What is your prompt?
  2021-12-25 17:39   ` Steffen Nurpmeso
@ 2021-12-25 18:28     ` Grant Taylor via COFF
  2021-12-25 19:14       ` Steffen Nurpmeso
  0 siblings, 1 reply; 26+ messages in thread
From: Grant Taylor via COFF @ 2021-12-25 18:28 UTC (permalink / raw)
  To: coff


[-- Attachment #1.1: Type: text/plain, Size: 650 bytes --]

On 12/25/21 10:39 AM, Steffen Nurpmeso wrote:
> I might be the only living one who has the expansion of $? in $PS1.

It's not $PS1, but I do have $? in my Zsh $RPROMPT.

I used to have $? in $PS1 before switching to $RPROMPT.

> (And who's "~/.shrc" gives a _somewhat_ portable PS1 with
> last-component-of HOSTNAME and PWD.)

I'd like to know more.

I don't know if it's a good thing or not, but portability across 
platforms (OSs / architectures) is much less of an issue for me than it 
was in my last job.  Now I mostly worry about Linux and FreeBSD. 
Admittedly, some really old versions.



-- 
Grant. . . .
unix || die


[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4017 bytes --]

[-- Attachment #2: Type: text/plain, Size: 141 bytes --]

_______________________________________________
COFF mailing list
COFF@minnie.tuhs.org
https://minnie.tuhs.org/cgi-bin/mailman/listinfo/coff

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [COFF] What is your prompt?
  2021-12-25 18:28     ` Grant Taylor via COFF
@ 2021-12-25 19:14       ` Steffen Nurpmeso
  2021-12-26  3:44         ` Grant Taylor via COFF
  0 siblings, 1 reply; 26+ messages in thread
From: Steffen Nurpmeso @ 2021-12-25 19:14 UTC (permalink / raw)
  To: Grant Taylor; +Cc: coff

Grant Taylor wrote in
 <517271a2-c18c-f6b2-e5a8-0f93b2accba7@spamtrap.tnetconsulting.net>:
 |On 12/25/21 10:39 AM, Steffen Nurpmeso wrote:
 |> I might be the only living one who has the expansion of $? in $PS1.
 |
 |It's not $PS1, but I do have $? in my Zsh $RPROMPT.
 |
 |I used to have $? in $PS1 before switching to $RPROMPT.
 |
 |> (And who's "~/.shrc" gives a _somewhat_ portable PS1 with
 |> last-component-of HOSTNAME and PWD.)
 |
 |I'd like to know more.
 |
 |I don't know if it's a good thing or not, but portability across 
 |platforms (OSs / architectures) is much less of an issue for me than it 
 |was in my last job.  Now I mostly worry about Linux and FreeBSD. 
 |Admittedly, some really old versions.

Sure.  Oh the compatibility of shells i meant, of course.  But
that mostly colours, now that ~/.profile ensures HOSTNAME and
LOGNAME per se.  No more \XY escapes here, except \e and the
\[..\] that some need (to get it column counting right, with
colours) (SHTYPE=bash and =yash).

And the "set -o" you need/can to get where you want to be, ksh for
example braceexpand, emacs-usemeta (if possible), expand_aliases
(bash), cdprint/emacs/tabcomplete (NetBSD ksh).

It is of course all a bitrot-affine compatibility mess.  You look
for $0, sometimes deeper for some *_VERSION, for $OSTYPE (which my
~/.profile sets, too).  But in the end it is all a mess.  If
i recall correctly i once proposed a standardized VERSION or xy
thing so that one could easily identify, even in subshells.  But
that would affect future shells only, anyhow.  At one time i have
thrown away a lot of tests, since fish and some other shells
i will never use no more, what remains is just enough to start
working the best i can with dash, bash, ksh.  Last change on PS1
in March 2018, i usually only have one account per $HOSTNAME.
Pretty bitter is shells without aliases, where the a-lia-ses have
to be created as sh_ell_functions.  And then one says builtin, the
other says built-in.

Yeah i mean computing would be nice, if there would not be those
uncountable quirks you need in real life.  The maintainer of
libinput has written a short down-to-earth article on that a few
years ago.

That reminds me of my bitter gut feeling that something bad will
happen, all these days, but luckily the rocket that carried some
real penis lifted successfully.

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)
_______________________________________________
COFF mailing list
COFF@minnie.tuhs.org
https://minnie.tuhs.org/cgi-bin/mailman/listinfo/coff

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [COFF] What is your prompt?
  2021-12-25  4:40 ` Theodore Ts'o
  2021-12-25 17:39   ` Steffen Nurpmeso
@ 2021-12-25 23:19   ` Greg 'groggy' Lehey
  2021-12-25 23:43     ` Steffen Nurpmeso
  2021-12-26  3:29     ` Grant Taylor via COFF
  1 sibling, 2 replies; 26+ messages in thread
From: Greg 'groggy' Lehey @ 2021-12-25 23:19 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: coff, Rudi Blom


[-- Attachment #1.1: Type: text/plain, Size: 1047 bytes --]

On Friday, 24 December 2021 at 23:40:56 -0500, Theodore Ts'o wrote:
> Here are examples of some of my prompts.  It does use two lines, but
> the extra context is worth it to me:
>
> <tytso@cwcc> {/home/tytso}
> 267% cd /usr/projects/e2fsprogs/base

That's actually surprisingly like mine, though I squeeze it into one
line.  Like you, I find user, system and cwd important, but also the
tty.  In addition I put a marker to help find prompts in long output,
so a typical prompt might be:

  === grog@bilbo (/dev/pts/27) ~/src 6 -> 

That's generated with

  PS1="\[ESC[34m\]=== \u@\h (`tty`) \[ESC[31m\]\w\[ESC[34m\] \# ->\[ESC[30m\]\[ESC[47m\] "

> 272% su
> Password:
> <tytso.root@cwcc> {/home/tytso}, level 2

That's interesting.  How do you do that?

Greg
--
Sent from my desktop computer.
Finger grog@lemis.com for PGP public key.
See complete headers for address and phone numbers.
This message is digitally signed.  If your Microsoft mail program
reports problems, please read http://lemis.com/broken-MUA.php

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 163 bytes --]

[-- Attachment #2: Type: text/plain, Size: 141 bytes --]

_______________________________________________
COFF mailing list
COFF@minnie.tuhs.org
https://minnie.tuhs.org/cgi-bin/mailman/listinfo/coff

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [COFF] What is your prompt?
  2021-12-25 23:19   ` Greg 'groggy' Lehey
@ 2021-12-25 23:43     ` Steffen Nurpmeso
  2021-12-26 21:18       ` Theodore Ts'o
  2021-12-26  3:29     ` Grant Taylor via COFF
  1 sibling, 1 reply; 26+ messages in thread
From: Steffen Nurpmeso @ 2021-12-25 23:43 UTC (permalink / raw)
  To: Greg 'groggy' Lehey; +Cc: Rudi Blom, coff

Greg 'groggy' Lehey wrote in
 <20211225231941.GB83649@eureka.lemis.com>:
 |On Friday, 24 December 2021 at 23:40:56 -0500, Theodore Ts'o wrote:
 |> Here are examples of some of my prompts.  It does use two lines, but
 |> the extra context is worth it to me:
 |>
 |> <tytso@cwcc> {/home/tytso}
 |> 267% cd /usr/projects/e2fsprogs/base
 |
 |That's actually surprisingly like mine, though I squeeze it into one
 |line.  Like you, I find user, system and cwd important, but also the
 |tty.  In addition I put a marker to help find prompts in long output,
 |so a typical prompt might be:
 |
 |  === grog@bilbo (/dev/pts/27) ~/src 6 -> 
 |
 |That's generated with
 |
 |  PS1="\[ESC[34m\]=== \u@\h (`tty`) \[ESC[31m\]\w\[ESC[34m\] \# ->\[ESC[30\
 |  m\]\[ESC[47m\] "
 |
 |> 272% su
 |> Password:
 |> <tytso.root@cwcc> {/home/tytso}, level 2
 |
 |That's interesting.  How do you do that?

Looks like bash(1)'s $SHLVL to me.
I always stumble over the OpenCSW.org ssh(1) logins, they set
ignoreeof by default.  That is how strange things go, in the shell
i hate that, in my mailer i have that and furthermore even

  commandalias q 'echo You do not want to quit, do you?'

and that happens several times a week.
I mean i have

      [ "${UID}" -eq 0 ] && PS1='#' || PS1='$'
      if ( [ "${HISTSIZE##84}" = 42 ] ) > /dev/null 2>&1; then
         # bash(1)/*ksh(1)?
         if [ -n "${___SHTYPE}" ] || [ -n "${PWD}" ]; then
            PS1="${ps1s}#?\$?${j}|${HOSTNAME%%.*}:\${PWD##*/}${PS1}${ps1e} "
         else
            PS1="${ps1s}#${j}${HOSTNAME%%.*}:${ps1W}${PS1}${ps1e} "
         fi
      else
         PS1="${ps1s}#${j}${HOSTNAME}${PS1}${ps1e} "
      fi
      PS2='> '
      export PS1 PS2

Where all the ps1* series was detected earlier, for colour, like

  ps1s="\[\e[31m\]" ps1S="\[\e[38;5;203m\]" ps1e="\[\e[0m\]"

for bash or

  eval "ps1s=\$'\e[31m' ps1S=\$'\e[38;5;203m' ps1e=\$'\e[0m'"

for mksh (to get around bugs it had sometime, and were fixed, some
get fixed by Thorsten), as well as

  ps1s="^[[31m" ps1S="^[[38;5;203m" ps1e="^[[0m" # XXX \e <> OpenBSD?$

and here ^[ is indeed the fully expanded \e for those ksh's which
cannot.  The $j is for shells not running in tmux, where i have
a status line with lots of infos, to get load average

  [ -f /proc/loadavg ] && j="(\$(cut -f1,4 -d' ' /proc/loadavg))"

I forgot busybox sh(1) in the listing.  ps1W is \W for FreeBSD and
DragonFly ash(1) things.  Hm.
Maybe i have to un-bitrot that by retesting against all shells
again, it has been years, and lots of programming happens.
I usually do "scp .* HOST:" whenever i get a HOST account, and
forget about it thereafter.

A nice rest-Christmas for all Christians, shall there be some left
which Jesus would not throw out of the temple, actually, that is.

:)

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)
_______________________________________________
COFF mailing list
COFF@minnie.tuhs.org
https://minnie.tuhs.org/cgi-bin/mailman/listinfo/coff

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [COFF] What is your prompt?
  2021-12-25 23:19   ` Greg 'groggy' Lehey
  2021-12-25 23:43     ` Steffen Nurpmeso
@ 2021-12-26  3:29     ` Grant Taylor via COFF
  2021-12-26  3:54       ` Greg 'groggy' Lehey
  1 sibling, 1 reply; 26+ messages in thread
From: Grant Taylor via COFF @ 2021-12-26  3:29 UTC (permalink / raw)
  To: coff


[-- Attachment #1.1: Type: text/plain, Size: 424 bytes --]

On 12/25/21 4:19 PM, Greg 'groggy' Lehey wrote:
> Like you, I find user, system and cwd important, but also 
> the tty.

I'm curious, what use do you have for the TTY information?

How do you use it in your day to day activities in the shell?

> In addition I put a marker to help find prompts in long output,

Yep.  I think the leading hash in my PS1 does similar for me.



-- 
Grant. . . .
unix || die


[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4017 bytes --]

[-- Attachment #2: Type: text/plain, Size: 141 bytes --]

_______________________________________________
COFF mailing list
COFF@minnie.tuhs.org
https://minnie.tuhs.org/cgi-bin/mailman/listinfo/coff

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [COFF] What is your prompt?
  2021-12-25 19:14       ` Steffen Nurpmeso
@ 2021-12-26  3:44         ` Grant Taylor via COFF
  0 siblings, 0 replies; 26+ messages in thread
From: Grant Taylor via COFF @ 2021-12-26  3:44 UTC (permalink / raw)
  To: coff


[-- Attachment #1.1: Type: text/plain, Size: 782 bytes --]

On 12/25/21 12:14 PM, Steffen Nurpmeso wrote:
> Sure.  Oh the compatibility of shells i meant, of course.  But that 
> mostly colours, now that ~/.profile ensures HOSTNAME and LOGNAME 
> per se.  No more \XY escapes here, except \e and the \[..\] that some 
> need (to get it column counting right, with colours) (SHTYPE=bash 
> and =yash).

Printing vs non-printing characters are important.

> You look for $0, sometimes deeper for some *_VERSION, for $OSTYPE 
> (which my ~/.profile sets, too).  But in the end it is all a mess.

Hum.  I've not thought about trying to tease that information out of 
environment variables.  Instead, I create my own environment variables 
and populate them from various $(uname ...) output.



-- 
Grant. . . .
unix || die


[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4017 bytes --]

[-- Attachment #2: Type: text/plain, Size: 141 bytes --]

_______________________________________________
COFF mailing list
COFF@minnie.tuhs.org
https://minnie.tuhs.org/cgi-bin/mailman/listinfo/coff

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [COFF] What is your prompt?
  2021-12-26  3:29     ` Grant Taylor via COFF
@ 2021-12-26  3:54       ` Greg 'groggy' Lehey
  2021-12-26  5:27         ` Grant Taylor via COFF
  0 siblings, 1 reply; 26+ messages in thread
From: Greg 'groggy' Lehey @ 2021-12-26  3:54 UTC (permalink / raw)
  To: Grant Taylor; +Cc: coff


[-- Attachment #1.1: Type: text/plain, Size: 684 bytes --]

On Saturday, 25 December 2021 at 20:29:31 -0700, COFF wrote:
> On 12/25/21 4:19 PM, Greg 'groggy' Lehey wrote:
>> Like you, I find user, system and cwd important, but also
>> the tty.
>
> I'm curious, what use do you have for the TTY information?

If I have a process misbehaving on that tty, I can use the information
to run ps against the tty.  It's not exactly a daily occurrence, but
it's convenient when it's needed.

Greg
--
Sent from my desktop computer.
Finger grog@lemis.com for PGP public key.
See complete headers for address and phone numbers.
This message is digitally signed.  If your Microsoft mail program
reports problems, please read http://lemis.com/broken-MUA.php

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 163 bytes --]

[-- Attachment #2: Type: text/plain, Size: 141 bytes --]

_______________________________________________
COFF mailing list
COFF@minnie.tuhs.org
https://minnie.tuhs.org/cgi-bin/mailman/listinfo/coff

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [COFF] What is your prompt?
  2021-12-26  3:54       ` Greg 'groggy' Lehey
@ 2021-12-26  5:27         ` Grant Taylor via COFF
  0 siblings, 0 replies; 26+ messages in thread
From: Grant Taylor via COFF @ 2021-12-26  5:27 UTC (permalink / raw)
  To: coff


[-- Attachment #1.1: Type: text/plain, Size: 410 bytes --]

On 12/25/21 8:54 PM, Greg 'groggy' Lehey wrote:
> If I have a process misbehaving on that tty, I can use the information 
> to run ps against the tty.  It's not exactly a daily occurrence, 
> but it's convenient when it's needed.

Ah, pre-fetching diagnostic information in preparation for the off hand 
chance that you need it.

Thank you for explaining.  :-)



-- 
Grant. . . .
unix || die


[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4017 bytes --]

[-- Attachment #2: Type: text/plain, Size: 141 bytes --]

_______________________________________________
COFF mailing list
COFF@minnie.tuhs.org
https://minnie.tuhs.org/cgi-bin/mailman/listinfo/coff

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [COFF] What is your prompt?
  2021-12-25 23:43     ` Steffen Nurpmeso
@ 2021-12-26 21:18       ` Theodore Ts'o
  2021-12-26 21:33         ` Warner Losh
  2021-12-27 18:37         ` Steffen Nurpmeso
  0 siblings, 2 replies; 26+ messages in thread
From: Theodore Ts'o @ 2021-12-26 21:18 UTC (permalink / raw)
  To: Greg 'groggy' Lehey, coff, Rudi Blom

On Sun, Dec 26, 2021 at 12:43:37AM +0100, Steffen Nurpmeso wrote:
> I usually do "scp .* HOST:" whenever i get a HOST account, and
> forget about it thereafter.

I keep a private git repo on one of my machines, so when I get a HOST
account, I run a comand like this:

% git clone ssh://tytso@example.com/home/tytso/repos/dotfiles .
% cd dotfiles
% make

This installs a bunch of symlinks from
dotfiles/{.bashrc,.profile,.muttrc}, etc. to $HOME/.

That way, I can run "git pull" to update my dotfiles on one particular
machine, and if I make local changes, I'll do a "git push" to send
them back to my dotfiles repo.

The Makefile I have in my top-level repo some folks might find
interesting:

.PHONY: all bin dotfiles

all: dotfiles

DIRS= .gnupg .mutt .config/gce-xfstests .config/gcloud/configurations bin em
#DBG= echo

dotfiles:
	for file in $(shell find $(CURDIR) -maxdepth 1 -type f -name ".*" \
	    -not -name ".*~" -not -name ".gitignore" -print); do \
		f=$$(basename $$file); \
		if test -f $(HOME)/$$f -a ! -h $(HOME)/$$f ; then \
			mkdir -p backup ; \
			mv $(HOME)/$$f backup ; \
		fi ; \
		$(DBG) ln -sfn $$file $(HOME)/$$f; \
	done
	for dir in $(DIRS) ; do \
	    $(DBG) mkdir -p $(HOME)/$$dir ; \
	    for file in $$(find $$(pwd)/$$dir -maxdepth 1 -type f \
		-not -name "*~" -print); do \
		f=$$(basename $$file); \
		if test -f $(HOME)/$$dir/$$f -a ! -h $(HOME)/$$dir/$$f ; then \
			mkdir -p backup/$$dir ; \
			mv $(HOME)/$$dir/$$f backup/$$dir ; \
		fi ; \
		$(DBG) ln -sfn $$file $(HOME)/$$dir/$$f; \
	    done; \
	done
	if test -d backup ; then find backup -type f -print ; fi

Cheers,

						- Ted
_______________________________________________
COFF mailing list
COFF@minnie.tuhs.org
https://minnie.tuhs.org/cgi-bin/mailman/listinfo/coff

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [COFF] What is your prompt?
  2021-12-26 21:18       ` Theodore Ts'o
@ 2021-12-26 21:33         ` Warner Losh
  2021-12-27  1:33           ` Theodore Ts'o
  2021-12-27 18:44           ` Steffen Nurpmeso
  2021-12-27 18:37         ` Steffen Nurpmeso
  1 sibling, 2 replies; 26+ messages in thread
From: Warner Losh @ 2021-12-26 21:33 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: Rudi Blom, coff


[-- Attachment #1.1: Type: text/plain, Size: 2759 bytes --]

On Sun, Dec 26, 2021, 2:18 PM Theodore Ts'o <tytso@mit.edu> wrote:

> On Sun, Dec 26, 2021 at 12:43:37AM +0100, Steffen Nurpmeso wrote:
> > I usually do "scp .* HOST:" whenever i get a HOST account, and
> > forget about it thereafter.
>
> I keep a private git repo on one of my machines, so when I get a HOST
> account, I run a comand like this:
>
> % git clone ssh://tytso@example.com/home/tytso/repos/dotfiles .
>

I have symlinks to all my files. I also have special hooks that I run per
os and per host to pull in different configs when needed. Though in
recent years I've not needed it much. I used to do a lot for work like
this, but these days work envs are close to my home env, so there is little
point.

I've been doing this since RCS days across 5 different SCMs... git makes
oopses so rare that the paranoia below seems overkill. Though for other
SCMs it would likely not be paranoid enough.

Warner

% cd dotfiles
> % make
>
> This installs a bunch of symlinks from
> dotfiles/{.bashrc,.profile,.muttrc}, etc. to $HOME/.
>
> That way, I can run "git pull" to update my dotfiles on one particular
> machine, and if I make local changes, I'll do a "git push" to send
> them back to my dotfiles repo.
>
> The Makefile I have in my top-level repo some folks might find
> interesting:
>
> .PHONY: all bin dotfiles
>
> all: dotfiles
>
> DIRS= .gnupg .mutt .config/gce-xfstests .config/gcloud/configurations bin
> em
> #DBG= echo
>
> dotfiles:
>         for file in $(shell find $(CURDIR) -maxdepth 1 -type f -name ".*" \
>             -not -name ".*~" -not -name ".gitignore" -print); do \
>                 f=$$(basename $$file); \
>                 if test -f $(HOME)/$$f -a ! -h $(HOME)/$$f ; then \
>                         mkdir -p backup ; \
>                         mv $(HOME)/$$f backup ; \
>                 fi ; \
>                 $(DBG) ln -sfn $$file $(HOME)/$$f; \
>         done
>         for dir in $(DIRS) ; do \
>             $(DBG) mkdir -p $(HOME)/$$dir ; \
>             for file in $$(find $$(pwd)/$$dir -maxdepth 1 -type f \
>                 -not -name "*~" -print); do \
>                 f=$$(basename $$file); \
>                 if test -f $(HOME)/$$dir/$$f -a ! -h $(HOME)/$$dir/$$f ;
> then \
>                         mkdir -p backup/$$dir ; \
>                         mv $(HOME)/$$dir/$$f backup/$$dir ; \
>                 fi ; \
>                 $(DBG) ln -sfn $$file $(HOME)/$$dir/$$f; \
>             done; \
>         done
>         if test -d backup ; then find backup -type f -print ; fi
>
> Cheers,
>
>                                                 - Ted
> _______________________________________________
> COFF mailing list
> COFF@minnie.tuhs.org
> https://minnie.tuhs.org/cgi-bin/mailman/listinfo/coff
>

[-- Attachment #1.2: Type: text/html, Size: 4123 bytes --]

[-- Attachment #2: Type: text/plain, Size: 141 bytes --]

_______________________________________________
COFF mailing list
COFF@minnie.tuhs.org
https://minnie.tuhs.org/cgi-bin/mailman/listinfo/coff

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [COFF] What is your prompt?
  2021-12-26 21:33         ` Warner Losh
@ 2021-12-27  1:33           ` Theodore Ts'o
  2021-12-27  2:52             ` Rudi Blom
  2021-12-27 18:44           ` Steffen Nurpmeso
  1 sibling, 1 reply; 26+ messages in thread
From: Theodore Ts'o @ 2021-12-27  1:33 UTC (permalink / raw)
  To: Warner Losh; +Cc: Rudi Blom, coff

On Sun, Dec 26, 2021 at 02:33:03PM -0700, Warner Losh wrote:
> I have symlinks to all my files. I also have special hooks that I run per
> os and per host to pull in different configs when needed. Though in
> recent years I've not needed it much. I used to do a lot for work like
> this, but these days work envs are close to my home env, so there is little
> point.

I have a bunch of work-specific aliases which get picked up via:

if [ -f $HOME/.bashrc.local ] ; then
   . $HOME/.bashrc.local
fi

I don't keep .bashrc.local under git control, since some of the paths
in those aliases might be considered Work-confidential, so I don't
want to push them out to a personal git repo.

> I've been doing this since RCS days across 5 different SCMs... git makes
> oopses so rare that the paranoia below seems overkill. Though for other
> SCMs it would likely not be paranoid enough.

The backup directory isn't for paranoia, actually.  It's so the first
time that I install my custom dotfiles on a particular machine, if
there is a prexisting dot-file, say, .profile, I copy it to the backup
directory before replacing it with a symlink to the dotfiles repo.

There might be some magic environment variables or PATH setup that is
unique to that particular system's default dot files, so I can take a
quick look at them and see if I might need to extend my generic dot
files, or maybe add something to the ~/.bashrc.local file, or some
such.

					- Ted
_______________________________________________
COFF mailing list
COFF@minnie.tuhs.org
https://minnie.tuhs.org/cgi-bin/mailman/listinfo/coff

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [COFF] What is your prompt?
  2021-12-27  1:33           ` Theodore Ts'o
@ 2021-12-27  2:52             ` Rudi Blom
  2021-12-27  3:43               ` Greg 'groggy' Lehey
  0 siblings, 1 reply; 26+ messages in thread
From: Rudi Blom @ 2021-12-27  2:52 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: coff


[-- Attachment #1.1: Type: text/plain, Size: 2342 bytes --]

My official status seems a bit unclear (although I'm getting paid :-) ) but
unofficially I keep an eye on a lot of a customers servers. Ad-hoc shell
scripts still have similar structure as I know how to 'cut and paste'.

These scripts are run remotely via a 'homegrown' client-server setup. Many
should run on different UNIX environments and therefore have near the
beginning an OS check. Depending on that I can set PATH and anything else
important.

#
# check what type of OS this system runs on
#
OST=`uname -m`
case ${OST} in
"i386")
OST="SCO"
...
;;
"alpha")
OST="ALP"
...
;;
"ia64")
OST="HPU"
...
;;
*)
echo "unknown OS type ${OST} ... \c"
exit 1
;;
esac


On Mon, 27 Dec 2021 at 08:33, Theodore Ts'o <tytso@mit.edu> wrote:

> On Sun, Dec 26, 2021 at 02:33:03PM -0700, Warner Losh wrote:
> > I have symlinks to all my files. I also have special hooks that I run per
> > os and per host to pull in different configs when needed. Though in
> > recent years I've not needed it much. I used to do a lot for work like
> > this, but these days work envs are close to my home env, so there is
> little
> > point.
>
> I have a bunch of work-specific aliases which get picked up via:
>
> if [ -f $HOME/.bashrc.local ] ; then
>    . $HOME/.bashrc.local
> fi
>
> I don't keep .bashrc.local under git control, since some of the paths
> in those aliases might be considered Work-confidential, so I don't
> want to push them out to a personal git repo.
>
> > I've been doing this since RCS days across 5 different SCMs... git makes
> > oopses so rare that the paranoia below seems overkill. Though for other
> > SCMs it would likely not be paranoid enough.
>
> The backup directory isn't for paranoia, actually.  It's so the first
> time that I install my custom dotfiles on a particular machine, if
> there is a prexisting dot-file, say, .profile, I copy it to the backup
> directory before replacing it with a symlink to the dotfiles repo.
>
> There might be some magic environment variables or PATH setup that is
> unique to that particular system's default dot files, so I can take a
> quick look at them and see if I might need to extend my generic dot
> files, or maybe add something to the ~/.bashrc.local file, or some
> such.
>
>                                         - Ted
>


-- 
The more I learn the better I understand I know nothing.

[-- Attachment #1.2: Type: text/html, Size: 4253 bytes --]

[-- Attachment #2: Type: text/plain, Size: 141 bytes --]

_______________________________________________
COFF mailing list
COFF@minnie.tuhs.org
https://minnie.tuhs.org/cgi-bin/mailman/listinfo/coff

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [COFF] What is your prompt?
  2021-12-27  2:52             ` Rudi Blom
@ 2021-12-27  3:43               ` Greg 'groggy' Lehey
  2021-12-27  4:06                 ` Rudi Blom
  0 siblings, 1 reply; 26+ messages in thread
From: Greg 'groggy' Lehey @ 2021-12-27  3:43 UTC (permalink / raw)
  To: Rudi Blom; +Cc: coff


[-- Attachment #1.1: Type: text/plain, Size: 1726 bytes --]

On Monday, 27 December 2021 at  9:52:24 +0700, Rudi Blom wrote:
> My official status seems a bit unclear (although I'm getting paid :-) ) but
> unofficially I keep an eye on a lot of a customers servers. Ad-hoc shell
> scripts still have similar structure as I know how to 'cut and paste'.
>
> These scripts are run remotely via a 'homegrown' client-server setup. Many
> should run on different UNIX environments and therefore have near the
> beginning an OS check. Depending on that I can set PATH and anything else
> important.
>
> #
> # check what type of OS this system runs on
> #
> OST=`uname -m`

That's the architecture.  Wouldn't just `uname` be better?  I have:

  case `uname` in
  Linux)
    PATH=.:~:/usr/local/bin:/usr/local/sbin:~/bin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin:/usr/local/bitkeeper:/Photos/Tools
    export SHELL=/bin/bash
    ;;

  NetBSD)
    PATH=.:~:/usr/pkg/bin::/usr/local/bin:/usr/local/sbin:~/bin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin:/usr/local/bitkeeper:/usr/local/gnu-autotools/bin:~:/Photos/Tools
    export SHELL=/usr/pkg/bin/bash
    ;;

  FreeBSD)
    PATH=.:~:/home/local/bin:/usr/local/bin:/usr/local/sbin:~/bin:/usr/bin:/usr/sbin:/bin:/sbin:/Photos/Tools:~
    export SHELL=/usr/local/bin/bash
    ;;
...

And yes, lm, if you're looking, there's really a /usr/local/bitkeeper
in there.  It's been years, but I don't tidy these things up very
often.  I only just removed mosaic from my fvwm2 config menus.

Greg
--
Sent from my desktop computer.
Finger grog@lemis.com for PGP public key.
See complete headers for address and phone numbers.
This message is digitally signed.  If your Microsoft mail program
reports problems, please read http://lemis.com/broken-MUA.php

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 163 bytes --]

[-- Attachment #2: Type: text/plain, Size: 141 bytes --]

_______________________________________________
COFF mailing list
COFF@minnie.tuhs.org
https://minnie.tuhs.org/cgi-bin/mailman/listinfo/coff

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [COFF] What is your prompt?
  2021-12-27  3:43               ` Greg 'groggy' Lehey
@ 2021-12-27  4:06                 ` Rudi Blom
  2021-12-27  4:12                   ` Greg 'groggy' Lehey
  0 siblings, 1 reply; 26+ messages in thread
From: Rudi Blom @ 2021-12-27  4:06 UTC (permalink / raw)
  To: Greg 'groggy' Lehey; +Cc: coff


[-- Attachment #1.1: Type: text/plain, Size: 2308 bytes --]

Just 'uname' is not specific enough. On SCO UNIX 3.2V4.2 uname defaults to
'uname -s'. On AlphaServer with Digital UNIX 4.0g or TRU64 V5.1B I get
'OSF1' as answer. On HP-UX 11.23/11.31 I get 'HP-UX'.

Even if I do a 'uname -m' I may still do additional 'uname [-<argument>]'
for other specifics. Of course a 'uname -a' and 'set -- $*' would be a
possibility.

On Mon, 27 Dec 2021 at 10:43, Greg 'groggy' Lehey <grog@lemis.com> wrote:

> On Monday, 27 December 2021 at  9:52:24 +0700, Rudi Blom wrote:
> > My official status seems a bit unclear (although I'm getting paid :-) )
> but
> > unofficially I keep an eye on a lot of a customers servers. Ad-hoc shell
> > scripts still have similar structure as I know how to 'cut and paste'.
> >
> > These scripts are run remotely via a 'homegrown' client-server setup.
> Many
> > should run on different UNIX environments and therefore have near the
> > beginning an OS check. Depending on that I can set PATH and anything else
> > important.
> >
> > #
> > # check what type of OS this system runs on
> > #
> > OST=`uname -m`
>
> That's the architecture.  Wouldn't just `uname` be better?  I have:
>
>   case `uname` in
>   Linux)
>
> PATH=.:~:/usr/local/bin:/usr/local/sbin:~/bin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin:/usr/local/bitkeeper:/Photos/Tools
>     export SHELL=/bin/bash
>     ;;
>
>   NetBSD)
>
> PATH=.:~:/usr/pkg/bin::/usr/local/bin:/usr/local/sbin:~/bin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin:/usr/local/bitkeeper:/usr/local/gnu-autotools/bin:~:/Photos/Tools
>     export SHELL=/usr/pkg/bin/bash
>     ;;
>
>   FreeBSD)
>
> PATH=.:~:/home/local/bin:/usr/local/bin:/usr/local/sbin:~/bin:/usr/bin:/usr/sbin:/bin:/sbin:/Photos/Tools:~
>     export SHELL=/usr/local/bin/bash
>     ;;
> ...
>
> And yes, lm, if you're looking, there's really a /usr/local/bitkeeper
> in there.  It's been years, but I don't tidy these things up very
> often.  I only just removed mosaic from my fvwm2 config menus.
>
> Greg
> --
> Sent from my desktop computer.
> Finger grog@lemis.com for PGP public key.
> See complete headers for address and phone numbers.
> This message is digitally signed.  If your Microsoft mail program
> reports problems, please read http://lemis.com/broken-MUA.php
>


-- 
The more I learn the better I understand I know nothing.

[-- Attachment #1.2: Type: text/html, Size: 3182 bytes --]

[-- Attachment #2: Type: text/plain, Size: 141 bytes --]

_______________________________________________
COFF mailing list
COFF@minnie.tuhs.org
https://minnie.tuhs.org/cgi-bin/mailman/listinfo/coff

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [COFF] What is your prompt?
  2021-12-27  4:06                 ` Rudi Blom
@ 2021-12-27  4:12                   ` Greg 'groggy' Lehey
  2021-12-27  4:28                     ` Rudi Blom
  0 siblings, 1 reply; 26+ messages in thread
From: Greg 'groggy' Lehey @ 2021-12-27  4:12 UTC (permalink / raw)
  To: Rudi Blom; +Cc: coff


[-- Attachment #1.1: Type: text/plain, Size: 625 bytes --]

On Monday, 27 December 2021 at 11:06:07 +0700, Rudi Blom wrote:
> Just 'uname' is not specific enough. On SCO UNIX 3.2V4.2 uname defaults to
> 'uname -s'. On AlphaServer with Digital UNIX 4.0g or TRU64 V5.1B I get
> 'OSF1' as answer. On HP-UX 11.23/11.31 I get 'HP-UX'.

That looks good to me.  And I thought that uname without parms always
defaults to uname -s.

Greg
--
Sent from my desktop computer.
Finger grog@lemis.com for PGP public key.
See complete headers for address and phone numbers.
This message is digitally signed.  If your Microsoft mail program
reports problems, please read http://lemis.com/broken-MUA.php

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 163 bytes --]

[-- Attachment #2: Type: text/plain, Size: 141 bytes --]

_______________________________________________
COFF mailing list
COFF@minnie.tuhs.org
https://minnie.tuhs.org/cgi-bin/mailman/listinfo/coff

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [COFF] What is your prompt?
  2021-12-27  4:12                   ` Greg 'groggy' Lehey
@ 2021-12-27  4:28                     ` Rudi Blom
  0 siblings, 0 replies; 26+ messages in thread
From: Rudi Blom @ 2021-12-27  4:28 UTC (permalink / raw)
  To: Greg 'groggy' Lehey; +Cc: coff


[-- Attachment #1.1: Type: text/plain, Size: 1046 bytes --]

On SCO UNIX 3.2V4.2 'uname' defaults to 'uname -s' BUT for both the output
is the server/host/node name. It's the "NODE" as found in
/etc/conf/cf.d/stune and generated into the kernel.

On DU/TRU64 'uname' defaults to 'uname -s', on HP-UX the same.


On Mon, 27 Dec 2021 at 11:12, Greg 'groggy' Lehey <grog@lemis.com> wrote:

> On Monday, 27 December 2021 at 11:06:07 +0700, Rudi Blom wrote:
> > Just 'uname' is not specific enough. On SCO UNIX 3.2V4.2 uname defaults
> to
> > 'uname -s'. On AlphaServer with Digital UNIX 4.0g or TRU64 V5.1B I get
> > 'OSF1' as answer. On HP-UX 11.23/11.31 I get 'HP-UX'.
>
> That looks good to me.  And I thought that uname without parms always
> defaults to uname -s.
>
> Greg
> --
> Sent from my desktop computer.
> Finger grog@lemis.com for PGP public key.
> See complete headers for address and phone numbers.
> This message is digitally signed.  If your Microsoft mail program
> reports problems, please read http://lemis.com/broken-MUA.php
>


-- 
The more I learn the better I understand I know nothing.

[-- Attachment #1.2: Type: text/html, Size: 1713 bytes --]

[-- Attachment #2: Type: text/plain, Size: 141 bytes --]

_______________________________________________
COFF mailing list
COFF@minnie.tuhs.org
https://minnie.tuhs.org/cgi-bin/mailman/listinfo/coff

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [COFF] What is your prompt?
  2021-12-26 21:18       ` Theodore Ts'o
  2021-12-26 21:33         ` Warner Losh
@ 2021-12-27 18:37         ` Steffen Nurpmeso
  1 sibling, 0 replies; 26+ messages in thread
From: Steffen Nurpmeso @ 2021-12-27 18:37 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: Rudi Blom, coff

Theodore Ts'o wrote in
 <YcjcC7x8TrMq4kvy@mit.edu>:
 |On Sun, Dec 26, 2021 at 12:43:37AM +0100, Steffen Nurpmeso wrote:
 |> I usually do "scp .* HOST:" whenever i get a HOST account, and
 |> forget about it thereafter.
 |
 |I keep a private git repo on one of my machines, so when I get a HOST
 |account, I run a comand like this:
 |
 |% git clone ssh://tytso@example.com/home/tytso/repos/dotfiles .
 |% cd dotfiles
 |% make
 |
 |This installs a bunch of symlinks from
 |dotfiles/{.bashrc,.profile,.muttrc}, etc. to $HOME/.
 |
 |That way, I can run "git pull" to update my dotfiles on one particular
 |machine, and if I make local changes, I'll do a "git push" to send
 |them back to my dotfiles repo.

Negative.. but i have sort of this for root accounts, less any
fancy make(1) mechanism, however, but there is ~/sic/root.git, and
locally i merge/bundle according branches into machine specific
branche(s) that can then be pushed/fetched.
(My spare "wales" even simply selectively shares the filesystem
via snapshots, it is just which /root/.git branch is checked out,
and one "/root/bin/backup.sh restore" after FS synchronization;
same shared static kernel, but different ssh keys and /etc/hosts,
hostname via kernel command line, thanks to /dev/mapper even
/etc/fstab is identical.  I can git merge "kent" into "wales", and
git just does it right!)

I "only have symlinks" in my non-root ~/, but i have to create
them manually.  I do not have many accounts i work with:
practically all VMs for building+testing software, so not much
effort getting cosy there.  Here on "kent" i created them on April
13th 2019, only added .irssi on April 22nd once i started using
IRC, too.  That is manageable.
And all the directories that then exist nonetheless, ~/sic,
~/{,sec.}arena, ~/$USR (~/usr-kent-crux-linux-x86_64/{bin,lib..}
here) are created by ~/.profile when i login the first time with
the symlink tree present.  (But of course they are empty, hm.)

It all _is_ in a sec.arena/configs.git directory, but there is
home/ as well as .home/ and some others, and only home/ content is
to be distributed, so i go into that home and scp(1).  The data in
there is pretty stable, and what changes sometimes, for example my
mailer's config when its development continues, or the .cwmrc just
got a "pkill -CONT tmux" last week (^Z delivery sometimes hits
tmux not the terminal within where it is typed), is needed only
locally.  But your approach is much nicer.

Just to add that ~/sic is an encfs mount of ~/.sic, ~/.mozilla of
~/.secweb-mozilla (normal browsing container mounts a specific
/home partition), and ~/sec.arena of ~/.sec.arena, only the latter
two of which are permanently mounted when the lid is up.

Really, i love what has become possible with modern hard- and
software!

 |The Makefile I have in my top-level repo some folks might find
 |interesting:
 |
 |.PHONY: all bin dotfiles
 |
 |all: dotfiles
 |
 |DIRS= .gnupg .mutt .config/gce-xfstests .config/gcloud/configurations \
 |bin em
 |#DBG= echo
 |
 |dotfiles:
 | for file in $(shell find $(CURDIR) -maxdepth 1 -type f -name ".*" \
 |     -not -name ".*~" -not -name ".gitignore" -print); do \
 |  f=$$(basename $$file); \
 |  if test -f $(HOME)/$$f -a ! -h $(HOME)/$$f ; then \
 |   mkdir -p backup ; \
 |   mv $(HOME)/$$f backup ; \
 |  fi ; \
 |  $(DBG) ln -sfn $$file $(HOME)/$$f; \
 | done
 | for dir in $(DIRS) ; do \
 |     $(DBG) mkdir -p $(HOME)/$$dir ; \
 |     for file in $$(find $$(pwd)/$$dir -maxdepth 1 -type f \
 |  -not -name "*~" -print); do \
 |  f=$$(basename $$file); \
 |  if test -f $(HOME)/$$dir/$$f -a ! -h $(HOME)/$$dir/$$f ; then \
 |   mkdir -p backup/$$dir ; \
 |   mv $(HOME)/$$dir/$$f backup/$$dir ; \
 |  fi ; \
 |  $(DBG) ln -sfn $$file $(HOME)/$$dir/$$f; \
 |     done; \
 | done
 | if test -d backup ; then find backup -type f -print ; fi

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)
_______________________________________________
COFF mailing list
COFF@minnie.tuhs.org
https://minnie.tuhs.org/cgi-bin/mailman/listinfo/coff

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [COFF] What is your prompt?
  2021-12-26 21:33         ` Warner Losh
  2021-12-27  1:33           ` Theodore Ts'o
@ 2021-12-27 18:44           ` Steffen Nurpmeso
  2021-12-27 18:55             ` Warner Losh
  1 sibling, 1 reply; 26+ messages in thread
From: Steffen Nurpmeso @ 2021-12-27 18:44 UTC (permalink / raw)
  To: Warner Losh; +Cc: Rudi Blom, coff

Warner Losh wrote in
 <CANCZdfoP6bkJCMTD96p=iEH8YP9cq1vX9TfXDASu0egmPYGVfQ@mail.gmail.com>:
 |On Sun, Dec 26, 2021, 2:18 PM Theodore Ts'o <tytso@mit.edu> wrote:
 |> On Sun, Dec 26, 2021 at 12:43:37AM +0100, Steffen Nurpmeso wrote:
 |>> I usually do "scp .* HOST:" whenever i get a HOST account, and
 |>> forget about it thereafter.
 |>
 |> I keep a private git repo on one of my machines, so when I get a HOST
 |> account, I run a comand like this:
 |>
 |> % git clone ssh://tytso@example.com/home/tytso/repos/dotfiles .
 |
 |I have symlinks to all my files. I also have special hooks that I run per
 |os and per host to pull in different configs when needed. Though in
 |recent years I've not needed it much. I used to do a lot for work like
 |this, but these days work envs are close to my home env, so there is little
 |point.
 |
 |I've been doing this since RCS days across 5 different SCMs... git makes
 |oopses so rare that the paranoia below seems overkill. Though for other

Oh yes, i could not agree more.  I never tried bitkeeper ;), but
even after eleven years of git (~/calendar (symlink) just told me

  12/24   Beschließe öffentliche Projekte mit GIT zu managen (2010)

) i often state "when have i told the last time that git is
magnificent?" when it rebases automatically over long history,
garbage-collects into one big pack (alongside those i want to
.keep unchanged), or selectively distributes branches here and
there.  Wording spread they furtherly improved the merge algorithm
just recently.

 |SCMs it would likely not be paranoid enough.

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)
_______________________________________________
COFF mailing list
COFF@minnie.tuhs.org
https://minnie.tuhs.org/cgi-bin/mailman/listinfo/coff

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [COFF] What is your prompt?
  2021-12-27 18:44           ` Steffen Nurpmeso
@ 2021-12-27 18:55             ` Warner Losh
  2021-12-27 19:07               ` Grant Taylor via COFF
  2021-12-27 19:25               ` Steffen Nurpmeso
  0 siblings, 2 replies; 26+ messages in thread
From: Warner Losh @ 2021-12-27 18:55 UTC (permalink / raw)
  To: Warner Losh, Theodore Ts'o, Rudi Blom, coff


[-- Attachment #1.1: Type: text/plain, Size: 2240 bytes --]

On Mon, Dec 27, 2021 at 11:44 AM Steffen Nurpmeso <steffen@sdaoden.eu>
wrote:

> Warner Losh wrote in
>  <CANCZdfoP6bkJCMTD96p=iEH8YP9cq1vX9TfXDASu0egmPYGVfQ@mail.gmail.com>:
>  |On Sun, Dec 26, 2021, 2:18 PM Theodore Ts'o <tytso@mit.edu> wrote:
>  |> On Sun, Dec 26, 2021 at 12:43:37AM +0100, Steffen Nurpmeso wrote:
>  |>> I usually do "scp .* HOST:" whenever i get a HOST account, and
>  |>> forget about it thereafter.
>  |>
>  |> I keep a private git repo on one of my machines, so when I get a HOST
>  |> account, I run a comand like this:
>  |>
>  |> % git clone ssh://tytso@example.com/home/tytso/repos/dotfiles .
>  |
>  |I have symlinks to all my files. I also have special hooks that I run per
>  |os and per host to pull in different configs when needed. Though in
>  |recent years I've not needed it much. I used to do a lot for work like
>  |this, but these days work envs are close to my home env, so there is
> little
>  |point.
>  |
>  |I've been doing this since RCS days across 5 different SCMs... git makes
>  |oopses so rare that the paranoia below seems overkill. Though for other
>
> Oh yes, i could not agree more.  I never tried bitkeeper ;), but
> even after eleven years of git (~/calendar (symlink) just told me
>
>   12/24   Beschließe öffentliche Projekte mit GIT zu managen (2010)
>
> ) i often state "when have i told the last time that git is
> magnificent?" when it rebases automatically over long history,
> garbage-collects into one big pack (alongside those i want to
> .keep unchanged), or selectively distributes branches here and
> there.  Wording spread they furtherly improved the merge algorithm
> just recently.
>

The first years of git were interesting times to be using it. After that
it's been rock solid, especially relative to all the other tools out there.

 I have something similar to the .local stuff Ted does. In fact, I used to
use exactly that pattern. However, I've taken to doing that via symlinks
to the host name (so foo.host with multiple ones symlinked to the
master if it comes to that). That way I could keep my local changes
in version control... One to many client machines crashing and losing
stuff in my past...

Warner

[-- Attachment #1.2: Type: text/html, Size: 3075 bytes --]

[-- Attachment #2: Type: text/plain, Size: 141 bytes --]

_______________________________________________
COFF mailing list
COFF@minnie.tuhs.org
https://minnie.tuhs.org/cgi-bin/mailman/listinfo/coff

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [COFF] What is your prompt?
  2021-12-27 18:55             ` Warner Losh
@ 2021-12-27 19:07               ` Grant Taylor via COFF
  2021-12-27 19:25               ` Steffen Nurpmeso
  1 sibling, 0 replies; 26+ messages in thread
From: Grant Taylor via COFF @ 2021-12-27 19:07 UTC (permalink / raw)
  To: coff


[-- Attachment #1.1: Type: text/plain, Size: 955 bytes --]

On 12/27/21 11:55 AM, Warner Losh wrote:
> I've taken to doing that via symlinks to the host name (so foo.host 
> with multiple ones symlinked to the master if it comes to that). That 
> way I could keep my local changes in version control... One to many 
> client machines crashing and losing stuff in my past...

I too use <something>.<hostname> where something is aliases, bashrc, 
zshrc, etc.

I will also frequently have <something>.<hostname> source 
<something>.<arbitrary group>.  That way I can have $WORK specific 
things in <something>.<$WORK> and personal things in <something>.home, 
and accounts on friends systems source <something>.<friend's name>. 
Thus I have things common to <arbitrary group> in one file.  It means 
that machine specific <something>.<hostname> ends up being quite 
minimal.  I could probably get away with (sym)links if I don't need 
/anything/ host specific.



-- 
Grant. . . .
unix || die


[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4017 bytes --]

[-- Attachment #2: Type: text/plain, Size: 141 bytes --]

_______________________________________________
COFF mailing list
COFF@minnie.tuhs.org
https://minnie.tuhs.org/cgi-bin/mailman/listinfo/coff

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [COFF] What is your prompt?
  2021-12-27 18:55             ` Warner Losh
  2021-12-27 19:07               ` Grant Taylor via COFF
@ 2021-12-27 19:25               ` Steffen Nurpmeso
  1 sibling, 0 replies; 26+ messages in thread
From: Steffen Nurpmeso @ 2021-12-27 19:25 UTC (permalink / raw)
  To: Warner Losh; +Cc: Rudi Blom, coff

Warner Losh wrote in
 <CANCZdfrKFTjWnNGcZBTBfZ9e379VwjhNJK3Z8mLJR9dKLOj4SA@mail.gmail.com>:
 |On Mon, Dec 27, 2021 at 11:44 AM Steffen Nurpmeso <steffen@sdaoden.eu>
 |wrote:
 |> Warner Losh wrote in
 |>  <CANCZdfoP6bkJCMTD96p=iEH8YP9cq1vX9TfXDASu0egmPYGVfQ@mail.gmail.com>:
 |>|On Sun, Dec 26, 2021, 2:18 PM Theodore Ts'o <tytso@mit.edu> wrote:
 |>|> I keep a private git repo on one of my machines, so when I get a HOST
 |>|> account, I run a comand like this:
 |>|>
 |>|> % git clone ssh://tytso@example.com/home/tytso/repos/dotfiles .
 |>|
 |>|I have symlinks to all my files. I also have special hooks that I run per
 |>|os and per host to pull in different configs when needed. Though in
 |>|recent years I've not needed it much. I used to do a lot for work like
 |>|this, but these days work envs are close to my home env, so there is
 |> little
 |>|point.
 |>|
 |>|I've been doing this since RCS days across 5 different SCMs... git makes
 |>|oopses so rare that the paranoia below seems overkill. Though for other
 |>
 |> Oh yes, i could not agree more.  I never tried bitkeeper ;), but
 |> even after eleven years of git (~/calendar (symlink) just told me
 ...
 |>   12/24   Beschließe öffentliche Projekte mit GIT zu managen (2010)
 ...
 |The first years of git were interesting times to be using it. After that
 |it's been rock solid, especially relative to all the other tools out there.

"rebase --onto" never really worked for me until it then did, but
it took long.  They reversed the output of rev-parse at some time,
i test for version 1.8 for the switch.  The garbage collect memory
window limit maybe now works .. and garbage collection took longer but
required less memory in earlier times, i always see it on the
OpenCSW.org cluster which uses git 2.4, 1.7.10.3 and what
else, but the plan to build on old one just for gc i never put in
practice; whether that today would still work, i do not know
either, no hash but SHA-1 here still, however.

I hated it bailed on breaking network connections, i do not know
whether they fixed it, i am now behind datagram based VPN, and
that "heals" that problem for me, practically always, luckily.  It
is a pain with a bad internet connection when huge downloads then
break after say hundreds of megabytes, and cannot be restarted at
the time it bailed.  On the other hand i never tried to fix it,
not even locally.

No breakage here, never.  Wow.

 | I have something similar to the .local stuff Ted does. In fact, I used to
 |use exactly that pattern. However, I've taken to doing that via symlinks
 |to the host name (so foo.host with multiple ones symlinked to the
 |master if it comes to that). That way I could keep my local changes
 |in version control... One to many client machines crashing and losing
 |stuff in my past...

Yeah.  No. :)  (But for one lost backup encryption key that almost
broke me and anyway ate some really good work i was/am prowd of.)

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)
_______________________________________________
COFF mailing list
COFF@minnie.tuhs.org
https://minnie.tuhs.org/cgi-bin/mailman/listinfo/coff

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [COFF] What is your prompt?
  2021-12-24 17:17 ` [COFF] What is your prompt? Grant Taylor via COFF
@ 2021-12-26 22:17   ` Mike Markowski
  0 siblings, 0 replies; 26+ messages in thread
From: Mike Markowski @ 2021-12-26 22:17 UTC (permalink / raw)
  To: coff


[-- Attachment #1.1: Type: text/plain, Size: 182 bytes --]

>
> On 12/22/21 11:59 PM, Andy Kosela wrote:
> What is your prompt?

 I prefer minimalism:  export PS1="\h$ "

Similarly, in ham radio I prefer CW (Morse code).  :-)

Mike Markowski

[-- Attachment #1.2: Type: text/html, Size: 451 bytes --]

[-- Attachment #2: Type: text/plain, Size: 141 bytes --]

_______________________________________________
COFF mailing list
COFF@minnie.tuhs.org
https://minnie.tuhs.org/cgi-bin/mailman/listinfo/coff

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [COFF] What is your prompt?
  2021-12-23  6:59 [COFF] What is your prompt? (was: ksh88 source code?) Andy Kosela
@ 2021-12-24 17:17 ` Grant Taylor via COFF
  2021-12-26 22:17   ` Mike Markowski
  0 siblings, 1 reply; 26+ messages in thread
From: Grant Taylor via COFF @ 2021-12-24 17:17 UTC (permalink / raw)
  To: coff


[-- Attachment #1.1: Type: text/plain, Size: 3927 bytes --]

On 12/22/21 11:59 PM, Andy Kosela wrote:
> What is your prompt?
Pre-Script:  Seeing as how this is COFF and it's supposed to be a slow 
day at work (holding down the fort while others celebrate) I'll chime 
in.  What follows is what the type of thing that I'd be interested in 
reading from others.

I've been a *LONG* *TIME* advocate for having at the very minimum 1) the 
(current) username and 2) the hostname in the prompt.  This became 
exceedingly apparent at my last job with a bunch of junior admins, too 
many of which (read: > 0), inadvertently issued commands as the wrong 
user and / or on the wrong host.

I personally like having the current working directory in the prompt.

After some other incidents at my previous job, I started advocating for 
having the leading character in the prompt be a "#" so that most shells 
would not interpret it as a command pasted with trailing carriage return.

This brings me to the quintessential Bash / Zsh PS1 prompt of:

    PS1="#[\u@\h:\w]\$ "

The square brackets are effectively eye candy.  The \$ evaluates to 
indication of if you're running as a normal user or root.  It's largely 
superfluous with \u in the prompt.  But it makes things uniform and 
reduces questions when others are learning things.

When I migrated to Zsh, my prompt got a bit more complex.  The base 
prompt in a new terminal window still looks mostly the same as the above 
PS1.  The biggest difference is that I use Zsh's RPROMPT for transient 
things like the previous commands return code ($?) and date & time (the 
prompt was printed).  The RPROMPT has the nice feature of it leaves the 
screen when when the current command is executed, thus it doesn't 
clutter screen scroll back.

I'm leveraging Zsh's conditional prompt features to make the return code 
($?) stand out in bright white on bright red when $? != 0.

My shell initialization files conditionally set various environment 
variables which are used in the prompt.  Conditionally on things like:

  - the TERM type
  - my terminal emulator's answer back - used for terminal specific features
  - shell level
  - if the shell is forked from inside of screen / tmux
  - if the shell is forked from inside of vim

Depending on the TERM type and my terminal's answer back I'll either 
include control sequences to set the window title to (simplified version 
of) the PS1 prompt.  This way I have a good idea from the window title 
when selecting minimized windows from lists, where the terminal therein is.

I'm leveraging Zsh's preexec() function to conditionally set the window 
title to the command that's being executed if answer back indicates a 
supported terminal emulator.

I'm comparing the host name to the value of answer back to set the 
prompt color as a simple indicator if I'm on my local system or not.

  - Green  = terminal to local system
  - Yellow = terminal to a non-local system
  - Red    = terminal as root window somewhere, BE CAREFUL

So ... my Zsh prompt has a fair bit behind it.  But the bulk of what's 
printed is still the comment character, the username, the hostname, the 
current working directory, and the (non)root indicator.

One deviation is that I now have my root prompt (via sudo / su) slightly 
different in that after the effective user name, root, the prompt also 
includes my real user name in parenthesis.

    #[root(gtaylor)@host:~]#

As I do more with containers, I'm getting ready to implement a similar 
permutation on the host portion such that the host name portion reflects 
the container's / network namespace's value of \h with parent host OS's 
name in side of parenthesis, much like the effective / logged in user pair.

    #[root(gtaylor)@netns(host):~]#

Post-Script:  Happy holidays.  Here's hoping that things are going well 
for you and yours.



-- 
Grant. . . .
unix || die


[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4017 bytes --]

[-- Attachment #2: Type: text/plain, Size: 141 bytes --]

_______________________________________________
COFF mailing list
COFF@minnie.tuhs.org
https://minnie.tuhs.org/cgi-bin/mailman/listinfo/coff

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2021-12-27 19:26 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-25  2:50 [COFF] What is your prompt? Rudi Blom
2021-12-25  4:40 ` Theodore Ts'o
2021-12-25 17:39   ` Steffen Nurpmeso
2021-12-25 18:28     ` Grant Taylor via COFF
2021-12-25 19:14       ` Steffen Nurpmeso
2021-12-26  3:44         ` Grant Taylor via COFF
2021-12-25 23:19   ` Greg 'groggy' Lehey
2021-12-25 23:43     ` Steffen Nurpmeso
2021-12-26 21:18       ` Theodore Ts'o
2021-12-26 21:33         ` Warner Losh
2021-12-27  1:33           ` Theodore Ts'o
2021-12-27  2:52             ` Rudi Blom
2021-12-27  3:43               ` Greg 'groggy' Lehey
2021-12-27  4:06                 ` Rudi Blom
2021-12-27  4:12                   ` Greg 'groggy' Lehey
2021-12-27  4:28                     ` Rudi Blom
2021-12-27 18:44           ` Steffen Nurpmeso
2021-12-27 18:55             ` Warner Losh
2021-12-27 19:07               ` Grant Taylor via COFF
2021-12-27 19:25               ` Steffen Nurpmeso
2021-12-27 18:37         ` Steffen Nurpmeso
2021-12-26  3:29     ` Grant Taylor via COFF
2021-12-26  3:54       ` Greg 'groggy' Lehey
2021-12-26  5:27         ` Grant Taylor via COFF
  -- strict thread matches above, loose matches on Subject: below --
2021-12-23  6:59 [COFF] What is your prompt? (was: ksh88 source code?) Andy Kosela
2021-12-24 17:17 ` [COFF] What is your prompt? Grant Taylor via COFF
2021-12-26 22:17   ` Mike Markowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).