Skip to content

Instantly share code, notes, and snippets.

View pancudaniel7's full-sized avatar
🎯
Focusing

Daniel pancudaniel7

🎯
Focusing
View GitHub Profile

Logrotate Configuration with Systemd Timer

This document explains how to set up logrotate to manage log files more frequently using a systemd timer. This approach is useful for log files that grow rapidly and need to be rotated more often than the daily rotation typically provided by cron jobs.

Logrotate Configuration

First, set up the logrotate configuration for your specific log file. Create a file in /etc/logrotate.d/ for your application. Here is an example configuration that rotates a log file when it reaches a certain size:

#!/bin/bash
# Logrotate Configuration
echo "Setting up Logrotate configuration for your application..."
cat <<EOF > /etc/logrotate.d/logrotate_size_check
/var/log/syslog {
size 100M
rotate 30
compress
missingok

Logrotate Configuration with Systemd Timer

This document explains how to set up logrotate to manage log files more frequently using a systemd timer. This approach is useful for log files that grow rapidly and need to be rotated more often than the daily rotation typically provided by cron jobs.

Logrotate Configuration

First, set up the logrotate configuration for your specific log file. Create a file in /etc/logrotate.d/ for your application. Here is an example configuration that rotates a log file when it reaches a certain size:

Log Truncation Utility with systemd

This document explains how to set up and use a log truncation utility on a Linux system using systemd

Setup

Step 1: Script Creation

  1. Create the Script (truncate_logs.sh):

Pulumi Go remote debugging

In this guide, we will walk through the setup and steps needed to start a remote debugging session for a Pulumi Go application.

Pre-installation Requirements

Before you begin, ensure you have the necessary tools installed on your system. The following are required to successfully run and debug the application:

Delve Debugger

#!/bin/bash
# 1 - project name (default: ansible)
project_name=${1:-ansible}
ansible_config_file_url="https://gist.github.com/alivx/2a4ca3e577ead4bd38d247c258e6513b"
mkdir -p $project_name/{playbooks,roles,inventory} && \
touch $project_name/{playbooks,roles,inventory}/.gitkeep && \
curl -o $project_name/ansible.cfg https://gist.githubusercontent.com/alivx/2a4ca3e577ead4bd38d247c258e6513b/raw/fe2b9b1c7abc2b52cc6998525718c9a40c7e02a5/ansible.cfg
#!/bin/bash
# This script will backup your n last commits in to it to git-backups directory
BACKUP_DIR="$HOME/git-backups"
LOG_FILE="/var/log/git_backup.log"
GIT_REPO_DIR="${1:-/Users/pancudaniel/workspace/pragma-infrastructure}"
mkdir -p "$BACKUP_DIR"
TIMESTAMP=$(date +"%Y-%m-%d")

Daily Git Backup Script

This bash script automatically backs up your last five Git commits to a specified directory. It's designed to be run on macOS using launchd, ensuring your backups are created daily without manual intervention.

Prerequisites

  • macOS operating system.
  • Basic understanding of terminal commands.
  • Git repositories that you want to back up.
#!/bin/bash
# Generates terraform multiple workspaces project structure
project_name=${1:-terraform-project}
mkdir $project_name && \
cd $project_name && \
mkdir -p environments/{dev,staging,prod} && \
mkdir -p modules && \
@pancudaniel7
pancudaniel7 / BackendEngineerSpecialistGradingScale.md
Last active March 15, 2024 19:08
Senior Backend Engineer Specialist Grade Scaling

Senior Backend Engineer Specialist Grading Scale

Essential categories to consider when conducting an interview for a senior generalist software developer

Observation: In the grade cell you can add a grade between 1 and 10 for that category

Technical Proficiency [Grade]
  • Depth of knowledge in relevant programming languages, frameworks, and tools