This file contains hidden or 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
require 'rake' | |
require 'rspec/core/rake_task' | |
hosts = [ | |
{ | |
:name => 'proxy001.example.jp', | |
:roles => %w( base proxy ), | |
}, | |
{ | |
:name => 'proxy002.example.jp', |
This file contains hidden or 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/bash | |
set -eu | |
# macOS の Vagrant 用 nfsd 設定 | |
sudo -v | |
# nfsd を起動するには /etc/exports が必要 | |
touch_exports() { | |
local readonly target="/etc/exports" |
This file contains hidden or 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
def textile_to_markdown(textile) | |
d = [] | |
pre = false | |
table_header = false | |
text_line = false | |
textile.each_line do |s| | |
s.chomp! |
This file contains hidden or 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
# Markdown形式のファイルパスを取得し配列に格納する | |
mdpath=($(find ./ -name "*.md")) | |
# カウンタ | |
cnt=0 | |
# 配列でループ | |
for mdfile in ${mdpath[@]}; do | |
# 拡張子をhtmlに変換する | |
htfile=$(echo $mdfile | sed -e "s|\.md|.html|") |
This file contains hidden or 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
<?php | |
// https://code.i-harness.com/ja/q/264e62 | |
function formatBytes($size, $precision = 2) | |
{ | |
$base = log($size, 1024); | |
$suffixes = array('B', 'KB', 'MB', 'GB', 'TB'); | |
return round(pow(1024, $base - floor($base)), $precision) . ' ' . $suffixes[floor($base)]; | |
} |
This file contains hidden or 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/bash | |
# https://dev.classmethod.jp/cloud/aws/awslogs-amazonlinux2/ | |
# setting | |
LOGPREFIX="amazonlinux2-syslog" | |
RETENTIONDAYS="14" | |
LOGGROUP=(/var/log/messages /var/log/cloud-init.log /var/log/cron /var/log/secure /var/log/yum.log) | |
# install |