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
param([string]$oc,[string]$nc) | |
Write-Host "Searching for: "$oc | |
Get-ChildItem test.config -recurse | | |
Foreach-Object { | |
$c = ($_ | Get-Content) | |
$n = $c -replace [RegEx]::Escape($oc), $nc | |
if($c -ne $n) { | |
Write-Host $_.FullName | |
if($nc -ne $NULL) { |
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
(new System.Xml.Serialization.XmlSerializer(obj.GetType())).Serialize(new System.IO.StreamWriter(@"c:\temp\text.xml"), obj) |
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
# read in the certificate from a pre-existing PFX file | |
$cert = Get-PfxCertificate -FilePath "$env:temp\codeSignCert.pfx" | |
# find all scripts in your user profile... | |
Get-ChildItem -Path $home\Documents -Filter *.ps1 -Include *.ps1 -Recurse -ErrorAction SilentlyContinue | | |
# ...that do not have a signature yet... | |
Where-Object { | |
($_ | Get-AuthenticodeSignature).Status -eq 'NotSigned' | |
} | | |
# and apply one |
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
SELECT DISTINCT | |
o.name AS Object_Name, | |
o.type_desc | |
FROM sys.sql_modules m | |
INNER JOIN | |
sys.objects o | |
ON m.object_id = o.object_id | |
WHERE m.definition Like '%ABD%'; |
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 NOT EXISTS (SELECT * FROM sys.objects WHERE type = 'IF' AND object_id = object_id('dbo.ParseFilePath')) | |
EXEC ('CREATE FUNCTION dbo.ParseFilePath() RETURNS TABLE AS RETURN SELECT Result = ''This is a stub'';' ) | |
GO | |
ALTER FUNCTION dbo.ParseFilePath (@FilePath nvarchar(300)) | |
RETURNS TABLE | |
/************************************************************************************************* | |
AUTHOR: Andy Mallon | |
CREATED: 20180114 |
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
Install-Module -Name Posh-SSH -Scope CurrentUser | |
Get-Command -Module Posh-SSH |
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
#view if readonly | |
gci -Include *.cshtml -Recurse -Path $pwd | select fullname,isreadonly | |
#remove read only | |
gci -Include *.cshtml -Recurse | % { if($_.IsReadOnly){$_.IsReadOnly= $false} } |
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 os, random | |
#Where the image folders live | |
hardshell_path = "gear_images/hardshell_jackets/" | |
insulated_path = "gear_images/insulated_jackets/" | |
#Play around with ratio training to run | |
train_ratio = 0.5 | |
set_hardshell = set(os.listdir(hardshell_path)) |
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
## REMOVE CRAP | |
Get-AppxPackage -AllUsers | Remove-AppxPackage | |
## INSTALL PACKAGE MANAGERS | |
Write-Host "Installing Scoop and Choco..." | |
Set-ExecutionPolicy Bypass -Scope Process -Force; iex (new-object net.webclient).downloadstring('https://get.scoop.sh') | |
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
## INSTALL APPS THROUGH SCOOP | |
Write-Host "Installing apps through scoop (cmder, curl, docker)..." |
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
########## | |
# Tweaked Win10 Initial Setup Script | |
# Primary Author: Disassembler <[email protected]> | |
# Modified by: alirobe <[email protected]> based on my personal preferences. | |
# Version: 2.20.1, 2018-07-23 | |
# Primary Author Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script | |
# Tweaked Source: https://gist.github.com/alirobe/7f3b34ad89a159e6daa1/ | |
# Tweak difference: | |
# | |
# @alirobe's version is a subset focused on safely disabling telemetry, some 'smart' features and 3rd party bloat ... |