This file contains hidden or 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
#!/bin/sh | |
read -n 1 -s -r -p "Press any key to check macOS updates!" | |
macvalue=$( softwareupdatre -l | grep -ic "No new software available.") | |
if [ $macvalue -eq 1 ] | |
then | |
echo "No macOS updates" | |
else | |
read -n 1 -s -r -p "Press any key to run macOS updates!" | |
softwareupdate -i -a |
This file contains hidden or 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
#!/bin/bash | |
yum install perl-Switch perl-DateTime perl-Sys-Syslog perl-LWP-Protocol-https perl-Digest-SHA.x86_64 -y | |
cd /home/ec2-user | |
curl http://aws-cloudwatch.s3.amazonaws.com/downloads/CloudWatchMonitoringScripts-1.2.2.zip -O | |
unzip CloudWatchMonitoringScripts-1.2.2.zip | |
rm CloudWatchMonitoringScripts-1.2.2.zip |
This file contains hidden or 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
# remembercredential will save the first good username/pw credential entered in GUI | |
# put shared key for "insert VPN password" | |
# dnssuffix is like ad.companyname.com but probably dosent matter | |
# type over the brackets with the values and put in quotes only | |
Add-VpnConnection -AllUserConnection -Name "[insert VPN name]" -ServerAddress [insert IP/hostname for VPN] -TunnelType L2tp -DNSSuffix "[insert domain name]" -EncryptionLevel Optional -AuthenticationMethod PAP -L2tpPsk "[insert VPN password]" -Force -PassThru -RememberCredential |
This file contains hidden or 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
#!/bin/sh | |
if [ -e /cygdrive/c/Users/admin/rsyncjob.lock ] | |
then | |
echo "Rsync job already running...exiting" | |
exit | |
fi | |
touch /cygdrive/c/Users/admin/rsyncjob.lock |
This file contains hidden or 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
#!/bin/sh | |
diskutil list | |
echo "Hello what disk to erase? eg disk2" | |
read killthisdisk | |
sudo diskutil eraseDisk FAT32 EXTERNAL MBRFormat /dev/$killthisdisk | |
read -n 1 -s -r -p "When you are in UNetBootin, select the disk you choose, but the s1 prefix or it wont do anything when you press OK. Press any key to continue" | |
sudo /Applications/unetbootin.app/Contents/MacOS/unetbootin targetdrive=/dev/$killthisdisk | |
This file contains hidden or 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
Get-ADUser $Acn |
This file contains hidden or 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
Get-ADGroupMember -Identity "$Group" | | |
Select samAccountName,Name, | |
@{Name="DisplayName";Expression={(Get-ADUser $_.distinguishedName -Properties Displayname).Displayname}}, | |
@{Name="Title";Expression={(Get-ADUser $_.distinguishedName -Properties Title).title}} |
This file contains hidden or 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-ADGroupMember -Identity "$Group" -Member $Acn |
This file contains hidden or 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
#example vars | |
$acn = "sjobs" | |
$first = "Steve" | |
$last = "Jobs" | |
$pass= "secretwords" | |
$domain1 = "ca" | |
$domain2 = "apple" | |
$domain3 = "com" | |
$secretOU = "AppleComputers" |