"
-
- index_content += ""
-
- readme = os.path.join(root, "README.md")
- if os.path.exists(readme):
- with open(readme) as file:
- readme_content = markdown.markdown(file.read())
- #massive hack
- readme_content = readme_content.replace("\"/", "\"/" + filename + "/")
-
- index_content += readme_content
-
- index_content += ""
-
- index_content += footer
- index_content = format_file(page_templ, index_content, {
- "name": name,
- "commit": commit,
- "url": url,
- "filename": filename,
- "above": "/".join(root.split("/")[1:-1]),
- })
-
- with open(os.path.join(root,"index.html"), "w") as file:
- file.write(index_content)
-
-def create_repos():
- try:
- shutil.rmtree(os.path.join(dist, "git"))
- except:
- pass
-
- git_path = os.path.join(dist, "git")
- try:
- os.makedirs(git_path)
- except:
- print("Already have git path")
-
- for repo in get_repos():
- repo = repo.strip()
- print(repo)
- name = ".".join(repo.split("/")[-1].split(".")[:-1])
- os.system(f"mkdir -p /tmp/repos/{name} ;\
- cd /tmp/repos/{name} ;\
- git pull || git clone {repo} /tmp/repos/{name}")
-
- os.system(f"cp -r /tmp/repos/{name} {dist}/git")
-
- command = subprocess.run(f"cd /tmp/repos/{name} && git log --pretty=format:'%h%x09%an%x09%ad%x09%s' --no-decorate -1", stdout=subprocess.PIPE, shell=True)
-
- commit = command.stdout.decode()
-
- traverse_repo(os.path.join(git_path, name), name, commit, repo)
-
-make()
-create_repos()
diff --git a/build.sh b/build.sh
deleted file mode 100755
index 4abdef5..0000000
--- a/build.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-python build.py
-python gif.py
-
diff --git a/const.py b/const.py
deleted file mode 100644
index 6903e96..0000000
--- a/const.py
+++ /dev/null
@@ -1,8 +0,0 @@
-site_index = "https://davidovski.xyz/"
-images = "images"
-date_format = "%a, %d %b %Y %H:%M:%S"
-source = "src"
-templates = "templates"
-resources = "resources"
-dist = "dist"
-summary_max = 10
diff --git a/entries/entries.sh b/entries/entries.sh
new file mode 100755
index 0000000..e85c454
--- /dev/null
+++ b/entries/entries.sh
@@ -0,0 +1,5 @@
+#!../page.sh
+
+[ -z "$1" ] || {
+ md2html $1
+}
diff --git a/src/git_compile.md b/entries/git_compile.html
old mode 100644
new mode 100755
similarity index 99%
rename from src/git_compile.md
rename to entries/git_compile.html
index 05176c0..48619f6
--- a/src/git_compile.md
+++ b/entries/git_compile.html
@@ -1,9 +1,9 @@
+#!./entries.sh
+
# Compiling files in a git repo
So I decided to improve the way that that you can access some of the repos that I am hosting on this server, including the code that I use to compile the site itself. I quickly hacked together a bit of code in my existing [build.py](https://davidovski.xyz/git/davidovski/build.py.html) to clone a list of repos and go through and generate a html pages for each of the files in the repo.
-...
-
Although this means that this is only a static view of the repo at any time (needing me to rebuild the site for it to update) I can easily add any git repo to be built into my site, so as you may see, I have added a few repos from my github as well.
I tried using cgit, but it just didn't provide exactly what I wanted and I wasn't in the mood to try configuring it to my liking, so I opted for this approach instead.
diff --git a/src/librex.md b/entries/librex.html
old mode 100644
new mode 100755
similarity index 98%
rename from src/librex.md
rename to entries/librex.html
index aec86a2..c78c2cd
--- a/src/librex.md
+++ b/entries/librex.html
@@ -1,3 +1,5 @@
+#!./entries.sh
+
# LibreX - a metasearch engine
My instance: [search.davidovski.xyz](https://search.davidovski.xyz/)
diff --git a/src/pci_passthrough.md b/entries/pci_passthrough.html
old mode 100644
new mode 100755
similarity index 99%
rename from src/pci_passthrough.md
rename to entries/pci_passthrough.html
index 75f169e..942c2b4
--- a/src/pci_passthrough.md
+++ b/entries/pci_passthrough.html
@@ -1,9 +1,9 @@
+#!./entries.sh
+
# PCI passthrough with qemu
QEMU is a powerful free and open source emulator which when paired with kvm can be used to create almost bare-metal performance virtual machines. In this guide I will be detailing some tips and tricks to configuring a setup on your linux system to allow a PCI device (typically a graphics card) to be passed through to a virtual machine.
-...
-
Countless guides already exist on this topic but they all rely on using virt-manager and other Redhat software, which, depending on your use case, may be completely overkill. This guide assumes that you will not be using the target GPU as a video output on your host machine from boot, so will only work in configurations where you are able to remote connect or where you have **multiple graphics cards**. However the process is mostly similar for single GPU passthrough, with extra steps if you want to bind and unbind display drivers from the host.
This is a generic guide written to support any semi-standard Linux distributions, so adapt any instructions as you see fit to your current system.
diff --git a/src/ssh_forwarding.md b/entries/ssh_forwarding.html
old mode 100644
new mode 100755
similarity index 99%
rename from src/ssh_forwarding.md
rename to entries/ssh_forwarding.html
index 863c97f..d068f54
--- a/src/ssh_forwarding.md
+++ b/entries/ssh_forwarding.html
@@ -1,11 +1,11 @@
+#!./entries.sh
+
# Permanent SSH Forwarding (Tutorial)
Take this situation: you have a cheap (or even free), low-powered remote server and a considerably better homeserver with more storage and power. For certain services that require more power, you'd obviously want to run them on that homeserver.
However, what if you don't want to, *or can't*, directly open ports onto your home network, or you if you simply want to keep all of your site to one IP? This is where SSH port forwarding comes in handy: using ssh to forward the open port from a service from your local server to the remote one, where it can be exposed to the rest of the internet.
-...
-
## SSH Remote Port Forwarding
SSH remote port forwarding is built right into ssh itself, and is quite simple:
diff --git a/src/welcome.md b/entries/welcome.html
old mode 100644
new mode 100755
similarity index 98%
rename from src/welcome.md
rename to entries/welcome.html
index c9bf751..5d34602
--- a/src/welcome.md
+++ b/entries/welcome.html
@@ -1,3 +1,5 @@
+#!./entries.sh
+
# welcome
welcome. i decided to turn this webpage into blog-style site... i havent got a topic or anything, so expect either: quality tutorials and very interesting techy things; or just random shitposts or rambles about things.
diff --git a/git_repos.txt b/git_repos.txt
deleted file mode 100644
index fcfa3fb..0000000
--- a/git_repos.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-#https://git.davidovski.xyz/davidovski.git
-#https://git.davidovski.xyz/xilinux/xibuild.git
-#https://git.davidovski.xyz/xilinux/xipkg.git
-#https://git.davidovski.xyz/dot.git
-#https://github.com/davidovski/glsl-mandelbrot.git
-#https://github.com/davidovski/dungeon-generator.git
-#https://github.com/davidovski/chatroom.git
-#https://github.com/davidovski/kblg.git
-#https://github.com/davidovski/asteriods.git
-#https://github.com/davidovski/anyscroll.git
diff --git a/images/bg.gif b/images/bg.gif
new file mode 100755
index 0000000..044324f
--- /dev/null
+++ b/images/bg.gif
@@ -0,0 +1,2 @@
+#!/bin/sh
+./gif.py
diff --git a/gif.py b/images/gif.py
old mode 100644
new mode 100755
similarity index 74%
rename from gif.py
rename to images/gif.py
index 827f150..26e8408
--- a/gif.py
+++ b/images/gif.py
@@ -1,4 +1,7 @@
+#!/usr/bin/env python
import glob
+import sys
+import os
import math
import random
from PIL import Image
@@ -21,14 +24,8 @@ colors = [
color("#191919"),
color("#373b41"),
]
-colors2 = colors + [
- color("#f58f44")
-]
-sorted(colors, key=rgb_to_v)
-sorted(colors2, key=rgb_to_v)
-
-def make(filename, colors, inp=None):
+def make(colors, inp=None):
p = len(colors)
w = int(128 / p) * p
h = int(128 / p) * p
@@ -58,9 +55,16 @@ def make(filename, colors, inp=None):
frames.append(image.convert("P"))
- frames[0].save(filename, mode="P", format="GIF", append_images=frames[1:], save_all=True, duration=100, loop=0)
-
-make("dist/images/bg.gif", colors)
-make("dist/images/remotecontrol.gif", colors2, inp="images/remotecontrol-small.png")
+ frames[0].save(sys.stdout, mode="P", format="GIF", append_images=frames[1:], save_all=True, duration=100, loop=0)
+
+
+template = None
+if len(sys.argv) > 1 and os.path.exists(sys.argv[1]):
+ template = sys.argv[1]
+ colors = colors + [ color("#f58f44") ]
+
+sorted(colors, key=rgb_to_v)
+make(colors, inp=template)
+#make("dist/images/remotecontrol.gif", colors2, inp="images/remotecontrol-small.png")
diff --git a/images/remotecontrol.gif b/images/remotecontrol.gif
new file mode 100755
index 0000000..5e73b92
--- /dev/null
+++ b/images/remotecontrol.gif
@@ -0,0 +1,2 @@
+#!/bin/sh
+./gif.py remotecontrol-small.png
diff --git a/index.html b/index.html
new file mode 100755
index 0000000..080a484
--- /dev/null
+++ b/index.html
@@ -0,0 +1,43 @@
+#!./page.sh
+
+cat << EOF
+
+
+
+
Hi, I'm david and this is my website.
+
+
if you want to contact me, you can message me on matrix @ix:davidovski.xyz.
+
+
+
+
+
+
+
+EOF
+
+cat << EOF
+
+
blog posts
+
+
+EOF
+# list all the files in the directory
+for file in entries/*.html; do
+ title="$(grep '^# ' $file)"
+ title=${title#\# }
+
+ printf "
+