From 5a0d5c2bb7d700343adbef66185675215cc983e5 Mon Sep 17 00:00:00 2001 From: mjfernez Date: Tue, 11 Jul 2023 23:31:16 -0400 Subject: HTML generation --- about/faq.html | 282 ++++++++++-- about/howami.html | 141 ++++++ about/whatami.html | 148 +++++- about/whereami.html | 229 +++++++++- about/whoami.html | 184 +++++++- about/whyami.html | 144 +++++- thoughts/syntax/my-worst-habit.html | 173 ++++++- thoughts/syntax/random-python-idiosyncrasies.html | 308 ++++++++++--- .../tor/how-to-host-a-tor-hidden-service.html | 209 ++++++++- ...how-to-fix-neovim-nerdtree-rendering-issue.html | 180 +++++++- tutorials/www/how-to-make-this-site.html | 504 ++++++++++++++++++--- tutorials/www/how-to-use-the-internet.html | 249 ++++++++++ tutorials/www/quick-intro-html-css.html | 475 ++++++++++++++++--- 13 files changed, 2943 insertions(+), 283 deletions(-) create mode 100644 tutorials/www/how-to-use-the-internet.html diff --git a/about/faq.html b/about/faq.html index 87180cc..994d8a8 100644 --- a/about/faq.html +++ b/about/faq.html @@ -6,67 +6,279 @@ faq -

Frequently Anticipated Questions

-

Questions noone asked, but could maybe

-

Why bother running a Tor hidden service if you're gonna put your full name on it?

-

One, because I think hidden services are neat and I thought it'd be neat to make one. And two, if I really needed to be anonymous, I would probably self-host or find a hosting provider somewhere else, or reconsider using the Internet all together.

-

The hidden service has a benefit though, mostly to you. You don't need to expose your IP to me or to anyone else to access this site.

-

How come I can't access your main domain?

-

Honestly, I wouldn't know if my site is blocked elsewhere, but I may have blocked your IP for the following reasons:

+

Frequently Anticipated +Questions

+

Questions noone asked, +but could maybe

+

Why +bother running a Tor hidden service if you're gonna put your full name +on it?

+

One, because I think hidden services are neat and I thought it'd be +neat to make one. And two, if I really needed to be anonymous, I would +probably self-host or find a hosting provider somewhere else, or +reconsider using the Internet all together.

+

The hidden service has a benefit though, mostly to you. You +don't need to expose your IP to me or to anyone else to access this +site.

+

How come I can't +access your main domain?

+

Honestly, I wouldn't know if my site is blocked elsewhere, but I may +have blocked your IP for the following reasons:

-

This is part of the reason why I run the site as hidden service since you can still read my nonsense anyway through that, but if you think this might be an error on my part, you can email me.

-

You wrote all this in vim? Why tho?

-

Neovim more lately, but yeah other than large projects, I prefer using vim for editing. Mostly because it's easy to edit consistently across servers and because I just spend so much of my time in the terminal lately that I'm used to it.

+

This is part of the reason why I run the site as hidden service since +you can still read my nonsense anyway through that, but if you think +this might be an error on my part, you can email me.

+

You wrote all this in +vim? Why tho?

+

Neovim more lately, but yeah other than large projects, I prefer +using vim for editing. Mostly because it's easy to edit consistently +across servers and because I just spend so much of my time in the +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 a forum.

-

Besides I've installed Debian lots of times so I figured, why not try something different? It's pretty cool as a server OS. Just a lot of homework. I'm sure it's good as a desktop/laptop one too, but it's not different enough for me to move all my data.

+

I don't know the artist of that one unfortunately, I just found it on +a forum.

+

Besides I've installed Debian lots of times so I figured, why not try +something different? It's pretty cool as a server OS. Just a lot of +homework. I'm sure it's good as a desktop/laptop one too, but it's not +different enough for me to move all my data.

For what it's worth, I use Debian sid for a daily driver.

-

Why bother making your site from scratch? It looks like crap

-

Eh. I feel like if what I say isn't interesting, prettying it up won't help keep attention that much. I like simple sites like this one. It forces you to poke around more. Poking around is a good thing.

-

Why does your RSS feed update me on old stuff?

-

Because I made it to set the publication date to the last write time of the file. Change is important and I do it often, because I'm often wrong.

-

Why is this site public domain? What does that mean?

-

