Skip to content

Commit

Permalink
Add link to Linux Master application
Browse files Browse the repository at this point in the history
  • Loading branch information
abregman committed Mar 30, 2021
1 parent e858b38 commit ba18baa
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ Once you are familiar with the commands and feel comfortable enough to keep deep
* Kernel
* Virtulization

#### Linux Master Application

A completely free application for testing your knowledge on Linux

<a href="https://play.google.com/store/apps/details?id=com.codingshell.linuxmaster"><img src="images/linux_master.jpeg"/></a>

### System Design

System Design can be a complex topic. For that reason, I've created a separate repository for you to learn it properly.
Expand Down
Binary file added images/linux_master.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 61 additions & 1 deletion resources/mongo.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,66 @@ Name | Description
#### Aggregations

* Count the number of documents: `db.accounts.aggregate([ { "$count": "number of documents" }])`
* Show only the sub element "attachment_uuids": `db.accounts.aggregate( [ {$project: {"hosts.attachment_uuids": 1, _id:0}} ] )`
* Show only the sub element 'attachment_uuids': `db.accounts.aggregate( [ {$project: {"hosts.attachment_uuids": 1, _id:0}} ] )`

#### Users

* Display users:

```
use admin
db.getUsers()
```

* Create administrative user

```
use admin
db.createUser({user: "admin", pwd: "some_password", roles: ["root"]})
```

* Authentice: `db.auth(USERNAME, PASSWORD)`

#### Roles

* Display roles

```
use admin
db.getRoles()
```

* Drop/Remove role: `db.dropRole("NAME_OF_THE_ROLE")`

#### LDAP

* Mongo Conf LDAP configuration

```
security:
# authorization: "enabled"
ldap:
servers: 'some.ldap.server.com'
userToDNMapping:
'[
{
match: "(.+)",
ldapQuery: "DC=X,DC=com??sub?(uid={0})"
}
]'
authz:
queryTemplate: "{USER}?memberOf?base"
setParameter:
authenticationMechanisms: 'PLAIN,SCRAM-SHA-1'
```

* Create role where the LDAP group "unicorns" has permissions to only run 'find' on "hosts" collection in 'test' db:

```
db.createRole({role:"cn=unicorns,ou=groups,dc=X,dc=com", privileges: [{ resource: {db: "", collection: "hosts"}, actions: ["find"]}], roles: [{ role: "read", db: "test"}]})
```

* Drop/Remove role from the previous example: `db.dropRole("cn=unicorns,ou=groups,dc=X,dc=com")`

### Mongo Python

Expand Down Expand Up @@ -64,3 +123,4 @@ mongo_client.update_one(
{'_id': 1},
{'$addToSet': {'some_list': { '$each': [1, 2, 3]} }}, upsert=True)
```

0 comments on commit ba18baa

Please sign in to comment.