This file contains 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
import requests | |
import json | |
from urlparse import urlparse | |
sip_domain = "SIP_DOMAIN.COM" | |
username = "USERNAME@SIP_DOMAIN.COM" | |
password = "YOUR_LYNC_PASSWORD" | |
def extractAuthURL(str): | |
start = str.find('MsRtcOAuth'); |
This file contains 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
#!/usr/bin/python | |
# | |
# Convert windows sid to centrify express generated uid | |
# http://community.centrify.com/t5/DirectControl-Express-for-UNIX/RE-Evaluating-Centrify-Express-Now-And-Have-Some-Questions/td-p/3174 | |
import argparse | |
import re | |
def sid(value): | |
sidrx = re.compile('^S-1-5-\d{2}-\d+-(\d{4,10})-\d+-(\d+)$') | |
m = sidrx.match(value) |
This file contains 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.smbAccessDriver.php.orig 2014-10-23 11:15:47.699206429 -0400 | |
+++ class.smbAccessDriver.php 2014-10-23 11:21:50.423194343 -0400 | |
@@ -86,16 +86,33 @@ | |
require_once(AJXP_BIN_FOLDER."/pclzip.lib.php"); | |
$filePaths = array(); | |
foreach ($src as $item) { | |
- $realFile = call_user_func(array($this->wrapperClassName, "getRealFSReference"), $this->urlBase.(($item[0] == "/")? "" : "/").AJXP_Utils::securePath($item)); | |
- $basedir = trim(dirname($realFile))."/"; | |
- $filePaths[] = array(PCLZIP_ATT_FILE_NAME => $realFile, | |
- PCLZIP_ATT_FILE_NEW_SHORT_NAME => basename($item)); |
This file contains 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
// based on the grid from: http://knockoutjs.com/examples/resources/knockout.simpleGrid.3.0.js | |
// configuration: columns: {headerText, rowText (fn or property name,) headerClass, cellTemplate} | |
(function () { | |
// Private function | |
function getColumnsForScaffolding(data) { | |
if ((typeof data.length !== 'number') || data.length === 0) { | |
return []; | |
} | |
var columns = []; | |
for (var propertyName in data[0]) { |
This file contains 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
# | |
# Print a summary of disk usage in the supplied directory | |
# -directory <directory> | |
# | |
Param( | |
[parameter(Mandatory=$true)] | |
[alias("d")] | |
$directory | |
) |
This file contains 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
import RPi.GPIO as GPIO | |
import time | |
from pygame import mixer | |
import random | |
GPIO.setmode(GPIO.BCM) | |
TRIG = 23 | |
ECHO = 24 | |
# | |
# background music |
This file contains 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
param ( | |
[string]$username = $(throw "-username is required.") | |
) | |
# | |
# Load Account Details | |
# | |
$user = Get-ADObject -Filter {(sAMAccountName -eq $username)} -Properties 'ObjectSID','uidNumber' | |
$sidStr = $user.ObjectSID | |
"Found ObjectSID: {0} for {1}" -f $sidStr,$username | |
# |
This file contains 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
/* | |
* File: main.c | |
* Author: toaster | |
* | |
* Created on November 5, 2015, 8:45 PM | |
*/ | |
#include <xc.h> /* XC8 General Include File */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> |
This file contains 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
function getMonday { | |
$days="Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday" | |
return (Get-Date).AddDays(-([array]::IndexOf($days,(Get-Date).DayOfWeek.ToString())-1)) | |
} |
This file contains 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
$user = "NT User:S-1-5-21-579602563-1105609867-1454996784-1641" | |
$mailbox = "[email protected]" | |
$folders = @(Get-MailboxFolderStatistics $mailbox | Where {!($exclusions -icontains $_.FolderPath)} | Select FolderPath) | |
foreach ($origFolder in $folders) { | |
$id = $mailbox + ":" + $origFolder.FolderPath.Replace('/','\') | |
# Uncomment this to list all unattached sids | |
# get-MailboxFolderPermission -Identity $id | where {$_.user -like "*S-1-5*"} | |
# Remove dead permissions | |
if ($perm = get-MailboxFolderPermission -Identity $id -user $user -ErrorAction SilentlyContinue) { | |
remove-MailboxFolderPermission -Identity $id -user $user -Confirm:$false -ErrorAction STOP |
OlderNewer