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 よりも証明書の重複取得の回数制限がかなり緩和されている。

ストアしている証明書の一覧†

certbot certificates

ストアしている証明書を削除する†

sudo certbot delete --cert-name example.com

取得済みの証明書が「Certificate not yet due for renewal」で再取得できない場合はこれで設定を消すと通るようになる。

openssl†

自己証明書の作成†

openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 3650

RSA 鍵からパスワードを削除する†

openssl rsa -in key.pem -out key.pem

openssl rsa - Mister PKI
https://www.misterpki.com/openssl-rsa/

curl†

NTLM 認証をする†

curl --ntlm -u user:password https://...

dig†

ルートサーバからの反復問い合わせとその応答をすべて表示する†

dig @1.1.1.1 mgmn.jp +trace

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