GEOUNIVERSAL .:.


pages - photos - log

web, webmaster, sshfs .:.

2021 06 01

sshfs

finally able to access pi files on everything with a relatively simple method. no installing servers or anything really.

sshfs on the raspberry pi

to mounth the folder as a drive on windows you need to install both of these things:

sshfs-win

winfsp

webmaster, python

switching plans up for the webmaster guy. i was finally getting the hang of nodejs but i'm going to go with python. the code looks way prettier and it worked the second try. i've never written anything more than 5 lines and have it work the first try.

not on my main computer tonight but holding myself to logging at least once a month. will edit this all again in a couple days, just putting this here for now

webmastertest3.py

import markdown
md = markdown.Markdown(extensions = ['meta', 'attr_list'])
import os

def makepage(mdfile):
    file = open('../templates/header.txt', 'r')
    header = file.read()
    file.close()

    file = open('../md/' + mdfile, 'r')
    body = md.convert(file.read()) + '\n' + str(md.Meta)
    file.close()

    file = open('../templates/footer.txt', 'r')
    footer = file.read()
    file.close

    html = header + body + footer

    savefile = open('../html/' + mdfile[:-3] + 'html', 'w')
    savefile.write(html)
    savefile.close()

for mdfile in os.listdir('../md'):
if mdfile[-3:] == "txt":
    makepage(mdfile)
    print(mdfile)