Skip to content
yurenchen000 edited this page Aug 19, 2025 · 2 revisions

use cases

just demos i often use

TIPS: Ctrl + G will prepend howto cmd and query

NOTE: AI may make mistakes, check before pressing Enter


//dev,git

$ howto generate xx.patch from xx.a xx.b
== howto: generate xx.patch from xx.a xx.b
== cmd is: diff -u xx.a xx.b > xx.patch

$ howto apply patch gen by 'diff -u xx.a xx.b > xx.patch'
== howto: apply patch gen by diff -u xx.a xx.b > xx.patch
== cmd is: patch xx.a < xx.patch


$ howto git drop local commit 3479640
== howto: git drop local commit 3479640
== cmd is: git reset --hard 3479640^


$ howto git rebase master force use their
== howto: git rebase master force use their
== cmd is: git rebase --onto master --force

$ howto checkout git@github.com:yurenchen000/howto.sh.git
== howto: checkout git@github.com:yurenchen000/howto.sh.git
== cmd is: git clone git@github.com:yurenchen000/howto.sh.git && cd howto.sh

//server ops

$ howto show ip local port range from proc
== howto: show ip local port range from proc
== cmd is: cat /proc/sys/net/ipv4/ip_local_port_range


$ howto show conntrack max from proc
== howto: show conntrack max from proc
== cmd is: cat /proc/sys/net/nf_conntrack_max


$ howto dropcaches 3
== howto: dropcaches 3
== cmd is: sync; echo 3 | sudo tee /proc/sys/vm/drop_caches


$ howto rename all 'output_2025-08-05_*.mp4' to 'out_*.mp4'
== howto: rename all output_2025-08-05_*.mp4 to out_*.mp4
== cmd is: rename 's/output_2025-08-05_/out_/' output_2025-08-05_*.mp4


$ howto openssl connect bing.com 443
== howto: openssl connect bing.com 443
== cmd is: openssl s_client -connect bing.com:443 -servername bing.com

$ howto query ca expire time for bing.com
== howto: query ca expire time for bing.com
== cmd is: echo | openssl s_client -connect bing.com:443 -servername bing.com 2>/dev/null | openssl x509 -noout -dates

//other

$ howto download all url in avatars.txt to avatars/
== howto: download all url in avatars.txt to avatars/
== cmd is: wget -i avatars.txt -P avatars/

$ howto convert demo2.gif to demo2.mp4, frame rate 30, twitter compatible  
== cmd is: ffmpeg -i demo2.gif -vf "fps=30,scale=trunc(iw/2)*2:trunc(ih/2)*2" -c:v libx264 -pix_fmt yuv420p demo2.mp4

$ howto extract xxx.tar.gz
== howto: extract xxx.tar.gz
== cmd is: tar -xzf xxx.
Clone this wiki locally