Skip to content

Instantly share code, notes, and snippets.

View awildeone's full-sized avatar

Andrew Wilde awildeone

  • Vancouver, BC, Canada
View GitHub Profile
@talkingmoose
talkingmoose / Download and Install Microsoft product.zsh
Last active April 22, 2024 23:51
**Download the latest version of this script from: https://gist.github.com/b6637160b65b751824943ede022daa17 .** Downloads and installs the latest available Microsoft product specified directly on the client. This avoids having to manually download and store an up-to-date installer on a distribution server every month.
#!/bin/zsh
:<<'ABOUT_THIS_SCRIPT'
-----------------------------------------------------------------------
Written by:William Smith
Partner Program Manager
Jamf
bill@talkingmoose.net
https://gist.github.com/b6637160b65b751824943ede022daa17
@opragel
opragel / add_vpn_to_menu_and_enable_show_time.sh
Created March 28, 2016 04:42
add_vpn_to_menu_and_enable_show_time.sh
#!/bin/bash
# Script adds the VPN item to the menu bar and enables the 'show time
# connected' & 'show status while connecting' options. Last tested on 10.11
currentUser=$(python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");')
currentUserHomeDirectory=$(dscl . -read "/users/$currentUser" NFSHomeDirectory | cut -d " " -f 2)
vpnMenuItemExists=$(defaults read "$currentUserHomeDirectory/Library/Preferences/com.apple.systemuiserver" menuExtras | grep -o VPN)
if [ "$vpnMenuItemExists" ]; then
printf "VPN menu item is already on the status bar!"
@opragel
opragel / collect_sysdiagnose_logs_for_current_user.sh
Last active January 20, 2016 21:36
collect_sysdiagnose_logs_for_current_user.sh
#!/bin/bash
currentUser=$(/usr/bin/python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");')
computerHostname=$(hostname)
dateTime=$(date +%F_%H-%M-%S)
archiveName="$computerHostname-logs.$dateTime"
outputDirectory="/Users/$currentUser/Desktop/"
expect <<- DONE
set timeout -1
spawn sysdiagnose -b -d -f "$outputDirectory" -A "$archiveName"
@opragel
opragel / add_certificate_to_keychain_and_trust.sh
Created July 29, 2015 03:27
add_certificate_to_keychain_and_trust.sh
#!/bin/bash
KEYCHAIN_PATH="/Library/Keychains/System.keychain"
CERTIFICATE_CER_PATHS=( \
"/private/tmp/my-certificate-1.cer" \
"/private/tmp/my-certificate-2.cer" )
for certificateCerPath in "${CERTIFICATE_CER_PATHS[@]}"; do
certificatePemPath="$certificateCerPath.pem"
openssl x509 -inform der -in "$certificateCerPath" -out "$certificatePemPath"
opensslVerifyResponse=$(openssl verify -CAfile "$certificatePemPath" "$certificatePemPath" | grep -o 'error.*at .*depth')
@mgreensmith
mgreensmith / Slack_solarized_themes
Last active May 2, 2024 18:14
Solarized themes for Slack
Solarized
#FDF6E3,#EEE8D5,#93A1A1,#FDF6E3,#EEE8D5,#657B83,#2AA198,#DC322F
Solarized Dark
#073642,#002B36,#B58900,#FDF6E3,#CB4B16,#FDF6E3,#2AA198,#DC322F