This file contains hidden or 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 [email protected]: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 [email protected]: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 |
This file contains hidden or 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 |
This file contains hidden or 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 | |
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 = ''; |
This file contains hidden or 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
esource "aws_iam_role" "run_inspector_role" { | |
name = "cloudwatch-events-run-inspector-role" | |
assume_role_policy = <<POLICY | |
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Principal": { | |
"Service": "events.amazonaws.com" |
This file contains hidden or 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 | |
add_filter( 'wp_is_mobile', function( $is_mobile ) { | |
// CloudFront でスマートフォンと判定された場合、true を返す。 | |
if ( isset($_SERVER['HTTP_CLOUDFRONT_IS_MOBILE_VIEWER']) && "true" === $_SERVER['HTTP_CLOUDFRONT_IS_MOBILE_VIEWER'] ) { | |
$is_mobile = true; | |
} | |
// CloudFront でタブレットと判定された場合、true を返す。 | |
// (タブレットはPCと同じ扱いにしたい場合は、$is_mobile を false にする | |
if ( isset($_SERVER['HTTP_CLOUDFRONT_IS_TABLET_VIEWER']) && "true" === $_SERVER['HTTP_CLOUDFRONT_IS_TABLET_VIEWER'] ) { |
This file contains hidden or 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 | |
// CloudFront で Cookie key wordpress_last_visit をオリジンに渡すようにしておくこと | |
add_action( 'plugins_loaded', function(){ | |
if ( is_user_logged_in() ) { | |
setcookie( 'wordpress_last_visit', time() ); | |
} | |
}); |
This file contains hidden or 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 | |
wp_cache_delete ( 'alloptions', 'options' ); | |
?> |
This file contains hidden or 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 | |
LF=$(printf '\\\012_') | |
LF=${LF%_} | |
TAB=$'\t' | |
_ssl_keys=$(find /etc/nginx/conf.d/ -type f -name '*.conf' | xargs grep ssl_certificate | grep -v ssl_certificate_key | sed 's/[#:;]//g' | sort | uniq | awk '{print $1,$3}') | |
IFS=$LF | |
for _ssl_key in ${_ssl_keys}; do | |
_conf_file=$(echo ${_ssl_key} | awk '{print $1}') | |
_cert_key=$(echo ${_ssl_key} | awk '{print $2}') |
This file contains hidden or 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
$ npm install stripe |
This file contains hidden or 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 chown -R $(whoami):admin /usr/local | |
$ brew update | |
$ sudo chown root:wheel /usr/local |