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 | |
# for development, you can go bare-metal with this URL: | |
# no payment processor ID necessary: | |
# THE_URL=http://awesome.org/sites/all/modules/civicrm/extern/authorizeIPN.php | |
# Confirm the URL to use in the Authorize.net Silent-Post URL: | |
# last URL segment is the payment processor ID | |
THE_URL="https://awesome.org/civicrm/payment/ipn/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
#!/bin/sh | |
DOMAINS="www.facebook.com twitter.com www.instagram.com" | |
UNTIL=90 #minutes | |
for d in $DOMAINS | |
do | |
sudo iptables -I OUTPUT -d $d -j DROP | |
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
#!/usr/bin/env bash | |
DIR_DEFAULTS="./tmp.default" | |
DIR_MODIFIEDS="./tmp.modified" | |
test -d "$DIR_DEFAULTS" && echo "ERROR: $DIR_DEFAULTS would be deleted" && exit 1 | |
mkdir "$DIR_DEFAULTS" | |
test -d "$DIR_MODIFIEDS" && echo "ERROR: $DIR_DEFAULTS would be deleted" && exit 1 | |
mkdir "$DIR_MODIFIEDS" |
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
#!/usr/bin/env bash | |
# This is a gist | |
# https://gist.github.com/ginkgomzd/050d1452709d5a7cddbd802e0c8087a3 | |
run-every() { | |
boldtxt=$(tput bold) | |
normaltxt=$(tput sgr0) |
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
#!/usr/bin/env bash | |
# generate a strong password without shell special characters | |
# defaults to 32 characters, overridden to a number passed as first arg | |
# uses xclip to copy to clipboard | |
# uses zenity to alert to desktop (from gnome-run-prompt) | |
gen_pass_length=32 | |
if [ $# -eq 1 ]; then | |
gen_pass_length="$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
# | |
# Invoke from cordova project root | |
# Locates the apk, detects the package name, uninstalls it before installing. | |
# Starts the app using `adb shell am...` | |
# | |
adbinst() { | |
apk=`find . -name android-debug.apk` | |
platforms=`find . -maxdepth 1 -type d -name platforms` | |
if [ "$platforms" != './platforms' ] ; then echo "NOT IN PROJECT DIR"; return; 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
DROP PROCEDURE IF EXISTS `sp_add_column_if_not_exists`; | |
DELIMITER !! | |
CREATE PROCEDURE sp_add_column_if_not_exists ( | |
IN table_name nvarchar(128), | |
IN column_name nvarchar(128), | |
IN column_definition varchar(256) | |
) |
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 | |
// example call, specifying bit-flags, | |
// returns as string: | |
echo listEnabledErrorReportingFlags(E_ALL & ~(E_WARNING|E_NOTICE|E_STRICT)); | |
// example call, using current bit-flags, | |
// returns as array: | |
var_export(listEnabledErrorReportingFlags(null, TRUE)); |
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
#! /usr/bin/env bash | |
__print_completions() { | |
printf '%s\n' "${COMPREPLY[@]}" | |
} | |
# load bash-completion functions | |
source /etc/bash_completion | |
_ansible_wrapper() { |