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
APP_DEV=static.intermail.dev.$1.jp7.com.br | |
echo "Creating S3 development bucket " $APP_DEV"...\n" | |
aws s3api create-bucket --bucket $APP_DEV --region us-east-1 | |
echo "Setting Static Web Hosting...\n" | |
aws s3api put-bucket-website --bucket $APP_DEV --website-configuration file://website-config.json | |
echo "Bucket" $APP_DEV "created, visit AWS Console to create IAM user for said bucket.\n" | |
APP_QA=static.intermail.qa.$1.jp7.com.br |
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 | |
// php -f export-aws-s3-wordpress.php <host> <db> <user> <password> <url> <bucket> [ --dry-run] | |
array_shift($argv); | |
list($host, $db, $user, $pass, $url, $bucket, $dryrun) = $argv; | |
$cmd = 'wp search-replace "' . $url . '/wp-content/uploads" "' . $bucket . '/wp-content/uploads" --url=' . $url . ' --network ' . $dryrun; | |
echo $cmd . PHP_EOL; | |
echo shell_exec($cmd) . PHP_EOL; |
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
# sh nginx.sh <app name> | |
APP=$1 | |
if [[ $APP == "" ]]; then | |
echo "Please provide app name." | |
exit; | |
fi | |
NGINX_PATH=/usr/local/etc/nginx | |
cp $NGINX_PATH/sites-enabled/template.dev $NGINX_PATH/sites-enabled/$APP.dev | |
sed -i '' "s/app/$APP/g" $NGINX_PATH/sites-enabled/$APP.dev | |
echo "Config created for $APP" |
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
NGINX_PATH=/usr/local/etc/nginx | |
for f in ~/Sites/*; do | |
if [ -d $f ]; then # Is a directory | |
NGINX_CONF="$NGINX_PATH/sites-enabled/$(basename $f).dev" | |
echo $NGINX_CONF | |
cp $NGINX_PATH/template.dev $NGINX_CONF |
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
export TMPDIR=/tmp/ | |
cd /usr/local/lib | |
mkdir phantom | |
cd phantom | |
wget https://gist.githubusercontent.com/ultimagriever/72fcb3e4446460638d65aecd2fbee98c/raw/9d915c60921219900b60c64cf5379c54d63ca43c/restart.sh | |
wget https://gist.githubusercontent.com/ultimagriever/72fcb3e4446460638d65aecd2fbee98c/raw/9d915c60921219900b60c64cf5379c54d63ca43c/start.sh | |
wget https://gist.githubusercontent.com/ultimagriever/72fcb3e4446460638d65aecd2fbee98c/raw/9d915c60921219900b60c64cf5379c54d63ca43c/status.sh | |
wget https://gist.githubusercontent.com/ultimagriever/72fcb3e4446460638d65aecd2fbee98c/raw/9d915c60921219900b60c64cf5379c54d63ca43c/stop.sh | |
chmod +x *.sh | |
ln -s /usr/local/lib/phantom/restart.sh /usr/local/bin/phantom-restart |
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
# sh self-signed-certificate.sh [domain_name] | |
DOMAIN_NAME=$1 | |
openssl req -new -subj "/C=/ST=/O=/localityName=/commonName=$DOMAIN_NAME/organizationalUnitName=/emailAddress=/" \ | |
-addext "subjectAltName = DNS:www.$DOMAIN_NAME" \ | |
-newkey rsa:4096 | |
-keyout $DOMAIN_NAME.key -out $DOMAIN_NAME.csr | |
openssl x509 -req -days 365 -in $DOMAIN_NAME.csr -signkey $DOMAIN_NAME.key -out $DOMAIN_NAME.crt | |
openssl rsa -in $DOMAIN_NAME.key -out $DOMAIN_NAME.key |
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
/** | |
* Migrate MongoDB database to Firebase. | |
* Syntax: node migrate.js [-c || --collection=]<MongoDB Collection> [ [-h || --host=]<MongoDB URI>] | |
* If no args are provided, the MONGODB_URI | |
* env variable declared in the .env file | |
* will be used instead. | |
*/ | |
const env = require('dotenv'); | |
const firebase = require('firebase'); |
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
chmod +x countdown.sh | |
ln -s $HOME/countdown.sh /usr/local/bin/countdown |
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
ENV_FILE=$1 | |
while read -r line | |
do | |
IFS="=" read -ra keys <<< "$line" | |
travis env set ${keys[0]} ${keys[1]} --private --no-interactive | |
done < $ENV_FILE |
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 | |
define("GLOBAL_URL", "insert your wordpress master url here, e.g. master domain"); | |
// Export master blog without comments - handled by Facebook plugin | |
exec('wp export --url="' . GLOBAL_URL . '" --skip_comments --filename_format="{site}.{date}.xml"'); | |
$sites = shell_exec("wp site list --url=\"" . GLOBAL_URL . "\" --field=url"); | |
$sites = explode(PHP_EOL, $sites); | |
foreach ($sites as $site) { | |
$url = str_replace("http://", "", $site); |
OlderNewer