This site is "licensed" under The Creative Commons CC0 or "No Rights Reserved" license. This means that any file accessible on my web server which I created (which is the text you are reading and the code that generates it) belongs to the public domain as far as legally possible and I reserve no right to it's re-publication, re-use, or re-distribution with no expectation of compensation. So if you find any use of the information I post here, or the little flask app I wrote to run the thing, you are free to use it without any fear that I'm going to slap you with a lawsuit. This does not include most of the images; I try to link credit where I can for those.

-

A lot of people might prefer a BSD or GNU style license for their code and I agree that there are many cases where that is the preferred option. But it doesn't make sense for me; at least not for a homepage like this. I'm not sure about other people, but most of my ideas are not my own; they come from reading a history book or doing a textbook exercise or an off-color joke. So without getting on a soapbox, I guess you can say the idea of "intellectual property" never made too much sense to me in general.

-

I get that people have to get paid. I get that people are afraid of someone else taking credit for their work. But for this site at least, I guess I just don't really care. If someone really finds some way to profit of some random guy's Linux tutorials and unqualified thoughts on the world I honestly think they deserve the credit not me. I have no idea how I'd do that; I'm not sure I'd even want to waste my time with all the marketing nonsense of the modern web. And on the second point, if someone "steals" my work it's not exactly hard to figure out it was published here first--a Google search will prove that. But even if that weren't the case, I still wouldn't mind. I'd be glad that this stuff is useful at all. That would be a nice surprise.

-

Not everything that is linked to on this site falls under the same guidelines, so be sure to respect that author's copyright; I tend to link stuff that is generally pretty free to use, though.

-

Why don't you highlight URLs you dinosaur?

-

Because I think it's kinda deceiving. It's one thing to highlight a word that leads to a place, since the user doesn't have expectation of where it's going to lead, they'll tend to hover to see where it's going. A full URL looks like it's going exactly where it's going. A user won't think twice about clicking on https://facebook.com/. They will if they see totally not a virus. If you're giving out the full URL anyway why bother linking it? Every browser in the world has double-click (or long-press) to highlight the URL automatically, then right-click, and open in new tab.

+

Why +bother making your site from scratch? It looks like crap

+

Eh. I feel like if what I say isn't interesting, prettying it up +won't help keep attention that much. I like simple sites like this one. +It forces you to poke around more. Poking around is a good thing.

+

Why does your +RSS feed update me on old stuff?

+

Because I made it to set the publication date to the last write time +of the file. Change is important and I do it often, because I'm often +wrong.

+

Why is +this site public domain? What does that mean?

+

This site is "licensed" under The Creative Commons CC0 or "No Rights +Reserved" license. This means that any file accessible on my web server +which I created (which is the text you are reading and the code that +generates it) belongs to the public domain as far as legally possible +and I reserve no right to it's re-publication, re-use, or +re-distribution with no expectation of compensation. So if you find any +use of the information I post here, or the little flask app I wrote to +run the thing, you are free to use it without any fear that I'm going to +slap you with a lawsuit. This does not include most of the +images; I try to link credit where I can for those.

+

A lot of people might prefer a BSD or GNU style license for their +code and I agree that there are many cases where that is the +preferred option. But it doesn't make sense for me; at least not for a +homepage like this. I'm not sure about other people, but most of my +ideas are not my own; they come from reading a history book or doing a +textbook exercise or an off-color joke. So without getting on a soapbox, +I guess you can say the idea of "intellectual property" never made too +much sense to me in general.

+

I get that people have to get paid. I get that people are afraid of +someone else taking credit for their work. But for this site at least, I +guess I just don't really care. If someone really finds some way to +profit of some random guy's Linux tutorials and unqualified thoughts on +the world I honestly think they deserve the credit not me. I +have no idea how I'd do that; I'm not sure I'd even want to waste my +time with all the marketing nonsense of the modern web. And on the +second point, if someone "steals" my work it's not exactly hard to +figure out it was published here first--a Google search will prove that. +But even if that weren't the case, I still wouldn't mind. I'd be glad +that this stuff is useful at all. That would be a nice surprise.

+

Not everything that is linked to on this site falls +under the same guidelines, so be sure to respect that author's +copyright; I tend to link stuff that is generally pretty free to use, +though.

diff --git a/about/howami.html b/about/howami.html index 978c92c..1ae967f 100644 --- a/about/howami.html +++ b/about/howami.html @@ -6,12 +6,153 @@ howami diff --git a/about/whatami.html b/about/whatami.html index 15551ee..30002bf 100644 --- a/about/whatami.html +++ b/about/whatami.html @@ -6,16 +6,162 @@ whatami

