This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "System Events" | |
tell appearance preferences to set dark mode to not dark mode | |
keystroke "d" using {command down, option down, control down, shift down} | |
end tell | |
set curVolume to get volume settings | |
if output muted of curVolume is false then | |
set volume with output muted | |
else | |
set volume without output muted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
############################################################## | |
# # | |
# NETBOOTCH, by Peter Bukowinski ([email protected]) # | |
# last revised July 31, 2008 at 5:48pm # | |
# # | |
# ABOUT THIS SCRIPT: # | |
# This script makes it easy to change the default NetBoot # | |
# image hosted on an Xserve via the command line. It is an # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
❯ java -version | |
java version "1.8.0_51" | |
Java(TM) SE Runtime Environment (build 1.8.0_51-b16) | |
Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode) | |
❯ java -version | head -1 | |
java version "1.8.0_51" | |
Java(TM) SE Runtime Environment (build 1.8.0_51-b16) | |
Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Pass any number of short hostnames to run cmd on all | |
# hosts in parallel and display the results nicely. | |
import sys | |
import subprocess | |
import multiprocessing | |
PROCESSES = 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script will change the hostname of a Mac to a dot-separated version | |
# of the full name of the most-commonly-logged-in user with a local home. | |
# Give a list of usernames to ignore, separated by spaces | |
ignore_list=( root admin administrator bukowinskip ) | |
# Get a list of usernames sorted by login frequency, limited to the last 100 logins | |
login_list=$(last -t console -100 | \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys, getopt, os, glob, shutil, json | |
# relative path to Chrome Default Prefs | |
chrome_prefs = "Library/Application Support/Google/Chrome/Default/Preferences" | |
def set_plugin_state(pref, plugin, state): | |
""" | |
This function parses the chrome prefs file passed to it, looking |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This section uses python to get the current console user. You can | |
# usually just use the built-in $USER variable, but this is more | |
# robust. | |
USER=$(/usr/bin/python -c \ | |
'from SystemConfiguration import SCDynamicStoreCopyConsoleUser;\ | |
print SCDynamicStoreCopyConsoleUser(None, None, None)[0]') | |
# This looks up the password expiration date from AD. It's stored |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
USER=$(/usr/bin/python -c \ | |
'from SystemConfiguration import SCDynamicStoreCopyConsoleUser;\ | |
print SCDynamicStoreCopyConsoleUser(None, None, None)[0]') | |
xWin=$(/usr/bin/dscl localhost read /Search/Users/$USER \ | |
msDS-UserPasswordExpiryTimeComputed 2>/dev/null |\ | |
/usr/bin/awk '/dsAttrTypeNative/{print $NF}') | |
xUnix=$(echo "($xWin/10000000)-11644473600" | bc) | |
/bin/date -r $xUnix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
myDomain=$(dsconfigad -show | awk '/Active Directory Domain/{print $NF}') | |
myLDAP=$(dig -t srv _ldap._tcp.${myDomain} | awk '/^_ldap/{print $NF}' | head -1) | |
mySearchBase=$(ldapsearch -LLL -Q -s base -H ldap://${myLDAP} defaultNamingContext | awk '/defaultNamingContext/{print $2}') | |
uAC=$(dscl localhost read /Search/Users/$USER userAccountControl | awk '/:userAccountControl:/{print $2}') | |
if [[ $uAC =~ ^6 ]]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# | |
# Simple python example of a Pashua password prompt window for changing passwords. | |
# It prompts for the current password, new password, and new password verification. | |
# It does the verification and redisplays the prompt with feedback if the current or | |
# new passwords do not match. | |
# | |
# THIS WILL NOT ACTUALLY CHANGE PASSWORDS. I created this as an example of how you can | |
# design Pashua dialogs and work with their output. | |
# |
NewerOlder