This file contains 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 | |
# | |
# Default settings block, change here if you need or put other defaults to your .bashrc | |
# | |
DSFC_USER="${DSFC_USER:-root}" # defaults to root | |
DSFC_HOSTS_GREP="${DSFC_HOSTS_GREP:-"swarm-"}" # what to grep in /etc/hosts | |
DSFC_HOSTS_LIST="${DSFC_HOSTS_LIST:-`(cat /etc/hosts | grep ${DSFC_HOSTS_GREP} | cut -f1 | xargs -L1 echo | uniq)`}" # change the default inside backticks to your way to get hosts list | |
DSFC_METHOD_SSH="${DSFC_METHOD_SSH:-1}" # whether to use the ssh and docker ps method |
This file contains 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 | |
# Build or use cached image and tag with "local/local/ubuntu_pdftk", suppress output | |
# to maintain compatibility in case you are parsing the pdftk output. | |
# It will build the image if it's absent or use the cached one. | |
echo "FROM ubuntu:16.04 | |
RUN apt-get update && \ | |
apt-get install -y pdftk && \ | |
rm -rf /var/lib/apt/lists/*" | docker build -t local/local/ubuntu_pdftk - 2>&1 > /dev/null |
This file contains 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 | |
usage="Input piped docker-compose logs -t, or a file created from this command, to show logs lines sorted by time.\n\n Usage:\n\n $(basename "$0") [-h|--help] - this message\n $(basename "$0") - runs default docker-compose logs -t and sorts'em\n docker-compose logs -t|$(basename "$0") - pipe logs to this command\n $(basename "$0") my-compose.log - or choose file with logs to display\n\n" | |
[ $# -ge 1 -a -f "$1" ] && input="$1" || input="-" | |
case "$1" in | |
-h|--help) printf "$usage" | |
exit | |
;; | |
esac | |
if [ -t 0 ]; then | |
docker-compose logs -t|sort -t "|" -k +2d |
This file contains 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
<?php | |
/** | |
* Created by IntelliJ IDEA. | |
* User: sheershoff | |
* Date: 11/23/15 | |
* Time: 9:59 PM | |
*/ | |
namespace generic\namespace; // use whatever you need to include in your migrations | |
use Yii; |
This file contains 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
<?php | |
$i = 0; | |
$in = []; | |
$state['inDocSection'] = false; | |
function cmpget($l,$key){ | |
if(strncmp($l,$key,strlen($key))!==false){ | |
$v = substr($l,strlen($key)); |
This file contains 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
<?php | |
namespace common\helpers; | |
class ArrayHelper extends \yii\helpers\ArrayHelper | |
{ | |
public static function multiSearch($needle, $haystack, $options = ['strict' => false, 'yiiFormat' => false]) | |
{ | |
$iterator = new \RecursiveIteratorIterator(new \RecursiveArrayIterator([$haystack])); | |
// parent array is skipped in subiterators, so we wrap the argument in one more array | |
$results = []; |