Skip to content

Instantly share code, notes, and snippets.

@taddev
taddev / lock_wp-content.sh
Last active August 29, 2015 13:56
A series of scripts to manage the permissions for various wordpress directories in bulk. The *lock* scripts will remove write access to the files while the *unlock* scripts will add it.
#!/bin/bash
LOCKFILE="/home/tad/scripts/.unlocked_wp-content"
WPDIR="/var/www/localhost/htdocs/blog/wp/wp-content"
if [ -f $LOCKFILE ]; then
echo "Locking WP-Content Directory"
find $WPDIR -type f -exec chmod 644 {} \;
find $WPDIR -type d -exec chmod 755 {} \;
rm -f $LOCKFILE
@taddev
taddev / AddCert.ps1
Created October 27, 2012 04:17
A simple way to sign code in PowerShell
#
# Author: Tad DeVries
# Email: taddevries@gmail.com
# FileName: AddCert.ps1
#
# Description: Allow a simple method to sign code.
#
# Copyright (C) 2010 Tad DeVries
#
# This program is free software; you can redistribute it and/or
@taddev
taddev / InputTest.ps1
Created October 27, 2012 04:37
An input test to understand piping in Powershell
param( [switch]$parent, [switch]$child, [switch]$help, [string]$template );
function displayHelp()
{
echo "Input is piped in from the command line.`nThis script will process some stuff";
echo "Parameters:`n";
echo "`t-child`tProcess the child nodes";
echo "`t-parent`tProcess the parent nodes";
echo "`nExample:";
echo "`t1,2,3|.\InputTest.ps1 -child -parent";
@taddev
taddev / SignCode.ps1
Created October 27, 2012 17:26
Code Signing Script for Powershell
#
# Author: Tad DeVries
# Email: taddevries@gmail.com
# FileName: SignCode.ps1
#
# Description:
# Uses a codesigning certifcate in your certificate list
# to sign the code. You may need to edit the options below
# to select the correct certificate if you have more than
# one like I do.
@taddev
taddev / yamlStorage.class.php
Created November 25, 2012 17:44
YAML storage class providing simple inser/modify/delete operations.
<?php
/*
# Author: Tad DeVries
# Email: taddevries@gmail.com
# FileName: yamlStorage.class.php
#
# Description:
# This class provides a simple mechanism for inserting/modifying/deleting
# information in a YAML file.
#
@taddev
taddev / wp_secure.sh
Last active December 27, 2015 00:19
This is a BASH script that will change permissions on the various directories of a Wordpress site, including the entire site. The script assumes that you have a different user and group permissions set on the directory; the permissions on each folder and file should be defined something like this <user>:<web server user>. In this way your user a…
#!/bin/bash
#
# Copyright (C) 2013 Tad DeVries <tad@splunk.net>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
@taddev
taddev / gist:7275888
Last active May 2, 2016 17:20
Nginx reverse proxy settings for Exchange 2010/2013 autodiscover.
server {
listen 443;
server_name autodiscover.gwtest.us;
# Enable SSL
ssl on;
ssl_certificate /etc/ssl/nginx/mail.gwtest.us.crt;
ssl_certificate_key /etc/ssl/nginx/mail.gwtest.us.open.key;
ssl_session_timeout 5m;
@taddev
taddev / RunElevated.ps1
Created October 27, 2012 04:43
Create a sudo-like command for Powershell
#
# Author: Tad DeVries
# Email: taddevries@gmail.com
# FileName: RunElevated.ps1
#
# Description:
# Creates a "sudo" like command to elevate another
# command to administrative level. This is used to
# simplify the CLI interaction and create a little
# home like feeling for the *nix users out there.
@taddev
taddev / listExample.c
Created February 28, 2013 00:02
This program demonstrates a simple doubly linked list used to store names and phone numbers. There are methods to add, search, edit, delete, and print records. This program ignores user input validation since pointer and memory manipulation are the key goals.
/*
* Author: Tad DeVries <tad@splunk.net>
* Date: 2013/02/27
*
* Language: C
*
* Description: This program demonstrates a simple doubly linked list
* used to store names and phone numbers. There are methods to add, search,
* edit, delete, and print records. This program ignores user input validation
* since pointer and memory manipulation are the key goals.
@taddev
taddev / nginx.conf
Last active July 27, 2023 10:49
Nginx reverse proxy to Exchange 2010/2013
server {
listen 80;
#listen [::]:80;
server_name mail.gwtest.us autodiscover.gwtest.us;
return 301 https://$host$request_uri;
}
server {
listen 443;
#listen [::]:443 ipv6only=on;