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

@rustyrussell rustyrussell commented Aug 22, 2019

No description provided.

Copy link
Collaborator

@ZmnSCPxj ZmnSCPxj left a comment

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

Loading

Copy link
Contributor

@practicalswift practicalswift left a comment

ACK aa31634 modulo a few nits

 _____________________________________
/ Thanks for tackling this important  \
\ issue! You are a great human being. /
 -------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

Loading

contrib/plugins/cowsay.sh Outdated Show resolved Hide resolved
Loading
contrib/plugins/cowsay.sh Outdated Show resolved Hide resolved
Loading
contrib/plugins/cowsay.sh Outdated Show resolved Hide resolved
Loading
contrib/plugins/cowsay.sh Outdated Show resolved Hide resolved
Loading
contrib/plugins/cowsay.sh Outdated Show resolved Hide resolved
Loading
@Saibato
Copy link
Contributor

@Saibato Saibato 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.

Loading

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' '"'
Copy link
Collaborator

@jb55 jb55 Aug 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Loading

Copy link
Contributor Author

@rustyrussell rustyrussell Aug 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

 _________________________________________
/ 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 |
                ||     ||

Loading


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

@practicalswift practicalswift Aug 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Loading

Copy link
Contributor Author

@rustyrussell rustyrussell Aug 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Loading

Copy link
Contributor Author

@rustyrussell rustyrussell Aug 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Loading

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' '"'
Copy link
Contributor

@practicalswift practicalswift Aug 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Loading

Copy link
Contributor Author

@rustyrussell rustyrussell Aug 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Loading

@practicalswift
Copy link
Contributor

@practicalswift practicalswift commented Aug 23, 2019

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

Loading

 ___________________________________________________________________________
/ 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
Copy link
Contributor Author

@rustyrussell rustyrussell commented Aug 26, 2019

Ack bd27414

Loading

@rustyrussell rustyrussell merged commit c2f58ae into ElementsProject:master Aug 26, 2019
3 of 4 checks passed
Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment