Skip to content

Instantly share code, notes, and snippets.

@kitzy
kitzy / rackspace_db_mod
Created January 31, 2013 20:11
This can be added to my jssdeploy script to accomodate for the JSS database connections dropping due to Rackspace's 120 second timeout on their Cloud Databases product.
# Modify database connection time from 300 to 100 to accommodate for Rackspace's Cloud Databases default timeout of 120 seconds
sed "s@<IdleConnectionTestPeriod>.*@<IdleConnectionTestPeriod>100</IdleConnectionTestPeriod>@" -i /var/lib/tomcat7/webapps/$instanceName/WEB-INF/xml/DataBase.xml
@kitzy
kitzy / deleteMacKeeper.sh
Created February 9, 2015 21:58
Delete MacKeeper and JustCloud
#!/bin/bash
# This program will uninstall MacKeeper and JustCloud
#################
### Variables ###
#################
# Items at the system level to be removed
systemItems=(
@kitzy
kitzy / checkEnrollment.sh
Created May 10, 2015 02:29
This gist checks to see if JSS enrollment is complete, and attempts to force enrollment until sucessful.
#!/bin/bash
# Check to make sure the machine has enrolled before continuing
/bin/echo "Checking enrollment..."
until [ ! -f "/Library/Application Support/JAMF/FirstRun/Enroll/enroll.sh" ]
do
/bin/echo "Machine is not enrolled. Trying enrollment."
# Attempt enrollment
/Library/Application\ Support/JAMF/FirstRun/Enroll/enroll.sh
@kitzy
kitzy / pound
Created June 3, 2015 23:39
/etc/default/pound
# Defaults for pound initscript
# sourced by /etc/init.d/pound
# installed at /etc/default/pound by the maintainer scripts
# prevent startup with default configuration
# set the below variable to 1 in order to allow pound to start
startup=1
@kitzy
kitzy / pound.cfg
Created June 4, 2015 21:39
This is an example pound config for load balancing a JSS
## This is an example pound config for load balancing a JSS
## Created by John Kitzmiller - www.johnkitzmiller.com
######################################################################
## global options:
User "www-data"
Group "www-data"
#RootJail "/chroot/pound"
@kitzy
kitzy / recoveryKeyCheck.sh
Created June 20, 2015 01:32
This script will call a policy from the JSS to issue a new recovery key if it detects that the recovery key has been used to log in.
#!/bin/bash
# Automatic FV2 Individual Recovery Key re-issue script
# written by John Kitzmiller - www.johnkitzmiller.com
#
# This script will call a policy from the JSS to issue a new recovery key
# if it detects that the recovery key has been used to log in
#
### Functions ###
#!/bin/bash
jamfHelper="/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper"
icon="/path/to/logo.png"
"$jamfHelper" -startLaunchd -windowType fs -icon $icon -description "Your computer is being configured, please wait." &
@kitzy
kitzy / com.apple.screensaver.plist
Created January 16, 2016 20:35
An example screensaver plist for creating a custom configuration profile for bypassing a bug in Casper Suite v9.82.
<?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>askForPassword</key>
<integer>1</integer>
<key>askForPasswordDelay</key>
<real>0.0</real>
<key>tokenRemovalAction</key>
<integer>0</integer>
@kitzy
kitzy / 8080_server.xml
Created March 8, 2016 02:40
A connector for Tomcat working behind a load balancer for the JSS
<Connector URIEncoding="UTF-8" port="8080" executor="tomcatThreadPool" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" proxyPort="443" scheme="https" />
@kitzy
kitzy / RemoteIPValve_server.xml
Created March 8, 2016 02:44
Setting the Remote IP Valve in server.xml
<Valve className="org.apache.catalina.valves.RemoteIpValve" />