From d7254205e8a3f6c0580302b5e5ab57d3136d2b5b Mon Sep 17 00:00:00 2001 From: swaggboi Date: Sun, 28 Feb 2021 01:33:35 -0500 Subject: [PATCH] Templatize pages and implement layout --- templates/die.html.ep | 18 ++++++ templates/index.html.ep | 70 +++----------------- templates/layouts/swagg.html.ep | 55 ++++++++++++++++ templates/me.html.ep | 74 +++++++++++++++++++++ templates/news.html.ep | 110 ++++++++++++++++++++++++++++++++ www-swagg.pl | 14 ++-- 6 files changed, 269 insertions(+), 72 deletions(-) create mode 100644 templates/die.html.ep create mode 100644 templates/layouts/swagg.html.ep diff --git a/templates/die.html.ep b/templates/die.html.ep new file mode 100644 index 0000000..d9179d0 --- /dev/null +++ b/templates/die.html.ep @@ -0,0 +1,18 @@ +% title 'Deprecation of Internet Explorer'; +% layout 'swagg'; +
+

Deprecation of Internet Explorer (D.I.E.) Clock

+

Internet Explorer is sentenced to D.I.E. in:

+
+
+

+
+
+

Good riddance to bad rubbish...
+
+ Fun fact: Microsoft killed + + the first usable web browser to the general public


+
+
+ diff --git a/templates/index.html.ep b/templates/index.html.ep index 983f059..8bd0f54 100644 --- a/templates/index.html.ep +++ b/templates/index.html.ep @@ -1,56 +1,17 @@ - - - - - - Swagg::Net Homepage - - - - - - - -
- a purple gorilla -
-
-
-

- fireworks - Welcome to the Swagg::Net - more fireworks -

-

- (SwaggNet Wide Area Gigabit Game - Network)!! -

-
-
- - a padlock - Now in HTTPS!! -
-
+% title 'Swagg::Net Homepage'; +% layout 'swagg'; +
Under contruction
+ alt="Under contruction" height="40">
-
-

+

Homepage

+
+
+--------------------------+

- Did you hear the - news? Downtime happening soon - update
-
- Looking for a network/Linux admin? Read about me - BSOD
-
Looking for the game servers? Check out the message of the day character from Doom video game @@ -128,18 +89,3 @@ +--------------------------+

- - - diff --git a/templates/layouts/swagg.html.ep b/templates/layouts/swagg.html.ep new file mode 100644 index 0000000..b1a7223 --- /dev/null +++ b/templates/layouts/swagg.html.ep @@ -0,0 +1,55 @@ + + + + + + <%= title %> + + + + + + + +
+ a purple gorilla +
+ + a padlock + Now in HTTPS!! + +
+
+

+ fireworks + Welcome to the Swagg::Net + more fireworks +

+
+
+
+
+ Home - + Me BSOD - + News update
+
+
+
+
+<%= content %> + + + diff --git a/templates/me.html.ep b/templates/me.html.ep index e69de29..c645ff4 100644 --- a/templates/me.html.ep +++ b/templates/me.html.ep @@ -0,0 +1,74 @@ +% title 'About Me'; +% layout 'swagg'; +
+

All about Daniel

+

+ Northern Virginia (near DC) + - mail + - Resume +

+

+ My name is Daniel and I want to be a Perl / Unix hacker when I grow up.
+

+
+
+ +--------------------------+
+
+
+

+ These are old and bad, please check out + my git repos +

+
+
+ +--------------------------+
+
+
+

+

Here are some shell scripts I've written:

+ apt-up.sh - shell script that waits 10 + min for a user to log into a Debian/Ubuntu system then proceeds to + update the system via the apt-get package manager if no one logs in, + finishing with a system shutdown
+ tf2server01-bup.bash - bash + script to tarball, encrypt, and upload a back-up of a game + server
+ fedup-swagg.sh - shell script to + upgrade Fedora releases
+ yum-up.sh - shell script to update + system via yum package manager and email me if a (service) restart + is required
+ stripe-cache-sizer.sh - + small shell script with a simple for-loop that sets the stripe cache + size on an mdraid array +

