Skip to content

Instantly share code, notes, and snippets.

View zackn9ne's full-sized avatar

zackn9ne zackn9ne

  • earth, New York
View GitHub Profile
@zackn9ne
zackn9ne / update.sh
Last active December 2, 2018 17:45
sysadmin script to update macOS mojave in various ways (office and macOs)
#!/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
@zackn9ne
zackn9ne / boot.sh
Last active October 9, 2018 19:33
acloudguru ec2 bootstrap script
#!/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
@zackn9ne
zackn9ne / add_vpns.ps1
Created September 4, 2018 16:07
win10 vpn elevated ps
# 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
@zackn9ne
zackn9ne / sync_a.sh
Created July 14, 2018 21:22
rsync lock file
#!/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
@zackn9ne
zackn9ne / unetbootin_hisierra
Last active July 2, 2018 15:43
unetbootin for High Sierra
#!/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
@zackn9ne
zackn9ne / ad_user_info.ps1
Last active June 21, 2018 18:34
ad check on user
Get-ADUser $Acn
@zackn9ne
zackn9ne / get_all_people_group.ps1
Created June 21, 2018 18:31
Get all People in a Group
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}}
@zackn9ne
zackn9ne / adduser_togroup.ps1
Last active June 21, 2018 18:26
ps add user to group
Add-ADGroupMember -Identity "$Group" -Member $Acn
@zackn9ne
zackn9ne / add_users_megascriptSmart.ps1
Last active June 26, 2018 20:47
powershell add user megascript
#example vars
$acn = "sjobs"
$first = "Steve"
$last = "Jobs"
$pass= "secretwords"
$domain1 = "ca"
$domain2 = "apple"
$domain3 = "com"
$secretOU = "AppleComputers"
@zackn9ne
zackn9ne / mutebutton.sh
Created June 11, 2018 02:57
get sound working t420 arch
#! /bin/sh
echo "options thinkpad_acpi enabled=0 # enables Mute-Button on ThinkPads with IdeaPad-Firmware" | sudo tee --append /etc/modprobe.d/modprobe.conf