Skip to content

Instantly share code, notes, and snippets.

View gjpalau's full-sized avatar

Gilbert Palau gjpalau

View GitHub Profile
@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 / boxedit-install.sh
Created December 17, 2015 18:13
Download and Install Box Edit 3.1.2 for Mac
#!/bin/bash
# Original Script by Bryson Tyrrell | [email protected] | http://twitter.com/bryson3gps
# Modified on December 16, 2015 by Gilbert Palau | Univision Desktop Engineering | [email protected]
#
# The BoxEdit components Box Local Com Server.app and Box Edit.app are launched via launch_app.sh code
# added with permission of Elliot Jordan <[email protected]>
# launch_app was created on 02-10-2015 and last modified by Elliot Jordan on 02-27-2015 | v1.2
# Integrated on 12-18-2015 by Gilbert Palau | Univision Desktop Engineering | [email protected]
#
# Much thanks to Bryson, who figured out the command line to install from within the app...
@gjpalau
gjpalau / boxsync-install.sh
Created December 17, 2015 18:11
Downloads and Install Box Sync for Mac
#!/bin/bash
policy="Box Sync 4"
loggertag="system-log-tag"
tmpdir="/tmp/"
downloadurl="https://e3.boxcdn.net/box-installers/sync/Sync+4+External/Box%20Sync%20Installer.dmg"
log() {
echo "$1"
/usr/bin/logger -t "$loggertag: $policy" "$1"
@gjpalau
gjpalau / box-sync-edit-install.sh
Created December 16, 2015 16:23
FileWave Script for download and install of Box Sync + Box Edit
#!/bin/bash
# Original Script by Bryson Tyrrell | [email protected] | http://twitter.com/bryson3gps
# Modified on December 16, 2015 by Gilbert Palau | Univision Desktop Engineering | [email protected]
#
echo ""
echo "Downloading Box Edit"
webCheckSum=$(curl -sI https://e3.boxcdn.net/box-installers/boxedit/mac/currentrelease/BoxEditInstaller.dmg | tr -d '\r' | awk '/Content-Length/ {print $2}')
curl -fkS --progress-bar https://e3.boxcdn.net/box-installers/boxedit/mac/currentrelease/BoxEditInstaller.dmg -o /tmp/BoxEditInstaller.dmg
fileCheckSum=$(cksum /tmp/BoxEditInstaller.dmg | awk '{print $2}')
@gjpalau
gjpalau / box-download-install.sh
Last active December 16, 2015 16:19
Script to download and deploy Box Sync and Box Edit for Mac
#!/bin/bash
# Original Script by Bryson Tyrrell | [email protected] | http://twitter.com/bryson3gps
# Modified on December 16, 2015 by Gilbert Palau | Univision Desktop Engineering | [email protected]
#
installerOption="$4"
if [[ ${installerOption} = edit ]]; then
echo ""
echo "Downloading Box Edit"
@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 / keychain-clean.sh
Created July 20, 2015 23:34
This script should take care of any issues with the keychain by making sure it has been completely removed, so that it will be created from scratch when a new user logs in.
#!/bin/bash
\#
\# keychain-clean.sh
\# cleans and disinfects keychains
\#
if [ -d "/Users/default/Library/Keychains" ]; then
/bin/rm -rf /Users/default/Library/Keychains
fi
/bin/mkdir /Users/default/Library/Keychains
/usr/sbin/chown default:staff /Users/default/Library/Keychains
@gjpalau
gjpalau / defaultuser-prep.sh
Created July 20, 2015 21:57
script to prepare a default user before capturing an image
#!/bin/bash
\#
\# defaultuser-prep.sh
\# preparer for default user account on Mac OS X
\#
/bin/rm –rf /System/Library/User\ Template/English.lproj
if [ -d "/Users/default/Library/Keychains" ]; then
/bin/rm -rf /Users/default/Library/Keychains
fi
/bin/mkdir /Users/default/Library/Keychains
@gjpalau
gjpalau / ipv6-off.sh
Created July 20, 2015 21:08
turn off IPv6 on OS X via Script
#!/bin/sh
\#
\# ipv6-off.sh
\# Disable IPv6 on all interfaces.
\#
IFS=$'\n'
net=`networksetup -listallnetworkservices | grep -v asterisk`
for i in $net
do
networksetup -setv6off "$i"
@gjpalau
gjpalau / rsync-capture.sh
Created May 14, 2015 00:07
Rsync Capture
# !/bin/bash
# RSYNC Capture
# Carlos Raygada / Gilbert Palau
# May 2015 v.01
#Stores Mac Serial Number in $serial
serial=$(ioreg -l |grep "IOPlatformSerialNumber"|cut -d ""="" -f 2|sed -e s/[^[:alnum:]]//g)
#Stores Username
echo enter username: