Wednesday, 4 September 2019

uniq: the -f, --skip-fields=N option and --group=both // removing chunks of samey same stuff from logfiles

Awkward log parsing question.
How to remove big chunks in log with similar/same content
  . . . but leave first few and last few lines,
  . . show information on the chunk removed.

Another question, can we do grep -v but when we match and do not show the lines can we show something like "1094 lines not shown" ?

 e.g. grep -Ev "annoying message|other annoying message|other frequent annoying messages"

Similar question here . . .

https://unix.stackexchange.com/questions/244650/remove-partial-duplicates-consecutive-lines-but-keep-first-and-last/538960#538960

uniq is (sort of) the perfect tool for this, by default in uniq you can keep/show the first but not last line in set.
uniq has a -f flag which allows you to skip the first few fields.
From man uniq:
   -f, --skip-fields=N
          avoid comparing the first N fields

   -s, --skip-chars=N
          avoid comparing the first N characters

   A field is a run of blanks (usually spaces and/or TABs), then non-blank characters.  Fields are skipped before chars.
Example with uniq -c to show count see what uniq is doing:
-bash-4.2$ uniq -c -f 1 original_file
  1 1447790360      99999   99999   20.25   20.25   20.25   20.50
  9 1447790362      20.25   20.25   20.25   20.25   20.25   20.50
  1 1447790388      20.25   20.25   99999   99999   99999   99999
  1 1447790389      99999   99999   20.25   20.25   20.25   20.50
  1 1447790391      20.00   20.25   20.25   20.25   20.25   20.50
  3 1447790394      20.25   20.25   20.25   20.25   20.25   20.50
Not bad. Pretty close to what is wanted. And easy to do. But missing the last matching line in group . . . .
The grouping options in uniq are also interesting for this question . . .
   --group[=METHOD]
          show all items, separating groups with an empty line METHOD={separate(default),prepend,append,both}

   -D, --all-repeated[=METHOD]
          print all duplicate lines groups can be delimited with an empty line METHOD={none(default),prepend,separate}
Example, uniq by group . . .
    -bash-4.2$ uniq --group=both -f 1 original_file 

1447790360      99999   99999   20.25   20.25   20.25   20.50

1447790362      20.25   20.25   20.25   20.25   20.25   20.50
1447790365      20.25   20.25   20.25   20.25   20.25   20.50
1447790368      20.25   20.25   20.25   20.25   20.25   20.50
1447790371      20.25   20.25   20.25   20.25   20.25   20.50
1447790374      20.25   20.25   20.25   20.25   20.25   20.50
1447790377      20.25   20.25   20.25   20.25   20.25   20.50
1447790380      20.25   20.25   20.25   20.25   20.25   20.50
1447790383      20.25   20.25   20.25   20.25   20.25   20.50
1447790386      20.25   20.25   20.25   20.25   20.25   20.50

1447790388      20.25   20.25   99999   99999   99999   99999

1447790389      99999   99999   20.25   20.25   20.25   20.50

1447790391      20.00   20.25   20.25   20.25   20.25   20.50

1447790394      20.25   20.25   20.25   20.25   20.25   20.50
1447790397      20.25   20.25   20.25   20.25   20.25   20.50
1447790400      20.25   20.25   20.25   20.25   20.25   20.50
Then grep for line before and after every empty line and strip blank lines:
-bash-4.2$ uniq --group=both -f 1 original_file |grep -B1 -A1 ^$ |grep -Ev "^$|^--$"
1447790360      99999   99999   20.25   20.25   20.25   20.50
1447790362      20.25   20.25   20.25   20.25   20.25   20.50
1447790386      20.25   20.25   20.25   20.25   20.25   20.50
1447790388      20.25   20.25   99999   99999   99999   99999
1447790389      99999   99999   20.25   20.25   20.25   20.50
1447790391      20.00   20.25   20.25   20.25   20.25   20.50
1447790394      20.25   20.25   20.25   20.25   20.25   20.50
1447790400      20.25   20.25   20.25   20.25   20.25   20.50
Tah dahhh! Pretty good.

Monday, 2 September 2019

Sharing the roads and cycle paths . . and informal/accidental/commuting "drafting" on bike



https://bicycles.stackexchange.com/questions/63882/how-to-deal-with-anxiety-caused-by-dangerous-riding-conditions-stemming-from-poo

