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
| #!/usr/bin/php | |
| <?php | |
| ## SETUP | |
| $isPhpCsPass = false; | |
| $isPhpMdPass = false; | |
| $isPhpUnitPass = false; | |
| ## PHPCS |
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
| Promise = require('bluebird') | |
| var A = function() { | |
| return new Promise(function(resolve, reject) { | |
| var result = 'A is done' | |
| console.log(result) | |
| resolve(result); | |
| }) |
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
| Hi guys. Recently I had a situation when a certain directory had a few more sub-directories, and | |
| I needed to perform an identical list of actions for each of those sub-directories and doing that | |
| manually by changing the current directory and repeatedly executing same commands was quite annoying | |
| so I decided to spend half an hour and create a bash script for that purpose. | |
| A particular example of the situation I had was having several virtual machines located accordingly | |
| in ~/Boxes/serverOne ~/Boxes/serverTwo ~/Boxes/serverThree (I was testing ansible and was recreating and destroying vms). | |
| This script asks for the confirmation as well. |
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 | |
| if [ -z "$1" ] | |
| then | |
| echo "No destination path is given" | |
| exit 1 | |
| fi | |
| if [ -z "$2" ] | |
| then |
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
| from __future__ import with_statement | |
| from fabric.api import local, env, settings, abort, run, cd | |
| from fabric.contrib.console import confirm | |
| import time | |
| # Please create this directory on your production server | |
| code_dir='/var/www/deploy-stage' | |
| # Please make sure this directory exists and contains uploaded files | |
| # most of the cases it is a good idea to keep your uploads apart from your source code |
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
| <!doctype html> | |
| <html> | |
| <head> | |
| <meta charset=utf-8> | |
| <title></title> | |
| <link rel="stylehsheet" href=""> | |
| </head> | |
| <body> | |
| </body> |
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
| To be able to use Fabric for deploy you must have some things done: | |
| - you need to be able to ssh to the server where the deployemnt is meant to be done. | |
| - your Python version should match a certain required one | |
| - you must have `pip` installed | |
| - you must have `virtualenv` installed | |
| - you must have `fabric` installed inside your virtual environment (please read about virtual env below) | |
| Note about SSH: Basically Fabric uses ssh to connect to the sever so before you even | |
| start with Fabbric please make sure your computer (user) public key is added to the | |
| server's authorized hosts and you are able to ssh to the server without prompting |
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
| Following these instructions you would get three virtual machines , whereas one would be a server (ansible machine) | |
| from where ansible would install software into two remaining virtual machines (destination servers). | |
| Prerequsets (installed on a host machine): | |
| - virtual box | |
| - vagrant | |
| List of software which will be installed on the destination servers (basic list, some dependencies will be installed as well): | |
| - git |
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
| ----- Esc ----- | |
| Quick change directory: Esc + c | |
| Quick change directory history: Esc + c and then Esc + h | |
| Quick change directory previous entry: Esc + c and then Esc + p | |
| Command line history: Esc + h | |
| Command line previous command: Esc + p | |
| View change: Esc + t (each time you do this shortcut a new directory view will appear) | |
| Print current working directory in command line: Esc + a | |
| Switch between background command line and MC: Ctrl + o | |
| Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <project name="Composer Targets" default="build"> | |
| <property name="builddir" value="${basedir}/build"/> | |
| <property name="composer" value="${builddir}/composer.phar"/> | |
| <target name="php-check"> | |
| <condition property="php" value="php"> | |
| <not> | |
| <isset property="${php}"/> |