Skip to content

Instantly share code, notes, and snippets.

View allella's full-sized avatar

Jim Ciallella allella

View GitHub Profile
@allella
allella / gist:ffdcf0a5dd9e147405b5
Last active May 8, 2017 13:59
Let's Encrypt .htaccess to Fix Issues with Drupal or Wordpress Getting "cannot connect" Error
# add this before all other rewrite rules in your .htaccess
# backup your Apache file(s) first to avoid breaking things
# BE SURE TO TEST AND RELOAD APACHE AFTER MAKING THIS EDIT
# allow Let's Encrypt to access it's challenge file without the rewrite rules screwing them up
RewriteEngine On
RewriteRule "^.well-known/acme-challenge" - [L]
# Now, run an error check and reload Apache
/usr/sbin/apachectl configtest && /etc/init.d/httpd reload
@allella
allella / gist:f3f297a8906bf7534d80
Last active February 14, 2016 23:20
Apache Disable SSL v2 and v3
# Whereever this line is defined (grep all Apache .conf files to make sure it's not defined in multiple places)
# use the following to disable SSL v2 and v3
# This is a best practice as of Feb 2016, but this is subject to change over time, so don't take this as gospel
SSLProtocol All -SSLv2 -SSLv3
@allella
allella / gist:c50826d639cb17e1ebd9
Last active August 5, 2016 15:38
Let's Encrypt Manual Webroot SSL Install for CentOS 6 or 7 With a Cron Job
# Change to the root user
su root
# EPEL is used by Letsencrypt auto to install packages it needs. This doesn't install anything, it just means
# extra packages in this Linux repo are available for installation
yum install epel-release
# Ideally you'd already have, or else install, Python 2.7 to avoid certain Python related messages, but if you
# don't want to bother it will work with Python 2.6
# See https://digitz.org/blog/lets-encrypt-ssl-centos-7-setup/ for more on Python 2.7 and CentOS
@allella
allella / gist:b2de20d3df17a867f3c3
Last active February 14, 2016 20:09
Updating Apache to Named Virtual Hosts For Multiple SSL Certificates on the Same 1 IP Address
# BE VERY CAREFUL IF YOU CHANGE YOUR Apache CONFIGURATION
# Backup your configuration before changing and run an error check before applying changes
# If you have 1 IP address for each SSL certificate then you probably don't need to do any of this
# If you have more than 1 site per IP address then this worked for me.
# It requires Apache with with SNI, which should already be part of Apache since it's been around for many years
# For more info see https://www.digicert.com/ssl-support/apache-multiple-ssl-certificates-using-sni.htm
# I changed to named Virtual Hosts https://httpd.apache.org/docs/2.2/en/vhosts/name-based.html , like this
vi /etc/httpd/conf/httpd.conf
@allella
allella / braintree.php
Created January 29, 2016 21:37
A Simple Braintree PHP Hosted Fields Example using an onPaymentMethodReceived To Override the Submit Button
<?php
Braintree_Configuration::environment('sandbox');
Braintree_Configuration::merchantId('YOURMERCHANTIDHERE');
Braintree_Configuration::publicKey('YOURPUBLICKEYHERE');
Braintree_Configuration::privateKey('YOURPRIVATEKEYHERE');
$result = Braintree_Transaction::sale([
'amount' => '150.00',
'paymentMethodNonce' => $_POST['nonce']
@allella
allella / gist:33f31c41028956c85b5f
Created January 23, 2016 16:15
Ubuntu Unity Startup Script for Elo Touchscreen Calibration
# saved this to ~/.config/upstart/elo-touch.conf
start on desktop-start
stop on desktop-end
script
xinput set-int-prop "Elo Serial TouchScreen" "Evdev Axis Calibration" 32 3928 300 155 3736
xinput set-int-prop "Elo Serial TouchScreen" "Evdev Axes Swap" 8 0
end script