Skip to content

Instantly share code, notes, and snippets.

# 不要なコンテナまとめて削除
docker rm `docker ps -a -q`
# 不要なイメージをまとめて削除
docker rmi $(docker images | awk '/^<none>/ { print $3 }')
@ymxmore
ymxmore / user-data
Created August 21, 2015 00:47
Disk attachment memo
# --------------------------------------------------------------------------------------------------------
# If you want to attach the storage can comment , Please specify the size of the storage
# --------------------------------------------------------------------------------------------------------
# - name: format-var-lib-docker.service
# command: start
# content: |
# [Unit]
# Before=docker.service var-lib-docker.mount
# ConditionPathExists=!/dev/sdb1
# [Service]
@ymxmore
ymxmore / Vagrantfile
Last active August 29, 2015 14:27
Disk attachment memo
# uuid重複エラーが出た時
# $ VBoxManage internalcommands sethduuid ./.tmp/disk.vdi
# VirtualBoxにてinaccessibleが出た時
# # UUID確認
# $ VBoxManage list vms
#
# # 登録解除
# $ VBoxManage unregistervm {uuid}
@ymxmore
ymxmore / .editorconfig
Created July 3, 2015 18:05
.editorconfig
# EditorConfig is awesome: http://EditorConfig.org
#root = true
[*]
indent_style = tab
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@ymxmore
ymxmore / git.config.sh
Created July 3, 2015 16:59
Git コミッターのメールアドレスなどを無条件で過去のものも全て変更 (要force push)
# 現在のブランチの設定を変更
git config --local user.name <name>
git config --local user.email <email>
# 過去のものを全てまとめて変更 (要force push)
git filter-branch -f \
--env-filter \
"GIT_AUTHOR_NAME='<name>'; GIT_AUTHOR_EMAIL='<email>'; GIT_COMMITTER_NAME='<name>'; GIT_COMMITTER_EMAIL='<email>';" \
HEAD
npm ls -gp | awk -F/ '/node_modules/ && !/node_modules.*node_modules/ {print $NF}' | xargs npm -g rm
@ymxmore
ymxmore / gist:1b3f32bc561e524bfc03
Last active August 29, 2015 14:05
Sublime Text よく使うショートカット一覧
Key Description
cmd + L 行選択
cmd + shift + L 選択を行単位にする
ctrl + shift + M カッコ内選択
opt + cmd + 2 windowを2分割
ctrl + W 選択文字列をHTMLタグで囲む
cmd + P Goto Anything[ : 行ジャンプ
@ymxmore
ymxmore / mac-terminal-shortcut-keys.md
Created January 9, 2014 00:15
Mac terminal shortcut keys.
Key Description
Ctrl-A 行の先頭へ移動
Ctrl-E 行の末尾へ移動
Ctrl-F 右へ移動
Ctrl-B 左へ移動
Ctrl-U カーソル位置から行頭までを削除
Ctrl-K カーソル位置から行末までを削除
Ctrl-H カーソル位置の前の文字を削除
Ctrl-D カーソル位置の次の文字を削除
@ymxmore
ymxmore / vagrant-chef.md
Last active September 7, 2019 22:57
Vagrant, Chef(solo), Knife(solo) コマンド・テンプレート集。

Vagrant, Chef(solo), Knife(solo) コマンド・テンプレート集

Vagrant

VirtualBoxとVagrantをインストール

  VirtualBox
    https://www.virtualbox.org/wiki/Downloads
@ymxmore
ymxmore / file-preview.js
Created August 18, 2013 05:07
FileオブジェクトからdataURIを取得
var view_file_content = function(data, callback) {
if (!window.FileReader || !data.files || !_.isArray(data.files) || data.files.length <= 0) {
return;
}
var file = data.files[0];
if(file.type.match(/image/)) {
var fr = new FileReader();