Advanced Search
Search Results
502 total results found
Distribution Lists
Azure Powershell Module Cheatsheet
# Azure Product Azure CLI Example CLI PowerShell Module Example PS 1 Syntax az PowerShell uses a verb-noun pair for the names of cmdlets 2 Log in to Azure az login az login -u johndoe@contoso.com -p VerySecret Az.Accounts ...
Email Management
While loops
Run for period of time #!/bin/bash runtime="5 minute" endtime=$(date -ud "$runtime" +%s) while [[ $(date -u +%s) -le $endtime ]] do echo "Time Now: `date +%H:%M:%S`" echo "Sleeping for 10 seconds" sleep 10 done Resource: https://www.g...
Bugs
For loops
Compute md5sum for every item in a directory for i in "$(ls)"; do md5sum "${i}"; done | sort Print 1 through 10 for COUNT in $(seq 1 10); do echo $COUNT sleep 1 done Read data into an array and loop over it mapfile -t buckets < <(aws s3 ls | grep t...
LAPS
SSH
Encrypt Key openssl rsa -des3 -in key.pem -out encrypted-key.pem # Enter a passphrase mv encrypted-key.pem key.pem chmod 400 key.pem Decrypt Key openssl rsa -in key.pem -out key.open.pem # Enter the passphrase used to encrypt the ke mv key.open.pem key...
Sleeping Bear Dunes
Create sudo user non-interactively
Skip the prompts that come with creating a user typically, and give them sudoers privileges. Replace ${USERNAME} with the user you want to create. # The man page explanation for --gecos isn't that intuitive IMO # Basically specifying --gecos "" states you do...
Day 5 - Manisitique
Run function as another user
export -f <function_name> su <user to run function as> -c "bash -c <function_name>"
Day 1 - St. Ignace, Sault Ste. Marie and Whitefish Point
Run command as another user
USER=centos runuser -l $USER -c 'whoami' Resource: https://devops.stackexchange.com/questions/10402/running-a-command-as-a-specific-user-on-an-ec2-using-ssm
Day 6 - Boyne Mountain and Crystal Mountain
New Page
Exit-on-error mode Put this at the top of your bash script: set -e. If a command returns a nonzero status, the shell will exit. Resources: https://unix.stackexchange.com/questions/97101/how-to-catch-an-error-in-a-linux-bash-script http://linuxcommand.org/lc3...
Day 2 - Munising
Create Test Detections
Original Article We have several test detections that can be run to verify the Falcon sensor is sending detections back to the cloud and that they are being received in a timely manner. If you have a SOC that receives and responds to alerts, it would be advi...