ンンンン ン

ンンンン ン

#!/usr/bin/env bash

. "test/testlib.sh"

begin_test "prune"
(
  set -e

  reponame="$(basename "$0" ".sh")"
  setup_remote_repo "$reponame"

  clone_repo "$reponame" repo

  git lfs track "*.dat" 2>&1 | tee track.log
  grep "Tracking \*.dat" track.log

  # generate content we'll use
  content_unreferenced="To delete: unreferenced"
  content_oldandpushed="To delete: pushed and too old"
  content_oldandunchanged="Keep: pushed and created a while ago, but still current"
  content_keepunpushed="Keep: unpushed"
  content_keepunpushedtagged="Keep: unpushed tagged only"
  content_keephead="Keep: HEAD"
  content_keeprecentbranch="Keep: Recent branch"
  content_keeprecentcommithead="Keep: Recent commit on HEAD"
  content_keeprecentcommitbranch="Keep: Recent commit on recent branch"
  content_keepmergedrecent="Keep: merged secondary branch that's recent"
  content_keepmergedunpushed="Keep: merged secondary branch that's not pushed"
  oid_unreferenced=$(calc_oid "$content_unreferenced")
  oid_oldandpushed=$(calc_oid "$content_oldandpushed")
  oid_oldandunchanged=$(calc_oid "$content_oldandunchanged")
  oid_keepunpushed=$(calc_oid "$content_keepunpushed")
  oid_keepunpushedtagged=$(calc_oid "$content_keepunpushedtagged")
  oid_keephead=$(calc_oid "$content_keephead")
  oid_keeprecentbranch=$(calc_oid "$content_keeprecentbranch")
  oid_keeprecentcommithead=$(calc_oid "$content_keeprecentcommithead")
  oid_keeprecentcommitbranch=$(calc_oid "$content_keeprecentcommitbranch")
  oid_keepmergedrecent=$(calc_oid "$content_keepmergedrecent")
  oid_keepmergedunpushed=$(calc_oid "$content_keepmergedunpushed")

  echo "[
  {
    \"CommitDate\":\"$(get_date -7d)\",
    \"Files\":[
      {\"Filename\":\"file1.dat\",\"Size\":${#content_oldandpushed}, \"Data\":\"$content_oldandpushed\"},
      {\"Filename\":\"file2.dat\",\"Size\":${#content_oldandunchanged}, \"Data\":\"$content_oldandunchanged\"}]
  },
  {
    \"CommitDate\":\"$(get_date -7d)\",
    \"NewBranch\":\"branch_to_delete\",
    \"Files\":[
      {\"Filename\":\"file1.dat\",\"Size\":${#content_unreferenced}, \"Data\":\"$content_unreferenced\"}]
  },
  {
    \"CommitDate\":\"$(get_date -7d)\",
    \"ParentBranches\":[\"master\"],
    \"NewBranch\":\"branch_to_delete_tagged\",
    \"Tags\":[\"retain_tag\"],
    \"Files\":[
      {\"Filename\":\"file1.dat\",\"Size\":${#content_keepunpushedtagged}, \"Data\":\"$content_keepunpushedtagged\"}]
  },
  {
    \"CommitDate\":\"$(get_date -6d)\",
    \"ParentBranches\":[\"master\"],
    \"NewBranch\":\"merge_branch_unpushed\",
    \"Files\":[
      {\"Filename\":\"file1.dat\",\"Size\":${#content_keepmergedunpushed}, \"Data\":\"$content_keepmergedunpushed\"}]
  },
  {
    \"CommitDate\":\"$(get_date -3d)\",
    \"ParentBranches\":[\"master\"],
    \"NewBranch\":\"merge_branch_recent\",
    \"Files\":[
      {\"Filename\":\"file4.dat\",\"Size\":${#content_keepmergedrecent}, \"Data\":\"$content_keepmergedrecent\"}]
  },
  {
    \"CommitDate\":\"$(get_date -6d)\",
    \"ParentBranches\":[\"master\"],
    \"NewBranch\":\"branch_unpushed\",
    \"Files\":[
      {\"Filename\":\"file3.dat\",\"Size\":${#content_keepunpushedother}, \"Data\":\"$content_keepunpushedother\"}]
  },
  {
    \"CommitDate\":\"$(get_date -6d)\",
    \"ParentBranches\":[\"branch_unpushed\", \"merge_branch_unpushed\"]
  },
  {
    \"CommitDate\":\"$(get_date -4d)\",
    \"ParentBranches\":[\"master\"],
    \"NewBranch\":\"branch_recent\",
    \"Files\":[
      {\"Filename\":\"file5.dat\",\"Size\":${#content_keeprecentcommitbranch}, \"Data\":\"$content_keeprecentcommitbranch\"}]
  },
  {
    \"CommitDate\":\"$(get_date -2d)\",
    \"Files\":[
      {\"Filename\":\"file5.dat\",\"Size\":${#content_keeprecentbranch}, \"Data\":\"$content_keeprecentbranch\"}]
  },
  {
    \"CommitDate\":\"$(get_date -4d)\",
    \"ParentBranches\":[\"master\"],
    \"Files\":[
      {\"Filename\":\"file1.dat\",\"Size\":${#content_keeprecentcommithead}, \"Data\":\"$content_keeprecentcommithead\"}]
  },
  {
    \"CommitDate\":\"$(get_date -2d)\",
    \"ParentBranches\":[\"master\", \"merge_branch_recent\"]
  },
  {
    \"CommitDate\":\"$(get_date -1d)\",
    \"Files\":[
      {\"Filename\":\"file1.dat\",\"Size\":${#content_keephead}, \"Data\":\"$content_keephead\"}]
  }
  ]" | lfstest-testutils addcommits

  # delete temporary branches
  git branch -D branch_to_delete
  git branch -D branch_to_delete_tagged
  git branch -D merge_branch_unpushed
  git branch -D merge_branch_recent

  # only push master
  git push origin master

  # now create another commit on master that is unpushed
  echo "[
  {
    \"CommitDate\":\"$(get_date -0d)\",
    \"Files\":[
      {\"Filename\":\"file1.dat\",\"Size\":${#content_keephead}, \"Data\":\"$content_keephead\"}]
  }
  ]" | lfstest-testutils addcommits

  git config lfs.fetchrecentrefsdays 5
  git config lfs.fetchrecentremoterefs true
  git config lfs.fetchrecentcommitsdays 3
  git config lfs.pruneoffset 2

)
end_test

begin_test "prune unpushed HEAD"
(
    # old commits on HEAD but latest few are not pushed so keep those
    # even changes pre-HEAD
)
end_test

begin_test "prune worktree"
(
    # old commits on HEAD but latest few are not pushed so keep those
    # even changes pre-HEAD
)
end_test

begin_test "prune no remote"
(
)
end_test

begin_test "prune specify remote"
(
)
end_test

error: pathspec 'test/test-prune.sh' did not match any file(s) known to git


Create netcore3.0.sh

Create netcore3.0.sh

#!/bin/bash -e
ARG REPO=mcr.microsoft.com/dotnet/core/runtime-deps
# Install .NET Core
ENV DOTNET_VERSION 3.0.3
 curl -SL --output dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Runtime/$DOTNET_VERSION/dotnet-runtime-$DOTNET_VERSION-linux-x64.tar.gz \
    && dotnet_sha512='3d1f0ba2f293f43e087a8940a0f4736561f43b9f28bc5beda79a61f887e258543aea4dc71e88414a7c6e271dcda984a989afb62fc659a72223707a179cdde9c5' \
    && echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \
    && mkdir -p /usr/share/dotnet \
    && tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
    && rm dotnet.tar.gz \
    && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet

error: pathspec 'netcore3.0.sh' did not match any file(s) known to git


Added missing script

Added missing script

#!/bin/bash
##
## @(#) Test028 - Trnsactional Message Queue tests static driver, for documentation
##
## @file run.sh
##
## -----------------------------------------------------------------------------
## Enduro/X Middleware Platform for Distributed Transaction Processing
## Copyright (C) 2015, ATR Baltic, SIA. All Rights Reserved.
## This software is released under one of the following licenses:
## GPL or ATR Baltic's license for commercial use.
## -----------------------------------------------------------------------------
## GPL license:
##
## This program is free software; you can redistribute it and/or modify it under
## the terms of the GNU General Public License as published by the Free Software
## Foundation; either version 2 of the License, or (at your option) any later
## version.
##
## This program is distributed in the hope that it will be useful, but WITHOUT ANY
## WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
## PARTICULAR PURPOSE. See the GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License along with
## this program; if not, write to the Free Software Foundation, Inc., 59 Temple
## Place, Suite 330, Boston, MA 02111-1307 USA
##
## -----------------------------------------------------------------------------
## A commercial use license is available from ATR Baltic, SIA
## contact@atrbaltic.com
## -----------------------------------------------------------------------------
##

export TESTNO="028"
export TESTNAME_SHORT="tmq"
export TESTNAME="test${TESTNO}_${TESTNAME_SHORT}"

PWD=`pwd`
if [ `echo $PWD | grep $TESTNAME ` ]; then
        # Do nothing
        echo > /dev/null
else
        # started from parent folder
        pushd .
        echo "Doing cd"
        cd $TESTNAME
fi;

#
# Dynamic tests
#
echo "Dynamic XA driver tests..."
export NDRX_XA_DRIVERLIB_FILENAME=libndrxxaqdisks.so

if [ "$(uname)" == "Darwin" ]; then
	export NDRX_XA_DRIVERLIB_FILENAME=libndrxxaqdisks.dylib
fi

. ../testenv.sh

export TESTDIR="$NDRX_APPHOME/atmitest/$TESTNAME"
export PATH=$PATH:$TESTDIR
# Override timeout!
export NDRX_TOUT=90

#
# Domain 1 - here client will live
#
function set_dom1 {
    echo "Setting domain 1"
    . ../dom1.sh
    export NDRX_CONFIG=$TESTDIR/ndrxconfig-dom1.xml
    export NDRX_DMNLOG=$TESTDIR/ndrxd-dom1.log
    export NDRX_LOG=$TESTDIR/ndrx-dom1.log
    export NDRX_DEBUG_CONF=$TESTDIR/debug-bench.conf

# XA config, mandatory for TMQ:
    export NDRX_XA_RES_ID=1
    export NDRX_XA_OPEN_STR="./QSPACE1"
    export NDRX_XA_CLOSE_STR=$NDRX_XA_OPEN_STR
# Used from parent
    export NDRX_XA_DRIVERLIB=$NDRX_XA_DRIVERLIB_FILENAME

    export NDRX_XA_RMLIB=libndrxxaqdisk.so
if [ "$(uname)" == "Darwin" ]; then
    export NDRX_XA_RMLIB=libndrxxaqdisk.dylib
fi
    export NDRX_XA_LAZY_INIT=0
}

#
# Generic exit function
#
function go_out {
    echo "Test exiting with: $1"

    set_dom1;
    xadmin stop -y
    xadmin down -y

    # If some alive stuff left...
    xadmin killall atmiclt28

    popd 2>/dev/null
    exit $1
}

function clean_logs {

    # clean-up the logs for debbuging at the error.
    for f in `ls *.log`; do
         echo > $f
    done

}
#
# Test Q space for empty condition
#
function test_empty_qspace {
	echo "Testing Qspace empty"

	COUNT=`find ./QSPACE1 -type f | wc | awk '{print $1}'`

	if [[ "X$COUNT" != "X0" ]]; then
		echo "QSPACE1 MUST BE EMPTY AFTER TEST!!!!"
		go_out 2
	fi

    clean_logs;
}

rm *dom*.log

# Where to store TM logs
rm -rf ./RM1
mkdir RM1

# Where to store Q messages (QSPACE1)
rm -rf ./QSPACE1
mkdir QSPACE1

cp q.conf.tpl q.conf

set_dom1;
xadmin stop -y
xadmin start -y || go_out 1

# Go to domain 1
set_dom1;

# Run the client test...
xadmin psc
xadmin psvc
xadmin ppm

set | grep NDRX

echo "Running: Benchmark"
(./atmiclt28 basic 2>&1) > ./atmiclt-dom1.log
RET=$?

if [[ "X$RET" != "X0" ]]; then
    go_out $RET
fi

go_out $RET

error: pathspec 'atmitest/test028_tmq/run-doc-bench-05.sh' did not match any file(s) known to git


pyvenv and source dir initialization implemented

#!/bin/bash

PYTHON_VER=3
DJANGO_VER=
GIT_REMOTE=
VENV_DIR="pyvenv"
SOURCE_DIR="source"

if [ -t 1 ]
then
  function message() {
    if [ "$1" == "-g" ]
    then
      shift
      color=32
    else
      color=33
    fi

    printf "\033[0;${color}m$*\033[0m\n"
  }
else
  function message() {
    [ "$1" == "-g" ] && shift

    echo "$*"
  }
fi

function print_help {
  PROGRAM_NAME=`basename "$0"`
  echo "Usage: $PROGRAM_NAME PROJECT"
  echo
  echo "  -2   use python 2"
  echo "  -3   use python 3 (default)"
  echo "  -g   clone specified git repo instead of initializing a new one"
  echo "  -h   show this help"
  echo
  echo "  PROJECT specifies the project name. New directory with that name"
  echo "  will be created and the project will be initialized in this directory."
  echo
}

#################
# parse options #
#################

while getopts "23d:g:h" opt
do
  case "$opt" in
    2)
      PYTHON_VER=2
      ;;
    3)
      PYTHON_VER=3
      ;;
    d)
      DJANGO_VER="$OPTARG"
      ;;
    g)
      GIT_REMOTE="$OPTARG"
      ;;
    h)
      print_help;
      ;;
    \?)
      echo "Unknown option: -$OPTARG" >&2
      exit 1
      ;;
  esac
done

shift $(( $OPTIND - 1 ))

# parse project name

PROJECT="$1"
shift

if [[ -z "$PROJECT" ]]
then
  echo "No project name specified"  >&2
  exit 1
fi

if [[ ! "$PROJECT" =~ ^[a-zA-Z0-9_-]+$ ]]
then
  echo "Project name can contain only letters, numbers, dash and underscore." >&2
  exit 1
fi

################################
# create the project structure #
################################

message "creating project $PROJECT"

set -e

PYTHON_BIN=`which python$PYTHON_VER`
if [[ "$PYTHON_VER" == "3" ]]
then
  VENV_CREATE="$PYTHON_BIN -m venv"
else
  VENV_CREATE="virtualenv"
fi

# create project dir
mkdir "$PROJECT"
cd "$PROJECT"

# init python virtual environment
$VENV_CREATE "$VENV_DIR"

if [[ -n "$GIT_REMOTE" ]]
then
  # clone git repo
  message "cloning repository"
  git clone "$GIT_REMOTE" "$SOURCE_DIR"
else
  # activate venv and install django
  message "installing django"
  . "$VENV_DIR/bin/activate"
  pip install "django$DJANGO_VER"

  message "creating new django project"
  mkdir "$SOURCE_DIR"
  django-admin startproject "${PROJECT//-/_}" "$SOURCE_DIR"
  cd "$SOURCE_DIR"
  cat > .gitignore <<HEREDOC
*.pyc
__pycache__/
**/LC_MESSAGES/*.mo
HEREDOC
  git init
  git add .
  git commit -m "initialized empty django project"
fi

message -g "new project $PROJECT initialized succesfully"


Add route53 utility

Add route53 utility

#!/bin/bash
fail() {
  echo $1
  exit 1
}
if [ -z "$1" -o -z "$2" -o -z "$3"]; then
  fail "Usage: $0 zone record.name ip.address"
else
  ZONE_NAME=$1
  NAME=$2
  IP=$3
fi

if ! ZONE_ID=$(aws route53 list-hosted-zones | jq -e -r ".HostedZones[]|select(.Name==\"${ZONE_NAME}\").Id"); then
  fail "Did not find requested zone"
fi
if ! CHANGE_ID=$(aws route53 change-resource-record-sets --hosted-zone-id $ZONE_ID --cli-input-json "{\"HostedZoneId\":\"$ZONE_ID\",\"ChangeBatch\":
{\"Changes\":[{\"Action\":\"UPSERT\",\"ResourceRecordSet\":{\"Name\":\"$NAME\",
\"Type\":\"A\",\"TTL\":300,\"ResourceRecords\":[{\"Value\":\"$IP\"}]}}]}}" | jq -e -r ".ChangeInfo.Id"); then
  fail "Failed to upsert DNS record"
fi
COUNT=0
while [ $COUNT -lt 180 ] && [ "$STATUS" != "INSYNC" ]; do
  sleep 1
  STATUS=$(aws route53 get-change --id "$CHANGE_ID" | jq  -r ".ChangeInfo.Status")
  COUNT=$((COUNT + 1))
done
if [ "$STATUS" != "INSYNC" ]; then
  fail "Failed to update private ip into DNS"
fi

error: pathspec 'usr/bin/update-dns-record.sh' did not match any file(s) known to git


add upload pypi script

add upload pypi script

#!/usr/bin/env bash
python3 setup.py sdist bdist_wheel
twine upload dist/*

error: pathspec 'etk/upload_pypi.sh' did not match any file(s) known to git


added a seek unit test

added a seek unit test

#!/bin/bash

fail() {
   echo "ERROR - " $@
   exit 1
}

test -d tmp || mkdir tmp

for round in $(seq 1 1 2)
do
   echo -n " o"
   SEED=$RANDOM # bashism
   $@ -n 20 -o tmp/test-1-$$-%n -s $SEED *.*  # make 1-20, or 20 after --seek 0
   $@ -n 10 -o tmp/test-2-$$-%n -s $SEED *.*  # make 1-10
   $@ -n 10 --seek 10 -o tmp/test-2-$$-%n -s $SEED *.* # make 11-20 (10 after 10)
   FIRST=`cat tmp/test-1-$$* | md5sum`
   SECOND=`cat tmp/test-2-$$* | md5sum`
   test "$FIRST" = "$SECOND" || fail "sums differ $FIRST $SECOND seed $SEED"
done

error: pathspec 'tests/seek.sh' did not match any file(s) known to git


Update latest released version property only for non-SNAPSHOT versions

#!/bin/bash
set -e
# Update the version for for all droolsjbpm repositories

initializeWorkingDirAndScriptDir() {
    # Set working directory and remove all symbolic links
    workingDir=`pwd -P`

    # Go the script directory
    cd `dirname $0`
    # If the file itself is a symbolic link (ignoring parent directory links), then follow that link recursively
    # Note that scriptDir=`pwd -P` does not do that and cannot cope with a link directly to the file
    scriptFileBasename=`basename $0`
    while [ -L "$scriptFileBasename" ] ; do
        scriptFileBasename=`readlink $scriptFileBasename` # Follow the link
        cd `dirname $scriptFileBasename`
        scriptFileBasename=`basename $scriptFileBasename`
    done
    # Set script directory and remove other symbolic links (parent directory links)
    scriptDir=`pwd -P`
}

updateParentVersion() {
    mvn -B -N -s $scriptDir/update-version-all-settings.xml versions:update-parent -Dfull\
     -DparentVersion=[$newVersion] -DallowSnapshots=true -DgenerateBackupPoms=false
}

updateChildModulesVersion() {
    mvn -B -s $scriptDir/update-version-all-settings.xml versions:update-child-modules -Dfull\
     -DallowSnapshots=true -DgenerateBackupPoms=false
}

# Updates parent version and child modules versions for Maven project in current working dir
updateParentAndChildVersions() {
    # install the current version first (usually SNAPSHOT) as it is then needed later on when updating child modules
    mvn -B clean install -N
    updateParentVersion
    updateChildModulesVersion
}

initializeWorkingDirAndScriptDir
droolsjbpmOrganizationDir="$scriptDir/../../.."

if [ $# != 1 ]; then
    echo
    echo "Usage:"
    echo "  $0 releaseNewVersion"
    echo "For example:"
    echo "  $0 6.3.0.Final"
    echo
    exit 1
fi

newVersion=$1
echo "New version is $newVersion"

startDateTime=`date +%s`

cd $droolsjbpmOrganizationDir

for repository in `cat ${scriptDir}/../repository-list.txt` ; do
    echo

    if [ ! -d $droolsjbpmOrganizationDir/$repository ]; then
        echo "==============================================================================="
        echo "Missing Repository: $repository. SKIPPING!"
        echo "==============================================================================="
    else
        echo "==============================================================================="
        echo "Repository: $repository"
        echo "==============================================================================="
        cd $repository
        if [ $repository == 'droolsjbpm-build-bootstrap' ]; then
            # first build&install the current version (usually SNAPSHOT) as it is needed later by other repos
            mvn -B -Dfull clean install
            mvn -B -Dfull versions:set -DnewVersion=$newVersion -DallowSnapshots=true -DgenerateBackupPoms=false
            sed -i "s/<version\.org\.kie>.*<\/version.org.kie>/<version.org.kie>$newVersion<\/version.org.kie>/" pom.xml
            # update latest released version property only for non-SNAPSHOT versions
            if [[ ! $newVersion == *-SNAPSHOT ]]; then
                sed -i "s/<latestReleasedVersionFromThisBranch>.*<\/latestReleasedVersionFromThisBranch>/<latestReleasedVersionFromThisBranch>$newVersion<\/latestReleasedVersionFromThisBranch>/" pom.xml
            fi
            # workaround for http://jira.codehaus.org/browse/MVERSIONS-161
            mvn -B clean install -DskipTests
            returnCode=$?

        elif [ $repository = 'jbpm' ]; then
            updateParentAndChildVersions
            returnCode=$?
            sed -i "s/release.version=.*$/release.version=$newVersion/" jbpm-installer/build.properties

        elif [ $repository = 'droolsjbpm-tools' ]; then
            cd drools-eclipse
            mvn -B -Dfull tycho-versions:set-version -DnewVersion=$newVersion
            returnCode=$?
            # replace the leftovers not covered by the tycho plugin (bug?)
            # SNAPSHOT and release versions need to be handled differently
            versionToUse=$newVersion
            if [[ $newVersion == *-SNAPSHOT ]]; then
                versionToUse=`sed "s/-SNAPSHOT/.qualifier/" <<< $newVersion`
            fi
            sed -i "s/source_[^\"]*/source_$versionToUse/" org.drools.updatesite/category.xml
            sed -i "s/version=\"[0-9\.]*qualifier\"/version=\"$versionToUse\"/" org.drools.updatesite/category.xml
            cd ..
            if [ $returnCode == 0 ]; then
                mvn -B clean install -N
                updateParentVersion
                # workaround for http://jira.codehaus.org/browse/MVERSIONS-161
                mvn -B clean install -N -DskipTests
                cd drools-eclipse
                updateParentVersion
                cd ..
                updateChildModulesVersion
                returnCode=$?
            fi

        else
            updateParentAndChildVersions
            returnCode=$?
        fi

        if [ $returnCode != 0 ] ; then
            exit $returnCode
        fi

        cd ..
    fi
done

endDateTime=`date +%s`
spentSeconds=`expr $endDateTime - $startDateTime`

echo
echo "Total time: ${spentSeconds}s"

#!/bin/bash
set -e
# Update the version for for all droolsjbpm repositories

initializeWorkingDirAndScriptDir() {
    # Set working directory and remove all symbolic links
    workingDir=`pwd -P`

    # Go the script directory
    cd `dirname $0`
    # If the file itself is a symbolic link (ignoring parent directory links), then follow that link recursively
    # Note that scriptDir=`pwd -P` does not do that and cannot cope with a link directly to the file
    scriptFileBasename=`basename $0`
    while [ -L "$scriptFileBasename" ] ; do
        scriptFileBasename=`readlink $scriptFileBasename` # Follow the link
        cd `dirname $scriptFileBasename`
        scriptFileBasename=`basename $scriptFileBasename`
    done
    # Set script directory and remove other symbolic links (parent directory links)
    scriptDir=`pwd -P`
}

updateParentVersion() {
    mvn -B -N -s $scriptDir/update-version-all-settings.xml versions:update-parent -Dfull\
     -DparentVersion=[$newVersion] -DallowSnapshots=true -DgenerateBackupPoms=false
}

updateChildModulesVersion() {
    mvn -B -s $scriptDir/update-version-all-settings.xml versions:update-child-modules -Dfull\
     -DallowSnapshots=true -DgenerateBackupPoms=false
}

# Updates parent version and child modules versions for Maven project in current working dir
updateParentAndChildVersions() {
    # install the current version first (usually SNAPSHOT) as it is then needed later on when updating child modules
    mvn -B clean install -N
    updateParentVersion
    updateChildModulesVersion
}

initializeWorkingDirAndScriptDir
droolsjbpmOrganizationDir="$scriptDir/../../.."

if [ $# != 1 ]; then
    echo
    echo "Usage:"
    echo "  $0 releaseNewVersion"
    echo "For example:"
    echo "  $0 6.3.0.Final"
    echo
    exit 1
fi

newVersion=$1
echo "New version is $newVersion"

startDateTime=`date +%s`

cd $droolsjbpmOrganizationDir

for repository in `cat ${scriptDir}/../repository-list.txt` ; do
    echo

    if [ ! -d $droolsjbpmOrganizationDir/$repository ]; then
        echo "==============================================================================="
        echo "Missing Repository: $repository. SKIPPING!"
        echo "==============================================================================="
    else
        echo "==============================================================================="
        echo "Repository: $repository"
        echo "==============================================================================="
        cd $repository
        if [ $repository == 'droolsjbpm-build-bootstrap' ]; then
            # first build&install the current version (usually SNAPSHOT) as it is needed later by other repos
            mvn -B -Dfull clean install
            mvn -B -Dfull versions:set -DnewVersion=$newVersion -DallowSnapshots=true -DgenerateBackupPoms=false
            sed -i "s/<version\.org\.kie>.*<\/version.org.kie>/<version.org.kie>$newVersion<\/version.org.kie>/" pom.xml
            sed -i "s/<latestReleasedVersionFromThisBranch>.*<\/latestReleasedVersionFromThisBranch>/<latestReleasedVersionFromThisBranch>$newVersion<\/latestReleasedVersionFromThisBranch>/" pom.xml
            # workaround for http://jira.codehaus.org/browse/MVERSIONS-161
            mvn -B clean install -DskipTests
            returnCode=$?

        elif [ $repository = 'jbpm' ]; then
            updateParentAndChildVersions
            returnCode=$?
            sed -i "s/release.version=.*$/release.version=$newVersion/" jbpm-installer/build.properties

        elif [ $repository = 'droolsjbpm-tools' ]; then
            cd drools-eclipse
            mvn -B -Dfull tycho-versions:set-version -DnewVersion=$newVersion
            returnCode=$?
            # replace the leftovers not covered by the tycho plugin (bug?)
            # SNAPSHOT and release versions need to be handled differently
            versionToUse=$newVersion
            if [[ $newVersion == *-SNAPSHOT ]]; then
                versionToUse=`sed "s/-SNAPSHOT/.qualifier/" <<< $newVersion`
            fi
            sed -i "s/source_[^\"]*/source_$versionToUse/" org.drools.updatesite/category.xml
            sed -i "s/version=\"[0-9\.]*qualifier\"/version=\"$versionToUse\"/" org.drools.updatesite/category.xml
            cd ..
            if [ $returnCode == 0 ]; then
                mvn -B clean install -N
                updateParentVersion
                # workaround for http://jira.codehaus.org/browse/MVERSIONS-161
                mvn -B clean install -N -DskipTests
                cd drools-eclipse
                updateParentVersion
                cd ..
                updateChildModulesVersion
                returnCode=$?
            fi

        else
            updateParentAndChildVersions
            returnCode=$?
        fi

        if [ $returnCode != 0 ] ; then
            exit $returnCode
        fi

        cd ..
    fi
done

endDateTime=`date +%s`
spentSeconds=`expr $endDateTime - $startDateTime`

echo
echo "Total time: ${spentSeconds}s"


Start UI tests in background

Start UI tests in background

fatal: remote error: upload-pack: not our ref 227a06275d2e294adb6eae6c7452b46e848e08ad
fatal: the remote end hung up unexpectedly


Add explicit test script

Add explicit test script

#!/bin/bash

HKEYDIR="hkeyvolume"
CKEYDIR=/opt/dnscrypt-wrapper/etc/keys

echo "-> Build dnscrypt-wrapper"
docker build -t dnscryptio/dnscrypt-wrapper .

echo "-> Run bind"
docker run -d --name bind dnscryptio/bind
BINDIP=$(docker inspect -f '{{ .NetworkSettings.IPAddress }}' bind)
echo "-> BIND is running on $BINDIP"

echo "-> Run dnscrypt-wrapper --version"
docker run --interactive --tty --rm dnscryptio/dnscrypt-wrapper --version

echo "-> Generate and get provider keypair"
docker run --interactive --tty --rm --volume $HKEYDIR:$CKEYDIR -w $CKEYDIR dnscryptio/dnscrypt-wrapper --gen-provider-keypair | tee /tmp/gen-provider-keypair.log
cat /tmp/gen-provider-keypair.log
PUBLIC_KEYPAIR_FINGERPRINT=$(egrep 'Provider public key: ' /tmp/gen-provider-keypair.log | sed 's/Provider public key: //')

echo "-> Generate service keypair"
docker run --interactive --tty --rm --volume $HKEYDIR:$CKEYDIR -w $CKEYDIR dnscryptio/dnscrypt-wrapper --gen-crypt-keypair

echo "-> Generate cert"
docker run --interactive --tty --rm --volume $HKEYDIR:$CKEYDIR -w $CKEYDIR dnscryptio/dnscrypt-wrapper --gen-cert-file

echo "-> Run and detach dnscrypt-wrapper"
docker run --volume $HKEYDIR:$CKEYDIR -w $CKEYDIR --expose=4443 --name=wrapper --detach dnscryptio/dnscrypt-wrapper --listen-address=0.0.0.0:4443 --resolver-address=$BINDIP:53 --provider-name=2.dnscrypt-cert.test.dnscrypt.io --provider-cert-file=$CKEYDIR/dnscrypt.cert --crypt-secretkey-file=$CKEYDIR/crypt_secret.key

echo "-> Test for running dnscrypt-wrapper and show logs"
sleep 10; docker ps | grep dnscrypt-wrapper
docker logs --details -t wrapper

WRAPPERIP=$(docker inspect -f '{{ .NetworkSettings.IPAddress }}' wrapper)
echo "-> dnscrypt-wrapper is running on IP $WRAPPERIP"
echo "-> Provider key: $PUBLIC_KEYPAIR_FINGERPRINT"
echo "-> Run and detach dnscrypt-proxy, show logs"
docker run --detach --name=proxy -e RESOLVER_ADDR=$WRAPPERIP:4443 -e PROVIDER_NAME=2.dnscrypt-cert.test.dnscrypt.io -e PROVIDER_KEY=$PUBLIC_KEYPAIR_FINGERPRINT -e LOGLEVEL=7 -p 127.0.0.1:53:53/udp dnscryptio/dnscrypt-proxy
docker logs -t --details proxy

echo "-> Test for working DNS lookups via dnscrypt-proxy"
dig @127.0.0.1 www.google.com

rm /tmp/gen-provider-keypair.log
rm /tmp/fingerprint
docker stop proxy; docker stop wrapper; docker stop bind; docker rm proxy; docker rm wrapper; docker rm bind
docker volume rm $HKEYDIR

error: pathspec 'tests/test.sh' did not match any file(s) known to git


MDEV-4399 mysql_secure_installation reports error in find_mysql_client

1. remove find_mysql_client (from a bad merge)
2. use $mysql_command

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/flynn1973/mariadb-aix.git/'


fix permissions

fix permissions

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/namn/api-client-go.git/'


installation instructions and helper scripts

Test Plan: ongoing

Reviewed By: lesha@fb.com

Subscribers: kma

FB internal diff: D1434462

#!/bin/bash -e
#
#  Copyright (c) 2014, Facebook, Inc.
#  All rights reserved.
#
#  This source code is licensed under the BSD-style license found in the
#  LICENSE file in the root directory of this source tree. An additional grant
#  of patent rights can be found in the PATENTS file in the same directory.
#
#
set -o pipefail

if [[ ! -r ./Tensor.h ]]; then
  echo "Please run from the thpp subdirectory." >&2
  exit 1
fi

rm -rf gtest-1.7.0 gtest-1.7.0.zip
curl -JLO https://googletest.googlecode.com/files/gtest-1.7.0.zip
if [[ $(sha1sum -b gtest-1.7.0.zip | cut -d' ' -f1) != \
      'f85f6d2481e2c6c4a18539e391aa4ea8ab0394af' ]]; then
  echo "Invalid gtest-1.7.0.zip file" >&2
  exit 1
fi
unzip gtest-1.7.0.zip

# Build in a separate directory
mkdir -p build
cd build

# Configure
cmake ..

# Make
make

# Run tests
ctest

# Install
sudo make install

error: pathspec 'thpp/build.sh' did not match any file(s) known to git


Add alternative dotnet tool based build file for bash

#!/usr/bin/env bash
# Define varibles
CAKE_VERSION=0.30.0
DOTNET_VERSION=2.1.401
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
TOOLS_DIR=$SCRIPT_DIR/tools
CAKE_EXE=$TOOLS_DIR/dotnet-cake
CAKE_PATH=.store/cake.tool/$CAKE_VERSION

# Make sure the tools folder exist.
if [ ! -d "$TOOLS_DIR" ]; then
  mkdir "$TOOLS_DIR"
fi

###########################################################################
# INSTALL .NET CORE CLI
###########################################################################

echo "Installing .NET CLI..."
if [ ! -d "$SCRIPT_DIR/.dotnet" ]; then
  mkdir "$SCRIPT_DIR/.dotnet"
fi
curl -Lsfo "$SCRIPT_DIR/.dotnet/dotnet-install.sh" https://dot.net/v1/dotnet-install.sh
bash "$SCRIPT_DIR/.dotnet/dotnet-install.sh" --version $DOTNET_VERSION --install-dir .dotnet --no-path
export PATH="$SCRIPT_DIR/.dotnet":$PATH
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
export DOTNET_CLI_TELEMETRY_OPTOUT=1
export DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER=0

###########################################################################
# INSTALL CAKE
###########################################################################

if [ ! -f "$CAKE_EXE" ] || [ ! -d "$CAKE_PATH" ]; then
    echo "Installing Cake $CAKE_VERSION..."
    dotnet tool install --tool-path $TOOLS_DIR --version $CAKE_VERSION Cake.Tool
    if [ $? -ne 0 ]; then
        echo "An error occured while installing Cake."
        exit 1
    fi
fi

# Make sure that Cake has been installed.
if [ ! -f "$CAKE_EXE" ]; then
    echo "Could not find Cake.exe at '$CAKE_EXE'."
    exit 1
fi

###########################################################################
# RUN BUILD SCRIPT
###########################################################################

# Start Cake
(exec "$CAKE_EXE" build.cake --bootstrap) && (exec "$CAKE_EXE" build.cake "$@")

error: pathspec 'build2.sh' did not match any file(s) known to git


do not print pylint score

do not print pylint score

It's alway 10 here :)

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/dmerejkowsky/twittback.git/'


Added the resource directory for Nexus 2 & Nexus 3

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/marcomaccio/devpaas.git/'


add host

add host

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/DWBN/salt-check_mk_agent-formula.git/'


Implement live timer.

Implement live timer.

Hey, this is much better than dumb_minutes. Credit goes to the unix.com
user "cfajohnson" [1] for the functionality I essentially gronked.
[1] http://www.unix.com/shell-programming-and-scripting/98889-display-runnning-countdown-bash-script.html
I'm going to guess, much like another user on that thread did, that
backgrounding sleep(1) and using Bash's built-in wait minimizes the
clock skew caused by printf(1) and decrementing $secs.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/GA114/pomodoro.git/'


Converted runtests.ksh (rev. 1.25) into a Bourne shell script.  Replaced Korn shell's echo command by the printf command.

#!/bin/sh
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation.  Portions created by Netscape are
# Copyright (C) 1998-2000 Netscape Communications Corporation.  All
# Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the
# terms of the GNU General Public License Version 2 or later (the
# "GPL"), in which case the provisions of the GPL are applicable
# instead of those above.  If you wish to allow use of your
# version of this file only under the terms of the GPL and not to
# allow others to use your version of this file under the MPL,
# indicate your decision by deleting the provisions above and
# replace them with the notice and other provisions required by
# the GPL.  If you do not delete the provisions above, a recipient
# may use your version of this file under either the MPL or the
# GPL.
#

#
# tests.ksh
#	korn shell script for nspr tests
#

SYSTEM_INFO=`uname -a`
OS_ARCH=`uname -s`
if [ $OS_ARCH = "Windows_NT" ]
then
	NULL_DEVICE=nul
else
	NULL_DEVICE=/dev/null
fi

#
# Irrevelant tests
#
#bug1test 	- used to demonstrate a bug on NT
#bigfile2   - requires 4Gig file creation. See BugZilla #5451
#bigfile3   - requires 4Gig file creation. See BugZilla #5451
#dbmalloc	- obsolete; originally for testing debug version of nspr's malloc
#dbmalloc1	- obsolete; originally for testing debug version of nspr's malloc
#depend		- obsolete; used to test a initial spec for library dependencies
#dceemu		- used to tests special functions in NSPR for DCE emulation
#ipv6		- IPV6 not in use by NSPR clients
#mbcs       - tests use of multi-byte charset for filenames. See BugZilla #25140
#sproc_ch	- obsolete; sproc-based tests for Irix
#sproc_p	- obsolete; sproc-based tests for Irix
#io_timeoutk - obsolete; subsumed in io_timeout
#io_timeoutu - obsolete; subsumed in io_timeout
#prftest1	- obsolete; subsumed by prftest
#prftest2	- obsolete; subsumed by prftest
#prselect	- obsolete; PR_Select is obsolete
#select2	- obsolete; PR_Select is obsolete
#sem		- obsolete; PRSemaphore is obsolete
#stat		- for OS2?
#suspend	- private interfaces PR_SuspendAll, PR_ResumeAll, etc..
#thruput	- needs to be run manually as client/server
#time		- used to measure time with native calls and nspr calls
#tmoacc		- should be run with tmocon
#tmocon		- should be run with tmoacc
#op_noacc	- limited use
#yield		- limited use for PR_Yield

#
# Tests not run (but should)
#

#forktest (failed on IRIX)
#nbconn - fails on some platforms
#poll_er - fails on some platforms? limited use?
#prpoll -  the bad-FD test needs to be moved to a different test
#sleep	-  specific to OS/2

LOGFILE=${NSPR_TEST_LOGFILE:-$NULL_DEVICE}

#
# Tests run on all platforms
#

TESTS="
accept
acceptread
acceptreademu
affinity
alarm
anonfm
atomic
attach
bigfile
cleanup
cltsrv
concur
cvar
cvar2
dlltest
dtoa
errcodes
exit
fdcach
fileio
foreign
fsync
gethost
getproto
i2l
initclk
inrval
instrumt
intrio
intrupt
io_timeout
ioconthr
join
joinkk
joinku
joinuk
joinuu
layer
lazyinit
lltest
lock
lockfile
logger
many_cv
multiwait
nameshm1
nblayer
nonblock
ntioto
ntoh
op_2long
op_excl
op_filnf
op_filok
op_nofil
parent
peek
perf
pipeping
pipeping2
pipeself
poll_nm
poll_to
pollable
prftest
primblok
provider
prpollml
ranfile
randseed
rwlocktest
sel_spd
selct_er
selct_nm
selct_to
selintr
sema
semaerr
semaping
sendzlf
server_test
servr_kk
servr_uk
servr_ku
servr_uu
short_thread
sigpipe
socket
sockopt
sockping
sprintf
stack
stdio
str2addr
strod
switch
system
testbit
testfile
threads
timemac
timetest
tpd
udpsrv
vercheck
version
writev
xnotify
zerolen"

rval=0

#
# When set, value of the environment variable TEST_TIMEOUT is the maximum
# time (secs) allowed for a test program beyond which it is terminated.
# If TEST_TIMEOUT is not set or if it's value is 0, then test programs
# don't timeout.
#
# Running runtests.ksh under MKS toolkit on NT, 95, 98 does not cause
# timeout detection correctly. For these platforms, do not attempt timeout
# test. (lth).
#
#

OS_PLATFORM=`uname`
OBJDIR=`basename $PWD`
printf "\nNSPR Test Results - $OBJDIR\n\n"
printf "BEGIN\t\t\t`date`\n"
printf "NSPR_TEST_LOGFILE\t${LOGFILE}\n\n"
printf "Test\t\t\tResult\n\n"
if [ $OS_PLATFORM = "Windows_95" ] || [ $OS_PLATFORM = "Windows_98" ] || [ $OS_PLATFORM = "Windows_NT" ] ; then
	for prog in $TESTS
	do
		printf "$prog"
		printf "\nBEGIN TEST: $prog\n\n" >> ${LOGFILE} 2>&1
		./$prog >> ${LOGFILE} 2>&1
		if [ 0 = $? ] ; then
			printf "\t\t\tPassed\n";
		else
			printf "\t\t\tFAILED\n";
			rval=1
		fi;
		printf "\nEND TEST: $prog\n\n" >> ${LOGFILE} 2>&1
	done
else
	for prog in $TESTS
	do
		printf "$prog"
		printf "\nBEGIN TEST: $prog\n\n" >> ${LOGFILE} 2>&1
		export test_rval
		./$prog >> ${LOGFILE} 2>&1 &
		test_pid=$!
		sleep_pid=0
		if test -n "$TEST_TIMEOUT" && test "$TEST_TIMEOUT" -gt 0
		then
		(sleep  $TEST_TIMEOUT; kill $test_pid >/dev/null 2>&1 ) &
		sleep_pid=$!
		fi
		wait $test_pid
		test_rval=$?
		[ $sleep_pid -eq 0 ] || kill $sleep_pid >/dev/null 2>&1
		if [ 0 = $test_rval ] ; then
			printf "\t\t\tPassed\n";
		else
			printf "\t\t\tFAILED\n";
			rval=1
		fi;
		printf "\nEND TEST: $prog\n\n" >> ${LOGFILE} 2>&1
	done
fi;

printf "END\t\t\t`date`\n"
exit $rval

error: pathspec 'pr/tests/runtests.sh' did not match any file(s) known to git


Using Basi for install to increase speed and readability

error: pathspec 'Battlefield' did not match any file(s) known to git
error: pathspec '1942' did not match any file(s) known to git
error: pathspec 'installer.sh' did not match any file(s) known to git


update

update

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/neurobin/test.git/'


added iterm shell integration script to sourced files

#!/bin/bash
is_osx || return
# This is based on "preexec.bash" but is customized for iTerm2.

# Note: this module requires 2 bash features which you must not otherwise be
# using: the "DEBUG" trap, and the "PROMPT_COMMAND" variable.  preexec_install
# will override these and if you override one or the other this _will_ break.

# This is known to support bash3, as well as *mostly* support bash2.05b.  It
# has been tested with the default shells on MacOS X 10.4 "Tiger", Ubuntu 5.10
# "Breezy Badger", Ubuntu 6.06 "Dapper Drake", and Ubuntu 6.10 "Edgy Eft".

# Copy screen-run variables from the remote host, if they're available.

# Saved copy of your PS1. Changes to PS1 from here on are ignored as it is
# re-set from PROMPT_COMMAND.
orig_ps1="${PS1}"

# This variable describes whether we are currently in "interactive mode";
# i.e. whether this shell has just executed a prompt and is waiting for user
# input.  It documents whether the current command invoked by the trace hook is
# run interactively by the user; it's set immediately after the prompt hook,
# and unset as soon as the trace hook is run.
preexec_interactive_mode=""

# tmux and screen are not supported; even using the tmux hack to get escape
# codes passed through, ncurses interferes and the cursor isn't in the right
# place at the time it's passed through.
if ( [ x"$TERM" != xscreen ] ); then
  # Default do-nothing implementation of preexec.
  function preexec () {
      true
  }

  # Default do-nothing implementation of precmd.
  function precmd () {
      true
  }

  # This function is installed as the PROMPT_COMMAND; it is invoked before each
  # interactive prompt display.  It sets a variable to indicate that the prompt
  # was just displayed, to allow the DEBUG trap, below, to know that the next
  # command is likely interactive.
  function preexec_invoke_cmd () {
      last_hist_ent="$(history 1)";
      precmd;
      # This is an iTerm2 addition to try to work around a problem in the
      # original preexec.bash.
      # When the PS1 has command substitutions, this gets invoked for each
      # substitution and each command that's run within the substitution, which
      # really adds up. It would be great if we could do something like this at
      # the end of this script:
      #   PS1="$(prompt_prefix)$PS1($prompt_suffix)"
      # and have prompt_prefix set a global variable that tells precmd not to
      # output anything and have prompt_suffix reset that variable.
      # Unfortunately, command substitutions run in subshells and can't
      # communicate to the outside world.
      # Instead, we have this workaround. We save the original value of PS1 in
      # $orig_ps1. Then each time this function is run (it's called from
      # PROMPT_COMMAND just before the prompt is shown) it will change PS1 to a
      # string without any command substitutions by doing eval on orig_ps1. At
      # this point preexec_interactive_mode is still the empty string, so preexec
      # won't produce output for command substitutions.
      export PS1="\[$(prompt_prefix)\]$(eval "echo \"$orig_ps1\"")\[$(prompt_suffix)\]"
      preexec_interactive_mode="yes";
  }

  # This function is installed as the DEBUG trap.  It is invoked before each
  # interactive prompt display.  Its purpose is to inspect the current
  # environment to attempt to detect if the current command is being invoked
  # interactively, and invoke 'preexec' if so.
  function preexec_invoke_exec () {
      if [[ -n "$COMP_LINE" ]]
      then
          # We're in the middle of a completer.  This obviously can't be
          # an interactively issued command.
          return
      fi
      if [[ -z "$preexec_interactive_mode" ]]
      then
          # We're doing something related to displaying the prompt.  Let the
          # prompt set the title instead of me.
          return
      else
          # If we're in a subshell, then the prompt won't be re-displayed to put
          # us back into interactive mode, so let's not set the variable back.
          # In other words, if you have a subshell like
          #   (sleep 1; sleep 2)
          # You want to see the 'sleep 2' as a set_command_title as well.
          if [[ 0 -eq "$BASH_SUBSHELL" ]]
          then
              preexec_interactive_mode=""
          fi
      fi
      if [[ "preexec_invoke_cmd" == "$BASH_COMMAND" ]]
      then
          # Sadly, there's no cleaner way to detect two prompts being displayed
          # one after another.  This makes it important that PROMPT_COMMAND
          # remain set _exactly_ as below in preexec_install.  Let's switch back
          # out of interactive mode and not trace any of the commands run in
          # precmd.

          # Given their buggy interaction between BASH_COMMAND and debug traps,
          # versions of bash prior to 3.1 can't detect this at all.
          preexec_interactive_mode=""
          return
      fi

      # In more recent versions of bash, this could be set via the "BASH_COMMAND"
      # variable, but using history here is better in some ways: for example, "ps
      # auxf | less" will show up with both sides of the pipe if we use history,
      # but only as "ps auxf" if not.
      hist_ent="$(history 1)";
      local prev_hist_ent="${last_hist_ent}";
      last_hist_ent="${hist_ent}";
      if [[ "${prev_hist_ent}" != "${hist_ent}" ]]; then
          local this_command="$(echo "${hist_ent}" | sed -e "s/^[ ]*[0-9]*[ ]*//g")";
      else
          local this_command="";
      fi;

      # If none of the previous checks have earlied out of this function, then
      # the command is in fact interactive and we should invoke the user's
      # preexec hook with the running command as an argument.
      preexec "$this_command";
  }

  # Execute this to set up preexec and precmd execution.
  function preexec_install () {

      # *BOTH* of these options need to be set for the DEBUG trap to be invoked
      # in ( ) subshells.  This smells like a bug in bash to me.  The null stackederr
      # redirections are to quiet errors on bash2.05 (i.e. OSX's default shell)
      # where the options can't be set, and it's impossible to inherit the trap
      # into subshells.

      set -o functrace > /dev/null 2>&1
      shopt -s extdebug > /dev/null 2>&1

      # Finally, install the actual traps.
      if ( [ x"$PROMPT_COMMAND" = x ]); then
        PROMPT_COMMAND="preexec_invoke_cmd";
      else
        # If there's a trailing semicolon folowed by spaces, remove it (issue 3358).
        PROMPT_COMMAND="$(echo -n $PROMPT_COMMAND | sed -e 's/; *$//'); preexec_invoke_cmd";
      fi
      trap 'preexec_invoke_exec' DEBUG;
  }

  # -- begin iTerm2 customization

  function iterm2_begin_osc {
    printf "\033]"
  }

  function iterm2_end_osc {
    printf "\007"
  }

  # Runs after interactively edited command but before execution
  function preexec() {
    iterm2_begin_osc
    printf "133;C"
    iterm2_end_osc
  }

  function remotehost_and_currentdir() {
    iterm2_begin_osc
    printf "1337;RemoteHost=%s@%s" "$USER" $(hostname -f)
    iterm2_end_osc

    iterm2_begin_osc
    printf "1337;CurrentDir=%s" "$PWD"
    iterm2_end_osc
  }

  function prompt_prefix() {
    iterm2_begin_osc
    printf "133;D;\$?"
    iterm2_end_osc

    remotehost_and_currentdir

    iterm2_begin_osc
    printf "133;A"
    iterm2_end_osc
  }

  function prompt_suffix() {
    iterm2_begin_osc
    printf "133;B"
    iterm2_end_osc
  }

  function print_version_number() {
    iterm2_begin_osc
    printf "1337;ShellIntegrationVersion=1"
    iterm2_end_osc
  }

  preexec_install

  # This is necessary so the first command line will have a hostname and current directory.
  remotehost_and_currentdir
  print_version_number
fi

error: pathspec 'source/iterm2_shell_integration.bash' did not match any file(s) known to git


klient: add script for creating entrypoints scripts

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/szkl/koding.git/'


update

update

#!/usr/bin/env bash
set -e

export DEBIAN_FRONTEND=noninteractive
WORKDIR=~/tmp/bootstrap
mkdir -p $WORKDIR

echo "installing server..."
cd $WORKDIR
git clone https://github.com/goude/runcom

cd $WORKDIR/runcom/containers/metal/
sudo ./base-package-setup.sh

#cd $WORKDIR/runcom/setup
#./update-binary-tools.sh
#./runcom-full-install.sh

error: pathspec 'containers/metal/server-bootstrap.sh' did not match any file(s) known to git


Add api-key detection script (#109)

Add api-key detection script (#109)

#!/bin/sh
#
# Will check for API keys in what is about to be committed.
# Called by "git commit" with no arguments.  The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# Use --no-verify to ignore

## Installation
### MacOS:

# **Globally (all repos):**
# - Find global git directory:
# `git config --list --show-origin`
# Check top line of output, should be similar to:
# `file:/Applications/Xcode.app/Contents/Developer/usr/share/git-core/gitconfig	credential.helper=osxkeychain`
# - Create a global git hooks directory:
# `mkdir /Applications/Xcode.app/Contents/Developer/usr/share/git-core/hooks`
# - Configure a global git hooks path:
# `git config --global core.hooksPath /Applications/Xcode.app/Contents/Developer/usr/share/git-core/hooks`
# - Install api-key-hook file:
# `cp pre-commit.sh /Applications/Xcode.app/Contents/Developer/usr/share/git-core/hooks/pre-commit`

# **Locally (local repo):**
# - Create pre-commit.sh to local repo
# `cp pre-commit.sh .git/hooks/pre-commit`

STASH_NAME="pre-commit-$(date +%s)"
git stash save -q --keep-index $STASH_NAME

# Test prospective commit
GDAX_KEY="[a-f0-9]{32}"
GDAX_SECRET="[a-zA-Z0-9=\/+]{88}"
POLONIEX_KEY="(([A-Z0-9]{8}\-){3})([A-Z0-9]{8})"
POLONIEX_SECRET="[a-f0-9]{128}"
BITTREX_KEY="[a-f0-9]{32}"
BITTREX_SECRET="[a-f0-9]{32}"

FORBIDDEN_EXP=( $GDAX_KEY $GDAX_SECRET $POLONIEX_KEY $POLONIEX_SECRET $BITTREX_KEY $BITTREX_SECRET)

EXCLUDE="'.lock'"
COMMAND1="ls -p | grep -v '/$'"
COMMAND2="grep -v $EXCLUDE"
FAIL_MESSAGE="COMMIT REJECTED Found possible secret keys. Please remove them before committing or use --no-verify to ignore and commit anyway.\n If this helped you, consider donating Bitcoin to: 183J9CYci5Xbe3YXct1BHyRjyxH89QiUCc I had BTC stolen :( just trying to earn it back ;)"

for expression in "${FORBIDDEN_EXP[@]}"
do
    :
    output=$(ls -p | grep  -v '.lock\|package.json' | GREP_OPTIONS="--directories=skip" GREP_COLOR='4;5;37;41' xargs grep --color --with-filename -n -iE $expression)

    if [ $? -eq 0 ]
    then
        ls -p | grep  -v '.lock\|package.json' | GREP_OPTIONS="--directories=skip" GREP_COLOR='4;5;37;41' xargs grep --color --with-filename -n -iE $expression
        echo '\n' $FAIL_MESSAGE '\n' && exit 1
    fi
done

STASHES=$(git stash list)
if [[ $STASHES == "$STASH_NAME" ]]; then
  git stash pop -q
fi

error: pathspec 'pre-commit.sh' did not match any file(s) known to git


Added shellscript with summary of actions

#!/bin/bash
# python scripts/ANNOTATE/generate_wav_mat.py lists/eating_upv.wavs.txt lists/eating_upv.wav_mats.txt
april-ann scripts/PREPROCESS/preprocess.lua lists/eating_upv.wav_mats.txt lists/eating_upv.fb_mats.txt

error: pathspec 'preprocess.sh' did not match any file(s) known to git