Extract sub string by patter

This pattern extract data from the string. Spaces around = are optional in pattern.
String mydata = "some string with videochat = 'the data i want' inside";
Pattern pattern = Pattern.compile("videochat\\s?=\\s?'(.*?)'");
Matcher matcher = pattern.matcher(mydata);
if (matcher.find()) {
    System.out.println(matcher.group(1));
}

プラグインなしでスライドしながらフェードアウトするスライダー

<ul id="slide_wrapp">
  <li class="slide_item"><!-- スライド1の中身 --></li>
  <li class="slide_item"><!-- スライド2の中身 --></li>
  <li class="slide_item"><!-- スライド3の中身 --></li>
</ul>

FI BinaryOperator

public void testIntMethods() {
    BinaryOperator<Integer> sum1 = Integer::sum;
    IntBinaryOperator sum2 = Integer::sum;
    BinaryOperator<Integer> max1 = Integer::max;
    IntBinaryOperator max2 = Integer::max;
    BinaryOperator<Integer> min1 = Integer::min;
    IntBinaryOperator min2 = Integer::min;
    Comparator<Integer> cmp = Integer::compare;

    int[] numbers = { -1, 0, 1, 100, Integer.MAX_VALUE, Integer.MIN_VALUE };
    for (int i : numbers) {
        for (int j : numbers) {
            assertEquals(i+j, (int) sum1.apply(i, j));
            assertEquals(i+j, sum2.applyAsInt(i, j));
            assertEquals(Math.max(i,j), (int) max1.apply(i, j));
            assertEquals(Math.max(i,j), max2.applyAsInt(i, j));
            assertEquals(Math.min(i,j), (int) min1.apply(i, j));
            assertEquals(Math.min(i,j), min2.applyAsInt(i, j));
            assertEquals(((Integer) i).compareTo(j), cmp.compare(i, j));
        }
    }
}

Social sharing tiny component - SCSS

/**
  * Copyright (C) 2014 Roman Janko
  * _social-sharing.scss
  *
  * changelog
  * 18.12.2017 15:03:08:revised
  *
  * @author janko@andweb.cz
  * @version 0.1.0
  * @since 0.1.0
  */
 

$list: ();
$list: append($list, twitter);
$list: append($list, facebook);
/*$list: append($list, gplus);*/
$list: append($list, linkedin);

$length: length($list);
$size: 48px;

.social-sharing-pane
{
	background: #fff;
	position: fixed;
	right: 0;
	top: 50%;
	margin-top: - (($size * $length) / 2);
	z-index: 50;
	width: $size;
	height: $size * $length;
	
	a
	{
		width: $size;
		height: $size;
		display: block;
		opacity: 1;
		
		
		@each $flag in $list
		{
			&.-#{$flag}
			{
				background: url('/assets/gfx/social-sharing/#{$flag}.png') no-repeat;
				background-size: $size $size;
			}
		}

		&:hover
		{
			opacity: .8;
		}

	}

	@include respond(0, 480px) {
		top: auto;
		right: auto;
		left: 0px;
		bottom: 0px;
		margin-top: 0px;
		width: $size * $length;
		height: $size;

		a {
			display: block;
			float: left;
			margin: 0;
			padding: 0;
		}

	}
}

second snippet

Hello, this is my second snippet.
This is my second snippet.

Script to remove Keychain Item

Script to remove Keychain Item
#!/bin/bash

#This script will search for a keychain item for the OLD Fileshare server and remove it.

#This will find the current logged in user

USER=$(defaults read /Library/Preferences/com.apple.loginwindow.plist lastUserName)

#This is the keychain item to delete

KEYCHAIN_ITEM="192.168.9.108"

#Command to delete the keychain item

/usr/bin/security delete-internet-password -l "$KEYCHAIN_ITEM" /Users/"$USER"/Library/Keychains/login.keychain

Remove Sites from Jamf Pro server

Remove Sites from Jamf Pro server
#!/bin/bash
for i in $(seq -w 0 13);do
	for j in {1..12};do
		curl -sku jamfadmin:jamf1234 https://pro.jamf.training:8443/"$i"/JSSResource/sites/id/"$j" -X DELETE
	done
done

EA to discover current caching server being used

EA to discover current caching server being used
#!/bin/sh
#
#
#
#Jamf Pro Extension Attribute to return the active Caching Server
#Note that the return is either a multi-line output of IPs or null if none are found
#
#
result=`/usr/bin/AssetCacheLocatorUtil 2>&1 | grep guid | awk '{print$4}' | sed 's/^\(.*\):.*$/\1/' | uniq`
echo "<result>$result</result>"

Create classrooms in Jamf Pro

Create classrooms in Jamf Pro
#!/bin/bash


