Skip to content

Instantly share code, notes, and snippets.

View Hectormalvarez's full-sized avatar

Hector Alvarez Hectormalvarez

View GitHub Profile
from datetime import datetime, timedelta
from openpyxl.reader.excel import load_workbook
from openpyxl.styles import PatternFill, Side, Font
from openpyxl.styles.borders import Border
import re
import glob
files = glob.glob('*.xlsx') # grabs all spreadsheets in the folder and puts them in a list
for file in files: # loops through all the spreadsheets in list and formats them
@Hectormalvarez
Hectormalvarez / Set-EnvVarsFromDotEnv.ps1
Last active April 23, 2024 22:46
Set-EnvsFromEnvFile
function Set-EnvVarsFromDotEnv {
<#
.SYNOPSIS
Parses a .env file and sets environment variables from it.
.DESCRIPTION
This function reads a .env file, parses each line as a key-value
pair, and sets corresponding environment variables within the current
PowerShell session. The .env file format should have one key-value
pair per line, separated by an equals sign (=).
function Get-ADAccountInformation {
<#
.SYNOPSIS
Retrieves detailed Active Directory account information for a specified user.
.DESCRIPTION
This function provides the following information about an AD user:
* Enabled status
* Lockout status (if locked out)
* Lockout time (if locked out, both local and UTC)
find . -type f -name '*.env.sample' -execdir bash -c 'cp "$1" "${1%.sample}"' _ {} \;