Skip to content

Instantly share code, notes, and snippets.

@tkuchiki
tkuchiki / check_https_domain.sh
Last active August 29, 2015 13:59
https を使っているかチェック
#!/bin/bash
DOMAIN=$1
LIST=$2
TIMEOUT=${3:-5}
https() {
_DOMAIN="${1}"
_SUB_DOMAIN="${2}"
@tkuchiki
tkuchiki / _command.sh
Last active August 29, 2015 13:59
SSL証明書とキーのペアが妥当かを one liner で確認(bash限定)
diff <(openssl rsa -in example.com.key.pem -modulus -noout) <(openssl x509 -in example.com.cer.pem -modulus -noout)
@tkuchiki
tkuchiki / command
Last active August 29, 2015 14:00
Redhat 系 OS で RAID
# 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
# 実行ユーザのホームディレクトリ
ls ~
# 指定したユーザのホームディレクトリ
ls ~user
# 指定したユーザのホームディレクトリ(失敗)
USERNAME=USER ls ~$USERNAME
# 指定したユーザのホームディレクトリ(変数使用)
mknod -m 666 /dev/full c 1 7
chown root:root /dev/full
@tkuchiki
tkuchiki / get_current_shell.sh
Last active August 29, 2015 14:01
現在の Shell を Shellscript の中から判定する(Linux, BSD 両対応)
_PID=$$; _PPID=$(ps -o ppid -p $_PID | tail -n 1); ps -p $_PPID
@tkuchiki
tkuchiki / gist:b2302df524b78c0f43bf
Created May 12, 2014 12:16
install packer for mac
brew tap homebrew/binary
brew install packer
@tkuchiki
tkuchiki / etc_default_docker
Last active August 29, 2015 14:01
Docker files for Ubuntu
# 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/"

container id search by container name

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

retrieve binding port

# svn delete recursive
find /path/to/dir -print0 | xargs -0 svn delete --force