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 | |
if [[ $# != 1 ]]; then echo "You must supply a single IP address." && exit 1; fi | |
newip="$1" | |
config="/etc/sysconfig/network-scripts/ifcfg-eth0" | |
oldip=$(awk -F= '/IPADDR/{gsub("\"","");print $2}' $config) | |
newgw=$(echo $newip | awk '{sub(".[0-9]+$",".1"); print}') | |
echo "" |
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
try | |
-- test for Kerberos ticket presence and attempt to renew | |
do shell script "/usr/bin/klist | /usr/bin/grep krbtgt" | |
do shell script "/usr/bin/kinit -R" | |
on error | |
-- offer to renew Kerberos ticket | |
set response to (display dialog "No Kerberos ticket was found. Do you want to renew it?" with icon 2 buttons {"No", "Yes"} default button "Yes") | |
if button returned of response is "Yes" then | |
try | |
set thePassword to text returned of (display dialog "Enter your password:" default answer "" with hidden answer) |
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 | |
for log in $(/bin/ls -r /var/log/install.log*); do | |
bzgrep 'Writing receipt' $log | awk '{print $1,$2,$3,$10}' | |
done |
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
try | |
set uname to do shell script "/usr/bin/whoami" | |
set passwd to text returned of (display dialog "Please enter your password:" default answer "" with hidden answer) | |
mount volume "smb://" & uname & ":" & passwd & "@server/share" | |
on error theError | |
display dialog theError buttons "Darn" default button 1 with icon 2 | |
end try |
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 | |
# Explicitly set the directory you want to operate on here | |
workingPath="/your/path/here" | |
# Set a custom internal field separator to ease handling | |
# of filenames that contain spaces | |
IFS=$'\n' | |
# Identify files that end in ' 2' and tack on our custom |
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 | |
# set the input for lazy convenience | |
IFS=$' ' | |
localadmins=$(/usr/bin/dscl localhost -read /Local/Default/Groups/admin GroupMembership | awk -F': ' '{print $2}') | |
for account in `echo $localadmins`; do | |
# add additional blocks like >> && ! [ "$account" == "username" ] << for additional exclusions | |
if ! [ "$account" == "root" ] && ! [ "$account" == "itstech" ]; 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
#!/bin/bash | |
eth0addr=$(/sbin/ip addr show eth0 | /bin/awk '/inet/{gsub("/.+","");print $2}') | |
ipone=$(/bin/echo $eth0addr | /bin/cut -c1-9) | |
iptwo=$(/bin/echo $eth0addr | /bin/cut -c11-12) | |
ipnet=$(/bin/echo $eth0addr | /bin/cut -c1-5) | |
/usr/bin/ipmitool lan set 1 ipsrc static && \ | |
/usr/bin/ipmitool lan set 1 ipaddr ${ipone}.2${iptwo} && \ | |
/usr/bin/ipmitool lan set 1 defgw ipaddr ${ipnet}.0.1 && \ | |
/usr/bin/ipmitool lan set 1 netmask 255.255.0.0 && \ |
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 | |
########################################## | |
# MKCLUSTERSCRATCH -last modified 10/10/14 | |
########################################## | |
function help { | |
cat <<EOF | |
MKCLUSTERSCRATCH TOOL |
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
getsid () { dscl localhost -read /Search/Users/$1 SMBSID 2>/dev/null | awk '{print $2}'; } |
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" | |
set isRunning to (count of (every process whose bundle identifier is "com.Growl.GrowlHelperApp")) > 0 | |
end tell | |
if isRunning then | |
tell application id "com.Growl.GrowlHelperApp" | |
-- Make a list of all notification types that this script will ever send: | |
set the allNotificationsList to {"Test Notification"} | |
-- Make a list of the enabled notifications. Others can be enabled in Growl prefs. |
OlderNewer