https://www.oreilly.co.jp/books/9784873116860/
📝 2014年の話であることに注意
https://www.oreilly.co.jp/books/9784873116860/
📝 2014年の話であることに注意
#!/bin/bash | |
# set profile | |
echo -ne "\033]1337;SetProfile=Remote\a" | |
# ssh login | |
/usr/bin/ssh "$@" | |
# set profile(default) | |
echo -ne "\033]1337;SetProfile=Default\a" |
#! /usr/bin/ruby | |
# frozen_string_literal: true | |
# USAGE: | |
# {RAILS_ROOT}/bin/rails r mongoid_not_allowed_fields_detector.rb | |
Rails.application.eager_load! | |
# mongoid v6.1.1 | |
# Mongoid.destructive_fields |
const airbrake = require('airbrake').createClient("your project ID", "your api key") | |
// errbit run on localhost | |
airbrake.protocol = 'http' | |
airbrake.serviceHost = 'localhost:3001' | |
// By default only the errors from the production environment will get reported | |
// If you put 'production' in airbrake.env, errors will reported | |
airbrake.env = 'production' | |
// routing | |
app.use('/', index) |
git branch -r --merged master | grep -v -e master -e release -e staging/ | sed -e 's% *origin/%%' | xargs -I% git push --delete origin % |
for key in `aws s3api list-objects --bucket {bucket_name} --output json | jq -r '.Contents[].Key'`; do echo $key; aws s3api restore-object --bucket {bucket_name} --key $key --restore-request '{"Days": 1}'; done | |
for key in `aws s3api list-objects --bucket {bucket_name} --output json | jq -r '.Contents[].Key'`; do echo "\n$key"; aws s3api head-object --bucket {bucket_name} --key $key --output json | jq -r .Restore; done | |
for key in `aws s3api list-objects --bucket {bucket_name} --prefix {path} --output json | jq -r '.Contents[].Key'`; do echo "\n$key"; aws s3 cp s3://{bucket_name}/$key ./; done |
require 'spec_helper' | |
describe package('nginx') do | |
it { should be_installed } | |
end | |
describe service('nginx') do | |
it { should be_enabled } | |
it { should be_running } | |
end |
# Nginx をインストール | |
package 'nginx' | |
# Nginx | |
service 'nginx' do | |
# サービスの有効化, 起動 | |
action [:enable, :start] | |
end | |
#!/bin/bash | |
merge_commit=$(ruby -e 'print (File.readlines(ARGV[0]) & File.readlines(ARGV[1])).last' <(git rev-list --ancestry-path $1..master) <(git rev-list --first-parent $1..master)) | |
if git show $merge_commit | grep -q 'pull request' | |
then | |
pull_request_number=$(git log -1 --format=%B $merge_commit | sed -e 's/^.*#\([0-9]*\).*$/\1/' | head -1) | |
url="`hub browse -u`/pull/${pull_request_number}" | |
echo $url | |
fi | |
open $url |
module ZunDoko | |
Z = 'ズン' | |
D = 'ドコ' | |
TARGET = [Z, Z, Z, Z, D] | |
def self.kiyoshi(arr=[]) | |
arr.shift if arr.size > 4 | |
arr << [Z, D].sample | |
return "#{arr.join("\s")} #{'キ・ヨ・シ!'}" if arr == TARGET |