This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ ! -d "/DisabledExtensions/AMD6000Controller.kext" ]; then | |
sudo mkdir /DisabledExtensions 2>/dev/null | |
sudo mv /System/Library/Extensions/{AMD6000Controller.kext,AMDFramebuffer.kext,AMDRadeonX3000.kext,AMDRadeonX3000GLDriver.bundle,AMDSupport.kext} /DisabledExtensions/ | |
echo "Disable AMD Drivers Kext (Moved to /DisabledExtensions)" | |
else | |
sudo mv /DisabledExtensions/* /System/Library/Extensions/ | |
echo "AMD Drivers restored to System Extensions" | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
template_path="$1" | |
function usage (){ | |
echo -e "Usage: template <path to template> 'var1|content' 'var2|content'..."; | |
[[ -f "$template_path" ]] && { echo "Current variables:" $(cat $template_path |perl -ne '/#([A-Za-z1-9]+)#[^#].*/ && printf "%s, ", $1'); } | |
exit 1; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
T='gYw' | |
echo -e "\n 40m 41m 42m 43m 44m 45m 46m 47m"; | |
for FGs in ' m' ' 1m' ' 30m' '1;30m' ' 31m' '1;31m' ' 32m' '1;32m' ' 33m' '1;33m' ' 34m' '1;34m' ' 35m' '1;35m' ' 36m' '1;36m' ' 37m' '1;37m'; | |
do FG=${FGs// /} | |
echo -en " $FGs \033[$FG $T " | |
for BG in 40m 41m 42m 43m 44m 45m 46m 47m; | |
do echo -en "$EINS \033[$FG\033[$BG $T \033[0m\033[$BG \033[0m"; | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
appname="$1" | |
[ -z $appname ] && read -p "Application name : " appname | |
apppath=$(find ~/Library/Developer/CoreSimulator/Devices/ -name "$appname.app" -print -quit) | |
if [[ ! -z $apppath ]]; then | |
echo "Found path for $appname app" | |
echo -e "\033[1;30m$apppath\033[0m" | |
appbundle=$(osascript -e "id of app \"$apppath\"") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Some useful Shell aliases and function for using on Mac OS X | |
# https://gist.github.com/atika/4bca2820b21a71858a06 | |
# Regular Expressions | |
ipregx="[0-9]{2,3}\.[0-9]{2,3}\.[0-9]{2,3}\.[0-9]{2,3}" # IP Regular Expression | |
mailregx="[a-zA-Z0-9_-\.]+@[a-zA-Z0-9_-\.]+\.[a-z]{2,3}" # Mail Regular Expression | |
# ql : Show a "Quick Look" view of files | |
ql () { /usr/bin/qlmanage -p "$@" >& /dev/null & } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This is a general-purpose function to ask Yes/No questions in Bash, either | |
# with or without a default answer. It keeps repeating the question until it | |
# gets a valid answer. | |
# http://djm.me/ask | |
while true; do | |
if [ "${2:-}" = "Y" ]; then |
NewerOlder