From 9272d1b1b63984fcf0cfab8c27cdc271b0fe29c5 Mon Sep 17 00:00:00 2001 From: mjfernez Date: Sun, 7 Nov 2021 15:37:34 -0500 Subject: Commit all local files for mjfer.net Excepting files in site-files.git --- flasksite.ini | 9 ++ omit | 12 ++- runuwsgi | 3 + siteconfig.py | 14 ++-- static/5575602.png | Bin 0 -> 5152 bytes static/email.svg | 3 + static/github.svg | 3 + static/human_router.jpg | Bin 0 -> 290892 bytes static/linkedin.svg | 3 + static/main.css | 24 +++--- static/puffy.gif | Bin 0 -> 144465 bytes static/rss.svg | 3 + templates/base.html | 12 +-- templates/site | 1 + templates/site/about/.description | 1 - templates/site/about/faq.html | 3 - templates/site/about/whoami.html | 1 - templates/site/files/.description | 1 - templates/site/files/1.html | 11 --- templates/site/fun/.description | 1 - templates/site/fun/.links | 1 - templates/site/fun/renegade.html! | 6 -- templates/site/home.html | 4 - templates/site/license.html | 17 ---- templates/site/thoughts/.description | 3 - templates/site/thoughts/rants/.description | 1 - templates/site/thoughts/rants/dontread.txt | 2 - templates/site/tutorials/.description | 3 - templates/site/tutorials/.links | 1 - templates/site/tutorials/.secret/secretfile.txt | 1 - .../site/tutorials/how-to-make-this-site.html | 1 - templates/site/tutorials/linux/linuz1.html | 1 - templates/site/tutorials/python/.description | 1 - templates/site/tutorials/python/py-style.html | 34 -------- templates/site/tutorials/python/py-style.md | 91 --------------------- templates/site/tutorials/python/test.py | 2 - 36 files changed, 62 insertions(+), 212 deletions(-) create mode 100644 flasksite.ini create mode 100755 runuwsgi create mode 100644 static/5575602.png create mode 100644 static/email.svg create mode 100644 static/github.svg create mode 100644 static/human_router.jpg create mode 100644 static/linkedin.svg create mode 100644 static/puffy.gif create mode 100644 static/rss.svg create mode 100644 templates/site delete mode 100644 templates/site/about/.description delete mode 100644 templates/site/about/faq.html delete mode 100644 templates/site/about/whoami.html delete mode 100644 templates/site/files/.description delete mode 100644 templates/site/files/1.html delete mode 100644 templates/site/fun/.description delete mode 100644 templates/site/fun/.links delete mode 100644 templates/site/fun/renegade.html! delete mode 100644 templates/site/home.html delete mode 100644 templates/site/license.html delete mode 100644 templates/site/thoughts/.description delete mode 100644 templates/site/thoughts/rants/.description delete mode 100644 templates/site/thoughts/rants/dontread.txt delete mode 100644 templates/site/tutorials/.description delete mode 100644 templates/site/tutorials/.links delete mode 100644 templates/site/tutorials/.secret/secretfile.txt delete mode 100644 templates/site/tutorials/how-to-make-this-site.html delete mode 100644 templates/site/tutorials/linux/linuz1.html delete mode 100644 templates/site/tutorials/python/.description delete mode 100644 templates/site/tutorials/python/py-style.html delete mode 100644 templates/site/tutorials/python/py-style.md delete mode 100644 templates/site/tutorials/python/test.py diff --git a/flasksite.ini b/flasksite.ini new file mode 100644 index 0000000..73c2152 --- /dev/null +++ b/flasksite.ini @@ -0,0 +1,9 @@ +[uwsgi] +socket = /var/www/run/flask-main/flask-main.sock +home = env +wsgi-file = server.py +callable = app +master = true +die-on-term = true +processes = 4 +logger = file:/var/www/logs/uwsgi.log diff --git a/omit b/omit index 3a2d936..4fa883e 100644 --- a/omit +++ b/omit @@ -1,2 +1,12 @@ license.html -thoughts/rants/dontread.txt +home.html +pgp.txt +files/ +files/pdfopts.yaml +files/RESUME.html +files/RESUME.pdf +files/gensume +files/RESUME.md +files/bookmarks.html +panupdate +about/faq.html diff --git a/runuwsgi b/runuwsgi new file mode 100755 index 0000000..9588af0 --- /dev/null +++ b/runuwsgi @@ -0,0 +1,3 @@ +#!/bin/ksh +cd /var/www/ezcms +uwsgi --ini flasksite.ini & diff --git a/siteconfig.py b/siteconfig.py index 8917a20..f5cbee6 100644 --- a/siteconfig.py +++ b/siteconfig.py @@ -35,8 +35,8 @@ class siteconfig: # REQUIRED SETTINGS # - DOMAIN = "example.net" # Your site here! - HOME_TITLE = "WELCOME" + DOMAIN = "mjfer.net" # Your site here! + HOME_TITLE = "welcome" LINKS_FILE = ".links" # ".lnx" if you like DESC_FILE = ".description" # ".desc" DEFAULT_MIMETYPE = "application/octet-stream" @@ -92,16 +92,16 @@ class siteconfig: # RSS Settings rss_channel_config = { - 'TITLE': "RSS Feed for example.net", - 'LINK': "http://127.0.0.1:5000/", - 'DESCRIPTION': "My example feed", + 'TITLE': "mjfer.net RSS Feed", + 'LINK': "https://mjfer.net/", + 'DESCRIPTION': "feed organized by the latest updated files", 'LANGUAGE': "en-us", 'PUBDATE': "", 'LASTBUILDDATE': "", 'DOCS': "https://git.mjfer.net/ezcms.git/", 'GENERATOR': "EZCMS", - 'AUTHOR': "editor@example.net", - 'WEBMASTER': "webmaster@example.net", + 'AUTHOR': "mjf@mjfer.net", + 'WEBMASTER': "mjf@mjfer.net", # Max amount of paragraphs to print in each description 'DESCRIPTION_LENGTH': 3, # File extensions to include in RSS updates diff --git a/static/5575602.png b/static/5575602.png new file mode 100644 index 0000000..f4a10bc Binary files /dev/null and b/static/5575602.png differ diff --git a/static/email.svg b/static/email.svg new file mode 100644 index 0000000..f576714 --- /dev/null +++ b/static/email.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/static/github.svg b/static/github.svg new file mode 100644 index 0000000..bb4e45c --- /dev/null +++ b/static/github.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/static/human_router.jpg b/static/human_router.jpg new file mode 100644 index 0000000..e0934c1 Binary files /dev/null and b/static/human_router.jpg differ diff --git a/static/linkedin.svg b/static/linkedin.svg new file mode 100644 index 0000000..4c4efe5 --- /dev/null +++ b/static/linkedin.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/static/main.css b/static/main.css index 4db48f9..3e60bff 100644 --- a/static/main.css +++ b/static/main.css @@ -7,7 +7,6 @@ h3,h4 { text-align: justify; margin: 0.25em auto; } -/* class to optionally center h3 when we want it */ h3.center { text-align: center; } @@ -52,8 +51,7 @@ body { max-width: 35%; display: block; } -/* Use for long text which doesnt wrap nicely */ -.long { +.longboi { word-wrap: break-word; } p { @@ -70,6 +68,7 @@ code { white-space: pre-wrap; word-wrap: break-all; } + table { border-spacing: 0 10px; } @@ -81,20 +80,23 @@ img { height: auto; width: auto; } -/*mobile*/ +img.icon { + filter: invert(50%); +} +/* some Stallman trickery for making mobile text bigger */ @media screen and (max-device-width: 480px) { - body { + body { max-width: 100%; font-size: 90%; - } - .license { + } + .license { font-size: 0; - } - p { + } + p { margin-top: 5%; margin-bottom: 5%; - } - code.long { + } + code.longboi { font-size: 65%; } } diff --git a/static/puffy.gif b/static/puffy.gif new file mode 100644 index 0000000..aa0d461 Binary files /dev/null and b/static/puffy.gif differ diff --git a/static/rss.svg b/static/rss.svg new file mode 100644 index 0000000..39bef06 --- /dev/null +++ b/static/rss.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index 5ca253a..1509d5c 100644 --- a/templates/base.html +++ b/templates/base.html @@ -3,7 +3,7 @@ {{ domain }}/{{ title }} - + {% block css%} {% endblock %} @@ -17,9 +17,9 @@ {{ dir }}/ | {% endfor %} - - - + +   +

