Skip to content

Instantly share code, notes, and snippets.

Elvis Marte emarte91

Block or report user

Report or block emarte91

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@emarte91
emarte91 / ADBulkCreation.ps1
Created Nov 1, 2018
Create multiple Active Directory accounts with a csv
View ADBulkCreation.ps1
Import-Module ActiveDirectory
Import-Csv \\Pathname\ADbulk.csv | ForEach-Object {
$firstName = $_.firstname
$lastName = $_.lastname
$name = $firstName + ' ' + $lastName
$samAccountName = $firstName[0] + $lastName
$userPrincipal = $samAccountName + "@companyname.com"
$ouPath = "OU=Base,OU=Sites,DC=rome,DC=local"
$password = (ConvertTo-SecureString "Password1" -AsPlainText -Force)
$enable = $true
@emarte91
emarte91 / Dice.py
Created Oct 26, 2018
Roll the dice against the computer. Highest number wins
View Dice.py
import random
def roll():
option = input("Roll the dice! y/n:")
if option == 'y' or option == 'Y':
results()
def results():
@emarte91
emarte91 / GoogleMap.py
Created Oct 25, 2018
Searches inputted address with google maps
View GoogleMap.py
import webbrowser, sys # Get address
if len(sys.argv) > 1:
address = ' '.join(sys.argv[1:])
# chops off google.py filename in the beginning ['mapIt.py', 'address']
webbrowser.open('https://www.google.com/maps/place/' + address)
@emarte91
emarte91 / SalaryPaycheckCalculator.py
Last active Oct 8, 2018
Calculates weekly, biweekly, and monthly salary only for 2 states. AZ and NY
View SalaryPaycheckCalculator.py
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:")
@emarte91
emarte91 / MatplotlibExample.py
Last active Oct 1, 2018
Plot csv data with matplotlib and pandas
View MatplotlibExample.py
import matplotlib.pyplot as plt
import pandas as pd
headers = ['Country', 'Visitors']
df = pd.read_csv('September.csv', delimiter=",", names=headers)
x = df['Country']
y = df['Visitors']
plt.bar(x, y)
@emarte91
emarte91 / SecretPasswordFile.txt
Last active Oct 1, 2018
Basic script to show how functions work
@emarte91
emarte91 / Magic8Ball.py
Last active May 24, 2019
Simple magic 8 ball program
View Magic8Ball.py
import random
def magic8Ball():
print("Welcome to the Magic 8 Ball")
x = input("What is your question my child?")
answerList = ["It is certain",
"Outlook good",
"You may rely on it",
"Ask again later",
"Concentrate and ask again",
@emarte91
emarte91 / RandomPasswordGenerator.py
Created Sep 18, 2018
Creates a strong random password from 8-16 characters
View RandomPasswordGenerator.py
import string
from random import randint, choice
letter = string.ascii_letters
nums = string.digits
specialChar = string.punctuation
chars = letter + nums + specialChar
min_length = 8
max_length = 16
@emarte91
emarte91 / PasswordResetTool.ps1
Created Sep 15, 2018
Resets AD user account passwords and unlocks accounts.
View PasswordResetTool.ps1
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 Sep 15, 2018
Basic AD password reset tool with a simple GUI
View PasswordResetToolGUI.ps1
Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.Application]::EnableVisualStyles()
Function MakeNewForm {
$PWTool.Close()
$PWTool.Dispose()
MakeForm
}
Function Search {
You can’t perform that action at this time.