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
using System; | |
using static System.Buffers.Binary.BinaryPrimitives; | |
namespace BinaryStruct | |
{ | |
public ref struct Reader | |
{ | |
public enum Endian | |
{ |
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
namespace DapperTest | |
{ | |
using Dapper; | |
using System.Data; | |
using static Dapper.SqlMapper; | |
namespace DapperTest | |
{ | |
interface IDbConnectionFactory |
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
using System; | |
using System.Linq; | |
using Microsoft.EntityFrameworkCore; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Hosting; | |
// Other classes can found at https://docs.microsoft.com/en-us/ef/core/get-started/overview/first-app | |
// Requires generation of migrations using ef tools | |
// Standalone, this is a bad idea |
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
from __future__ import print_function | |
import json | |
import boto3 | |
import datetime | |
dynamodb = boto3.resource('dynamodb', region_name='ap-southeast-1') | |
table = dynamodb.Table('TableNameHistory') |
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
PROXY="http://username:password@host:port" | |
export http_proxy=$PROXY | |
export https_proxy=$PROXY |
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
PS C:\> sqlcmd -S 'localhost\SQLEXPRESS' -U username -P RealPassword -Q "select getdate()" | |
----------------------- | |
2016-06-23 12:37:12.523 | |
(1 rows affected) | |
PS C:\> sqlcmd -S 'localhost\SQLEXPRESS' -U -U username -P FakePassword -Q "select getdate()" | |
Sqlcmd: Error: Microsoft SQL Server Native Client 11.0 : Login failed for user 'username'.. |
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
Function Start-Countdown | |
{ <# | |
.SYNOPSIS | |
Provide a graphical countdown if you need to pause a script for a period of time | |
.PARAMETER Seconds | |
Time, in seconds, that the function will pause | |
.PARAMETER Messge | |
Message you want displayed while waiting | |
.EXAMPLE | |
Start-Countdown -Seconds 30 -Message Please wait while Active Directory replicates data... |
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
set LISTENADDRESS=10.40.1.10 | |
set CONNECTADDRESS=10.1.1.20 | |
netsh interface portproxy add v4tov4 listenport=80 listenaddress=%LISTENADDRESS% connectport=63000 connectaddress=%CONNECTADDRESS% | |
netsh interface portproxy add v4tov4 listenport=2222 listenaddress=%LISTENADDRESS% connectport=63001 connectaddress=%CONNECTADDRESS% | |
netsh interface portproxy add v4tov4 listenport=44818 listenaddress=%LISTENADDRESS% connectport=63002 connectaddress=%CONNECTADDRESS% | |
netsh interface portproxy show all | |
pause |
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
set LISTENADDRESS=192.168.1.58 | |
set CONNECTADDRESS=10.1.1.10 | |
netsh interface portproxy add v4tov4 listenport=63000 listenaddress=%LISTENADDRESS% connectport=80 connectaddress=%CONNECTADDRESS% | |
netsh interface portproxy add v4tov4 listenport=63001 listenaddress=%LISTENADDRESS% connectport=2222 connectaddress=%CONNECTADDRESS% | |
netsh interface portproxy add v4tov4 listenport=63002 listenaddress=%LISTENADDRESS% connectport=44818 connectaddress=%CONNECTADDRESS% | |
netsh interface portproxy show all | |
pause |
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
$MyGuid = ([guid]::NewGuid()).Guid |
NewerOlder