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
#Configurable Variables | |
$EmailFrom = "[email protected]" | |
$EmailTo = "[email protected],[email protected]" | |
$Subject = "Email Subject Goes Here" | |
$Body = "The body of the email goes here." | |
$SMTPServer = "SMTP-SRV-01" | |
$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 25) | |
<# | |
#Uncomment to use Gmail's SMTP server. Might need to change the port aboce |
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 | |
Powershell Script that copies AppSettings and ConnectionStrings between from one Azure Web App to another on the same subscription | |
.Description | |
Pass the old and new resource group and webapp names to this script and it will copy the settings over seamlessly | |
.NOTES | |
Version: 1.0 | |
Author: jcefoli | |
Creation Date: 7/27/2017 | |
This script assumes you have the AzureRM Powershell modules installed, are logged into your Azure Account (Login-AzureRmAccount) and on the correct Subscription |
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 will loop through all numbered images in a folder and update the EXIF metadata timestamp by 1 minute for every X photos (see $BatchSize) | |
Setup: | |
-Assumes image filenames are numbered and sequential (34.jpg, 35.jpg, 36.jpg) | |
-Requires exiftool and assumes it's in your system Path or in the directory you execute this scrpt from. | |
Download it here: https://www.sno.phy.queensu.ca/~phil/exiftool/ | |
Why: | |
-When I uploaded my wedding photos to Google Photos, I noticed they were out of order. |
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
$computer = $env:computername | |
$sessions = qwinsta /server:$computer | |
$sessions = $sessions[1..$($sessions.Count - 1)] | |
foreach ($Result in $sessions) { | |
$userName = $Result.Substring(19,22).Trim() | |
$id = $Result.Substring(41,7).Trim() | |
if ($userName -ne ""){ | |
rwinsta /server:$computer $id | |
} |
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
#Take GZipped Backup of all DBs, Stored Procs and Triggers (https://stackoverflow.com/a/38527022) | |
#Note, if you want to shrink ibdata1, Another article recommends skipping a few DBS (https://stackoverflow.com/a/3456885) | |
#Backup | |
mysqldump -u root --all-databases --events --ignore-table=mysql.event --extended-insert --add-drop-database --disable-keys --flush-privileges --quick --routines --triggers | gzip > "all_databases.gz" | |
#Restore | |
gunzip < all_databases.gz | mysql -u root |
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
EVAL "for i, name in ipairs(redis.call('KEYS', '*YOUR_PATTERN_HERE*')) do redis.call('DEL', name, 0); end" 0 |
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
<? | |
#Usage http://localhost/get_stockclose.php?symbol=msft | |
#You need an API Key from www.alphavantage.co (update it on line 29) | |
#Mutual Fund data is delayed one day | |
#Get Symbol from query string | |
if (!isset($_GET['symbol'])){ | |
echo "Ticker Symbol Missing. Make sure your requests ends in ?symbol=xyz"; | |
exit; | |
}else{ |
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
$configFiles = Get-ChildItem C:\YourDirectory *.config -Recurse | |
foreach ($file in $configFiles) | |
{ | |
$content = [System.IO.File]::ReadAllText($file.FullName).Replace('foo','bar') | |
[System.IO.File]::WriteAllText($file.FullName, $content) | |
} |
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 Script Start Time | |
$StartTime = Get-Date | |
<# | |
----------- | |
Your script here | |
----------- | |
#> | |
# Set Script Finish Time and do math |
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
040e67fa7ece009d4becef9f4d74ddb8d0986b60c8acf9a72f0647aae4c39fd407c5207f2c78b3c8bd9612dd13f7d6bc4b39b5bb91a4fdbb5fa6ddb8c120f03f22;webandtech |