From 87adb4e14dd08d1786c0f9bae3a620ed4acbed28 Mon Sep 17 00:00:00 2001 From: DarkFeather Date: Fri, 12 Jan 2024 20:03:08 -0600 Subject: [PATCH] 25U subnetting app --- roles/WebServer/files/apps/25u_subnetting.php | 46 +++++++++++++++++++ .../files/conf.d/Yggdrasil/aaa_default.conf | 9 ++++ 2 files changed, 55 insertions(+) create mode 100644 roles/WebServer/files/apps/25u_subnetting.php diff --git a/roles/WebServer/files/apps/25u_subnetting.php b/roles/WebServer/files/apps/25u_subnetting.php new file mode 100644 index 0000000..89dfe88 --- /dev/null +++ b/roles/WebServer/files/apps/25u_subnetting.php @@ -0,0 +1,46 @@ + + +25U Subnetting Practice + +'; + +// Binary conversions +echo '

Convert the following to binary:

'; +for ($x = 0; $x <= 3; $x++) { + echo '

'.rand(0,256).' ____________________

'; +} + +// Decimal conversions +echo '

Convert the following to decimal:

'; +for ($x = 0; $x <= 3; $x++) { + echo '

'; + + for ($y = 0; $y <= 7; $y++) { + echo rand(0,1); + } + + + echo ' ____________________

'; +} + +// CIDRs +echo '

Convert the following slash notations to decimal and binary:

'; +for ($x = 0; $x <= 3; $x++) { + echo ''; +} +echo '
SlashDecimalBinary
'.rand(16,32).'  
'; + +//Subnets +echo '

Identify the following for these CIDR’s:

'; +echo ''; + +for ($x = 0; $x <= 6; $x++) { + echo ''; +} +echo '
IP/CIDRSMNetIDHost RangeBroadcastGatewayIncrement
'.rand(0,256).'.'.rand(0,256).'.'.rand(0,256).'.'.rand(0,256).'/'.rand(16,32).'      
'; + +echo '

Bonus: Calculate the three subnets that follow each of the above.

'; + +echo ''; diff --git a/roles/WebServer/files/conf.d/Yggdrasil/aaa_default.conf b/roles/WebServer/files/conf.d/Yggdrasil/aaa_default.conf index 2ad8b32..a39e0fc 100644 --- a/roles/WebServer/files/conf.d/Yggdrasil/aaa_default.conf +++ b/roles/WebServer/files/conf.d/Yggdrasil/aaa_default.conf @@ -34,6 +34,15 @@ server { rewrite /martialarts/maqotw.xml /MartialArts/Wiki/raw/branch/main/rss/maqotw.xml; } + location /25u { + include conf.d/fastcgi.config; + root /usr/share/webapps/aninix/; + location ~* 25u { + try_files $uri /25u_subnetting.php; + expires max; + } + } + location /whatismyip { include conf.d/fastcgi.config; root /usr/share/webapps/aninix/;