In case of alien transmission...

-

It should be noted for the record I'm a human (homo sapiens sapiens), which by most estimates puts me firmly in the category of water-like object at ~60% of my total body mass, with the remaining matter compromised of various arrangements of carbon, oxygen, and potato chips.

+

It should be noted for the record I'm a human (homo sapiens +sapiens), which by most estimates puts +me firmly in the category of water-like object at ~60% of my +total body mass, with the remaining matter compromised of various +arrangements of carbon, oxygen, and potato chips.

diff --git a/about/whereami.html b/about/whereami.html index 766d72d..2ea1558 100644 --- a/about/whereami.html +++ b/about/whereami.html @@ -6,39 +6,238 @@ whereami
-

But I have to say this in defense of humankind: In no matter what era in history, including the Garden of Eden, everybody just got here. And, except for the Garden of Eden, there were already all these games going on that could make you act crazy, even if you weren't crazy to begin with. Some of the crazymaking games going on today are love and hate, liberalism and conservatism, automobiles and credit cards, golf, and girls' basketball.

+

But I have to say this in defense of humankind: In no matter what era +in history, including the Garden of Eden, everybody just got +here. And, except for the Garden of Eden, there were already +all these games going on that could make you act crazy, even if you +weren't crazy to begin with. Some of the crazymaking games going on +today are love and hate, liberalism and conservatism, automobiles and +credit cards, golf, and girls' basketball.

-- Kurt Vonnegut, from A man without a country, emphasis my own
-

Since you are on this page, you're presumably lost. That's ok. I don't really get all this stuff either. Let's start with some easy stuff.

-

You're on the Internet. Known to some as a series of tubes, but in reality much more complicated than it has to be. In basic sense, your computer called mine, and mine answered with directory full of pages.

-

The way you get here is through a device you have at home called a 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 spend their time plugging cables into and out of ports so calls could connect.

+

Since you are on this page, you're presumably lost. That's +ok. I don't really get all this stuff either. Let's start with +some easy stuff.

+

You're on the Internet. Known to some as a series of +tubes, but in reality much more complicated than it has to be. In +basic sense, your computer called mine, and mine answered with directory +full of pages.

+

The way you get here is through a device you have at home called a +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 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 for us. Internet companies, governments, and anyone else with enough money and influence bought huge routers and hooked them all up to talk to each other. Then they convinced us all to go out and buy a router from our ISP of "choice" so we could all send cat pictures to each other seamlessly. We got rid of phones, replaced our phone with our IP address and email, just to ironically end up back at phones again. All of our devices serve, or at least can serve, as a router in some way, and all these little robots talking to each other makes it so you can get lost on some person's home page.

-

In a way, you could say you've made it to a place my router took you to. Not my home router of course--that one sucks.

-

I'm mooching of someone else's, also known as a Virtual Private Server. These companies run whole bunch of servers, hook them up on a bulk connection and rent them out for people to run blogs about cats and porn sites.

-

I'm getting lost on your question though, so where are we exactly?

-

Precisely speaking, you are in a chrooted web server running on rented virtual machine in a server farm located roughly in New Jersey browsing the "about" directory on the "whereami.html" page.

-

Less precisely, all that means is you're looking at some files I left in a directory at this address, and paid some people to host for me since local ISPs tend to be ridiculously expensive if you want to do anything besides host some private servers for you and your friends and family.

-

But maybe most importantly, you've reached a webpage owned by another human being, not a corporation, or a bot, or a government, or work, or a network. All these files were loving crafted by yours truly in vim, in markdown and converted with pandoc to HTML because of laziness. The Internet I grew up with, though I didn't really appreciate it at the time, used to be filled with places like this. "Homepages" were a thing, or were just starting to be at least.

-

But as soon as it started it all got sucked up and commodified into social media; we somehow got coerced into profiles, templates, and standards to make us easier for ad companies to study. It's not even unreasonable to believe you're not even talking to real people on there, because there's a good chance of it now. Astroturfing is not a secret government conspiracy, it's just business as usual at this point. You used to be able to tell a human from a chatbot from the way they write. I don't know if the bots at this point are smarter, or if we've just been made so cynical and dumb by the process that we've given up.

+

Image of a switchboard courtesy of Wikipedia +contributors

+

