blob: f90182b061da5c88d90503b52acee946f959f933 (
about) (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
---
layout: page
title: "TIL: Useful code snippets"
lang: en
ref: til
---
### Bash variables
```shell
$ which git
/run/current-system/sw/bin/git
$ readlink $(!!)
readlink $(which git)
/nix/store/5bgr1xpm4m0r72h9049jbbhagxdyrnyb-git-2.28.0/bin/git
```
### 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'
```
### UNIX searching commands
```shell
$ which gcc
$ locate signal.h
$ updatedb # add to cron?
```
### Guix contributing
```shell
$ cd ~/dev/guix/guix/
$ git clean -ffdx
$ guix environment guix # guix environment guix --ad-hoc help2man git strace
$ ./bootstrap
$ ./configure --localstatedir=/var
$ make
$ ./pre-inst-env guix describe
$ ./pre-inst-env guix show $PKG
$ ./pre-inst-env guix build $PKG
$ ./pre-inst-env guix lint $PKG
```
v2:
```shell
guix environment --pure guix --ad-hoc help2man git strace -- sh -c "./bootstrap && ./configure --localstatedir=/var && make"
```
v3:
```shell
$ guix environment --pure guix --ad-hoc help2man git stract
$ ./bootstrap
$ ./configure --localstatedir=/var
$ make
$ ./pre-inst-env guix build $PKG
$ ./pre-inst-env guix lint $PKG
$ ./pre-inst-env guix refresh --list-dependent $PKG
$ ./pre-inst-env guix build --rounds=2 $PKG
$ ./etc/ident-code.el $PKG
```
### git mail patches
Check the [guix-devel thread][0] on
named "Re: [External] Re: New outreachy participant introduction".
[0]: https://lists.gnu.org/archive/html/guix-devel/2019-10/msg00093.html
### Flutter Dart `patchelf`
```shell
patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) /home/andreh/dev/misc/flutter/bin/cache/dart-sdk/bin/dart
```
### builds.sr.ht environment variables
[https://builds.sr.ht/~euandreh/job/68005](https://builds.sr.ht/~euandreh/job/68005).
### `C-c M-m` in message-mode for creating `cut here` sections
Or run the `scissors` function.
### Software Recomendations StackExchange exists
[https://softwarerecs.stackexchange.com/](https://softwarerecs.stackexchange.com/).
### GPG key search
```shell
gpg --search-key eu@euandre.org
```
### Git Annex wanted
```shell
git annex wanted . 'exclude=Banshee/old-musics/* and exclude=attic/videos/* and exclude=Photos/*'
```
### Useful keybindings
- `SPC v` for region selection
- `SPC j s` to split sexp
- `mod-shift-space` reset layout
## Acknowledgements
Shameless rip-off of [Anna e só](https://til.flourishing.stream/).
|