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
Host ssh_proxy | |
HostName ssh_proxy.example.net | |
Port 22 | |
User hoge | |
IdentityFile ~/.ssh/id_rsa | |
Host target | |
HostName target.example.net | |
Port 22 | |
User fuga |
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
#!/usr/bin/php | |
<?php | |
switch($argc) { | |
case 1: | |
case 2: | |
echo "please input new site url and wp directory name!\n"; | |
exit(); | |
default: | |
$old_site = isset($argv[3]) ? $argv[3] : ''; | |
$path = $argv[2]; |
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
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>?ver=<?php echo date('YmdHis', filemtime(get_stylesheet_directory() . '/style.css')); ?>" /> |
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_enqueue_script( | |
'example_js', | |
get_stylesheet_directory_uri() . '/js/example.js' , | |
array() , | |
date('YmdHis', filemtime(get_stylesheet_directory() . '/js/example.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
server { | |
listen 80 default; | |
server_name _; | |
root /path/to/wordpress; | |
index index.html index.htm; | |
charset utf-8; | |
access_log /var/log/nginx/access.log main; | |
error_log /var/log/nginx/error.log; |
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
class relative_URI { | |
private $top_url; | |
public function __construct() { | |
add_action('get_header', array(&$this, 'get_header'), 1); | |
add_action('wp_footer', array(&$this, 'wp_footer'), 99999); | |
$home_url = trailingslashit(get_home_url('/')); | |
$this->top_url = preg_replace( '/^(https?:\/\/.+?)\/(.*)$/', '$1', $home_url ); | |
} | |
protected function replace_relative_URI($content) { | |
$pattern = '#(<[^>]+)(' . $this->top_url . ')#i'; |
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 { | |
listen 80; | |
server_name example.com *.example.com; | |
root /var/www/vhosts/example.com; | |
index index.html index.htm; | |
charset utf-8; | |
access_log /var/log/nginx/example.com.access.log main; | |
error_log /var/log/nginx/example.com.error.log; |
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 { | |
listen unix:/var/run/nginx-backend.sock; | |
server_name example.com *.example.com; | |
root /var/www/vhosts/example.com; | |
index index.php index.html index.htm; | |
access_log /var/log/nginx/example.com.backend.access.log backend; | |
keepalive_timeout 25; | |
port_in_redirect off; |
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/sh | |
INSTANCEID=`/usr/bin/curl -s http://169.254.169.254/latest/meta-data/instance-id` | |
PUBLICNAME=`/usr/bin/curl -s http://169.254.169.254/latest/meta-data/public-hostname` | |
AZ=`/usr/bin/curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone/` | |
if [ "$AZ" = "eu-west-1a" -o "$AZ" = "eu-west-1b" -o "$AZ" = "eu-west-1c" ]; then | |
REGION=eu-west-1 | |
TZ=WET | |
elif [ "$AZ" = "sa-east-1a" -o "$AZ" = "sa-east-1b" ]; then | |
REGION=sa-east-1 |
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/sh | |
yum install -y git | |
cd /tmp/ | |
/usr/bin/git clone git://github.com/megumiteam/amimoto.git | |
if [ -f /tmp/amimoto/initial ]; then | |
cd /tmp/amimoto | |
/bin/sh /tmp/amimoto/initial | |
fi | |
/bin/rm -Rf /tmp/amimoto |