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
| // ==UserScript== | |
| // @name coupons.shoprite.com | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description try to take over the world! | |
| // @author You | |
| // @match https://shop-rite-web-prod.azurewebsites.net/ | |
| // @grant none | |
| // @require http://code.jquery.com/jquery-3.3.1.min.js | |
| // ==/UserScript== |
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.IO; | |
| using log4net; | |
| using Ninject.Modules; | |
| namespace NinjectSample | |
| { | |
| public class NinjectBindings : NinjectModule | |
| { | |
| public override void Load() |
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
| private void Copy(string sourceCommandText, string destinationTableName, IEnumerable<SqlBulkCopyColumnMapping> columnMappings) | |
| { | |
| using (var sqlBulkCopy = new SqlBulkCopy(_destinationConnectionString, SqlBulkCopyOptions.Default)) | |
| { | |
| const int timeout = 1200; | |
| sqlBulkCopy.BulkCopyTimeout = timeout; | |
| sqlBulkCopy.BatchSize = 50000; | |
| sqlBulkCopy.DestinationTableName = destinationTableName; | |
| sqlBulkCopy.NotifyAfter = 1000000; |
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 (var sqlBulkCopy = new SqlBulkCopy(connectionString, SqlBulkCopyOptions.Default)) | |
| { | |
| const int timeout = 1200; | |
| sqlBulkCopy.BulkCopyTimeout = timeout; | |
| sqlBulkCopy.BatchSize = 50000; | |
| sqlBulkCopy.DestinationTableName = "dbo.MyTable"; | |
| sqlBulkCopy.NotifyAfter = 1000000; | |
| sqlBulkCopy.SqlRowsCopied += SqlBulkCopy_SqlRowsCopied; |
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
| <?xml version="1.0" encoding="utf-8" ?> | |
| <log4net> | |
| <root> | |
| <level value="ALL" /> | |
| <appender-ref ref="RollingFileAppender" /> | |
| </root> | |
| <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender"> | |
| <file type="log4net.Util.PatternString" value="C:\Logs\MyLog-%property{machineName}.log" /> | |
| <appendToFile value="true" /> | |
| <rollingStyle value="Size" /> |
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
| import base64 | |
| import hashlib | |
| from Crypto import Random | |
| from Crypto.Cypher import AES | |
| import sys | |
| if len(sys.argv) != 4: | |
| print: ("Usage: simple_decrypt <Plaintext-KMS-DEK> <IV> <Encrypted-BAK-filename>") | |
| sys.exit(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
| $Ec2Instances = @() | |
| $Instances = (Get-EC2Instance -Filter ` | |
| @( | |
| @{name = "tag:MyFirstTag"; values = "FirstTagValue" }, | |
| @{name = "tag:MySecondTag"; values = @("SecondTagValue1"; "SecondTagValue2") } | |
| ) | |
| ).Instances | |
| foreach ($Instance in $Instances) { |
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
| // if profiles are mfa-enabled - add AWSSDK.SecurityToken Nuget package | |
| // otherwise - will encounter runtime error | |
| private static IAmazonS3 GetAmazonS3() | |
| { | |
| if (Debugger.IsAttached) | |
| { | |
| var sharedFile = new SharedCredentialsFile(); | |
| sharedFile.TryGetProfile("Your Profile Name", out var profile); | |
| AWSCredentialsFactory.TryGetAWSCredentials(profile, sharedFile, out var credentials); |
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
| $Path = $env:TEMP | |
| $Installer = "chrome_installer.exe" | |
| Invoke-WebRequest "https://dl.google.com/chrome/install/latest/chrome_installer.exe" -OutFile $Path$Installer | |
| Start-Process -FilePath $Path$Installer -Args "/silent /install" -Verb RunAs -Wait | |
| Remove-Item $Path$Installer |