Skip to content

Instantly share code, notes, and snippets.

View israelshirk's full-sized avatar

Israel israelshirk

View GitHub Profile
<?php
add_action( 'template_redirect', 'nlp_ssl_template_redirect', 1 );
function nlp_ssl_template_redirect() {
if ( !is_ssl() && ! is_admin() ) {
if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http:' ) ) {
wp_redirect( preg_replace( '|^http://|', 'https://', $_SERVER['REQUEST_URI'] ), 301 );
exit();
} else {
@israelshirk
israelshirk / ks.cfg
Created October 14, 2015 20:45
RHEL7 kickstart
# Base settings install
# Zero everything out...
zerombr
clearpart --all --initlabel
# Generic boot settings...
cdrom
lang en_US.UTF-8
keyboard 'us'
@israelshirk
israelshirk / ks.cfg
Last active September 4, 2015 00:41
Packer race condition due to extra disks
# RHEL 6.7
install
zerombr
clearpart --all --initlabel
cdrom
lang en_US.UTF-8
keyboard 'us'
key dcc2e57bdcc6e4e5
rootpw --iscrypted $sadfasdfasdf --lock
network --onboot yes --device eth0 --bootproto dhcp --noipv6 --hostname=localhost.localdomain
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGKSpYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKcHCBMXGyImVSRudWxs1QkKCwwNDg8QERJcTlNDb21wb25lbnRzVU5TUkdCXE5T
Q29sb3JTcGFjZV8QEk5TQ3VzdG9tQ29sb3JTcGFjZVYkY2xhc3NPECgwLjAyNzQ1MTAw
NjcgMC4yMTE3NjQ3MjMxIDAuMjU4ODIzNDg0MiAxTxAmMC4wMzkzODA3NTE1NSAwLjE2
@israelshirk
israelshirk / serve-hhvm.sh
Last active August 29, 2015 14:25
Homestead provisioning tweak for hhvm
#!/usr/bin/env bash
if [ ! -f "/var/lock/installed-hhvm" ]; then
wget -O - "http://dl.hhvm.com/conf/hhvm.gpg.key" | apt-key add -
echo deb "http://dl.hhvm.com/ubuntu" "trusty" "main" | tee "/etc/apt/sources.list.d/hhvm.list"
apt-get -y update
apt-get -y install "hhvm"
sed -i 's/www-data/vagrant/g' "/etc/init.d/hhvm"
update-rc.d "hhvm" "defaults"
touch "/var/lock/installed-hhvm"
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "/definitions",
"type": "object",
"title": "Type Definitions",
"description": "Type Definitions",
"name": "definitions",
"definitions": {
"id": {
"id": "#/definitions/id",
@israelshirk
israelshirk / clone.sh
Created May 27, 2015 03:53
Mirror RH repos to local
#!/bin/bash
set -x
# rhel-x86_64-server-optional-6 RHEL Server Optional (v. 6 64-bit x86_64) 8,284
# rhn-tools-rhel-x86_64-server-6
for i in rhel-x86_64-server-6 rhel-x86_64-server-optional-6 rhn-tools-rhel-x86_64-server-6; do
mkdir -p /builds/repo/$i
reposync --downloadcomps --download-metadata -l -n --repoid=$i --download_path=/builds/repo/
@israelshirk
israelshirk / in-schema.json
Last active August 29, 2015 14:21
TV4 with recursive reference lookups... Just in case the graphics card keeps tossing cookies...
/*
Author: Geraint Luff and others
Year: 2013
This code is released into the "public domain" by its author(s). Anybody may use, alter and distribute the code without restriction. The author makes no guarantees, and takes no liability of any kind for use of this code.
If you find a bug or make an improvement, it would be courteous to let the author know, but it is not compulsory.
*/
(function (global, factory) {
if (typeof define === 'function' && define.amd) {
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDBVanTF5hz94NmFOEu4ZqNyg7S9kaKd5mVK6VxogPbzcSJhJhh4A96JCD0BthqnvGi88IWj4+xKYo30iEupZmY6v17YVNHDbdH1NI5euW+oY0uhoVrnv3D9jWoIlKBvKXS9d4GFmo6PCrOHxlXe5UrSluxTfXUis1Ea9R16Q0SuNoHVX43f5aq9U9VyMiR+tJMyG9YdyZpIM0l/oBfN05iwjLTfgvS3kdUZcIv4EI1I0ZwYJfm5cRPzCEN33DK903SOHLcBtqkudrnzzET+/h/uggtY+kPoUbam95XlcNquoBGhO/8swHkP1j2S97xHOENibpANYHxfu4ziysjs7Hd israel@mbp-2012-retina
@israelshirk
israelshirk / activemq-cpp.spec
Created May 13, 2015 20:03
ActiveMQ-cpp 3.8.2 spec file for RHEL6, no doc
Name: activemq-cpp
Version: 3.8.2
Release: 1%{?dist}
Summary: C++ Implementation of a JMS style Messaging Client
Group: Development/Libraries
License: ASL 2.0
URL: http://activemq.apache.org/cms/
Source0: http://www.apache.org/dist/activemq/activemq-cpp/source/activemq-cpp-library-%{version}-src.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)