# Shell scripts

Script to use inside the shell immediately. 

## Commands

- `images-from` - get list of images from `docker-compose.STACK_NAME.yml` file.
- `pull-images-from` - pull all the images from `docker-compose.STACK_NAME.yml` file.
- `set-docker-envs` - sets environment variables for docker for your shell session.
- `google` - find everything from shell.
- `clean-docker` - cleans garbage from docker.
- `cr-script` - creates a shell script with the needed rights.

### Aliases

```bash
alias gc='git clone'
alias grep='grep --color=auto'
alias ..='cd ..'
alias d='date +%F'
alias now='date +"%T"'
alias cpu='top -o cpu'
alias mem='top -o rsize' # memory
alias ip="curl icanhazip.com"
alias cls='printf "\033c"'
```

## Install

1. Create a folder inside your user folder (`~/`). In the example `Workspace` is used.
2. Copy this folder (`shell`) contents into the newly created folder.
3. Create or edit your `.bashrc` file (located at user folder).
4. Insert the following line into your `.bashrc`. Change 
`YOUR_USER_FOLDER` and `YOUR_NEWLY_CREATED_FOLDER` to appropriate name:
    ```bash
    . /Users/YOUR_USER_FOLDER/YOUR_NEWLY_CREATED_FOLDER/entry.sh
    ```
5. In the `entry.sh` file change `Workspace` to `YOUR_NEWLY_CREATED_FOLDER`.
 
### How to use with iTerm:

1. Open iTerm.
2. Open Preferences (⌘,)
3. Open Profiles tab.
4. Under the `Command` header click on `Command` and insert the following:
    ```bash
    /bin/bash -l
    ```
5. In the `Send text at start` insert the following line:
    ```bash
    source ~/.bashrc && printf "\033c"
    ```
6. Restart iTerm.
    
### Contacts

For details ask [Victor Klynets](slack://user?team=T03H728KN&id=U3T5U57CN).
