Compare commits

...

6 Commits

Author SHA1 Message Date
1201b201fb wip: feat: xbox modding post 2025-02-01 09:25:50 +01:00
4a82105c39 wip: portainer post 2025-02-01 08:56:06 +01:00
agj
4a5a54a293 Merge pull request 'feat: neomutt post' (#1) from dev into main
Reviewed-on: #1
2025-02-01 08:56:04 +01:00
b6b7146f50 feat: neomutt post 2025-01-11 16:34:53 +01:00
508af46e66 fix: set baseurl
All checks were successful
Release CI action / build-and-push-container (push) Successful in 2m56s
2024-12-02 22:15:58 +01:00
3e4bf792fe fix: typos
All checks were successful
Release CI action / build-and-push-container (push) Successful in 3m14s
2024-12-02 20:06:55 +01:00
12 changed files with 338 additions and 11 deletions

View File

@ -4,9 +4,9 @@ WORKDIR /hugo
RUN hugo new site /hugo
RUN git clone https://github.com/yihui/hugo-xmin.git themes/hugo-xmin
ADD hugo.toml /hugo/hugo.toml
ADD content /hugo/content
ADD static /hugo/static
ADD shortcodes /hugo/layouts/shortcodes
ENV PORT=1313
EXPOSE $PORT
CMD ["hugo", "serve", "--bind", "0.0.0.0", "--port", "$PORT"]
ADD content /hugo/content
CMD ["hugo", "serve", "--baseURL", "https://blog.gtz.dk/", "--bind", "0.0.0.0", "--port", "$PORT"]

View File

@ -1,3 +1,26 @@
# gtz blog
An opinionated blog.
I write posts about technology and other interests that I have.
To iterate locally:
```sh
docker build -t wip .
docker run --rm -it -p 8080:8080 wip hugo serve --bind 0.0.0.0 --port 8080
```
## Things I want to write
### Opinions
- [ ] Clean Architecture is stupid and overly complicated - dependency injection is king
- [ ] For want of a neater (human) internet
- [ ] A truly FOSS printer.
even the hardware should be FOSS. - most parts should be 3d printable.
should be a laser printer, as inkjet is stupid.
- [ ] A truly FOSS eink reader.
- [ ] VIM Bindings everywhere please
### Digital Soverignty
- [x] how to host a blog
- [ ] how to securely "self-host" using a VPS, portainer and traefik
- [x] how to configure neomutt
- [ ] how to securely host a mail server

View File

@ -3,5 +3,17 @@ title: About gtz blog
author: Asger Gitz-Johansen
---
This is just a simple blog.
<!-- TODO: Add more shit about myself. -->
I am a software engineer from Denmark working at [GomSpace](https://gomspace.com/home.aspx).
This is just my simple blog that I use for letting out "blogging-steam".
I write GNU/Linux based tutorials and sometimes I write opinion pieces.
I hope you find my stuff useful.
If you want more from me, check my links:
- [GitHub](https://github.com/sillydan1)
- [Model Based Development Paper 1](https://github.com/sillydan1/aaltitoad/blob/master/.github/resources/docs/SW9__AALTITOAD.pdf)
- [Model Based Development Paper 2](https://github.com/sillydan1/aaltitoad/blob/master/.github/resources/docs/SW10__Tick_Tock_Automata.pdf)
- [Model Based Development Paper 3](https://github.com/sillydan1/aaltitoad/blob/master/.github/resources/docs/aaltitoad-v1.0.0.pdf)
- [Graphedit](https://github.com/sillydan1/graphedit) (in hibernation)
- [AALTITOAD](https://github.com/sillydan1/aaltitoad) (in hibernation)
{{< centered image="/6616144.png" >}}

View File

@ -5,4 +5,7 @@ title = 'Example'
tags = ['tutorial']
categories = ['technical']
+++
content goes here.
{{< centered image="/6616144.png" >}}

View File

@ -0,0 +1,89 @@
+++
date = '2025-01-11'
title = 'Neomutt and Outlook'
tags = ['howto', 'tutorial', 'mutt', '2fa', 'oauth2']
categories = ['technical']
+++
Neomutt is a great way to read, send and manage your email.
In this tutorial we will configure neomutt to be able to synchronize e-mails with Outlook (or other popular e-mail provider) addresses!
By the end of this tutorial, you will be able to manually synchronize your emails using the `mailsync` command and read/manage your emails in an interface that looks like so:
{{< centered image="/neomutt-screenshot.png" >}}
Apologies for the blur, but I dont want you to read **my** e-mails.
## First Things First
First, sign in to your mail through the browser. This is needed for the OAuth2 authorization flow.
You should also obviously install neomutt.
This can just be done through your package manager.
As I am using Arch linux, I will do so using `pacman`, but on Ubuntu or Debian you should use `apt`:
```sh
pacman -S neomutt
```
## GPG
The first thing you'll need is a `gpg` key for encryption purposes.
You can check your keys using `gpg --list-keys`.
If you don't already have a `gpg` key, you can generate one with the `--full-gen-key` flag.
```sh
gpg --full-gen-key
```
## OAuth2
As part of installing neomutt, you should have the oauth2 python script located in `/usr/share/neomutt/oauth2/`.
We need to register neomutt as an already trusted app.
We will simply abuse the thunderbird client-id for this, which is: `9e5f94bc-e8a4-4e73-b8be-63364c29d753` - with this you don't need to specify a client secret:
```sh
/usr/share/neomutt/oauth2/mutt_oauth2.py \
-v \
-t \
--authorize \
--client-id "9e5f94bc-e8a4-4e73-b8be-63364c29d753" \
--client-secret "" \
--email "your-email-here" \
--provider microsoft \
$HOME/email-token
```
This will ask you a couple questions.
Select `authcode` for the preferred OAuth2 flow.
If prompted for a client secret, simply press enter.
You should get a link - enter that link into your browser and allow the app.
By the end of the flow you should end up at an empty website.
Copy the last part of the URL and paste it into your terminal.
After this you should have a token file located at `$HOME/email-token`.
It's a good idea to take a backup of this file just in case you overwrite it.
But if you do loose it, you can just run the flow again.
## Mutt-Wizard
We are almost there!
The wonderful Luke Smith has made a neat setup wizard called [mutt-wizard](https://muttwizard.com/).
Install (see the mutt-wizard website), run it and enter your email information.
After this, you should edit your `~/.mbsyncrc` file, as the default `PassCmd` is not quite configured yet.
It should look something like this (make sure to change `your-email-here` and `username` to the appropriate values):
```
...
PassCmd "/usr/share/neomutt/oauth2/mutt_oauth2.py --encryption-pipe 'gpg -e -r your-email-here' /home/username/email-token"
...
```
You should now be able to run `mailsync` (installed with mutt-wizard):
```sh
mailsync
```
It might ask you to select which profile to sync.
Just provide the name you set when setting up your gpg profile and everything should sync now!
After a successful sync, you should be able to just open `neomutt` and start reading, replying and whatever you do with email!
```sh
neomutt
```
{{< centered image="/6616144.png" >}}

View File

@ -64,7 +64,7 @@ For now, I am just using the built-in server in `hugo`, but it should be possibl
I mentioned `hugo` before, but I was mostly mad that I had to add the autogenerated stuff in git - with this approach... I don't have to 🎊!
## Images
Just put images in the `static` directory, and reference to them in your blogposts like you would normally in a `hugo` project:
Just put images in the `static` directory, and reference to them in your blog posts like you would normally in a `hugo` project:
```markdown
![example](/example.png)
@ -110,7 +110,7 @@ Yes! Now we're cooking with gas! ... or atleast cooking with something. Note tha
## Conclusion
We have made a docker file for automatically downloading, generating and serving a simple `hugo` blog site.
Personally, I would've liked the `static` and `shortcodes` directories to not exist, but blogposts need images and it needs to center them, so they are a necessary evil.
Personally, I would've liked the `static` and `shortcodes` directories to not exist, but blog posts need images and it needs to center them, so they are a necessary evil.
Could we make the directory structure better and cleaner? Probably yes.
Will I make it better for this blog in the future? Probably yes.
Will I make another post when I do that? Probably yes!
@ -120,7 +120,7 @@ The next section concerns about hosting, orchestrating and deploying the site au
# Deployment
Being able to build and launch the docker image is nice and can suffice for smaller projects.
Yes, this blog is a small project and the manual method should be more than enough, but I also play [factorio](https://store.steampowered.com/app/427520/Factorio/) (highly recommend it!), so I _hvae_ to automate everything that is tedious.
Yes, this blog is a small project and the manual method should be more than enough, but I also play [factorio](https://store.steampowered.com/app/427520/Factorio/) (highly recommend it!), so I _have_ to automate everything that is tedious.
I also have other projects that I host on my VPS (Virtual Private Server) such my portfolio site [gtz.dk](https://gtz.dk) and a [gitea instance](https://git.gtz.dk/) amongst other things.
## Continuous Integration
@ -159,7 +159,7 @@ Every time we push a commit to the `main` branch, we run the job named `build-an
In the job, we first download our repository with the `actions/checkout@v4` action, then we build the container using `docker build` (we make sure to accurately tag the image), then we log in to the container registry that we want to host the container at using the `docker/login-action@v3` action, and the we simply `docker push` the container image.
Make sure to replace the `git.gtz.dk` website mentions with your own github hosting service (whether self-hosted, or `github.com`) and replace the `gitea/GITEA` mentions with `github/GITHUB` instead.
Note that the syntax is extemely similar to GitHub Actions - in fact Gitea Actions are trying to be 1 to 1 compatible with GitHub Actions, so it should be relatively straight forward.
Note that the syntax is extremely similar to GitHub Actions - in fact Gitea Actions are trying to be 1 to 1 compatible with GitHub Actions, so it should be relatively straight forward.
This setup also gives us the possibility of performing traditional code-review before releasing by using [pull requests](https://docs.gitea.com/next/usage/pull-request?_highlight).
This should empower us to identify and correct issues (e.g. spelling mistakes or whatever) before they are pushed to the official website.
@ -171,7 +171,7 @@ This was the most difficult thing to do. We are _almost_ there.
## Continuous Delivery
With a docker image readily available, we can automatically deploy the blog when we push it!
I personally am a big fan of the simplicity of [portainer](https://www.portainer.io/), as it scales really well when doing perosnal server stuff.
I personally am a big fan of the simplicity of [portainer](https://www.portainer.io/), as it scales really well when doing personal server stuff.
What we really just need is a simple webhook... Fuck...
@ -203,9 +203,11 @@ Only one small thing - if you are hosting the container on a private registry (l
# Conclusion
PHEW! I started this blog post using words like "simple" and "easy" - but it got a bit out of hand I must admit.
The workflow is very simple now though. You don't have to contiously deal with the mess of deploying your stuff, and you dont have to commit unneccesary autogenerated stuff to git.
The workflow is very simple now though. You don't have to contiously deal with the mess of deploying your stuff, and you don't have to commit unnecessary autogenerated stuff to git.
Just focus on writing posts and publish them by merging to `main`. Nice and automated 😁.
## P.S.
You may notice that the CI script on the real blog repository is a bit more complicated than what we've went through in this post, but the extra complexity only comes from some stupid technicalities regarding my build server being based on ARM rather than x86 (raspberry pi).
The script we made here is plenty good to get you started.
{{< centered image="/6616144.png" >}}

View File

@ -0,0 +1,78 @@
+++
date = '2024-12-04'
draft = true
title = "How to Host Docker Containers Easily in The Cloud"
tags = ["howto", "tutorial", "web"]
categories = ["technical"]
+++
In this post, we will be going over how to set up a [portainer]() managed docker environment, and how to use it.
This is ideal if you want to host a personal website, a [blog](/posts/how-to-blog), a personal [github](git.gtz.dk) or whatever your development heart desire.
If you choose to follow along, by the end of it, you will have an environment where you can just add or remove docker based services. It's even quite secure!
## Portainer
## Traefik
## Keycloak
## Automatic backups
## TODOs
- [ ] 2FA the control dashboards through keycloak
- [ ] geoblocking the control dashboards
- [ ] start the article with a demo of what we'll be making
- MAYBE:
- [ ] portainer introduction (maybe)
- [ ] traefik introduction (maybe)
- [ ] add a "skip if you already know portainer and traefik"
```yaml
services:
postgresql:
image: postgres:16
environment:
- POSTGRES_USER=keycloak
_ POSTGRES_DB=keycloak
- POSTGRES_PASSWORD=secret
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
- keycloak
keycloak:
image: quay.io/keycloa/keycloak:22
restart: always
command: start
depends_on:
- postgresql
environment:
# traefik handles ssl
- KC_PROXY_ADDRESS_FORWARDING=true
- KC_HOSTNAME_STRUCT=false
- KC_HOSTNAME=keycloak.gtz.dk
- KC_PROXY=edge
- KC_HTTP_ENABLED=true
# connect to the postgres thing
- DB=keycloak
- DB_URL='jdbc:postgresql://postgres:5432/postgresql?ssl=allow'
- DB_USERNAME=keycloak
- DB_PASSWORD=secret
- KEYCLOAK_ADMIN=admin
- KEYCLOAK_ADMIN_PASSWORD=admin
networks:
- proxy
- keycloa
labels:
- "traefik.enable=true"
- port=8080
networks:
proxy:
external: true
keycloak:
```
{{< centered image="/6616144.png" >}}

View File

@ -0,0 +1,120 @@
+++
date = '2025-01-27'
draft = false
title = 'Softmod your Original Xbox Today'
tags = ['technical', 'games', 'modding']
categories = ['technical', 'personal']
+++
If you want to skip the personal story, the tutorial part starts [here]({{< ref "xbox-modding.md#softmodding-the-xbox" >}}).
The original Xbox is a phenominal little machine.
In this post I will go over my journey of modding my own personal xbox.
Feel free to follow along, but this is mostly just a recollection of my journey for the sake of writing it down.
## First Things First
If you own an Xbox Original and you haven't removed the clock capacitor yet, DO IT NOW. YOU SHOULD'VE DONE IT SEVERAL
YEARS AGO, IT *WILL* KILL YOUR XBOX.
Even if you are not sure if it's removed or not, please check to make sure. This is incredibly important.
With that out of the way, let's begin.
## The Beginnings
It all started with I was about 14 years old.
I remember it clearly.
It was early 2010 and I had saved up my allowance for a while and wanted to buy something for myself.
So as any 14 year old buy with marginal financial freedom, I went to the local GameStop just to browse.
I was already an avid Halo fan, so I was looking around at the Halo 3 and Gears of War copies that they had, as well as
the other xbox 360 games showing off on the store shelves.
But alas, I did not own an Xbox 360, or any (real) videogame console for that matter.
So I opted to buy something else, I don't remember what excactly.
What I do remember is that when I went up to the counter, I saw that they had a used Xbox original (back then we called
it the xbox 1) for sale!
And only for 1001kr! Which was... not excactly cheap at the time, but hey, I didn't know better.
I had saved up just over 1000kr! And the Halo 2 Collectors edition was bundled with it! Holy crap!!
This was a match made in heaven and I bought it on the spot in favor of whatever else I wanted.
Proud, and with my heart pumping (this was the biggest purchase I had ever done at the time), I took it home and
deliberately hid it from my mother, because she wouldn't approve of me spending my hard earned allowance on a videogame
console.
A couple of years earlier, my sister and I received a small CRT TV with an in-built DVD player for our rooms so we
could watch movies and (some) TV in our rooms. This CRT had an S-VIDEO input.
I remember that it was such an adventure trying to figure out how to plug the Xbox to the TV. The figure-8 cable scared
me when it sparked when I plugged it into the Xbox and I thought I broke it, but I just had to change the input on the
TV. And when I finally got it working I was rewarded with the comforting green glow of the internal clock needing to be
set. I promptly pressed 'A' without changing anything, inserted the Halo 2 disc and played for the first time on my very
own video game console.
I sneak-play'ed so much Halo 2, that I missed a lot of homework, and sleep. I distinctly remember one night I played
(with no sound mind you) for uncountable hours. Oh to be a kid again. I know that at one point my mom found out and she
didn't actually care that I "wasted" the money. She only cared about my bedtime (ugh!) and my homework (double ugh!) -
which is fair, but still.
A couple months after the purchase, I wanted to try out the Xbox Live features and play Halo 2 online (I did not know
you'd have to pay for it) so I found a way to connect an ethernet cable to the box and tried connecting.
But I was not able to get any connection. I kept trouble-shooting and then I realized that LITERALLY THE WEEK BEFORE
Microsoft had closed the Xbox Original live service down. What a bummer dude. Welp. At least I had the Halo 2 campaign.
## Getting a Taste for Modding
Much later. I am now in my ??'s.
TODO:
- Building my own PC
- Building skills
- Fixing my laptop (which broke all the time)
- Modding the Wii
- Modding the Playstation 2
The first game console that I modded was a Wii that I bought on a flea-market for next to nothing.
Side tangent: The Wii is the _easiest_ console to softmod. You only need an SDCard - that's it.
This Wii modding lit a fire under me, and I started taking apart
## Softmodding the Xbox {#softmodding-the-xbox}
There are a couple of directions you can take when it comes to modding the OG Xbox.
I will be exclusively *softmodding* mine, as if I were to solder anything that is required for hardmodding it, I would
at best: brick the console, and at worst burn my apartment to the ground.
This mod _does_ require purchasing some hardware though, namely:
- **An xbox (male) to USB (female) adapter.**
These are increasingly difficult to find, so if you tend to drag your feet on projects like these (like I tend to)
buy it now! Or you might have to make one yourself - and I just said that soldering is out of the picture for me.
It has to look like this:
{{< centered image="/xbox-to-usb.png" style="width: 40%" >}}
- **An older USB stick.**
The Xbox will reject most modern USB flash drives - it has to be a fairly small one (I used a 4GiB one), and no, you
cannot just set the partition sizes to be small, the physical hardware has to be old. You probably have one lying
around, or your parents might have one in their "random electronics" drawer.
- **A DVD burner and some (writable and blank) DVDs.**
This is mostly just to burn a single DVD with the softmodding tools on it. I think you can buy pre-burned discs, but
if you have a DVD burner (generally just a good doohickey to have), it's much easier to just use `xfburn` to burn the
disc yourself.
### Software
I am using GNU/Linunx, but all of these are also available on Microsoft Windows - I haven't checked if OSX have these,
but I wouldn't be surprised to find that they also work there.
- `xfburn` for burning DVDs.
## TODO:
- Link to MrMario (check for peertube link as a backup)
- Xbox softmodding tool disc
- Extras (chimp)
- Holy crap the IDE hot-swapping
## Upgrading the Xbox
Now that we have softmodded it, we can choose to upgrade the aging IDE harddrive with a slightly newer and larger
harddrive! This is totally optional, but I highly recommend it as it'll enable you to store many more games on the
console itself, rather than mucking about with DVD discs and a dying DVD drive.
## Thanks
I would like to thank [bringus studios](https://www.youtube.com/@BringusStudios) for keeping the interest of console
hacking alive and a special thanks to [mr mario](https://www.youtube.com/@MrMario2011) for his fantastic tutorials.
Please check both of these creators out.
{{< centered image="/6616144.png" >}}

View File

@ -1,3 +1,3 @@
<p align="center">
<img alt="example" src="{{.Get `image`}}" style="max-width: 100%;">
<img alt="example" src="{{.Get `image`}}" style="max-width: 100%; {{.Get `style`}}">
</p>

BIN
static/6616144.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 KiB

BIN
static/xbox-to-usb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB