Skip to content

Instantly share code, notes, and snippets.

@tkuchiki
tkuchiki / check_https_domain.sh
Last active Aug 29, 2015
https を使っているかチェック
View check_https_domain.sh
#!/bin/bash
DOMAIN=$1
LIST=$2
TIMEOUT=${3:-5}
https() {
_DOMAIN="${1}"
_SUB_DOMAIN="${2}"
@tkuchiki
tkuchiki / _command.sh
Last active Aug 29, 2015
SSL証明書とキーのペアが妥当かを one liner で確認(bash限定)
View _command.sh
diff <(openssl rsa -in example.com.key.pem -modulus -noout) <(openssl x509 -in example.com.cer.pem -modulus -noout)
@tkuchiki
tkuchiki / command
Last active Aug 29, 2015
Redhat 系 OS で RAID
View command
# format /dev/sdb /dev/sdc disk
mdadm --create /dev/md0 --level=0 --raid-devices=2 /dev/sd[bc]1
# mdadm --detail --scan >> /etc/mdadm.conf
mkfs.ext4 /dev/md0
e2label /dev/md0 LABEL_NAME
# edit /etc/fstab
View gist:edb7094509b77d9000e4
# 実行ユーザのホームディレクトリ
ls ~
# 指定したユーザのホームディレクトリ
ls ~user
# 指定したユーザのホームディレクトリ(失敗)
USERNAME=USER ls ~$USERNAME
# 指定したユーザのホームディレクトリ(変数使用)
View gist:702e34c69831250acd6b
mknod -m 666 /dev/full c 1 7
chown root:root /dev/full
@tkuchiki
tkuchiki / get_current_shell.sh
Last active Aug 29, 2015
現在の Shell を Shellscript の中から判定する(Linux, BSD 両対応)
View get_current_shell.sh
_PID=$$; _PPID=$(ps -o ppid -p $_PID | tail -n 1); ps -p $_PPID
View gist:b2302df524b78c0f43bf
brew tap homebrew/binary
brew install packer
@tkuchiki
tkuchiki / etc_default_docker
Last active Aug 29, 2015
Docker files for Ubuntu
View etc_default_docker
# Docker Upstart and SysVinit configuration file
# Customize location of Docker binary (especially for development testing).
#DOCKER="/usr/local/bin/docker"
# Use DOCKER_OPTS to modify the daemon startup options.
#DOCKER_OPTS="-dns 8.8.8.8 -dns 8.8.4.4"
# If you need Docker to use an HTTP proxy, it can also be specified here.
#export http_proxy="http://127.0.0.1:3128/"
View gist:648bb941f8689f5b58a2

container id search by container name

$ docker ps -a | grep CONTAINER_NAME | cut -d ' ' -f 1
03b1407f8ba4

retrieve binding port

View gist:6e41831561038ae97c28
# svn delete recursive
find /path/to/dir -print0 | xargs -0 svn delete --force