This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [user] | |
| email = [email protected] | |
| name = Natan | |
| [color] | |
| ui = true | |
| [alias] | |
| co = checkout | |
| ci = commit | |
| st = status |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| GIT_PS1_SHOWDIRTYSTATE=true | |
| export PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w\[\033[31m\]$(__git_ps1)\[\033[00m\]\[\033[01;34m\] \$\[\033[00m\] ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/id_rsa | |
| ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/github_rsa | |
| ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/mozilla_rsa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Login to database | |
| sudo -u postgres psql | |
| # Creating user | |
| sudo -u postgres createuser <username> | |
| # Creating Database | |
| sudo -u postgres createdb <dbname> | |
| # Giving the user a password |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Переменная для сохранения строки с датой | |
| BACKUP_DATE=`date +%Y-%m-%d__%H:%M:%S` | |
| # Префикс, или, говоря иначе, начало имени файла | |
| BACKUP_PREFIX="prod_db" | |
| # Количество копий, которое нужно сохранять | |
| MAX_COPIES_COUNTER=5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Получение доступа к базе данных | |
| DB_DATABASE=table | |
| DB_USERNAME=user | |
| DB_PASSWORD=password | |
| # Переменная для сохранения строки с датой | |
| BACKUP_DATE=`date +%Y-%m-%d__%H:%M:%S` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Install GitLens | |
| // Ctrl + P | |
| // ext install eamodio.gitlens | |
| // https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens | |
| { | |
| "editor.fontSize": 16, | |
| "editor.renderWhitespace": "all", | |
| "editor.multiCursorModifier": "ctrlCmd", | |
| "editor.wordWrap": "on", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| image: rastasheep/ubuntu-sshd:18.04 | |
| stages: | |
| - deploy | |
| deploy_prod: | |
| stage: deploy | |
| before_script: | |
| - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' | |
| - mkdir -p ~/.ssh | |
| - chmod 700 ~/.ssh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| stages: | |
| - test | |
| - build | |
| - deploy | |
| test: | |
| stage: test | |
| script: echo "Running tests" | |
| tags: | |
| - lab |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # sudo nano /etc/systemd/system/docker-app.service | |
| # sudo systemctl daemon-reload | |
| # sudo systemctl status docker-app | |
| [Unit] | |
| Description=Docker Compose App | |
| Requires=docker.service | |
| After=docker.service | |
| [Service] | |
| Restart=always |