This file contains 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 |
This file contains 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 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 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 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
<snippet> | |
<content><![CDATA[ | |
# Dropzone Action Info | |
# Name: ${1:Name} | |
# Description: ${2:Description} | |
# Handles: ${3:Files, Text} | |
# Creator: ${4:Creator Name} | |
# URL: ${5:Creator URL} | |
# OptionsNIB: ${6:Login, ExtendedLogin, APIKey, UsernameAPIKey, ChooseFolder, ChooseApplication, GoogleAuth} | |
# LoginTitle: ${7:Login Title (For Login NIB)} |
This file contains 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 | |
# usage: git-sync-upstream "/your/git/folder/" [rebase/merge] | |
action="merge" | |
if [ $# -ge 1 ]; then cd "$1"; fi | |
if [ $# -eq 2 ]; then if [ "$2" = "rebase" ]; then action="rebase"; fi; fi | |
clear; |
This file contains 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 | |
servername=$(echo "$@" |sed 's/ /-/g') | |
if [ "$servername" == "" ]; then | |
echo "Please specify a server name like: myserver.com" | |
exit | |
fi | |
if [ -f "$servername.key" ] || [ -f "$servername.crt" ]; then |
This file contains 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
# Check until host is UP | |
checkisup () { while (true) do if ping -t 2 -c 1 $1 &>/dev/null; then echo -e " $(date +%T) \\033[1;36m Host $1 is up! \\033[0m\n $(ping -c 1 $1 | head -n2 | tail -n1)"; return 0; else echo -e " $(date +%T) \\033[31m Host $1 is down...\\033[0m"; sleep 1; fi; done; } |
This file contains 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
# Split and export a QuickTime Movie | |
# Create a folder "exports" on the desktop | |
# Open one movie file in QuickTime | |
# Configure where you want to cut the video, if you want first and last part and the QuickTime window name (after modification) | |
# Launch this script and wait | |
#------------- BEGIN OF CONFIGURATION -------- | |
-- Middle Mark : Set where you want to cut the video (in seconds) |
This file contains 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
github-open-url='git remote -v | grep fetch | grep -oE '\''https://github.com/\S+'\'' | xargs -I{} open {}' |
OlderNewer