#########################################
#
#
# This script is designed to upload a CSV to create AppleClassroom classes in JAMF pro
#   Created by Trey Howell August 2 2018
#
#
############################################



######Variables

####Account for access to API, needs ability to check accounts and read, write and create to Static groups, Device records, and Classes
apiuser="apiusername"
apipass="apipassword"
####comment out above and uncomment these if you want to ask for username and password
#apiuser="$(osascript -e 'Tell application "System Events" to display dialog "Enter the Username with API right" default answer "jsmith"' -e 'text returned of result' 2>/dev/null)"
#apipass="$(osascript -e 'Tell application "System Events" to display dialog "Enter the  Password for the account:" default answer "" with hidden answer' -e 'text returned of result' 2>/dev/null)"


####JSS Server, if Clustered may need to use a specific Server. I have had issues where not all Servers in cluster work with API calls
jssser="https://jssserver.com:8443"
#jssser="https://jssserver.com:8443"
####comment out above and uncomment these if you want to ask for JSS address
#jssser="$(osascript -e 'Tell application "System Events" to display dialog "Enter JSS address without ending slash" default answer "https://jss.org:8443"' -e 'text returned of result' 2>/dev/null)"


##comment out these lines if not using Sites
####getsite info
ste="$(osascript -e 'Tell application "System Events" to display dialog "Enter three digit site info" default answer ""' -e 'text returned of result' 2>/dev/null)"
#####hardcode Site info
#ste="TME"
#### for Logs being Created
loggedInUser=`ls -l /dev/console | awk '{print $3}'`
TIME=`date "+Date:%m-%d-%Y TIME:%H:%M:%S"`




                     ######################################################################
########################################do not modify below this line ###############################################
                     ######################################################################

#####ask for path for CSV file
INPUT="$(osascript -e 'Tell application "System Events" to  return POSIX path of (choose file with prompt "Select an CSV file")')"
###comment out above and uncomment below and put in path to hardcode.
#INPUT=$1
####commented out but may need to add a extra line for parsing
#head -N 1 "$INPUT" >> "$INPUT"
echo " " >> "$INPUT"
########Parseing the CSV file for DATA
SaveIFS=$IFS
IFS=","
while read serl stid stufrst stulst tchrnme tchrusrnme tchrnme1 tchrusrnme1 tchrnme2 tchrusrnme2 tchrnme3 tchrusrnme3 tchrnme4 tchrusrnme4 tchrnme5 tchrusrnme5  status
do

####Create log on Desktop in folder
mkdir -p /Users/$loggedInUser/Desktop/Classroom
echo "***********************************************************************" >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"
echo $TIME >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"
echo " " >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"

#####random Gernerated data
rando=`cat /dev/urandom | env LC_CTYPE=C tr -cd 'a-z' | head -c 8`
#############This part will add the Student info to the iPAd #################################################################################
	
#########strips out the beginning S if it exist, ignores it if it exists
serl2=`echo $serl | sed 's/^S\\(.*\\)/\\1/'`

###log
echo $serl2 >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"
#####get ID of Student IPAD. Required for API Scripting
stuipdid=`curl -k -s -u $apiuser:$apipass $jssser/JSSResource/mobiledevices/serialnumber/$serl2 | xpath /mobile_device/general/id[1] | sed 's,<id>,,;s,</id>,,' | tail -1`

####create student in VPP tab
echo "<user><name>"$stufrst  $stulst"</name><full_name>"$stufrst  $stulst"</full_name></user>" >  /tmp/vpp.xml
	
curl -k -s -u $apiuser:$apipass $jssser/JSSResource/users/id/0 -T /tmp/vpp.xml -X POST >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"

	
###	Create XML to associate Student to iPad 
#echo "<mobile_device><general><site><name>"$ste"</name></site></general><location><username>"$stid"</username></location></mobile_device>" > /tmp/std.xml
echo "<mobile_device><general><site><name>"$ste"</name></site></general><location><username>"$stufrst  $stulst"</username><realname>"$stufrst  $stulst"</realname><real_name>"$stufrst  $stulst"</real_name><email_address>$rando</email_address></location></mobile_device>" > /tmp/std.xml
####upload the XML file to JSS 
curl -k -s -u $apiuser:$apipass $jssser/JSSResource/mobiledevices/id/$stuipdid -T /tmp/std.xml -X PUT >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"
	
######this Adds the Teacher in the Assigned to Attribute, Helps looking up student by Teacher named
##### Setting Variable for xml file with asset variable for Assigned to Teacher It is the extension attribute to be userd for later purposes ######
#can't have Spaces in usernames for Attributes, so this removes any spaces
tchrnmef=`echo "$tchrnme""_""$ste" | sed 's/ //g'` 
#tchrnmef=`echo $tchrnme`
####create XML for Teacher Attribute 
echo "<mobile_device><extension_attributes><extension_attribute><id>1</id><value>"$tchrnmef"</value></extension_attribute></extension_attributes></mobile_device>" > /tmp/nametcrt.xml

