Skip to content

Instantly share code, notes, and snippets.

View mrwormhole's full-sized avatar
Naïvety is a fool's blessing

Talha Altınel mrwormhole

Naïvety is a fool's blessing
View GitHub Profile
@adam-hanna
adam-hanna / systemd-cloudwatch-logs-tutorial.md
Last active March 3, 2025 18:42
Forward systemd service logs to AWS Cloudwatch

Introduction

I often find myself ssh'ing into my servers and checking my systemd service logs with $ journalctl -f -u {name}.service. One day I got tired of this and wanted all of my important logs in once place (Amazon AWS Cloudwatch). To my dismay, there weren't any real good tutorials on how to do so. So, voilà.

Steps

Overall, it's a fairly simple process consisting of the following few steps.

1. Modify the service file

Open the service file with $ sudo vi /lib/systemd/system/{name}.service

Modify the [Service] section:

@exocode
exocode / xfs-on-hetzner.yml
Last active March 12, 2025 18:01
Create xfs partitions on Hetzner via cloud-init. It keeps root disk available again after rebooting. Simply change your desired sizes and filesystem to use it for your needs.
#cloud-config
resize_rootfs: false
disk_setup:
/dev/sda:
table_type: 'mbr'
layout:
- 25
- 75
overwrite: true