diff options
28 files changed, 558 insertions, 14 deletions
diff --git a/.md/fun/.description b/.md/fun/.description new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.md/fun/.description diff --git a/.md/thoughts/.description b/.md/thoughts/.description new file mode 100644 index 0000000..16f9528 --- /dev/null +++ b/.md/thoughts/.description @@ -0,0 +1 @@ +Things I am less qualified to write about, but persist nonetheless. diff --git a/.md/thoughts/net/.description b/.md/thoughts/net/.description new file mode 100644 index 0000000..793a3e0 --- /dev/null +++ b/.md/thoughts/net/.description @@ -0,0 +1 @@ +Serious business diff --git a/.md/thoughts/net/the-web30-people-kinda-scare-me-a-little.md b/.md/thoughts/net/the-web30-people-kinda-scare-me-a-little.md new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.md/thoughts/net/the-web30-people-kinda-scare-me-a-little.md diff --git a/.md/thoughts/society/.description b/.md/thoughts/society/.description new file mode 100644 index 0000000..10ce4fb --- /dev/null +++ b/.md/thoughts/society/.description @@ -0,0 +1 @@ +We live in one diff --git a/.md/thoughts/society/as-a-conservatively-liberal-fascist-anarchist.md b/.md/thoughts/society/as-a-conservatively-liberal-fascist-anarchist.md new file mode 100644 index 0000000..3749b95 --- /dev/null +++ b/.md/thoughts/society/as-a-conservatively-liberal-fascist-anarchist.md @@ -0,0 +1,18 @@ +*As better articulated +[here](https://edgeryders.eu/uploads/short-url/hZV8OTRoPrt6JO6KfePZBxVeWgZ.pdf)* + + +## Liberals and Conservatives + +### Liberals + +### Conservatives + +## Anarchists and Fascists + +### Anarchists + +### Fascists + +Even worse the never-ending sects of sects of the modern left is +the empty category of fascism, which even Orwell in 195X bemoaned:
\ No newline at end of file diff --git a/.md/thoughts/society/history/.description b/.md/thoughts/society/history/.description new file mode 100644 index 0000000..670ab01 --- /dev/null +++ b/.md/thoughts/society/history/.description @@ -0,0 +1,7 @@ +The only way forward is through -- *Nick Land* + +<small> +Because someone will complain and nuance is dead: I do not endorse +his viewpoints or schizobabble, but I do find his writing interesting +from a historical standpoint +</small> diff --git a/.md/thoughts/society/im-not-really-sure-i-want-everything-to-be-a-game.md b/.md/thoughts/society/im-not-really-sure-i-want-everything-to-be-a-game.md new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.md/thoughts/society/im-not-really-sure-i-want-everything-to-be-a-game.md diff --git a/.md/thoughts/society/techbros-scifi-and-the-world-controllers.md b/.md/thoughts/society/techbros-scifi-and-the-world-controllers.md new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.md/thoughts/society/techbros-scifi-and-the-world-controllers.md diff --git a/.md/thoughts/syntax/.description b/.md/thoughts/syntax/.description new file mode 100644 index 0000000..425358c --- /dev/null +++ b/.md/thoughts/syntax/.description @@ -0,0 +1 @@ +Language on languages diff --git a/.md/thoughts/syntax/my-worst-habit.md b/.md/thoughts/syntax/my-worst-habit.md new file mode 100644 index 0000000..2f760e1 --- /dev/null +++ b/.md/thoughts/syntax/my-worst-habit.md @@ -0,0 +1,56 @@ +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. + +The punctuation works in that last example, 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 +morning goosing the nurses and tanking up on coal gas and Klim -- and +just before the operation he sneaked a double shot of nutmeg to nerve +himself up. + +(In England and especially in Edinburgh the citizens bubble coal gas +through Klim -- a horrible form of powdered milk tasting like rancid +chalk -- and pick up on the results. They hock everything to pay the +gas bill, and when the man comes around to shut it off for the +non-payment, you can hear their screams for miles. When a citizen is +sick from needing it he says "I got the klinks" or "That old stove +climbing up my back." + +Nutmeg. I quote from the author's article on narcotic drugs in the +British Journal of Addiction (see Appendix): "Convicts and sailors +sometimes have recourse to nutmeg. About a tablespoon is swallowed +with water. Result vaguely similar to marijuana with side effects of +headache and nausea. There are a number of narcotics of the nutmeg +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 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. An academic 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 ... recently: + +... + +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/.md/thoughts/syntax/random-python-idiosyncrasies.md b/.md/thoughts/syntax/random-python-idiosyncrasies.md new file mode 100644 index 0000000..be3f1f8 --- /dev/null +++ b/.md/thoughts/syntax/random-python-idiosyncrasies.md @@ -0,0 +1,107 @@ +# 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) 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 coala since it's friendly but there' plenty of advanced +linters out there. + +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? + +Like so: + +```code +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) + +```code +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 + +As in: +```code +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* prefered to tabs + +Again, see PEP8. + +## 4) Always add spaces between arithmetic, but never for brackets + +It's a pain to read: + +```code +1/(2*sqrt(pi))*exp(x**2) +``` + +Do this + +```code +1 / (2 * sqrt(pi)) * exp(x ** 2) +``` + +The same goes for logic operators + +```code +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. + +```code +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: + +```code +# this doesn't actually work, but you get the idea +r = requests.get("www.debian.org") +pageSize = r.json()['pageSize'] # camel case ok +``` + diff --git a/.md/tutorials/tor/how-to-host-a-tor-hidden-service.md b/.md/tutorials/tor/how-to-host-a-tor-hidden-service.md index 2446cf2..a6f7e4e 100644 --- a/.md/tutorials/tor/how-to-host-a-tor-hidden-service.md +++ b/.md/tutorials/tor/how-to-host-a-tor-hidden-service.md @@ -10,7 +10,7 @@ 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](/site/tutorials/www/how-to-make-this-site.html). +[here](/tutorials/www/how-to-make-this-site.html). 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. diff --git a/.md/tutorials/www/how-to-make-this-site.md b/.md/tutorials/www/how-to-make-this-site.md index 2cf8a80..d62e47c 100644 --- a/.md/tutorials/www/how-to-make-this-site.md +++ b/.md/tutorials/www/how-to-make-this-site.md @@ -198,7 +198,7 @@ Now get your *public* ip address at this site https://who.is/ and share it with your friends. Watch in horror as they access all the files in the directory you launched the server! -## How can make this server available on the Internet *cheaply* and *independently* +## How can I make this server available on the Internet *cheaply* and *independently* <i> TL;DR Expense scales with independence. It's possible to become your own service provider, get IP addresses from ICANN, your own hardware to host @@ -225,7 +225,7 @@ template language to render it automatically. But if your content is short and sweet, or you're mostly hosting files, writing a few basic HTML files in vim or notepad and adding some CSS goes a long way. I wrote my own view of the topic in the context of how I wrote this site -[here](/site/tutorials/www/quick-intro-to-html-css.html). And you can +[here](/tutorials/www/quick-intro-to-html-css.html). And you can find a number of great guides on how to write files, copy them and manage them in the [references](#references). @@ -266,7 +266,7 @@ But once you have stuff to share, how do you keep this stuff online? Technically yes, but practically probably not. At least not at a lot of extra cost to you. If you do want to host a small thing at home, like some text or some cat pics, a -[tor hidden service](/site/tutorials/tor/how-to-host-a-tor-hidden-service.html) +[tor hidden service](/tutorials/tor/how-to-host-a-tor-hidden-service.html) is a great option. I spent a lot of time searching on this (you can find a full list of diff --git a/about/faq.html b/about/faq.html index 1bab7e9..d9803f7 100644 --- a/about/faq.html +++ b/about/faq.html @@ -1,3 +1,38 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> +<head> + <meta charset="utf-8" /> + <meta name="generator" content="pandoc" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> + <title>faq</title> + <style> + code{white-space: pre-wrap;} + span.smallcaps{font-variant: small-caps;} + span.underline{text-decoration: underline;} + div.column{display: inline-block; vertical-align: top; width: 50%;} + div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} + ul.task-list{list-style: none;} + </style> +</head> +<body> +<nav id="TOC" role="doc-toc"> +<h2 id="toc-title">Contents</h2> +<ul> +<li><a href="#frequently-anticipated-questions">Frequently Anticipated Questions</a> +<ul> +<li><a href="#questions-noone-asked-but-could-maybe">Questions noone asked, but could maybe</a> +<ul> +<li><a href="#why-bother-running-a-tor-hidden-service-if-youre-gonna-put-your-full-name-on-it"><em>Why bother running a Tor hidden service if you're gonna put your full name on it?</em></a></li> +<li><a href="#you-wrote-all-this-in-vim-why-tho"><em>You wrote all this in vim? Why tho?</em></a></li> +<li><a href="#why-openbsd"><em>Why OpenBSD?</em></a></li> +<li><a href="#why-bother-making-your-site-from-scratch-it-looks-like-crap"><em>Why bother making your site from scratch? It looks like crap</em></a></li> +<li><a href="#why-does-your-rss-feed-update-me-on-old-stuff"><em>Why does your RSS feed update me on old stuff?</em></a></li> +<li><a href="#why-is-this-site-public-domain-what-does-that-mean"><em>Why is this site public domain? What does that mean?</em></a></li> +<li><a href="#why-dont-you-highlight-urls-you-dinosaur">Why don't you highlight URLs you dinosaur?</a></li> +</ul></li> +</ul></li> +</ul> +</nav> <h1 id="frequently-anticipated-questions">Frequently Anticipated Questions</h1> <h2 id="questions-noone-asked-but-could-maybe">Questions noone asked, but could maybe</h2> <h3 id="why-bother-running-a-tor-hidden-service-if-youre-gonna-put-your-full-name-on-it"><em>Why bother running a Tor hidden service if you're gonna put your full name on it?</em></h3> @@ -22,3 +57,5 @@ <p><em>Not</em> everything that is <em>linked</em> 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.</p> <h3 id="why-dont-you-highlight-urls-you-dinosaur">Why don't you highlight URLs you dinosaur?</h3> <p>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 <a href="https://www.youtube.com/watch?v=dQw4w9WgXcQ">https://facebook.com/</a>. They will if they see <a href="https://www.youtube.com/watch?v=dQw4w9WgXcQ">totally not a virus</a>. 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.</p> +</body> +</html> diff --git a/about/howami.html b/about/howami.html index bd3e904..978c92c 100644 --- a/about/howami.html +++ b/about/howami.html @@ -1 +1,20 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> +<head> + <meta charset="utf-8" /> + <meta name="generator" content="pandoc" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> + <title>howami</title> + <style> + code{white-space: pre-wrap;} + span.smallcaps{font-variant: small-caps;} + span.underline{text-decoration: underline;} + div.column{display: inline-block; vertical-align: top; width: 50%;} + div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} + ul.task-list{list-style: none;} + </style> +</head> +<body> <p>Doing all right, thanks for asking.</p> +</body> +</html> diff --git a/about/whatami.html b/about/whatami.html index 253513a..15551ee 100644 --- a/about/whatami.html +++ b/about/whatami.html @@ -1,2 +1,21 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> +<head> + <meta charset="utf-8" /> + <meta name="generator" content="pandoc" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> + <title>whatami</title> + <style> + code{white-space: pre-wrap;} + span.smallcaps{font-variant: small-caps;} + span.underline{text-decoration: underline;} + div.column{display: inline-block; vertical-align: top; width: 50%;} + div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} + ul.task-list{list-style: none;} + </style> +</head> +<body> <p>In case of alien transmission...</p> <p>It should be noted for the record I'm a human (<em>homo sapiens sapiens</em>), which by <a href="https://en.wikipedia.org/wiki/Body_water">most estimates</a> puts me firmly in the category of <em>water-like object</em> at ~60% of my total body mass, with the remaining matter compromised of various arrangements of carbon, oxygen, and potato chips.</p> +</body> +</html> diff --git a/about/whereami.html b/about/whereami.html index 67cd391..766d72d 100644 --- a/about/whereami.html +++ b/about/whereami.html @@ -1,3 +1,20 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> +<head> + <meta charset="utf-8" /> + <meta name="generator" content="pandoc" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> + <title>whereami</title> + <style> + code{white-space: pre-wrap;} + span.smallcaps{font-variant: small-caps;} + span.underline{text-decoration: underline;} + div.column{display: inline-block; vertical-align: top; width: 50%;} + div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} + ul.task-list{list-style: none;} + </style> +</head> +<body> <center> <p>But I have to say this in defense of humankind: In no matter what era in history, including the Garden of Eden, <strong>everybody just got here</strong>. 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.</p> -- <em>Kurt Vonnegut, from A man without a country, emphasis my own</em> @@ -23,3 +40,5 @@ <p>and old <a href="https://archive.md/rav1z">not-so</a> faithful:</p> <p>https://www.wikipedia.org/</p> <p>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?</p> +</body> +</html> diff --git a/about/whoami.html b/about/whoami.html index b5fe602..5431c1d 100644 --- a/about/whoami.html +++ b/about/whoami.html @@ -1,3 +1,20 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> +<head> + <meta charset="utf-8" /> + <meta name="generator" content="pandoc" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> + <title>whoami</title> + <style> + code{white-space: pre-wrap;} + span.smallcaps{font-variant: small-caps;} + span.underline{text-decoration: underline;} + div.column{display: inline-block; vertical-align: top; width: 50%;} + div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} + ul.task-list{list-style: none;} + </style> +</head> +<body> <center> <p>Quotation is a serviceable substitute for wit.</p> -- <a href="https://archive.md/7AC79"><em>apparently no one</em></a> @@ -14,3 +31,5 @@ <li><p>I spend a lot of time on the Internet lost. And in the process, sometimes find useful things; though I largely find nonsense, which has it's own value, but it's separate.</p></li> </ul> <p>Here is as close to home as I'll get for now.</p> +</body> +</html> diff --git a/about/whyami.html b/about/whyami.html index a94240c..e181213 100644 --- a/about/whyami.html +++ b/about/whyami.html @@ -1,4 +1,23 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> +<head> + <meta charset="utf-8" /> + <meta name="generator" content="pandoc" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> + <title>whyami</title> + <style> + code{white-space: pre-wrap;} + span.smallcaps{font-variant: small-caps;} + span.underline{text-decoration: underline;} + div.column{display: inline-block; vertical-align: top; width: 50%;} + div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} + ul.task-list{list-style: none;} + </style> +</head> +<body> <center> <p>We are here on Earth to fart around. Don't let anybody tell you any different.</p> -- <em>Kurt Vonnegut, from A man without a country.</em> </center> +</body> +</html> @@ -10,14 +10,14 @@ and organizing myself.</p> <p>If you're looking to connect professionally or for fun, you can check out my resume -<a href="/site/files/RESUME.html" target="_blank" rel="noopener noreferrer">here</a>. +<a href="/files/RESUME.html" target="_blank" rel="noopener noreferrer">here</a>. </p> <p>If you think websites and servers are neat like I do and want to learn the ins and outs of hosting your own, click -<a href="/site/tutorials/www/how-to-make-this-site.html">here</a>. +<a href="/tutorials/www/how-to-make-this-site.html">here</a>. </p> <p>If you're just here by chance and don't know where you are click -<a href="/site/about/whereami.html">here</a>. +<a href="/about/whereami.html">here</a>. </p> <p>Otherwise, check out and explore the folders in the navbar above</p> @@ -31,7 +31,7 @@ learn the ins and outs of hosting your own, click something has gone terribly wrong. Please contact me at <a href="mailto:abuse@mjfer.net">abuse@mjfer.net</a> so I can resolve the problem. If you prefer to encrypt your - email, please use <a href="/site/pgp.txt">this key</a>. + email, please use <a href="/pgp.txt">this key</a>. </b></p> @@ -8,12 +8,14 @@ do then newfile=$(sed "s/\.md\///; s/md/html/" <<< $file) echo "Saved "$file" to "$newfile - pandoc --ascii -f markdown-smart $file -t html -o $newfile + pandoc -s --toc --toc-depth=6 \ + --ascii -V toc-title:"Contents" \ + -f markdown-smart $file -t html -o $newfile fi if [[ "$file" == *.description ]] then newfile=$(sed "s/\.md\///" <<< $file) - cp -v $file $newfile + cp -vf $file $newfile fi done done diff --git a/thoughts/.description b/thoughts/.description new file mode 100644 index 0000000..16f9528 --- /dev/null +++ b/thoughts/.description @@ -0,0 +1 @@ +Things I am less qualified to write about, but persist nonetheless. diff --git a/thoughts/syntax/.description b/thoughts/syntax/.description new file mode 100644 index 0000000..425358c --- /dev/null +++ b/thoughts/syntax/.description @@ -0,0 +1 @@ +Language on languages diff --git a/thoughts/syntax/random-python-idiosyncrasies.html b/thoughts/syntax/random-python-idiosyncrasies.html new file mode 100644 index 0000000..80e4563 --- /dev/null +++ b/thoughts/syntax/random-python-idiosyncrasies.html @@ -0,0 +1,85 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> +<head> + <meta charset="utf-8" /> + <meta name="generator" content="pandoc" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> + <title>random-python-idiosyncrasies</title> + <style> + code{white-space: pre-wrap;} + span.smallcaps{font-variant: small-caps;} + span.underline{text-decoration: underline;} + div.column{display: inline-block; vertical-align: top; width: 50%;} + div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} + ul.task-list{list-style: none;} + </style> +</head> +<body> +<nav id="TOC" role="doc-toc"> +<h2 id="toc-title">Contents</h2> +<ul> +<li><a href="#coding-style-guide">Coding Style Guide</a> +<ul> +<li><a href="#strings-are-double-quoted.-keys-and-chars-are-single-quoted.">1) <em>Strings</em> are <em>double-quoted</em>. <em>Keys</em> and <em>chars</em> are <em>single-quoted</em>.</a></li> +<li><a href="#long-strings-belong-in-parentheses">2) Long strings belong in parentheses</a></li> +<li><a href="#tabs-are-four-spaces-and-spaces-are-always-prefered-to-tabs">3) Tabs are four spaces and spaces are <em>ALWAYS</em> prefered to tabs</a></li> +<li><a href="#always-add-spaces-between-arithmetic-but-never-for-brackets">4) Always add spaces between arithmetic, but never for brackets</a></li> +<li><a href="#everything-should-be-snake_case">5) EVERYTHING should be snake_case</a></li> +</ul></li> +</ul> +</nav> +<h1 id="coding-style-guide">Coding Style Guide</h1> +<p>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) to ensure <em>I</em> adhere to my own style because I'm terribly inconsistent</p> +<p>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.</p> +<p><em>BUT</em> first and foremost, <em>code must comply with PEP8 first</em>. This is easy to automate. I like coala since it's friendly but there' plenty of advanced linters out there.</p> +<p>That aside, I have the following idiosyncracies:</p> +<h2 id="strings-are-double-quoted.-keys-and-chars-are-single-quoted.">1) <em>Strings</em> are <em>double-quoted</em>. <em>Keys</em> and <em>chars</em> are <em>single-quoted</em>.</h2> +<p>This is really just because I like how C does it. And Cpython's C-based so why not?</p> +<p>Like so:</p> +<pre class="code"><code>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 }</code></pre> +<p>The only exception is for strings with quotes in them (anything to avoid escapes, really)</p> +<pre class="code"><code>quoted_string = ( + '"You miss 100% of the shots you don't take - Wayne Gretsky"' + ' - Michael Scott' +)</code></pre> +<p>That brings me to my next point.</p> +<h2 id="long-strings-belong-in-parentheses">2) Long strings belong in parentheses</h2> +<p>As in:</p> +<pre class="code"><code>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." +)</code></pre> +<h2 id="tabs-are-four-spaces-and-spaces-are-always-prefered-to-tabs">3) Tabs are four spaces and spaces are <em>ALWAYS</em> prefered to tabs</h2> +<p>Again, see PEP8.</p> +<h2 id="always-add-spaces-between-arithmetic-but-never-for-brackets">4) Always add spaces between arithmetic, but never for brackets</h2> +<p>It's a pain to read:</p> +<pre class="code"><code>1/(2*sqrt(pi))*exp(x**2)</code></pre> +<p>Do this</p> +<pre class="code"><code>1 / (2 * sqrt(pi)) * exp(x ** 2)</code></pre> +<p>The same goes for logic operators</p> +<pre class="code"><code>true & false ^ true</code></pre> +<h2 id="everything-should-be-snake_case">5) EVERYTHING should be snake_case</h2> +<p>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.</p> +<pre class="code"><code>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</code></pre> +<p>Example exception:</p> +<pre class="code"><code># this doesn't actually work, but you get the idea +r = requests.get("www.debian.org") +pageSize = r.json()['pageSize'] # camel case ok</code></pre> +</body> +</html> 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 794932e..43b6364 100644 --- a/tutorials/tor/how-to-host-a-tor-hidden-service.html +++ b/tutorials/tor/how-to-host-a-tor-hidden-service.html @@ -1,5 +1,32 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> +<head> + <meta charset="utf-8" /> + <meta name="generator" content="pandoc" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> + <title>how-to-host-a-tor-hidden-service</title> + <style> + code{white-space: pre-wrap;} + span.smallcaps{font-variant: small-caps;} + span.underline{text-decoration: underline;} + div.column{display: inline-block; vertical-align: top; width: 50%;} + div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} + ul.task-list{list-style: none;} + </style> +</head> +<body> +<nav id="TOC" role="doc-toc"> +<h2 id="toc-title">Contents</h2> +<ul> +<li><a href="#how-to-spin-up-a-temporary-hidden-file-share-with-python">How to spin up a temporary hidden file share with Python</a> +<ul> +<li><a href="#configure-tor">Configure Tor</a></li> +<li><a href="#set-up-the-server">Set up the server</a></li> +</ul></li> +</ul> +</nav> <p>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.</p> -<p>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 <a href="https://community.torproject.org/onion-services/setup/">here</a>. 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 <em>temporary</em> 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 <a href="/site/tutorials/www/how-to-make-this-site.html">here</a>.</p> +<p>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 <a href="https://community.torproject.org/onion-services/setup/">here</a>. 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 <em>temporary</em> 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 <a href="/tutorials/www/how-to-make-this-site.html">here</a>.</p> <p>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 <a href="https://docs.microsoft.com/en-us/windows/wsl/install">Windows Subsystem for Linux</a>.</p> <h2 id="how-to-spin-up-a-temporary-hidden-file-share-with-python">How to spin up a temporary hidden file share with Python</h2> <p>Once you have Debian/Ubuntu/whatever installed and it's updated to your liking, you can install Tor with:</p> @@ -36,3 +63,5 @@ $ python3 -m http.server</code></pre> <p>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".</p> <p>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.</p> <p>Be sure to watch the program log though... lest they get up to no good.</p> +</body> +</html> diff --git a/tutorials/www/how-to-make-this-site.html b/tutorials/www/how-to-make-this-site.html index f84414e..c3290e9 100644 --- a/tutorials/www/how-to-make-this-site.html +++ b/tutorials/www/how-to-make-this-site.html @@ -1,3 +1,49 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> +<head> + <meta charset="utf-8" /> + <meta name="generator" content="pandoc" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> + <title>how-to-make-this-site</title> + <style> + code{white-space: pre-wrap;} + span.smallcaps{font-variant: small-caps;} + span.underline{text-decoration: underline;} + div.column{display: inline-block; vertical-align: top; width: 50%;} + div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} + ul.task-list{list-style: none;} + </style> +</head> +<body> +<nav id="TOC" role="doc-toc"> +<h2 id="toc-title">Contents</h2> +<ul> +<li><a href="#background">Background</a></li> +<li><a href="#what-is-a-web-server-and-how-do-i-run-one">What is a web server and how do I run one?</a> +<ul> +<li><a href="#getting-from-localhost-to-the-internet">Getting from localhost to the internet</a></li> +</ul></li> +<li><a href="#how-can-i-make-this-server-available-on-the-internet-cheaply-and-independently">How can I make this server available on the Internet <em>cheaply</em> and <em>independently</em></a> +<ul> +<li><a href="#can-i-run-a-web-server-at-home">Can I run a web server at home</a></li> +<li><a href="#so-what-should-i-do">So what should I do</a></li> +</ul></li> +<li><a href="#whats-a-domain-name">What's a "Domain Name"</a></li> +<li><a href="#setup-https-and-tls-for-some-sense-of-security">Setup HTTPS and TLS, for some sense of security</a></li> +<li><a href="#perspective">Perspective</a></li> +<li><a href="#references">References</a> +<ul> +<li><a href="#terms-of-service-for-certain-isps">Terms of service for certain ISPs</a> +<ul> +<li><a href="#verizon">Verizon</a></li> +<li><a href="#optimum">Optimum</a></li> +<li><a href="#spectrum">Spectrum</a></li> +<li><a href="#att">AT&T</a></li> +<li><a href="#cox-communications">Cox Communications</a></li> +</ul></li> +</ul></li> +</ul> +</nav> <h2 id="background">Background</h2> <p><em>TL;DR get to </em><a href="#thepoint">the point</a></p> <p>I think it was roughly the end of high school when I first had the idea I wanted to make <em>some</em> kind of website. This would be around 2010 and I did what I thought would be a good idea and bought a book on the subject: "Web Sites for Dummies." I was dummy after all...</p> @@ -71,14 +117,14 @@ link/ether 82:e2:e4:c2:0c:a1 brd ff:ff:ff:ff:ff:ff permaddr 98:de:d0:f3:d6:ea</code></pre> <p>The device "enp7s0" is my Ethernet adapter (starts with an 'e') and my current local ip address for the device is shown. If you use wifi, it will likely start with a "wl." Set the forwarding rule according to this value.</p> <p>Now get your <em>public</em> ip address at this site https://who.is/ and share it with your friends. Watch in horror as they access all the files in the directory you launched the server!</p> -<h2 id="how-can-make-this-server-available-on-the-internet-cheaply-and-independently">How can make this server available on the Internet <em>cheaply</em> and <em>independently</em></h2> +<h2 id="how-can-i-make-this-server-available-on-the-internet-cheaply-and-independently">How can I make this server available on the Internet <em>cheaply</em> and <em>independently</em></h2> <p><i> TL;DR Expense scales with independence. It's possible to become your own service provider, get IP addresses from ICANN, your own hardware to host it, to host your cat pics; but it's also a lot of time, work and money to do all that (<a href="https://hackaday.com/2018/09/20/one-mans-journey-to-become-his-own-isp/">this guy</a> did it apparently, and so did <a href="https://en.wikipedia.org/wiki/Kiwi_Farms">Null</a>)</p> <p>Most likely you'll want to rent someone else's server, usually a VPS. </i></p> <p>Once you understand the basic installation above, you can now populate your site with content just by adding HTML files to your web directory. You can use an HTML editor to write these, or you can download a full content management system to help you. Here are some options I know about:</p> <ul> <li><strong>You can just write the damn HTML and use apache or nginx</strong></li> </ul> -<p>This honestly is not that hard, it just takes long and takes away from the joy of writing in my opinion. I personally have set up my own little system where I write content in markdown and templates in the Jinja template language to render it automatically. But if your content is short and sweet, or you're mostly hosting files, writing a few basic HTML files in vim or notepad and adding some CSS goes a long way. I wrote my own view of the topic in the context of how I wrote this site <a href="/site/tutorials/www/quick-intro-to-html-css.html">here</a>. And you can find a number of great guides on how to write files, copy them and manage them in the <a href="#references">references</a>.</p> +<p>This honestly is not that hard, it just takes long and takes away from the joy of writing in my opinion. I personally have set up my own little system where I write content in markdown and templates in the Jinja template language to render it automatically. But if your content is short and sweet, or you're mostly hosting files, writing a few basic HTML files in vim or notepad and adding some CSS goes a long way. I wrote my own view of the topic in the context of how I wrote this site <a href="/tutorials/www/quick-intro-to-html-css.html">here</a>. And you can find a number of great guides on how to write files, copy them and manage them in the <a href="#references">references</a>.</p> <p>One easy way to create HTML templates with these servers is through the use of "Server Side Includes," which essentially let you past one html document into another. This varies by server, for example, nginx has their own options and syntax detailed <a href="https://nginx.org/en/docs/http/ngx_http_ssi_module.html">here</a>.</p> <ul> <li><a href="https://neocities.org/"><strong>Neocities</strong></a></li> @@ -96,7 +142,7 @@ <p>In addition to hosting code repositories, you can host small sites on github for mostly free. I've never used it, but I definitely would if I needed something like a small wiki.</p> <p>But once you have stuff to share, how do you keep this stuff online?</p> <h3 id="can-i-run-a-web-server-at-home">Can I run a web server at home</h3> -<p>Technically yes, but practically probably not. At least not at a lot of extra cost to you. If you do want to host a small thing at home, like some text or some cat pics, a <a href="/site/tutorials/tor/how-to-host-a-tor-hidden-service.html">tor hidden service</a> is a great option.</p> +<p>Technically yes, but practically probably not. At least not at a lot of extra cost to you. If you do want to host a small thing at home, like some text or some cat pics, a <a href="/tutorials/tor/how-to-host-a-tor-hidden-service.html">tor hidden service</a> is a great option.</p> <p>I spent a lot of time searching on this (you can find a full list of references at the bottom), and I've even tested a little bit by hosting game servers and web projects for code jams, but the problem is twofold. First, if you are in the United States and not a business, you probably have a standard plan with one of the major ISPs (Verizon, Optimum, etc.). This limits you in a few ways.</p> <ul> <li><p>Your bandwidth is limited, which limits the amount of people you can serve at one time <em>and</em> the rate you can transfer data to them. Think laggy games and videos that take 10 years to download.</p></li> @@ -193,3 +239,5 @@ </ol></li> </ul></li> </ul> +</body> +</html> diff --git a/tutorials/www/quick-intro-html-css.html b/tutorials/www/quick-intro-html-css.html index 33fba18..53073d3 100644 --- a/tutorials/www/quick-intro-html-css.html +++ b/tutorials/www/quick-intro-html-css.html @@ -1,3 +1,55 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> +<head> + <meta charset="utf-8" /> + <meta name="generator" content="pandoc" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> + <title>quick-intro-html-css</title> + <style> + code{white-space: pre-wrap;} + span.smallcaps{font-variant: small-caps;} + span.underline{text-decoration: underline;} + div.column{display: inline-block; vertical-align: top; width: 50%;} + div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} + ul.task-list{list-style: none;} + </style> +</head> +<body> +<nav id="TOC" role="doc-toc"> +<h2 id="toc-title">Contents</h2> +<ul> +<li><a href="#web-browsers-render-code">Web browsers render code</a> +<ul> +<li><a href="#html">HTML</a> +<ul> +<li><a href="#basic-format">Basic Format</a></li> +<li><a href="#tables-and-links">Tables and Links</a></li> +<li><a href="#and-everything-else...">And Everything Else...</a> +<ul> +<li><a href="#shortlist-of-text-and-formatting-tags">Shortlist of Text and Formatting Tags</a></li> +</ul></li> +<li><a href="#html-metadata">HTML Metadata</a></li> +</ul></li> +<li><a href="#css">CSS</a> +<ul> +<li><a href="#add-style-without-css">Add style <em>without</em> CSS</a></li> +<li><a href="#basic-formatting">Basic Formatting</a></li> +<li><a href="#image-formatting">Image Formatting</a></li> +<li><a href="#making-custom-classes">Making Custom Classes</a> +<ul> +<li><a href="#use-the-div-tag-to-make-sections">Use the div tag to make sections</a></li> +</ul></li> +<li><a href="#mobile-optimization">Mobile Optimization</a></li> +</ul></li> +<li><a href="#how-to-look-things-up">How to look things up</a></li> +<li><a href="#references">References</a> +<ul> +<li><a href="#html-1">HTML</a></li> +<li><a href="#css-1">CSS</a></li> +</ul></li> +</ul></li> +</ul> +</nav> <p><em>Note: you should run the examples to see how they work. You can either write the files yourself and open them in a web browser, or use an online HTML editor like</em> <a href="https://html-css-js.com/"><em>this one</em></a></p> <p>As you can see from the current state of this site, I'm not exactly exactly the most skilled web designer. But I struggled through the basics enough to get an idiot's sense of front-end web design, so that perspective might be useful if you have no clue where to start with this like I did.</p> <p>The building blocks are very simple, <em>but there's a lot of blocks</em>. The <a href="https://dev.w3.org/html5/spec-LC/semantics.html#semantics">HTML5 specification</a>, which most browsers are built around, defines the semantics of elements that can should be rendered by a web browser. CSS similarly defines the <em>attributes</em>--or styles--that can be applied to those elements in a format specified <a href="https://www.w3.org/TR/CSS1/">here</a>. I've never gotten deep into the weeds like professional designers do--and to be honest, I don't really want to. But I <em>do</em> like understanding how things work. And getting a unique custom HTML site is something anyone with a text editor and a web browser can get done in a weekend.</p> @@ -338,3 +390,5 @@ src="https://archive.md/zP2NL/9d16630c80f93351469867fde13ea5199cd1f483.jpg" <li>https://3body-net.medium.com/building-mobile-optimized-layouts-with-css-html-1a736d779b1b</li> <li>https://stallman.org/common/stallman.css</li> </ol> +</body> +</html> |