Tag: cheatsheet

cheetsheet/equery

よく使うオプション オプション ショートオプション 用途 例 belongs b ファイルを提供したパッケージを検索 equery belongs -e /bin/chgrp depends d そのパッケージが必要な全てのパッケージ equery depends pygtk depgraph g そのパッケージに必要な全てのパッケージ equery depgraph distcc uses u USE フラグを表示 equery uses syslib/glibc keywords y アーキテクチャごとの対応状況を確認できる equery keywords lv list l インストール可能なバージョンを確認する equery list -po vim インストール emerge --ask app-portage/gentoolkit 参考 オフィシャル オフィシャル Read more...

cheetsheet/aws/medialive

チャンネル操作 効果 コマンド チャンネルのリスト aws medialive list-channels –region ap-southeast-1 | jq -r ‘.Channels[].Id’) 止める aws medialive stop-channel –channel-id チャンネル ID 削除 aws medialive delete-channel –channel-id チャンネル ID 作成 aws medialive create-channel –cli-input-json file://channel_sample.json | jq ‘.Channel.Id’ 開始 aws medialive start-channel –channel-id チャンネル ID インプットを作成する aws medialive create-input –cli-input-json “$CREATEINPUT” –region ap-southeast-1 インプット id を調べる aws medialive list-inputs –region ap-southeast-1 | jq -r ‘. Read more...

cheetsheet/ufw

効果 コマンド 状態 sudo ufw status 有効/無効 sudo ufw <enable/disable> 開放 sudo ufw allow 80 ルールのリスト sudo ufw status numbered ルールの削除 sudo ufw delete <ルールID> Read more...

cheetsheet/ffmpeg

オプション 効果 コマンド 備考 RTMP 送信 ffmpeg -re -i hoge.mp4 -vcodec h264 -ar 44100 -f flv “rtmp://エンドポイント” ts ファイルを結合 ffmpeg -f concat -safe 0 -i live_1080p.txt -vsync 1 -c copy ../live_1080p.mp4 シャープネスを強く -vf “unsharp=3:3:0.3” 0.3〜0.5 CPU スレッドを有効に使う -threads 9 アスペクト比を維持した状態でサイズ変更 -vf scale=1280:-1 参考 音質を良くする -b:a 192k -aac_coder twoloop 参考 フレーム補間 -vf “minterpolate=60” 参考 Intel QSV でエンコード -c:v h264_videotoolbox -b:v 2m 参考 Linux でエンコード -vcodec h264_vaapi ビデオビットレート -b:v 2m 品質 -crf 28 0(ロスレス) 51(最低) QSV でエンコードする場合、 -b:v で十分なビットレートを指定する必要がある。 Read more...

cheetsheet/pactl

コマンド 効果 pactl list cards short カード一覧 pactl list modules ロードしている PluseAudio 一覧 pactl list sinks 現在の sink(出力先)一覧 pacmd list 現在の設定一覧 pacmd list-sinks | grep -e ‘name:’ -e ‘index:’ デフォルトの出力先 pulseaudio –dump-conf 設定ファイルの読み込み /etc/pulse/daemon.conf から読み込んでいる Read more...

cheetsheet/wp

Wordpress 用の CLI よく使うもの。 /home/kusanagi/ドメイン/DocumentRoot/ 配下に移動してから使う コマンド 効果 wc plugin list help ヘルプ wp plugin list –format=csv プラグインのリストを CSV で Read more...

ECRのパブリックレポジトリをCLIから作成する

2021/09/10 時点だと --region us-east-1 が必要だった。でないと Could not connect to the endpoint URL: "https://api.ecr-public.ap-northeast-1.amazonaws.com/" というエラーがでる。AWS 管理コンソール上は東京リージョンで存在を確認できる。 作成 AWS 管理コンソールでの作り方は パブリックリポジトリの作成 aws ecr-public create-repository --repository-name hogehoge --region us-east-1 削除 aws ecr-public delete-repository --repository-name hogehoge --region us-east-1 push までの流れ push する前にログインする( public とはいえ push にはログインが必要 ビルドする タグづけをする push aws ecr-public get-login-password --region ap-northeast-1 | docker login --username AWS --password-stdin public.ecr.aws/hoge docker build -t test-20210910-1 . docker tag test-20210910-1:latest public.ecr.aws/hoge/test-20210910-1:latest docker push public. Read more...

cheetsheet/git

オプション 説明 コマンド mainブランチとの差分をマージ git fetch origin && git merge origin/master 現在の変更をスタッシュに保存 git stash スタッシュされた変更のリストを表示 git stash list 最後にスタッシュした変更を再適用 git stash apply スタッシュした変更を削除 git stash drop git addしたステージングしたファイルのリストを解除 git reset ローカルにcommitしたが編集状態に戻したい git reset –mixed HEAD^ 最後にコミットした状態に戻す(編集内容は消える) git reset –hard HEAD 編集内容を消す git checkout HEAD – [ファイル名] 直近のログ、1個を確認 git -p -1 直前のコミットとその前のコミットとの間の差分を見たい git diff HEAD~1 HEAD . Read more...

cheetsheet/rg

オプション 説明 コマンド 隠しディレクトリも検索 –hidden 正規表現としない -F, –fixed-strings 単語とみなす。 /\b(?:foo)\b/ -w, –word-regexp 大小文字を区別しない。 /foo/i -i, –ignore-case 大小文字を区別する。 /foo/ -s, –case-sensitive 小文字なら /foo/i で大文字が含まれるなら /Foo/ -S, –smart-case 1行分マッチさせる。 foo は /^foo$/ -x, –line-regexp 複数行にまたがれる。 a\nb には a\nb でマッチする -U, –multiline -U と合わせて指定すると a\nb に a.b でマッチする –multiline-dotall Read more...