This commit is contained in:
deadvey 2025-03-31 16:41:54 +01:00
parent 1f5de7bd2a
commit 5ec27ffbfc
32 changed files with 452 additions and 239 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ __pycache__
/.git /.git
/blog /blog
/images /images
/tictactoe

File diff suppressed because one or more lines are too long

View File

@ -1,8 +0,0 @@
header='''
# DeaDvey's domain
=> / Home
=> /blog/ Blogs
=> /projects.gmi Projects
=> /contact.gmi Contact
=> /rss RSS Feed
'''

View File

@ -1,41 +0,0 @@
import blogs
import os
from datetime import datetime
markdown_page_directory = "/var/tmw/deadvey.com" # Leave empty if you don't have one
post = ["","","",[],[]]
print("Blog title:")
post[0] = input()
print("\nPost content:")
post[1] = input()
print("\nImage (0 to finish):")
image = input()
while image != "0":
post[3].append(image)
print("Image (0 to finish):")
image = input()
print("\nTag (0 to finish):")
tag = input()
while tag != "0":
post[4].append(tag)
print("Tag (0 to finish):")
tag = input()
post[2] = datetime.today().strftime('%a, %d %b %Y %H:%M:%S')
print(post)
blogs.blogs_array = blogs.blogs_array[::-1]
blogs.blogs_array.insert(0,post)
with open("blogs.py", "w") as blogs_file:
content = f'''blogs_array = {blogs.blogs_array}
blogs_array = blogs_array[::-1]'''
blogs_file.write(content)
os.system("python3 write_blog_pages.py")
os.system("python3 rss_feed.py")

View File

@ -1,4 +0,0 @@
import os
os.system("python3 write_blog_pages.py")
os.system("python3 rss_feed.py")

View File

@ -1 +0,0 @@
path = "/var/gemini/deadvey.com"

View File

@ -1,42 +0,0 @@
import root
import blogs
rss_feed_path = f"{root.path}/rss"
url = "https://deadvey.com"
images_path = f"{url}/images"
title = "DeaDvey's Blog"
blog_avatar_url = "{url}/images/pfp6.png"
description = "Linux, tech and film reviews"
with open(rss_feed_path, "w") as rss_file:
content = f'''<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title>{title}</title>
<link>{url}</link>
<description>{description}</description>
<pubDate>{blogs.blogs_array[0][2]} +0000</pubDate>
<lastBuildDate>{blogs.blogs_array[0][2]} +0000</lastBuildDate>
<image>
<url>{blog_avatar_url}</url>
<title>{title}</title>
<link>{url}</link>
</image>
'''
for current_blog in range(len(blogs.blogs_array)-1,0,-1):
# Add images to feed item
images_div = ""
for i in blogs.blogs_array[current_blog][3]:
images_div += f'<![CDATA[<img src="{images_path}/{i}"/>]]>'
content += f'''
<item>
<title>{blogs.blogs_array[current_blog][0]}</title>
<link>https://deadvey.com/blog/{current_blog}.html</link>
<description>{blogs.blogs_array[current_blog][1]}{images_div}</description>
<pubDate>{blogs.blogs_array[current_blog][2]} +0000</pubDate>
</item>
'''
content += "</channel>\n\n</rss>"
rss_file.write(content)

View File

