Skip to content

Instantly share code, notes, and snippets.

View AubreyHewes's full-sized avatar
💭
I may be slow to respond.

Aubrey AubreyHewes

💭
I may be slow to respond.
View GitHub Profile
@AubreyHewes
AubreyHewes / ubuntu-install-bitchx.sh
Created January 21, 2015 23:24
Compile and Install BitchX on Ubuntu
#!/bin/sh
####################################################################################
#
# Download Compile and Install BitchX on Ubuntu
#
####################################################################################
# download bitchx source
# @todo make smarter, i.e. regexp, though now uses _always_ available commands (sic)
@AubreyHewes
AubreyHewes / phpstorm-eap-update
Last active May 3, 2021 13:25
Update/Install the latest PhpStorm EAP automatically (add to external tools)
#!/usr/bin/env bash
#######################################################################################################################
#
# Updates/Install the latest PhpStorm EAP
#
# --------------------------------------------------------------------------------------------------------------------
#
# * Retrieves the current version from the EAP wiki
# * If the new version is not the current version (based on symlink to PhpStorm) then updates
# * Creates a symlink from versioned folder to PhpStorm
@AubreyHewes
AubreyHewes / fix_multiple_domain_plugin_redirects.php
Created May 14, 2020 12:03
WordPress "Multiple Domain" & WPML compatability fix
/**
* Configured "Multiple Domain" plugin does not redirect root properly when working with WPML...
*
* X.nl -> /
* Y.nl -> /
* X.com -> /en/
* Y.com -> /en/
*/
function fix_multiple_domain_plugin_redirects() {
if (strpos(MULTIPLE_DOMAIN_DOMAIN, '.com') === false) {
@AubreyHewes
AubreyHewes / importhorde.php
Created December 11, 2014 09:52
Import Horde contacts/identities/preferences to Roundcube This is dependent on being placed within the roundcube bin directory.
<?php
//
// Usage Example:
// importhorde.php -r sqlite:////roundcube.sqlite?mode=0646 -h mysql://user:pass@127.0.0.1:3306/horde -c -p
//
define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
require_once INSTALL_PATH.'program/include/clisetup.php';
ini_set('memory_limit', -1);
@AubreyHewes
AubreyHewes / keybase.md
Created February 11, 2020 16:46
keybase.md

Keybase proof

I hereby claim:

  • I am aubreyhewes on github.
  • I am aubz (https://keybase.io/aubz) on keybase.
  • I have a public key ASC3wMoMN2EgSqyGR6DsvQ3LN5HpEPVUWbYneS5JLtOS-wo

To claim this, I am signing this object:

@AubreyHewes
AubreyHewes / notify_slack_munin.sh
Last active March 28, 2019 15:37 — forked from hugochinchilla/slack_munin.sh
Slack notification script for Munin
#!/usr/local/bin/bash
# Slack notification script for Munin
# Mark Matienzo (@anarchivist)
#
# To use:
# 1) Create a new incoming webhook for Slack
# 2) Edit the configuration variables that start with "SLACK_" below
# 3) Add the following to your munin configuration:
#
@AubreyHewes
AubreyHewes / ttf-mscorefonts-installer.sh
Last active October 24, 2018 08:47
ttf-mscorefonts-installer failure Ubuntu 18 18.04 18.10
#!/bin/bash
# After updating from 17.04 I get apt errors as the `ttf-mscorefonts-installer` package is not downloading
# the fonts properly timeouts/forbidden et al
sudo apt purge ttf-mscorefonts-installer
wget http://httpredir.debian.org/debian/pool/contrib/m/msttcorefonts/ttf-mscorefonts-installer_3.7_all.deb
sudo apt install ./ttf-mscorefonts-installer_3.7_all.deb && rm ./ttf-mscorefonts-installer_3.7_all.deb
@AubreyHewes
AubreyHewes / A.markdown
Created April 26, 2018 23:48 — forked from larrybotha/A.markdown
Fix SVGs not scaling in IE9, IE10, and IE11

Fix SVG in <img> tags not scaling in IE9, IE10, IE11

IE9, IE10, and IE11 don't properly scale SVG files added with img tags when viewBox, width and height attributes are specified. View this codepen on the different browsers.

Image heights will not scale when the images are inside containers narrower than image widths. This can be resolved in 2 ways.

Use sed in bash to remove width and height attributes in SVG files

As per this answer on Stackoverflow, the issue can be resolved by removing just the width and height attributes.

@AubreyHewes
AubreyHewes / rules-both.iptables
Created October 26, 2017 15:48 — forked from jirutka/rules-both.iptables
Basic iptables template for ordinary servers (both IPv4 and IPv6)
###############################################################################
# The MIT License
#
# Copyright 2012-2014 Jakub Jirutka <jakub@jirutka.cz>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
#!/bin/sh
# Reference ip6tables firewall rules for ICMPv6.
# Ref: https://www.cert.org/downloads/IPv6/ip6tables_rules.txt
#
# 11/07/2008
# Ryan Giobbi, CERT
#
# Please send feedback to <rag@cert.org>
# Don't use these rules on production systems without testing.