{{ title }}

@@ -30,8 +30,8 @@

Go up to parent folder ({{ parent_dir }})

{% endif %}
- {% if last_update %} -

Last update: {{ last_update }}

+ {% if last_update %} +

Last update: {{ last_update }} -4:00 UTC

{% endif %}
{% include 'site/license.html' %}
diff --git a/templates/site b/templates/site new file mode 100644 index 0000000..f7d5c78 --- /dev/null +++ b/templates/site @@ -0,0 +1 @@ +replace with symlink to site-files.git diff --git a/templates/site/about/.description b/templates/site/about/.description deleted file mode 100644 index eee24f1..0000000 --- a/templates/site/about/.description +++ /dev/null @@ -1 +0,0 @@ -Who runs this place anyway? diff --git a/templates/site/about/faq.html b/templates/site/about/faq.html deleted file mode 100644 index 0ad0c1a..0000000 --- a/templates/site/about/faq.html +++ /dev/null @@ -1,3 +0,0 @@ -

Frequently Anticipated Questions

-
  • A question?
  • -

    Yes, that is a question. Nice one

    diff --git a/templates/site/about/whoami.html b/templates/site/about/whoami.html deleted file mode 100644 index 954d8db..0000000 --- a/templates/site/about/whoami.html +++ /dev/null @@ -1 +0,0 @@ -

    Person that does things

    diff --git a/templates/site/files/.description b/templates/site/files/.description deleted file mode 100644 index 0dd21eb..0000000 --- a/templates/site/files/.description +++ /dev/null @@ -1 +0,0 @@ -Everything else I don't have a place for diff --git a/templates/site/files/1.html b/templates/site/files/1.html deleted file mode 100644 index 6be9b63..0000000 --- a/templates/site/files/1.html +++ /dev/null @@ -1,11 +0,0 @@ -

    This is some text

    -
    -
    -
    -

    -This is a whole lot more text including very very very long lines, like wowza -this is long! Fortunately, css should wrap it nicely -

    -

    -Separate each paragraph! -

    diff --git a/templates/site/fun/.description b/templates/site/fun/.description deleted file mode 100644 index 37c5a36..0000000 --- a/templates/site/fun/.description +++ /dev/null @@ -1 +0,0 @@ -The internet is srs business these days. Here's some fun stuff instead diff --git a/templates/site/fun/.links b/templates/site/fun/.links deleted file mode 100644 index b3ea8fb..0000000 --- a/templates/site/fun/.links +++ /dev/null @@ -1 +0,0 @@ -???,http://www.nyan.cat/ diff --git a/templates/site/fun/renegade.html! b/templates/site/fun/renegade.html! deleted file mode 100644 index cc1e6f8..0000000 --- a/templates/site/fun/renegade.html! +++ /dev/null @@ -1,6 +0,0 @@ - - -

    This file breaks all the rules!

    -

    This file doesn't use the base template.

    - - diff --git a/templates/site/home.html b/templates/site/home.html deleted file mode 100644 index 01d676e..0000000 --- a/templates/site/home.html +++ /dev/null @@ -1,4 +0,0 @@ -{% extends 'base.html' %} -{% block content %} -

    Home

    -{% endblock %} diff --git a/templates/site/license.html b/templates/site/license.html deleted file mode 100644 index 172b43f..0000000 --- a/templates/site/license.html +++ /dev/null @@ -1,17 +0,0 @@ -

    - - CC0 - -
    - To the extent possible under law, - The author - has waived all copyright and related or neighboring rights to - content on {{ domain }}. - All work may be cited without attribution at the reader's discretion. - However, if you do use the work here, or otherwise benefit from it, - the author would love to hear about it! - This work is published from: - - United States. -

    diff --git a/templates/site/thoughts/.description b/templates/site/thoughts/.description deleted file mode 100644 index f9004b2..0000000 --- a/templates/site/thoughts/.description +++ /dev/null @@ -1,3 +0,0 @@ -My thoughts on various topics that I may or may not be qualified to write about -When I can't figure out exactly what I'm thinking, it gets written somewhere -here. diff --git a/templates/site/thoughts/rants/.description b/templates/site/thoughts/rants/.description deleted file mode 100644 index 33f8ee8..0000000 --- a/templates/site/thoughts/rants/.description +++ /dev/null @@ -1 +0,0 @@ - diff --git a/templates/site/thoughts/rants/dontread.txt b/templates/site/thoughts/rants/dontread.txt deleted file mode 100644 index e90754c..0000000 --- a/templates/site/thoughts/rants/dontread.txt +++ /dev/null @@ -1,2 +0,0 @@ -I hate people who try to beep me while I'm turning left... like what do you -want me to do? Run the kids over? diff --git a/templates/site/tutorials/.description b/templates/site/tutorials/.description deleted file mode 100644 index ec41834..0000000 --- a/templates/site/tutorials/.description +++ /dev/null @@ -1,3 +0,0 @@ -There's a lot of tutorials out there that can show you something if you know -what to look for. Here's some tutorials that might help when you don't know -what to search. diff --git a/templates/site/tutorials/.links b/templates/site/tutorials/.links deleted file mode 100644 index a0e2e99..0000000 --- a/templates/site/tutorials/.links +++ /dev/null @@ -1 +0,0 @@ -Cool site,https://fsf.org diff --git a/templates/site/tutorials/.secret/secretfile.txt b/templates/site/tutorials/.secret/secretfile.txt deleted file mode 100644 index cae75f7..0000000 --- a/templates/site/tutorials/.secret/secretfile.txt +++ /dev/null @@ -1 +0,0 @@ -You shouldn't be able to see this file. It is a secret diff --git a/templates/site/tutorials/how-to-make-this-site.html b/templates/site/tutorials/how-to-make-this-site.html deleted file mode 100644 index 09dc877..0000000 --- a/templates/site/tutorials/how-to-make-this-site.html +++ /dev/null @@ -1 +0,0 @@ -

    Carefully

    diff --git a/templates/site/tutorials/linux/linuz1.html b/templates/site/tutorials/linux/linuz1.html deleted file mode 100644 index c299a06..0000000 --- a/templates/site/tutorials/linux/linuz1.html +++ /dev/null @@ -1 +0,0 @@ -Linux is cool diff --git a/templates/site/tutorials/python/.description b/templates/site/tutorials/python/.description deleted file mode 100644 index d69e5c3..0000000 --- a/templates/site/tutorials/python/.description +++ /dev/null @@ -1 +0,0 @@ -Some basics and thoughts on Python diff --git a/templates/site/tutorials/python/py-style.html b/templates/site/tutorials/python/py-style.html deleted file mode 100644 index 62de1ba..0000000 --- a/templates/site/tutorials/python/py-style.html +++ /dev/null @@ -1,34 +0,0 @@ -

    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 in output # 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:

    -
    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"
    -
    -    "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.

    -
    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/templates/site/tutorials/python/py-style.md b/templates/site/tutorials/python/py-style.md deleted file mode 100644 index bf96f59..0000000 --- a/templates/site/tutorials/python/py-style.md +++ /dev/null @@ -1,91 +0,0 @@ -# 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 in output - # 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" - - "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/templates/site/tutorials/python/test.py b/templates/site/tutorials/python/test.py deleted file mode 100644 index 83b87a6..0000000 --- a/templates/site/tutorials/python/test.py +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/python3 -print("hi") -- cgit v1.2.3