Skip to content

Instantly share code, notes, and snippets.

View mrwormhole's full-sized avatar
🦇
wisdom is the offspring of suffering and time

Talha Altınel mrwormhole

🦇
wisdom is the offspring of suffering and time
View GitHub Profile
@adam-hanna
adam-hanna / systemd-cloudwatch-logs-tutorial.md
Last active July 10, 2024 03:19
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 June 18, 2024 16:07
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