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
| '''This script goes along the blog post | |
| "Building powerful image classification models using very little data" | |
| from blog.keras.io. | |
| It uses data that can be downloaded at: | |
| https://www.kaggle.com/c/dogs-vs-cats/data | |
| In our setup, we: | |
| - created a data/ folder | |
| - created train/ and validation/ subfolders inside data/ | |
| - created cats/ and dogs/ subfolders inside train/ and validation/ | |
| - put the cat pictures index 0-999 in data/train/cats |
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
| #!/usr/local/bin/python | |
| from subprocess import call | |
| from subprocess import Popen | |
| from subprocess import PIPE | |
| import re | |
| import winrm | |
| import sys | |
| import time | |
| settings = { |
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
| $socket = new-object System.Net.Sockets.TcpListener('0.0.0.0', 1080); | |
| if($socket -eq $null){ | |
| exit 1; | |
| } | |
| $socket.start(); | |
| $client = $socket.AcceptTcpClient(); | |
| $stream = $client.GetStream(); | |
| $buffer = new-object System.Byte[] 2048; | |
| $file = 'c:/afile.exe'; | |
| $fileStream = New-Object System.IO.FileStream($file, [System.IO.FileMode]'Create', [System.IO.FileAccess]'Write'); |
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
| #based on code from this blog: https://mcpmag.com/articles/2015/06/18/reporting-on-local-groups.aspx | |
| function Get-AdsiComputer { | |
| [CmdletBinding()] | |
| param ( | |
| [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] | |
| [string]$ComputerName = $env:COMPUTERNAME | |
| ) | |
| process { | |
| [ADSI]("WinNT://$ComputerName,computer") |
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
| $sw = [Diagnostics.Stopwatch]::StartNew() | |
| Write-Host "Updating path..." -foregroundColor DarkGreen | |
| if(!($env:path).contains((Split-Path $PROFILE))) { | |
| $env:path += ";" + (Split-Path $PROFILE) | |
| } | |
| if(!($env:path).contains('D:\dNx\dnx-util;')) { | |
| $env:path += ";" + 'D:\dNx\dnx-util;' | |
| } | |
| if(!($env:path).contains('D:\dNx\dnx-util\test;')) { | |
| $env:path += ";" + 'D:\dNx\dnx-util\test;' |
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.Configuration; | |
| using System.DirectoryServices; | |
| namespace StrategicPlans.Helpers | |
| { | |
| public class ActiveDirectoryHelper | |
| { | |
| public string ActiveDirectoryServerPath { get; set; } |
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 ldap | |
| class ADconnection(object): | |
| def __enter__(self): | |
| #LDAP Connection | |
| try: | |
| # Fix MS Issues |
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
| psExec \\\\WS886 cmd | |
| psExec \\WS886 cmd | |
| psExec '\\WS886' cmd | |
| https://community.spiceworks.com/how_to/78664-remove-local-printer-on-a-remote-machine |
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 Compress-Item { | |
| <# | |
| .SYNOPSIS | |
| Compress a file or directory. | |
| .DESCRIPTION | |
| Create a zip file from a collection of files. | |
| .INPUTS | |
| System.IO.FileInfo | |
| .EXAMPLE | |
| Compress-Item .SomeFile.txt |