@ -1,87 +0,0 @@
import blogs
import header
import root
from datetime import datetime
import os
file_extension = "gmi"
url = "gemini://deadvey.com"
blog_index_path = f"{root.path}/blog/"
tags = ["index"]
for i in range(0, len(blogs.blogs_array)):
for j in blogs.blogs_array[i][4]:
if j not in tags:
tags.append(j)
for tag in tags:
previous_year = 0 # Set the previous year as 0, the year is outputted to the page if it is different to 'previous_year'
file_name = tag.replace("/","per")
with open(f"{blog_index_path}/{file_name}.{file_extension}", "w") as blog_tag_file:
blog_tag_file.write(f"{header.header}")
if tag == "index":
blog_tag_file.write(f"## All:\n")
if tag != "index":
blog_tag_file.write(f"## {tag}:\n")
for current_blog in range(len(blogs.blogs_array)-1, -1, -1): # eg 50 - 0
if tag in blogs.blogs_array[current_blog][4] or tag == "index":
# Hexadecimal time parsing/formatting
parsed_date = datetime.strptime(blogs.blogs_array[current_blog][2], '%a, %d %b %Y %H:%M:%S')
year = str(hex(int(parsed_date.strftime('%Y'))))[2:]
day = str(hex(int(parsed_date.timetuple().tm_yday)))[2:]
if previous_year != year:
blog_tag_file.write(f"### {year}:\n")
# Write the link to the page
blog_tag_file.write(f"=> /blog/{current_blog}.{file_extension} {day}: {blogs.blogs_array[current_blog][0]}\n")
previous_year = year
blog_tag_file.write("")
# Also write all the blogs to their respective pages
for current_blog in range(len(blogs.blogs_array)-1, -1, -1): # eg 50 - 0
with open(f"{blog_index_path}/{current_blog}.{file_extension}","w") as current_blog_file:
parsed_date = datetime.strptime(blogs.blogs_array[current_blog][2], '%a, %d %b %Y %H:%M:%S')
year = str(hex(int(parsed_date.strftime('%Y'))))[2:]
day = str(hex(int(parsed_date.timetuple().tm_yday)))[2:]
hour = int(parsed_date.strftime('%H'))
minute = int(parsed_date.strftime('%M'))
second = int(parsed_date.strftime('%S'))
second_of_the_day = str(hex(int(((hour * 3600) + (minute * 60) + second) * (65536/86400))))[2:]
images_div = ""
tags_div = ""
buttons_div = ""
blogs.blogs_array[current_blog][1] = blogs.blogs_array[current_blog][1].replace(". ", ".\n")
blogs.blogs_array[current_blog][1] = blogs.blogs_array[current_blog][1].replace("! ", "!\n")
blogs.blogs_array[current_blog][1] = blogs.blogs_array[current_blog][1].replace("? ", "?\n")
if current_blog > 0:
buttons_div += f"=> /blog/{current_blog-1}.{file_extension} <-- {blogs.blogs_array[current_blog-1][0]}\n"
if current_blog < len(blogs.blogs_array) - 1:
buttons_div += f"=> /blog/{current_blog+1}.{file_extension} {blogs.blogs_array[current_blog+1][0]}-->\n"
for i in blogs.blogs_array[current_blog][3]:
images_div += f'=> /images/{i} {i}\n'
for i in blogs.blogs_array[current_blog][4]:
dir_name = i.replace("/", "per") + "." + file_extension
tags_div += f'=> /blog/{dir_name} {i}\n'
content = f'''
{header.header}
{buttons_div}
## {blogs.blogs_array[current_blog][0]}:
{blogs.blogs_array[current_blog][1]}
### Published: {day}/{year} at {second_of_the_day}
{tags_div}
{images_div}
'''
current_blog_file.write(content)

File diff suppressed because one or more lines are too long

View File

@ -1,9 +1,4 @@
# DeaDvey's domain # Contact me
=> / Home
=> /blog/ Blogs
=> /projects/ Projects
=> /contact/ Contact
=> /rss RSS Feed
Matrix: @deadvey:matrix.org Matrix: @deadvey:matrix.org
=> irc://irc.tuxcord.net irc.tuxcord.net (IRC) => irc://irc.tuxcord.net irc.tuxcord.net (IRC)

16
gemlog/index.gmi Normal file
View File

@ -0,0 +1,16 @@
## Glogger
So I think Glogger is finished ish,
I made a program in python I call "glogger" and it is this, a static gemlog generator using plain text files as the database.
I have also improved on my old blog generator by:
I) Having a config file that allow you to edit the formatting and other details
II) Using the "click" program that allows you to write text in your editor before it is passed on to python, maintaining any newlines and making it much nicer to edit text.
III) Allowing for multiple users seemlessly on one gemlog
IV) Letting you edit previous posts and updating them straightaway
I hope it works nice, the idea is to be lightweight, I also think it would be trivial to port it to a html website, I might make it general purpose, I literally think there would just need to be a file extension config in config.py.
Fly You High - DeaDvey
=> gemini://deadvey.com/gemlog/post/0.gmi permalink
---------------------------------------------

