コンテンツにスキップ

その他

git

初期設定

$ git config --global user.name "user"
$ git config --global user.email "user@example.com"
$ git config --global pull.rebase false
$ git config --global color.ui = auto

git config --global url.https://example.com/.insteadOf git@example.com:
git config --global --add url.https://example.com/.insteadOf ssh://git@example.com/

branch

git checkout -b test main
git push -u origin test

git commit -m ""

状態確認

status
show

git diff --name-only --cached
git diff ID
git log

patch

git format-patch --start-number NUMBER ID

git apply --check 0001-test.patch

patch -p1 < 0001-test.patch

書き換え

$ git commit --amend

$ git rebase -i HEAD~n
pickをeditに変更する
git commit --amend -s -m ""
git rebase --continue

git stash -u
git stash list
git stash apply stash@{0}
git stash apply stash@{0} --index
git stash drop stash@{0}
$ git reset --soft HEAD^
$ git reset --hard HEAD^
$ git reset HEAD FILENAME
$ git checkout HEAD FILENAME
$ git rm --cached -r FILENAME

$ git revert HEAD

$ git log --pretty=full

$ git filter-branch -f --env-filter '
  if [ "$GIT_COMMITTER_EMAIL" = "user1@example.com" ];
    then
      GIT_COMMITER_NAME="user2";
      GIT_AUTHOR_NAME="user2";
      GIT_COMMITER_EMAIL="user2@example.com";
      GIT_AUTHOR_EMAil="user2@example.com";
  fi'
$ git push -f

magit

unattended-upgrades

fwupdmgr

reverse SSH

  • /etc/ssh/sshd_config
GatewayPorts clientspecified
$ sudo systemctl restart sshd
$ ssh -N -R 0.0.0.0:PORT1:localhost:PORT2 SERVER

LXDE

タッチパッド

参考

  • https://wiki.debian.org/SynapticsTouchpad

  • /etc/X11/xorg.conf.d/40-libinput.conf

Section "InputClass"
        Identifier "libinput touchpad catchall"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
        Option "Tapping" "on"
    Option "NaturalScrolling" "on"
EndSection

輝度

$ brightnessctl set 10%

Emacs

(setq make-backup-files nil)
(global-display-line-numbers-mode t) (custom-set-variables '(display-line-numbers-width-start t))

pop-tag-mark

mew

M-x mew-summary-set-case

S/MIME

editor

$ sudo update-alternatives --config editor
$ sudo update-alternatives --set editor /usr/bin/vim.basic
EDITOR=/usr/bin/vi

ストレージのパスフレーズ

https://wiki.archlinux.jp/index.php/Dm-crypt/%E3%83%87%E3%83%90%E3%82%A4%E3%82%B9%E3%81%AE%E6%9A%97%E5%8F%B7%E5%8C%96

$ dd if=/dev/random bs=32 count=1 of=/root/random_data_keyfile1
$ cryptsetup luksAddKey /dev/sda3 /root/random_data_keyfile1
  • /etc/crypttab
home    UUID=<UUID identifier>    /etc/mykeyfile

その他

$ LANG=C xdg-user-dirs-gtk-update
systemd タイマー
systemctl edit
systemctl --user
bluetoothctl
linter clang-tidy
clang-format emacs

Bluetooth

bluetoothctlで、trustしてからpairしないと、接続できない場合がある。

trust
pair
connect

xrandr

$ xrandr --output HDMI-2 --left-of HDMI-1
$ xrandr --output HDMI-1 --mode 2560x1600