#####upload XML to JAMF PRO
curl -k -s -u $apiuser:$apipass $jssser/JSSResource/mobiledevices/id/$stuipdid -T /tmp/nametcrt.xml -X PUT >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"	

#############END OF This part will add the Student info to the iPAd  END OF #################################################################################
	
######create Static group and assign devices to group #############################################################

####create xml for static group
#echo "<mobile_device_group><name>"$tchrnmef"</name><is_smart>false</is_smart></mobile_device_group>" > /tmp/sticgrpc.xml
echo "<mobile_device_group><name>"$tchrnmef"</name><is_smart>false</is_smart><site><name>"$ste"</name></site></mobile_device_group>" > /tmp/sticgrpc.xml
########Upload Static Goup
curl -k -s -u $apiuser:$apipass $jssser/JSSResource/mobiledevicegroups/name/$tchrnmef -T /tmp/sticgrpc.xml -X POST >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"

########Add individual devices to Static Group just created
######create XML for Serial devices assigning to groups
echo "<mobile_device_group><mobile_device_additions><mobile_device><serial_number>"$serl2"</serial_number></mobile_device></mobile_device_additions></mobile_device_group>" > /tmp/sticgrp.xml

####upload Serials to JSS for Static Group
curl -k -s -u $apiuser:$apipass $jssser/JSSResource/mobiledevicegroups/name/$tchrnmef -T /tmp/sticgrp.xml -X PUT >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"

######END OF create Static group and assign devices to group END OF#############################################################

#########################add Static group to Class and create class #######################################################################




#########################END OF add Static group to Class and create class END OF#######################################################################

##############################This will add additional Teachers to the Class, The API requires all teachers be uploaded at same time, otherwise it will write over last one. This is why it checks for how many users. ####################

#####check see if 6th Teacher exits than add all 6 teachers
if [ "$tchrnme5" != "" ];then
echo "<class><name>"$tchrnmef"</name><teachers><teacher>"$tchrusrnme"</teacher><teacher>"$tchrusrnme1"</teacher><teacher>"$tchrusrnme2"</teacher><teacher>"$tchrusrnme3"</teacher><teacher>"$tchrusrnme4"</teacher><teacher>"$tchrusrnme5"</teacher></teachers></class>" > /tmp/class3.xml

#####check see if 5th Teacher exits than add all 5 teachers
elif [ "$tchrnme4" != "" ];then
echo "<class><name>"$tchrnmef"</name><teachers><teacher>"$tchrusrnme"</teacher><teacher>"$tchrusrnme1"</teacher><teacher>"$tchrusrnme2"</teacher><teacher>"$tchrusrnme3"</teacher><teacher>"$tchrusrnme4"</teacher></teachers></class>" > /tmp/class3.xml

#####check see if 4th Teacher exits than add all 4 teachers
elif [ "$tchrnme3" != "" ];then
echo "<class><name>"$tchrnmef"</name><teachers><teacher>"$tchrusrnme"</teacher><teacher>"$tchrusrnme1"</teacher><teacher>"$tchrusrnme2"</teacher><teacher>"$tchrusrnme3"</teacher></teachers></class>" > /tmp/class3.xml

#####check see if 3rd Teacher exits than add all 3 teachers
elif [ "$tchrnme2" != "" ];then
echo "<class><name>"$tchrnmef"</name><teachers><teacher>"$tchrusrnme"</teacher><teacher>"$tchrusrnme1"</teacher><teacher>"$tchrusrnme2"</teacher></teachers></class>" > /tmp/class3.xml

#####check see if 2nd Teacher exits than add all 2 teachers
elif [ "$tchrnme1" != "" ];then
echo "<class><name>"$tchrnmef"</name><teachers><teacher>"$tchrusrnme"</teacher><teacher>"$tchrusrnme1"</teacher></teachers></class>" > /tmp/class3.xml

#####check see if 2nd Teacher exits than add all 2 teachers
elif [ "$tchrnme" != "" ];then
echo "<class><name>"$tchrnmef"</name><teachers><teacher>"$tchrusrnme"</teacher></teachers></class>" > /tmp/class3.xml

fi

#####upload the proper XML File for Class
curl -k -s -u $apiuser:$apipass $jssser/JSSResource/classes/id/0 -T /tmp/class3.xml -X POST 

#####log info
cat /tmp/class3.xml >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log" 
##############################END OFThis will add additional Teachers to the Class, The API requires all teachers be uploaded at same time, otherwise it will write over last one. This is why it checks for how many users. END OF #######################################


