Skip to content

Instantly share code, notes, and snippets.

View gjpalau's full-sized avatar

Gilbert Palau gjpalau

View GitHub Profile
@gjpalau
gjpalau / rename-and-bind.sh
Last active May 25, 2020 22:54
mac renamer + AD bind script
#!/bin/bash
# uniMIS renamer script -- use with ComputerName name below
# By Gilbert Palau, Enterprise OS X - www.enterpriseosx.com
#
# this script renames the mac by chassi type + serial number: ??-SERIAL
#
# Legend:
#
laptop="ML-"
workstation="MW-"
@gjpalau
gjpalau / mso2016_install.sh
Created August 21, 2015 20:35
Install Office 2016 Script
#!/bin/bash
DOWNLOAD_URLS=( \
#Outlook
"http://download.microsoft.com/download/A/A/8/AA80584D-0B2B-4C72-8AA4-E9F51579D1BD/Microsoft_Outlook_15.13.1_Updater.pkg" \
# Word
"http://download.microsoft.com/download/4/A/A/4AADD7A3-8CBB-46BA-84DF-633C86FA4496/Microsoft_Word_15.13.1_Updater.pkg" \
# Excel
"http://download.microsoft.com/download/B/4/7/B4706EF5-0038-41F1-94E3-6ECA47575815/Microsoft_Excel_15.13.1_Updater.pkg" \
# Powerpoint
"http://download.microsoft.com/download/3/7/5/375BD444-21F2-4017-9988-2AF94A8B325F/Microsoft_PowerPoint_15.13.1_Updater.pkg" \
@gjpalau
gjpalau / timezone.sh
Created March 4, 2015 15:49
Script for managing timezones
#!/bin/bash
#### Set NTP Server
# Sets correct Timezone. If no Timezone is set, then default is CST
timezone=$1
if [ "$timezone" = "CST" ]
then
echo "America/Chicago"
@gjpalau
gjpalau / macrenamer.sh
Created February 11, 2015 23:07
Rename your computer depending on your chassis+yourmacserialnumber
#!/bin/bash
# uniMIS renamer script -- use with ComputerName name below
# By Gilbert Palau, Enterprise OS X - www.enterpriseosx.com
#
# this script renames the mac by chassi type + serial number: ??-SERIAL
#
# variables:
laptop="ML-"
workstation="MW-"
server="S-"
@gjpalau
gjpalau / unlock_printers.sh
Created August 1, 2016 17:44
script to allow "Everyone" to add or remove printers on Mac
#!/bin/sh
dseditgroup -o edit -a "everyone" -t group lpadmin
exit $?
@gjpalau
gjpalau / TurnOnSSHAddAdminGroup.sh
Last active July 22, 2016 08:20
Turn on remote login ## Create the com.apple.access_ssh group ## Add the admin group to com.apple.access_ssh ## unload and load the SSH Service
#!/bin/bash
# TurnOnSSHAddAdminGroup.sh
#
# Turn on remote login ## Create the com.apple.access_ssh group ## Add the admin group to com.apple.access_ssh ## unload and load the SSH Service
sudo systemsetup -setremotelogin on && dseditgroup -o create -q com.apple.access_ssh && dseditgroup -o edit -a admin -t group com.apple.access_ssh && sudo launchctl unload -w /System/Library/LaunchDaemons/ssh.plist && sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -allowAccessFor -specifiedUsers && sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -users techserv -activate -access -on -privs -all -clientopts -setvnclegacy -vnclegacy yes -clientopts -setvncpw -vncpw p@55w0rd -quiet
/usr/libexec/PlistBuddy -c ‘Set :com.apple.screensharing:Disabled NO’ /private/var/db/launchd.db/com.apple.launchd/overrides.plist
@gjpalau
gjpalau / ard-pub-cmd.sh
Created January 30, 2015 21:55
ard commands for public setup
dscl . create /Users/Public
dscl . create /Users/Public UserShell /bin/bash
dscl . create /Users/Public RealName "Public User"
dscl . create /Users/Public UniqueID 503
dscl . create /Users/Public PrimaryGroupID 1000
dscl . create /Users/Public NFSHomeDirectory /Users/Public
dscl . passwd /Users/Public Public
@gjpalau
gjpalau / TurnOnSSHAddAdminGroup.sh
Last active June 1, 2016 22:14
Script that activates ARD to use a specific user with specific access, and turns on SSH.
#!/bin/bash
# TurnOnSSHAddAdminGroup.sh
#
# Turn on remote login ## Create the com.apple.access_ssh group ## Add the admin group to com.apple.access_ssh ## unload and load the SSH Service
sudo systemsetup -setremotelogin on && dseditgroup -o create -q com.apple.access_ssh && dseditgroup -o edit -a admin -t group com.apple.access_ssh && sudo launchctl unload -w /System/Library/LaunchDaemons/ssh.plist && sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -allowAccessFor -specifiedUsers && sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -users nameofadmin -activate -access -on -privs -all -clientopts -setvnclegacy -vnclegacy yes -clientopts -setvncpw -vncpw p@55w0rd -quiet
/usr/libexec/PlistBuddy -c ‘Set :com.apple.screensharing:Disabled NO’ /private/var/db/launchd.db/com.apple.launchd/overrides.plist
@gjpalau
gjpalau / steguestlogin.plist
Created January 31, 2015 00:15
LaunchAgent Plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.site.steguestlogin</string>
<key>ProgramArguments</key>
<array>
<string>Users/Shared/Scripts/SteGuestlogin.sh</string>
</array>
#!/bin/bash
AIRPORT="en1"
USER="$USER"
if [ "$USER" = Public ]; then
networksetup -removeallpreferredwirelessnetworks
ifconfig en0 down
networksetup -setairportpower en1 on
echo "Airport is now turned on."
networksetup -addpreferredwirelessnetworkatindex en1 STE-Guest 0 OPEN
echo "You are now connected to the STE-Guest Network."