19
gemlog/post/0.gmi Normal file
View File

@ -0,0 +1,19 @@
# Posted by deadvey
## Glogger
### Published: 31/03/2025 at 16:06
So I think Glogger is finished ish,
I made a program in python I call "glogger" and it is this, a static gemlog generator using plain text files as the database.
I have also improved on my old blog generator by:
I) Having a config file that allow you to edit the formatting and other details
II) Using the "click" program that allows you to write text in your editor before it is passed on to python, maintaining any newlines and making it much nicer to edit text.
III) Allowing for multiple users seemlessly on one gemlog
IV) Letting you edit previous posts and updating them straightaway
I hope it works nice, the idea is to be lightweight, I also think it would be trivial to port it to a html website, I might make it general purpose, I literally think there would just need to be a file extension config in config.py.
Fly You High - DeaDvey
=> gemini://deadvey.com/gemlog/user/deadvey.gmi deadvey
Published: 31/03/2025 at 16:06
Last Edited: 31/03/2025 at 16:06

12
gemlog/post/1.gmi Normal file
View File

@ -0,0 +1,12 @@
# Posted by deadvey
## test post 2
### Published: %D
content
hehe
=> gemini://deadvey.com/gemlog/user/deadvey.gmi deadvey
Published: %D
Last Edited: %E

12
gemlog/post/2.gmi Normal file
View File

@ -0,0 +1,12 @@
# Posted by deadvey
## test post 3
### Published: %D
do
new
lines
work?
=> gemini://deadvey.com/gemlog/user/deadvey.gmi deadvey
Published: %D
Last Edited: %E

15
gemlog/post/3.gmi Normal file
View File

@ -0,0 +1,15 @@
# Posted by deadvey
## The Witcher The Last Wish
### Published: %D
4/5
Very good book, I enjoyed the interactions between Geralt and Dandillion,
My favourite short stories were "The Lesser Evil" where we see Geralt tackle with a moral dilema
and "The Last Wish" where Geralt and Yennefer meet for the first time.
Fly you high - DeaDvey
=> gemini://deadvey.com/gemlog/user/deadvey.gmi deadvey
Published: %D
Last Edited: %E

17
gemlog/user/deadvey.gmi Normal file
View File

@ -0,0 +1,17 @@
# deadvey:
## Glogger
So I think Glogger is finished ish,
I made a program in python I call "glogger" and it is this, a static gemlog generator using plain text files as the database.
I have also improved on my old blog generator by:
I) Having a config file that allow you to edit the formatting and other details
II) Using the "click" program that allows you to write text in your editor before it is passed on to python, maintaining any newlines and making it much nicer to edit text.
III) Allowing for multiple users seemlessly on one gemlog
IV) Letting you edit previous posts and updating them straightaway
I hope it works nice, the idea is to be lightweight, I also think it would be trivial to port it to a html website, I might make it general purpose, I literally think there would just need to be a file extension config in config.py.
Fly You High - DeaDvey
=> gemini://deadvey.com/gemlog/post/0.gmi permalink
---------------------------------------------

17
gemlog/user/max.gmi Normal file
View File

@ -0,0 +1,17 @@
# max:
## Glogger
So I think Glogger is finished ish,
I made a program in python I call "glogger" and it is this, a static gemlog generator using plain text files as the database.
I have also improved on my old blog generator by:
I) Having a config file that allow you to edit the formatting and other details
II) Using the "click" program that allows you to write text in your editor before it is passed on to python, maintaining any newlines and making it much nicer to edit text.
III) Allowing for multiple users seemlessly on one gemlog
IV) Letting you edit previous posts and updating them straightaway
I hope it works nice, the idea is to be lightweight, I also think it would be trivial to port it to a html website, I might make it general purpose, I literally think there would just need to be a file extension config in config.py.
Fly You High - DeaDvey
=> gemini://deadvey.com/gemlog/post/0.gmi permalink
---------------------------------------------

