From 5a0d5c2bb7d700343adbef66185675215cc983e5 Mon Sep 17 00:00:00 2001 From: mjfernez Date: Tue, 11 Jul 2023 23:31:16 -0400 Subject: HTML generation --- .../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 ++++++++++++++++--- 5 files changed, 1458 insertions(+), 159 deletions(-) create mode 100644 tutorials/www/how-to-use-the-internet.html (limited to 'tutorials') 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