Fortunately, we figured out that was dumb and made robots do the job +for us. Internet companies, governments, and anyone else with enough +money and influence bought huge routers and hooked them all up to talk +to each other. Then they convinced us all to go out and buy a router +from our ISP of "choice" so we could all send cat pictures to each other +seamlessly. We got rid of phones, replaced our phone with our IP address +and email, just to ironically end up back at phones again. All of our +devices serve, or at least can serve, as a router in some way, and all +these little robots talking to each other makes it so you can get lost +on some person's home page.

+

In a way, you could say you've made it to a place my router took you +to. Not my home router of course--that one sucks.

+

I'm mooching of someone else's, also known as a Virtual Private +Server. These companies run whole bunch of servers, hook them up on a +bulk connection and rent them out for people to run blogs about cats and +porn sites.

+

I'm getting lost on your question though, so where are we +exactly?

+

Precisely speaking, you are in a chrooted web server running on +rented virtual machine in a server farm located roughly in New Jersey +browsing the "about" directory on the "whereami.html" page.

+

Less precisely, all that means is you're looking at some files I left +in a directory at this address, and paid some people to host for me +since local ISPs tend to be ridiculously expensive if you want to do +anything besides host some private servers for you and your friends and +family.

+

But maybe most importantly, you've reached a webpage owned by another +human being, not a corporation, or a bot, or a government, or work, or a +network. All these files were loving crafted by yours truly in +vim, in markdown and converted with pandoc to HTML because of laziness. +The Internet I grew up with, though I didn't really appreciate it at the +time, used to be filled with places like this. "Homepages" were a thing, +or were just starting to be at least.

+

But as soon as it started it all got sucked up and commodified into +social media; we somehow got coerced into profiles, templates, and +standards to make us easier for ad companies to study. It's not even +unreasonable to believe you're not even talking to real people on there, +because there's a good chance of it now. Astroturfing is +not a secret government conspiracy, it's just business as usual at this +point. You used to be able to tell a human from a chatbot from the way +they write. I don't know if the bots at this point are smarter, or if +we've just been made so cynical and dumb by the process that we've given +up.

Who would really write all that garbage on Facebook anyway?

-

Don't mistake this for some pity nostalgia piece though. If you look hard enough--I promise you--that Internet of humans is still there. Here's a few places I like to poke around:

+

Don't mistake this for some pity nostalgia piece though. If you look +hard enough--I promise you--that Internet of humans is still +there. Here's a few places I like to poke around:

https://neocities.org/

https://1mb.club/

https://goodsites.tech/

and old not-so faithful:

https://www.wikipedia.org/

-

A helpful tip, CRTL+W will close any webpage you don't like. Not that you wouldn't like this page... you did read all the way here through all that pedantry didn't you?

+

A helpful tip, CRTL+W will close any webpage you don't like. Not that +you wouldn't like this page... you did read all the way here through all +that pedantry didn't you?

diff --git a/about/whoami.html b/about/whoami.html index 5431c1d..8e0ac63 100644 --- a/about/whoami.html +++ b/about/whoami.html @@ -6,12 +6,153 @@ whoami @@ -19,16 +160,43 @@

Quotation is a serviceable substitute for wit.

-- apparently no one -

TL;DR Above everything, I'm a lurker. And I mean that in the traditional forum/mailing list sense. You could put it a few ways and still be right: a reader, a people watcher, a listener, maybe a coward if you're cynical. But all in all, not anyone in particular really.

-

When I first came up with a writing a page with this title, it devolved into a kind of personal essay. The kind of unwelcome nonsense you no doubt encounter (and I no doubt supplied) in comment sections on the Internet or the paginated newsfeeds written by faceless names or in the rambling profiles that start with birth and forget where they're going around college. It seems to come easy to a lot of us.

+

TL;DR Above everything, I'm a lurker. And I mean that in the +traditional forum/mailing list sense. You could put it a few ways and +still be right: a reader, a people watcher, a listener, maybe a coward +if you're cynical. But all in all, not anyone in particular +really.

+

When I first came up with a writing a page with this title, it +devolved into a kind of personal essay. The kind of unwelcome nonsense +you no doubt encounter (and I no doubt supplied) in comment sections on +the Internet or the paginated newsfeeds written by faceless names or in +the rambling profiles that start with birth and forget where they're +going around college. It seems to come easy to a lot of us.

Now, I'm not so sure I've earned the right yet.

-

I'd rather just let my work (and my play) stand for itself, for whatever it's worth. You'll get it as you go I'm sure. That said, there are some things that probably help for context's sake:

