Skip to content

Instantly share code, notes, and snippets.

Rob P motionbug

Block or report user

Report or block motionbug

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@motionbug
motionbug / sips-icns-png.sh
Last active Oct 9, 2018
Create png from icns file
View sips-icns-png.sh
#!/bin/bash
#great little script to just use system icons for scripts
ICNS="/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Sync.icns"
LOGO="/private/tmp/logo.png"
convertlogo=$(sips -z 512 512 -s format png ${ICNS} --out ${LOGO})
@motionbug
motionbug / png2icns
Created Oct 9, 2018 — forked from djhaskin987/png2icns
Convert PNG file to ICNS file
View png2icns
# Stolen from here: http://stackoverflow.com/a/20703594/850326
#!/bin/sh
export POSIXLY_CORRECT=1
if [ -z "${1}" -o -z "${2}" ]
then
echo "Usage: ${0} <name> <original-png-location>"
fi
name=$1
View logged-bash-script-example.sh
#! /bin/bash
# concept from http://stackoverflow.com/a/3403786/267224
#############
# log to file
LOGFILE=/home/user/log/script.log
exec > >(tee -a $LOGFILE)
exec 2>&1
############
@motionbug
motionbug / setenv.sh
Last active Sep 13, 2015 — forked from terrancesnyder/setenv.sh
./setenv.sh - example setenv.sh with defaults set for minimal time spent in garbage collection
View setenv.sh
#! /bin/sh
# ==================================================================
# ______ __ _____
# /_ __/___ ____ ___ _________ _/ /_ /__ /
# / / / __ \/ __ `__ \/ ___/ __ `/ __/ / /
# / / / /_/ / / / / / / /__/ /_/ / /_ / /
#/_/ \____/_/ /_/ /_/\___/\__,_/\__/ /_/
# Multi-instance Apache Tomcat installation with a focus
# on best-practices as defined by Apache, SpringSource, and MuleSoft
View organize-photos.py
#!/usr/bin/python
import sys
import os, shutil
import subprocess
import os.path
from datetime import datetime
######################## Functions #########################
View .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
View scriptAsApplesript.applescript
on replace_chars(this_text, search_string, replacement_string)
set AppleScript's text item delimiters to the search_string
set the item_list to every text item of this_text
set AppleScript's text item delimiters to the replacement_string
set this_text to the item_list as string
set AppleScript's text item delimiters to ""
return this_text
end replace_chars
@motionbug
motionbug / gist:3085136
Created Jul 10, 2012 — forked from jamesez/gist:3085058
Build Chrome dmg
View gist:3085136
#!/bin/bash -ex
# Mount disk image on temp space
mountpoint=`hdiutil attach -mountrandom /tmp -nobrowse googlechrome.dmg | awk '/private\/tmp/ { print $3 } '`
echo Mounted on $mountpoint
# Determine version number
version=`defaults read "$mountpoint/Google Chrome.app/Contents/Info.plist" CFBundleShortVersionString`
echo Google Chrome version $version
@motionbug
motionbug / com.adobe.Acrobat.Pro.plist
Created Jun 17, 2012 — forked from timsutton/com.adobe.Acrobat.Pro.plist
Suppress updates, offer to associate PDFs with Acrobat, EULA
View com.adobe.Acrobat.Pro.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>10</key>
<dict>
<key>AVAlert</key>
<dict>
<key>Checkbox</key>
<array>
@motionbug
motionbug / postflight
Created Jun 15, 2012 — forked from rockpapergoat/postflight
create a recovery partition using apple's tools
View postflight
#!/bin/bash
hdiutil attach -nobrowse -noverify /tmp/RecoveryHDUpdate.dmg
hdiutil attach -nobrowse -noverify /Volumes/RecoveryHDUpdate/RecoveryHDUpdate.pkg/RecoveryHDMeta.dmg
/tmp/RecoveryHDUpdate/RecoveryHDUpdate.pkg/Scripts/Tools/dmtest ensureRecoveryPartition / /Volumes/Recovery\ HD\ Update/BaseSystem.dmg 0 0 /Volumes/Recovery\ HD\ Update/BaseSystem.chunklist
hdiutil eject /Volumes/Recovery\ HD\ Update
hdiutil eject /Volumes/RecoveryHDUpdate
You can’t perform that action at this time.