View Feed2Typetalk.js
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
'use strict'; | |
const lastUpdateFileName = './lastupdate.txt'; | |
const feedUrl = 'https://example.com/rss'; | |
const typetalkTopicNum = '__TYPETALK_TOPIC_NUMBER_HERE__'; | |
const typetalkToken = '__TYPETALK_TOKEN_HERE__' | |
const fs = require('fs'); | |
const FeedParser = require('feedparser'); | |
const https = require('https'); |
View AllowWPAdminRequestFromLoggedInUser.json
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
{ | |
"Name": "AdminRequestFromLoggedInUser", | |
"Priority": 8, | |
"Action": { | |
"Allow": {} | |
}, | |
"VisibilityConfig": { | |
"SampledRequestsEnabled": true, | |
"CloudWatchMetricsEnabled": true, | |
"MetricName": "AdminRequestFromLoggedInUser" |
View Brewfile
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
cask_args appdir: "/Applications" | |
tap "homebrew/bundle" | |
tap "homebrew/cask" | |
tap "homebrew/cask-versions" | |
tap "homebrew/cask-fonts" | |
tap "homebrew/core" | |
tap "argon/mas" | |
tap "rcmdnk/file" |
View remote-site-parts.php
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 | |
/** | |
* Adds Remote_Site_Parts widget. | |
*/ | |
add_action( 'widgets_init', function(){ | |
register_widget( 'Remote_Site_Parts' ); | |
}); | |
class Remote_Site_Parts extends WP_Widget { | |
private $options = [ | |
'title' => 'Title:', |
View doing-wp-cron.sh
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 | |
wp_root=${1:-/var/www/html} | |
wp="/usr/local/bin/wp --path=${wp_root}" | |
if [ ! -e ${wp_root} ]; then | |
echo "Not exists ${wp_root}" | |
exit 1 | |
fi | |
lock_file="/var/tmp/doing_wp-cron.$(basename $wp_root)" |
View after_install.sh
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 | |
service nginx reload | |
service monit start | |
if [ -d /var/cache/myapp ]; then | |
rm -rf /var/cache/myapp | |
fi |
View update-distribution.sh
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 | |
DIST_IDS=$(aws cloudfront list-distributions | jq -r '.DistributionList.Items[] | select(.IsIPV6Enabled == false) | .Id') | |
for DIST_ID in ${DIST_IDS}; do | |
ETAG=$(aws cloudfront get-distribution --id ${DIST_ID} | jq -r '.ETag') | |
CONFIG_JSON=$(mktemp) | |
jq -s '.[0] * .[1]' <(aws cloudfront get-distribution --id "${DIST_ID}" | jq '.Distribution.DistributionConfig') <(echo '{"IsIPV6Enabled": true}') > ${CONFIG_JSON} | |
aws cloudfront update-distribution --id ${DIST_ID} --distribution-config file://${CONFIG_JSON} --if-match ${ETAG} | |
rm -f ${CONFIG_JSON} | |
done |
View file0.txt
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
curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r '.prefixes[] | select(.service=="CLOUDFRONT") |
View file0.txt
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
$ wp package install git@github.com:wp-cli/profile-command.git | |
Installing package wp-cli/profile-command (dev-master) | |
Updating /home/ec2-user/.wp-cli/packages/composer.json to require the package... | |
Registering git@github.com:wp-cli/profile-command.git as a VCS repository... | |
Using Composer to install the package... | |
--- | |
Loading composer repositories with package information | |
Updating dependencies | |
Resolving dependencies through SAT | |
Dependency resolution completed in 0.212 seconds |
View file0.txt
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
$ sudo /opt/local/provision | |
$ nginx -v | |
nginx version: nginx/1.13.9 |
NewerOlder