From 1c5025d54c3a8244fcbe818f96dea49e51054ba6 Mon Sep 17 00:00:00 2001 From: mjfernez Date: Wed, 22 Nov 2023 13:55:19 -0500 Subject: Update to new media directory syntax --- .md/about/faq.md | 2 +- .md/about/whereami.md | 2 +- .../pc_gaming/common-gfx-card-installation-woes.md | 2 +- .../how-to-fix-neovim-nerdtree-rendering-issue.md | 8 +- .md/tutorials/www/quick-intro-html-css.md | 14 +- about/faq.html | 2 +- about/whereami.html | 2 +- home.html | 12 +- latest.html | 17 ++ .../common-gfx-card-installation-woes.html | 2 +- ...how-to-fix-neovim-nerdtree-rendering-issue.html | 8 +- tutorials/www/how-to-use-the-internet.html | 250 +++++++++++++++++++++ tutorials/www/quick-intro-html-css.html | 14 +- update_latest.py | 43 ++++ 14 files changed, 344 insertions(+), 34 deletions(-) create mode 100644 latest.html create mode 100644 tutorials/www/how-to-use-the-internet.html create mode 100644 update_latest.py diff --git a/.md/about/faq.md b/.md/about/faq.md index 21b2c73..c8fb90b 100644 --- a/.md/about/faq.md +++ b/.md/about/faq.md @@ -38,7 +38,7 @@ lately that I'm used to it. Honestly, I though the fish was cool. -![puffy](/static/puffy.gif) +![puffy](/static/media/puffy.gif) I don't know the artist of that one unfortunately, I just found it on a forum. diff --git a/.md/about/whereami.md b/.md/about/whereami.md index 8be0a66..01d0809 100644 --- a/.md/about/whereami.md +++ b/.md/about/whereami.md @@ -25,7 +25,7 @@ need to go to make things go beep. In the 60s and 70s, routers tended to be people-based and would require workers spend their time plugging cables into and out of ports so calls could connect. - + *Image of a switchboard courtesy of [Wikipedia diff --git a/.md/tutorials/pc_gaming/common-gfx-card-installation-woes.md b/.md/tutorials/pc_gaming/common-gfx-card-installation-woes.md index 19e3c1c..f9370ec 100644 --- a/.md/tutorials/pc_gaming/common-gfx-card-installation-woes.md +++ b/.md/tutorials/pc_gaming/common-gfx-card-installation-woes.md @@ -138,6 +138,6 @@ you're still seeing your desktop, you should be good to go! I ran Kerbal Space Program 2 (currently in early access) as my first test. -![](/static/ksp2.webm) +![](/static/media/ksp2.webm) Looking good, Jeb! diff --git a/.md/tutorials/vim/how-to-fix-neovim-nerdtree-rendering-issue.md b/.md/tutorials/vim/how-to-fix-neovim-nerdtree-rendering-issue.md index df0af33..1ff6fe7 100644 --- a/.md/tutorials/vim/how-to-fix-neovim-nerdtree-rendering-issue.md +++ b/.md/tutorials/vim/how-to-fix-neovim-nerdtree-rendering-issue.md @@ -6,18 +6,18 @@ scroll the window, I'd get a mess. ## The Problem -![](/static/mess.gif) +![](/static/media/mess.gif) Now, yes, I know I'm a heretic for using the arrow keys and not just jumping around, but I thought it was weird I didn't see this issue anywhere else. Also, vim doesn't have this problem. -![](/static/nomess-vim.gif) +![](/static/media/nomess-vim.gif) It's also not because of my meme tmux setup, the same issue happens in terminator, which I happened to have installed. -![](/static/mess-terminator.gif) +![](/static/media/mess-terminator.gif) ## The Attempt @@ -44,7 +44,7 @@ from Debian's default bashrc, but all I had to do was change it: export TERM='tmux256-color' ``` -![](/static/fixed.gif) +![](/static/media/fixed.gif) No more hacky autocommands! diff --git a/.md/tutorials/www/quick-intro-html-css.md b/.md/tutorials/www/quick-intro-html-css.md index 3fe94ad..d94c254 100644 --- a/.md/tutorials/www/quick-intro-html-css.md +++ b/.md/tutorials/www/quick-intro-html-css.md @@ -91,7 +91,7 @@ tags in this example: FSF! - + @@ -272,7 +272,7 @@ example: - +

My Great page

@@ -332,7 +332,7 @@ syntax. CSS allows you to set attributes to *all* tags in a specific document and create a unifying style for all your pages. ``` - + ``` As before, "href" points to the file to be linked. In this example, we @@ -446,7 +446,7 @@ img.gray { Applied: You can read lots more options for image formatting @@ -471,7 +471,7 @@ For one, that will only dim black-and-white images; anything else will just turn to mush like this: Instead, I'd like it to just apply to select elements; I can do so by @@ -486,10 +486,10 @@ img.icon { And to implement it in HTML: ``` - + ``` - + #### Use the div tag to make sections diff --git a/about/faq.html b/about/faq.html index a4ead4a..0c2c039 100644 --- a/about/faq.html +++ b/about/faq.html @@ -220,7 +220,7 @@ terminal lately that I'm used to it.

Why OpenBSD?

Honestly, I though the fish was cool.

-puffy +puffy

I don't know the artist of that one unfortunately, I just found it on diff --git a/about/whereami.html b/about/whereami.html index d6be605..8a2e712 100644 --- a/about/whereami.html +++ b/about/whereami.html @@ -178,7 +178,7 @@ router, which literally does what the name implies--it routes signals to where they need to go to make things go beep. In the 60s and 70s, routers tended to be people-based and would require workers spend their time plugging cables into and out of ports so calls could connect.

-

+

Image of a switchboard courtesy of Wikipedia contributors

Fortunately, we figured out that was dumb and made robots do the job diff --git a/home.html b/home.html index 2688d19..c80320a 100644 --- a/home.html +++ b/home.html @@ -43,9 +43,9 @@ learn the ins and outs of hosting your own, click - + - +
Most of what I'm working on (including this site) is kept at @@ -59,23 +59,23 @@ learn the ins and outs of hosting your own, click - + - + - + - + {% endblock %} diff --git a/latest.html b/latest.html new file mode 100644 index 0000000..fa5fd2b --- /dev/null +++ b/latest.html @@ -0,0 +1,17 @@ + + +

LATEST CHANGES

+ + + diff --git a/tutorials/pc_gaming/common-gfx-card-installation-woes.html b/tutorials/pc_gaming/common-gfx-card-installation-woes.html index a53c2d3..286b4ab 100644 --- a/tutorials/pc_gaming/common-gfx-card-installation-woes.html +++ b/tutorials/pc_gaming/common-gfx-card-installation-woes.html @@ -317,7 +317,7 @@ method!

point, as long as you're still seeing your desktop, you should be good to go! I ran Kerbal Space Program 2 (currently in early access) as my first test.

-

+

Looking good, Jeb!

diff --git a/tutorials/vim/how-to-fix-neovim-nerdtree-rendering-issue.html b/tutorials/vim/how-to-fix-neovim-nerdtree-rendering-issue.html index c5179a6..a3ab430 100644 --- a/tutorials/vim/how-to-fix-neovim-nerdtree-rendering-issue.html +++ b/tutorials/vim/how-to-fix-neovim-nerdtree-rendering-issue.html @@ -233,14 +233,14 @@ of active development on extensions. I didn't use it for a long time because I needed NerdTree but every time I'd scroll the window, I'd get a mess.

The Problem

-

+

Now, yes, I know I'm a heretic for using the arrow keys and not just jumping around, but I thought it was weird I didn't see this issue anywhere else. Also, vim doesn't have this problem.

-

+

It's also not because of my meme tmux setup, the same issue happens in terminator, which I happened to have installed.

-

+

The Attempt

There's a better way to do this, but I first figured just triggering a redraw on scroll would do the trick. You can do so by adding the @@ -256,7 +256,7 @@ TERM variable was set to 'xterm'. I'm not sure if I did that intentionally to run something or if it's just a legacy thing I left in from Debian's default bashrc, but all I had to do was change it:

export TERM='tmux256-color'
-

+

No more hacky autocommands!

If I had the foresight to test the issue in xterm first, I probably would have seen it right away....

diff --git a/tutorials/www/how-to-use-the-internet.html b/tutorials/www/how-to-use-the-internet.html new file mode 100644 index 0000000..67a020e --- /dev/null +++ b/tutorials/www/how-to-use-the-internet.html @@ -0,0 +1,250 @@ + + + + + + +how-to-use-the-internet + + + + +

Why?

+

Why would anyone want to use the Internet, really?

+

There is actually purpose to connecting all the computers in the +world with near-instant speed beyond just streaming television, phishing +scams, pornography, punditry, and Fortnight competitions.

+

Unfortunately, almost none of us use the Internet for it's intended +purpose: finding infomation.

+

Writing an angry tweet to a celebrity or posting a picture of your +cat seems to be second nature for most people, but converting a picture +from a PDF or looking up a study (or even a word!) you saw in an article +is something else entirely.

+

While that's in part the fault of our laziness, it's equally the +fault of what the Internet has become.

+

For one: there's just so much more stuff now; it's hard to +know exactly where to start and who to trust. And so much of that stuff +is now garbage, either in the way it's presented, with +disruptive ads that don't close correctly, or in the way it's written: +vague, misleading, or straight incorrect.

+

For two: no one really teaches you how to use this thing do they? +There are no courses on "How to use a search engine" or "How to find +good posts on a forum," and definitely not on "How to write +good posts on a forum." But these are exactly the kinds of skills you +really need if you want to navigate the modern world without getting +constantly distracted, misled, or totally lost.

+

There are of course, countless guides on "netiquette" geared towards +every possible internet subculture you can find. While many of them have +influenced this document and give many helpful tips on writing good +informative posts, none of them really go over what I think is most +important: what to do with the information you're reading.

+

This will probably be an evolving document as new services and +websites become available (or go down), but much of this material in the +beginning should be pretty generally applicable no matter what services +are available.

+

How to use a web browser

+

How to use a search engine

+

As for which search engine to use: you should use all of them, until +you get the results you need.

+

In my experience, none of the major search engines are particularly +good and I get inconsistent searches on all of them depending on what +I'm searching. There is a lot of preaching these days about privacy +concerns, but I don't really believe any service is more "private" than +another. These are all privacy nightmares, arguably by design. Your best +bet is just to search often and as many platforms as you can.

+

How to read and find +scholarly articles

+

How to use Wikipedia

+

A common complaint lodged at me whenever I recommend Wikipedia is +that it's not a source of truth since they found X mistake somewhere, or +made Y edit when they were a teenager that's still there. No one has +ever (or should ever) claim Wikipedia is a source of truth on it's own. +But you can use it to find more sources and maybe get a little +closer.

+

How to find articles +with Google Scholar

+

Advanced Topics

+

How to use tor to browse +anonymously

+

Many in the advertising world will boast about using a VPN for +anonymity, or using a VPN in conjuction with Tor to "increase privacy." +This is simply a misunderstanding of terms. A VPN provides +privacy of the user's connection since it provides +encryption--only the VPN provider can "see" what is searched. The goal +of Tor is anonymity not privacy. Anonymity means "no one knows +who you are" not "no one knows what you're doing." Technically, traffic +is encrypted between nodes of the Tor service, so some level of privacy +is provided as well, but this is most effective when using hidden +services, not using Tor in general.

+ + + diff --git a/tutorials/www/quick-intro-html-css.html b/tutorials/www/quick-intro-html-css.html index 9788cf4..4cdb434 100644 --- a/tutorials/www/quick-intro-html-css.html +++ b/tutorials/www/quick-intro-html-css.html @@ -267,7 +267,7 @@ more tags in this example:

<td>FSF!</td> <td> <a href="https://www.fsf.org/"> - <img src="https://static.fsf.org/common/img/logo-new.png" /> + <img src="https://static/media.fsf.org/common/img/logo-new.png" /> </a></td> </tr> <tr> @@ -447,7 +447,7 @@ example:

<meta name="keywords" content="HTML, CSS, JavaScript"> <meta name="author" content="John Doe"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <link rel="stylesheet" type="text/css" href="/static/main.css"> + <link rel="stylesheet" type="text/css" href="/static/media/main.css"> </head> <body> <h1>My Great page</h1> @@ -491,7 +491,7 @@ the icon you see in the tab of an open page.

style sheet. Like HTML, CSS is just a text file written in a specific syntax. CSS allows you to set attributes to all tags in a specific document and create a unifying style for all your pages.

-
<link rel="stylesheet" type="text/css" href="/static/main.css">
+
<link rel="stylesheet" type="text/css" href="/static/media/main.css">

As before, "href" points to the file to be linked. In this example, we place our CSS in a text file called "main.css" in the "static" directory of "/var/www/html".

@@ -574,7 +574,7 @@ using the filter option like so:

filter: grayscale(100%) }

Applied:

-

+

You can read lots more options for image formatting here and about the filter property here

Making Custom Classes

@@ -587,15 +587,15 @@ appear nice on dark theme browsers just as well. But I don't want to dim }

For one, that will only dim black-and-white images; anything else will just turn to mush like this:

-

+

Instead, I'd like it to just apply to select elements; I can do so by extending the tag with a class. On the CSS side:

img.icon {
     filter: invert(50%);
 }

And to implement it in HTML:

-
<img class="icon" src="/static/rss.svg" />
-

+
<img class="icon" src="/static/media/rss.svg" />
+

Use the div tag to make sections

You can use the class property on any HTML tag, but you can diff --git a/update_latest.py b/update_latest.py new file mode 100644 index 0000000..160dc7c --- /dev/null +++ b/update_latest.py @@ -0,0 +1,43 @@ +import os +import subprocess +from time import mktime, ctime +from email.utils import parsedate + +def file_last_modified(path): + git_time = f"git log -n1 --pretty=%aD {path}".split() + try: + mod_time = subprocess.check_output(git_time) + except: + # File is not in the git log, no biggie, just blank the date + return None + + # Git outputs in RFC2822 format + return parsedate(mod_time.decode('ascii').strip()) + +updates = {} +dirs = [x for x in os.listdir() + if os.path.isdir(x) and not x.startswith(".") + ] + +for top in dirs: + for root,_,files in os.walk(top): + for f in files: + if f.endswith(".html") or f.endswith(".txt"): + path = os.path.join(root, f) + t = file_last_modified(path) + if t: + updates[path] = mktime(t) +print("") +print("") +print("

LATEST CHANGES

") +print("") +print("") +print("") + -- cgit v1.2.3