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 | |
# Gets location information about the ip address of a local or remote computer | |
# by calling a public web service that performs ip geolocation. | |
# This function currently only supports IPv4 addresses. | |
function Get-PublicIP { | |
[CmdletBinding()] | |
param( | |
# The IP address to get location information for. |
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
/***************************************************************************/ | |
/* BAF_F_244_TRUNK_IDENTIFICATION */ | |
/***************************************************************************/ | |
{ | |
NULL, | |
"Trunk Identification", | |
10, | |
3, | |
{ | |
{ |
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
// Creates a table of known BAF module codes and their corresponding | |
// length, in bytes, including the module code itself. (i.e. module | |
// code 000 contains only the module code, and thus is 2 bytes - 0x000C) | |
// This is required when implementing a BAF parser, even if it only | |
// intends to support a subset of the module codes, because there is | |
// no way to determine the length of a module to even skip over it. | |
ModuleLengths = new Dictionary<int, int>( ); | |
ModuleLengths[0x000C] = 2; // MODULE 000 - TRAILER |
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 | |
Checks the exported commands in a set of modules looking for commands | |
that have naming conflicts. | |
.DESCRIPTION | |
When two modules export commands with the same name, there can be | |
unpredictable results when the unqualified name of the module is | |
used in scripts. | |
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 | |
# Takes one or more lines of text that were produced by a text-wrapping algorithm | |
# and attempts to 'unwrap' them so that the line breaks that were added are removed. | |
# | |
#.DESCRIPTION | |
# Unwrapping text is an error-prone process, because it is impossible to know for sure | |
# whether or not a hard line break was intentional or added as a result of word-wrapping. | |
# This function makes several assumptions about wrapped text. For example, if there are | |
# spaces at the end of a line and the following line is not blank, it is assumed that the | |
# line was wrapped. If there is a space on a blank line, it is assumed that the line |
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
# Adapted from the following post: | |
# How to Flush DNS Cache in Mac OS X | |
# http://osxdaily.com/2008/03/21/how-to-flush-your-dns-cache-in-mac-os-x/ | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root." 1>&2 | |
exit 1 | |
fi | |
OSVERSION=$(sw_vers -productVersion) |
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 | |
// In /wp-content/mu-plugins/wp-db-abstraction/translations/sqlsrv/translations.php, | |
// search for the lines that read: | |
// | |
// // SHOW COLUMNS | |
// if ( stripos($query, 'SHOW COLUMNS FROM ') === 0 ) { | |
// $end_pos = strlen($query); | |
// $param = substr($query, 18, $end_pos - 18); | |
// $param = "'". trim($param, "'") . "'"; | |
// $query = 'SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = ' . $param; |
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
#NoEnv | |
#SingleInstance, Ignore | |
SendMode Input | |
SetWorkingDir C:\Users\jeinstein\Dropbox\Tools\DevManView\x64 | |
OnExit, Cleanup | |
IsTouchEnabled = 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
-- Produces a table of matches within the string, along with the | |
-- character position and length of the matches. | |
SELECT * FROM Utils.RegexMatches('There are 10 people in 5 groups of 2.', '\d+'); | |
-- Produces a table of all the matched group expressions within the | |
-- string, along with the character position and length of the substrings. | |
SELECT * FROM Utils.RegexGroups('[email protected]', '^(?<user>[^@]+)@(?<domain>.*)$'); |
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 | |
# Exports objects to an Excel spreadsheet by writing them to a temporary | |
# CSV file and using Excel automation model to import it into a workbook. | |
# This allows formatting to be applied to columns which would not otherwise | |
# be possible in a plain CSV export. | |
function Export-Excel { | |
[CmdletBinding()] | |
param( |