From 8a587740cef0e75a76bb9aa953d217a682556255 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Mon, 10 Aug 2020 08:56:51 -0300 Subject: Add til.dm --- til.md | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 til.md (limited to 'til.md') diff --git a/til.md b/til.md new file mode 100644 index 0000000..b25de0d --- /dev/null +++ b/til.md @@ -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/) -- cgit v1.2.3