Skip to content

Instantly share code, notes, and snippets.

View aristipp's full-sized avatar

Christian Glasmeyer aristipp

View GitHub Profile
@aristipp
aristipp / mysql-levenshtein.sql
Created May 11, 2020 21:52 — forked from Kovah/mysql-levenshtein.sql
Levenshtein function for MySQL
-- Levenshtein function
-- Source: https://openquery.com.au/blog/levenshtein-mysql-stored-function
-- Levenshtein reference: http://en.wikipedia.org/wiki/Levenshtein_distance
-- Arjen note: because the levenshtein value is encoded in a byte array, distance cannot exceed 255;
-- thus the maximum string length this implementation can handle is also limited to 255 characters.
DELIMITER $$
DROP FUNCTION IF EXISTS LEVENSHTEIN $$
CREATE FUNCTION LEVENSHTEIN(s1 VARCHAR(255) CHARACTER SET utf8, s2 VARCHAR(255) CHARACTER SET utf8)
@aristipp
aristipp / ubuntu-webmin.yml
Created November 7, 2019 09:12 — forked from lzhengqc/ubuntu-webmin.yml
Ansible playbook: install Webmin on Ubuntu
---
#
# Ansible playbook: Webmin for Ubuntu v201501302302
# Louis T. Getterman IV (@LTGIV)
# www.GotGetLLC.com / www.opensour.cc
#
# Example Usage:
# [user@host ~$] ansible-playbook /etc/ansible/playbooks/webmin.yml --extra-vars 'target=nameFromHostsFile'
#
- hosts: '{{ target }}'
@aristipp
aristipp / phpswitch.sh
Created October 6, 2018 23:41
Modified script from https://github.com/philcook/brew-php-switcher, now working with the Apache installed via brew. Only a workaround, the original script should be altered to support both versions of Apache. Add #LoadModule php5_module libexec/apache2/libphp5.so to your Apache conf before using this script the first time.
#!/bin/bash
# Creator: Phil Cook
# Email: phil@phil-cook.com
# Twitter: @p_cook
brew_prefix=$(brew --prefix | sed 's#/#\\\/#g')
brew_array=("5.6","7.0","7.1","7.2")
php_array=("php@5.6" "php@7.0" "php@7.1" "php@7.2")
valet_support_php_version_array=("php@5.6" "php@7.0" "php@7.1" "php@7.2")
php_installed_array=()
@aristipp
aristipp / haconfig.sh
Created September 29, 2015 13:05 — forked from jlazic/haconfig.sh
Split monolithic HAProxy configuration
#!/bin/bash
#Requirements: etckeeper, diffcolor
#This script concatenates multiple files of haproxy configuration into
#one file, and than checks if monolithic config contains errors. If everything is
#OK with new config script will write new config to $CURRENTCFG and reload haproxy
#Also, script will commit changes to etckeeper, if you don't use etckeeper you
#should start using it.
#Script assumes following directory structure:
#/etc/haproxy/conf.d/