########this is all logging, comment out to line 192 if not wanting logging
	#####testing to see variables Commented out but can be uncommented
	echo "Serial : $serl" >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"
	echo "Serial : $serl2" >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"
	echo "ipad id : $stuipdid" >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"
	echo "studentid : $stid" >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"
	echo "studentlast : $stulst" >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"
	echo "student first : $stufrst" >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"
	
done < $INPUT
IFS=$SaveIFS
#####loop Ends here
echo "teacher : $tchrnme" >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"
	echo "teacher id : $tchrusrnme" >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"
	echo "teacher : $tchrnme1" >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"
	echo "teacher id : $tchrusrnme1" >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"
	echo "teacher : $tchrnme2" >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"
    echo "teacher id : $tchrusrnme2" >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"
	echo "teacher : $tchrnme3" >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"
	echo "teacher id : $tchrusrnme3" >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"
	echo "teacher : $tchrnme4" >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"
	echo "teacher id : $tchrusrnme4" >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"
	echo "teacher : $tchrnme5" >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"
	echo "teacher id : $tchrusrnme5" >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"
echo "Finished" >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"
echo "*********************************************************************************************************************************************************************************************************************" >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"
echo "   " >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"
echo "   " >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"
echo "   " >> "/Users/$loggedInUser/Desktop/Classroom/$tchrnme.log"


######end of logging



######Get ID of static group, needed for adding to Class
grpid=`curl -k -s -u $apiuser:$apipass $jssser/JSSResource/mobiledevicegroups/name/"$tchrnmef" | xpath /mobile_device_group/id[1] | sed 's,<id>,,;s,</id>,,' | tail -1`


######Get Group so we can add static group to Class
echo "<class><site><name>"$ste"</name></site><mobile_device_group_ids><id>$grpid</id></mobile_device_group_ids></class>" > /tmp/class.xml

#####get ID for class
clssid=`curl -k -s -u $apiuser:$apipass $jssser/JSSResource/classes/name/$tchrnmef | xpath /class/id[1] | sed 's,<id>,,;s,</id>,,' | tail -1`

######add static group to Class Students
curl -k -s -u $apiuser:$apipass $jssser/JSSResource/classes/id/$clssid -T /tmp/class.xml -X PUT 

