This file contains 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
# It might work in 4, but I'm not testing there. Lower you'll have to tweak code | |
#requires -Version 5.0 | |
param( | |
# Your Live ID for MSDN login | |
[Parameter(Mandatory)] | |
[PSCredential] | |
[System.Management.Automation.CredentialAttribute()] | |
$Credential, | |
# Pick a browser to use. Defaults to Firefox (which doesn't seem to require an external Driver file) |
This file contains 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
<# | |
Create FW rules for TCP and UDP Listening Ports | |
netstat -an -p tcp |Select-String "Listening" | |
netstat -an -p udp |Select-String "Listening" | |
for each entry in netstat create firewall rule | |
name = -p tcp|udp port port # | |
description = automatic allow rule generated by powershell on get-date |
This file contains 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 urllib | |
def lambda_handler(event, context): | |
for record in event['Records']: | |
try: | |
if 'aws:sns' == record['EventSource'] and record['Sns']['Message']: | |
record = json.loads(record['Sns']['Message'])['Records'][0] | |
except KeyError: | |
pass | |
bucket = record['s3']['bucket']['name'] |
This file contains 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
# Useful references: | |
# | |
# https://superuser.com/questions/992511/emulate-a-keyboard-button-via-the-command-line | |
# https://ss64.com/vb/sendkeys.html | |
# https://social.technet.microsoft.com/Forums/windowsserver/en-US/96b339e2-e9da-4802-a66d-be619aeb21ac/execute-function-one-time-in-every-10-mins-in-windows-powershell?forum=winserverpowershell | |
# https://learn-powershell.net/2013/02/08/powershell-and-events-object-events/ | |
# | |
# Future enhancements - use events rather than an infinite loop | |
$wsh = New-Object -ComObject WScript.Shell | |
while (1) { |
This file contains 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-INTERNETPROXY | |
# | |
# DESCRIPTION | |
# This function will set the proxy server and (optional) Automatic configuration script. | |
# | |
# SYNTAX | |
# Set-InternetProxy [-Proxy] <string[]> [[-acs] <string[]>] [<CommonParameters>] | |
# | |
# EXAMPLES |