Skip to content

Instantly share code, notes, and snippets.

@AtsushiA
AtsushiA / setup WP-CLI on XSERVER
Last active July 2, 2023 05:58
setup WP-CLI on XSERVER
#/bin/bash
cd ~
mkdir bin && cd bin
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
cd ~
echo '' >> ~/.bashrc
tap "akeru-inc/tap"
tap "homebrew/bundle"
tap "hudochenkov/sshpass"
tap "pulumi/tap"
tap "rhysd/hgrep", "https://github.com/rhysd/hgrep"
tap "teamookla/speedtest"
brew "openssl@3"
brew "ansible"
brew "awscli"
brew "cask"
@AtsushiA
AtsushiA / backlog-deploy.php
Last active August 27, 2020 01:19 — forked from hissy/backlog-deploy.php
Git Webhookを使ったCPIへのデプロイスクリプト
<?php
// CPIユーザーID(契約情報で確認してください)
$user_id = 'abc123defg';
// リポジトリ名(Backlogで確認してください)
$repo_name = 'repository_name';
// Gitレポジトリの位置の指定
$git_dir = '/usr/home/' . $user_id . '/' . $repo_name . '.git';
// 展開先ディレクトリの指定
$work_tree = '/usr/home/' . $user_id . '/html';
// logファイルの指定
#! /bin/bash
#set -ex
SOURCE_FILE=$1
FILE_NAME=`basename $1`
DISTNATION_FILE=`dirname $1`/${FILE_NAME%.*}_o.pdf
LANG=C
LC_ALL=C
## Check Value
@AtsushiA
AtsushiA / make_lamp-PHP71_on_ec2
Created February 12, 2017 15:42
LAMP on AWS (PHP7.1)
#!/bin/bash
#set -ex
## Set sqlpassword
MYSQL_PASSSWORD="$(curl http://169.254.169.254/latest/meta-data/instance-id)"
## Set Timezon
ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
sed -i -e "s/ZONE=.*$/ZONE=\"Asia\/Tokyo\"/" /etc/sysconfig/clock
sed -i -e "s/UTC=.*$/UTC=false/" /etc/sysconfig/clock
@AtsushiA
AtsushiA / gist:761e94cdf530bce068d508c2dccda06f
Created September 19, 2016 16:49
WordPress Detect if SSL is used. This is required since we are terminating SSL either on CloudFront or on ELB
/** FIX Redirect loop (add wp-config.php)
Detect if SSL is used. This is required since we are terminating SSL either on CloudFront or on ELB
**/
if (($_SERVER['HTTP_CLOUDFRONT_FORWARDED_PROTO'] == 'https') OR ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'))
{$_SERVER['HTTPS']='on';}
cat {LogFileName} | grep Googlebot | cut -f5 | awk '!colname[$1]++{print $1}'
@AtsushiA
AtsushiA / init.sh
Created June 29, 2016 02:42 — forked from shimakyohsuke/init.sh
Wocker でコンテナ立ち上げ後に実効するやつ
#!/bin/bash
shopt -s expand_aliases
source ~/.bash_profile
## 日本語化
wocker wp core language install ja
wocker wp core language activate ja
## いろいろなプラグインをインストール
echo "いろいろなプラグインをインストールしますか? [Y/N]"
@AtsushiA
AtsushiA / init.sh
Last active January 31, 2017 07:09
wocker-init-ja
#!/bin/bash
wocker wp core language install ja --activate
wocker wp core update-db
wocker wp option update timezone_string 'Asia/Tokyo'
wocker wp option update date_format 'Y年n月j日'
wocker wp option update time_format 'H:i'
wocker wp plugin update-all
# -*- mode: ruby -*-
# # vi: set ft=ruby :
require 'fileutils'
Vagrant.require_version ">= 1.6.0"
# Defaults for config options
$update_channel = "stable"
$vb_gui = false