When we cycle and drive (and walk) we SHARE the roads and paths with others. Learning defensive riding techniques is good for all road users. Assume anyone else on the road can do silly or unexpected things! :) Learn to observe and anticipate and change how you are riding if path is busy or narrow or you cannot see. It is like a game where if you are good you can predict all the things that happen. Ding a bell whenever you are near bend or corner you cannot see around. Defensive riding gives you control and makes the ride less stressful. Change route where possible to avoid problem sections.


https://bicycles.stackexchange.com/questions/5955/is-it-considered-rude-to-draft-other-random-cyclists/42316#42316

https://bicycles.stackexchange.com/questions/32753/it-it-impolite-to-informally-join-or-draft-a-group-of-cyclists/32758#32758

It's over politically-correct to say "you cannot do it" or "you have to ask permission".

When commuting I find that "drafting" sort of happens naturally or by accident.

This type of "drafting" is very different from racing drafting. You cannot be safe and draft at speed right on the wheel of someone you don't know! It is more like companionable cycling, there has to be alot of awareness (preferably by both riders) and you have to anticipate and give a lot of space.

Asking for permission doesn't make sense . . .

I find that it's not really that possible to chat / ask permission as "drafting" will start by accident when a rider slightly faster than another overtakes and the overtaken person can then keep up and draft. Mostly there is a difference in ability and the overtaken is not able to speed up and take turn in front. You are sort of stuck as due to benefit of draft you can keep up, this is your natural pace and even if you drop your natural pace off you might well be together again at next set of traffic lights.

If I catch up with someone and realise we are going the same speed more or less then that's a tricky one. I can stay behind. Or I could try to overtake but I think this might be a bit rude if the speed difference is not big and you are probably going to not be able to pull away clear of them.

There's a long steady uphill section on my commute home mostly with mixed on-road and shared foot/cycle path. I often find I'm riding at the same pace as other cyclists so drafting happens somewhat naturally. I don't find that taking turns happens at all much. Especially, of late, when the cyclist in front is on an ebike! :-)

I don't think it makes sense to ask for permission in this situation as all that is happening already is you are travelling at the same space. If permission is granted or denied then what are you going to do? You might be accidentally together for a while anyway!

Is it rude ?

I don't think it is rude ...

if done in a careful way

and as pointed out - it is not rude if you communicate!

Communication is good . . . leave the other cyclist know you are there.

Yes, a bit of communication would ensure it is not rude.

I do try communicate alot on the road. (using traffic signals and voice)

I think I'm a bit shy communicating with other cyclists if moving at a good pace. I would be more concentrating on riding. You might exchange a word if you stop at traffic lights.

In commuting you don't say hello to everyone who passes(maybe that would be nice! :)). Also, by the time someone has overtaken and you realise you are comfortable in draft your moment to say hello is sort of passed.

Hmm. I could try out something like, "oh, I seem to be behind you now, er, hope that's ok. I'll be careful." Hmm, well actually, thinking about it, I'm not too bad really, in front or behind I call out hazards, intentions and signals I'm making. Hopefully not too disconcerting for the other cyclists.

Most cyclists do not mind?

I said before something like "Depending on relative speed and road situation common sense prevails.". However I think I was wrong. As pointed out elsewhere people think differently. My common sense might not be the same as yours. SOLUTION: Communicate!

Sometimes someone would overtake me or I would catch up behind but think it doesn't make sense to overtake here . . and I end up cycling behind someone. And it is a bit unclear if they are aware of me or not.

A bit awkward but I guess safer and less rude if communication happens.

I like to drive/cycle defensively and find I generally have good awareness of riders or any traffic ahead and behind of me . . so I think that makes me more comfortable with someone tagging along sometimes.

On SAFETY:

This "drafting" is not like racing bike drafting.

I find riding as a pair like this is better for safety against car traffic.

If in behind someone assume they are not as aware or might be less experienced. So you have to be vigilant to hazards ahead (and behind) and anticipate for both of you!

If ahead of someone (OR even if you think you are alone!) similar applies. Always communicate and signal to that imaginary rider/car/other behind that may or may not be there.

Defensive riding techniques apply as always.

you have to be HYPER-aware of what is coming up in front as well as road situation all around/behind

you cannot draft right on wheel expecting signals as in road racing. It is an informal arrangement! (there is still good drafting benefit and more safety a bit back and off to the side)

When drafting like this I try to be of safety BENEFIT to the cyclist in front.

