Skip to content

Instantly share code, notes, and snippets.

View jasondewitt's full-sized avatar
:shipit:

Jason DeWitt jasondewitt

:shipit:
View GitHub Profile
@jasondewitt
jasondewitt / wptest.sh
Last active May 17, 2022 14:38
Install wptest.io via wp-cli
#!/bin/bash
echo "installing WP test content"
wp plugin install wordpress-importer --activate
curl -OL https://raw.githubusercontent.com/manovotny/wptest/master/wptest.xml
wp import wptest.xml --authors=create
wp plugin uninstall wordpress-importer --deactivate
rm wptest.xml
@jasondewitt
jasondewitt / headers.php
Created May 9, 2016 21:58
dump all headers in php
<?php
if (!function_exists('getallheaders')) {
function getallheaders()
{
if (!is_array($_SERVER)) {
return array();
}
$headers = array();
@jasondewitt
jasondewitt / incapsula.sh
Last active May 4, 2016 20:33
update nginx to allow various cloud service IPs
#!/usr/bin/env bash
# incapsula.sh
# grab the list of pingdom check public ips and format into a nginx config file to allow
# these addresses
# also handles set_real_ip_from, include both files into your config and check
# http://nginx.org/en/docs/http/ngx_http_realip_module.html for more info on real ip
allow_file='/etc/nginx/include/incapsula.conf'
realip_file='/etc/nginx/include/incapsula_realip.conf'
@jasondewitt
jasondewitt / merge.sh
Created September 25, 2015 22:02
merge log files into a single file
#!/bin/sh
export MFILE=merge_file.txt
export SFILE=complete_file.txt
for file in `ls *.log`
do
cat $file >> $MFILE