usefull-oneliners/README.md

29 rader
591 B
Markdown
Normal vy Historik

2018-06-08 13:31:07 +03:00
# Usefull Oneliners
2018-06-08 13:28:44 +03:00
2018-06-08 13:31:07 +03:00
## vim
2018-07-03 23:29:19 +03:00
* Set tab to 4 spaces:
2018-07-03 23:29:55 +03:00
2018-07-03 23:29:19 +03:00
```
set tabstop=8 softtabstop=0 expandtab shiftwidth=4 smarttab
```
2018-06-08 13:31:07 +03:00
2018-06-08 13:35:48 +03:00
## Shell
2018-07-03 23:29:19 +03:00
* Find my public IP:
2018-07-03 23:29:55 +03:00
2018-07-03 23:29:19 +03:00
```
dig +short myip.opendns.com @resolver1.opendns.com
```
2018-07-04 21:01:02 +03:00
* Check if private and public ssh keys match:
2018-07-03 23:29:55 +03:00
2018-07-03 23:29:19 +03:00
```
diff <(cat ~/.ssh/id_rsa.pub | cut -d' ' -f 2) <(ssh-keygen -y -f ~/.ssh/id_rsa | cut -d' ' -f 2)'
```
2018-06-08 13:35:48 +03:00
2018-06-08 13:31:07 +03:00
References
------
2018-07-03 23:29:19 +03:00
* https://stackoverflow.com/questions/1878974/redefine-tab-as-4-spaces
* https://serverfault.com/questions/426394/how-to-check-if-a-rsa-public-private-key-pair-matched