+

I'd rather just let my work (and my play) stand for itself, for +whatever it's worth. You'll get it as you go I'm sure. That said, there +are some things that probably help for context's sake:

Here is as close to home as I'll get for now.

diff --git a/about/whyami.html b/about/whyami.html index e181213..954b926 100644 --- a/about/whyami.html +++ b/about/whyami.html @@ -6,17 +6,159 @@ whyami
-

We are here on Earth to fart around. Don't let anybody tell you any different.

+

We are here on Earth to fart around. Don't let anybody tell you any +different.

-- Kurt Vonnegut, from A man without a country.
diff --git a/thoughts/syntax/my-worst-habit.html b/thoughts/syntax/my-worst-habit.html index 05a7cb4..65f19d8 100644 --- a/thoughts/syntax/my-worst-habit.html +++ b/thoughts/syntax/my-worst-habit.html @@ -6,18 +6,169 @@ my-worst-habit

Overuse of parentheses, by far.

-

Why is this a bad thing? Parentheses, as read by most readers, tend to contain additional superfluous information when read. So naturally, the mind tends to pay less attention to what's inside (or at least my mind does). I also believe it represents some repressed psychological trauma, since a Professor once circled how many times I abused the double dash, "--", and I haven't quite felt comfortable using it since--unless it feels right. As a result, I've found a new punctuation mark to abuse.

-

The parentheses and double dash work all right in that last paragraph, but relying on it leads to bad habits, and usually, sentences that droll on for far longer than welcome. Consider the following example from Naked Lunch:

+

Why is this a bad thing? Parentheses, as read by most readers, tend +to contain additional superfluous information when read. So +naturally, the mind tends to pay less attention to what's inside (or at +least my mind does). I also believe it represents some repressed +psychological trauma, since a Professor once circled how many times I +abused the double dash, "--", and I haven't quite felt comfortable using +it since--unless it feels right. As a result, I've found a new +punctuation mark to abuse.

+

The parentheses and double dash work all right in that last +paragraph, but relying on it leads to bad habits, and usually, sentences +that droll on for far longer than welcome. Consider the following +example from Naked Lunch:

Doc Browbeck was party inna second part. A retired abortionist and junk
 pusher (he was a veterinarian actually) recalled to service during the
 manpower shortage. Well, Doc had been in the hospital kitchen all
@@ -42,12 +193,22 @@ family in use among the Indians of South America. They are usually
 administered by sniffing a dried powder of the plant. The medicine
 men take these noxious substances and go into convulsive states. Their
 twitchings and mutterings are thought to have prophetic significance.")
-

This is the only example I know that dares to put parentheses and a long quote within parentheses, unless we're counting math textbooks. In a way it works, since if information is ever superfluous, the history of sailors getting high on nutmeg fits that bill. A careful reader might easily pick up on that, but to everyone else, I think a full paragraph of text in parentheses signals the reader to scroll down in the hopes that the story continues.

-

But just in case you think I'm just picking on William S. Burroughs, here's an example I regrettably wrote to a coworker recently with some details removed:

+

This is the only example I know that dares to put parentheses +and a long quote within parentheses, unless we're counting math +textbooks. In a way it works, since if information is ever +superfluous, the history of sailors getting high on nutmeg fits +that bill. A careful reader might easily pick up on that, but to +everyone else, I think a full paragraph of text in parentheses signals +the reader to scroll down in the hopes that the story continues.

+

But just in case you think I'm just picking on William S. Burroughs, +here's an example I regrettably wrote to a coworker recently with some +details removed:

[...] As a precaution, I did review $NOBODY's recent
 $THING_I_WAS_ASKED_TO_REVIEW (if you would like a detailed report on
 that, I can pull that together for you).
-

Somehow, I managed to take the one point worth emphasizing (an entire sentence at that!) and de-emphasized it.

-

It's a habit I can't break. So please, if you are a caring reader, do complain when I overuse parentheses. I deserve it.

+

Somehow, I managed to take the one point worth emphasizing +(an entire sentence at that!) and de-emphasized it.

+

It's a habit I can't break. So please, if you are a caring reader, do +complain when I overuse parentheses. I deserve it.

diff --git a/thoughts/syntax/random-python-idiosyncrasies.html b/thoughts/syntax/random-python-idiosyncrasies.html index fd2336d..dc67e4d 100644 --- a/thoughts/syntax/random-python-idiosyncrasies.html +++ b/thoughts/syntax/random-python-idiosyncrasies.html @@ -6,6 +6,146 @@ random-python-idiosyncrasies @@ -82,78 +224,128 @@

