shikanoko nokonoko on Nostr: Emacs trick of the day: M-x flush-lines M-x flush-lines prompts for a regex and ...
Emacs trick of the day: M-x flush-lines
M-x flush-lines prompts for a regex and removes all lines from the buffer matching the given regex.
Just now I rebuilt a hetzner VPS which of course means I get the infamous
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
message when I try SSHing back in.
To remove the needed lines from ~/.ssh/known_hosts I simply run M-x flush-lines in the buffer and they're all gone.
Pretty neat :)
Published at
2023-10-21 02:14:58Event JSON
{
"id": "679e9df07d1d4328a5183f0f258d47fb536e7f40e41a4432b1eb2d2dfabc6a1a",
"pubkey": "32b0082450d2269ff042a9caa54d5137459e6ef0ef2c07a9858d5b65348d7779",
"created_at": 1697854498,
"kind": 1,
"tags": [
[
"proxy",
"https://emacs.ch/users/olav/statuses/111270592423624842",
"activitypub"
]
],
"content": "Emacs trick of the day: M-x flush-lines\n\nM-x flush-lines prompts for a regex and removes all lines from the buffer matching the given regex.\n\nJust now I rebuilt a hetzner VPS which of course means I get the infamous \n\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\nmessage when I try SSHing back in.\n\nTo remove the needed lines from ~/.ssh/known_hosts I simply run M-x flush-lines in the buffer and they're all gone.\n\nPretty neat :)",
"sig": "64d5b83c40e0fa056a446bbfdd21df64466423fe545a79466b715282ec981e35b776229502bd5a3e77c017644c5200100248301552652717dedec87cb43cd9ba"
}