Reading Manpages On The Train |
May 12th, 2011 |
tech |
Stuck on the red line from 6:45 to 7:39. Every few minutes we were
told we would be moving 'momentarily'. Forgot my book. Reading
manpages. So far I've learned:
- ssh supports visual host keys
- When you ssh into somewhere you've sshed into before from this computer, checking that the host key has not changed is easy and automatic. When logging in from a different computer, though, the 'right' thing to do is to check the host fingerprint manually. This is impractical. The idea of a visual host key is that if you trust the computer you're on but not the connection it will display a pictoral representation of the fingerprint. This should be relatively easy to compare with a memorized one from past logins.
- It also supports putting fingerprints in the dns, though I've never heard of anyone doing that. Perhaps before DNSSEC (which is only just starting to be available) it wasn't so useful because someone that could man in the middle your ssh could just as easily man in the middle your dns?
- bash will generate sequences with '{N..M}' so '{1..5}' means '1 2 3 4 5'
- If you have A=1 B=A and want to do ${${B}} to mean ${A} to mean 1, you can't do it. Bash refuses to double expand. Instead you have to do ${!B} which is called indirect expansion. If you also have C=B I don't see a way to do ${!!C} and have a doubly indirect variable reference. I don't see why the didn't go for what I would find intuitive and do ${${B}} or ${${${C}}} along the model of $($(echo 'echo foo')) which does what I would expect it to (expands twice, finally echoing 'foo').
- I knew bash supported '<(...)' as in "diff <(commandA) <(commandB)" to compare the output of two commands without an intermediate file, but I didn't know it supported '>(...)' to do process substitution for writing, as in "log_results --outfile >(grep foo)".
Comment via: facebook