Coding Style Guide

The purpose of this document is twofold:

    -
  1. To ensure that anyone who might like to make my code better understands why I write python the way I do
  2. -
  3. To ensure I adhere to my own style because I'm terribly inconsistent
  4. +
  5. To ensure that anyone who might like to make my code better +understands why I write python the way I do
  6. +
  7. To ensure I adhere to my own style because I'm terribly +inconsistent
-

Being terribly inconsistent, the guidelines are not set in stone and if you have a good argument for doing things a particular, I don't really care.

-

BUT first and foremost, code must comply with PEP8 first. This is easy to automate. I like black since it's easy to use but there' plenty of advanced linters out there.

-

I usually invoke it like this to turn off forcing double quotes and force the line length to 72:

-
black -S -l 72 file.py
+

Being terribly inconsistent, the guidelines are not set in stone and +if you have a good argument for doing things a particular, I don't +really care.

+

BUT first and foremost, code must comply with PEP8 +first. This is easy to automate. I like black since it's easy to use +but there' plenty of advanced linters out there.

+

I usually invoke it like this to turn off forcing double quotes and +force the line length to 72:

+
black -S -l 72 file.py

That aside, I have the following idiosyncracies:

-

1) Strings are double-quoted. Keys and chars are single-quoted.

-

This is really just because I like how C does it. And Cpython's C-based so why not?

+

1) +Strings are double-quoted. Keys and +chars are single-quoted.

+

This is really just because I like how C does it. And Cpython's +C-based so why not?

Like so:

-
string = "This is a phrase"
-word = "word"
-cur_char = 'a'
-newline = '\n' # note, two characters, but it's still ONE char out
-# keys are single-quoted to avoid confusion
-dictionary = { 'key'  "1245dqw3w431", 'return': newline }
-

The only exception is for strings with quotes in them (anything to avoid escapes, really)

-
quoted_string = (
-    '"You miss 100% of the shots you don't take - Wayne Gretsky"'
-    ' - Michael Scott'
-)
+
string = "This is a phrase"
+word = "word"
+cur_char = 'a'
+newline = '\n' # note, two characters, but it's still ONE char out
+# keys are single-quoted to avoid confusion
+dictionary = { 'key'  "1245dqw3w431", 'return': newline }
+

The only exception is for strings with quotes in them (anything to +avoid escapes, really)

+
quoted_string = (
+    '"You miss 100% of the shots you don't take - Wayne Gretsky"'
+    ' - Michael Scott'
+)

That brings me to my next point.

-

2) Long strings belong in parentheses

+

2) Long strings belong in +parentheses

As in:

-
longboi = (
-    "This is a really long string usefull when making help menus. Be\n"
-    "sure to leave s space at the end of each line, or add a new line\n"
-    "when needed.\n\n"
-
-    "Try your best to keep formatting accurate like this."
-)
-

3) Tabs are four spaces and spaces are ALWAYS preferred to tabs

+
longboi = (
+    "This is a really long string usefull when making help menus. Be\n"
+    "sure to leave s space at the end of each line, or add a new line\n"
+    "when needed.\n\n"
+
+    "Try your best to keep formatting accurate like this."
+)
+

3) +Tabs are four spaces and spaces are ALWAYS preferred to +tabs

Again, see PEP8.

-

4) Always add spaces between arithmetic, but never for brackets

+

4) +Always add spaces between arithmetic, but never for brackets

It's a pain to read:

-
1/(2*sqrt(pi))*exp(x**2)
+
1/(2*sqrt(pi))*exp(x**2)

Do this

-
1 / (2 * sqrt(pi)) * exp(x ** 2)
+
1 / (2 * sqrt(pi)) * exp(x ** 2)

The same goes for logic operators

-
true & false ^ true
-

5) EVERYTHING should be snake_case

-

This is python. Unless there's a compatibility thing (like a library's code was written that way, or it matches an API variable), snake_case is preferred.

-
user_input = int(input()) # variable
-MAX_INPUT = 1000 # constant
-def judge_input(_input, _max): # function
-    if _max > _input:
-        print("Too big!")
-
-judge_input(user_input, MAX_INPUT
-class Input_Judger: # a class
-    # etc etc
+
true & false ^ true
+

5) EVERYTHING should be +snake_case

+

