Skip to content

Instantly share code, notes, and snippets.

View ryanmaclean's full-sized avatar
🍩
Running tf apply 💜

Ryan MacLean ryanmaclean

🍩
Running tf apply 💜
View GitHub Profile
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
@ryanmaclean
ryanmaclean / yosemite_wallpaper.sh
Last active May 23, 2018 04:13
Change Yosemite Wallpaper from Command Line
# This script changes the Apple Mac OSX wallpaper in 10.10 for the current user
# to Earth Horizon - feel free to set a different JPEG or download, then set it!
# Cribbed from this answer: http://stackoverflow.com/a/2119076
#
osascript -e 'tell application "Finder" to set desktop picture to POSIX file "/Library/Desktop Pictures/Earth Horizon.jpg"'
@ryanmaclean
ryanmaclean / accept_xcode_license.sh
Last active November 22, 2023 18:26
Accept Xcode License on the Command Line
# Run using "sudo accept_xcode_license.sh"
#
# Solving the OSX Yosemite Xcode Command Line Tools Licensing problem
# for multiple updates in order to script post-install tasks.
# Typical error reads after running "xcode-select --install" when setting up
# Homebrew is: "Agreeing to the Xcode/iOS license requires admin priviledges,
# please re-run as root via sudo"
#
# CREDIT:
# Based on a tip found at http://krypted.com/mac-os-x/licensing-the-xcode-command-line-tools/
@ryanmaclean
ryanmaclean / install_xcode.sh
Last active May 6, 2016 09:19
Install Xcode Entirely from Command Line in Apple OSX Yosemite (10.10)
# Using tccutil.py to help us here, instead of making plist files
# https://github.com/jacobsalmela/tccutil
curl -o tccutil.py https://raw.githubusercontent.com/jacobsalmela/tccutil/master/tccutil.py
chmod +x tccutil.py
sudo ./tccutil.py -i /usr/bin/osascript
sudo ./tccutil.py -e /usr/bin/osascript
sudo ./tccutil.py -i /System/Library/CoreServices/System\ Events.app
sudo ./tccutil.py -e /System/Library/CoreServices/System\ Events.app
sudo ./tccutil.py -i /Applications/Utilities/Terminal.app
sudo ./tccutil.py -e /Applications/Utilities/Terminal.app
@ryanmaclean
ryanmaclean / flush_dns_yosemite.sh
Created October 27, 2014 20:13
Flush DNS Cache in Yosemite
## This will flsuh your DNS cache, note that some browsers maintain their own cache
dscacheutil -flushcache
@ryanmaclean
ryanmaclean / install_alfresco.sh
Last active August 29, 2015 14:08
Alfresco One 4.2.3.1 One-Line Installer
#############################################################################################
# This opinionated oneline installer assumes that you want internal PostgreSQL, #
# Google Docs integration, LibreOffice, Solr, Java, Sharepoint and Tomcat to be installed. #
# Note that the password is stored in the $PASSWORD variable - you can set this #
# in the one-liner or outside of this code. #
# Documented here: http://docs.alfresco.com/4.2/concepts/silent-alf-install.html #
# Further: http://blyx.com/2014/02/20/alfresco-tip-unattended-installation-with-one-command #
#############################################################################################
alfresco-enterprise-4.2.3.1-installer-linux-x64.bin --prefix /opt/alfresco \
@ryanmaclean
ryanmaclean / ssh_aws.sh
Created October 29, 2014 23:07
SSH to Non-Standard Port on EC2 Local-Only Load Balancer at AWS with Key from Google Drive
# Replace SECRETKEY.pem with your key, 2020 with the port, loadbalancername with
# the name of your load balancer.
ssh -i ~/Google\ Drive/SECRETKEY.pem -p 2020 ec2-user@loadbalancername
@ryanmaclean
ryanmaclean / alfresco_startup_script_modified.sh
Last active August 29, 2015 14:08 — forked from billerby/alfresco
Run Alfresco Start Up Script as a User Other Than Root
#!/bin/sh
#
# chkconfig: 2345 80 30
# description: Alfresco Enterprise
#
# Username YOURUSER used in this case. Replace with one defined locally
# e.g.: with Chef or Puppet.
$YOURUSER = YOURUSER
RETVAL=0
@ryanmaclean
ryanmaclean / remove_win8_hiberfil
Last active August 29, 2015 14:16
Remove Windows 8.1 Hibernation File
If you're like me and rarely use sleep or hibernation on your desktop and have some systems with small root SSDs,
this will probably come in handy. Windows 8.1 has changed a few things around so that getting an admin command
prompt is slightly different than Windows 7, but that's easily sorted.
To remove the pesky hiberfil.sys:
- Press Win
- Type :cmd"
- Confirm with shift+ctl+enter
- Type powercfg -h off
- hit enter