From 1cdfca5c471bbd8d1737d32ab94408669678c483 Mon Sep 17 00:00:00 2001 From: Anne Jan Brouwer Date: Tue, 23 Jul 2019 16:51:18 +0200 Subject: [PATCH 1/4] Shit Happens Again 2021 Copy, Paste, Improve --- sha.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sha.py b/sha.py index 584cafd..b790b2c 100644 --- a/sha.py +++ b/sha.py @@ -5,7 +5,7 @@ @willie.module.commands('sha') @willie.module.example('.sha', 'sha') def spacestate(bot, trigger): - """Gives you a random SHA2017 slogan suggestion""" - txt = "echo \"$(grep \"^s\" /usr/share/dict/cracklib-small | shuf -n1) $(grep \"^hack\" /usr/share/dict/cracklib-small | shuf -n1) $(grep \"^a\" /usr/share/dict/cracklib-small | shuf -n1) 2017\"" + """Gives you a random SHA2032 slogan suggestion""" + txt = "echo \"$(grep \"^s\" /usr/share/dict/cracklib-small | shuf -n1) $(grep \"^hack\" /usr/share/dict/cracklib-small | shuf -n1) $(grep \"^a\" /usr/share/dict/cracklib-small | shuf -n1) 2021\"" bot.say(os.popen(txt).read().title()) From dc6f0465036502cfc98e575149a9365c17c30b7c Mon Sep 17 00:00:00 2001 From: Anne Jan Brouwer Date: Tue, 23 Jul 2019 16:53:36 +0200 Subject: [PATCH 2/4] Off by one . . --- sha.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sha.py b/sha.py index b790b2c..660c8a1 100644 --- a/sha.py +++ b/sha.py @@ -5,7 +5,7 @@ @willie.module.commands('sha') @willie.module.example('.sha', 'sha') def spacestate(bot, trigger): - """Gives you a random SHA2032 slogan suggestion""" + """Gives you a random SHA2021 slogan suggestion""" txt = "echo \"$(grep \"^s\" /usr/share/dict/cracklib-small | shuf -n1) $(grep \"^hack\" /usr/share/dict/cracklib-small | shuf -n1) $(grep \"^a\" /usr/share/dict/cracklib-small | shuf -n1) 2021\"" bot.say(os.popen(txt).read().title()) From aac6a6aeadb37fd5409479013a31665c0812430f Mon Sep 17 00:00:00 2001 From: Anne Jan Brouwer Date: Tue, 23 Jul 2019 17:33:13 +0200 Subject: [PATCH 3/4] Optimized and won't make ugly mistakes with apostrophes --- sha.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sha.py b/sha.py index 660c8a1..c9fd07f 100644 --- a/sha.py +++ b/sha.py @@ -6,6 +6,6 @@ @willie.module.example('.sha', 'sha') def spacestate(bot, trigger): """Gives you a random SHA2021 slogan suggestion""" - txt = "echo \"$(grep \"^s\" /usr/share/dict/cracklib-small | shuf -n1) $(grep \"^hack\" /usr/share/dict/cracklib-small | shuf -n1) $(grep \"^a\" /usr/share/dict/cracklib-small | shuf -n1) 2021\"" - bot.say(os.popen(txt).read().title()) - + txt = "for v in s h a; do w=$(grep \"^$v\" /usr/share/dict/cracklib-small | shuf -n1); echo -n \"${w^^${w:0:1}} \"; done ; echo 2021" + bot.say(os.popen(txt).read()) + From f919afff3ea5bb0f42e76be7af9f1c2c4c22682d Mon Sep 17 00:00:00 2001 From: Anne Jan Brouwer Date: Tue, 23 Jul 2019 17:46:59 +0200 Subject: [PATCH 4/4] Fixed capitalisation and "hack*" --- sha.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sha.py b/sha.py index c9fd07f..1112000 100644 --- a/sha.py +++ b/sha.py @@ -6,6 +6,6 @@ @willie.module.example('.sha', 'sha') def spacestate(bot, trigger): """Gives you a random SHA2021 slogan suggestion""" - txt = "for v in s h a; do w=$(grep \"^$v\" /usr/share/dict/cracklib-small | shuf -n1); echo -n \"${w^^${w:0:1}} \"; done ; echo 2021" + txt = "for v in s hack a; do w=$(grep \"^$v\" /usr/share/dict/cracklib-small | shuf -n1); echo -n \"${w^${v:0:1}} \"; done ; echo 2021" bot.say(os.popen(txt).read())