Skip to content

Instantly share code, notes, and snippets.

View christopheranderton's full-sized avatar

Christopher Anderton christopheranderton

View GitHub Profile
@jayhardee9
jayhardee9 / gist:bdc95af357714c046a87d5b03d72cf3a
Created November 1, 2016 13:33
Prompt for filename before saving screenshot (Macos Automator)
on run {input, parameters}
tell application "SystemUIServer"
set f to (choose file name default name (do shell script "date +'Screen_%Y%m%d_%H%M%S.png'"))'s POSIX path
do shell script "screencapture -ix " & f's quoted form
end tell
return input
end run
@sheagcraig
sheagcraig / README.md
Last active July 15, 2021 17:48
Uninstall Microsoft Lync

UninstallLync

According to Microsoft, Lync must be completely uninstalled, following the procedures documented at https://technet.microsoft.com/en-us/library/jj945448(v=office.14).aspx, at least for Calendar functionality to work correctly.

This repo contains a python script for removing all referenced Lync components for all normal users on a machine, i.e., with homes in /Users.

It is somewhat naive in that it assumes the users have not moved the Lync keychain items out of the Login keychain and into some other keychain. It handles the potential for multiple "[email protected]" certificates in the login keychain, however. This is all done by running the security command as a subprocess. Improvements could probably be made to do this all with the Security Framework and the PyObjC bridge, but this gets the job done.

Using UninstallLync in Your Environment

You will need to edit the pattern global APP_PW_PATTERN at the top of the uninstall_lync.py script to look for your environment's email domai

@idleberg
idleberg / atom-macos-context-menu.md
Last active April 27, 2022 00:37
“Open in Atom” in macOS context-menu

Open in Atom

  • Open Automator
  • Create a new Service
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
  • Set the script action to /usr/local/bin/atom -n "$@"
  • Set “Pass input” to as arguments
  • Save as Open in Atom
@peterkelm
peterkelm / uninstall_fusion.sh
Last active May 25, 2024 12:15
Script to completely uninstall VMWare Fusion, tested with Fusion 8 on OS X 10.11 El Capitan
#!/bin/bash
#
# Copyright (C) 2016 Peter Kelm
#
# uninstall script for VMWare Fusion, per VMware knowledge base
# https://kb.vmware.com/selfservice/search.do?cmd=displayKC&docType=kc&docTypeID=DT_KB_1_1&externalId=1017838
#
@sheagcraig
sheagcraig / uninstall_office2016.py
Created September 26, 2016 15:05
Silent Uninstall of Office 2016
#!/usr/bin/python
# Completely uninstall Office 2016, as per:
# https://support.office.com/en-us/article/Uninstall-Office-2016-for-Mac-eefa1199-5b58-43af-8a3d-b73dc1a8cae3
# and
# https://support.office.com/en-us/article/Troubleshoot-Office-2016-for-Mac-issues-by-completely-uninstalling-before-you-reinstall-ec3aa66e-6a76-451f-9d35-cba2e14e94c0?ui=en-US&rs=en-US&ad=US
import glob
import os
defaults write com.google.Chrome AppleLanguages '(en-US)'
defaults write com.google.Chrome.canary AppleLanguages '(en-US)'
defaults read com.google.Chrome
defaults read com.google.Chrome.canary
@caro3801
caro3801 / convert_image_to_eps.workflow
Last active September 9, 2016 12:10
OS X Automator shell script to convert image to eps (LaTeX FTW)
#convert tool to download http://www.imagemagick.org/script/convert.php
#Step 1 : In automator > New folder action : select the folder to watch
#Step 2 (only for testing) : Add "Get elements from the folder indicated" -> select few images from different origins
#Step 3 : Add a shell script with the following code
for f in "$@"
do
filename=$(basename "$f")
base="${filename%.*}"
newbase="${base//[^A-Za-z0-9_-]}"
@artdevjs
artdevjs / brew-cask-update.sh
Last active June 21, 2017 14:19
brew-cask-update.sh
#!/bin/bash
################################################################################
# Does a mass upgrade of your Homebrew apps and allows you to interactively
# select which Cask apps to upgrade.
#
# Author: Derrek Young, derrekyoung.com
# Requirements:
# Homebrew http://brew.sh/
# Cask https://caskroom.github.io/
@omgmog
omgmog / audio-processing.sh
Last active February 20, 2019 18:41
Audio processing bash functions for OSX
# Convert mp3 files to wav
# Usage: for file in *.mp3; do mp3towav $file; done
mp3towav() {
afconvert -f WAVE -d LEI16@44100 "$1"
}
# Trim silence from start/end of files
# Usage: for file in *.wav; do trimsilence $file; done
trimsilence() {
mkdir -p trimmed
@azazlife
azazlife / .bashrc
Last active July 30, 2017 08:14
macOS 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