5.3 KiB
title |
---|
Notes |
Git
Rebase
The use of -Xtheirs and -Xours appear to be somewhat counterintuitive, so think of it as telling git which branch code to favor when resolving rebase conflicts. For example, when doing:
git rebase -Xtheirs branch-b
Xtheirs favors your current branch-a code when overwriting merge conflicts, and vice versa -Xours overwrites merge conflicts with the code in branch-b.
Similar options exist in git merge command as well, but the meaning of -Xtheirs and -Xours is reversed due to the differences on how git rebase and git merge operate and what they consider ours vs. theirs:
git rebase -Xtheirs branch-b # <- ours: branch-b, theirs: branch-a
git merge -Xtheirs branch-b # <- ours: branch-a, theirs: branch-b
Thus, if you are merging changes from origin/master and would like git to favor your current branch code during merge conflicts, you’d need to do this:
git merge -Xours origin/master
-
https://dev.to/cloudx/resolving-git-conflicts-in-package-lockjson-using-a-merge-driver-2ipk
-
https://ten0s.github.io/blog/2020/04/19/git-difftool-and-binary-files
-
https://gist.github.com/pascaliske/53648334378d592c0c2cc62b989a027e
Shell tips
Disk space
du -cha --max-depth=1 / | grep -E "M|G"
du -cha --max-depth=1 /var | grep -E "M|G"
Recursively remove execute permissions
chmod -R a-x+X,u-x+rwX,go-wx+rX Study/
SED debugger - sedsed
System related
Htop explained
Using perf
perf top -t <pid>
shows the performance counters
rsync
rsync -a username@remote_host:/home/username/dir1 place_to_sync_on_local_machine
Like cp and similar tools, the source is always the first argument and the destination is always the second.
Nginx hosting setup
The below is used to generate the certificates. To add more sub-domains, just call the command again, adding the sub domain.
certbot certonly --agree-tos --email sanchayan@sanchayanmaity.net --webroot -w /var/lib/letsencrypt/ -d sanchayanmaity.net -d www.sanchayanmaity.net -d git.sanchayanmaity.net -d monitor.sanchayanmaity.net
certbot certonly --agree-tos --email sanchayan@sanchayanmaity.com --webroot -w /var/lib/letsencrypt/ -d sanchayanmaity.com -d www.sanchayanmaity.com -d git.sanchayanmaity.com -d monitor.sanchayanmaity.com
Setting up a kernel debugging environment
Javascript
C
Caching integer overflows in C
Where to find good bread in Bangalore
Wayland
A better way to read Wayland documentation
Distributed systems
PI calculus
Yocto
Yocto/openembedded builds never work on Arch and even on something old like Ubuntu 16.04, one runs into problems like this
docker is a blessing for such things.
docker run --rm -it -v {$PWD}:/oe-core crops/poky:debian-9 --workdir=/oe-core
Pulseaudio
Keyboard websites for split ergonomic keyboards
-
ergomech.store
-
keebmaker.com
-
boardsource.xyz
-
littlekeyboards.com
-
splitkb.com
-
rectangles.store
-
bastardkb.com
-
keeb.io
-
stackskb.com
Fish
- https://github.com/jorgebucaran/cookbook.fish#how-do-i-redirect-stdout-or-stderr-to-a-file-in-fish
- https://developerlife.com/2021/01/19/fish-scripting-manual/#how-to-write-functions
GPG
- https://emailselfdefense.fsf.org/en/index.html
- https://oguya.ch/posts/2016-04-01-gpg-subkeys/
- https://gitlab.com/muttmua/mutt/-/wikis/MuttGuide/UseGPG
- https://riseup.net/en/security/message-security/openpgp/best-practices
- https://m7i.org/tips/mutt-pgp-sign-attachment/
- https://thoughtbot.com/blog/pgp-and-you
- https://code.dblock.org/2021/04/16/adding-work-email-to-a-gpg-key-and-signing-git-commits.html