とんたんの技術メモ

注)ただのメモです。

よく使う開発コマンド

## CSS

```

# 中央寄せ

## absolute

position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;

```

## docker-compose
docker system df // ディスクの使用状況確認 docker-compose up -d docker-compose build --no-cache docker-compose exec rails bash // 既に立ち上がっているコンテナに入る
docker-compose run rails bash // まだ起動していないコンテナに入る
docker-compose run rails bundle exec rake db:migrate:reset // コマンド実行
docker-compose logs -f --tail=500
docker-compose down --rmi all // コンテナ・ネットワーク・イメージ削除
docker-compose restart [service_name] // 対象サービス再起動
docker images -aq | xargs docker rmi // イメージ全削除
docker inspect $(docker-compose ps -q rails) // コンテナ情報を確認
docker stop $(docker ps -a -q) // すべて停止
docker system prune -a --volumes // 不要なコンテナ&ネットワーク&イメージ&ボリューム一括削除
docker rm -f $(docker ps -aq) && docker rmi -f $(docker images -q) && docker volume rm -f $(docker volume ls -q) // 全部キレイにする


## docker
docker images --filter "dangling=true"// タグのついていないイメージを取得
docker system prune -a -f // 停止しているコンテナすべて削除
docker stats xxxx // コンテナの使用状況を確認
docker rm -f $(docker ps -aq) && docker rmi -f $(docker images -q) && docker volume rm -f $(docker volume ls -q) // 全部消す

## yarn
yarn cache clean
yarn start

## codeDeploy
tail -f /var/log/aws/codedeploy-agent/codedeploy-agent.log
tail -f /opt/codedeploy-agent/deployment-root/deployment-logs/codedeploy-agent-deployments.log ## mysql TRUNCATE TABLE ar_internal_metadata;
## rails
bundle exec rails g controller home index
bundle exec rails destroy controller home index
bundle exec rails g model site
bundle exec rails g task site_csv_import
gem uninstall coffee-rails // gemfileは手動更新 gem update mysql2 // 全更新は出来るだけしない gem cleanup // アップデートしたら一応これも実行
rails db:setup
bundle exec rails g migration createValue
bundle exec rake db:migrate
bundle exec rake db:migrate:reset
bundle exec rake db:seed
bundle exec rake sitemap:refresh:no_ping
irb // インタプリタ実行
## javascript console.log(); ## linux cat /etc/passwd // ユーザー一覧表示 who // ログインユーザー情報表示 which docker-compose > ~/test.txt // コマンドパスを取得&出力をテキストに保存
df -h //ディスク容量(G)を確認
sudo du -x / | sort -n | tail -40 // 容量が大きい順に並べる

## markdown ├│└
## vscode
ctrl + ` // ターミナルを表示
command + \ # 同一ファイルを分割
command + alt + 0 # 縦横分割の切り替え
shift + alt + ドラッグ # 矩形選択
command + B # サイドバー表示切り替え
command + shift + V # Markdownプレビュー
command+shift+X // 拡張機能を開く
control + - // 戻る
control + shift + - // 進む
command+Shift+P -> "compare"入力 // 文字列比較diff

## xcode
command + R // ビルドして実行
command + U // テスト実行
command + alt + / // コメント入力
option + click // エディタを右に表示
command + 0 // サイドメニュートグル
command + + - // エディターの拡大・縮小
alt + shift + ドラッグ // 矩形選択 ctlr + ` // ターミナル表示切り替え
// iterm2 cmd + d // 縦分割 cmd + shift + d // 横分割 // mac killall SystemUIServer // メニューバー再起動
sudo purge // RAM開放
command + option + i // ディベロッパーツール表示