Skip to content

Instantly share code, notes, and snippets.

View jamesmehorter's full-sized avatar

James Mehorter jamesmehorter

  • Penske Media Corporation
  • Northport, Maine
View GitHub Profile
@jamesmehorter
jamesmehorter / gist:b5a813c766161b59db5b9574b24f4e57
Last active March 7, 2024 16:37
Does your IP Authentication subscription require an update?

IP Address authentication to PMC Digital Subscriptions currenly only supports IPv4. We will soon begin prioritizing IPv6 addresses. If you have provided any IPv4 addresses to us in order to facilitate IP authenticiation for your subscription, and your proxy and/or network also supports IPv6, you must provide those IPv6 addresses before XX/XX/XXXX. Failure to do this will result in an inability to access your subscription!

You must perform the following commands for all IPs which have been provided to us.

NOTE If the below indicates you do have IPv6 please consult with your IT Department/Network Admin if a CIDR range should be provided instead of individual IP addresses. If you do not provide this we will assume no range.

IP Authentication for a network

If you have provided us an IPv4 address for a network, e.g. 149.40.50.162, and you're currently in that network, i.e.

Entries from cPanel:
TXT @ v=spf1 +a +mx +ip4:65.99.237.195 ~all
TXT default._domainkey v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5eXw9G+JZHMRmTCyJ8mmZXb81OIrlccfrh/2DoyTz+MrDIjyA05HELPO1p9Q1WWpwP0joTK/F0nIEWp32NhwlXqr/znFTQd+h1zG7rd866fGrW1Hj3j5ae5aozdH5rwLp3cRTBwOmEE3F3X5CgzujoufZXH5IOFtqVzgUlos2yVz/fIszHDHlNqxMZpDTY+aB;
---------
Showing the entries are present:
https://www.whatsmydns.net/#TXT/hometownre.org

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@jamesmehorter
jamesmehorter / xmlrpc.php
Last active August 25, 2016 16:51
Only allow specific ips and ip ranges access to xmlrpc.php
<?php
$allow_access = false;
$visitor_ip = $_SERVER['REMOTE_ADDR'];
// Enter precise ips, or omit the last chunk to do a range
$allowed_ips = array(
'192.0.118.', // WPCOM Jetpack Range
'192.0.114.', // WPCOM Jetpack Range
'192.0.116.', // WPCOM Jetpack Range
Helpful posts:
http://www.slideshare.net/datacharmer/mysql-sandbox-3
http://nicksda.apotomo.de/2013/10/running-multiple-mysql-servers-with-different-versions-on-the-same-machine/
http://tech-for-me.blogspot.com/2012/07/installing-mysql-sandbox-on-centos-6.html
Check if cpan is insalled
If not, suo apt-get install cpan
Install libraries needed for newer mysql
apt-get install libaio1 libaio-dev
@jamesmehorter
jamesmehorter / something.php
Created February 11, 2016 17:01
Add the current post ID to the Customize admin menu URL
/**
* Add the current post ID to the Customize admin menu URL
*
* @internal Called via wp_before_admin_bar_render action
*
* @param null
*
* @return null
*/
function pmc_add_post_id_to_customizer_url(){
@jamesmehorter
jamesmehorter / Apparmor user-tmp
Last active August 29, 2015 14:22
VVV MySQL Won't start
# FILE LOCATION/NAME: /etc/apparmor.d/abstractions/user-tmp
# per-user tmp directories
owner @{HOME}/tmp/** rwkl,
owner @{HOME}/tmp/ rw,
# global tmp directories
owner /var/tmp/** rwkl,
/var/tmp/ rw,
owner /tmp/** rwkl,
@jamesmehorter
jamesmehorter / gist:244c1c9922e3c0629437
Last active August 29, 2015 14:22
Get permalink of page using a specific page template
$wire_page_permalink = "";
// Fetch the page using the wire page template
$wire_page = get_pages( array(
'meta_key' => '_wp_page_template',
'meta_value' => 'template-the-wire.php'
) );
// Fetch the wire page permalink
if ( ! empty( $wire_page ) && 0 < count( $wire_page ) ) :
if ( GUNS_DEBUGGING ) {
$script_extension = '.min.js';
} else {
$script_extension = '.js';
}
wp_enqueue_script( 'respond', get_template_directory_uri() . '/assets/js/src/respond' . $script_extension );
/* BEFORE */
.site-title {
background: url('images/logo.png') no-repeat;
height: 49px;
margin: 0;
padding: 0;
text-indent: -999em;
width: 268px;
}