This file contains hidden or 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
| on run {userName} | |
| set DOMAIN to (do shell script "/usr/bin/dscl localhost -list /Active\\ Directory") | |
| set PROTOCOL to "smb" -- or "afp" | |
| set mac_home to (do shell script "/usr/bin/dscl localhost -read /Active\\ Directory/" & DOMAIN & "/All\\ Domains/Users/" & userName & " SMBHome | awk '{gsub(/\\\\/,\"/\"); print \"" & PROTOCOL & ":\" $2}'") | |
| set win_home to (do shell script "/usr/bin/dscl localhost -read /Active\\ Directory/" & DOMAIN & "/All\\ Domains/Users/" & userName & " SMBHome | awk '{print $2}'") | |
| if mac_home is "" then | |
| display dialog "Could not find username: " & userName buttons "OK" default button "OK" with icon 0 | |
| else | |
| set theDialog to display dialog "Mac: " & mac_home & " | |
| Windows: " & win_home buttons {"Copy Mac", "Copy Windows", "OK"} default button "Copy Mac" |
This file contains hidden or 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
| on open location this_URL | |
| -- passed urls should be "syspref://[PaneName] | |
| -- or "syspref://[Pane_Name]" -- no spaces | |
| set x to the offset of ":" in this_URL | |
| set sp to text from (x + 3) to -1 of this_URL | |
| set pane to do shell script "echo \"" & sp & "\" | awk '{gsub(\"_\",\"\\\\ \"); print}'" | |
| set h to path to home folder | |
| set home to POSIX path of h | |
| set path_heads to {"/System/", "/", home} | |
| set pref_pane to text from (x + 3) to -1 of this_URL |
This file contains hidden or 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 | |
| workpath=/opt/auth_files/ | |
| outfile=/root/auth_find-$1 | |
| # friendly usage funtion, called if no argument is supplied | |
| usage () | |
| { | |
| cat<<EOF | |
| Usage: auth_find [username] [new-username] |
This file contains hidden or 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 | |
| # grab first argument as pdf filename and generate ps filename | |
| thePDF=$1 | |
| thePS=$(echo $thePDF.ps) | |
| queueName=$2 | |
| usage() { | |
| cat<<EOF | |
| Usage: psprint [your pdf] [lpr queue]*" |
This file contains hidden or 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/perl -w | |
| use strict; | |
| # This script automates the process of adding usersets to the user_lists section | |
| # of the SGE cluster queue configs. It takes the userset name as a command line | |
| # argument or it prompts for the userset name if no argument is given. Multiple | |
| # lists can be submitted as a comma-separated list *without spaces*. | |
| # queues to be modified | |
| my @queues = qw( |
This file contains hidden or 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 | |
| usage () { | |
| /bin/echo "Usage: shotshadows [off|on]" | |
| exit 1 | |
| } | |
| if [ $# == 1 ]; then | |
| if [ $1 == "off" ]; then | |
| /bin/echo "Disabling drop shadows in screenshots and restarting SystemUIServer" |
This file contains hidden or 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
| --this first line gets the x in os version 10.x | |
| set osVersion to (do shell script "sw_vers -productVersion | awk -F. '{print $2}'") as integer | |
| tell application "System Preferences" | |
| try -- this won't work if UI scripting is not enabled | |
| set current pane to pane id "com.apple.preferences.users" | |
| activate | |
| tell application "System Events" | |
| tell application process "System Preferences" | |
| if osVersion is less than or equal to 6 then | |
| click radio button "Password" of tab group 1 of window "Accounts" |
This file contains hidden or 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, re | |
| # get first command line argument as filename | |
| input_file = sys.argv[1] | |
| # suck in file contents | |
| with open(input_file) as f: | |
| content = f.readlines() |
This file contains hidden or 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
| on open location this_URL | |
| -- passed paths should be "finder://[/path/to/directory] | |
| -- spaces in path names should be replaced with a url-friendly '%20' | |
| set x to the offset of ":" in this_URL | |
| set passed_path to text from (x + 3) to -1 of this_URL | |
| set my_path to do shell script "echo \"" & passed_path & "\" | awk '{gsub(\"%20\",\"\\\\ \"); print}'" | |
| do shell script "open " & my_path | |
| end open location |
This file contains hidden or 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
| display dialog "Please enter the account to give administrator privileges." default answer "" | |
| set username to text returned of result | |
| try | |
| do shell script "/usr/sbin/dseditgroup -o edit -a 'DOMAIN\\" & username & "' -t user admin" with administrator privileges | |
| set question to display dialog "Successfully granted administrator privileges to " & username & "." buttons {"Quit"} default button 1 | |
| set answer to button returned of question | |
| if answer is equal to "Quit" then | |
| return | |
| end if | |
| on error |