This is python. Unless there's a compatibility thing (like a +library's code was written that way, or it matches an API variable), +snake_case is preferred.

+
user_input = int(input()) # variable
+MAX_INPUT = 1000 # constant
+def judge_input(_input, _max): # function
+    if _max > _input:
+        print("Too big!")
+
+judge_input(user_input, MAX_INPUT
+class Input_Judger: # a class
+    # etc etc

Example exception:

-
# this doesn't actually work, but you get the idea
-r = requests.get("www.debian.org")
-pageSize = r.json()['pageSize'] # camel case ok
-

6) If it's over 100 lines, you probably need a new file (and a class)

-

This is more of a general coding thing, but I've encountered so many 1000 line monster out there, I need to reiterate it. I understand how these things come to be, having made a few myself in the beginning. You get an idea and want to see it through in full. Like On the Road it comes out as a scroll Merlin himself would be proud of.

-

But coming back to the scroll in a week half-drunk and half-tired is not a situation you want to be caught in. You can always import any python code you write with a simple:

-
import filename
+
# this doesn't actually work, but you get the idea
+r = requests.get("www.debian.org")
+pageSize = r.json()['pageSize'] # camel case ok
+

6) +If it's over 100 lines, you probably need a new file (and a class)

+

This is more of a general coding thing, but I've encountered so many +1000 line monster out there, I need to reiterate it. I understand how +these things come to be, having made a few myself in the beginning. You +get an idea and want to see it through in full. Like On the +Road it comes out as a scroll Merlin himself would be proud of.

+

But coming back to the scroll in a week half-drunk and half-tired is +not a situation you want to be caught in. You can always import +any python code you write with a simple:

+
import filename

As long as it's in the same directory.

diff --git a/tutorials/tor/how-to-host-a-tor-hidden-service.html b/tutorials/tor/how-to-host-a-tor-hidden-service.html index 43b6364..79a4e2e 100644 --- a/tutorials/tor/how-to-host-a-tor-hidden-service.html +++ b/tutorials/tor/how-to-host-a-tor-hidden-service.html @@ -6,62 +6,241 @@ how-to-host-a-tor-hidden-service -

This might sound spooky and complicated, but it's really not. If you want to host a small site or a small file share among friends, I honestly think Tor is one of the easiest and safest options to set up.

-

Getting a Tor hidden service running is so stupidly easy that it hardly deserves it's own article. Tor's website has a great guide right here. I figured I'd put my own spin on it by showing you show to host a temporary server to share some files with your friends. Please note the word temporary in that last sentence; running this way for a while is insecure and not a good idea. For a permanent solution, you'll want to host a real web server as explained here.

-

Like that article, I will only explain how to do this on Linux since it's way easier and, to be honest, I've never tried to do it on Windows. If you've never used Linux before, buy a Raspberry Pi and follow the basic install guide. If you're strapped for cash, run it in a virtual machine, or use Windows Subsystem for Linux.

-

How to spin up a temporary hidden file share with Python

-

Once you have Debian/Ubuntu/whatever installed and it's updated to your liking, you can install Tor with:

+

This might sound spooky and complicated, but it's really not. If you +want to host a small site or a small file share among friends, I +honestly think Tor is one of the easiest and safest options to set +up.

+

Getting a Tor hidden service running is so stupidly easy that it +hardly deserves it's own article. Tor's website has a great guide right +here. +I figured I'd put my own spin on it by showing you show to host a +temporary server to share some files with your friends. Please note the +word temporary in that last sentence; running this way for a +while is insecure and not a good idea. For a permanent solution, you'll +want to host a real web server as explained here.

+

Like that article, I will only explain how to do this on Linux since +it's way easier and, to be honest, I've never tried to do it on Windows. +If you've never used Linux before, buy a Raspberry Pi and follow the +basic install guide. If you're strapped for cash, run it in a virtual +machine, or use Windows +Subsystem for Linux.

+

How to +spin up a temporary hidden file share with Python

+

Once you have Debian/Ubuntu/whatever installed and it's updated to +your liking, you can install Tor with:

$ sudo apt install tor

Start (or stop) Tor with:

$ sudo service tor start

or

$ sudo systemctl start tor.service
-

You may need to enable the service first. I think this is done by default now, but it doesn't hurt:

+

You may need to enable the service first. I think this is done by +default now, but it doesn't hurt:

$ sudo systemctl enable tor.service

Configure Tor

-

You'll need to edit the file "/etc/tor/torrc" before your service can be available over Tor. Use vim, nano, or whatever you like to edit the file (as root!) and search for the following lines:

