df -h
'-h' は 61917736 を 60G とかになおしてくれる。
パーティションの一覧表示
parted -l
未使用スペースを含めて表示
parted (parted) print free
tar -cvzf tgzFILE DIRCompressTo
tar -xvzf tgzFILE
git pull --rebase
git commit --amend --author="mgmn <mgmnjp@example.com>" --no-edit
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
(Enter) ~.
certbot --non-interactive certonly --webroot -w /var/www/html -m "mgmnjp@example.com" --agree-tos -d "example.com"
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 req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 3650
openssl rsa -in key.pem -out key.pem
openssl rsa - Mister PKI
https://www.misterpki.com/openssl-rsa/
curl --ntlm -u user:password https://...
dig @1.1.1.1 mgmn.jp +trace
下段は development 環境用。
bundle && yarn --frozen-lockfile
pg_dump -Fc mastodon_production -f ~/donbak/pg_backup.dump
pg_dump -Fc mastodon_development -f ~/donbak/pg_backup.dump
RAILS_ENV=production bundle exec rails db:migrate
RAILS_ENV=development bundle exec rails db:migrate
rm -rf public/packs && RAILS_ENV=production bundle exec rails assets:precompile
rm -rf public/packs && RAILS_ENV=development bundle exec rails assets:precompile
public/packs を消した場合は OS 再起動したほうがいいかも
sudo systemctl daemon-reload && sudo systemctl reload mastodon-web && sudo systemctl restart mastodon-sidekiq # サービス稼働状態の確認 sudo systemctl | grep mastodon
RAILS_ENV=development bin/tootctl accounts create --email EMAIL --confirmed USERNAME
RAILS_ENV=development bin/tootctl accounts create --role Owner --email EMAIL --confirmed USERNAME
RAILS_ENV=production bin/tootctl accounts modify --role Owner USERNAME
RAILS_ENV=development bin/tootctl accounts modify --role Owner USERNAME