View File

@ -1,13 +1,41 @@
# DeaDvey's domain # DeaDvey's domain
## About:
Hey, I'm deadvey, this is my gemlog,
I'm a British Student who's interested in Gemini, Open Source, Linux, Rust and Building Computers.
My gemlog mostly consists of reviews of films and books and also about things I've been doing recently.
Hope you like it :)
You can clone my Capsule from the source code link at the bottom
## Pages:
=> / Home => / Home
=> /blog/ Blogs => /gemlog/ Gemlogs
=> /projects.gmi Projects => /projects.gmi Projects
=> /contact.gmi Contact => /contact.gmi Contact
=> /resources Resources
=> /rss RSS Feed => /rss RSS Feed
Hey, I'm deadvey, this is my gemlog, ## Random Experiments on this capsule:
You can clone my page from the source code link at the bottom => /tictactoe/---------.gmi TicTacToe/Noughts and Crosses
## Other good Gem Capsules:
=> gemini://maxxcan.flounder.online/ Maxxcan
Copyright © 2022-2025 DeaDvey Copyright © 2022-2025 DeaDvey
=> /LICENSE This website is licensed under the GPL3 => /LICENSE This website is licensed under the GPL3
=> https://git.javalsai.dynv6.net/deadvey/htdocs.git source code => https://git.javalsai.dynv6.net/deadvey/htdocs.git source code
```
____ ____ _
| _ \ ___ __ _| _ \__ _____ _ _( )___
| | | |/ _ \/ _` | | | \ \ / / _ \ | | |// __|
| |_| | __/ (_| | |_| |\ V / __/ |_| | \__ \
|____/ \___|\__,_|____/ \_/ \___|\__, | |___/
|___/
____ _
| _ \ ___ _ __ ___ __ _(_)_ __
| | | |/ _ \| '_ ` _ \ / _` | | '_ \
| |_| | (_) | | | | | | (_| | | | | |
|____/ \___/|_| |_| |_|\__,_|_|_| |_|
```

View File

@ -1,18 +1,19 @@
# DeaDvey's domain # Projects
=> / Home
=> /blog/ Blogs
=> /projects.gmi Projects
=> /contact.gmi Contact
=> /rss RSS Feed
=>https://git.javalsai.dynv6.net/deadvey/nixos NixOS configuration files ## Miscellaneous:
=>https://git.javalsai.dynv6.net/deadvey/markdown-webbrowser Markdown web browser => https://git.javalsai.tuxcord.net/deadvey/nixos NixOS configuration files
=> https://git.javalsai.tuxcord.net/deadvey/dotfiles Dotfiles
=> https://git.javalsai.tuxcord.net/deadvey/markdown-webbrowser Gemini/Markdown web browser
=> https://git.javalsai.tuxcord.net/deadvey/themedweb Themed Web - firefox extension
=> https://git.javalsai.tuxcord.net/deadvey/screenshot Basic screenshot tool for X11 and Wayland
## Website/Capsule:
=> /tictactoe/---------.gmi Noughts and Crosses in Gemini
=> https://tuxcord.net Tuxcord.net => https://tuxcord.net Tuxcord.net
=>https://git.javalsai.dynv6.net/deadvey/themedweb Themed Web - firefox extension
=>https://git.javalsai.dynv6.net/deadvey/screenshot Basic screenshot tool for X11 and Wayland
Games: ## Games:
=>https://git.javalsai.dynv6.net/deadvey/random-rust/src/branch/master/rustsweeper Rustsweeper (Minesweeper clone) => https://git.javalsai.tuxcord.net/deadvey/random-rust/src/branch/master/rustsweeper Rustsweeper (Minesweeper clone)
=>https://git.javalsai.dynv6.net/deadvey/bases-game Bases game => https://git.javalsai.tuxcord.net/deadvey/bases-game Bases game
=>https://git.javalsai.dynv6.net/deadvey/random-rust/src/branch/master/falling Falling => https://git.javalsai.tuxcord.net/deadvey/random-rust/src/branch/master/falling Falling
=>https://git.javalsai.dynv6.net/deadvey/random-rust/src/branch/master/rubiks Rubiks Cube Simulator => https://git.javalsai.tuxcord.net/deadvey/random-rust/src/branch/master/rubiks Rubiks Cube Simulator
=> https://git.javalsai.tuxcord.net/deadvey/wraithfate Wraithfate remake in Rust

9
resources/index.gmi Normal file
View File

@ -0,0 +1,9 @@
# Resources I've made
=> physics Physics A Level
=> maths Maths A Level
=> cs Computer Science A Level
=> nixos NixOS
=> symbols.gmi Mathematical Symbols

View File

@ -0,0 +1,4 @@
# Maths
=> pure Pure
=> stats Statistics
=> mechanics Mechanics

View File

@ -0,0 +1,172 @@
# Differenciation
=> integration.gmi Also see Integration
Differenciation was discovered/pioneered by Isaac Newton
It allows you to find the gradient equation for a curve (eg x²+3x+6)
You can easily find the gradient between two points on a curve by using the equation
```
change in y / change in x
```
But if you want to find the gradient at a specific point on a graph, you have to draw a tangent... Or DO you?
Well, if you pick two points on a graph (f(x): y = x²+3x+6) where
```x = 1```
and
```x = 1 + h```
Where h is a number that is very close to 0.
You can find the gradient between these two points:
```
change in y
-----------
change in x
=>
((1+h)² + 3(1+h) + 6) - (1² + 3(1) + 6)
---------------------------------------
(1 + h) - 1
=>
( h² + 5h + 10) - (10)
----------------------
h
=>
h² + 5h
-------
h
=>
h + 5
=>
5 (because h is nearly 0)
```
...thus the gradient at point x=1 is 5
This proof is called First Principle and can be written:
```
f(x+h) - f(x)
-------------
f'(x) = lim h
h→0
```
This takes a while so a quicker way we can do this is by differenciating the curve equation
We do this by multiplying the coefficient by the number that the x is a power to and then minusing one from the the power:
```
f(x) = x² + 3x + 6
f'(x) = 2x + 3
dy
-- = 2x + 3
dx
```
f'(x) and dy/dx are just different ways of denoting a differenciated equation
Then we can simply substitute 1 into the equation:
```
2(1) + 3 = 5
```
And boom, that is differenciation; finding the gradient line of a curve
If you draw the gradient curve then you will see that the point it crosses the x axis, where x=0, the gradient=0 as that is the turning point of the quadratic equation:
```
0 = 2x + 3
-3 = 2x
-1.5 = x
```
And so x = -1.5 is the minimum point for x
```
x² + 3x + 6:
| | |
| ||
| || (1. Sides of the V shape are getting steeper)
| ||
| |
' '|
\./ | (2. Turning point is -1.5)
_______________|________________
|
|
2x + 3:
| /
| /
| /
(2. Crosses |/ (1. Because the line is getting higher)
the x axis /
at -1.5) /|
/ |
____________/__|________________
/ |
/ |
```
Additionally, if an equation has roots or fractions, you can use the index laws to put the equation in indicies form:
=> index-laws.gmi Index Laws
```
x³ + sqrt(x)
= x³ + x^(1/2)
2x² + 1/x
= 2x² + x^(-1)
```
Questions:
1.
a) Differenciate x³ - 4x² + 6x - 1
b) Find the gradient at x=3
=> integration.gmi Also see Integration
for finding the area under a curve, the reverse process of differenciation
Answers
↓↓↓↓↓↓↓
Answers:
1.
a) 3x² - 8x + 6
b) 9

View File

@ -0,0 +1,31 @@
# Exponential Graphs
=> differenciation.gmi You should understand differentiation before reading this section
Exponential graphs are those in the form of y = k^(x)
they should look like this:
y
|
| |
| |
| |
| |
| |
| |
| _-
| ___--
|---------___________ x
As you can see, the line curves upwards, increasing in gradient costantly.
It's also interesting to note that all exponential graphs (without a specified y intercept), intersect y at 1 as n^0 === 1
If you draw the gradient graph of an exponential, you get another exponential graph, they are usually slightly different to the original graph,
for instance, the gradient graph of 2^x is slightly shallower than 2^x
and the gradient graph of 3^x is slightly steeper than 3^x,
As you can see, the gradient graph and initial graph must cross at a certain value between 2 and 3
that value is about 2.718, the gradient graph 2.718^x is exactly the same as 2.718^x, we call this value e.
Similar to pi, the number e actually goes on forever, I just rounded it to 2.718, the first 10 digits are 2.718281828.
So e is a special number because if you differenciate it, you get the same value:
```
y = e^x
dy/dx = e^x
y = e^kx
dy/dx = ke^kx
```

View File

@ -0,0 +1,17 @@
# Index Laws
You can use these index laws to simplify powers of the same base
```
a^(m) × a^(n) = a^(mn)
a^(m) ÷ a^(n) = a^(m-n)
(a^(m))^(n) = a^(mn)
(ab)^(n) = a^(n)b^(n)
sqrt(a) = a^(1/2)
cbrt(a) = a^(1/3)
sqrt(a^(n)) = a^(n/2)
1/x = x^(-1)
2/x = 2x^(-1)
1/(x^(n)) = x^(-n)
```

View File

@ -0,0 +1,7 @@
# Pure Maths
=> index-laws.gmi Index Laws
=> exponentials.gmi Exponentials
## Calculus
=> differenciation.gmi Differenciation
=> integration.gmi Integration

View File

@ -0,0 +1 @@
# Integration

28
resources/nixos/index.gmi Normal file
View File

@ -0,0 +1,28 @@
# NixOS:
## setup:
### Change to unstable branch:
```
nix-channel --add https://nixos.org/channels/nixos-unstable nixos
sudo nixos-rebuild switch --upgrade
```
## configuration.nix:
### Auto mounting:
```
fileSystems = {
"/dev/sda1" = {
device = "/dev/sda1"; # The device id of the drive you want to be mounted
# device = "server:/dev/sda1"; # For nfs drives
fsType = "ext4"; # The filesystem of the mounted drive, "auto" by default
# ext4, fat32, nfs, btrfs, etc...
mountPoint = "/mnt"; # Where the drive should be mounted to, a path
};
};
```
### List all NixOS options
```
man configuration.nix
```
=> https://mynixos.com Or use the mynixos resource

View File

@ -0,0 +1,3 @@
# Physics
=> materials Materials

View File

@ -0,0 +1,7 @@
# Hooke's Law
Hooke's Law applies to all materials, up to a point.
Hooke's Law states that the Extension is Directly Proportional to Force Applied.
```
F = kx
k is the stiffness or spring constant
```

View File

@ -0,0 +1,2 @@
# Materials
=> hookes.gmi Hooke's Law

12
resources/symbols.gmi Normal file
View File

@ -0,0 +1,12 @@
# Symbols
µ = AltGr+m = Micro ×10^(-6)
× = AltGr+Shift+, = Multiply
÷ = AltGr+Shift+. = Divide
¹ = AltGr+1 = Power of 1
² = AltGr+2 = Power of 2
³ = AltGr+3 = Power of 3
½ = AltGr+5 = Half = 1/2
¾ = AltGr+6 = Three Quarters = 3/4
ß = AltGr+s = Beta
ŋ = AltGr+g = Eta ? = Viscosity
º = AltGr+Shift+m = Degrees

2
rss
View File

@ -15,7 +15,7 @@
<item> <item>
<title>Setting up agate on OpenSUSE or NixOS</title> <title>Setting up agate on OpenSUSE or NixOS</title>
<link>https://deadvey.com/blog/111.html</link> <link>https://deadvey.com/blog/111.html</link>
<description> <description>=> gemini://qwertqwefsday.eu/agate.gmi Agate's Gemini Capsule (Source)
In order to setup Agate on OpenSUSE tumbleweed, I cloned te agate git repository In order to setup Agate on OpenSUSE tumbleweed, I cloned te agate git repository
``` ```
git clone https://github.com/mbrubeck/agate.git git clone https://github.com/mbrubeck/agate.git