Tuesday, January 31, 2017

passwordless ssh

* passwordless ssh

** make a key

** copy it to every machine you can log in to
as you
ssh-copy-id jla@furnace

or as root
ssh-copy-id root@manftest59

Emacs code folding

* Emacs code folding


M-1 C-x $ and magic happens!

As usual, it’s white magic: C-x $ will bring your code back.

* hg merge not graphical avoid meld >>>>>>> <<<<< =====

* hg merge not graphical avoid meld >>>>>>> <<<<< =====
HGMERGE=merge hg rebase --keep --source ptm-eftest-source --dest origin/master

hg bisect

* hg bisect

** basic commands
hg bisect --reset
hg bisect --bad
hg bisect --good

** help is surprisingly readable
hg bisect --help
hg bisect --help --verbose

** automatic usage
hg bisect --reset
hg bisect --bad 34
hg bisect --good 12
hg bisect --command "make && make tests"

hg clean

there's no equivalent to git clean, but

hg status -iu                          # to show
hg status -iun0 | xargs -r0 rm         # to destroy

removes all the ignored (i) and unversioned (u) files that may be lying around (including emacs backup files etc, may be better to do make clean)

and then

hg update -C -r xxxxx

restores the state of the parent (note just -C puts you to tip rather than to where you are)

Mercurial hg diff patch wiggle

remember diff is from 30652 to 30659 to make a patch that will turn 30652 into 30659

hg diff -r 30652 -r 30659 >~/patch
patch  -p1 <~/patch

if the patch fails to apply, the bits can be wiggled in like:

wiggle --replace mc/main/ncsi.c mc/main/ncsi.c.rej
wiggle --replace mc/main/pdma.c mc/main/pdma.c.rej


wiggle -rp ~/patch

should do the whole thing, but it can't create files.