+
+
+ +--------------------------+
+
+
+

+

I'm learning Perl now too

+ papicat.pl - (perpetually + work-in-progress) CLI client for Akamai's OPEN EdgeGrid API
+ cpcodes.pl - simple script to extract + some info from debug headers for Akamaized hostnames
+ ula6-swagg.pl - turns a MAC address + into an IPv6 ULA prefix
+ smac.pl - takes a list of misformatted + MAC addresses from arguments or standard input and substitutes them + for the correct format
+ pingy.pl - sends a couple pings to + IP(v6) addresses and restarts routing services if host(s) are + unreachable +

+
+
+ +--------------------------+
+
+
+

+ Warranty: If my script breaks your system, you get to keep both + pieces. +

+
diff --git a/templates/news.html.ep b/templates/news.html.ep index e69de29..ee5e1e4 100644 --- a/templates/news.html.ep +++ b/templates/news.html.ep @@ -0,0 +1,110 @@ +% title 'News'; +% layout 'swagg'; +
+

News

+
+
+ +--------------------------+
+
+
+
+ 6/25/2020 - Major Downtime Coming
+
+
+
+ +--------------------------+
+
+
+

+ I am going to be moving equipment this weekend (6/26/2020 to + 6/28/2020) so there may be a full day or two of downtime while I piece + everything together. In the future I'm going to move the MOTD and this + little news section to another server because this message kind of + defeats the purpose (didn't help I posted it at the last minute + WHOOPS) +

+
+
+ +--------------------------+
+
+
+
+ 1/17/2020 - New Domain Name
+
+
+
+ +--------------------------+
+
+
+

+ I purchased the swagg.net domain name last year but never go + around to cutting over from the old one. As with the move from + swagg.ddns.net, I'm going to hold onto swagg.cc to serve redirects + but eventually I'll be letting it go as swagg.cc actually costs me + money +

+
+
+ +--------------------------+
+
+
+
+ 7/26/2019 - Now serving HTTPS
+
+
+
+ +--------------------------+
+
+
+

I got bored and changed stuff and now there's HTTPS

+
+
+ +--------------------------+
+
+
+
+ 7/17/2019 - New IP addresses
+
+
+
+ +--------------------------+
+
+
+

+ Due to me physically moving my server (and everything) to my new + place in Northern VA, there was some downtime (2 days) and + SwaggNet now has all new IP addresses. I think it's done now but + there may be some more downtime at night during the weekend as I + have to clean up my cabling as things got a bit spaghettified + during the move and I haven't had the time to unravel it all. +

+
+
+ +--------------------------+
+
+
+
+ 5/13/2019 - New domain name (and IPv6!!)
+
+
+
+ +--------------------------+
+
+
+

+ I've been quietly playing around with IPv6 for some time and + finally felt comfortable going "global" with it, however the old + domain name (swagg.ddns.net) was a free Dynamic DNS name and thus + was not configurable as an AAAA (IPv6) + record. Therefore swagg.cc is now + the new domain name for SwaggNet and swagg.ddns.net has be + reconfigured to simply point to swagg.cc and will stay that way as + long as I can hold on to that name. swagg.cc should now resolve to + IPv4 or IPv6 and if you're curious or want to test your own IPv6 + configuration, I've also + created ipv6.swagg.cc which + will only be used for IPv6 records so using ipv6.swagg.cc should + essentially force an IPv6 session if everything's been set up + correctly. +

+
diff --git a/www-swagg.pl b/www-swagg.pl index 2733595..71b3a83 100755 --- a/www-swagg.pl +++ b/www-swagg.pl @@ -4,21 +4,15 @@ use Mojolicious::Lite; get '/' => sub { my ($c) = @_; - my $fortune = `fortune`; + my $fortune = `fortune` || 'huh??'; $c->render(fortune => $fortune) } => 'index'; -get '/me' => sub { - my ($c) = @_; +get '/die'; - $c->render(); -}; +get '/me'; -get '/news' => sub { - my ($c) = @_; - - $c->render(); -}; +get '/news'; app->start();