Environment per project/directory
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 | |
# split strings | |
GIT_BRANCH="origin/master" | |
remote=`echo $GIT_BRANCH | cut -d '/' -f 1` | |
branch=`echo $GIT_BRANCH | cut -d '/' -f 2` | |
# finding working directory of a process (where $$ is the PID, obtained through `pgrep` or other) | |
pwdx $$ | |
# or |
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 | |
# Create an admin user. | |
wp user create username user@example.com --role=administrator | |
# Reset user password. | |
wp user update user --user_pass=password --skip-email | |
# Create a database backup. | |
wp db export - | gzip -9 > db.sql.gz |
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 | |
WEBSITES_ROOT=/var/www | |
BACKUP_ROOT=/var/backups/websites | |
# Checks to see if arguments are provided | |
if [ $2 ] | |
then | |
BUCKET=$2 | |
else |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"s3:ListMultipartUploadParts" | |
], | |
"Resource": "arn:aws:s3:::*" | |
}, |
I hereby claim:
- I am yusufhm on github.
- I am yusufhm (https://keybase.io/yusufhm) on keybase.
- I have a public key ASApjd3pUzWFOGkOKWHV1Q34v6hxiWFba7sCKt1lBegO0wo
To claim this, I am signing this object:
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_put_contents('public://screenshot.jpg', $this->getSession()->getScreenshot()); | |
file_put_contents('public://' . drupal_basename($this->getSession()->getCurrentUrl()) . '.html', $this->getCurrentPageContent()); |
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
# PHPUnit testing. | |
# Set `BROWSERTEST_OUTPUT_DIRECTORY` so we get the browser output. | |
(export BROWSERTEST_OUTPUT_DIRECTORY=$(pwd)/docroot/sites/simpletest/browser_output; blt tests:phpunit:run -vvv) | |
# Behat testing. | |
(export BUILDKITE_BUILD_CHECKOUT_PATH=$(pwd); blt tests:behat:run --environment=ci --no-interaction --yes --ansi --define drush.alias='${drush.aliases.ci}') |
Type sudo visudo -f /etc/sudoers.d/30-brew
and enter the following content:
%admin ALL = (ALL) NOPASSWD: /usr/local/bin/brew