######CLEAN UP OF TMP FILES
sleep 3
rm /tmp/*.xml

Change from Local to Domain

Change from Local to Domain
#!/bin/bash


#### Variables 
loggedInUser=`ls -l /dev/console | awk '{print $3}'`
allusers=`sudo dscl . list /Users | grep -v '^_' | xargs | sed -e 's/ /", "/g' | awk '{ print "\""$0"\""}'`
#####Change these Variables only

dirSearchBase="DC=risd,DC=net"
dirHost="'risd.net'"

domnusr="'domin accountt'"
dmnpass="'domain password'"

binduser="'domain join account'"
bindpass="'password'"
Domainname="'risd.net'"











oldusr=$loggedInUser
#oldusr="$(osascript -e 'tell application "System Events" to activate' -e 'tell application "System Events" to return (choose from list {'"$allusers"'} with prompt "Choose your  Account" with title "Account" OK button name "Select" cancel button name "Quit")')"
adur=`dscl . -read /Users/$oldusr | grep OriginalAuthenticationAuthority`

if [ "$adur" != "" ]; then
    osascript -e 'Tell application "System Events" to display dialog "This user is already a network User" buttons {"Cancel"} cancel button "Cancel" default button "Cancel" with icon caution'
    exit 1
fi

######VErify User is same as AD USER
###This Does The Query for the CN of the User Account


#ldapsearch -h "risd.net" -p 389 -x -D "domjoin" -w "Tms-k12J01n" -b "DC=risd,DC=net" -s sub sAMAccountName="hhorton"
verifusr=`ldapsearch -h "risd.net" -p 389 -x -D "domain account" -w "domain password" -b "DC=risd,DC=net" -s sub sAMAccountName="$loggedInUser" | grep sAMAccountName | tail -1 | awk '{print $NF}' | tr '[:upper:]' '[:lower:]'`
if [ $verifusr == $loggedInUser ]; then
    # The user pressed Cancel
 #   exit 1 # exit with an error status
#fi


###delete user but not Data
sudo dscl . -delete /Users/$oldusr


#######Fix Permissions and ownership of Files
/System/Library/CoreServices/ManagedClient.app/Contents/Resources/createmobileaccount -n $loggedInUser
sudo dscl . -append /Groups/admin GroupMembership $loggedInUser
sleep 5
chown -R $oldusr /Users/$oldusr &






osascript -e 'Tell application "System Events" to display dialog "Please log out, and log in with your network credentials." buttons {"OK"} cancel button "OK" default button "OK" with icon caution'

else
osascript -e 'Tell application "System Events" to display dialog "The user is not a network  User. Please contact Helpdesk" buttons {"OK"} cancel button "OK" default button "OK" with icon caution'
fi

Download all ipsws

Download all ipsws
#!/bin/sh


PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/libexec:/usr/local/bin
export PATH

### Begin user editable values ###

# Set the following to the location you wish to download to, we will attempt to make it if it doesn't exist
TARGET_DIR="/Users/Shared/IPSWs"

### End user editable values ###

# Internal variables, do not edit
THE_LIST_URL="http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStore.woa/wa/com.apple.jingle.appserver.client.MZITunesClientCheck/version"
PROG_NAME=`basename "${0}"`
DATE=`date +%Y-%m-%d_%H:%M:%S`
LOG_LOCATION="${HOME}/Library/Logs/${PROG_NAME}"
LOG_FILE_NAME="${PROG_NAME}_${DATE}.log"
BACKGROUND="true"
FORCE_UPDATE="false"
VERBOSE="false"

# parse the options...
while getopts 'wfvhl' OPTION
do
	case ${OPTION} in
		w)	BACKGROUND="false"	# Remove the &
			;;
		f)	FORCE_UPDATE="true"
			;;
		v)	VERBOSE="true"
			;;
		l)	mkdir -p "${LOG_LOCATION}"
			set -x
			exec 1>>"${LOG_LOCATION}"/"${LOG_FILE_NAME}" 2>&1
			;;
		?)	cat >&2 <<-EOF
			Usage: ${PROG_NAME}: [-h] [-w] [-f] [-v] [target_dir]
			
			Download available IPSWs to ${TARGET_DIR} or target_dir, if specified.
			
			Options:
			-w  Wait for downloads. Default is to schedule downloads in the background
			    and exit.
			-f  Force downloading of all updates. Default is to download only IPSWs
			    that are not already in the target directory.
			-v  Verbose output. Default is to operate silently.
			-l  Enables logging to the directory ${LOG_LOCATION}.
			    Default is to not log.
			-h  Print this message and exit.
			EOF
			exit 1
			;;
	esac
done
# and eat them
shift $((OPTIND - 1))

# If an arg has been specified, use it as the target
if [ "${1}" != "" ]; then
	TARGET_DIR=${1}
fi

# Try to make the target directory, if it doesn't exist.
if [ ! -d "${TARGET_DIR}" ]; then	
	mkdir -p "${TARGET_DIR}"
	if [ $? -ne 0 ]; then
	        echo "$0: Can't create ${TARGET_DIR}, exiting..."
	        exit 2
	fi
fi

# Get a temp file
TEMP_FILE=`mktemp -q "/tmp/${PROG_NAME}.XXXXXX"`
if [ $? -ne 0 ]; then
        echo "$0: Can't create temp file, exiting..."
        exit 3
fi

DOWNLOAD_COUNT_FILE=`mktemp -q "/tmp/${PROG_NAME}.XXXXXX"`
if [ $? -ne 0 ]; then
        echo "$0: Can't create temp file, exiting..."
        exit 4
fi

DOWNLOAD_COUNT=0

# Fetch the catalog and filter for IPSW files
curl -s -L "$THE_LIST_URL" | grep -v "http://www.apple.com" | grep "http://.*ipsw" | sed -e 's/<string>//' -e 's/<\/string>//' | awk '{print $1}' | uniq | while read IPSW_URL; do
	# get just the FILE_NAME to save 
	FILE_NAME=`echo "$IPSW_URL" | awk 'BEGIN { FS="/" } ; { print $NF }'` 
	
	# Check the temp file for this filename
	grep -q "${FILE_NAME}" "${TEMP_FILE}"
	IN_FILE=$?
	
	if [ "${IN_FILE}" -ne "0" ]; then
		# It wasn't in the temp file, so we're not downloading it currently. Should we?
		if [ "${FORCE_UPDATE}" == "true" -o ! -e "${TARGET_DIR}/${FILE_NAME}" ]; then 
			echo "${FILE_NAME}" >> "${TEMP_FILE}"
			if [ "${VERBOSE}" == "true" ]; then
				echo "Fetching ${FILE_NAME}"
			fi
			if [ "${BACKGROUND}" == "true" ]; then
				curl -s -L "${IPSW_URL}" -o "${TARGET_DIR}/${FILE_NAME}" &
			else
				curl -s -L "${IPSW_URL}" -o "${TARGET_DIR}/${FILE_NAME}"
			fi
			DOWNLOAD_COUNT=`expr ${DOWNLOAD_COUNT} + 1`
			echo "${DOWNLOAD_COUNT}" > "${DOWNLOAD_COUNT_FILE}"
		fi
	fi
	
done

if [ "${VERBOSE}" == "true" ]; then
	DOWNLOAD_COUNT=`cat "${DOWNLOAD_COUNT_FILE}"`
	if [ "${BACKGROUND}" == "true" ]; then
		echo "Downloading ${DOWNLOAD_COUNT} iOS IPSW updates to ${TARGET_DIR} in the background."
	else
		echo "Downloaded ${DOWNLOAD_COUNT} iOS IPSW updates to ${TARGET_DIR}."
	fi
fi

# clean up the temporary files
rm "${TEMP_FILE}"
rm "${DOWNLOAD_COUNT_FILE}"

exit 0

Name Computer Script

Name Computer Script
#!/bin/bash
 
# Declare Variables

# This is the name of the Jamf Pro Account that has priviges for the API. Note this should be limited
apiuser=""

# This is the password of the Jamf Pro Account that has priviges for the API. Note this should be limited
apipass=""

# This is the Jamf Pro URL
jamfurl=""

# This will set a default Prefix for a computer name
prefix="EDU"

# hardcode Serial Number Variable
serialNumber=""
 
# Get Serial Number 
serialNumber="$(system_profiler SPHardwareDataType | awk '/Serial Number/{print $4}')"
 
# Get the Current Assigned User
User=$(curl -su "$apiuser":"$apipass" -H "Accept: application/xml" "$jamfurl"JSSResource/computers/serialnumber/"$serialNumber" | xmllint --xpath '/computer/location/username/text()' -)
 
# Get assigned Building
Building=$(curl -su "$apiuser":"$apipass" -H "Accept: application/xml" "$jamfurl"JSSResource/computers/serialnumber/"$serialNumber" | xmllint --xpath '/computer/location/building/text()' -)
 
# Check to see if a user is assigned, if not, exit script using error code 1
if [[ "$User" == "" ]]; then
	echo "User not assigned to computer record"
	exit 1
fi
 
# Check to see if a building is assigned, if not, exit script using error code 2
if [[ "$Building" == "" ]]; then
	echo "Building not assigned to computer record"
	exit 2
fi
 
# Set Variable for naming computer
computerName=$(echo "$prefix-$Building-$User")
 
# Set Computer Name
sudo scutil --set HostName "$computerName"
sudo scutil --set LocalHostName "$computerName"
sudo scutil --set ComputerName "$computerName"
 
echo "$computerName"

EA to report T1 or T2

EA to report T1 or T2
#!/bin/bash

#Report T2 Chip presence in Recon

if system_profiler SPiBridgeDataType | grep "T2"; then
	tchip="Yes - T2"
fi

if system_profiler SPiBridgeDataType | grep "T1"; then
	tchip="Yes - T1 "
fi

echo "<result>$tchip</result>"

EA for last reboot

EA for last reboot
 #!/bin/bash

result=$(date -j -f "%s" $(sysctl kern.boottime | awk '{print $5}' | tr -d , ) +"%F %T")
echo "<result>$result</result>"

Remove all unapproved admins

Remove all unapproved admins
#!/bin/bash

#This script will loop through all admins on the computer automatically removing "root" from the array "knownAdmins".
#This script is based off parameters. Example: $1, $2 $3.
#Making this ready for Jamf policy deployment the parameters have been set for $4 and above.
#Upload Script to Jamf and make use of Parameters to be known good admins. Example: Parameter 4 = backdoorITadmin, Parameter 5 = *Jamf Management Account*
#If more parameters are needed, please add an OR to the IF statement.

knownAdmins=$(dscl . read /Groups/admin GroupMembership | awk '{for (i=2; i<=NF; i++) print $i}' | grep -v root ) ##Array for all Admins


for i in ${knownAdmins[@]};do

	if [ "$i" == "$4" -o "$i" == "$5" -o "$i" == "$6" -o "$i" == "$7" ];then ##Looping through knownAdmins and checking against parameters
			echo $i user is a known admin.
		else
			echo $i is not a known admin. Removing from admin group...
			 dseditgroup -o edit -d $i admin ##If admin is found that is not declared in a parameter. Remove from admin group.
	fi
done

56 freelancing tools & resources

Brad Hussey - brad@bradhussey.ca - 11.16.18
Free Stock Photography

Stock photography usually sucks... it's expensive, most photographs look staged and fake, and for the most part, they don't actually look good or match your designs. Luckily, there's a huge movement going on right now where professional (and extremely talented) photographers are giving their photos away totally free, for whatever you want, no strings attached! Below is a list of a bunch of websites that feature totally free stock photography that you can use in your designs, your websites, apps, games, etc. (Make sure to double-check the photo you use is actually free, as there may be the odd photo that requires a credit to the photographer).

Unsplash - Do-whatever-you-want high-resolution photos. Download 10 new free photos every 10 days.
Startup Stock Photos - Take 'em, these things are free. Go. Make something.

Pic Jumbo - totally free photos & stock images.

Gratisography - Free, use as you please, high-resolution stock photos for personal and commercial projects.

Death to The Stock Photo - A photo & inspiration haven for creatives crushing their path. Free photos by email every month

Negative Space - Free stock photos in high resolution with their RAW files. All photos are released under CC0, no copyright restrictions.

Splitshire - Royalty Free Stock Photos & Images.

Life of Pix - Free stock photos, high-resolution, for personal and commercial uses. New pictures added weekly! High-resolution images, pix & photographies for free for U!

The Stocks - the best royalty free stock photos in one place

Endless Icons - A collection of free flat icons and creative stuff.


Productivity Tools

Running a home based business means you have total freedom of your own schedule. For some people, that can be scary because they're worried they won't be able to keep themselves accountable. What I've found is that because this is my thing, I'm running my own business, and I'm in charge of my professional destiny — I don't mess around, and I take my work seriously. I suggest you do too. There's nothing wrong with taking a long weekend, or working early mornings so you can spend the rest of the afternoon with your kids — but honestly, take what you do seriously, don't mess around.

One of the most valuable things I've done in my business is 10x my productivity, and maximize my per-hour output so the time I spend working is insanely productive. This means I don't have to spend a full 8 hours per day, because in the 4 - 6 hours I work each day, I produce about 10 hours of work. The following tools are the exact tools I use to help me boost my productivity.

Trello - I use Trello basically 24/7. It's my all-in-one project manager, task tracker, I manage my global team, communicate with clients, track my progress and so much more. Trello is amazing, and I highly recommend you pause reading this email (but come back!), and go get yourself a free Trello account.

Dropbox - Probably the single-most important piece of software I use to run my business (other than a code editor) is Dropbox. It's very likely that you use Dropbox already, and if that's the case, good on ya! If you don't have a Dropbox account, or have never heard of Dropbox, listen up, because you're missing out. First of all, Dropbox is totally free. There's an option to sign up for two different premium versions of Dropbox, but in all honesty, you probably won't need it. I only recently signed up for the premium version of Dropbox, simply because of how much I use (and love) it.

RescueTime - A free application that runs in the background and tracks your computer usage. You receive weekly reports letting you know when you’re most productive, and what you’re wasting time on. Ever since using RescueTime, I’ve been able to cut my workweek from 40 hours a week to 20 hours a week simply because I now fully understand when I get most of my work done. I love it!

1Password - I’ve given up having to remember a bunch of passwords long ago. I literally have hundreds of accounts scattered across the Internet, and it was impossible for me to remember all of the passwords, so I’d end up only having two or three variations of the same password — which is very insecure, and frustrating because you still have to remember the variation. With 1Password, I only have to remember a single secure master password in order to log in to any of my accounts. It’s saved me so many headaches, and now all of my passwords are more secure than ever. I use this tool everyday, and I suggest you consider adding it to your tool belt. 1Password is available for all your devices, for both Mac & Windows

WorkFlowy - an organizational tool that makes life easier. It's a surprisingly powerful way to take notes, make lists, collaborate, brainstorm, plan, and more.

Toggl - Best time tracking system for a small business. A simple online timer with a powerful timesheet calculator.

Evernote - Take notes to a new level with Evernote, the productivity app that keeps your projects, ideas, and inspiration handy across all your digital devices.


Design & Coding Tools

InvisionApp - Transform your Web & Mobile (iOS, Android) designs into clickable, interactive Prototypes and Mockups. Share and Collaborate on them with others.

Coda 2 - You code for the web. You demand a fast, clean, and powerful text editor. Pixel-perfect preview. A built-in way to open and manage your local and remote files. And maybe a dash of SSH. Say hello, Coda.

Adobe Brackets - An open source code editor for web designers and front-end developers. Supported by Adobe.

Adobe CreativeCloud - Creative Cloud gives you our entire collection of creative tools for your desktop, like Photoshop, Illustrator, InDesign and Adobe Premiere Pro.

CodeKit - CodeKit compiles Less, Sass, Stylus, Jade, Haml, Slim, CoffeeScript, Javascript, TypeScript, Markdown and Compass files automatically each time you save.

BitBucket - Bitbucket is the Git solution for professional teams. Collaborate on code with inline comments and pull requests.

OmniGraffle - OmniGraffle is for creating beautiful, precise graphics. Available for Mac, iPhone, and iPad.

Little Ipsum - LittleIpsum is the fastest Latin Text Generator for OS X.


Business Management

ConvertKit - ConvertKit is an email marketing tool for bloggers & entrepreneurs. It is hands down the most valuable piece of marketing software I use in my online business. I used ConvertKit to grow my email list 4x in 2015 from 3,400 to almost 14,000 subscribers and I’m so happy with my experience so far. If you’re a blogger, own an online business, or you’re just starting out and looking to build an email list — trust me when I say ConvertKit is the best tool for the job.

Quickbooks Online - When I incorporated my business in late 2014, I started using Quickbooks Online as suggested by my accountant. Incorporated businesses have much more complicated financial detail that needs to be properly tracked. Sending estimates & invoices, tracking expenses, and keeping all of my business financials in order is super easy with Quickbooks Online. I added my accountant to my Quickbooks account, and when tax time comes around, she makes sure everything is organized & tracked properly, and I get to just focus on growing my business.

JustHost - When I made my very first website over 7 years ago, I signed up with Justhost — and I’ve never looked back! Since then, I’ve built hundreds of websites with Justhost as my only hosting provider. I recommend these guys to all of my clients, my students, my family and friends. If you’re looking to start your very first website, or are looking for a reliable hosting provider — look no further. You get a free domain name for life, great customer service, unlimited domains, unlimited email accounts, unlimited GBs of space, an anytime money back guarantee.

Ballpark - Ballpark lets you track your time, send estimates & invoices to your clients, manage your contacts, and lets your clients pay you online using their credit card. This service has been incredibly valuable to me as a professional freelancer, and has saved me thousands of dollars when handling professional web development projects. I simply couldn’t recommend these guys enough!

ScreenFlow - I use ScreenFlow on a daily basis to create my online courses and tutorials. I believe it’s simply the best tool out there for screen recording, and editing your videos. It works amazing for me, and has made me thousands of dollars. I would never recommend this tool (let alone highlight it) if I didn’t think it was amazing.

Basecamp - Basecamp is a private, secure space online where people working together can organize and discuss everything they need to get a project done. See it, track it, discuss it, act on it. Tasks, discussions, deadlines, and files - everything’s predictably organized in Basecamp.

HelloSign - Fast, Secure, and Legally Binding eSignatures for Business

Expensify - Hassle-free expense reporting built for employees and loved by admins.

Hello Bonsai - Bonsai provides bulletproof freelance work contract templates, simple e-signing, and payment escrow for creative freelancers like designers and developers.

Harvest App - Simple time tracking, fast online invoicing, and powerful reporting software. Simplify employee timesheets and billing.


My Favourite Blogs & Websites

Code College - Learn Web Design, Web Development & How to Build an Online Business with our world-class online courses, and engage with a vibrant community of likeminded students.

Teachable - Your skills and experiences are valuable. Build a beautiful course website and control your branding, student data, and pricing all from one place.

Udemy - Udemy is an online education marketplace with limitless variety: over 7 million students enrolled in more than 30000 courses, taught by 19000 instructors.

LinkedIn - Manage your professional identity. Build and engage with your professional network. Access knowledge, insights and opportunities.

Smart Passive Income - Learn how to build an online passive income business with Pat Flynn.

ThemeForest - Discover 23499 WordPress Themes and Website Templates from only $2 on ThemeForest, the #1 marketplace for Website Templates.

Creative Market - Buy and sell handcrafted, mousemade design content like vector patterns, icons, photoshop brushes, fonts and more at Creative Market.

Video Fruit - step-by-step formulas to grow your business.

Nathan Barry - Nathan is a software designer and author in Boise, Idaho. Most recently he wrote The App Design Handbook, a complete guide to designing beautiful iOS applications.

Entrepreneur on Fire - EntrepreneurOnFire is an award winning Podcast where John Lee Dumas chats with today's most inspiring Entrepreneurs 7-days a week. Prepare to IGNITE!

Four Hour Workweek Blog - Tim Ferriss's 4-Hour Workweek and Lifestyle Design Blog.

Zen Habits - Zen Habits is about finding simplicity and mindfulness in the daily chaos of our lives. It’s about clearing the clutter so we can focus on what’s important, create something amazing, find happiness.


Useful Apps

BackBlaze - Backblaze is a pioneer in robust, scalable low cost cloud backup and storage services. Personal online backup to enterprise scale data storage solutions.

CleanMyMac - Mac Cleaning Software. Clean, optimize, and maintain your Mac with CleanMyMac 3.

Skype - Skype keeps the world talking, for free. Share, message and call - now with group video on mobile and tablet too.

Auto Text Expander - Auto Text Expander allows you to set up keyword shortcuts for your most frequently used text snippets.

Boomerang for Gmail - Boomerang adds scheduled sending and the easiest, most integrated email reminders to Gmail, helping you reach Inbox Zero.

Undo Send for Gmail - Gmail plugin that allows you to undo send your messages, just in case you said something you shouldn't have!

Crowdcast - Connect with your audience over live video. Simple & powerful Q&As, webinars, live courses & online summits with your audience.

Google Hangouts on Air - With Hangouts On Air, you can host and broadcast live discussions and performances to the world through your YouTube channel or Google+ Home page. You can also edit and share a copy of the broadcast.

Appear.in - Video conversations with up to 8 people for free. No login required – no installs.