Skip to content

Instantly share code, notes, and snippets.

View jacobsalmela's full-sized avatar
:octocat:
To all that makes us unique

Jacob Salmela jacobsalmela

:octocat:
To all that makes us unique
View GitHub Profile
@jacobsalmela
jacobsalmela / credentials.sh
Last active August 29, 2015 14:08
Enter sample TestNav credentials
# Click full-screen button so all computers have the Safari window in the same position
osascript -e 'tell application "System Events"
set frontmost of process "Safari" to true
tell process "Safari"
click button 4 of window 1
end tell
end tell'
# Sleep for a bit seconds to make sure full screen is fully-activated
sleep 3
@jacobsalmela
jacobsalmela / open-sample-test-site.sh
Last active August 29, 2015 14:08
Opens the sample test site for TestNav
# Open sample test site
killall Safari > /dev/null
osascript -e 'tell application "Safari"
activate
set the URL of the front document to "http://testnav.com/mnqc"
end tell'
@jacobsalmela
jacobsalmela / click-start-test-button.sh
Last active August 29, 2015 14:08
Starts the system check for TestNav
# Click full-screen button twice so all computers have the Safari window in the same position
osascript -e 'tell application "System Events"
set frontmost of process "Safari" to true
tell process "Safari"
click button 4 of window 1
end tell
end tell'
# Sleep for a bit seconds to make sure full screen is fully-activated
sleep 4
@jacobsalmela
jacobsalmela / open-testnav-system-check.sh
Last active August 29, 2015 14:08
Opens the system check page for TestNav
# Open system check site
killall Safari > /dev/null
osascript -e 'tell application "Safari"
activate
set the URL of the front document to "https://proctorcaching.pearsonaccess.com/ems/systemCheck/systemCheck.jsp?acc=mn"
end tell'
@jacobsalmela
jacobsalmela / java-exceptions-testnav.sh
Last active August 29, 2015 14:08
Adds Pearsons TestNav to the Java Exception list
#!/bin/sh
# This script will x amount of servers to the Oracle Java Exception Site List.
# By Jacob Salmela
# Based on: http://derflounder.wordpress.com/2014/01/16/managing-oracles-java-exception-site-list/
# List of each server to be added to the Java whitelist (one per line in single quotes)
servers=('http://www.pearsonaccess.com/cs/Satellite?pagename=Pearson/QuickLink/mn'
'https://www.testnav.com/'
'https://proctorcaching.pearsonaccess.com/ems/systemCheck/systemCheck.jsp?acc=mn'
'https://testnav.com/mn/testnav-7.5.22.36/'
@jacobsalmela
jacobsalmela / disable-java-cache.sh
Created November 4, 2014 14:26
Disable Java cache for TestNav
# Set your variable values here
bud='/usr/libexec/Plistbuddy'
plist='/Users/student/Library/Preferences/com.oracle.javadeployment.plist'
# Disable Java cache by adding or setting the plist entry
killall cfprefsd
${bud} -c "Add /com/oracle/javadeployment/:deployment.cache.enabled bool false" ${plist}
#${bud} -c "Set /com/oracle/javadeployment/:deployment.cache.enabled false" ${plist}
killall cfprefsd
@jacobsalmela
jacobsalmela / notifier-via-jss.py
Last active August 29, 2015 14:11
Run terminal-notifier script as root without hanging
#!/usr/bin/python
#-----------IMPORTS----------
import sys,pwd,os
import subprocess
from platform import mac_ver
#----------VARIABLES---------
v, _, _ = mac_ver()
v = float('.'.join(v.split('.')[:2]))
@jacobsalmela
jacobsalmela / system-check-win.py
Last active August 29, 2015 14:12
Windows: Open TestNav system check
# Open a URL once a user is logged in
import webbrowser
new = 2 # open in a new tab, if possible
system_check = "https://proctorcaching.pearsonaccess.com/ems/systemCheck/systemCheck.jsp?acc=mn"
webbrowser.open(system_check,new=new)
@jacobsalmela
jacobsalmela / safari-fullscreen.sh
Created January 5, 2015 19:02
Make Safari full-screen
# Click full-screen button so all computers have the Safari window in the same position
osascript -e 'tell application "System Events"
set frontmost of process "Safari" to true
tell process "Safari"
click button 4 of window 1
end tell
end tell'
@jacobsalmela
jacobsalmela / chrome-settings-for-testnav.sh
Created January 5, 2015 14:24
Enable Java and pop-ups for Pearsons wonderful product.
echo '<?xml version="1.0" encoding="UTF-8"?>' > /Library/Preferences/com.google.Chrome.plist
echo '<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">' >> /Library/Preferences/com.google.Chrome.plist
echo '<plist version="1.0">' >> /Library/Preferences/com.google.Chrome.plist
echo ' <dict>' >> /Library/Preferences/com.google.Chrome.plist
echo ' <key>EnabledPlugins</key>' >> /Library/Preferences/com.google.Chrome.plist
echo ' <array>' >> /Library/Preferences/com.google.Chrome.plist
echo ' <string>Java*</string>' >> /Library/Preferences/com.google.Chrome.plist
echo ' </array>' >> /Library/Preferences/com.google.Chrome.plist
echo ' </dict>' >> /Library/Preferences/com.google.Chrome.plist
echo '</plist>' >> /Library/Preferences/com.google.Chrome.plist