+

You'll need to edit the file "/etc/tor/torrc" before your service can +be available over Tor. Use vim, nano, or whatever you like to edit the +file (as root!) and search for the following lines:

#HiddenServiceDir /var/lib/tor/hidden_service/
 #HiddenServicePort 80 127.0.0.1:80
-

Remove the '#' at the beginning of each and change the port to 8000 like so:

+

Remove the '#' at the beginning of each and change the port to 8000 +like so:

HiddenServiceDir /var/lib/tor/hidden_service/
 HiddenServicePort 80 127.0.0.1:8000

Save and restart Tor for the changes to apply:

$ sudo service tor restart
-

Once you do this, you'll get a new onion address located in the directory noted above. Use cat to read the hostname file and copy it down somewhere. This is your ".onion" address:

+

Once you do this, you'll get a new onion address located in the +directory noted above. Use cat to read the hostname file and copy it +down somewhere. This is your ".onion" address:

$ cat /var/lib/tor/hidden_service/hostname

Set up the server

Make some directory to hold your files.

$ mkdir -pv ~/files

If you're on WSL you can copy files from your C drive like so:

$ cp -vr /mnt/c/Users/username/Desktop/cats ~/files/
-

On a remote server (like a Raspberry pi) you can use scp instead (replace 'rapsberry' with the hostname or local IP of you Pi):

+

On a remote server (like a Raspberry pi) you can use scp instead +(replace 'rapsberry' with the hostname or local IP of you Pi):

$ scp -vr cats pi@raspberry:~/files/
-

Since we're only doing this temporarily, we don't care too much about security or where the files should go, but if you want to be careful, you can issue the following to set the directory to read only after you copy your files in:

+

Since we're only doing this temporarily, we don't care too much about +security or where the files should go, but if you want to be careful, +you can issue the following to set the directory to read only after you +copy your files in:

$ chmod -R 644 files

Change into the directory and run Python's built-in http server:

$ cd files
 $ python3 -m http.server
-

You'll see the server is being hosted on port 8000, which is what we chose in the config file earlier. Just leave it running, or send it to the background with Ctrl+Z and run "bg".

-

And that's it! You are now the proud owner of a tor hidden service. Take the hostname you copied down before and add ".onion" to the end and give it to your friends so they can browse the files in the directory through the Tor Browser.

-

Be sure to watch the program log though... lest they get up to no good.

+

You'll see the server is being hosted on port 8000, which is what we +chose in the config file earlier. Just leave it running, or send it to +the background with Ctrl+Z and run "bg".

+

And that's it! You are now the proud owner of a tor hidden service. +Take the hostname you copied down before and add ".onion" to the end and +give it to your friends so they can browse the files in the directory +through the Tor Browser.

+

Be sure to watch the program log though... lest they get up to no +good.

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 075d777..17f8c84 100644 --- a/tutorials/vim/how-to-fix-neovim-nerdtree-rendering-issue.html +++ b/tutorials/vim/how-to-fix-neovim-nerdtree-rendering-issue.html @@ -6,6 +6,146 @@ how-to-fix-neovim-nerdtree-rendering-issue @@ -85,22 +227,40 @@
  • The Actual Solution
  • -

    I really like neovim since COC is integrated with it to work nicely. Plus, I like the defaults and the fact there's a lot 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.

    +

    I really like neovim since COC is integrated with +it to work nicely. Plus, I like the defaults and the fact there's a lot +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.

    +

    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.

    +

    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 following line to your init.vim file:

    +

    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 +following line to your init.vim file:

    au WinScrolled * redraw!
    -

    As it turns out, the "WinScrolled" event only exists in neovim, so this command won't work in plain vim (see :help autocmd-events for the list of events in each program).

    +

    As it turns out, the "WinScrolled" event only exists in +neovim, so this command won't work in plain vim (see +:help autocmd-events for the list of events in each +program).

    The Actual Solution

    -

    After installing COC and running a healthcheck, I realized that my 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'
    +

    After installing COC and running a healthcheck, I realized that my +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....

    +

    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-make-this-site.html b/tutorials/www/how-to-make-this-site.html index c3290e9..2fcc26f 100644 --- a/tutorials/www/how-to-make-this-site.html +++ b/tutorials/www/how-to-make-this-site.html @@ -6,12 +6,153 @@ how-to-make-this-site @@ -19,21 +160,29 @@

    Contents