2020-07-05 22:38:14 -04:00
|
|
|
# FAQ
|
2021-07-20 20:14:24 -04:00
|
|
|
|
2022-01-24 14:03:38 -05:00
|
|
|
## Scripting
|
|
|
|
|
|
|
|
|
|
### Search all duplicate file recursively in given directory
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
find . -type f -printf '%p/ %f\n' | sort -k2 | uniq -f1 --all-repeated=separate
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Search all duplicate directory recursively in given directory
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
find . -type d -printf '%p/ %f\n' | sort -k2 | uniq -f1 --all-repeated=separate
|
|
|
|
|
```
|
|
|
|
|
|
2021-01-20 06:23:44 -05:00
|
|
|
## Networking
|
2021-07-20 20:14:24 -04:00
|
|
|
|
2021-01-20 06:23:44 -05:00
|
|
|
Show all open port
|
2021-07-20 20:14:24 -04:00
|
|
|
|
2021-01-20 06:23:44 -05:00
|
|
|
```bash
|
|
|
|
|
sudo lsof -i -P -n | grep LISTEN
|
|
|
|
|
```
|
2021-07-20 20:14:24 -04:00
|
|
|
|
2021-01-21 01:52:54 -05:00
|
|
|
or
|
2021-07-20 20:14:24 -04:00
|
|
|
|
2021-01-21 01:52:54 -05:00
|
|
|
```bash
|
|
|
|
|
sudo netstat -lpnt | grep LISTEN
|
|
|
|
|
```
|
2021-07-20 20:14:24 -04:00
|
|
|
|
2021-01-21 01:52:54 -05:00
|
|
|
or
|
2021-07-20 20:14:24 -04:00
|
|
|
|
2021-01-21 01:52:54 -05:00
|
|
|
```bash
|
|
|
|
|
sudo ss -lpnt | grep LISTEN
|
|
|
|
|
```
|
2021-01-20 06:23:44 -05:00
|
|
|
|
2020-07-05 22:38:14 -04:00
|
|
|
## git-repo
|
2021-07-20 20:14:24 -04:00
|
|
|
|
2020-07-05 22:38:14 -04:00
|
|
|
### error.GitError fatal bad revision
|
2021-07-20 20:14:24 -04:00
|
|
|
|
2020-07-05 22:38:14 -04:00
|
|
|
Example:
|
2021-07-20 20:14:24 -04:00
|
|
|
|
2020-07-05 22:38:14 -04:00
|
|
|
```
|
|
|
|
|
error.GitError: manifests rev-list (u'^2736dfd46e8a30cf59a9cd6e93d9e56e87021f2a', 'HEAD', '--'): fatal: bad revision 'HEAD'
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Did you modify files in .repo?
|
|
|
|
|
|
2020-09-30 20:49:35 -04:00
|
|
|
To reset files from your branch into .repo:
|
2021-07-20 20:14:24 -04:00
|
|
|
|
2020-07-05 22:38:14 -04:00
|
|
|
```bash
|
|
|
|
|
cd .repo/manifests
|
|
|
|
|
git branch -av
|
|
|
|
|
> remotes/m/rel/8953/zd552kl/7.1.1-11.40.208 -> origin/rel/8953/zd552kl/7.1.1-11.40.208
|
|
|
|
|
> remotes/origin/dev/ze550kl/asus/5.0.0-20150208 11a37fe set dev/ze550kl/asus/5.0.0-20150208
|
|
|
|
|
> remotes/origin/rel/8953/zd552kl/7.1.1-11.40.208 2736dfd Remove opencv3 from the manifest
|
|
|
|
|
# To reset the "remotes/origin" use the same as "remotes/m"
|
|
|
|
|
git reset --hard REF_OF_REMOTES/m
|
|
|
|
|
> git reset --hard remotes/origin/rel/8953/zd552kl/7.1.1-11.40.208
|
2021-07-20 20:14:24 -04:00
|
|
|
```
|