This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$GROUPS = Get-ADGroup -Filter * -Properties proxyAddresses,mail,displayName | |
$GROUPS | ForEach { | |
$GROUP = $_ | |
$GROUP.proxyAddresses = $null | |
if($GROUP.mail){ | |
$MAIL = $GROUP.mail.ToString() | |
$NAME = $GROUP.name.ToString() | |
$GROUP.proxyAddresses = "SMTP:$MAIL" | |
$GROUP.displayName = $NAME | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Manages Shadow Groups in Active Directory | |
.DESCRIPTION | |
This script automatically manages the member users of groups placed in | |
"OU=Shadow Groups,DC=contoso,DC=com". Users and computers that are contained | |
by OUs that match the name of a shadow group are automatically added to that group, | |
and users that are no longer contained by a matching OU are removed from | |
the group. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Total number of days | |
var days = process.argv[2] || 90 | |
//List of books | |
var books = { | |
Genesis: 50, | |
Exodus: 40, | |
Leviticus: 27, | |
Numbers: 36, | |
Deuteronomy: 34, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Git branch auto-clone script | |
# https://gist.github.com/kenaniah/7af6efe09df138a8a2b9 | |
# BASE should point to a bare git repo | |
# DEST should point to a directory for branches to be checked out into | |
# Define where things are pulled from | |
BASE=$1 | |
DEST=$2 | |
# Fetch to the source repo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- PostgreSQL database dump | |
-- | |
SET statement_timeout = 0; | |
SET lock_timeout = 0; | |
SET client_encoding = 'UTF8'; | |
SET standard_conforming_strings = on; | |
SET check_function_bodies = false; | |
SET client_min_messages = warning; | |
-- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Povides a function that allows files to be uploaded to an Amazon S3 bucket | |
function upload_to_s3 { | |
# Definitions | |
bucket=<bucket name> | |
resource=$2/`basename $1` | |
content_type="application/x-compressed" | |
date=`date -R` | |
md5=`openssl dgst -md5 -binary "$1" | openssl enc -e -base64` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Worker(object): | |
@staticmethod | |
def _irr(....): | |
... | |
def foo(): | |
with multiprocessing.Pool() as pool: | |
results = {} | |
results['gross_xirr'] = pool.apply_async(Worker._irr, (gross_stream, 0.115, 'xnpv')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Launch the backend | |
exec('/bin/bash -c "nohup ' . $start_command . ' 1> >(logger -p user.warning -t accounting.py) 2> /dev/null &" > /dev/null 2>&1'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Manages Shadow Groups in Active Directory | |
.DESCRIPTION | |
This script automatically manages the member users of groups placed in | |
"OU=Shadow Groups,DC=mydomain,DC=local". Users and computers that are contained | |
by OUs that match the name of a shadow group are automatically added to that group, | |
and users that are no longer contained by a matching OU are removed from | |
the group. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This isn't really a git hook, but it's manually called it after every fetch run. | |
# This script essentially wraps the actual post-receive hook. | |
# Build the standard input for the post-receive hook | |
cat refs/heads/* | paste TRAC_HEAD - > post-fetch.tmp | |
find refs/heads/* | paste post-fetch.tmp - | awk '{print $1, $2, $3}' > post-fetch.stdin | |
# Call the post-receive hook just like the commits were pushed |