Skip to content

Instantly share code, notes, and snippets.

@alanivey
alanivey / Homebrew.md
Last active August 18, 2018 14:59
Homebrew MAMP on OS X Mavericks
@alanivey
alanivey / gist:4709843
Created February 4, 2013 21:24
Chef MySQL Server use encrypted data bag for passwords
diff --git a/cookbooks/mysql/recipes/server.rb b/cookbooks/mysql/recipes/server.rb
index 8229adc..0caf44e 100644
--- a/cookbooks/mysql/recipes/server.rb
+++ b/cookbooks/mysql/recipes/server.rb
@@ -35,10 +35,21 @@ if Chef::Config[:solo]
].join(' '))
end
else
- # generate all passwords
- node.set_unless['mysql']['server_debian_password'] = secure_password
@alanivey
alanivey / php-fpm-www.conf
Last active December 15, 2015 03:09
php53-fpm on CentOS 5
; Start a new pool named 'www'.
[www]
; The address on which to accept FastCGI requests.
; Valid syntaxes are:
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
; a specific port;
; 'port' - to listen on a TCP socket to all addresses on a
; specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
@alanivey
alanivey / gist:6064500
Last active December 20, 2015 03:29
Pressflow 7 differences (October 2013)
diff -x '*.info' -x LICENSE.txt -ruN core/ pressflow/
diff -x '*.info' -x LICENSE.txt -ruN core/includes/bootstrap.inc pressflow/includes/bootstrap.inc
--- core/includes/bootstrap.inc 2013-08-07 22:04:26.000000000 -0400
+++ pressflow/includes/bootstrap.inc 2013-10-17 15:26:18.000000000 -0400
@@ -717,6 +717,22 @@
}
$is_https = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on';
+ // Load environmental config, if present.
+ if (isset($_SERVER['PRESSFLOW_SETTINGS'])) {
core = 7.x
api = 2
projects[drupal][version] = 7
@alanivey
alanivey / jail.local
Last active July 13, 2020 21:53
fail2ban filter for WordPress URLs
# Ban hosts attemping to connect to WordPress
[apache-wordpress]
enabled = true
filter = apache-wordpress
action = iptables-multiport[name=Apache-WordPress, port="http,https"]
logpath = /var/log/http/*access_log
maxretry = 3
bantime = 86400
#!/bin/bash
# tungsten-slave-createcachetables.sh
# Tungsten is not extracting data for the following pattern (Drupal 6 and 7):
# replicator.filter.replicate.ignore=*.access,*.cache,*.cache_*,*.ctools_*_cache,*.views_*_cache,*.sessions,*.watchdog
# This means that the tables would not exist on the slave. It would be ideal to have
# the tables exist, but be empty.
# This script will create empty tables for any table matching the pattern in 'grep' commands below.
# It is manually set to match the same replicator.filter.replicate.ignore in the tungsten config.
@alanivey
alanivey / .htaccess
Created November 15, 2013 15:13
WordPress default .htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
@alanivey
alanivey / gist:7535763
Created November 18, 2013 21:36
XtraBackup Incremental
# backup
innobackupex --no-timestamp /var/lib/mysql-backup/full
innobackupex --no-timestamp --incremental /var/lib/mysql-backup/incremental1 --incremental-basedir=/var/lib/mysql-backup/full
innobackupex --no-timestamp --incremental /var/lib/mysql-backup/incremental2 --incremental-basedir=/var/lib/mysql-backup/incremental1
innobackupex --no-timestamp --incremental /var/lib/mysql-backup/incremental3 --incremental-basedir=/var/lib/mysql-backup/incremental2
#prepare incrementals into full
innobackupex --apply-log --redo-only /root/backup/full
@alanivey
alanivey / shuttle_config.sh
Created December 10, 2013 18:46
Shuttle (http://fitztrev.github.io/shuttle/) config with Vagrant, all Storm on Demand (stormondemand.com) servers, and all Liquid Web servers
#!/bin/bash
echo "{"
echo "\"_comment\": \"Valid terminals include: 'Terminal.app' or 'iTerm'\","
echo "\"terminal\": \"iTerm\","
echo "\"hosts\": ["
echo "{"
echo "\"name\": \"Vagrant\","