Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/cherkavi/cheat-sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
cherkavi committed Oct 1, 2020
2 parents 2e0d268 + 53dab78 commit dcba80e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
18 changes: 18 additions & 0 deletions linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -1155,6 +1155,19 @@ vi wrap( :set wrap, :set nowrap )
```
export PROMPT_COMMAND="echo -n \[\$(date +%H:%M:%S)\]\ "
```
.bashrc of ubuntu
```bash
if [ "$color_prompt" = yes ]; then
# PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@$(date +%d%m_%H%M)\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

else
# PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
PS1='${debian_chroot:+($debian_chroot)}\u:\$(date +%d.%m_%H:%M)\w\$ '

fi
unset color_prompt force_color_prompt
```

### last executed exit code
```
Expand Down Expand Up @@ -1656,6 +1669,11 @@ sudo adduser vitalii sudo
sudo deluser vitalii sudo
```

### admin rights for script, sudo rights for script
```
sudo -E bash -c 'python3'
```

### remove user
```
sudo userdel -r test
Expand Down
10 changes: 8 additions & 2 deletions mapr.md
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,14 @@ maprcli table index add -path /vantage/deploy/data-access-video/images -index fr
maprclitable index list -path <path>
maprclitable cfcreate / delete / list
```
[manipulate with MapRDB via DbShell](https://docs.datafabric.hpe.com/61/ReferenceGuide/mapr_dbshell.htm)
* https://mapr.com/docs/61/ReferenceGuide/dbshell-find-findbyid.html
Describe data, describe table
```
mapr dbshell
desc /full/path/to/maprdb/table
```
[manipulate with MapRDB via DbShell](https://docs.datafabric.hpe.com/61/ReferenceGuide/HBaseShellforMapR-DB.html)
* [find by id](https://mapr.com/docs/61/ReferenceGuide/dbshell-find-findbyid.html)
* [query data](https://docs.datafabric.hpe.com/61/ReferenceGuide/dbshell-find-query.html)
```sh
mapr dbshell
find /mapr/prod/vantage/orchestration/tables/metadata --q {"$select":["mdf4Path.name","mdf4Path.fullPath"],"$limit":2}
Expand Down
9 changes: 9 additions & 0 deletions mariadb.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,15 @@ CREATE DATABASE {databasename}
COLLATE = 'utf8_general_ci';
```

### create table, autoincrement
```
create table IF NOT EXISTS `hlm_auth_ext`(
`auth_ext_id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY,
`uuid` varchar(64) NOT NULL,
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
```

### subquery returns more than one row
```
select
Expand Down

0 comments on commit dcba80e

Please sign in to comment.