Skip to content

Instantly share code, notes, and snippets.

View alexandermeindl's full-sized avatar

Alexander Meindl alexandermeindl

View GitHub Profile
@geerlingguy
geerlingguy / ansible-role-test.sh
Last active January 18, 2024 17:37
Ansible Role Test Shim Script
#!/bin/bash
#
# Ansible role test shim.
#
# Usage: [OPTIONS] ./tests/test.sh
# - distro: a supported Docker distro version (default = "centos7")
# - playbook: a playbook in the tests directory (default = "test.yml")
# - role_dir: the directory where the role exists (default = $PWD)
# - cleanup: whether to remove the Docker container (default = true)
# - container_id: the --name to set for the container (default = timestamp)
@alexandermeindl
alexandermeindl / sample_data.rb
Last active May 30, 2017 15:52
Create sample data for Redmine performance tests
desc <<-END_DESC
Seed sample data for benchmark tests - do not use it with production data!
Examples:
# get this script
cd $REDMINE_ROOT
wget -O lib/tasks/sample_data.rb https://gist.githubusercontent.com/alexandermeindl/ed6ae8a199f1b4869ca0f581b9d94f16/raw
# prepare base redmine data
export RAILS_ENV=test
bundle exec rake db:drop db:create db:migrate
@thomasjsn
thomasjsn / laravel-queue.service
Last active April 26, 2024 09:34
Laravel queue worker using systemd.
# Laravel queue worker using systemd
# ----------------------------------
#
# /lib/systemd/system/queue.service
#
# run this command to enable service:
# systemctl enable queue.service
[Unit]
Description=Laravel queue worker
@Nihisil
Nihisil / jail.local
Last active September 5, 2023 06:20
Send notifications to the Slack from fail2ban
...
action_with_slack_notification = %(banaction)s[name=%(__name__)s, port="%(port)$
slack[name=%(__name__)s]
action = %(action_with_slack_notification)s
...
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
@chadsmith
chadsmith / FaviconAwesome.js
Last active January 11, 2018 19:03
FontAwesome in Favicons
(function() {
var FaviconAwesome = function(icon, color, bg) {
'use strict';
var
container = document.createElement('div'),
span = document.createElement('span'),
body = document.body,
content,
canvas = document.createElement('canvas'),
getContext = function(w) {
@sidnei
sidnei / gist:7041338
Last active May 8, 2021 12:36
Using lvm thin provisioning
# Using lvm thin provisioning, per https://github.com/lxc/lxc/pull/67
# First we create a volume group to hold the thin pool
$ sudo vgcreate lxc /dev/sde3
# Then create a thin-pool named 'tp' within that volume group
$ sudo lvcreate -l 90%VG --type thin-pool --thinpool tp lxc
@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@ck-on
ck-on / ocp.php
Last active March 25, 2024 09:30
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)#ocp #php #opcache #opcode #cache #zend #optimizerplus #optimizer+
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.7
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.7 2015-09-01 regex fix for PHP7 phpinfo
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
@2called-chaos
2called-chaos / setup-autossh-tunnel.sh
Last active April 30, 2018 15:38
Adds a start script which will setup a port forwarding over SSH (via autossh) for database traffic tunneling. You can use this script for every port actually. I might called it different but I only need it for MySQL ;-)
#!/bin/bash
# Install:
# curl -O https://gist.githubusercontent.com/2called-chaos/4285767/raw/setup-autossh-tunnel.sh
# chmod u+x setup-autossh-tunnel.sh
# ./setup-autossh-tunnel.sh
SSH_USER="mysql_tunnel"
SSH_SERVER="db.example.net"
SSH_PORT="22"