Welcome to my blog!

Here you can find various topics about Infrastructure, Programming and all the rest that comes to my mind 🤓

NOTIMP DNS Error in Caddy

When you are configuring caddy as a reverse proxy for your homelab you can come across the following error message: Oct 12 09:35:11 nasmoritz caddy[10525]: {"level":"error","ts":1728718511.8123024,"logger":"tls","msg":"job failed","error":"service.your-homelab.com: obtaining certificate: [service.your-homelab.com] Obtain: [service.your-homelab.com] solving challenges: presenting for challenge: could not determine zone for domain \"_acme-challenge.service.your-homelab.com\": unexpected response code 'NOTIMP' for service.your-homelab.com. (order=https://acme-v02.api.letsencrypt.org/acme/order/REDACTED/REDACTED) (ca=https://acme-v02.api.letsencrypt.org/directory)"} I fixed this as I am also running a pi hole server by explictly defining the DNS Servers (in this case cloudflare) in the Caddyfile: ...

October 12, 2024 Â· 1 min Â· Moritz Gnisia

Fixing broken thumbnails due to timezone issue in Immich

While importing some old images to immich via the cli like immich upload -r some_path. I faced the issue that the thumbnails of the images were broken due to a timezone issue. You could also have seen this in the logs. I was able to resolve this issue by adding the TZ Variable to the .env file for the docker-compose config.

October 1, 2024 Â· 1 min Â· Moritz Gnisia

How can one use a function imported from another script in a vue component?

If you are developing multiple components in Vue, you might be facing the situation that you have the following folder structure: . └── src/ └── components/ ├── utils/ │ └── some_cool_functions.js ├── component_a.vue └── component_b.vue $ cat some_cool_functions.js export function function_b(id) { console.log("Do some stuff in function a " + id) } export function function_b(id) { console.log("Do some stuff in function b " + id) } <template> <div> .... <v-btn @click="function_a(item.id)" color="error">Some Button for Function A</v-btn> <v-btn @click="function_b(item.id)" color="error">Some Button for Function B</v-btn> </div> </template> <script> import { function_a, function_b } from './functions/some_cool_functions.js' export default { components: { }, setup() { }, data() { return { some_value: '' }; }, methods: { function_a, // <-- add this function_b, } } </script> Then you have a button in component_a.vue which would like use the function from utils script. Then you need to do the following: ...

November 30, 2023 Â· 1 min Â· Moritz Gnisia

What do you need to login into a EC2 instance via SSM?

Make sure you have an AMI where the SSM Agent is installed. If this is not the case update the user-data to install the agent VPC: Instance is running in a private subnet -> Ensure you have a NAT Gateway Instance is running in a public subnet -> Internet Access must be given / Ensure you have a Internet Gateway In both cases you need to allow HTTPS outgoing traffic (this means 443 with 0.0.0.0/0) If you don’t want to use a outgoing security group rule with 0.0.0.0/0, setup a VPC Endpoint. In this case make sure that DNS Queries via TCP/UDP are allowed on Port 53. Otherwise the DNS Queries won’t work.

November 24, 2023 Â· 1 min Â· Moritz Gnisia

How to straighten PDFs on MacOS with PDFScanner

With the Software PDFScanner you can automatically straighten PDFs which you have scanned. Just enable the Deskew after scan option.

November 24, 2023 Â· 1 min Â· Moritz Gnisia

Update one to many field with Graphql in GraphCMS

Update one to many field with Graphql in GraphCMS Currently I am working on a migration from a Django based website to a replace it with GraphCMS. As we have lots of entries in our database a manuel migration is not a feasible option and would lead to errors during the migration process. Therefore, I want to transfer the data between the two systems with standardized graphql / api calls. Problem The challenge I had was the following: In django we have a one-to-many field but I could not find the appropriate mutation wich updates the field correctly. You can do something like this (Please not that you have to customize the command for you GraphCMS schema): ...

March 20, 2021 Â· 1 min Â· Moritz Gnisia

Create Continuous Integration (CI) Pipeline in Gitlab

Create Continuous Integration (CI) Pipeline in Gitlab Agenda What is Continuous Integration (CI)? What it is the application? How does a CI Pipeline work? What do I need for a CI Pipeline? What steps are necessary? Small Project in Python Server Configuration Python Project Gitlab CI Yaml File stages: - test python_test: stage: test image: python:3.9 script: - pip3 install pipenv - pipenv install - pipenv run python3 -m pytest Server Configuration Server Update # SSH Login ~ ssh root@IP-Adresse # Update Server root@server:~$ apt-get update && apt-get upgrade Create new user # Create new user root@server:~$ useradd -m -s /bin/bash youtube # Change Password root@server:~$ passwd youtube # Add user to sudo Group root@server:~$ usermod -aG sudo youtube Disable root access per ssh # Edit SSH Config youtube@server:~$ sudo vim /etc/ssh/sshd_config # inside vim /PermitRootLogin yes mit no ersetzen # on your keyboard :wq # Restart ssh service root@server:~$ sudo systemctl restart ssh Password-less login + Installation of Docker # on your Laptop / PC ~ ssh-copy-id youtube@server-IP # Login mit youtube ohne Passwort # Installation of Docker youtube@server:~$ sudo apt-get install -y docker.io # Adding user to docker group root@server:~$ usermod -aG docker $USER # Logout and login again Checking of docker installation # Testen der Docker Installation youtube@server:~$ docker ps # Beispiel Container starten youtube@server:~$ docker run hello-world Install Gitlab Runner # Start Gitlab Runner # Resource: https://docs.gitlab.com/runner/install/docker.html youtube@server:~$ docker run -d --name gitlab-runner --restart always -v /srv/gitlab-runner/config:/etc/gitlab-runner \ -v /var/run/docker.sock:/var/run/docker.sock \ gitlab/gitlab-runner:latest # Register Gitlab Runner-> write gitlab.com oder your Gitlab Instanz Resource: https://docs.gitlab.com/runner/register/ youtube@server:~$ docker run --rm -it -v /srv/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner register Downloads Presentation Python Project Helpful Links https://docs.gitlab.com/ee/ci/README.html https://docs.pytest.org/en/stable/ https://docs.docker.com/ https://docs.gitlab.com/runner/install/docker.html https://docs.gitlab.com/runner/register/ Icons https://www.flaticon.com/authors/becr https://www.flaticon.com/autho https://www.flaticon.com/authors/freepik

January 3, 2021 Â· 2 min Â· Moritz Gnisia

Run/Start Docker Container and execute command

Run/Start Docker Container and execute command In some situations you have to test different commands inside a docker container but you might not want to keep running in the background. Then you can use the following command which: will start the container with docker_image execute a command specified after the -c argument docker run --rm -v `$(pwd)`:/temp_volume docker_image \ /bin/bash -c "cd /temp_volume && python3 script.py"

September 3, 2020 Â· 1 min Â· Moritz Gnisia

How to fix a wrong horizontal aligned column border in a multicolumn table in LaTex?

How to fix a wrong horizontal aligned column border in a multicolumn table? Problem I just had the following problem in LaTex: As you can clearly see in the image the border of the right column in the first row is not aligned with the border in the rows below. The LaTex code for this error is: % table excerpt Class Type & \multicolumn{3}{c}{A} & \multicolumn{3}{|c}{B} For simplicities reasons I only show a small except of the table. ...

July 9, 2020 Â· 1 min Â· Moritz Gnisia

How to remove booksmarks from PDFs?

Removal of booksmarks in PDFs Open Xournal++ Open the PDF Export the PDF again Now the bookmarks are removed

June 29, 2020 Â· 1 min Â· Moritz Gnisia