Skip to content

Instantly share code, notes, and snippets.

View samsav's full-sized avatar

Sampo Savolainen samsav

  • Eugene, OR
View GitHub Profile
@samsav
samsav / log-memory-usage.service
Created October 2, 2025 18:39
A bash script and systemd files for periodically logging memory use on a host
[Unit]
Description=Log memory usage and top processes on an EC2 instance running Amazon Linux 2023
[Service]
Type=oneshot
ExecStartPre=/usr/bin/mkdir -p /home/ec2-user/memlog
ExecStart=/home/ec2-user/log_memory_usage.sh /home/ec2-user/memlog/memory_summary.log /home/ec2-user/memlog/top_processes.log
StandardOutput=journal
StandardError=journal
User=ec2-user
@samsav
samsav / zendesk_analysis.py
Last active December 22, 2023 06:17
Scripts for downloading and analyzing Zendesk Help Center contents
"""
Script for analyzing Zendesk Help Center articles
Extracts the following statistics from article body content:
- word count
- average sentence length
- number of sentences that are too long (as defined by the LONG_SENT_LIMIT
parameter)
- readability scores (Flesch Reading Ease and Automated Readability Index)