Spenser's personal site for things Spenser is enjoying and wanting to show you! (site contents below) use your mouse scroll wheel and "left click" function to view.

Why/How to host a bunch of crap locally
fisho down This website uses an efficient fish-based (based fish) navigation technique.

Why/How to host a bunch of crap locally

Why/How to host a bunch of crap locally

For your hackerman code documentation of course. Have a local homepage that
shows all your locally hosted material to browse. Instantly lookup
whatever your need.

Step 1: start making mirrors with httrack and downloading documentation

If you use Lisp, download the Hyperspec. Python's documentation can be
downloaded easily too. etc. For sites that don't offer a download,
use httrack to mirror them.

An example httrack command

httrack --disable-security-limits -d -w -x -c4 --fast-engine  -A2000 --max-rate 0 --continue --near -v '-%e0' -'#L9999999' 'https://tatsumoto.neocities.org/' '+*tatsumoto.neocities.org/*' "$@"

Elite hackerman hint

Setup your editor (Emacs) to allow you to instantly lookup any keyword
from the documentation using CTAGS, the same way they can be used to
jump to a function definition etc. The common lisp Hyperspec works
beautifully for this purpose, and SLIME has a built-in command for it.

Generating your index dashboard homepage

We will use HTTrack's index feature to quickly index all of our sites
and generate a page. The above image is of that page as generated by
this script. Just add your folder names to the INDICES.

#!/bin/sh
# uses GNU sed -i for the optional cheap hack
INDICES="
<your subfolders>
tatsumoto.neocities.org-guide
"

chdir /var/www/localdocs
IFS="
"
rm index.html
echo "$INDICES" | sed 's/^/http:\/\/localhost\//' | xargs httrack --update -r1 -%i

# KLUDGE/BUGFIX: something wrong with the AJATT mirror one
cp AJATT/index.html localhost/AJATT/index.html

# hack to add a site that is hosted on a separate HTTP server
sed -i 's^<TABLE BORDER="0" WIDTH="100%" CELLSPACING="1" CELLPADDING="0">^<TABLE BORDER="0" WIDTH="100%" CELLSPACING="1" CELLPADDING="0"><TR> <TD BACKGROUND="fade.gif"><A HREF="localhost:8002/index.html"> DoR romanian podcast (local transcripts) </A>		</TD> </TR> '^ index.html

echo "HINT: Add the new site(s) to INDICES."
echo "HINT: add <title> tags to them so you can read the index."
TMP="$(mktemp)"
cat index.html >"$TMP"
cat "$TMP" | sed 's/\([^"]\)localhost\//\1/' >index.html
rm "$TMP"
#!/bin/sh
# args: URL [HTTRACK arguments]
url="$1"
shift # removes first arg for ordering
httrack-command "$url" --update "$@"

Updating some mirrors

For content you want to keep in sync, here is ascript which can be run
in cron, for example.

Hosting an actual webserver

Sometimes the "Browse files" ability of your browser doesn't quite nail
it, so you might want to install quark (check out https://frign.de ),
a very minimal web server, and just run it all the time on that folder.

If you want to be able to click links and have them actually direct you
within your subdomain, this sed command will replace all the links so
long as you have the GNU sed with the `-i` extension.

sed -i 's^oldwebsite.com^localhost:8000 (or whatever)^' *

Future work

Indexing/searching?

fisho up
in: articles

Spenser Truex

Contact
hacker emblem
| |