Skip to content

Instantly share code, notes, and snippets.

View thewellington's full-sized avatar

W. S. Wellington thewellington

View GitHub Profile
@thewellington
thewellington / generatePhoneList.sh
Created February 14, 2014 16:01
Generate a telephone list using Active Directory, Word, and a Mac. Ick! #mac #active_directory #ad #phone_list
#!/bin/bash
# Phone List Generator v. 2 by bill_wellington at aw.org
# This script will pull live data from Active Directory and output a .csv
# file (named as an argument) including first name, last name, department,
# phone ext. and mobile phone ext. It goes through a strips out all
# constituents who are students, members of the "Class of...", or who do
# not have a 4 digit extension listed in either their phone number or
# their mobile number. The list can then be used to generate a phone list
# using MS Word's mail merge functions.
@thewellington
thewellington / dsstore_cleanup.sh
Created August 15, 2014 15:48
This script will recursively delete the .DS_Store file generated by Macintosh computers. It takes a single argument, the path of the directory where you wish to begin the recursive deletion. Works on both Linux and Macs (with GNU find or BSD find)
#!/usr/bin/env bash
#
# This script will recursively delete the .DS_Store file generated by Macintosh computers.
# It takes a single argument, the path of the directory where you wish to begin the recursive deletion.
#
# works on both Linux and Macs (with GNU find or BSD find)
#
# EXAMPLE:
# dsstore_cleanup.sh /path/to/directory/
#
@thewellington
thewellington / modernie.sh
Last active August 29, 2015 14:06
Downloads and Installs Win7 and IE 9 - VMware Fusion VM for Macintosh
#!/usr/bin/env bash
#
# v1.0 - 2014-09-18
#
# downloads rar files from modern.ie and extracts them.
#
# INSTRUCTIONS: place this script in your home directory, set the executable bit, and run it.
URL='https://www.modern.ie/vmdownload?platform=mac&virtPlatform=vmware&browserOS=IE9-Win7&parts=4&filename=VMBuild_20131127/VMware/IE9_Win7/Mac/'
RAR_REGEX='IE9.Win7.For.MacVMware.part0{1.sfx,2.rar,3.rar,4.rar}'
@thewellington
thewellington / extract_email.sh
Created October 20, 2014 14:41
regex to extract email addresses from a blob of text.
#!/usr/bin/env bash
#
#
# regex to extract email addresses from a blob of text.
#
# grep -i -o '[A-Z0-9._%+-]\+@[A-Z0-9.-]\+\.[A-Z]\{2,4\}' source_file.txt > dest_file.txt
#
#
@thewellington
thewellington / change_computer_name.sh
Created April 27, 2015 22:23
JAMF Casper Suite change computer name before binding to AD
#!/bin/bash
#
# change_computer_name.sh
# 2015-04-06 by bill@wellingtonnet.net
#
# This script is for use with JAMF Casper Suite and makes some assumptions about
# the context in which it is running, specifically that arguments are served by
# the JSS and that arguments 1 through 3 are predefined as mount point, computer
# name, and username, respectively.
#
@thewellington
thewellington / puppet_agent_reset.sh
Created June 30, 2015 22:27
Puppet Agent Reset
#! /bin/env python
# puppet_agent_reset.py
# Collect info from the skytap JSON and save it
#
# Tasks:
# Get the default gateway
# Collect JSON from http://<gateway>/skytap
# Parse VM ID from "id" and configuration id from "configuration_url"
# Check certname in puppet.conf, set to "VMID<vmid>-ENV<config>" if different
@thewellington
thewellington / log
Created September 27, 2013 22:33
I use this script to log everything I do throughout the day
#!/usr/bin/env python
# myLogger.py by bill@wellingtonnet.net - 2012-11-14
# This module takes additional commandline arguments, concatenates them into a
# string, and then appends that string to a defined output file.
#
# Intended to be an easy to access work log for all things that I have completed
#
# import necessary modules
@thewellington
thewellington / upload-my-key.sh
Created September 27, 2013 22:36
I use this to upload my key to servers
#!/bin/sh
# KEY="$HOME/.ssh/id_dsa.pub"
KEY="$HOME/.ssh/id_rsa.pub"
if [ ! -f ~/.ssh/id_rsa.pub ];then
echo "private key not found at $KEY"
echo "* please create it with "ssh-keygen -t [rsa|dsa]" *"
echo "* to login to the remote host without a password, don't give the key you create with ssh-keygen a password! *"
exit
@thewellington
thewellington / upload-authorized-keys.sh
Last active December 24, 2015 03:19
Used to upload keys to specific accounts usage: upload-authorized-keys.sh shellacct@hostname /path/to/key.pub
#!/bin/sh
#
# upload-authorized-keys.sh
# by bill@wellingtonnet.net
#
# This script will take a key provided as an argument on the commandline and
# add it to the authorized_keys file on a remote server. It can be used to
# upload many keys in a short time, particularly once your key is already loaded.
#
# Usage: upload-authorized-keys.sh shellacct@hostname /path/to/local/copy/of/key.pub
@thewellington
thewellington / osx-welcome.sh
Last active December 24, 2015 03:19
After building an OS X image, start the mac at the welcome screenSo... I needed to deploy a number of macs to a great number of people... and they all needed to have an "out of box" experience with the machine whereby they set up their own account and all the happy stuff that Apple gives you when you take a Mac out of the box. This script allowe…
#!/bin/bash
#
# v.1.1 by bill@wellingtonnet.net
# adapted from instructions posted at
# http://www.macgurulounge.com/easily-prep-mac-resale/
#
# This script sets a Mac up to start at the welcome screen.
# It must be run from single user mode, so put it somewhere on
# the file system, make it executable, then reboot and hold down cmd-s
#