Skip to content

Instantly share code, notes, and snippets.

View onlime's full-sized avatar

Philip Iezzi (Pipo) onlime

View GitHub Profile
@onlime
onlime / fixpreferences.sh
Created April 22, 2014 14:28
fix user preferences in Roundcube webmail
#!/usr/bin/env php
<?php
/*
+-----------------------------------------------------------------------+
| bin/fixpreferences.sh |
| |
| Copyright (c) 2014 Onlime Webhosting (http://www.onlime.ch) |
| Licensed under the GNU General Public License version 3. |
| |
| PURPOSE: |
@onlime
onlime / libxl.rb
Last active August 29, 2015 14:05
Homebrew php56-excel (using libxl)
require 'formula'
class Libxl < Formula
homepage 'http://www.libxl.com/'
url 'ftp://xlware.com/libxl-mac-3.6.0.tar.gz'
sha1 '52da78f73e4a8e727c8c73c99435f4136e3774c2'
def install
lib.install 'lib/libxl.dylib'
include.install Dir["include_c/*.h"]
@onlime
onlime / accounts.list
Last active May 4, 2023 12:08
imapsync script to migrate multiple IMAP accounts in a row
# <SRCUSER> <SRCPW> <DSTUSER> <DSTPW>
@onlime
onlime / zfs-destroy-snapshots.py
Created August 6, 2021 11:27
Helper script to remove old ZFS snapshots
#!/usr/bin/env python3
"""
Helper script to remove old ZFS snapshots
Copyright (c) Onlime GmbH, https://www.onlime.ch
"""
import argparse
from re import compile
from datetime import datetime, timedelta
from subprocess import check_output
import sys
@onlime
onlime / .gitlab-ci.yml
Last active August 18, 2021 16:02
Simple SSH/rsync based continuous deployment of a Nuxt.js static frontend project with GitLab CI/CD
image: node:current
variables:
# In case you did not set up $SSH_KNOWN_HOSTS variable:
# SSH_OPTS: '-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'
SSH_OPTS: ''
BASE_DIR: public_html/blog
KEEP: 5
default:
@onlime
onlime / build-encryption-key.sh
Created August 17, 2021 10:22
Secure External Backup with ZFS Native Encryption
#!/bin/bash
#
# 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
onlime / mysql-recursive-dump.py
Created August 17, 2021 10:26
Recursively fetch dependent rows with mysqldump
#!/usr/bin/env python3
#
# Copyright (c) 2021 Philip Iezzi, Onlime GmbH - https://www.onlime.ch
#
import argparse
import subprocess
header = """SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT;
SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS;
@onlime
onlime / install-composer.yml
Created August 21, 2021 23:24
Small Ansible playbook to install latest-stable Composer
- hosts: webservers
tasks:
# Install Composer the lightweight way (without using installer)
# https://getcomposer.org/download
- name: Composer | Install Composer latest-stable
get_url:
url: https://getcomposer.org/download/latest-stable/composer.phar
checksum: 'sha256:https://getcomposer.org/download/latest-stable/composer.phar.sha256sum'
dest: /usr/local/bin/composer.phar
@onlime
onlime / .env
Created August 30, 2021 21:33
Algolia Vue InstantSearch component in Nuxt/content
ALGOLIA_INDEX=dev_articles
ALGOLIA_APP_ID=ABCDE12345
#ALGOLIA_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ALGOLIA_SEARCH_ONLY_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ALGOLIA_HITS_PER_PAGE=5
ALGOLIA_QUERY_BUFFER_TIME=300
@onlime
onlime / .eslintrc.js
Created August 30, 2021 21:37
Configure ESLint and Prettier for Vue/Nuxt.js project in VS Code
module.exports = {
root: true,
env: {
browser: true,
node: true,
},
parserOptions: {
parser: '@babel/eslint-parser',
requireConfigFile: false,
},