Skip to content

Commit

Permalink
Merge pull request #262 from veracioux:tuterm_demo
Browse files Browse the repository at this point in the history
Add automated CLI demonstrations

Contributors:
  * @veracioux
  * @spirillen
  • Loading branch information
funilrys committed Dec 25, 2021
2 parents f0292cc + f537119 commit b3c4442
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ contribution(s) and or issue report which made or make `PyFunceble`_ a better to

- Avinash Reddy - `@AvinashReddy3108`_
- Daniel - `@dnmTX`_
- Haris Gušić - `@veracioux`_
- gwarser - `@gwarser`_
- hawkeye116477 - `@hawkeye116477`_
- Human Being - `@T145`_
Expand Down Expand Up @@ -296,6 +297,7 @@ License
.. _@T145: https://github.com/T145
.. _@tartley: https://github.com/tartley
.. _@theskumar: https://github.com/theskumar
.. _@veracioux: https://github.com/veracioux
.. _@Wally3K: https://github.com/WaLLy3K
.. _@xxcriticxx: https://github.com/xxcriticxx
.. _@yaml: https://github.com/yaml
Expand Down
2 changes: 2 additions & 0 deletions docs/contributors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ contribution(s) and or issue report which made or make `PyFunceble`_ a better to
- Avinash Reddy - `@AvinashReddy3108`_
- Daniel - `@dnmTX`_
- gwarser - `@gwarser`_
- Haris Gušić - `@veracioux`_
- hawkeye116477 - `@hawkeye116477`_
- Human Being - `@T145`_
- Imre Kristoffer Eilertsen - `@DandelionSprout`_
Expand Down Expand Up @@ -60,6 +61,7 @@ contribution(s) and or issue report which made or make `PyFunceble`_ a better to
.. _@speedmann: https://github.com/speedmann
.. _@spirillen: https://mypdns.org/spirillen
.. _@T145: https://github.com/T145
.. _@veracioux: https://github.com/veracioux
.. _@Wally3K: https://github.com/WaLLy3K
.. _@xxcriticxx: https://github.com/xxcriticxx
.. _@ybreza: https://github.com/ybreza
Expand Down
21 changes: 21 additions & 0 deletions examples/demo/config.sh.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Common config for demo scripts
configure() {
DELAY=0.07
DELAY_SEP=0.22
DELAY_PROMPT=0.6

# No messages/warnings in the current versions of the scripts
# but if we add them, their colors can be changed here
# COLOR_WARNING='1;91'
# COLOR_MESSAGE='1;32'

# If you want to use the colorful prompt
TUTERM_NAME='PyFunceble-demo'
# Set the terminal width/height
}

prompt() {
# For a more colorful prompt, uncomment the following:
# echo -ne "\033[1;94m$TUTERM_NAME \033[1;35m$(pwd | sed "s:$HOME:~:")\033[0;33m $\033[0m "
echo -n '[funilrys@funilrys PyFunceble]$ '
}
14 changes: 14 additions & 0 deletions examples/demo/landing_page_demo_1.tut
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env tuterm

source config.sh.in

run() {
c PyFunceble --version
c PyFunceble -a -d example.org
c PyFunceble -a -d example.org --whois-lookup
c PyFunceble -a -d exampleee.com
c PyFunceble -a -d microsoft_google.com
c exit
}

# vim: filetype=sh
15 changes: 15 additions & 0 deletions examples/demo/landing_page_demo_2.tut
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env tuterm

source config.sh.in

run() {
c PyFunceble --version
c PyFunceble -d 9.9.9.9 # Neutral stable

This comment has been minimized.

Copy link
@spirillen

spirillen Dec 27, 2021

Contributor

This should be 9.9.9.10 for a unfiltered lookup

This comment has been minimized.

Copy link
@funilrys

funilrys Dec 27, 2021

Author Owner

PR welcome.

c PyFunceble -d 2620:fe::fe # quad9 IPv6 (As I recall GHA now supports IPv6)
c PyFunceble -d 194.187.99.221 # Adult CDN: https://mypdns.org/my-privacy-dns/porn-records/-/issues?scope=all&state=all&label_name[]=IP%3A%3ABlackListing
c PyFunceble -d 45.136.204.40 # 23 phis: https://github.com/mitchellkrogza/phishing/pull/67
c PyFunceble -u http://18.191.88.103/login.html # As we can do urls too, this is a inactive Phis
c exit
}

# vim: filetype=sh
14 changes: 14 additions & 0 deletions examples/demo/landing_page_demo_3.tut
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env tuterm

source config.sh.in

run() {
c PyFunceble --version
c PyFunceble -u https://github.com/funilrys
c PyFunceble -u https://github.com/microsoft_google
c PyFunceble -u https://microsoft_google.com
c PyFunceble -u https://microsoft_google.com --local
c exit
}

# vim: filetype=sh
17 changes: 17 additions & 0 deletions examples/demo/record.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env sh

set -e

# Pre-warm PyFunceble for better performance
echo Pre-warming for better recording performance
for i in $(seq 1 10); do
PyFunceble --version >/dev/null
done

for file in "$@"; do
mkdir -p "/tmp/PyFunceble"
cast="/tmp/PyFunceble/$(basename "$file").cast"
rm -f "$cast"
stty cols 166 rows 45
asciinema rec -c "tuterm $file --mode demo" "$cast"
done
8 changes: 8 additions & 0 deletions examples/demo/upload.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env sh

set -e

for file in "$@"; do
cast="/tmp/PyFunceble/$(basename "$file").cast"
asciinema upload "$cast" | grep 'https:' | sed 's/^\s*//'
done

0 comments on commit b3c4442

Please sign in to comment.