Skip to content

Instantly share code, notes, and snippets.

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)
@emarte91
emarte91 / FacebookAutoLogin.py
Last active September 2, 2018 08:58
Log into facebook with selenium
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']")
@emarte91
emarte91 / GetExternalIP.ps1
Created September 4, 2018 20:08
One line script to get your external IP address
Invoke-RestMethod ipinfo.io | Select ip
@emarte91
emarte91 / ScriptMenu.ps1
Last active September 7, 2018 07:39
Organize your scripts in a simple menu
Write-Host "Main Menu`n`nChoose an option"
$Option = Read-Host "1: Password Reset Script`n2: Exchange Email Creator`n:"
Switch($Option)
{
1 {"Opening Password script"; \\FilePathHere}
2 {"Opening Exchange script";\\FilePathHere}
default {"Incorrect option try again"; \\MainMenu.ps1 }
}
@emarte91
emarte91 / WebStatusMon.py
Created August 29, 2018 16:07
Checks website status code
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:
@emarte91
emarte91 / OUUserSearch.ps1
Created September 11, 2018 04:03
Find AD users in a specific OU
$OU = 'ou=TestOU,dc=Company,dc=local'
Get-ADUser -Filter * -SearchBase $OU | Select Name,Samaccountname
@emarte91
emarte91 / CreateADUser.ps1
Last active September 12, 2018 09:05
Basic AD account creator | Modify to your environment needs
$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"
@emarte91
emarte91 / PasswordResetTool.ps1
Created September 15, 2018 04:14
Resets AD user account passwords and unlocks accounts.
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
@emarte91
emarte91 / PasswordResetToolGUI.ps1
Created September 15, 2018 03:36
Basic AD password reset tool with a simple GUI
Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.Application]::EnableVisualStyles()
Function MakeNewForm {
$PWTool.Close()
$PWTool.Dispose()
MakeForm
}
Function Search {
@emarte91
emarte91 / SalaryPaycheckCalculator.py
Last active October 8, 2018 20:34
Calculates weekly, biweekly, and monthly salary only for 2 states. AZ and NY
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:")