Skip to content

Instantly share code, notes, and snippets.

View gjpalau's full-sized avatar

Gilbert Palau gjpalau

View GitHub Profile
@gjpalau
gjpalau / addtologinhook.sh
Created February 11, 2015 23:20
login and log out hooks
sudo defaults write com.apple.loginwindow LoginHook /location/of/the/script.sh
sudo defaults write com.apple.loginwindow LogoutHook /Library/ETS/macrenamer.sh
@gjpalau
gjpalau / preconfig.sh
Created February 23, 2015 21:22
Sophos Pre-Config
./CreateOnAccessPreconfig -AutoLaunch "YES" -InArchives "NO" && sudo ./CreateUpdatePreconfig -PrimaryServerType 1 -PrimaryServerUserName SophosSvcAccount -PrimaryServerPassword \!4m31337 -PrimaryServerURL http://avupdate.yourdomaingoeshere.com:8195/sophosupdate/CIDs/S000/ESCOSX -SecondaryServerType 0 -SecondaryServerUserName username -SecondaryServerPassword changeme
@gjpalau
gjpalau / install-sophos.sh
Last active August 29, 2015 14:16
Script for Installing Sophos
#!/bin/bash
LOGGER="/usr/bin/logger"
# Determine working directory
install_dir=`dirname $0`
# Uninstall existing copy of Sophos 8.x by checking for the
# Sophos Antivirus uninstaller package in /Library/Sophos Anti-Virus.
# If present, the uninstallation process is run.
@gjpalau
gjpalau / gist:34c50e7b3d2bf5aea4db
Created February 23, 2015 21:32
stand alone install
"/usr/local/sophos/Sophos Installer.app/Contents/MacOS/tools/InstallationDeployer" --install
@gjpalau
gjpalau / gist:acf4d3ccf2450241d711
Created February 23, 2015 21:33
install stand alone line
"/usr/local/sophos/Sophos Installer.app/Contents/MacOS/InstallationDeployer" --install
@gjpalau
gjpalau / sophos-install-fw.sh
Created February 26, 2015 01:00
Shell Script to install Sophos with FileWave
#!/bin/bash
LOGGER="/usr/bin/logger"
# Determine working directory
install_dir=`dirname $0`
# Uninstall existing copy of Sophos 8.x by checking for the
# Sophos Antivirus uninstaller package in /Library/Sophos Anti-Virus.
# If present, the uninstallation process is run.
@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 / 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 / install-sophos-noconsole.sh
Created March 24, 2015 13:46
Install Sophos - Without the Console
#!/bin/bash
LOGGER="/usr/bin/logger"
# Determine working directory
install_dir=`dirname $0`
# Uninstall existing copy of Sophos 8.x by checking for the
# Sophos Antivirus uninstaller package in /Library/Sophos Anti-Virus.
# If present, the uninstallation process is run.
@gjpalau
gjpalau / disableipv6.sh
Created April 1, 2015 15:05
Disable IPv6 on all network devices on os x
#!/bin/sh
IFS=$'\n'
net=`networksetup -listallnetworkservices | grep -v asterisk`
for i in $net
do
networksetup -setv6off "$i"
done
exit 0