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
set isCrashPlanRunning to false | |
try | |
set pid to do shell script ¬ | |
"sudo launchctl list | grep com.crashplan.engine" user name "username" password ¬ | |
"password" with administrator privileges | |
set isCrashPlanRunning to true | |
end try | |
if isCrashPlanRunning then | |
log "CrashPlan is already running: " & pid |
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
DELETE FROM node_revisions WHERE vid IN ( | |
SELECT subquery.vid FROM ( | |
SELECT @row_num := IF(@prev_value=nr.nid,@row_num+1,1) AS RowNumber | |
,nr.nid | |
,nr.vid | |
,nr.timestamp | |
,@prev_value := nr.nid | |
FROM node_revisions nr, | |
(SELECT @row_num := 1) x, | |
(SELECT @prev_value := '') y |
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 | |
# Check for the existance of drush on the system | |
if [[ ! -x /bin/drush || ! -x /usr/bin/drush ]]; then | |
echo "This script requires drush!" | |
echo | |
exit 3 | |
fi | |
if [[ -z ${1} ]]; 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
<?php | |
/** | |
* @file | |
* Rebuild the node access database with no php time limits. | |
*/ | |
/** | |
* Rebuilds the node access database (for use with drush php-script). | |
* |
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
# This would go into .bash_profile, .bashrc, .zshrc, etc. | |
# Script to start the gpg-agent - in it's own file as it is also used when the machine starts up | |
# Be sure to update the path to wherever you place this file! | |
# Note, depending on shell you may not need this line enabling, if the global daemon is already running | |
# OK. Some shells complain, others don't! | |
~/bin/startup-gpg-agent.sh | |
# GPG | |
if [ -f "${HOME}/.gpg-agent-info" ]; 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/sh | |
# Best To-Do List. Ever. | |
# | |
# Usage: | |
# 1. Add a new item to list: `todo This needs to be fixed` | |
# 2. Edit the to-do list: `todo -e` | |
# 3. Show the current to-do's: `todo` | |
if [[ $1 ]]; then | |
if [ $1 = "-e" ]; 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 | |
# pull all git repositories in a directory | |
pull_repo() { | |
echo "pulling $1 ..." | |
if git pull; then # >/dev/null 2>&1 | |
echo -e "pulling $1 succeed\n" | |
else | |
echo -e "pulling $1 failed\n" |
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 | |
SCRIPT=$(basename "$0") | |
exitWithError () { | |
echo -e "$1" 1>&2 | |
exit 1 | |
} | |
usage () { |
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
osascript <<EOT | |
display dialog "MD5: | |
$(openssl md5 $1 | awk '{print $2}') | |
SHA1: | |
$(openssl sha1 $1 | awk '{print $2}') | |
SHA256: | |
$(openssl dgst -sha256 $1 | awk '{print $2}')" with title "$(basename $1)" with icon Caution | |
EOT |
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 | |
# Run this script with: | |
# bash <(curl -s https://gist.github.com/garlandkr/e80674b49270b0199fa6/raw/ami-clean.sh | |
function print_green { | |
echo -e "\e[32m${1}\e[0m" | |
} | |
print_green 'Clean Yum' |
OlderNewer