Skip to content

Instantly share code, notes, and snippets.

@taddev
taddev / gihtubpage.conf
Last active January 25, 2024 14:56
NGINX Reverse proxy settings to Github pages
server {
listen 80 default_server;
listen [::]:80 ipv6only=on default_server;
server_name splunk.net blog.splunk.net www.splunk.net .taddevries.com;
access_log /var/log/nginx/blog.access_log main;
error_log /var/log/nginx/blog.error_log info;
return 301 https://blog.splunk.net;
}
server {
@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 / 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 / nginx.conf
Last active October 24, 2024 06:48
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;
@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 <[email protected]>
#
# 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:6212449
Last active September 8, 2023 00:41
Nginx Reverse Proxy with custom error if upstream proxy is not working.
server {
listen 80;
listen [::]:80 default server ipv6only=on;
location / {
proxy_intercept_errors on;
proxy_pass http://localhost:9000;
}
error_page 500 502 503 504 /50x.html;
@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 <[email protected]>
* 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 / yamlStorage.class.php
Created November 25, 2012 17:44
YAML storage class providing simple inser/modify/delete operations.
<?php
/*
# Author: Tad DeVries
# Email: [email protected]
# FileName: yamlStorage.class.php
#
# Description:
# This class provides a simple mechanism for inserting/modifying/deleting
# information in a YAML file.
#
@taddev
taddev / SignCode.ps1
Created October 27, 2012 17:26
Code Signing Script for Powershell
#
# Author: Tad DeVries
# Email: [email protected]
# 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 / RunElevated.ps1
Created October 27, 2012 04:43
Create a sudo-like command for Powershell
#
# Author: Tad DeVries
# Email: [email protected]
# 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.