Skip to content

Instantly share code, notes, and snippets.

tkuchiki / gist:9347861
Created Mar 4, 2014
Vagrant で Centos6.5 を立てて Docker を install
View gist:9347861
# Mac
vagrant init opscode-centos65
vagrant up
vagrant ssh
# CentOS 6.5
sudo rpm -Uvh
yum -y install docker-io
View gist:9388153
# ローカルファイルを圧縮したものを、リモートサーバに直接送る
tar -cz /path/to/{dir,file} | ssh your_server "cat /path/to/file.tar.gz"
# ローカルのシェルスクリプトをリモートサーバで実行
cat << EOF | ssh REMOTE_HOST "bash"
tkuchiki /
Last active Aug 29, 2015
linux のリモートサーバにユーザを作成する
View gist:9458536
getent passwd | awk -F':' '{ print $1}' | grep -w USERNAME
View gist:9543025
# rpm をダウンロードするだけ
yum install --downloadonly --downloaddir=/path/to/dir
# 依存関係を考慮して削除
yum install yum-plugin-remove-with-leaves
yum remove --remove-leaves PACKAGE
tkuchiki / gist:9971439
Last active Aug 29, 2015
ssh 多段ポートフォワーディング
View gist:9971439
# sshを実行するマシンの localhost:5900 -> remote1:5900, remote1 の localhost:5900 -> remote2:5900
## -f をつければバックグラウンドで実行
ssh -t -L 5900:localhost:5900 user@remote1 ssh -t -N -L 5900:localhost:5900 user@remote2
View gist:10014084
yum install -y kvm libvirt virt-install
tkuchiki / varnish-release.spec
Last active Aug 29, 2015
varnish-release 4.0 rpm
View varnish-release.spec
Name: varnish-release
Version: 4.0
Release: 1%{?dist}
Summary: Varnish 4.0 package repository configuration
Group: System Environment/Base
License: BSD
View gist:10447527
# 証明書アップロード
$ aws iam upload-server-certificate --server-certificate-name --certificate-body file:///path/to/ --private-key file:///path/to/ --certificate-chain file:///path/to/
SERVERCERTIFICATEMETADATA arn:aws:iam::123456789012:server-certificate/ / XXXXXXXXXXXXXXXXXXXXX 2014-04-11T07:43:32.214Z
# Listener 作成
$ aws elb create-load-balancer-listeners --load-balancer-name test-elb --listeners "Protocol=https,LoadBalancerPort=443,InstanceProtocol=http,InstancePort=80,SSLCertificateId=arn:aws:iam::123456789012:server-certificate/"
# Listener の証明書変更
tkuchiki / gist:10477692
Created Apr 11, 2014
install cpanm for CentOS 6
View gist:10477692
yum install -y perl-ExtUtils-MakeMaker perl-Module-Build perl-CPAN
curl -L | perl - App::cpanminus