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 | |
ETAG='' | |
if [ -f /tmp/etag ]; then | |
ETAG=$(cat /tmp/etag) | |
fi | |
head=true | |
while IFS= read -r line; do |
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 | |
class MyAuthenticator extends MemberAuthenticator { | |
/** | |
* Attempt to find and authenticate member if possible from the given data | |
* | |
* @param array $data | |
* @param Form $form | |
* @param bool &$success Success flag |
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
class Page_Controller extends ContentController { | |
/** | |
* An array of actions that can be accessed via a request. Each array element should be an action name, and the | |
* permissions or conditions required to allow the user to access it. | |
* | |
* <code> | |
* array ( | |
* 'action', // anyone can access this action | |
* 'action' => true, // same as above |
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 | |
function log { | |
[ ${VERBOSE} ] && echo "$@" >&2 | |
} | |
VERBOSE=1 | |
if [ -n "$1" ]; then | |
CURRENT_BRANCH="$1" | |
else | |
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) |
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 | |
IP=$(curl -s -L https://checkip.amazonaws.com/) | |
OLDIP=$(cat /tmp/ip) | |
DOMAIN_REGEX="\s+example\.com" | |
DOMAIN="sub.example.com" | |
if [ "${IP}" != "${OLDIP}" ]; then | |
echo "IP changed from ${OLDIP} to ${IP}" | |
echo "`date -u +%F-%T` IP changed from ${OLDIP} to ${IP}" >> /tmp/iplog |
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
[user] | |
name = <name> | |
email = <email> | |
signingkey = <GPG key> | |
[alias] | |
br = checkout -b | |
ch = cherry-pick | |
ci = commit | |
cim = commit --amend --no-edit | |
co = checkout |
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 | |
BU=true | |
CO=true | |
BUILD=true | |
TARGET='master' | |
DB_USER='' | |
DB_PASS='' | |
DB_HOST='' | |
DB_NAME='' |
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 | |
echo "==== STARTING PARSER ====" | |
date +'%F %T' | |
touch /tmp/seen | |
CURRENT_TIME=$(date +%s) | |
# assuming we run every 15 mins (900 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
#!/usr/bin/env bash | |
SWAP_SIZE=1 | |
if [[ $1 =~ ^-?[0-9]+$ ]]; then | |
SWAP_SIZE="$1" | |
fi | |
dd if=/dev/zero of=/swapfile count="$((${SWAP_SIZE} * 1024))" bs=1MiB | |
chmod 600 /swapfile |
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 | |
### INSTALL STATE VARS ### | |
INSTALL_CURL=true | |
INSTALL_PIP=true | |
INSTALL_PYTHON=true | |
INSTALL_AWS=true | |
INSTALL_TX=true | |
INSTALL_PHP=true | |
INSTALL_COMPOSER=true |