command snippet

disk free

df -h

'-h' は 61917736 を 60G とかになおしてくれる。

tar+gzip

ディレクトリの圧縮

tar -cvzf tgzFILE DIRCompressTo

ディレクトリの展開

tar -xvzf tgzFILE

git

force pushed branch の pull

git pull --rebase

直前の commit の author の修正

git commit --amend --author="mgmn <mgmnjp@example.com>" --no-edit

直前の amend commit を取り消す (変更を維持)

git reset --soft HEAD@{1}

`git reflog` した結果の `{n}` こ前に HEAD を移動している。
https://stackoverflow.com/questions/1459150/how-to-undo-git-commit-amend-done-instead-of-git-commit

ssh

固まったセッションの強制終了

(Enter)
~.

certbot

証明書の取得

certbot --non-interactive certonly --webroot -w /var/www/html -m "mgmnjp@example.com" --agree-tos -d "example.com" 

証明書の取得 (staging server)

certbot --non-interactive certonly --webroot -w /var/www/html -m "mgmnjp@example.com" --agree-tos -d "example.com" --test-cert

staging server は production server よりも証明書の重複取得の回数制限がかなり緩和されている。


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS