diff options
Diffstat (limited to 'til.md')
-rw-r--r-- | til.md | 53 |
1 files changed, 53 insertions, 0 deletions
@@ -0,0 +1,53 @@ +--- +layout: page +title: "TIL: Useful code snippets" +lang: en +ref: til +--- +Useful code snippets[^source]. + +## Git custom work-tree checkout + +```shell +git --work-tree=/path/to/outputdir checkout HEAD -- . +``` +## Search in Git + +Search log messages + +```shell +git log --grep='Build 0051' +``` + +Search content in git history + +```shell +git grep 'Build 0051' $(git rev-list --all) +``` +## Find broken symlinks + +```shell +find . -xtype l +``` + +## Kernel version +```shell +uname -r +``` +## Sending email through the command line + +```shell +mail eu@euandre.org -s "This is the subject" -aFrom:eu@euandre.org <<< 'This is the message' +``` + +## Git bisecting + +Automatic Git bisect + +```shell +git bisect start e1fd0a817d192c5a5df72dd7422e36558fa78e46 HEAD +git bisect run sh -c 'git clean -ffdx && ./bootstrap && ./configure --localstatedir=/var && make && git checkout' +``` + + +[^source]: Shameless rip-off of [Anna e só](https://til.flourishing.stream/) |