Skip to content

Instantly share code, notes, and snippets.

View pythoninthegrass's full-sized avatar

pythoninthegrass

View GitHub Profile
@pythoninthegrass
pythoninthegrass / .bash_profile
Last active May 2, 2020 18:17 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@pythoninthegrass
pythoninthegrass / 0_reuse_code.js
Created April 5, 2016 13:38
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@pythoninthegrass
pythoninthegrass / pull-printer-config.sh
Created April 5, 2016 13:41
Use to copy printer configs (CUPS.) Also nice host and user variables. See: http://www.papercut.com/kb/Main/CopyingPrinterConfigOnTheMac
#!/bin/sh
#
# (c) Copyright PaperCut Software, 2007
#
# Author: Chris Dance (chris.dance <a> papercut.com)
# A simple script to copy printer configuration from one Apple Mac OS X
# system to another.
#
TARGET_HOST=`hostname`
#!/bin/bash
########################################################################
# Originally Created Created By: Andrina Kelly, andrina.kelly@bellmedia.ca
# Modifications from scripts from Bryson Tyrrell
# Final by Ross Derewianko
# Creation Date: April 2015
# Last modified: April, 18 2015
# Brief Description: Gather diagnostic logs and submit to the JSS
########################################################################
#!/bin/bash
# Set Variables
# Who's the current console user?
LOGGEDIN=`who | grep console | awk '{print $1}'`
# What's the default mail client for the logged in user?
DEFAULTMAIL=`defaults read /Users/$LOGGEDIN/Library/Preferences/com.apple.LaunchServices.plist | perl -e 'while(<>) {push @lines, $_; m~mailto~ and last} $_ = $lines[-2]; s~[^\"]+\"~~;s~\";~~;print'`
# Get the Computer Name
COMPUTER=`hostname`
# The file that sysdiagnose created to add as an attachment
#!/bin/sh
# Mount the drive
sudo mkdir /Volumes/ClientLogs
mount_afp "afp://172.20.1.8/ClientLogs" /Volumes/ClientLogs
# Send zip file
dateformat=`date +"%Y-%m-%d"`
hostname=`jamf getComputerName | sed -e 's/<computer_name>//' -e 's/<\/\computer_name>//'`
curl -O -L https://dl.bintray.com/mitchellh/packer/packer_0.7.5_darwin_amd64.zip
unzip packer_0.7.5_darwin_amd64.zip
sudo mv packer_0.7 /usr/local/packer
sudo chown $USER /usr/local/packer/
# then update your .bash_profile with the new path e.g.:
# export PATH="/usr/local/git/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/local/packer:$PATH"
#!/bin/bash
# cf. http://www.macos.utah.edu/documentation/authentication/dscl.html
if [[ "$(/usr/bin/whoami)" != "root" ]]; then printf '\nMust be run as root!\n\n'; exit 1; fi
OPATH=$PATH
export PATH=/usr/bin:/usr/sbin:/bin:/sbin
OIFS=$IFS
#!/bin/sh
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend
#!/bin/bash
JAMFHELPER="/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper"
# Constants
mdmAirport="AirportNetworkName"
jhWindowType="utility"
jhTitle="System Management"
jhDescription="Please select the $mdmAirport network from the AirPort menu in the menu bar."
# The icon to show in the jamfHelper dialog box
jhIcon="/Library/Application Support/JAMF/icon.png"
# Name of the AirPort network which will be removed and added by removing and adding MDM profiles