Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The most important contrib/ addition, ever. #2985

Merged
merged 1 commit into from Aug 26, 2019

Conversation

@rustyrussell
Copy link
Contributor

commented Aug 22, 2019

No description provided.

@ZmnSCPxj
Copy link
Collaborator

left a comment

Strong NACK. This should be in plugins/, of the same importance as pay and autoclean plugins.

@practicalswift
Copy link
Collaborator

left a comment

ACK aa31634 modulo a few nits

 _____________________________________
/ Thanks for tackling this important  \
\ issue! You are a great human being. /
 -------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
contrib/plugins/cowsay.sh Outdated Show resolved Hide resolved
contrib/plugins/cowsay.sh Outdated Show resolved Hide resolved
contrib/plugins/cowsay.sh Outdated Show resolved Hide resolved
contrib/plugins/cowsay.sh Outdated Show resolved Hide resolved
contrib/plugins/cowsay.sh Outdated Show resolved Hide resolved
@Saibato

This comment has been minimized.

Copy link
Contributor

commented Aug 22, 2019

tNACK aa31634
even rm -rf /. worked, oh man I should have red the manual twice 😄

EDIT:
I heard in an other twitter that some take even sarcasm for real.

So here is the DISCLAIMER: Don't test this after poke around with cows and don't mess with things you don't fully grasp ( like I do always ) , this can be otherwise your most #RECKLESS mainnet moment.

EDIT2:
tACK dd79f56
This is now in the true spirit of ZKS and it's followup BS and on that hill the cow will have always enough grass to serve there real masters.
Though in some jurisdiction even the crafting off such cow power is illegal. Can someone please ping back to print a t-shirt ?

For more KYC/AML I strongly urge to let the cow say on fallback something with nc -e and/or ssh.

FYI: I managed to get the cow to be fed with ERC20 weed, so lions accept her as there own, what makes her very special and safe in this universe.

params=$(echo "$JSON" | sed 's/.*"params" *: *//' | tr -d '[{}]"')
echo '{"jsonrpc":"2.0","id":'$id',"result":{"format-hint":"simple","cowsay":"'
# FIXME: lightning-cli does not unescape \\, so we replace with an L.
printf "$params" | cowsay | sed 's/\\/L/g' | sed ':a;N;$!ba;s/\n/\\n/g' | tr '\012' '"'

This comment has been minimized.

Copy link
@jb55

jb55 Aug 22, 2019

Collaborator

This depends on an external application which increases burden when packaging and distributing the plugins. I say we write a cowsay implementation in bash for maximum portability.

This comment has been minimized.

Copy link
@rustyrussell

rustyrussell Aug 23, 2019

Author Contributor
 _________________________________________
/ Chose to add an emergency backup cow,   \
| because while we're only using a        |
| fraction of cowsay(1) powers now,       |
\ future generations may add more options /
 -----------------------------------------
        \   ^__^
         \  (**)\_______
            (__)\       )\/\
             U  ||----w |
                ||     ||

# Eg. {"jsonrpc":"2.0","id":2,"method":"getmanifest","params":{}}\n\n
read -r JSON
read _

This comment has been minimized.

Copy link
@practicalswift

practicalswift Aug 23, 2019

Collaborator

Nit: read -r _ to avoid mangling backslashes. Applies to all read _ :-)

This comment has been minimized.

Copy link
@rustyrussell

rustyrussell Aug 25, 2019

Author Contributor

Since we're not using _ and it's assumed to be a blank line, this seems like the shortest code wins?

This comment has been minimized.

Copy link
@rustyrussell

rustyrussell Aug 26, 2019

Author Contributor

.... but make check-source complains, so I changed it anyway! Thanks!

params=$(echo "$JSON" | sed 's/.*"params" *: *//' | tr -d '[{}]"')
echo '{"jsonrpc":"2.0","id":'"$id"',"result":{"format-hint":"simple","cowsay":"'
# FIXME: lightning-cli does not unescape \\, so we replace with an L.
echo -n "$params" | maybe_cowsay | sed 's/\\/L/g' | sed ':a;N;$!ba;s/\n/\\n/g' | tr '\012' '"'

This comment has been minimized.

Copy link
@practicalswift

practicalswift Aug 23, 2019

Collaborator

Nit: echo -n is not portable -- consider using printf "%s" "$params".

This comment has been minimized.

Copy link
@rustyrussell

rustyrussell Aug 25, 2019

Author Contributor

Agreed; I tested it with dash, but not FreeBSD. Will fix.

@practicalswift

This comment has been minimized.

Copy link
Collaborator

commented Aug 23, 2019

 __________________________________
/ ACK d3d859a2 modulo nits. Thanks \
\ hooman. Sincerely yours, cow.    /
 ----------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

@rustyrussell rustyrussell force-pushed the rustyrussell:cowsay branch from d3d859a to dd79f56 Aug 25, 2019

contrib/plugins: cowsay
 ___________________________________________________________________________
/ The most important plugin. Ever. Much thanks to @practicalswift and @jb55 \
\ for their improvements!                                                   /
 ---------------------------------------------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

@rustyrussell rustyrussell force-pushed the rustyrussell:cowsay branch from dd79f56 to bd27414 Aug 26, 2019

@rustyrussell

This comment has been minimized.

Copy link
Contributor Author

commented Aug 26, 2019

Ack bd27414

@rustyrussell rustyrussell merged commit c2f58ae into ElementsProject:master Aug 26, 2019

3 of 4 checks passed

bitcoin-bot/acks Check is pending
ackbot PR ack'd by rustyrussell
bitcoin-bot/fixups PR does not contain unsquashed fixups
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.