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 requests | |
import time | |
import datetime | |
while True: | |
r = requests.get("https://thinktreeit.com") | |
if r.status_code != 200: | |
print(f'Down Status Code:{r.status_code} {datetime.datetime.now()}') | |
time.sleep(5) | |
else: |
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 requests | |
from bs4 import BeautifulSoup | |
url = "http://yourwebsitehere.com/" | |
response = requests.get(url) | |
soup = BeautifulSoup(response.text, "html.parser") | |
email = soup.select('a[href^=mailto]') | |
with open("website_emails.csv", "a") as csv_file: | |
csv_writer = writer(csv_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
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
driver = webdriver.Chrome() | |
driver.get("Https://facebook.com") | |
def userInfo(Username,Password): | |
user = driver.find_element_by_xpath("//*[@id='email']") | |
user.send_keys(Username) | |
password = driver.find_element_by_xpath("//*[@id='pass']") |
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
Invoke-RestMethod ipinfo.io | Select ip |
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
$OU = 'ou=TestOU,dc=Company,dc=local' | |
Get-ADUser -Filter * -SearchBase $OU | Select Name,Samaccountname |
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
$firstName = Read-Host "What is the users first name?" | |
$lastName = Read-Host "What is the users last name?" | |
# Default username setting is first letter of first name and full last name Ex: John Smith = Jsmith | |
$recommendedUser = $firstName[0] + $lastName | |
#Password set to "Password1" feel free to change | |
$password = (ConvertTo-SecureString -AsPlainText "Password1" -Force) | |
$fullName = "$firstName $lastName" |
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
Add-Type -AssemblyName System.Windows.Forms | |
[System.Windows.Forms.Application]::EnableVisualStyles() | |
Function MakeNewForm { | |
$PWTool.Close() | |
$PWTool.Dispose() | |
MakeForm | |
} | |
Function Search { |
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
Write-Host "Password Reset and Unlock Tool`n" -ForegroundColor Yellow | |
$User = Read-Host "Enter in a Username" | |
try{ | |
Get-ADuser $User -properties * | select Name,LockedOut,Enabled,@{n='Password Last Reset';e={$_.PasswordLastSet}},@{n="Job Title";e={$_."Description"}},@{n='Email';e={$_."EmailAddress"}},TelephoneNumber,Office | fl | |
$Name = (Get-ADUser $User -Properties Name).name | |
} | |
catch{ | |
Write-Warning "$User is incorrect or does not exist.`nTry again" | |
\\FileOfYourScript.ps1 |
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
def calculations(): | |
salary = int(input("What is your yearly salary?")) | |
state = input("What state are you in? Choose a number \n 1: AZ \n 2: NY\n:") | |
states = {'1': .83, '2': .73} | |
state_tax = states.get(state) | |
weekly = int((salary / 52) * state_tax) | |
monthly = int((salary / 12) * state_tax) | |
biweekly = weekly * 2 | |
print("Weekly: $" + str(weekly) + "\nMonthly: $" + str(monthly) + "\nBiWeekly: $" + str(biweekly)) | |
new_calculation = input("Would you like to calculate another salary? Y/N:") |
OlderNewer