Skip to content

Instantly share code, notes, and snippets.


Philip Iezzi onlime

View GitHub Profile
onlime / EventServiceProvider.php
Last active Dec 3, 2021
Log emails as *.eml in Laravel Mailer
View EventServiceProvider.php
namespace App\Providers;
use App\Listeners\LogSentMessage;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Illuminate\Mail\Events\MessageSent;
class EventServiceProvider extends ServiceProvider
onlime / accounts.list
Last active Sep 23, 2021
imapsync script to migrate multiple IMAP accounts in a row
View accounts.list
onlime / action.d_apache-get-dos.conf
Created Sep 9, 2021
Using a Fail2ban jail to mitigate against simple DoS attacks against Apache
View action.d_apache-get-dos.conf
# Fail2Ban filter to scan Apache access.log for DoS attacks
before = common.conf
# Option: failregex
# Notes.: regex to match GET requests in the logfile resulting in one of the
# following status codes: 401, 403, 404, 503.
# The host must be matched by a group named "host". The tag "<HOST>"
onlime / .eslintrc.js
Created Aug 30, 2021
Configure ESLint and Prettier for Vue/Nuxt.js project in VS Code
View .eslintrc.js
module.exports = {
root: true,
env: {
browser: true,
node: true,
parserOptions: {
parser: '@babel/eslint-parser',
requireConfigFile: false,
onlime / .env
Created Aug 30, 2021
Algolia Vue InstantSearch component in Nuxt/content
View .env
onlime / install-composer.yml
Created Aug 21, 2021
Small Ansible playbook to install latest-stable Composer
View install-composer.yml
- hosts: webservers
# Install Composer the lightweight way (without using installer)
- name: Composer | Install Composer latest-stable
checksum: 'sha256:'
dest: /usr/local/bin/composer.phar
onlime / .gitlab-ci.yml
Last active Aug 18, 2021
Simple SSH/rsync based continuous deployment of a Nuxt.js static frontend project with GitLab CI/CD
View .gitlab-ci.yml
image: node:current
# In case you did not set up $SSH_KNOWN_HOSTS variable:
# SSH_OPTS: '-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'
BASE_DIR: public_html/blog
onlime /
Created Aug 17, 2021
Recursively fetch dependent rows with mysqldump
#!/usr/bin/env python3
# Copyright (c) 2021 Philip Iezzi, Onlime GmbH -
import argparse
import subprocess
onlime /
Created Aug 17, 2021
Secure External Backup with ZFS Native Encryption
# This script usually is called on the first login and asks for a password
# to build the LUKS + ZFS encryption keys which then are stored only in volatile
# memory /mnt/ramfs (ramfs).
# This script is added to your /root/.profile in order you won't forget to
# build the encryption key each time you reboot the server.
# We are using ramfs instead of tmpfs as there is no swapping support in
# ramfs which is good in a security perspective.
onlime /
Created Aug 6, 2021
Helper script to remove old ZFS snapshots
#!/usr/bin/env python3
Helper script to remove old ZFS snapshots
Copyright (c) Onlime GmbH,
import argparse
from re import compile
from datetime import datetime, timedelta
from subprocess import check_output
import sys