Re: [Dorset] ed, vi et al

2019-07-05 Thread Ralph Corderoy
Hi Tim,

> I sometimes think the same about the default tty signal mapping of
> Ctrl-\ for SIGQUIT -- the two keys appear next to either other on this
> keyboard, so is easy for e.g. a cat to type (or even a mis-typed
> Ctrl-Z undo attempt).

I typed this TTY's QUIT character on Wednesday by accident.  Here, it's
also defined as Ctrl-\.  But I typed Ctrl-Shift-4; I probably wanted ‘$’
but Ctrl was still on its way up.

Actually, the Shift isn't required; Ctrl-4 does SIGQUIT too, and not
because of the bit-twiddling reason that Ctrl-2 gives NUL just as Ctrl-@
should: that Shift-2 is ‘"’.  xterm's input.c says it's an X thing, but
I haven't found anything else about it:

 * X "normally" has some built-in translations, which the user may want to
 * suppress when processing the modifyOtherKeys resource.  In particular, 
the
 * control modifier applied to some of the keyboard digits gives results for
 * control characters.

Here's me entering Ctrl-1, Ctrl-2, ... up to Ctrl-0 and then Enter.

$ stty raw; \
> ((timeout --foreground 4.2 dd bs=1; stty cooked; echo >&3) | hd) 3>&1
1^@^[^\^]^^^_^?9^M
  31 00 1b 1c 1d 1e 1f 7f  39 0d|1...9.|
000a
$

You can see the TTY's ‘ctlecho’ setting causing Ctrl-2 to be echoed as
‘^@’, NUL, and that's confirmed by the hex dump.  0x1c is backslash,
0x5c, with Ctrl masking off 0x40.

-- 
Cheers, Ralph.

-- 
  Next meeting: BEC, Bournemouth, Tuesday, 2019-08-06 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk/
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Links from 2019-07-02's Pub Meet.

2019-07-05 Thread Ralph Corderoy
Hi Tim,

> Incidentally, a pair of floppy disk drives with PSU, interface card
> and CP/M cost around £800 in 1983 - £2288 today according to
> https://www.inflationtool.com/british-pound

That's using CPI, which I always think of as a con by our Government to
help hide that successive post-war Governments, of all flavours, have
indebted us by over-promising what we can't afford and needing to erode
our debt, and our savings, away.  :-)

RPI, specifically DQAD from ONS's MM23,
https://www.ons.gov.uk/economy/inflationandpriceindices/timeseries/dqad/mm23
has these indexes for 1983 and 2019-05, the latest month available.

£800 * 286.3 / 86.8 = £2,638.71

LibreOffice here, 6.2.4-1, can't show the whole XLSX file available
above: too many columns.

-- 
Cheers, Ralph.

-- 
  Next meeting: BEC, Bournemouth, Tuesday, 2019-08-06 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk/
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Very slow Desktop startup problem

2019-07-05 Thread Ralph Corderoy
Hi Clive,

> Should the swap show a mount point and if so where?  (/?)

No, a mount point is a directory where the filesystem's root directory
appears, e.g. /home is a common one.  Whilst it's mounted, the contents
of the original /home directory are inaccessible as accesses pass across
to the mounted filesystem instead.

> probably won't get the time to run other commands till weekend

Well when you do, here's an updated version that tells us similar
information to above, and more.

 (
 set -x
 grep -w swap /etc/fstab
 lsblk -o type,name,fstype,label,uuid,mountpoint,size,partuuid
 sudo -i blkid
 ls -l /dev/disk/*
 ) |&
 curl -sSF 'f:1=<-' ix.io

-- 
Cheers, Ralph.

-- 
  Next meeting: BEC, Bournemouth, Tuesday, 2019-08-06 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk/
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Very slow Desktop startup problem

2019-07-05 Thread Victor Churchill
:)

Now to me, it's more logical to tinker with the file descriptors of the
command first and then say where they are going rather than vice versa.

On a related note I recall early *nixes where the command switches had to
precede all the other arguments. Took me years to get used to the fact that
in later versions you could say 'ls foo* -l'


best regards,
웃
Victor Churchill,
Netley Abbey, Southampton
07970 844083


On Fri, 5 Jul 2019 at 13:35, Ralph Corderoy  wrote:

> Hi Victor,
>
> > Saying 'do_something_interesting 2>&1 > something_interesting.log'
>
> Or, the alternative action of ‘foo >bar 2>&1’.  :-)
>
> --
> Cheers, Ralph.
>
> --
>   Next meeting: BEC, Bournemouth, Tuesday, 2019-08-06 20:00
>   Check to whom you are replying
>   Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk/
>   New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk
>
-- 
  Next meeting: BEC, Bournemouth, Tuesday, 2019-08-06 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk/
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] ed, vi et al

2019-07-05 Thread Tim Waugh
On Fri, 5 Jul 2019 at 08:07, Ralph Corderoy  wrote:

> Here's me entering Ctrl-1, Ctrl-2, ... up to Ctrl-0 and then Enter.
>
> $ stty raw; \
> > ((timeout --foreground 4.2 dd bs=1; stty cooked; echo >&3) | hd) 3>&1
> 1^@^[^\^]^^^_^?9^M
>   31 00 1b 1c 1d 1e 1f 7f  39 0d
> |1...9.|
> 000a
> $
>
> You can see the TTY's ‘ctlecho’ setting causing Ctrl-2 to be echoed as
> ‘^@’, NUL, and that's confirmed by the hex dump.  0x1c is backslash,
> 0x5c, with Ctrl masking off 0x40.
>

I had no idea about those. It's a minefield!

Tim.
*/
-- 
  Next meeting: BEC, Bournemouth, Tuesday, 2019-08-06 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk/
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Very slow Desktop startup problem

2019-07-05 Thread Patrick Wigmore
On Fri, 5 Jul 2019 at 08:44, Ralph Corderoy  wrote:
> (yada yada) |& curl -sSF 'f:1=<-' ix.io

On Fri, 05 Jul 2019 11:42:22 +0100, Victor Churchill wrote:
> I was puzzled to see the '&' in your command above. I'd have thought that
> saying
> (yada yada) | curl -sSF 'f:1=<-' ix.io
> would do the trick

In bash(1), |& is one operator, not two.

From the manual:
> If |& is used, command's standard error, in addition to its standard
> output, is connected to command2's standard input through the pipe; it
> is shorthand for 2>&1 |.

On Fri, 05 Jul 2019 11:42:22 +0100, Victor Churchill wrote:
> [I'd have thought that] adding the ampersand would, if anything, cause
> it to break: "pipe this lot to nothing, and while you're about it
> run this curl with no stdin"

I think that would be the meaning if you were to put a space between | and &:

(yada yada) | & curl -sSF 'f:1=<-' ix.io

But that form produces a syntax error.

$ echo "dogs" | & cat
bash: syntax error near unexpected token `&'
   

Patrick
-- 
  Next meeting: BEC, Bournemouth, Tuesday, 2019-08-06 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk/
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Discovering unfamiliar utilities

2019-07-05 Thread Ralph Corderoy
Hi Patrick,

> but what method did you use to produce the list of files, excluding
> common operating system libraries?

I expect Bob used ldd(1) and then removed common ones by hand, knowing
what they were likely to be.  For a one-off quick task, automating it
would be more tedious.

set /usr/bin/{true,vim,gimp}

needed() { ldd "$@" | awk '$2 == "=>" {print $3}'; }
for f; do
echo $f
needed $f | fgrep -vf <(
needed "$@" |
sort |
uniq -dc |
awk '$1 == '$#' {print $2}'
) |
xargs -rd\\n size -t
echo
done

> I was inspired to read man(1)'s manual page and to belatedly try out
> man -k and man -K.

Yes, I do use apropos(1).

> For example, the short description of size(1) does not make any 
> mention of object files:
>
> $ man -f size
> size (1) - list section sizes and total size.

This is a bug that you may like to report; it needs ‘of object or
archive files’ appended.  The DESCRIPTION section says as much.  It also
shouldn't end the description with a full stop.

> So, I still feel in want of a good categorised summary of well-known
> commands, or at least a search technique that can expand my search to
> include conceptually-related terms.

I learnt by reading books.  Pre-Internet.  The authors back then
typically put a lot of effort into providing a coherent progression
through the subject.  ‘The Unix Programming Environment’ is an old
classic if you're also interested in programming on Unix.
http://amzn.to/16SVwhD

And the man pages came printed on paper from Sun along with a permuted
index.  Just reading down that index was a good way to find new things
to learn; especially as they paid editors to ensure good NAME sections.
https://en.wikipedia.org/wiki/Ptx_(Unix)

After books came mailing lists and Usenet groups where you'd learn to
spot the knowledgable writers.

Ideally, ‘every day's a school day’.  :-)

-- 
Cheers, Ralph.

-- 
  Next meeting: BEC, Bournemouth, Tuesday, 2019-08-06 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk/
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


[Dorset] Distributed, Fault-tolerant, Filesystems.

2019-07-05 Thread Ralph Corderoy
Hi Tim W.,

> Yes, thinking around the problem of wanting to seamlessly use more
> storage than is available locally on e.g. a laptop, backed by network
> storage (perhaps a local file server, perhaps as a cache for cloud
> storage).
>
> https://ceph.com/ceph-storage/

http://docs.ceph.com/docs/master/architecture/ is a good overview of all
its moving parts.

> https://www.gluster.org/

A useless web site AFAICS; didn't find an obvious list of features.

Another in this sphere is http://www.xtreemfs.org/all_features.php

In the BSD world, https://en.wikipedia.org/wiki/HAMMER is interesting,
but https://en.wikipedia.org/wiki/HAMMER2 has come along without the
networking side of things, yet.

-- 
Cheers, Ralph.

-- 
  Next meeting: BEC, Bournemouth, Tuesday, 2019-08-06 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk/
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Discovering unfamiliar utilities

2019-07-05 Thread John Carlyle-Clarke
You reminded me that a few days ago I listed the files in a core package on
a server (looking for a missing utility) and saw a few things in the list
that I didn't immediately recognise. I thought at the time, "That would be
a good way to learn about utilities that I don't know exist".

The downside is that it's system-dependant, and you have to know or guess
the names of the important packages.

On my system, anything called "*utils" is likely to be worth looking into.

#~ pacman -Q | grep "utils"
binutils 2.32-2
bluez-utils 5.50-6
bridge-utils 1.6-3
ca-certificates-utils 20181109-1
cifs-utils 6.8-2
coreutils 8.31-1
desktop-file-utils 0.23+4+g92af410-1
diffutils 3.7-1
exfat-utils 1.3.0-1
findutils 4.6.0-4
inetutils 1.9.4-7
iputils 20180629.f6aac8d-4
jfsutils 1.1.15-6
keyutils 1.6-1
pciutils 3.6.2-1
pcmciautils 018-8
python-docutils 0.14-2
sg3_utils 1.44-1
sysfsutils 2.1.0-10
usbutils 010-1
v4l-utils 1.16.6-1
xdg-utils 1.1.3-3
xorg-font-utils 7.6-5
xorg-xkbutils 1.0.4-3

#~ pacman -Ql binutils | grep /bin/
binutils /usr/bin/
binutils /usr/bin/addr2line
binutils /usr/bin/ar
binutils /usr/bin/as
binutils /usr/bin/c++filt
binutils /usr/bin/dwp
binutils /usr/bin/elfedit
binutils /usr/bin/gprof
binutils /usr/bin/ld
binutils /usr/bin/ld.bfd
binutils /usr/bin/ld.gold
binutils /usr/bin/nm
binutils /usr/bin/objcopy
binutils /usr/bin/objdump
binutils /usr/bin/ranlib
binutils /usr/bin/readelf
binutils /usr/bin/size
binutils /usr/bin/strings
binutils /usr/bin/strip

On Fri, 5 Jul 2019 at 12:14, Patrick Wigmore  wrote:

> On Thu, 04 Jul 2019 10:37:35 +0100, Bob Dunlop wrote:
> > nvi
> >textdata bss dec hex filename
> >   270612048 256   2936572b5 /usr/bin/nvi
> >  442019   18688 144  460851   70833 /usr/lib64/libvi.so.0
> >  430302   176282552  450482   6dfb2 /lib64/libncursesw.so.6
>
> This type of output was not something I was familiar with. I can see
> that size(1) produces output in this format, given a list of object
> files, but what method did you use to produce the list of files,
> excluding common operating system libraries?
>
> More generally, this highlighted to me a gap in my knowledge about how
> to discover utilities that fill a particular need without first
> knowing their names. I had already forgotten the route I took to
> discovering size(1) within minutes of discovering it. It began with a
> web search for the column headings in the output and ended with some
> poking around on the local system.
>
> I discovered ldd(1) in a similarly poorly remembered fashion, but it's
> clearly not the whole solution.
>
> I was inspired to read man(1)'s manual page and to belatedly try out
> man -k and man -K. However, it is difficult to devise keywords that
> are specific enough to select the right manual pages and generic
> enough to appear in their short descriptions.
>
> For example, the short description of size(1) does not make any
> mention of object files:
>
> $ man -f size
> size (1) - list section sizes and total size.
>
> Even if it did mention object files, that would need to be the
> terminology that came to mind if I wanted to find size(1) using:
>
> $ apropos -a object size
>
> (It seems to me that man -k has no direct equivalent to the -a option
> of apropos.)
>
> So, I still feel in want of a good categorised summary of well-known
> commands, or at least a search technique that can expand my search to
> include conceptually-related terms.
>
> Patrick
>
> --
>   Next meeting: BEC, Bournemouth, Tuesday, 2019-08-06 20:00
>   Check to whom you are replying
>   Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk/
>   New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk
>
-- 
  Next meeting: BEC, Bournemouth, Tuesday, 2019-08-06 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk/
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Discovering unfamiliar utilities

2019-07-05 Thread Patrick Wigmore
On Fri, 05 Jul 2019 13:33:21 +0100, Ralph Corderoy wrote:
> For a one-off quick task, automating it would be more tedious.

But you did it anyway, even though you didn't need the results!
(Don't change, your code snippets are great.)

> I learnt by reading books.  Pre-Internet.  The authors back then
> typically put a lot of effort into providing a coherent progression
> through the subject.

That's exactly why I think books (and courses) are valuable. I don't 
see them as a thing of the past. Other resources can sometimes provide 
quick answers, or an overview of current thinking, but I tend to turn 
to books when I want a solid, baseline understanding of a well-
developed topic.

The main difficulty I have with books is discovering the right ones, 
and I suppose I was fishing for a book recommendation, so thank you 
for recommending 'The Unix Programming Environment'.

There seems to be a copy of it in the library at Bournemouth 
University.
https://capitadiscovery.co.uk/bournemouth-ac/items/91529

At some point I will head over there to have a read and see what's 
nearby on the shelves; that usually turns up something good. (If I can 
figure out how to navigate the ever-changing maze of new buildings on 
their campus.)

> This is a bug that you may like to report

Good point. I'll see about doing that later.


On Fri, 05 Jul 2019 14:05:30 +0100, Bob Dunlop wrote:
> The command was simply "ldd /usr/bin/nvi" which shows the list of
> object dependencies, then cut and paste library names I'm interested
> in into the size command.

That makes sense. I thought there might have been a magic one-liner 
that knew which ones to omit, but in hindsight I suppose you need 
quite a bit of context to decide which libraries are relevant, so it's 
not as plausible as I thought.


On Fri, 05 Jul 2019 14:44:22 +0100, John Carlyle-Clarke wrote:
> You reminded me that a few days ago I listed the files in a core
> package on a server (looking for a missing utility) and saw a few
> things in the list that I didn't immediately recognise. I thought
> at the time, "That would be a good way to learn about utilities
> that I don't know exist".

That's true. Package management is a good way to find things, and 
there is usually some kind of categorisation in place as well. 
Certainly a useful tool to keep at hand.

Patrick

-- 
  Next meeting: BEC, Bournemouth, Tuesday, 2019-08-06 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk/
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Discovering unfamiliar utilities

2019-07-05 Thread Bob Dunlop
On Fri, Jul 05 at 12:14, Patrick Wigmore wrote:
> On Thu, 04 Jul 2019 10:37:35 +0100, Bob Dunlop wrote:
> > nvi
> >textdata bss dec hex filename
> >   270612048 256   2936572b5 /usr/bin/nvi
> >  442019   18688 144  460851   70833 /usr/lib64/libvi.so.0
> >  430302   176282552  450482   6dfb2 /lib64/libncursesw.so.6
> 
> This type of output was not something I was familiar with. I can see 
> that size(1) produces output in this format, given a list of object 
> files, but what method did you use to produce the list of files, 
> excluding common operating system libraries?

The command was simply "ldd /usr/bin/nvi" which shows the list of
object dependencies, then cut and paste library names I'm interested
in into the size command.

As for how to locate an unknown command I don't know, in my case it's
too many years of experience.  Since you already know about apropos
and it's limitations I can only suggest DuckDuckGo is your friend.
Or https://unix.stackexchange.com/search is good for a lot of technical
questions.

-- 
Bob Dunlop

-- 
  Next meeting: BEC, Bournemouth, Tuesday, 2019-08-06 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk/
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] ed, vi et al

2019-07-05 Thread Bob Dunlop
Hi,

On Thu, Jul 04 at 03:15, Ralph Corderoy wrote:
> Hi Bob,
> 
> > On reason you had ed on early machines and Vi on later can be seen by
> > examining the code size of even modern builds.
> 
> Right, given the small amount of RAM on early machines, ed fitted where
> bigger programs couldn't.  IIRC vi or its predecessor caused performance

My wife has just reminded me of a couple more reasons for using ed rather
than vi.  Vi is in /usr/bin so not available until /usr is mounted.
Ed would run without a /tmp directory, vi won't.

Both are non-problems on modern systems.

-- 
Bob Dunlop

-- 
  Next meeting: BEC, Bournemouth, Tuesday, 2019-08-06 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk/
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Very slow Desktop startup problem

2019-07-05 Thread Victor Churchill
Thanks Ralph and Patrick.

> it [ |& ]  is shorthand for 2>&1 ...bash also adds ‘&>foo’ meaning ‘>foo
2>&1’.  Likewise ‘&>>’.

Well we live and learn. I'm going to add this to my catalogue of scenarios
where I have developed a muscle-memory for doing things an 'old' way, and
then a new and usually better better way has come along while I wasn't
looking.

Saying 'do_something_interesting 2>&1 > something_interesting.log' or
'do_something 2>&1 | grep -i whoopsie' have been in my mental toolbox so
long I can find them in the dark. So I never thought of looking for newer
shinier versions.

I must find my way back to Bournemouth sometime for one of the monthly
meetups.

best regards,
웃
Victor Churchill,
Netley Abbey, Southampton
07970 844083


On Fri, 5 Jul 2019 at 12:55, Ralph Corderoy  wrote:

> Hi Victor,
>
> Hope life's treating you well since you moved ‘abroad’.
>
> Patrick wrote:
> > > > (yada yada) |& curl -sSF 'f:1=<-' ix.io
> > >
> > > I was puzzled to see the '&' in your command above.
>
> Patrick's answered that ‘|&’ is a bash shorthand for ‘2>&1 |’.
>
> > > I'd have thought that saying
> > > (yada yada) | curl -sSF 'f:1=<-' ix.io
> > > would do the trick
>
> If the sub-shell in parenthesis produced any stderr for Clive, which
> would probably be interesting to us, then it would appear on his TTY and
> not be piped to curl so we see it.  Redirecting stderr to the same place
> as stdout, the pipe, avoids this.
>
> > In bash(1), |& is one operator, not two.
>
> bash also adds ‘&>foo’ meaning ‘>foo 2>&1’.  Likewise ‘&>>’.
>
> --
> Cheers, Ralph.
>
> --
>   Next meeting: BEC, Bournemouth, Tuesday, 2019-08-06 20:00
>   Check to whom you are replying
>   Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk/
>   New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk
>
-- 
  Next meeting: BEC, Bournemouth, Tuesday, 2019-08-06 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk/
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Very slow Desktop startup problem

2019-07-05 Thread Victor Churchill
Hi Ralph,
Neat trick with ix.io; I hadn't met that before. A pastebin for one-liners!
I was puzzled to see the '&' in your command above. I'd have thought that
saying
(yada yada) | curl -sSF 'f:1=<-' ix.io
would do the trick, and that adding the ampersand would, if anything, cause
it to break: "pipe this lot to nothing, and while you're about it run this
curl with no stdin". Obviously I'm mistaken, but I don't know why: can you
enlighten?

best regards,
웃
Victor Churchill,
Netley Abbey, Southampton
07970 844083


On Fri, 5 Jul 2019 at 08:44, Ralph Corderoy  wrote:

> Hi Clive,
>
> > Should the swap show a mount point and if so where?  (/?)
>
> No, a mount point is a directory where the filesystem's root directory
> appears, e.g. /home is a common one.  Whilst it's mounted, the contents
> of the original /home directory are inaccessible as accesses pass across
> to the mounted filesystem instead.
>
> > probably won't get the time to run other commands till weekend
>
> Well when you do, here's an updated version that tells us similar
> information to above, and more.
>
>  (
>  set -x
>  grep -w swap /etc/fstab
>  lsblk -o type,name,fstype,label,uuid,mountpoint,size,partuuid
>  sudo -i blkid
>  ls -l /dev/disk/*
>  ) |&
>  curl -sSF 'f:1=<-' ix.io
>
> --
> Cheers, Ralph.
>
> --
>   Next meeting: BEC, Bournemouth, Tuesday, 2019-08-06 20:00
>   Check to whom you are replying
>   Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk/
>   New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk
>
-- 
  Next meeting: BEC, Bournemouth, Tuesday, 2019-08-06 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk/
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


[Dorset] Discovering unfamiliar utilities

2019-07-05 Thread Patrick Wigmore
On Thu, 04 Jul 2019 10:37:35 +0100, Bob Dunlop wrote:
> nvi
>textdata bss dec hex filename
>   270612048 256   2936572b5 /usr/bin/nvi
>  442019   18688 144  460851   70833 /usr/lib64/libvi.so.0
>  430302   176282552  450482   6dfb2 /lib64/libncursesw.so.6

This type of output was not something I was familiar with. I can see 
that size(1) produces output in this format, given a list of object 
files, but what method did you use to produce the list of files, 
excluding common operating system libraries?

More generally, this highlighted to me a gap in my knowledge about how 
to discover utilities that fill a particular need without first 
knowing their names. I had already forgotten the route I took to 
discovering size(1) within minutes of discovering it. It began with a 
web search for the column headings in the output and ended with some 
poking around on the local system.

I discovered ldd(1) in a similarly poorly remembered fashion, but it's 
clearly not the whole solution.

I was inspired to read man(1)'s manual page and to belatedly try out
man -k and man -K. However, it is difficult to devise keywords that 
are specific enough to select the right manual pages and generic 
enough to appear in their short descriptions.

For example, the short description of size(1) does not make any 
mention of object files:

$ man -f size
size (1) - list section sizes and total size.

Even if it did mention object files, that would need to be the 
terminology that came to mind if I wanted to find size(1) using:

$ apropos -a object size

(It seems to me that man -k has no direct equivalent to the -a option 
of apropos.)

So, I still feel in want of a good categorised summary of well-known 
commands, or at least a search technique that can expand my search to 
include conceptually-related terms.

Patrick

-- 
  Next meeting: BEC, Bournemouth, Tuesday, 2019-08-06 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk/
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Very slow Desktop startup problem

2019-07-05 Thread Ralph Corderoy
Hi Victor,

> Saying 'do_something_interesting 2>&1 > something_interesting.log'

Or, the alternative action of ‘foo >bar 2>&1’.  :-)

-- 
Cheers, Ralph.

-- 
  Next meeting: BEC, Bournemouth, Tuesday, 2019-08-06 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk/
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Very slow Desktop startup problem

2019-07-05 Thread Ralph Corderoy
Hi Victor,

Hope life's treating you well since you moved ‘abroad’.

Patrick wrote:
> > > (yada yada) |& curl -sSF 'f:1=<-' ix.io
> >
> > I was puzzled to see the '&' in your command above.

Patrick's answered that ‘|&’ is a bash shorthand for ‘2>&1 |’.

> > I'd have thought that saying
> > (yada yada) | curl -sSF 'f:1=<-' ix.io
> > would do the trick

If the sub-shell in parenthesis produced any stderr for Clive, which
would probably be interesting to us, then it would appear on his TTY and
not be piped to curl so we see it.  Redirecting stderr to the same place
as stdout, the pipe, avoids this.

> In bash(1), |& is one operator, not two.

bash also adds ‘&>foo’ meaning ‘>foo 2>&1’.  Likewise ‘&>>’.

-- 
Cheers, Ralph.

-- 
  Next meeting: BEC, Bournemouth, Tuesday, 2019-08-06 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk/
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk


Re: [Dorset] Discovering unfamiliar utilities

2019-07-05 Thread Patrick Wigmore
On Fri, 05 Jul 2019 12:14:03 +0100, Patrick Wigmore wrote:
> the short description of size(1) does not make any mention of object
> files:
>
> $ man -f size
> size (1) - list section sizes and total size.

On Fri, 05 Jul 2019 13:33:21 +0100, Ralph Corderoy wrote:
> This is a bug that you may like to report

The latest version 2.32 contains the same description, so I reported 
Bug 24777 against binutils.
https://sourceware.org/bugzilla/show_bug.cgi?id=24777

-- 
  Next meeting: BEC, Bournemouth, Tuesday, 2019-08-06 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk/
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk