Skip to content

Instantly share code, notes, and snippets.

View mattrude's full-sized avatar

Matt Rude mattrude

View GitHub Profile
@mattrude
mattrude / changepassword.php
Created October 31, 2010 23:49
LDAP PHP Change Password Page
<?php
/**
* LDAP PHP Change Password Webpage
* @author: Matt Rude <http://mattrude.com>
* @website: http://technology.mattrude.com/2010/11/ldap-php-change-password-webpage/
*
*
* GNU GENERAL PUBLIC LICENSE
* Version 2, June 1991
@mattrude
mattrude / gist:889424
Created March 27, 2011 18:04
Changes My Computer to actual Computername
'==============================================================================
'LANG : VBScript
'NAME : computername.vbs
'DESCRIPTION: Changes My Computer to actual Computername
'==============================================================================
Option Explicit
Const HKEY_CLASSES_ROOT = &H80000000
Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002
@mattrude
mattrude / timesince.php
Created April 22, 2011 02:27
WordPress Plugin to display the time since a entered date.
<?php
/*
Matt Rude <matt@mattrude.com> - 1 Nov 2009
This shortcode displays the years since the date provided.
To use this shortcode, add some text to a post or page simmiler to:
[ts date='1983-09-02']
The date format is YYYY-MM-DD
@mattrude
mattrude / wp-backup.sh
Created August 11, 2011 00:26
WordPress Auto Backup Script
# /bin/bash
BKNAME=
DIR=
DBHOST=
DBNAME=
DBUSER=
DBPASS=
# Backup Varibles
BKDIR=
# Copyright 2010 Drew Blas <drew.blas@gmail.com>
# From: http://drewblas.com/2010/07/15/an-analysis-of-gpled-code-in-thesis
#
# 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 ANY WARRANTY; without even the implied warranty of
@mattrude
mattrude / markdownize_cgit.py
Created December 21, 2011 03:31 — forked from jasongraham/markdownize_cgit.py
Used by the cgit 'about-filter' to parse a markdown file.
#!/usr/bin/env python
#
# Copyright 2011, Jason Graham
#
# Uses python-markdown to convert a markdown document to the body
# of an HTML document to display with cgit (http://hjemli.net/git/cgit/).
#
# Install:
#
# 1- Install python-markdown ( sudo apt-get install python-markdown )
@mattrude
mattrude / gist:2005151
Created March 9, 2012 05:10 — forked from stran12/gist:1394757
Step-by-step installation of cGit with Nginx

How to install cGit on Nginx (Ubuntu server)

Step-by-step installtion of cGit on nginx without funky rewrite rules.

Pre-requisites

This is for ::

@mattrude
mattrude / post-receive.sh
Created May 13, 2012 15:57
An example git hook script to mail out commit update information.
#!/bin/sh
#
# Copyright (c) 2007 Andy Parkins
#
# An example hook script to mail out commit update information. This hook
# sends emails listing new revisions to the repository introduced by the
# change being reported. The rule is that (for branch updates) each commit
# will appear on one email and one email only.
#
# This hook is stored in the contrib/hooks directory. Your distribution
@mattrude
mattrude / mdr_post_rss.php
Created May 20, 2012 17:57
Adds a small footer to all rss & atom feed posts in WordPress.
/********************************************************************************
* Add Footer to WordPress RSS feeds. Add this snippet to your functions.php
*/
function mdr_postrss($content) {
if(is_feed()){
$site_name = get_bloginfo_rss('name');
$post_title = get_the_title_rss();
$home_url = home_url('/');
$post_url = post_permalink();
@mattrude
mattrude / git-hook-post-receive-email.sh
Last active October 11, 2015 16:37
Example of a post receive email file called by a git hook that sends a color coded formatted html email of the git diff
#!/bin/sh
#
# An example hook script to mail out commit update information. This hook
# sends emails listing new revisions to the repository introduced by the
# change being reported. The rule is that (for branch updates) each commit
# will appear on one email and one email only.
#
# This hook is stored in the contrib/hooks directory. Your distribution
# will have put this somewhere standard. You should make this script
# executable then link to it in the repository you would like to use it in.