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 search-replace \ | |
http://example.com/wp-content/uploads/ /wp-content/uploads/ \ | |
wp_posts \ | |
--include-columns=post_content |
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
/* postmeta のお掃除 */ | |
DELETE | |
FROM wp_postmeta | |
WHERE NOT EXISTS ( | |
SELECT 'x' | |
FROM wp_posts | |
WHERE wp_posts.ID = wp_postmeta.post_id | |
); | |
/* comment のお掃除 */ | |
DELETE |
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 | |
set -eux | |
# WordPress のインストールパス | |
wp_path='/path/to/wordpress' | |
# http ステータスコードを監視する記事ページのURL(削除されることのない記事のURLが良いです) | |
single_page_url='http://example.com/archives/1' | |
# http ステータスコードの取得 |
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 | |
# WordPress の Web ドキュメントルートディレクトリへのパス | |
wp_path='/path/to/wordpress' | |
# EC2 のインスタンス ID を取得 | |
instanceid=$(curl -s http://169.254.169.254/latest/meta-data/instance-id) | |
# region を取得 | |
az=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone) |
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
$ npm install s3 --save |
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 | |
/* | |
Plugin Name: Get ALL Links. | |
Plugin URI: | |
Description: | |
Version: 0.1 | |
Author: DigitalCube | |
Author URI: | |
License: GPLv2 or later | |
*/ |
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
server { | |
-- snip -- | |
location / { | |
-- snip -- | |
# ngx_mruby により text/ 内の http を https に置換 | |
mruby_output_body_filter /path/to/ssl_filter.rb cache; | |
} | |
} |
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
map $sent_http_content_type $expires { | |
default off; | |
~image/ max; | |
~audio/ max; | |
~video/ max; | |
text/css 30d; | |
text/javascript 30d; | |
application/javascript 30d; | |
application/pdf max; | |
} |
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
$ wget -S --spider https://lets.ninja/ | |
Spider mode enabled. Check if remote file exists. | |
--2016-06-20 20:02:13-- https://lets.ninja/ | |
Resolving lets.ninja... 54.92.34.103 | |
Connecting to lets.ninja|54.92.34.103|:443... connected. | |
HTTP request sent, awaiting response... | |
HTTP/1.1 200 OK | |
Server: nginx | |
Date: Mon, 20 Jun 2016 11:02:13 GMT | |
Content-Type: text/html; charset=UTF-8 |
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 | |
web_docmentroot='/var/www/html' | |
s3_region='us-east-1' | |
s3_bucket='lets.ninja' | |
if [ ! -e /usr/local/bin ]; then | |
mkdir -p /usr/local/bin | |
fi | |
yum -y install nginx golang fuse wget | |
wget https://github.com/kahing/goofys/releases/download/v0.0.6/goofys -P /usr/local/bin | |
chmod +x /usr/local/bin/goofys |