Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
#!/bin/sh
# Kickstarts ARD (only allows 'ladmin' user) with all controls active
# Must be run as root!
/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -users ladmin -privs -all -restart -agent -menu
exit $?
#!/bin/bash
# Displays Oracle JRE version or N/A if not found
printf '<result>'
if [ -e /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java ]; then
result=$(defaults read /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Info.plist CFBundleVersion)
printf "%s" "$result"
else
printf 'N/A'
fi
printf '</result>'
### Keybase proof
I hereby claim:
* I am opragel on github.
* I am opragel (https://keybase.io/opragel) on keybase.
* I have a public key whose fingerprint is D47C 2548 A438 026C 3851 9033 01CF C6CC 691B F9E1
To claim this, I am signing this object:
@opragel
opragel / install-canon-c5235-printer.sh
Created June 3, 2015 00:31
install-canon-c5235-printer.sh
#!/bin/bash
printerName="Canon_C5235"
printerDriver="/Library/Printers/PPDs/Contents/Resources/CNPZUIRAC5235ZU.ppd.gz"
printerAddress="lpd://0.0.0.0"
# This variable is the custom event trigger for driver install policy in JSS
driverInstallEvent="installCanonC5235driver"
# Theoretically no need to edit below here
if [ ! -f "$printerDriver" ]; then
jamf policy -event $driverInstallEvent
@opragel
opragel / gist:9ca7dc4ac7c753e83229
Created June 18, 2015 00:14
auto-install-chrome-osx.sh
#!/bin/bash
# This script will download and install Google Chrome on a fresh installation of Mac OS X.
# Usage: curl -fkL gist.github.com/raw/4364590/install-chrome.sh | sh
DOWNLOAD_URL="https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg"
DMG_PATH="/tmp/Google Chrome.dmg"
DMG_VOLUME_PATH="/Volumes/Google Chrome/"
APP_NAME="Google Chrome.app"
APP_PATH="/Applications/$APP_NAME"
@opragel
opragel / adwaremedic-signatures-modified.xml
Last active August 29, 2015 14:25
adwaremedic-signatures-modified.xml
<AdwareDefinition>
<Version>90</Version>
<DefinitionAuthor>Owen Pragel</DefinitionAuthor>
<DefinitionSource>http://www.adwaremedic.com/signatures.xml</DefinitionSource>
<Adware>
<AdwareName>FkCodec</AdwareName>
<File>/Users/*/Library/Application Support/Codec-M</File>
<File>/Users/*/Library/LaunchAgents/com.codecm.uploader.plist</File>
<File>/Applications/Codec-M.app</File>
</Adware>
@opragel
opragel / cipher.sh
Last active August 29, 2015 14:25
Updates ciphers in Tomcat server.xml for JSS 9.73
#!/bin/bash
# It's your funeral
LINUX_TOMCAT_USER="tomcat7"
LINUX_TOMCAT_GROUP="tomcat7"
LINUX_SERVER_XML_PATH="/usr/local/jss/tomcat/conf/server.xml"
LINUX_SERVER_XML_BACKUP_PATH="/usr/local/jss/tomcat/conf/server.xml.bak"
MAC_TOMCAT_USER="_appserver"
MAC_TOMCAT_GROUP="_appserveradmin"
MAC_SERVER_XML_PATH="/Library/JSS/Tomcat/conf/server.xml"
MAC_SERVER_XML_BACKUP_PATH="/Library/JSS/Tomcat/conf/server.xml.bak"
@opragel
opragel / get_all_distinct_applications_by_max_version.sql
Created September 26, 2015 00:35
get_all_distinct_applications_by_max_version.sql
select application_name, MAX(application_version) FROM applications GROUP BY application_name ORDER BY application_name;