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 | |
# | |
# Payload free package to create a user on a 10.7 system. | |
import sys | |
import os | |
import re | |
import time | |
import subprocess |
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
$ cat preferences.js | |
pref("app.update.url", "http://url.com/update.xml"); | |
pref("app.update.url.manual", "http://url.com/manual"); | |
$ perl -i~ -pe 's{pref("app.update.url", "http://url.com/update.xml");}{pref("app.update.url", "http://custom.edu/update.xml");}g' preferences.js | |
$ cat preferences.js* | |
pref("app.update.url", "http://url.com/update.xml"); | |
pref("app.update.url.manual", "http://url.com/manual"); | |
pref("app.update.url", "http://url.com/update.xml"); | |
pref("app.update.url.manual", "http://url.com/manual"); |
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
while getopts a:l? opt; do | |
case "$opt" in | |
a) variable="$OPTARG";; | |
l) list="LONG";; | |
h) | |
help | |
exit 0;; | |
?) | |
help | |
exit 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/sh | |
# Script credit: Jeremy Reichman <[email protected]> | |
# VolumeCheck Exit Statuses are calculated by subtracting 32 | |
# E.G. exit 48 matches 16, exit 50 matches 18 in the VolumeCheck.strings file | |
# Check for minimum Mac OS X major version on the volume | |
SCRIPT_PATH="$0" | |
VOLUME_PATH="$1" |
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/perl | |
use Foundation; | |
my $NSASCIIStringEncoding = 1; | |
my $dscl = "/usr/bin/dscl"; | |
sub getGeneratedUID(){ | |
$name = shift; | |
my $command = "$dscl -plist . -read /Users/$name GeneratedUID"; | |
print "$command\n"; | |
my $output = `$command`; |
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 sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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
When you need to run a script against a volume that has not been restored first, you can set the $DS_LAST_RESTORED_VOLUME to the internal drive of the Mac. This allows a script to work with or without restoring in a workflow. | |
DS_LAST_RESTORED_VOLUME=`system_profiler SPSerialATADataType | awk -F': ' '/Mount Point/ { print $2}'|head -n1` |
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
CREATE TRIGGER movie_rental_insert On customer_rentals | |
FOR INSERT | |
AS BEGIN | |
UPDATE movies | |
SET num_rentals = num_rentals + 1 | |
WHERE INSERTED.movie_id = movies.movie_id | |
END; |
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
#include <stdio.h> | |
#include <gssapi.h> | |
#define kserver "dce.psu.edu" | |
//#define | |
#define minor_status | |
OM_uint32 CHECK_CRED(char *name) { | |
OM_uint32 gss_inquire_cred( |
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
# Check for active connection | |
while [ "$NETACTIVE" == 'FALSE' ]; do | |
# If block to test internet availability | |
if ping -nc 3 8.8.8.8 | grep '100.0%' >/dev/null 2>&1;then | |
/bin/echo $(date) "failed to connect to server" | |
exit 1 | |
else | |
/bin/echo $(date) "Success connecting to server" | |
# Do stuff here | |
NETACTIVE=TRUE |
OlderNewer