Skip to content

Commit

Permalink
Small fix + cheatsheet
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Mar 22, 2020
1 parent 5ccf01d commit 8bc2ea9
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 6 deletions.
48 changes: 48 additions & 0 deletions cheatsheet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Rsync
``````
rsync -az IP:/module ~/ — progress
rsync — list-only IP:/
rsync -avrz /opt/data/filename root@ip:/opt/data/file
``````
# CouchDb
```
/_all_dbs
<db>/_all_docs?include_docs=true&limit=50
/<db>/doc?rev=<nr>
<db>/doc
<db>/doc/<name>
/<db>/<docid>
/<db>/<id>/<attachment_id>
```
# MongoDB
``````
show databases
use ‘db’
show collections
db.’collection’.stats()
db.’collection’.findOne()
db.’collection’.find().prettyPrint()
db.’collection’.find()
``````
# Elastic
``````
_cat/nodes?v
_cat/count?v
<indices>/_search?size=50
``````
12 changes: 6 additions & 6 deletions leaklooker/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,12 +511,12 @@ def check_rsync(c, i, search):
banner = i['result']['data']['service']['banner'].split("\\n")
for share in banner:
shares.append(share)

device = Rsync(search=search, ip=ip, port=port, shares=shares)
device.save()
except Exception as e:
print(e)

device = Rsync(search=search, ip=ip, port=port, shares=shares)
device.save()


return_dict[c] = {"ip": ip, "port": port, "shares": shares}

Expand Down Expand Up @@ -675,14 +675,14 @@ def check_elastic(c, i, search):
indices_list.append(indice['index_name'])

new_size = size(bytes_size)

device = Elastic(search=search, name=name, ip=ip, port=port, size=new_size, indices=indices_list)
device.save()
except Exception as e:
print(e)

return_dict[c] = {"name": name, "ip": ip, "port": port, 'size': new_size, "indice": indices_list}

device = Elastic(search=search, name=name, ip=ip, port=port, size=new_size, indices=indices_list)
device.save()

return return_dict


Expand Down

0 comments on commit 8bc2ea9

Please sign in to comment.