Skip to content

Instantly share code, notes, and snippets.

Gilbert Palau gjpalau

View GitHub Profile
@gjpalau
gjpalau / unlock_printers.sh
Created Aug 1, 2016
script to allow "Everyone" to add or remove printers on Mac
View unlock_printers.sh
#!/bin/sh
dseditgroup -o edit -a "everyone" -t group lpadmin
exit $?
@gjpalau
gjpalau / boxedit-install.sh
Created Dec 17, 2015
Download and Install Box Edit 3.1.2 for Mac
View boxedit-install.sh
#!/bin/bash
# Original Script by Bryson Tyrrell | bryson.tyrrell@gmail.com | http://twitter.com/bryson3gps
# Modified on December 16, 2015 by Gilbert Palau | Univision Desktop Engineering | gpalau@univision.net
#
# 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 <elliot@lindegroup.com>
# 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 | gpalau@univision.net
#
# Much thanks to Bryson, who figured out the command line to install from within the app...
@gjpalau
gjpalau / boxsync-install.sh
Created Dec 17, 2015
Downloads and Install Box Sync for Mac
View boxsync-install.sh
#!/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 Dec 16, 2015
FileWave Script for download and install of Box Sync + Box Edit
View box-sync-edit-install.sh
#!/bin/bash
# Original Script by Bryson Tyrrell | bryson.tyrrell@gmail.com | http://twitter.com/bryson3gps
# Modified on December 16, 2015 by Gilbert Palau | Univision Desktop Engineering | gpalau@univision.net
#
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 Dec 16, 2015
Script to download and deploy Box Sync and Box Edit for Mac
View box-download-install.sh
#!/bin/bash
# Original Script by Bryson Tyrrell | bryson.tyrrell@gmail.com | http://twitter.com/bryson3gps
# Modified on December 16, 2015 by Gilbert Palau | Univision Desktop Engineering | gpalau@univision.net
#
installerOption="$4"
if [[ ${installerOption} = edit ]]; then
echo ""
echo "Downloading Box Edit"
@gjpalau
gjpalau / mso2016_install.sh
Created Aug 21, 2015
Install Office 2016 Script
View mso2016_install.sh
#!/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 Jul 20, 2015
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.
View keychain-clean.sh
#!/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 Jul 20, 2015
script to prepare a default user before capturing an image
View defaultuser-prep.sh
#!/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 Jul 20, 2015
turn off IPv6 on OS X via Script
View ipv6-off.sh
#!/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"
View rsync-capture.sh
# !/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:
You can’t perform that action at this time.