You can back off frequently and give space as the cyclist in front encounters hazards, make it clear you are not going for overtake and making space for them to do so.

move to the side to look in front and behind, (be careful to try and not block the view of the front rider if they look behind)

signal to front and behind and look after both yourself and others.

voice call out hazards, intentions and signals you are making

safety check and signal and claim the road lane early if it looks like you have to move out to avoid hazard/overtake/...

I generally have flashing lights on and I have a bell too :-)

"ding" means "I am here"

"blink blink blink" means "I am coming/here/going"

Bells . .

I don't know is this just Dublin, Ireland, but many cyclists don't have(illegal here) or use bells. I find the tinkle of a bell + voice from well back mostly gives good enough warning to pedestrians/dog walkers/other hazards(:-)). Warning enough that multiple cyclists can pass in a friendly way as opposed to all coming to a grumpy slow halt or blazing past close by in a dangerous manner.


Saturday, 24 August 2019

Sat diary, cut lawn, laundry, recycling, . . .


Maeve heading out with friends
Daire in heading golfing later
No sign yet of Kate

Breakfast

No Saturday paper?

Cut very long grass(first day it has been dry for ages)
Hang clothes
Put on white wash
Empty dishwasher

Green bin was not collected :-( Panda :-( second fortnight in row not collected so emptied it, separated waste. Paper paper card paper paper card tins tetra plastic(next to paper in bulk), there was a puddle at the bottom.


Exercises, neck, shoulder, weights, push ips, stretches, . . Todo: plank! Yoga.

Catching up on family/scout messages. Counting scouts moving to vents/going to eurojam/registering.

Todo:
Lunch. Spuds
Test systems in work, several failed :-P
Recycling visit

Count scouts, scout money, send messages, new leaders training, . .  Scout county prep, . .

Bike chain?

Fix boots?

Orienteering or mountain bike or . . .





Friday, 23 August 2019

grepping for non-ascii chars . . grep from 0x80->0xFF doesn't find > 2 byte encoded chars unless set locale e.g. with LC_ALL=C


A cow-orker asked this old chestnut again.

Actually that problem ended up being a CR in between {} in a big .json file, not funny characters.

But along the way we found something confusing and learned that grep for chars from 0x80 to 0xff does show extended chars encoded in 2 bytes BUT weirdly NON intuitively it doesn't seem to match with extended chars encoded in 3 and 4 bytes.

 * © copyright c2a9 or   underscore c2a0 chars would match

 * 💘 Heart With Arrow Emoji - Emojipedia == UTF8? f09f9298  did not match

 * あ a in japanese hiragana  e38182 did not match

If you give the magical pre-invocation LC_ALL=C to the grep . . then it DOES match 2/3/4 byte extended characters.


This ANSWER updated goes into full explanation:


https://stackoverflow.com/questions/3001177/how-do-i-grep-for-all-non-ascii-characters/46343900#46343900

I agree with Harvey above buried in the comments, it is often more useful to search for non-printable characters OR it is easy to think non-ASCII when you really should be thinking non-printable. Harvey suggests "use this: "[^\n -~]". Add \r for DOS text files. That translates to "[^\x0A\x020-\x07E]" and add \x0D for CR"

Also, adding -c (show count of patterns matched) to grep is useful when searching for non-printable chars as the strings matched can mess up terminal.

I found adding range 0-8 and 0x0e-0x1f (to the 0x80-0xff range) is a useful pattern. This excludes the TAB, CR and LF and one or two more uncommon printable chars. So IMHO a quite a useful (albeit crude) grep pattern is THIS one:

grep -c -P -n "[\x00-\x08\x0E-\x1F\x80-\xFF]" *

ACTUALLY, generally you will need to do this:

LC_ALL=C grep -c -P -n "[\x00-\x08\x0E-\x1F\x80-\xFF]" *

breakdown:

LC_ALL=C - set locale to C, otherwise many extended chars will not match (even though they look like they are encoded > 0x80)
\x00-\x08 - non-printable control chars 0 - 7 decimal
\x0E-\x1F - more non-printable control chars 14 - 31 decimal
\x80-1xFF - non-printable chars > 128 decimal
-c - print count of matching lines instead of lines
-P - perl style regexps 
Instead of -c you may prefer to use -n (and optionally -b) or -l
-n, --line-number
-b, --byte-offset
-l, --files-with-matches

E.g. practical example of use find to grep all files under current directory:

LC_ALL=C find . -type f -exec grep -c -P -n "[\x00-\x08\x0E-\x1F\x80-\xFF]" {} +

You may wish to adjust the grep at times. e.g. BS(0x08 - backspace) char used in some printable files or to exclude VT(0x0B - vertical tab). The BEL(0x07) and ESC(0x1B) chars can also be deemed printable in some cases.

Non-Printable ASCII Chars
** marks PRINTABLE but CONTROL chars that is useful to exclude sometimes

Dec   Hex Ctrl Char description           Dec Hex Ctrl Char description
0     00  ^@  NULL                        16  10  ^P  DATA LINK ESCAPE (DLE)
1     01  ^A  START OF HEADING (SOH)      17  11  ^Q  DEVICE CONTROL 1 (DC1)
2     02  ^B  START OF TEXT (STX)         18  12  ^R  DEVICE CONTROL 2 (DC2)
3     03  ^C  END OF TEXT (ETX)           19  13  ^S  DEVICE CONTROL 3 (DC3)
4     04  ^D  END OF TRANSMISSION (EOT)   20  14  ^T  DEVICE CONTROL 4 (DC4)
5     05  ^E  END OF QUERY (ENQ)          21  15  ^U  NEGATIVE ACKNOWLEDGEMENT (NAK)
6     06  ^F  ACKNOWLEDGE (ACK)           22  16  ^V  SYNCHRONIZE (SYN)
7     07  ^G  BEEP (BEL)                  23  17  ^W  END OF TRANSMISSION BLOCK (ETB)
8     08  ^H  BACKSPACE (BS)**            24  18  ^X  CANCEL (CAN)
9     09  ^I  HORIZONTAL TAB (HT)**       25  19  ^Y  END OF MEDIUM (EM)
10    0A  ^J  LINE FEED (LF)**            26  1A  ^Z  SUBSTITUTE (SUB)
11    0B  ^K  VERTICAL TAB (VT)**         27  1B  ^[  ESCAPE (ESC)
12    0C  ^L  FF (FORM FEED)**            28  1C  ^\  FILE SEPARATOR (FS) RIGHT ARROW
13    0D  ^M  CR (CARRIAGE RETURN)**      29  1D  ^]  GROUP SEPARATOR (GS) LEFT ARROW
14    0E  ^N  SO (SHIFT OUT)              30  1E  ^^  RECORD SEPARATOR (RS) UP ARROW
15    0F  ^O  SI (SHIFT IN)               31  1F  ^_  UNIT SEPARATOR (US) DOWN ARROW


UPDATE: I had to revisit this recently. And, YYMV depending on terminal settings/solar weather forecast BUT . . I noticed that grep was not finding many unicode or extended characters. Even though intuitively they should match the range 0x80 to 0xff, 3 and 4 byte unicode characters were not matched. ??? Can anyone explain this? YES. @frabjous asked and @calandoa explained that LC_ALL=C should be used to set locale for the command to make grep match.

e.g. my locale LC_ALL= empty

$ locale
LANG=en_IE.UTF-8
LC_CTYPE="en_IE.UTF-8"
.
.
LC_ALL=
grep with LC_ALL= empty matches 2 byte encoded chars but not 3 and 4 byte encoded:

$ grep -P -n "[\x00-\x08\x0E-\x1F\x80-\xFF]" notes_unicode_emoji_test
5:© copyright c2a9
7:call  underscore c2a0
9:CTRL
31:5 © copyright
32:7 call  underscore
grep with LC_ALL=C does seem to match all extended characters that you would want:

$ LC_ALL=C grep --color='auto' -P -n "[\x80-\xFF]" notes_unicode_emoji_test
1:���� unicode dashes e28090
3:��� Heart With Arrow Emoji - Emojipedia == UTF8? f09f9298
5:� copyright c2a9
7:call� underscore c2a0
11:LIVE��E! ���������� ���� ���������� ���� �� �� ���� ����  YEOW, mix of japanese and chars from other e38182 e38184 . . e0a487
29:1 ���� unicode dashes
30:3 ��� Heart With Arrow Emoji - Emojipedia == UTF8 e28090
31:5 � copyright
32:7 call� underscore
33:11 LIVE��E! ���������� ���� ���������� ���� �� �� ���� ����  YEOW, mix of japanese and chars from other
34:52 LIVE��E! ���������� ���� ���������� ���� �� �� ���� ����  YEOW, mix of japanese and chars from other
81:LIVE��E! ���������� ���� ���������� ���� �� �� ���� ����  YEOW, mix of japanese and chars from other
THIS perl match (partially found elsewhere on stackoverflow) OR the inverse grep on the top answer DO seem to find ALL the ~weird~ and ~wonderful~ "non-ascii" characters without setting locale:

$ grep --color='auto' -P -n "[^\x00-\x7F]" notes_unicode_emoji_test
$ perl -ne 'print "$. $_" if m/[\x00-\x08\x0E-\x1F\x80-\xFF]/' notes_unicode_emoji_test
1 ‐‐ unicode dashes e28090
3 💘 Heart With Arrow Emoji - Emojipedia == UTF8? f09f9298
5 © copyright c2a9
7 call  underscore c2a0
9 CTRL-H CHARS URK URK URK
11 LIVE‐E! あいうえお かが アイウエオ カガ ᚊ ᚋ ซฌ आइ  YEOW, mix of japanese and chars from other e38182 e38184 . . e0a487
29 1 ‐‐ unicode dashes
30 3 💘 Heart With Arrow Emoji - Emojipedia == UTF8 e28090
31 5 © copyright
32 7 call  underscore
33 11 LIVE‐E! あいうえお かが アイウエオ カガ ᚊ ᚋ ซฌ आइ  YEOW, mix of japanese and chars from other
34 52 LIVE‐E! あいうえお かが アイウエオ カガ ᚊ ᚋ ซฌ आइ  YEOW, mix of japanese and chars from other
73 LIVE‐E! あいうえお かが アイウエオ カガ ᚊ ᚋ ซฌ आइ  YEOW, mix of japanese and chars from other
SO the preferred non-ascii char finders:

$ perl -ne 'print "$. $_" if m/[\x00-\x08\x0E-\x1F\x80-\xFF]/' notes_unicode_emoji_test

as in top answer, the inverse grep:

$ grep --color='auto' -P -n "[^\x00-\x7F]" notes_unicode_emoji_test

as in top answer but WITH LC_ALL=C:

$ LC_ALL=C grep --color='auto' -P -n "[\x80-\xFF]" notes_unicode_emoji_test

Wednesday, 14 August 2019

Shimano brake pads required adjusting with file !? and How to change hydraulic disc brake pads on bike

Shimano brake pads required adjusting with file !?
OOPS. Sorry Shimano. I put the pad sprint on the outside!
Lesson learnt: DIAGRAMS are good, even if you know have done the same procedure a few times before and think you know what you are doing!

My regular commuting bike rear brake felt a bit rough so brake pads probably worn. Need replacing.

I quite like replacing disc brake pads, it has sometimes been easy.

However the simple step of fitting the brake pads into the little brake pad holder did not work. The hole in the holder and pads could not line up. The hole for the pin in the pads was too far down OR the poinky bit of the pad too long. I guess tolerance in the brake pad manufacturing factory was exceeded.  SOLUTION: file down the top of the poinky bit of the brake pads until they fit in the holder.

I haven't had to do that before.

OOPS. DOH! Ehhhmm. The little pad spacer spring goes INSIDE the two brake pads!
Somewhat surprisingly the brake pads work fine with the spring on the outside.
Probably would wear weirdly though.


See also:
https://si.shimano.com/pdfs/dm/DM-BR0005-12-ENG.pdf


 A quick search online, . . I don't see other people with same problem.


Old school bike site . . is a little bit dated about disc brakes (cable levers, not hydraulic) and doesn't go into detail: https://www.sheldonbrown.com/disc-brakes.html


Good disc brake pad replacement instructions:

https://www.parktool.com/blog/repair-help/disc-brake-pad-removal-installation

https://www.bikeradar.com/advice/workshop/how-to-change-the-disc-brake-pads-on-your-bike/

https://www.merlincycles.com/blog/buyers-guide-to-disc-brake-pads/


My comprehensive general disc brake pad replacement instructions:

https://bicycles.stackexchange.com/questions/249/how-do-i-change-my-disc-brake-pads/63644#63644

The exact procedure varies a bit depending on the model of brake caliper/pads. Most disc brakes are now hydraulic. I have found that I have never had to so far let fluid out of or top up fluid in the hydraulic brakes! The procedure usually goes a bit like this:

TOOLS/INGREDIENTS:
latex gloves, cloth, old toothbrush, white spirits,
tyre remover tool, screwdriver, pliers(preferably needle nosed),
allen key/wrench as appropriate depending on wheel removal/caliper

0. Always allow a bit of time for complications. ESPECIALLY if you have not done that particular bike/part before.

1. Collect tools/parts. Gloves on. Remove wheel (OR some calipers you remove one bolt and the caliper rotates away from the rotor like a motorbike brake).

2. Clean brake caliper outside. Using toothbrush + white spirits + cloth. WARNING:  do not get dirty/oily fluid on rotor or braking surfaces!

3. OPTIONALLY: Use screwdriver to push brake pads apart as far as you can to each side (to push pistons back)

4. Pop out pin or whatever holds the brake pads in place.
   Remove pads from caliper.
   Inspect pads.
 
5. Clean inside of caliper.

6. Use plastic tool to push pistons back on each side.

7. Put new pads together with the pad spring in between them. Slide them into caliper. Push in pin or whatever holds them in place and lock.

8. Put wheel back on, gently . . make sure rotor goes in between the brake pads in the caliper.

9. Pull the brake a few times. The first few times it will be soft and go all the way but it should stiffen up as the piston is pushed out and starts pushing the pads against the rotor.

10. At this stage you are almost done, the rotor could have got something dripped or splashed on it so clean the rotor with a completely fresh cloth/kitchen towell. If the rotor has any contamination on it brakes might be noisy and not as effective as they should be.

11. Test cycle. Hopefully job is done brake working fine. If not . . then . . CONTINGENCY/debugging TIME . .

12. Tidy up.

12. Careful first few cycles out just in case . . .

Usually with disc brakes it is easy enough.
I think they are easier to change than rim brake pads.
But . . sometimes things get a bit tricky.
Extra notes in case of complications:

1. Yes, you do need to remove the wheel. This gives access to put in and out pads and to push the pistons back. Some types of pads could be replaced without removing the wheel, but only if you can also clean and get pistons back.

2. Yes, gloves and cleaning are good to use/do. Cleaning helps keeps you and tools/bike clean and in long term helps prevent parts getting seized and wearing.

3. Before removing the pads you can use them to push the pistons back. Insert a screwdriver or different tool between the brake pads and push them to the side. This ensures the piston is not damaged by directly pushing with screwdriver.

I did once encounter a piston which was stuck:
https://bicycles.stackexchange.com/questions/57661/hayes-sole-disk-brakes-adjusters-stiff-seized

In this case, remove the brake pads. Clean inside and outside with white spirits. Avoid getting dirty fluid on brake rotor or other braking surfaces. Do not clean/lubricate with oil or WD40 as it could damage any rubber/plastic parts of pistons. dot4 brake fluid could be used to lubricate (check is your hydraulic fluid mineral oil or dot4). After a while (in bad cases leave overnight for cleaning to soak in) gently (with plastic tool) but firmly push piston back.

I guess if that doesn't work then there might be air or excess of fluid in hydraulic system and some needs to be drained BUT I would really try and avoid draining any fluid!

4. For shimano there is a sort of cotter-pin. Bend or unbend the end to secure in place. For other pads there are different pins and small bolts or the caliper needs to be disconnected partly and angled away from rotor.

4. Inspect pads, I find usually pads go just a little bit too far worn in one place! When brake feels rougher or noisy I know I need to replace or inspect properly. Inspecting pads . . it is very hard to see how much pad is left without removing them. My shimano pads come off and the part closer to inside of the wheel is more worn, usually one end of a pad is almost completely down to the metal behind pad.

6. plastic tool = tyre remover or perhaps your old toothbrush :)

7. This step caused me trouble this morning! Shimano brake pads did not fit into the supplied pad holder they came with! They sort of fitted but hole for pin did not line up. I actually had to file the tops of the pads down to get them to fit into holder.  Fun and interesting!? And educational.  YES, and AFTER doing all this I find the clue is in the name "pad spacer" or "pad spring" should go in between the disc pads gently pushing them apart.  However you can put them on the outside and . . it doesn't really seem to matter. :-o

12. First few cycles out, just watching out for anything funny. "bedding-in" brake pads? I dunno. Usually they just work immediately.

A different thing, more of a problem with rim brakes, in case where your old brakes were quite bad and now you have good brakes be careful as you might grab and squeeze brakes suddenly and actually stop!! Do a bit of MTB training and learn to feather brakes.