View AllowWPAdminRequestFromLoggedInUser.json
{ | |
"Name": "AdminRequestFromLoggedInUser", | |
"Priority": 8, | |
"Action": { | |
"Allow": {} | |
}, | |
"VisibilityConfig": { | |
"SampledRequestsEnabled": true, | |
"CloudWatchMetricsEnabled": true, | |
"MetricName": "AdminRequestFromLoggedInUser" |
View Brewfile
cask_args appdir: "/Applications" | |
tap "homebrew/bundle" | |
tap "homebrew/cask" | |
tap "homebrew/cask-fonts" | |
tap "homebrew/core" | |
tap "argon/mas" | |
tap "rcmdnk/file" | |
brew "mas" |
View remote-site-parts.php
<?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
#!/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
#!/bin/bash | |
service nginx reload | |
service monit start | |
if [ -d /var/cache/myapp ]; then | |
rm -rf /var/cache/myapp | |
fi |
View update-distribution.sh
#!/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
curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r '.prefixes[] | select(.service=="CLOUDFRONT") |
View file0.txt
$ 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
$ sudo /opt/local/provision | |
$ nginx -v | |
nginx version: nginx/1.13.9 |
View http2_push.php
<?php | |
add_action('template_redirect', function(){ | |
if ( headers_sent() ) { | |
return; | |
} | |
do_action('wp_enqueue_scripts'); | |
foreach( array('style' => wp_styles(), 'script' => wp_scripts()) as $as => $wp_links ) { | |
$link = ''; |
NewerOlder