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 json | |
from datetime import * | |
import pprint | |
from dateutil.relativedelta import * | |
from dateutil.parser import * | |
import requests | |
import pytz | |
EASTERN_TZ = pytz.timezone('US/Eastern') |
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
from typing import List | |
def twoSum(nums: List[int], target: int) -> List[int]: | |
answers = [] | |
for n in nums: | |
answers.append(target - n) | |
ans = set(answers) & set(nums) | |
return ans | |
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
package main | |
import ( | |
"fmt" | |
"io" | |
"net/http" | |
"os" | |
) | |
// DownloadFile will download a url to a local file. |
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]$username='LocalAdministrator',[string]$password='P@ssw0rd!') | |
$secure_password = $password | ConvertTo-SecureString -AsPlainText -Force | |
try { | |
$LocalUserObject = Get-LocalUser -Name $username -ErrorAction Stop | |
} | |
catch [Microsoft.PowerShell.Commands.UserNotFoundException] { | |
"User $($username) Not Found" | Write-Warning | |
} |
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
$url = "https://s3.amazonaws.com/assets-cp/assets/Agent_Uninstaller.zip" | |
$output = "C:\Windows\Temp\Agent_Uninstaller.zip" | |
(New-Object System.Net.WebClient).DownloadFile($url, $output) | |
# The below usage of Expand-Archive is only possible with PowerShell 5.0+ | |
# Expand-Archive -LiteralPath C:\Windows\Temp\Agent_Uninstaller.zip -DestinationPath C:\Windows\Temp\LTAgentUninstaller -Force | |
# Use .NET instead | |
[System.Reflection.Assembly]::LoadWithPartialName("System.IO.Compression.FileSystem") | Out-Null | |
# Now we can expand the archive | |
[System.IO.Compression.ZipFile]::ExtractToDirectory('C:\Windows\Temp\Agent_Uninstaller.zip', 'C:\Windows\Temp\LTAgentUninstaller') | |
Start-Process -FilePath "C:\Windows\Temp\LTAgentUninstaller\Agent_Uninstall.exe" |
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
from csv import reader | |
from collections import namedtuple | |
import logging | |
import subprocess | |
# TODO: In the future this script should also possibly generate the data so that no other steps are required. | |
# E.g.: | |
# gam all users show filelist id alternateLink query "'[email protected]' in readers" > file.csv | |
# gam all users show filelist id alternateLink query "'[email protected]' in writers" > file.csv |
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
@ECHO OFF | |
ECHO Reset Volume Mixer Settings... | |
NET STOP Audiosrv | |
NET STOP AudioEndpointBuilder | |
REG DELETE "HKCU\Software\Microsoft\Internet Explorer\LowRegistry\Audio\PolicyConfig\PropertyStore" /F | |
REG ADD "HKCU\Software\Microsoft\Internet Explorer\LowRegistry\Audio\PolicyConfig\PropertyStore" |
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/bin/env python3 | |
""" | |
This script creates a macOS Mojave bootable ISO. | |
Requires Python 3.6, macOS, and macOS Mojave app installed. | |
Created using info gathered from here: https://gist.github.com/agentsim/00cc38c693e7d0e1b36a2080870d955b | |
Purpose: I just wanted to try out the subprocess library. | |
""" |
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
UVLY+3xs9LIslFFJL9zz9ZX/E8tch0h1gXBEL4FgoejQ9yQ/0abH8BYtlJeU1ADc3SFuE3wL+QT3GNZJWHAGbuEdinxloggMORGnbuQ6SZSa31gNy0HO2ze7bd0TLJa3BNtmzN/u40gehGsXFn3/Ve | |
ZjkII9ANA26kQnxsGo1dnnUUMkMT9XrDIfj9Xb+6TZNiJYl7+qD6xqQRdac61izYNQcOxIa7xwxdXqjWnEMUmBDBE7R1wxNRTSLvMAo6itab8yZnjF1OAzsesXfeWIFgz/yrHNsgeQ5JhFuitUsa9n | |
GtBLVrYpJaqnEQQtHdg2Uez09d89YDa3tq+afeVxC9Bgul6ga1W5FrwnZLgNmeaj+bOnLU3y/za1L6dwuUh6IqakNyx3vTrb0DDnb2fw7w== | |
F6ny/x7M/S/F1fu0oS2K41aR1n8URVQQ+ipS4NMLIkQoWhR5YEQMq2Tq5SP+RdIHK9blfFEBFZNJ9hcJkBt+9QJprvq+g0Gm3owr8jGfZ85yh8s+ChwENKeJRiQgs/Wr5n6JOH9b3EEAIUxPzTQ2/W | |
zFvpDR28TN9BqCUn0QUts1lnKX3+FfOC4J4lZhnsLfTKAkGxeNSaZ/2jtwMeX1VRVY8dyu3l8hVfogXC3sVxD5qwjaOd0i3moJWwbyDWQspunIY2GAONcgkH+6u87UPjHMuZcfCGPyu/YKpcEZg8FP | |
DLw58uU0o4Upbtq3aGaaOOV475tZ7Gi3zXJRBnfi+A== | |
1G2JyAkrPgv/ueMVOOIxM04Oqx1yXoXoCv99KNN0AqhDacpn6iaXn6wmdfDooqxV7oThGMzwPuFrtYSzyfq6xE6WsLuMnBwxjlKvfTr7/JQus3ALYXD05D+XjRIP2EHKo19rLUmtkk+hfGeuh/OSEc | |
V1+pZ9fSpkkS7+KvVF4Q2HkJRjLnWxqoRapd++vGXFaIOGKlF61VjIUNWo0RWRDINJExW3ONMVXatrNwIvW20zgB05STnpz9fMYGq4oCKUHU0AhXZ8s |
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/bin/env python3 | |
""" | |
This script creates a macOS High Sierra bootable ISO. | |
Requires Python 3.6, macOS, and macOS High Sierra app installed. | |
Created using info gathered from here: https://gist.github.com/agentsim/00cc38c693e7d0e1b36a2080870d955b | |
Purpose: I just wanted to try out the subprocess library. | |
""" |