Adding code to test that log is persistent and config data is persistent

#!/bin/bash

set -x

DOCKER_ID=`docker ps --filter name=ts3_data | tail -n +2 | awk '{print $1}'`
LOG_LINE=`docker logs $DOCKER_ID 2>/dev/null | tail -n 1`
docker stop $DOCKER_ID
docker start $DOCKER_ID
LOG_LINE_DIFF=`docker logs $DOCKER_ID 2>/dev/null | tail -n 1`

error: pathspec 'travis/log-testing.sh' did not match any file(s) known to git


Fix string compare whitespace

Fix string compare whitespace

#!/bin/bash

# Copyright 2016 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This script installs the exact golang version if not already installed
# this script is meant to be used by jenkins build agent and works only linux

set -e

VERSION_TO_INSTALL=${1:-"1.12.8"}
INSTALL_PATH=${2:-"/usr/local"}

# installs or updates golang if right version doesn't exists
function check_and_install_golang() {
	if ! go version &> /dev/null
	then
		echo "WARNING: No golang installation found in your enviroment."
    install_golang "$VERSION_TO_INSTALL" "$INSTALL_PATH"
    return
	fi

	# golang has been installed and check its version
	if [[ $(go version) =~ (([0-9]+)\.([0-9]+).([0-9]+).([\.0-9]*)) ]]
	then
		HOST_VERSION=${BASH_REMATCH[1]}
    if [ $HOST_VERSION = $VERSION_TO_INSTALL ]; then
      echo "go version on the host looks good : $HOST_VERSION"
    else
      echo "WARNING: expected go version to be $VERSION_TO_INSTALL but got $HOST_VERSION"
      install_golang "$VERSION_TO_INSTALL" "$INSTALL_PATH"
    fi
  else
  	echo "ERROR: Failed to parse golang version."
		return
	fi
}

# install_golang takes two parameters version and path to install.
function install_golang {
    echo "Installing golang version: $1 on $2"
    pushd /tmp >/dev/null
    sudo curl -qL -O "https://storage.googleapis.com/golang/go${1}.linux-amd64.tar.gz" &&
    sudo tar xfa go${1}.linux-amd64.tar.gz &&
    sudo rm -rf "${2}/go" &&
    sudo mv go "${2}/" && sudo chown -R $(whoami): ${2}/go
    popd >/dev/null
}

check_and_install_golang

#!/bin/bash

# Copyright 2016 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This script installs the exact golang version if not already installed
# this script is meant to be used by jenkins build agent and works only linux

set -e

VERSION_TO_INSTALL=${1:-"1.12.8"}
INSTALL_PATH=${2:-"/usr/local"}

# installs or updates golang if right version doesn't exists
function check_and_install_golang() {
	if ! go version &> /dev/null
	then
		echo "WARNING: No golang installation found in your enviroment."
    install_golang "$VERSION_TO_INSTALL" "$INSTALL_PATH"
    return
	fi

	# golang has been installed and check its version
	if [[ $(go version) =~ (([0-9]+)\.([0-9]+).([0-9]+).([\.0-9]*)) ]]
	then
		HOST_VERSION=${BASH_REMATCH[1]}
    if [ "$HOST_VERSION" = "$VERSION_TO_INSTALL" ]; then
      echo "go version on the host looks good : $HOST_VERSION"
    else
      echo "WARNING: expected go version to be $VERSION_TO_INSTALL but got $HOST_VERSION"
      install_golang "$VERSION_TO_INSTALL" "$INSTALL_PATH"
    fi
  else
  	echo "ERROR: Failed to parse golang version."
		return
	fi
}

# install_golang takes two parameters version and path to install.
function install_golang {
    echo "Installing golang version: $1 on $2"
    pushd /tmp >/dev/null
    sudo curl -qL -O "https://storage.googleapis.com/golang/go${1}.linux-amd64.tar.gz" &&
    sudo tar xfa go${1}.linux-amd64.tar.gz &&
    sudo rm -rf "${2}/go" &&
    sudo mv go "${2}/" && sudo chown -R $(whoami): ${2}/go
    popd >/dev/null
}

check_and_install_golang


arch/pi.sh: better example comment of nmap 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/tylerbrazier/linux.git/'


Added benchmark script

Added benchmark script

#!/bin/bash

TOOL='./afolder'

BENCHMARKS="benchmarks/markdown1.smt,benchmarks/markdown1.xml,
benchmarks/markdown2.smt,benchmarks/markdown2.xml,
benchmarks/markdown3.smt,benchmarks/markdown3.xml,
benchmarks/numa-864-10.smt,benchmarks/numa-864.xml,
benchmarks/numa-864-20.smt,benchmarks/numa-864.xml,
benchmarks/numa-864-40.smt,benchmarks/numa-864.xml,
benchmarks/standard_minInArray_false-unreach-call_ground.smt,benchmarks/standard_minInArray_false-unreach-call_ground.xml,
benchmarks/linear_sea.ch_true-unreach-call.smt,benchmarks/linear_sea.ch_true-unreach-call.xml
benchmarks/array_true-unreach-call3.smt,benchmarks/array_true-unreach-call3.xml,
benchmarks/standard_sentinel_true-unreach-call.smt,benchmarks/standard_sentinel_true-unreach-call.xml,
benchmarks/standard_find_true-unreach-call_ground.smt,benchmarks/standard_find_true-unreach-call_ground.xml,
benchmarks/standard_vararg_true-unreach-call_ground.smt,benchmarks/standard_vararg_true-unreach-call_ground.xml,
benchmarks/histogram-range8.smt,benchmarks/histogram-range.xml,-nosfsat
benchmarks/histogram-range9.smt,benchmarks/histogram-range.xml,-nosfsat
benchmarks/histogram-range10.smt,benchmarks/histogram-range.xml,-nosfsat
benchmarks/histogram-range11.smt,benchmarks/histogram-range.xml,-nosfsat
benchmarks/histogram-range11-unsat.smt,benchmarks/histogram-range.xml,-nosfsat
"

for TEST in ${BENCHMARKS}
do
    IFS=","
    set ${TEST}
    CMD="${TOOL} $1 $2 $3 -model"
    echo "Running "${CMD}
    eval ${CMD}
    echo "-----------"
    echo
done

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


Added make-doc.sh

Added make-doc.sh

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


change regexps so we catch sound ioctls as well in Linux

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/android-ia/platform_external_strace.git/'


autogen: remove copied code - srcdir and ORIGDIR (subdir config)

Signed-off-by: Uri Lublin <0332784c07b6f27b46541214503bc0da50f0f291@redhat.com>

#! /bin/sh

# FIXME: can replace this entire script with
# the following line if we can require autoconf 2.60:
# autoreconf -v --force --install || exit 1

PACKAGE=spice

ACLOCAL_FLAGS=""
LIBTOOLIZE=${LIBTOOLIZE-libtoolize}
LIBTOOLIZE_FLAGS="--copy --force"
AUTOHEADER=${AUTOHEADER-autoheader}
AUTOMAKE_FLAGS="--add-missing --gnu"
AUTOCONF=${AUTOCONF-autoconf}

# automake 1.8 requires autoconf 2.58
# automake 1.7 requires autoconf 2.54
automake_min_vers=1.7
aclocal_min_vers=$automake_min_vers
autoconf_min_vers=2.54
libtoolize_min_vers=1.4

# The awk-based string->number conversion we use needs a C locale to work
# as expected. Setting LC_ALL overrides whether the user set LC_ALL,
# LC_NUMERIC, or LANG.
LC_ALL=C

ARGV0=$0

# Allow invocation from a separate build directory; in that case, we change
# to the source directory to run the auto*, then change back before running configure
srcdir=`dirname $ARGV0`
test -z "$srcdir" && srcdir=.

ORIGDIR=`pwd`
cd $srcdir

# Not all echo versions allow -n, so we check what is possible. This test is
# based on the one in autoconf.
case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
  *c*,-n*) ECHO_N= ;;
  *c*,*  ) ECHO_N=-n ;;
  *)       ECHO_N= ;;
esac

# some terminal codes ...
boldface="`tput bold 2>/dev/null || true`"
normal="`tput sgr0 2>/dev/null || true`"
printbold() {
    echo $ECHO_N "$boldface"
    echo "$@"
    echo $ECHO_N "$normal"
}
printerr() {
    echo "$@" >&2
}

# Usage:
#     compare_versions MIN_VERSION ACTUAL_VERSION
# returns true if ACTUAL_VERSION >= MIN_VERSION
compare_versions() {
    ch_min_version=$1
    ch_actual_version=$2
    ch_status=0
    IFS="${IFS=         }"; ch_save_IFS="$IFS"; IFS="."
    set $ch_actual_version
    for ch_min in $ch_min_version; do
        ch_cur=`echo $1 | sed 's/[^0-9].*$//'`; shift # remove letter suffixes
        if [ -z "$ch_min" ]; then break; fi
        if [ -z "$ch_cur" ]; then ch_status=1; break; fi
        if [ $ch_cur -gt $ch_min ]; then break; fi
        if [ $ch_cur -lt $ch_min ]; then ch_status=1; break; fi
    done
    IFS="$ch_save_IFS"
    return $ch_status
}

# Usage:
#     version_check PACKAGE VARIABLE CHECKPROGS MIN_VERSION SOURCE
# checks to see if the package is available
version_check() {
    vc_package=$1
    vc_variable=$2
    vc_checkprogs=$3
    vc_min_version=$4
    vc_source=$5
    vc_status=1

    vc_checkprog=`eval echo "\\$$vc_variable"`
    if [ -n "$vc_checkprog" ]; then
	printbold "using $vc_checkprog for $vc_package"
	return 0
    fi

    printbold "checking for $vc_package >= $vc_min_version..."
    for vc_checkprog in $vc_checkprogs; do
	echo $ECHO_N "  testing $vc_checkprog... "
	if $vc_checkprog --version < /dev/null > /dev/null 2>&1; then
	    vc_actual_version=`$vc_checkprog --version | head -n 1 | \
                               sed 's/^.*[ 	]\([0-9.]*[a-z]*\).*$/\1/'`
	    if compare_versions $vc_min_version $vc_actual_version; then
		echo "found $vc_actual_version"
		# set variable
		eval "$vc_variable=$vc_checkprog"
		vc_status=0
		break
	    else
		echo "too old (found version $vc_actual_version)"
	    fi
	else
	    echo "not found."
	fi
    done
    if [ "$vc_status" != 0 ]; then
	printerr "***Error***: You must have $vc_package >= $vc_min_version installed"
	printerr "  to build $PROJECT.  Download the appropriate package for"
	printerr "  from your distribution or get the source tarball at"
        printerr "    $vc_source"
	printerr
    fi
    return $vc_status
}

version_check autoconf AUTOCONF $AUTOCONF $autoconf_min_vers \
    "http://ftp.gnu.org/pub/gnu/autoconf/autoconf-${autoconf_min_vers}.tar.gz" || DIE=1
version_check automake AUTOMAKE "$AUTOMAKE automake automake-1.10 automake-1.9 automake-1.8 automake-1.7" $automake_min_vers \
    "http://ftp.gnu.org/pub/gnu/automake/automake-${automake_min_vers}.tar.gz" || DIE=1
ACLOCAL=`echo $AUTOMAKE | sed s/automake/aclocal/`
version_check libtool LIBTOOLIZE "$LIBTOOLIZE glibtoolize libtoolize" $libtoolize_min_vers \
    "http://ftp.gnu.org/pub/gnu/libtool/libtool-${libtool_min_vers}.tar.gz" || DIE=1

if test -n "$DIE"; then
  exit 1
fi

if test -z "$*"; then
  echo "$ARGV0:	Note: \`./configure' will be run with no arguments."
  echo "		If you wish to pass any to it, please specify them on the"
  echo "		\`$0' command line."
  echo
fi

do_cmd() {
    echo "$ARGV0: running \`$@'"
    $@
}

# Run for top level directory

printbold "Setting up $PACKAGE toplevel"
do_cmd $LIBTOOLIZE $LIBTOOLIZE_FLAGS
do_cmd $ACLOCAL $ACLOCAL_FLAGS
do_cmd $AUTOHEADER
do_cmd $AUTOMAKE $AUTOMAKE_FLAGS
do_cmd $AUTOCONF

cd $ORIGDIR || exit $?
rm -f config.cache

do_cmd $srcdir/configure --enable-maintainer-mode ${1+"$@"} || exit 1

#! /bin/sh

srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.

ORIGDIR=`pwd`
cd $srcdir

# FIXME: can replace this entire script with
# the following line if we can require autoconf 2.60:
# autoreconf -v --force --install || exit 1

PACKAGE=spice

ACLOCAL_FLAGS=""
LIBTOOLIZE=${LIBTOOLIZE-libtoolize}
LIBTOOLIZE_FLAGS="--copy --force"
AUTOHEADER=${AUTOHEADER-autoheader}
AUTOMAKE_FLAGS="--add-missing --gnu"
AUTOCONF=${AUTOCONF-autoconf}

# automake 1.8 requires autoconf 2.58
# automake 1.7 requires autoconf 2.54
automake_min_vers=1.7
aclocal_min_vers=$automake_min_vers
autoconf_min_vers=2.54
libtoolize_min_vers=1.4

# The awk-based string->number conversion we use needs a C locale to work
# as expected. Setting LC_ALL overrides whether the user set LC_ALL,
# LC_NUMERIC, or LANG.
LC_ALL=C

ARGV0=$0

# Allow invocation from a separate build directory; in that case, we change
# to the source directory to run the auto*, then change back before running configure
srcdir=`dirname $ARGV0`
test -z "$srcdir" && srcdir=.

ORIGDIR=`pwd`

# Not all echo versions allow -n, so we check what is possible. This test is
# based on the one in autoconf.
case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
  *c*,-n*) ECHO_N= ;;
  *c*,*  ) ECHO_N=-n ;;
  *)       ECHO_N= ;;
esac

# some terminal codes ...
boldface="`tput bold 2>/dev/null || true`"
normal="`tput sgr0 2>/dev/null || true`"
printbold() {
    echo $ECHO_N "$boldface"
    echo "$@"
    echo $ECHO_N "$normal"
}
printerr() {
    echo "$@" >&2
}

# Usage:
#     compare_versions MIN_VERSION ACTUAL_VERSION
# returns true if ACTUAL_VERSION >= MIN_VERSION
compare_versions() {
    ch_min_version=$1
    ch_actual_version=$2
    ch_status=0
    IFS="${IFS=         }"; ch_save_IFS="$IFS"; IFS="."
    set $ch_actual_version
    for ch_min in $ch_min_version; do
        ch_cur=`echo $1 | sed 's/[^0-9].*$//'`; shift # remove letter suffixes
        if [ -z "$ch_min" ]; then break; fi
        if [ -z "$ch_cur" ]; then ch_status=1; break; fi
        if [ $ch_cur -gt $ch_min ]; then break; fi
        if [ $ch_cur -lt $ch_min ]; then ch_status=1; break; fi
    done
    IFS="$ch_save_IFS"
    return $ch_status
}

# Usage:
#     version_check PACKAGE VARIABLE CHECKPROGS MIN_VERSION SOURCE
# checks to see if the package is available
version_check() {
    vc_package=$1
    vc_variable=$2
    vc_checkprogs=$3
    vc_min_version=$4
    vc_source=$5
    vc_status=1

    vc_checkprog=`eval echo "\\$$vc_variable"`
    if [ -n "$vc_checkprog" ]; then
	printbold "using $vc_checkprog for $vc_package"
	return 0
    fi

    printbold "checking for $vc_package >= $vc_min_version..."
    for vc_checkprog in $vc_checkprogs; do
	echo $ECHO_N "  testing $vc_checkprog... "
	if $vc_checkprog --version < /dev/null > /dev/null 2>&1; then
	    vc_actual_version=`$vc_checkprog --version | head -n 1 | \
                               sed 's/^.*[ 	]\([0-9.]*[a-z]*\).*$/\1/'`
	    if compare_versions $vc_min_version $vc_actual_version; then
		echo "found $vc_actual_version"
		# set variable
		eval "$vc_variable=$vc_checkprog"
		vc_status=0
		break
	    else
		echo "too old (found version $vc_actual_version)"
	    fi
	else
	    echo "not found."
	fi
    done
    if [ "$vc_status" != 0 ]; then
	printerr "***Error***: You must have $vc_package >= $vc_min_version installed"
	printerr "  to build $PROJECT.  Download the appropriate package for"
	printerr "  from your distribution or get the source tarball at"
        printerr "    $vc_source"
	printerr
    fi
    return $vc_status
}

version_check autoconf AUTOCONF $AUTOCONF $autoconf_min_vers \
    "http://ftp.gnu.org/pub/gnu/autoconf/autoconf-${autoconf_min_vers}.tar.gz" || DIE=1
version_check automake AUTOMAKE "$AUTOMAKE automake automake-1.10 automake-1.9 automake-1.8 automake-1.7" $automake_min_vers \
    "http://ftp.gnu.org/pub/gnu/automake/automake-${automake_min_vers}.tar.gz" || DIE=1
ACLOCAL=`echo $AUTOMAKE | sed s/automake/aclocal/`
version_check libtool LIBTOOLIZE "$LIBTOOLIZE glibtoolize libtoolize" $libtoolize_min_vers \
    "http://ftp.gnu.org/pub/gnu/libtool/libtool-${libtool_min_vers}.tar.gz" || DIE=1

if test -n "$DIE"; then
  exit 1
fi

if test -z "$*"; then
  echo "$ARGV0:	Note: \`./configure' will be run with no arguments."
  echo "		If you wish to pass any to it, please specify them on the"
  echo "		\`$0' command line."
  echo
fi

do_cmd() {
    echo "$ARGV0: running \`$@'"
    $@
}

# Run for top level directory

printbold "Setting up $PACKAGE toplevel"
cd $srcdir
do_cmd $LIBTOOLIZE $LIBTOOLIZE_FLAGS
do_cmd $ACLOCAL $ACLOCAL_FLAGS
do_cmd $AUTOHEADER
do_cmd $AUTOMAKE $AUTOMAKE_FLAGS
do_cmd $AUTOCONF

cd $ORIGDIR || exit $?
rm -f config.cache

do_cmd $srcdir/configure --enable-maintainer-mode ${1+"$@"} || exit 1


bootstrap script to (re)generate autotools local files

#/bin/bash

autoreconf --force --install

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


autogen.sh: If configure fails, notify a message on that

See issue #894.

#!/bin/sh
#
# Run this before configure
#
# This file blatantly ripped off from subversion.
#
# Note: this dependency on Perl is fine: only developers use autogen.sh
#       and we can state that dev people need Perl on their machine
#
# TODO: make sure that ac_pkg_swig.m4 gets installed in m4 directory ...

rm -f autogen.err

automake --version | perl -ne 'if (/\(GNU automake\) (([0-9]+).([0-9]+))/) {print; if ($2 < 1 || ($2 == 1 && $3 < 4)) {exit 1;}}'

if [ $? -ne 0 ]; then
    echo "Error: you need automake 1.4 or later.  Please upgrade."
    exit 1
fi

if test ! -d `aclocal --print-ac-dir 2>> autogen.err`; then
  echo "Bad aclocal (automake) installation"
  exit 1
fi

# Produce aclocal.m4, so autoconf gets the automake macros it needs
#
case `uname` in
    CYGWIN*)
        include_dir='-I m4' # Needed for Cygwin only.
        ;;
    Darwin)
        [ "$LIBTOOLIZE" = "" ] && LIBTOOLIZE=glibtoolize
        ;;
esac

    ${LIBTOOLIZE:=libtoolize} --force --copy || {
    echo "error: libtoolize failed"
    exit 1
}

echo "Creating aclocal.m4: aclocal $include_dir $ACLOCAL_FLAGS"

aclocal $include_dir $ACLOCAL_FLAGS 2>> autogen.err

# Produce all the `GNUmakefile.in's and create neat missing things
# like `install-sh', etc.
#
echo "automake --add-missing --copy --foreign"

automake --add-missing --copy --foreign 2>> autogen.err || {
    echo ""
    echo "* * * warning: possible errors while running automake - check autogen.err"
    echo ""
}

# If there's a config.cache file, we may need to delete it.
# If we have an existing configure script, save a copy for comparison.
if [ -f config.cache ] && [ -f configure ]; then
  cp configure configure.$$.tmp
fi

# Produce ./configure
#
echo "Creating configure..."

autoconf 2>> autogen.err || {
    echo ""
    echo "* * * warning: possible errors while running automake - check autogen.err"
    echo ""
}

run_configure=true
for arg in $*; do
    case $arg in
        --no-configure)
            run_configure=false
            ;;
        *)
            ;;
    esac
done

if $run_configure; then
    mkdir -p build
    cd build
    ../configure --enable-maintainer-mode "$@"
    if [ $? -eq 0 ]; then
      echo
      echo "Now type 'make' to compile link-grammar (in the 'build' directory)."
    else
      echo
      echo "A syntax error may mean you need to install 'autoconf-archive'."
      echo "After you fix the problem then run '$0' again."
    fi
else
    echo
    echo "Now run 'configure' and 'make' to compile link-grammar."
fi

#!/bin/sh
#
# Run this before configure
#
# This file blatantly ripped off from subversion.
#
# Note: this dependency on Perl is fine: only developers use autogen.sh
#       and we can state that dev people need Perl on their machine
#
# TODO: make sure that ac_pkg_swig.m4 gets installed in m4 directory ...

rm -f autogen.err

automake --version | perl -ne 'if (/\(GNU automake\) (([0-9]+).([0-9]+))/) {print; if ($2 < 1 || ($2 == 1 && $3 < 4)) {exit 1;}}'

if [ $? -ne 0 ]; then
    echo "Error: you need automake 1.4 or later.  Please upgrade."
    exit 1
fi

if test ! -d `aclocal --print-ac-dir 2>> autogen.err`; then
  echo "Bad aclocal (automake) installation"
  exit 1
fi

# Produce aclocal.m4, so autoconf gets the automake macros it needs
#
case `uname` in
    CYGWIN*)
        include_dir='-I m4' # Needed for Cygwin only.
        ;;
    Darwin)
        [ "$LIBTOOLIZE" = "" ] && LIBTOOLIZE=glibtoolize
        ;;
esac

    ${LIBTOOLIZE:=libtoolize} --force --copy || {
    echo "error: libtoolize failed"
    exit 1
}

echo "Creating aclocal.m4: aclocal $include_dir $ACLOCAL_FLAGS"

aclocal $include_dir $ACLOCAL_FLAGS 2>> autogen.err

# Produce all the `GNUmakefile.in's and create neat missing things
# like `install-sh', etc.
#
echo "automake --add-missing --copy --foreign"

automake --add-missing --copy --foreign 2>> autogen.err || {
    echo ""
    echo "* * * warning: possible errors while running automake - check autogen.err"
    echo ""
}

# If there's a config.cache file, we may need to delete it.
# If we have an existing configure script, save a copy for comparison.
if [ -f config.cache ] && [ -f configure ]; then
  cp configure configure.$$.tmp
fi

# Produce ./configure
#
echo "Creating configure..."

autoconf 2>> autogen.err || {
    echo ""
    echo "* * * warning: possible errors while running automake - check autogen.err"
    echo ""
}

run_configure=true
for arg in $*; do
    case $arg in
        --no-configure)
            run_configure=false
            ;;
        *)
            ;;
    esac
done

if $run_configure; then
    mkdir -p build
    cd build
    ../configure --enable-maintainer-mode "$@"
    echo
    echo "Now type 'make' to compile link-grammar."
else
    echo
    echo "Now run 'configure' and 'make' to compile link-grammar."
fi


Renamed parameters and fixed Azure URL

Renamed parameters and fixed Azure URL

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/lukeawyatt/docker-azurefs.git/'


General build script added

General build script added

#!/usr/bin/env bash
cd 1-base-java-server/ &&
sh build.sh &&
cd ../2-base-mongodb-server/ &&
sh build.sh &&
cd ../3-db-server/ &&
sh build.sh

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


Made script execute itself upon installation

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/Slyke/Iptables-Generic.git/'


update

update

#!/bin/sh

pkill kore
cd backend/
kore run &
cd ../

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


adds script to fix rpath issues that arise when shared-library linking to amanzi on macs

for i in system filesystem program_options regex; do install_name_tool -change @rpath/libboost_${i}.dylib ${AMANZI_TPLS_DIR}/lib/libboost_${i}.dylib ${ATS_DIR}/bin/ats; done

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


Connect to screen session without knowing name

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/tkjef/shell_scripts.git/'


cleanup.sh to kill and remove every container on the host

#!/bin/bash

#
# kill every running container and remove them
#

echo "# kill every running container and remove them"

docker ps -aq | xargs docker kill &>/dev/null
docker ps -aq | xargs docker rm  &>/dev/null

#show what is left:
docker ps -a

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


update go_test

update go_test

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/gaia-adm/mr-burns.git/'


imt: now automated with a test script

imt: now automated with a test script

#!/bin/bash

fail=0;
if [ "$(curl https://www.imt-ip.pt/sites/IMTT/Portugues/Formularios/Documents/Mod9IMT.pdf -o /dev/null; echo $?)" -eq "35" ]; then
	echo "imt: problema com o certificado SSL";
	fail=1;
fi

if [ ! "$fail" ]; then
	echo "imt: incumprimento pode já não existir";
else
	echo "imt: Incumprimento mantém-se, a actualizar o README (faça um git diff, valide, e commit!)";
	while IFS='' read -r line || [[ -n "$line" ]]; do
		test $(echo "$line"|grep -v imt|wc -l) -eq "1" \
			&& echo "$line" \
			|| (h=$(echo "$line"|cut -d\| -f1-4); t=$(echo "$line"|cut -d\| -f6-); echo "$h| $(date +%Y/%m/%d) |$t");
	done < README.md > new
	mv new README.md
fi

error: pathspec 'scripts/49-imt.sh' did not match any file(s) known to git


make bootstrapping explicit

make bootstrapping explicit

set up the dhcp configuration and inject a lease for bootstrap host

#!/bin/bash -x

# shellcheck disable=SC1091
source /tmp/cerana-bootcfg

function exit_code_with_message() {
    local exit_code
    exit_code=${1}
    shift
    echo "${*}" >&2
    exit "${exit_code}"
}

[[ -n ${CERANA_RESCUE} ]] && exit_code_with_messsage 0 "Rescue Mode. Exiting."

[[ -z ${CERANA_CLUSTER_BOOTSTRAP} ]] && exit_code_with_message 0 "Not in bootstrap mode. Exiting."

[[ -z ${CERANA_MGMT_MAC} ]] && fail_exit 1 "Couldn't find MAC address for bootstrapping the cluster config. Failure."

[[ -z ${CERANA_MGMT_IP} ]] && fail_exit 1 "Couldn't find IP configuration for bootstrapping the cluster config. Failure."

LOCAL_IP=${CERANA_MGMT_IP%/*}
PREFIX_BITS=${CERANA_MGMT_IP#*/}

# FIXME UGLY HACK
case ${PREFIX_BITS} in
    8)
        MASK="/wAAAA=="
        NETMASK="255.0.0.0"
        ;;
    16)
        MASK="//8AAA=="
        NETMASK="255.255.0.0"
        ;;
    24)
        MASK="////AA=="
        NETMASK="255.255.255.0"
        ;;
    *)
        exit_code_with_message 2 "We only know how to handle /8, /16, /24 netmasks... sorry."
        ;;
esac

address_to_number() {
    local IFS=. ipStr
    ipStr=($1)
    echo $(($(($(($(($(($((ipStr[0] * 256)) + ipStr[1])) * 256)) + ipStr[2])) * 256)) + ipStr[3]))
}

number_to_address() {
    echo "$(($1 / 16777216)).$(($(($1 % 16777216)) / 65536)).$(($(($1 % 65536)) / 256)).$(($1 % 256))"
}

NET_ADDRESS=$(number_to_address $(($(address_to_number "${LOCAL_IP}") & $(address_to_number "${NETMASK}"))))

gateway_string() {
    [[ -n ${CERANA_MGMT_GW} ]] \
        && echo "\"gateway\":\"${CERANA_MGMT_GW}\","
}

l2-request() { coordinator-cli -c unix:///task-socket/l2-coordinator/coordinator/l2-coord.sock -r :4080 "$@"; }

until l2-request -t kv-keys -a key=/ &>/dev/null; do
    sleep 1
done

l2-request -t set-dhcp -s <<EOF
{
  "duration": 86400000000000,
  $(gateway_string)
  "net": {
    "IP": "${NET_ADDRESS}",
    "Mask": "${MASK}"
  }
}
EOF

LEASE_JSON="{\"mac\":\"${CERANA_MGMT_MAC}\", \"ip\":\"${LOCAL_IP}\"}"
l2-request -t dhcp-offer-lease -s <<<"${LEASE_JSON}" \
    && l2-request -t dhcp-ack-lease -s <<<"${LEASE_JSON}"

error: pathspec 'boot/scripts/bootstrap-clusterconfig.sh' did not match any file(s) known to git


:phone: phone home

:phone: phone home

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/mplusmuseum/mplusmuseum-stories.git/'


make it more portable

make it more portable

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/MBRG/otrs.git/'


adding jumpstorm plugin completion

adding jumpstorm plugin completion

<!DOCTYPE html>

    <meta charset='utf-8'>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Content-Language" content="en">

    <title>jumpstorm-zsh-plugin/jumpstorm.plugin.zsh at master · netresearch/jumpstorm-zsh-plugin</title>
    <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub">
    <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub">
    <link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-114.png">
    <link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114.png">
    <link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-144.png">
    <link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144.png">
    <meta property="fb:app_id" content="1401488693436528">

      <meta content="@github" name="twitter:site" /><meta content="summary" name="twitter:card" /><meta content="netresearch/jumpstorm-zsh-plugin" name="twitter:title" /><meta content="jumpstorm-zsh-plugin - zsh plugin for command autocompletition in jumpstorm (see https://github.com/netresearch/jumpstorm)" name="twitter:description" /><meta content="https://avatars1.githubusercontent.com/u/151247?v=3&s=400" name="twitter:image:src" />
<meta content="GitHub" property="og:site_name" /><meta content="object" property="og:type" /><meta content="https://avatars1.githubusercontent.com/u/151247?v=3&s=400" property="og:image" /><meta content="netresearch/jumpstorm-zsh-plugin" property="og:title" /><meta content="https://github.com/netresearch/jumpstorm-zsh-plugin" property="og:url" /><meta content="jumpstorm-zsh-plugin - zsh plugin for command autocompletition in jumpstorm (see https://github.com/netresearch/jumpstorm)" property="og:description" />

      <meta name="browser-stats-url" content="/_stats">
    <link rel="assets" href="https://assets-cdn.github.com/">
    <link rel="conduit-xhr" href="https://ghconduit.com:25035">
    <link rel="xhr-socket" href="/_sockets">
    <meta name="pjax-timeout" content="1000">
    <link rel="sudo-modal" href="/sessions/sudo_modal">

    <meta name="msapplication-TileImage" content="/windows-tile.png">
    <meta name="msapplication-TileColor" content="#ffffff">
    <meta name="selected-link" value="repo_source" data-pjax-transient>
      <meta name="google-analytics" content="UA-3769691-2">

    <meta content="collector.githubapp.com" name="octolytics-host" /><meta content="collector-cdn.github.com" name="octolytics-script-host" /><meta content="github" name="octolytics-app-id" /><meta content="4EEE14D8:4AE8:2A1831:548B6D5D" name="octolytics-dimension-request_id" /><meta content="550726" name="octolytics-actor-id" /><meta content="ahmadassaf" name="octolytics-actor-login" /><meta content="6453e4118505644758d135c2fd7590c899701913ccbdf1e738fb95fe86d92f57" name="octolytics-actor-hash" />

    <meta content="Rails, view, blob#show" name="analytics-event" />

    <link rel="icon" type="image/x-icon" href="https://assets-cdn.github.com/favicon.ico">

    <meta content="authenticity_token" name="csrf-param" />
<meta content="bsQgiNrUCfwrTpDR+FeIg6ApsCQAoBjNtiJRqupCp0psqp47VD5zS8Xzg/Fc8eFwedcbNpox3Hr3UE5xZstRwg==" name="csrf-token" />

    <link href="https://assets-cdn.github.com/assets/github-c7f434a471766a748d862b4cb294526acd6901321d901cc64028f53af8490603.css" media="all" rel="stylesheet" type="text/css" />
    <link href="https://assets-cdn.github.com/assets/github2-dd02fbee3f4d6d9f63fa884603d879f44764fb41275432a33fdd783c4b917453.css" media="all" rel="stylesheet" type="text/css" />

    <meta http-equiv="x-pjax-version" content="b8ecf20b7597124bb8f5b76c45762608">

  <meta name="description" content="jumpstorm-zsh-plugin - zsh plugin for command autocompletition in jumpstorm (see https://github.com/netresearch/jumpstorm)">
  <meta name="go-import" content="github.com/netresearch/jumpstorm-zsh-plugin git https://github.com/netresearch/jumpstorm-zsh-plugin.git">

  <meta content="151247" name="octolytics-dimension-user_id" /><meta content="netresearch" name="octolytics-dimension-user_login" /><meta content="4582895" name="octolytics-dimension-repository_id" /><meta content="netresearch/jumpstorm-zsh-plugin" name="octolytics-dimension-repository_nwo" /><meta content="true" name="octolytics-dimension-repository_public" /><meta content="false" name="octolytics-dimension-repository_is_fork" /><meta content="4582895" name="octolytics-dimension-repository_network_root_id" /><meta content="netresearch/jumpstorm-zsh-plugin" name="octolytics-dimension-repository_network_root_nwo" />
  <link href="https://github.com/netresearch/jumpstorm-zsh-plugin/commits/master.atom" rel="alternate" title="Recent Commits to jumpstorm-zsh-plugin:master" type="application/atom+xml">

    Skip to content

          <form accept-charset="UTF-8" action="/netresearch/jumpstorm-zsh-plugin/search" class="js-site-search-form" data-global-search-url="/search" data-repo-search-url="/netresearch/jumpstorm-zsh-plugin/search" method="get">
<input name="utf8" type="hidden" value="✓" />

  <input type="text"
    class="js-site-search-field is-clearable"
    data-hotkey="s"
    name="q"
    placeholder="Search"
    data-global-scope-placeholder="Search GitHub"
    data-repo-scope-placeholder="Search"
    tabindex="1"
    autocapitalize="off">

This repository

</form>

          Explore

            Gist

            Blog

          Help

        ahmadassaf

     New repository

     New organization

      This repository

         New issue

    <form accept-charset="UTF-8" action="/logout" class="logout-form" method="post">
<input name="utf8" type="hidden" value="✓" /><input name="authenticity_token" type="hidden" value="tcBBNTQ6WtsFsbKp/nj19nPZl/EUkcVvcQGihseAh3OpdY2QxzdBR326Lbq5ZkyVZkZwLbcKL4VvQOgCxCPAlg==" />

      <button class="header-nav-link sign-out-button tooltipped tooltipped-s" aria-label="Sign out" data-ga-click="Header, sign out, icon:logout">

      </button>
</form>

      <form accept-charset="UTF-8" action="/notifications/subscribe" class="js-social-container" data-autosubmit="true" data-remote="true" method="post">
<input name="utf8" type="hidden" value="✓" /><input name="authenticity_token" type="hidden" value="bsZ5Euczy2gERaYGdfupWGmqDGNxoZyWBtLZOy3F7Go5gTlNuEsVFi5adP8LWRURiNsh3dJ3fHRnzE2do6o0ig==" />
  <input id="repository_id" name="repository_id" type="hidden" value="4582895" />

        0

          Watch

            Notifications

                <input checked="checked" id="do_included" name="do" type="radio" value="included" />

Not watching

                Be notified when participating or @mentioned.

                  Watch

                <input id="do_subscribed" name="do" type="radio" value="subscribed" />

Watching

                Be notified of all conversations.

                  Unwatch

                <input id="do_ignore" name="do" type="radio" value="ignore" />

Ignoring

                Never be notified.

                  Stop ignoring

</form>

    <form accept-charset="UTF-8" action="/netresearch/jumpstorm-zsh-plugin/unstar" class="js-toggler-form starred js-unstar-button" data-remote="true" method="post">
<input name="utf8" type="hidden" value="✓" /><input name="authenticity_token" type="hidden" value="44iSNBkzWLCotUVYei2WCytS8zj0LbatyAfB4QeJw9Y3MlpLD7PfN4AbNDXh9b3Zw9fAmDtyyHjlSJ7cIXNSaQ==" />

      <button
        class="minibutton with-count js-toggler-target star-button"
        aria-label="Unstar this repository" title="Unstar netresearch/jumpstorm-zsh-plugin">

        Unstar
      </button>

          1

</form>
    <form accept-charset="UTF-8" action="/netresearch/jumpstorm-zsh-plugin/star" class="js-toggler-form unstarred js-star-button" data-remote="true" method="post">
<input name="utf8" type="hidden" value="✓" /><input name="authenticity_token" type="hidden" value="Yk2YFyFOfzSyDUBOVpzC6kmt05vcnSiUv9NZtwIAjGdqnnE6bU0AZvKhp+XHrRxGxmoBnN5xtWZKaR2QyhtfHw==" />

      <button
        class="minibutton with-count js-toggler-target star-button"
        aria-label="Star this repository" title="Star netresearch/jumpstorm-zsh-plugin">

        Star
      </button>

          1

</form>

            Fork

          0

          netresearch/jumpstorm-zsh-plugin

         Code

           Issues

           Pull Requests

           Wiki

         Pulse

         Graphs

HTTPS clone URL

    <input type="text" class="input-mini input-monospace js-url-field js-zeroclipboard-target"
           value="https://github.com/netresearch/jumpstorm-zsh-plugin.git" readonly="readonly">

      <button aria-label="Copy to clipboard" class="js-zeroclipboard minibutton zeroclipboard-button" data-copied-hint="Copied!" type="button"></button>

SSH clone URL

    <input type="text" class="input-mini input-monospace js-url-field js-zeroclipboard-target"
           value="git@github.com:netresearch/jumpstorm-zsh-plugin.git" readonly="readonly">

      <button aria-label="Copy to clipboard" class="js-zeroclipboard minibutton zeroclipboard-button" data-copied-hint="Copied!" type="button"></button>

Subversion checkout URL

    <input type="text" class="input-mini input-monospace js-url-field js-zeroclipboard-target"
           value="https://github.com/netresearch/jumpstorm-zsh-plugin" readonly="readonly">

      <button aria-label="Copy to clipboard" class="js-zeroclipboard minibutton zeroclipboard-button" data-copied-hint="Copied!" type="button"></button>

You can clone with
  HTTPS, SSH, or Subversion.

    Clone in Desktop

                  Download ZIP

Permalink

    branch:
    master

        Switch branches/tags

          <input type="text" aria-label="Filter branches/tags" id="context-commitish-filter-field" class="js-filterable-field js-navigation-enable" placeholder="Filter branches/tags">

              Branches

              Tags

              master

Nothing to show

Nothing to show

    <button aria-label="Copy file path to clipboard" class="js-zeroclipboard minibutton zeroclipboard-button" data-copied-hint="Copied!" type="button"></button>

    jumpstorm-zsh-plugin/jumpstorm.plugin.zsh

<include-fragment class="commit commit-loader file-history-tease" src="/netresearch/jumpstorm-zsh-plugin/contributors/master/jumpstorm.plugin.zsh">

    Fetching contributors…

Cannot retrieve contributors at this time

</include-fragment>

          15 lines (11 sloc)

        0.34 kb

          Raw
            Blame
          History

        # Jumpstorm command completition

        # @see https://github.com/netresearch/jumpstorm

        _jumpstorm_get_command_list () {

            ./jumpstorm --no-ansi | sed "1,/Available commands/d" | awk '/^  [a-z]+/ { print $1 }'

        }

        _jumpstorm () {

            if [ -f jumpstorm ]; then

                compadd `</span>_jumpstorm_get_command_list<span class="pl-pds">`

            fi

        }

        compdef _jumpstorm jumpstorm

Jump to Line

  <form accept-charset="UTF-8" class="js-jump-to-line-form">
    <input class="linejump-input js-jump-to-line-field" type="text" placeholder="Jump to line…" autofocus>
    <button type="submit" class="button">Go</button>
  </form>

Status

API

Training

Shop

Blog

About

© 2014 GitHub, Inc.

Terms

Privacy

Security

Contact

      <textarea name="fullscreen-contents" id="fullscreen-contents" class="fullscreen-contents js-fullscreen-contents" placeholder=""></textarea>

      Something went wrong with that request. Please try again.

error: pathspec 'plugins/jumpstorm/jumpstorm.plugin.zsh' did not match any file(s) known to git


add firewalld aliases

add firewalld aliases

alias fw="firewall-cmd"
alias fwp="firewall-cmd --permanent"
alias fwr="firewall-cmd --reload"
alias fwrp="firewall-cmd --runtime-to-permanent"

function fwl () {
  # converts output to zsh array ()
  # @f flag split on new line
  zones=("${(@f)$(firewall-cmd --get-active-zones | grep -v interfaces)}")

  for i in $zones; do
    firewall-cmd --zone $i --list-all
  done

  echo 'Direct Rules:'
  firewall-cmd --direct --get-all-rules
}

error: pathspec 'plugins/firewalld/firewalld.plugin.zsh' did not match any file(s) known to git


Add script for easily starting test container

#! /bin/bash

sudo docker run --privileged -it -e "CLOUDFLEET_DOMAIN=${1}.test.blimpyard.cloudfleet.io" -e "CLOUDFLEET_SECRET=password" -e "CLOUDFLEET_HOST=blimpyard.cloudfleet.io:443" --name "blimp_${1}" cloudfleet/blimp

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


script to copy a whole database

script to copy a whole database

if [ "x$6" == "x" ]; then
  echo "Usage: ./copy_whole_db.sh sourceuser sourcepass sourcedb destuser destpass destdb"
  exit
fi

sourceuser=$1
sourcepass=$2
sourcedb=$3
destuser=$4
destpass=$5
destdb=$6

mkdir -p log
echo "show collections" | mongo $sourcedb -u $sourceuser -p $sourcepass --quiet | while read collection; do
  echo "db.$collection.drop();" | mongo $destdb -u $destuser -p $destpass --quiet
  ./copy_collection.py \
    --source $sourceuser:$sourcepass@$sourcedb/$collection \
    --dest   $destuser:$destpass@$destdb/$collection \
    --restart > log/$collection.log 2>&1 &
done
sleep 5
grep Traceback log/*

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


Update testing run to include the example tests.

Both the Travis build and our nightly run were only running over modules/testing
so this change modifies the script to run over those and the tests now living
in docs/source/examples.

#!/usr/bin/env bash
#
# Run the python unittests for code in docs/source/examples/.

CWD=$(cd $(dirname $0) ; pwd)
source $CWD/common.bash

export CHPL_HOME=$REPO_ROOT/chapel-src
CHPL_GIT_URL=${CHPL_GIT_URL:-git://github.com/chapel-lang/chapel.git}
CHPL_GIT_BRANCH=${CHPL_GIT_BRANCH:-master}

log_info "Cloning Chapel source (branch: ${CHPL_GIT_BRANCH} repo: ${CHPL_GIT_URL}) into: ${CHPL_HOME}"
git clone --branch $CHPL_GIT_BRANCH $CHPL_GIT_URL $CHPL_HOME

log_info "Moving to: ${CHPL_HOME}"
cd $CHPL_HOME

log_info "Building Chapel"
export CHPL_LIBMODE=shared
source util/quickstart/setchplenv.bash && \
    make -j

# Install python dependencies for running the tests (not building the docs).
log_info "Installing python test dependencies."
pip install -r $TST_DIR/requirements.txt

(
    log_info "Moving to: ${MODULE_DIR}"
    cd $MODULE_DIR

    log_info "Installing pychapel from setup.py"
    python setup.py install
)

log_info "Running pych --check"
pych --check

# Copying pyChapel libchpl dependencies
cp $CHPL_HOME/lib/linux64*/* $VIRTUAL_ENV/share/pych/lib/

log_info "Moving to: ${REPO_ROOT}"
cd $REPO_ROOT

log_info "Running py.test over $TST_DIR and doc examples"
py.test --verbose --junitxml=$REPO_ROOT/python-results.xml $TST_DIR docs/source/examples/

log_info "Running pych --testing..."
pych --testing

#!/usr/bin/env bash
#
# Run the python unittests for code in docs/source/examples/.

CWD=$(cd $(dirname $0) ; pwd)
source $CWD/common.bash

export CHPL_HOME=$REPO_ROOT/chapel-src
CHPL_GIT_URL=${CHPL_GIT_URL:-git://github.com/chapel-lang/chapel.git}
CHPL_GIT_BRANCH=${CHPL_GIT_BRANCH:-master}

log_info "Cloning Chapel source (branch: ${CHPL_GIT_BRANCH} repo: ${CHPL_GIT_URL}) into: ${CHPL_HOME}"
git clone --branch $CHPL_GIT_BRANCH $CHPL_GIT_URL $CHPL_HOME

log_info "Moving to: ${CHPL_HOME}"
cd $CHPL_HOME

log_info "Building Chapel"
export CHPL_LIBMODE=shared
source util/quickstart/setchplenv.bash && \
    make -j

# Install python dependencies for running the tests (not building the docs).
log_info "Installing python test dependencies."
pip install -r $TST_DIR/requirements.txt

(
    log_info "Moving to: ${MODULE_DIR}"
    cd $MODULE_DIR

    log_info "Installing pychapel from setup.py"
    python setup.py install
)

log_info "Running pych --check"
pych --check

# Copying pyChapel libchpl dependencies
cp $CHPL_HOME/lib/linux64*/* $VIRTUAL_ENV/share/pych/lib/

log_info "Moving to: ${TST_DIR}"
cd $TST_DIR

log_info "Running py.test..."
py.test --verbose --junitxml=$REPO_ROOT/python-results.xml

log_info "Running pych --testing..."
pych --testing


adding test harness

adding test harness

cd lab1/scraping-lab
nosetests
cd ../log-file-analysis-lab
nosetests

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


load ssh-keys

load ssh-keys

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/Jumpscale/ays9.git/'


Use "python -m coverage" rather than use "coverage" explicitly

When coverage module is installed using a package from Debian/Ubuntu,
the command name is "python-coverage". By using "python -m coverage"
the coverage module is detected in both cases.

Change-Id: Icf9084855b83d0cc721de5325f38cf72ac85ff81
Closes-Bug: #1241332
Co-Authored-By: florent <ae636e45f03fbb934c7cdec89f262fb5d54a26c0@cloudwatt.com>

#!/bin/bash

set -o errexit

# ---------------UPDATE ME-------------------------------#
# Increment me any time the environment should be rebuilt.
# This includes dependency changes, directory renames, etc.
# Simple integer sequence: 1, 2, 3...
environment_version=42
#--------------------------------------------------------#

function usage {
  echo "Usage: $0 [OPTION]..."
  echo "Run Horizon's test suite(s)"
  echo ""
  echo "  -V, --virtual-env        Always use virtualenv.  Install automatically"
  echo "                           if not present"
  echo "  -N, --no-virtual-env     Don't use virtualenv.  Run tests in local"
  echo "                           environment"
  echo "  -c, --coverage           Generate reports using Coverage"
  echo "  -f, --force              Force a clean re-build of the virtual"
  echo "                           environment. Useful when dependencies have"
  echo "                           been added."
  echo "  -m, --manage             Run a Django management command."
  echo "  --makemessages           Create/Update English translation files."
  echo "  --compilemessages        Compile all translation files."
  echo "  -p, --pep8               Just run pep8"
  echo "  -P, --no-pep8            Don't run pep8 by default"
  echo "  -t, --tabs               Check for tab characters in files."
  echo "  -y, --pylint             Just run pylint"
  echo "  -q, --quiet              Run non-interactively. (Relatively) quiet."
  echo "                           Implies -V if -N is not set."
  echo "  --only-selenium          Run only the Selenium unit tests"
  echo "  --with-selenium          Run unit tests including Selenium tests"
  echo "  --integration            Run the integration tests (requires a running "
  echo "                           OpenStack environment)"
  echo "  --runserver              Run the Django development server for"
  echo "                           openstack_dashboard in the virtual"
  echo "                           environment."
  echo "  --docs                   Just build the documentation"
  echo "  --backup-environment     Make a backup of the environment on exit"
  echo "  --restore-environment    Restore the environment before running"
  echo "  --destroy-environment    Destroy the environment and exit"
  echo "  -h, --help               Print this usage message"
  echo ""
  echo "Note: with no options specified, the script will try to run the tests in"
  echo "  a virtual environment,  If no virtualenv is found, the script will ask"
  echo "  if you would like to create one.  If you prefer to run tests NOT in a"
  echo "  virtual environment, simply pass the -N option."
  exit
}

# DEFAULTS FOR RUN_TESTS.SH
#
root=`pwd -P`
venv=$root/.venv
with_venv=tools/with_venv.sh
included_dirs="openstack_dashboard horizon"

always_venv=0
backup_env=0
command_wrapper=""
destroy=0
force=0
just_pep8=0
no_pep8=0
just_pylint=0
just_docs=0
just_tabs=0
never_venv=0
quiet=0
restore_env=0
runserver=0
only_selenium=0
with_selenium=0
integration=0
testopts=""
testargs=""
with_coverage=0
makemessages=0
compilemessages=0
manage=0

# Jenkins sets a "JOB_NAME" variable, if it's not set, we'll make it "default"
[ "$JOB_NAME" ] || JOB_NAME="default"

function process_option {
  # If running manage command, treat the rest of options as arguments.
  if [ $manage -eq 1 ]; then
     testargs="$testargs $1"
     return 0
  fi

  case "$1" in
    -h|--help) usage;;
    -V|--virtual-env) always_venv=1; never_venv=0;;
    -N|--no-virtual-env) always_venv=0; never_venv=1;;
    -p|--pep8) just_pep8=1;;
    -P|--no-pep8) no_pep8=1;;
    -y|--pylint) just_pylint=1;;
    -f|--force) force=1;;
    -t|--tabs) just_tabs=1;;
    -q|--quiet) quiet=1;;
    -c|--coverage) with_coverage=1;;
    -m|--manage) manage=1;;
    --makemessages) makemessages=1;;
    --compilemessages) compilemessages=1;;
    --only-selenium) only_selenium=1;;
    --with-selenium) with_selenium=1;;
    --integration) integration=1;;
    --docs) just_docs=1;;
    --runserver) runserver=1;;
    --backup-environment) backup_env=1;;
    --restore-environment) restore_env=1;;
    --destroy-environment) destroy=1;;
    -*) testopts="$testopts $1";;
    *) testargs="$testargs $1"
  esac
}

function run_management_command {
  ${command_wrapper} python $root/manage.py $testopts $testargs
}

function run_server {
  echo "Starting Django development server..."
  ${command_wrapper} python $root/manage.py runserver $testopts $testargs
  echo "Server stopped."
}

function run_pylint {
  echo "Running pylint ..."
  PYTHONPATH=$root ${command_wrapper} pylint --rcfile=.pylintrc -f parseable $included_dirs > pylint.txt || true
  CODE=$?
  grep Global -A2 pylint.txt
  if [ $CODE -lt 32 ]; then
      echo "Completed successfully."
      exit 0
  else
      echo "Completed with problems."
      exit $CODE
  fi
}

function run_pep8 {
  echo "Running flake8 ..."
  set +o errexit
  ${command_wrapper} python -c "import hacking" 2>/dev/null
  no_hacking=$?
  set -o errexit
  if [ $never_venv -eq 1 -a $no_hacking -eq 1 ]; then
      echo "**WARNING**:" >&2
      echo "OpenStack hacking is not installed on your host. Its detection will be missed." >&2
      echo "Please install or use virtual env if you need OpenStack hacking detection." >&2
  fi
  DJANGO_SETTINGS_MODULE=openstack_dashboard.test.settings ${command_wrapper} flake8
}

function run_sphinx {
    echo "Building sphinx..."
    export DJANGO_SETTINGS_MODULE=openstack_dashboard.settings
    ${command_wrapper} sphinx-build -b html doc/source doc/build/html
    echo "Build complete."
}

function tab_check {
  TAB_VIOLATIONS=`find $included_dirs -type f -regex ".*\.\(css\|js\|py\|html\)" -print0 | xargs -0 awk '/\t/' | wc -l`
  if [ $TAB_VIOLATIONS -gt 0 ]; then
    echo "TABS! $TAB_VIOLATIONS of them! Oh no!"
    HORIZON_FILES=`find $included_dirs -type f -regex ".*\.\(css\|js\|py|\html\)"`
    for TABBED_FILE in $HORIZON_FILES
    do
      TAB_COUNT=`awk '/\t/' $TABBED_FILE | wc -l`
      if [ $TAB_COUNT -gt 0 ]; then
        echo "$TABBED_FILE: $TAB_COUNT"
      fi
    done
  fi
  return $TAB_VIOLATIONS;
}

function destroy_venv {
  echo "Cleaning environment..."
  echo "Removing virtualenv..."
  rm -rf $venv
  echo "Virtualenv removed."
  rm -f .environment_version
  echo "Environment cleaned."
}

function environment_check {
  echo "Checking environment."
  if [ -f .environment_version ]; then
    ENV_VERS=`cat .environment_version`
    if [ $ENV_VERS -eq $environment_version ]; then
      if [ -e ${venv} ]; then
        # If the environment exists and is up-to-date then set our variables
        command_wrapper="${root}/${with_venv}"
        echo "Environment is up to date."
        return 0
      fi
    fi
  fi

  if [ $always_venv -eq 1 ]; then
    install_venv
  else
    if [ ! -e ${venv} ]; then
      echo -e "Environment not found. Install? (Y/n) \c"
    else
      echo -e "Your environment appears to be out of date. Update? (Y/n) \c"
    fi
    read update_env
    if [ "x$update_env" = "xY" -o "x$update_env" = "x" -o "x$update_env" = "xy" ]; then
      install_venv
    else
      # Set our command wrapper anyway.
      command_wrapper="${root}/${with_venv}"
    fi
  fi
}

function sanity_check {
  # Anything that should be determined prior to running the tests, server, etc.
  # Don't sanity-check anything environment-related in -N flag is set
  if [ $never_venv -eq 0 ]; then
    if [ ! -e ${venv} ]; then
      echo "Virtualenv not found at $venv. Did install_venv.py succeed?"
      exit 1
    fi
  fi
  # Remove .pyc files. This is sanity checking because they can linger
  # after old files are deleted.
  find . -name "*.pyc" -exec rm -rf {} \;
}

function backup_environment {
  if [ $backup_env -eq 1 ]; then
    echo "Backing up environment \"$JOB_NAME\"..."
    if [ ! -e ${venv} ]; then
      echo "Environment not installed. Cannot back up."
      return 0
    fi
    if [ -d /tmp/.horizon_environment/$JOB_NAME ]; then
      mv /tmp/.horizon_environment/$JOB_NAME /tmp/.horizon_environment/$JOB_NAME.old
      rm -rf /tmp/.horizon_environment/$JOB_NAME
    fi
    mkdir -p /tmp/.horizon_environment/$JOB_NAME
    cp -r $venv /tmp/.horizon_environment/$JOB_NAME/
    cp .environment_version /tmp/.horizon_environment/$JOB_NAME/
    # Remove the backup now that we've completed successfully
    rm -rf /tmp/.horizon_environment/$JOB_NAME.old
    echo "Backup completed"
  fi
}

function restore_environment {
  if [ $restore_env -eq 1 ]; then
    echo "Restoring environment from backup..."
    if [ ! -d /tmp/.horizon_environment/$JOB_NAME ]; then
      echo "No backup to restore from."
      return 0
    fi

    cp -r /tmp/.horizon_environment/$JOB_NAME/.venv ./ || true
    cp -r /tmp/.horizon_environment/$JOB_NAME/.environment_version ./ || true

    echo "Environment restored successfully."
  fi
}

function install_venv {
  # Install with install_venv.py
  export PIP_DOWNLOAD_CACHE=${PIP_DOWNLOAD_CACHE-/tmp/.pip_download_cache}
  export PIP_USE_MIRRORS=true
  if [ $quiet -eq 1 ]; then
    export PIP_NO_INPUT=true
  fi
  echo "Fetching new src packages..."
  rm -rf $venv/src
  python tools/install_venv.py
  command_wrapper="$root/${with_venv}"
  # Make sure it worked and record the environment version
  sanity_check
  chmod -R 754 $venv
  echo $environment_version > .environment_version
}

function run_tests {
  sanity_check

  if [ $with_selenium -eq 1 ]; then
    export WITH_SELENIUM=1
  elif [ $only_selenium -eq 1 ]; then
    export WITH_SELENIUM=1
    export SKIP_UNITTESTS=1
  fi

  if [ $with_selenium -eq 0 -a $integration -eq 0 ]; then
      testopts="$testopts --exclude-dir=openstack_dashboard/test/integration_tests"
  fi

  if [ -z "$testargs" ]; then
     run_tests_all
  else
     run_tests_subset
  fi
}

function run_tests_subset {
  project=`echo $testargs | awk -F. '{print $1}'`
  ${command_wrapper} python $root/manage.py test --settings=$project.test.settings $testopts $testargs
}

function run_tests_all {
  echo "Running Horizon application tests"
  export NOSE_XUNIT_FILE=horizon/nosetests.xml
  if [ "$NOSE_WITH_HTML_OUTPUT" = '1' ]; then
    export NOSE_HTML_OUT_FILE='horizon_nose_results.html'
  fi
  if [ $with_coverage -eq 1 ]; then
    ${command_wrapper} python -m coverage.__main__ erase
    coverage_run="python -m coverage.__main__ run -p"
  fi
  ${command_wrapper} ${coverage_run} $root/manage.py test horizon --settings=horizon.test.settings $testopts
  # get results of the Horizon tests
  HORIZON_RESULT=$?

  echo "Running openstack_dashboard tests"
  export NOSE_XUNIT_FILE=openstack_dashboard/nosetests.xml
  if [ "$NOSE_WITH_HTML_OUTPUT" = '1' ]; then
    export NOSE_HTML_OUT_FILE='dashboard_nose_results.html'
  fi
  ${command_wrapper} ${coverage_run} $root/manage.py test openstack_dashboard --settings=openstack_dashboard.test.settings $testopts
  # get results of the openstack_dashboard tests
  DASHBOARD_RESULT=$?

  if [ $with_coverage -eq 1 ]; then
    echo "Generating coverage reports"
    ${command_wrapper} python -m coverage.__main__ combine
    ${command_wrapper} python -m coverage.__main__ xml -i --include="horizon/*,openstack_dashboard/*" --omit='/usr*,setup.py,*egg*,.venv/*'
    ${command_wrapper} python -m coverage.__main__ html -i --include="horizon/*,openstack_dashboard/*" --omit='/usr*,setup.py,*egg*,.venv/*' -d reports
  fi
  # Remove the leftover coverage files from the -p flag earlier.
  rm -f .coverage.*

  PEP8_RESULT=0
  if [ $no_pep8 -eq 0 ] && [ $only_selenium -eq 0 ]; then
      run_pep8
      PEP8_RESULT=$?
  fi

  TEST_RESULT=$(($HORIZON_RESULT || $DASHBOARD_RESULT || $PEP8_RESULT))
  if [ $TEST_RESULT -eq 0 ]; then
    echo "Tests completed successfully."
  else
    echo "Tests failed."
  fi
  exit $TEST_RESULT
}

function run_integration_tests {
  export INTEGRATION_TESTS=1

  echo "Running Horizon integration tests..."
  ${command_wrapper} nosetests openstack_dashboard/test/integration_tests/tests
  exit 0
}

function run_makemessages {
  OPTS="-l en --no-obsolete"
  DASHBOARD_OPTS="--extension=html,txt,csv --ignore=openstack"
  echo -n "horizon: "
  cd horizon
  ${command_wrapper} $root/manage.py makemessages $OPTS
  HORIZON_PY_RESULT=$?
  echo -n "horizon javascript: "
  ${command_wrapper} $root/manage.py makemessages -d djangojs $OPTS
  HORIZON_JS_RESULT=$?
  echo -n "openstack_dashboard: "
  cd ../openstack_dashboard
  ${command_wrapper} $root/manage.py makemessages $DASHBOARD_OPTS $OPTS
  DASHBOARD_RESULT=$?
  cd ..
  exit $(($HORIZON_PY_RESULT || $HORIZON_JS_RESULT || $DASHBOARD_RESULT))
}

function run_compilemessages {
  cd horizon
  ${command_wrapper} $root/manage.py compilemessages
  HORIZON_PY_RESULT=$?
  cd ../openstack_dashboard
  ${command_wrapper} $root/manage.py compilemessages
  DASHBOARD_RESULT=$?
  cd ..
  # English is the source language, so compiled catalogs are unnecessary.
  rm -vf horizon/locale/en/LC_MESSAGES/django*.mo
  rm -vf openstack_dashboard/locale/en/LC_MESSAGES/django.mo
  exit $(($HORIZON_PY_RESULT || $DASHBOARD_RESULT))
}

# ---------PREPARE THE ENVIRONMENT------------ #

# PROCESS ARGUMENTS, OVERRIDE DEFAULTS
for arg in "$@"; do
    process_option $arg
done

if [ $quiet -eq 1 ] && [ $never_venv -eq 0 ] && [ $always_venv -eq 0 ]
then
  always_venv=1
fi

# If destroy is set, just blow it away and exit.
if [ $destroy -eq 1 ]; then
  destroy_venv
  exit 0
fi

# Ignore all of this if the -N flag was set
if [ $never_venv -eq 0 ]; then

  # Restore previous environment if desired
  if [ $restore_env -eq 1 ]; then
    restore_environment
  fi

  # Remove the virtual environment if --force used
  if [ $force -eq 1 ]; then
    destroy_venv
  fi

  # Then check if it's up-to-date
  environment_check

  # Create a backup of the up-to-date environment if desired
  if [ $backup_env -eq 1 ]; then
    backup_environment
  fi
fi

# ---------EXERCISE THE CODE------------ #

# Run management commands
if [ $manage -eq 1 ]; then
    run_management_command
    exit $?
fi

# Build the docs
if [ $just_docs -eq 1 ]; then
    run_sphinx
    exit $?
fi

# Update translation files
if [ $makemessages -eq 1 ]; then
    run_makemessages
    exit $?
fi

# Compile translation files
if [ $compilemessages -eq 1 ]; then
    run_compilemessages
    exit $?
fi

# PEP8
if [ $just_pep8 -eq 1 ]; then
    run_pep8
    exit $?
fi

# Pylint
if [ $just_pylint -eq 1 ]; then
    run_pylint
    exit $?
fi

# Tab checker
if [ $just_tabs -eq 1 ]; then
    tab_check
    exit $?
fi

# Integration tests
if [ $integration -eq 1 ]; then
    run_integration_tests
    exit $?
fi

# Django development server
if [ $runserver -eq 1 ]; then
    run_server
    exit $?
fi

# Full test suite
run_tests || exit

#!/bin/bash

set -o errexit

# ---------------UPDATE ME-------------------------------#
# Increment me any time the environment should be rebuilt.
# This includes dependency changes, directory renames, etc.
# Simple integer sequence: 1, 2, 3...
environment_version=42
#--------------------------------------------------------#

function usage {
  echo "Usage: $0 [OPTION]..."
  echo "Run Horizon's test suite(s)"
  echo ""
  echo "  -V, --virtual-env        Always use virtualenv.  Install automatically"
  echo "                           if not present"
  echo "  -N, --no-virtual-env     Don't use virtualenv.  Run tests in local"
  echo "                           environment"
  echo "  -c, --coverage           Generate reports using Coverage"
  echo "  -f, --force              Force a clean re-build of the virtual"
  echo "                           environment. Useful when dependencies have"
  echo "                           been added."
  echo "  -m, --manage             Run a Django management command."
  echo "  --makemessages           Create/Update English translation files."
  echo "  --compilemessages        Compile all translation files."
  echo "  -p, --pep8               Just run pep8"
  echo "  -P, --no-pep8            Don't run pep8 by default"
  echo "  -t, --tabs               Check for tab characters in files."
  echo "  -y, --pylint             Just run pylint"
  echo "  -q, --quiet              Run non-interactively. (Relatively) quiet."
  echo "                           Implies -V if -N is not set."
  echo "  --only-selenium          Run only the Selenium unit tests"
  echo "  --with-selenium          Run unit tests including Selenium tests"
  echo "  --integration            Run the integration tests (requires a running "
  echo "                           OpenStack environment)"
  echo "  --runserver              Run the Django development server for"
  echo "                           openstack_dashboard in the virtual"
  echo "                           environment."
  echo "  --docs                   Just build the documentation"
  echo "  --backup-environment     Make a backup of the environment on exit"
  echo "  --restore-environment    Restore the environment before running"
  echo "  --destroy-environment    Destroy the environment and exit"
  echo "  -h, --help               Print this usage message"
  echo ""
  echo "Note: with no options specified, the script will try to run the tests in"
  echo "  a virtual environment,  If no virtualenv is found, the script will ask"
  echo "  if you would like to create one.  If you prefer to run tests NOT in a"
  echo "  virtual environment, simply pass the -N option."
  exit
}

# DEFAULTS FOR RUN_TESTS.SH
#
root=`pwd -P`
venv=$root/.venv
with_venv=tools/with_venv.sh
included_dirs="openstack_dashboard horizon"

always_venv=0
backup_env=0
command_wrapper=""
destroy=0
force=0
just_pep8=0
no_pep8=0
just_pylint=0
just_docs=0
just_tabs=0
never_venv=0
quiet=0
restore_env=0
runserver=0
only_selenium=0
with_selenium=0
integration=0
testopts=""
testargs=""
with_coverage=0
makemessages=0
compilemessages=0
manage=0

# Jenkins sets a "JOB_NAME" variable, if it's not set, we'll make it "default"
[ "$JOB_NAME" ] || JOB_NAME="default"

function process_option {
  # If running manage command, treat the rest of options as arguments.
  if [ $manage -eq 1 ]; then
     testargs="$testargs $1"
     return 0
  fi

  case "$1" in
    -h|--help) usage;;
    -V|--virtual-env) always_venv=1; never_venv=0;;
    -N|--no-virtual-env) always_venv=0; never_venv=1;;
    -p|--pep8) just_pep8=1;;
    -P|--no-pep8) no_pep8=1;;
    -y|--pylint) just_pylint=1;;
    -f|--force) force=1;;
    -t|--tabs) just_tabs=1;;
    -q|--quiet) quiet=1;;
    -c|--coverage) with_coverage=1;;
    -m|--manage) manage=1;;
    --makemessages) makemessages=1;;
    --compilemessages) compilemessages=1;;
    --only-selenium) only_selenium=1;;
    --with-selenium) with_selenium=1;;
    --integration) integration=1;;
    --docs) just_docs=1;;
    --runserver) runserver=1;;
    --backup-environment) backup_env=1;;
    --restore-environment) restore_env=1;;
    --destroy-environment) destroy=1;;
    -*) testopts="$testopts $1";;
    *) testargs="$testargs $1"
  esac
}

function run_management_command {
  ${command_wrapper} python $root/manage.py $testopts $testargs
}

function run_server {
  echo "Starting Django development server..."
  ${command_wrapper} python $root/manage.py runserver $testopts $testargs
  echo "Server stopped."
}

function run_pylint {
  echo "Running pylint ..."
  PYTHONPATH=$root ${command_wrapper} pylint --rcfile=.pylintrc -f parseable $included_dirs > pylint.txt || true
  CODE=$?
  grep Global -A2 pylint.txt
  if [ $CODE -lt 32 ]; then
      echo "Completed successfully."
      exit 0
  else
      echo "Completed with problems."
      exit $CODE
  fi
}

function run_pep8 {
  echo "Running flake8 ..."
  set +o errexit
  ${command_wrapper} python -c "import hacking" 2>/dev/null
  no_hacking=$?
  set -o errexit
  if [ $never_venv -eq 1 -a $no_hacking -eq 1 ]; then
      echo "**WARNING**:" >&2
      echo "OpenStack hacking is not installed on your host. Its detection will be missed." >&2
      echo "Please install or use virtual env if you need OpenStack hacking detection." >&2
  fi
  DJANGO_SETTINGS_MODULE=openstack_dashboard.test.settings ${command_wrapper} flake8
}

function run_sphinx {
    echo "Building sphinx..."
    export DJANGO_SETTINGS_MODULE=openstack_dashboard.settings
    ${command_wrapper} sphinx-build -b html doc/source doc/build/html
    echo "Build complete."
}

function tab_check {
  TAB_VIOLATIONS=`find $included_dirs -type f -regex ".*\.\(css\|js\|py\|html\)" -print0 | xargs -0 awk '/\t/' | wc -l`
  if [ $TAB_VIOLATIONS -gt 0 ]; then
    echo "TABS! $TAB_VIOLATIONS of them! Oh no!"
    HORIZON_FILES=`find $included_dirs -type f -regex ".*\.\(css\|js\|py|\html\)"`
    for TABBED_FILE in $HORIZON_FILES
    do
      TAB_COUNT=`awk '/\t/' $TABBED_FILE | wc -l`
      if [ $TAB_COUNT -gt 0 ]; then
        echo "$TABBED_FILE: $TAB_COUNT"
      fi
    done
  fi
  return $TAB_VIOLATIONS;
}

function destroy_venv {
  echo "Cleaning environment..."
  echo "Removing virtualenv..."
  rm -rf $venv
  echo "Virtualenv removed."
  rm -f .environment_version
  echo "Environment cleaned."
}

function environment_check {
  echo "Checking environment."
  if [ -f .environment_version ]; then
    ENV_VERS=`cat .environment_version`
    if [ $ENV_VERS -eq $environment_version ]; then
      if [ -e ${venv} ]; then
        # If the environment exists and is up-to-date then set our variables
        command_wrapper="${root}/${with_venv}"
        echo "Environment is up to date."
        return 0
      fi
    fi
  fi

  if [ $always_venv -eq 1 ]; then
    install_venv
  else
    if [ ! -e ${venv} ]; then
      echo -e "Environment not found. Install? (Y/n) \c"
    else
      echo -e "Your environment appears to be out of date. Update? (Y/n) \c"
    fi
    read update_env
    if [ "x$update_env" = "xY" -o "x$update_env" = "x" -o "x$update_env" = "xy" ]; then
      install_venv
    else
      # Set our command wrapper anyway.
      command_wrapper="${root}/${with_venv}"
    fi
  fi
}

function sanity_check {
  # Anything that should be determined prior to running the tests, server, etc.
  # Don't sanity-check anything environment-related in -N flag is set
  if [ $never_venv -eq 0 ]; then
    if [ ! -e ${venv} ]; then
      echo "Virtualenv not found at $venv. Did install_venv.py succeed?"
      exit 1
    fi
  fi
  # Remove .pyc files. This is sanity checking because they can linger
  # after old files are deleted.
  find . -name "*.pyc" -exec rm -rf {} \;
}

function backup_environment {
  if [ $backup_env -eq 1 ]; then
    echo "Backing up environment \"$JOB_NAME\"..."
    if [ ! -e ${venv} ]; then
      echo "Environment not installed. Cannot back up."
      return 0
    fi
    if [ -d /tmp/.horizon_environment/$JOB_NAME ]; then
      mv /tmp/.horizon_environment/$JOB_NAME /tmp/.horizon_environment/$JOB_NAME.old
      rm -rf /tmp/.horizon_environment/$JOB_NAME
    fi
    mkdir -p /tmp/.horizon_environment/$JOB_NAME
    cp -r $venv /tmp/.horizon_environment/$JOB_NAME/
    cp .environment_version /tmp/.horizon_environment/$JOB_NAME/
    # Remove the backup now that we've completed successfully
    rm -rf /tmp/.horizon_environment/$JOB_NAME.old
    echo "Backup completed"
  fi
}

function restore_environment {
  if [ $restore_env -eq 1 ]; then
    echo "Restoring environment from backup..."
    if [ ! -d /tmp/.horizon_environment/$JOB_NAME ]; then
      echo "No backup to restore from."
      return 0
    fi

    cp -r /tmp/.horizon_environment/$JOB_NAME/.venv ./ || true
    cp -r /tmp/.horizon_environment/$JOB_NAME/.environment_version ./ || true

    echo "Environment restored successfully."
  fi
}

function install_venv {
  # Install with install_venv.py
  export PIP_DOWNLOAD_CACHE=${PIP_DOWNLOAD_CACHE-/tmp/.pip_download_cache}
  export PIP_USE_MIRRORS=true
  if [ $quiet -eq 1 ]; then
    export PIP_NO_INPUT=true
  fi
  echo "Fetching new src packages..."
  rm -rf $venv/src
  python tools/install_venv.py
  command_wrapper="$root/${with_venv}"
  # Make sure it worked and record the environment version
  sanity_check
  chmod -R 754 $venv
  echo $environment_version > .environment_version
}

function run_tests {
  sanity_check

  if [ $with_selenium -eq 1 ]; then
    export WITH_SELENIUM=1
  elif [ $only_selenium -eq 1 ]; then
    export WITH_SELENIUM=1
    export SKIP_UNITTESTS=1
  fi

  if [ $with_selenium -eq 0 -a $integration -eq 0 ]; then
      testopts="$testopts --exclude-dir=openstack_dashboard/test/integration_tests"
  fi

  if [ -z "$testargs" ]; then
     run_tests_all
  else
     run_tests_subset
  fi
}

function run_tests_subset {
  project=`echo $testargs | awk -F. '{print $1}'`
  ${command_wrapper} python $root/manage.py test --settings=$project.test.settings $testopts $testargs
}

function run_tests_all {
  echo "Running Horizon application tests"
  export NOSE_XUNIT_FILE=horizon/nosetests.xml
  if [ "$NOSE_WITH_HTML_OUTPUT" = '1' ]; then
    export NOSE_HTML_OUT_FILE='horizon_nose_results.html'
  fi
  if [ $with_coverage -eq 1 ]; then
    ${command_wrapper} coverage erase
    coverage_run="coverage run -p"
  fi
  ${command_wrapper} ${coverage_run} $root/manage.py test horizon --settings=horizon.test.settings $testopts
  # get results of the Horizon tests
  HORIZON_RESULT=$?

  echo "Running openstack_dashboard tests"
  export NOSE_XUNIT_FILE=openstack_dashboard/nosetests.xml
  if [ "$NOSE_WITH_HTML_OUTPUT" = '1' ]; then
    export NOSE_HTML_OUT_FILE='dashboard_nose_results.html'
  fi
  ${command_wrapper} ${coverage_run} $root/manage.py test openstack_dashboard --settings=openstack_dashboard.test.settings $testopts
  # get results of the openstack_dashboard tests
  DASHBOARD_RESULT=$?

  if [ $with_coverage -eq 1 ]; then
    echo "Generating coverage reports"
    ${command_wrapper} coverage combine
    ${command_wrapper} coverage xml -i --include="horizon/*,openstack_dashboard/*" --omit='/usr*,setup.py,*egg*,.venv/*'
    ${command_wrapper} coverage html -i --include="horizon/*,openstack_dashboard/*" --omit='/usr*,setup.py,*egg*,.venv/*' -d reports
  fi
  # Remove the leftover coverage files from the -p flag earlier.
  rm -f .coverage.*

  PEP8_RESULT=0
  if [ $no_pep8 -eq 0 ] && [ $only_selenium -eq 0 ]; then
      run_pep8
      PEP8_RESULT=$?
  fi

  TEST_RESULT=$(($HORIZON_RESULT || $DASHBOARD_RESULT || $PEP8_RESULT))
  if [ $TEST_RESULT -eq 0 ]; then
    echo "Tests completed successfully."
  else
    echo "Tests failed."
  fi
  exit $TEST_RESULT
}

function run_integration_tests {
  export INTEGRATION_TESTS=1

  echo "Running Horizon integration tests..."
  ${command_wrapper} nosetests openstack_dashboard/test/integration_tests/tests
  exit 0
}

function run_makemessages {
  OPTS="-l en --no-obsolete"
  DASHBOARD_OPTS="--extension=html,txt,csv --ignore=openstack"
  echo -n "horizon: "
  cd horizon
  ${command_wrapper} $root/manage.py makemessages $OPTS
  HORIZON_PY_RESULT=$?
  echo -n "horizon javascript: "
  ${command_wrapper} $root/manage.py makemessages -d djangojs $OPTS
  HORIZON_JS_RESULT=$?
  echo -n "openstack_dashboard: "
  cd ../openstack_dashboard
  ${command_wrapper} $root/manage.py makemessages $DASHBOARD_OPTS $OPTS
  DASHBOARD_RESULT=$?
  cd ..
  exit $(($HORIZON_PY_RESULT || $HORIZON_JS_RESULT || $DASHBOARD_RESULT))
}

function run_compilemessages {
  cd horizon
  ${command_wrapper} $root/manage.py compilemessages
  HORIZON_PY_RESULT=$?
  cd ../openstack_dashboard
  ${command_wrapper} $root/manage.py compilemessages
  DASHBOARD_RESULT=$?
  cd ..
  # English is the source language, so compiled catalogs are unnecessary.
  rm -vf horizon/locale/en/LC_MESSAGES/django*.mo
  rm -vf openstack_dashboard/locale/en/LC_MESSAGES/django.mo
  exit $(($HORIZON_PY_RESULT || $DASHBOARD_RESULT))
}

# ---------PREPARE THE ENVIRONMENT------------ #

# PROCESS ARGUMENTS, OVERRIDE DEFAULTS
for arg in "$@"; do
    process_option $arg
done

if [ $quiet -eq 1 ] && [ $never_venv -eq 0 ] && [ $always_venv -eq 0 ]
then
  always_venv=1
fi

# If destroy is set, just blow it away and exit.
if [ $destroy -eq 1 ]; then
  destroy_venv
  exit 0
fi

# Ignore all of this if the -N flag was set
if [ $never_venv -eq 0 ]; then

  # Restore previous environment if desired
  if [ $restore_env -eq 1 ]; then
    restore_environment
  fi

  # Remove the virtual environment if --force used
  if [ $force -eq 1 ]; then
    destroy_venv
  fi

  # Then check if it's up-to-date
  environment_check

  # Create a backup of the up-to-date environment if desired
  if [ $backup_env -eq 1 ]; then
    backup_environment
  fi
fi

# ---------EXERCISE THE CODE------------ #

# Run management commands
if [ $manage -eq 1 ]; then
    run_management_command
    exit $?
fi

# Build the docs
if [ $just_docs -eq 1 ]; then
    run_sphinx
    exit $?
fi

# Update translation files
if [ $makemessages -eq 1 ]; then
    run_makemessages
    exit $?
fi

# Compile translation files
if [ $compilemessages -eq 1 ]; then
    run_compilemessages
    exit $?
fi

# PEP8
if [ $just_pep8 -eq 1 ]; then
    run_pep8
    exit $?
fi

# Pylint
if [ $just_pylint -eq 1 ]; then
    run_pylint
    exit $?
fi

# Tab checker
if [ $just_tabs -eq 1 ]; then
    tab_check
    exit $?
fi

# Integration tests
if [ $integration -eq 1 ]; then
    run_integration_tests
    exit $?
fi

# Django development server
if [ $runserver -eq 1 ]; then
    run_server
    exit $?
fi

# Full test suite
run_tests || exit


Revert "run tests inside venv"

Revert "run tests inside venv"

This reverts commit a5077b5bf2dbb94c6bc8d178a86896017e1635f4.

#!/bin/bash
# TODO: stash changes before doing tests: http://codeinthehole.com/writing/tips-for-using-a-git-pre-commit-hook/

EXITCODE=0

function handle_exit {
    if [ $? -ne 0 ]; then
        EXITCODE=1
    fi
}

echo '====== Running tests ========='
nosetests $@; handle_exit

echo '====== Running flake8 ======'
flake8 *.py; handle_exit
flake8 mrbob; handle_exit

if [ $EXITCODE -ne 0 ]; then
    exit 1
fi

#!/bin/bash
# TODO: stash changes before doing tests: http://codeinthehole.com/writing/tips-for-using-a-git-pre-commit-hook/

EXITCODE=0

function handle_exit {
    if [ $? -ne 0 ]; then
        EXITCODE=1
    fi
}

echo '====== Running tests ========='
bin/nosetests $@; handle_exit

echo '====== Running flake8 ======'
bin/flake8 *.py; handle_exit
bin/flake8 mrbob; handle_exit

if [ $EXITCODE -ne 0 ]; then
    exit 1
fi


update gitlab to 10.2.0-ce.0

update gitlab to 10.2.0-ce.0

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/halexan/msc.git/'


.scripts/functions.bash: added

.scripts/functions.bash: added

# $Id: $HOME/.scripts/functions.bash,v 2014/07/01 09:59:26 -tclover Exp $

# @FUNCTION: die
# @DESCRIPTION: hlper function
# @USAGE: <string>
die() {
	local _ret=$?
	echo "* $@"
	exit $_ret
}

# vim:fenc=utf-8:ft=zsh:ci:pi:sts=0:sw=2:ts=2:

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


Composer install and setup script

Composer install and setup script

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/frontalnugity/atom-configs.git/'


ISIS-2900: adds gitcommit.sh utility script

#!/usr/bin/env bash
usage() {
  echo "$(basename $0): [-A] [-P] message" >&2
  echo "  -A : suppress adding automatically, ie don't call 'git add .'" >&2
  echo "  -p : also push" >&2
}

PUSH=""
ADD=""

while getopts ":hAp" arg; do
  case $arg in
    h)
      usage
      exit 0
      ;;
    A)
      ADD="no-add"
      ;;
    p)
      PUSH="push"
      ;;
    *)
      usage
      exit 1
  esac
done

if [ $# -lt 1 ];
then
  echo $USAGE >&2
  exit 1
fi

shift $((OPTIND-1))

ISSUE=$(git rev-parse --abbrev-ref HEAD | cut -d- -f1,2)
MSG=$*

echo "ISSUE     : $ISSUE"
echo "MSG       : $MSG"
echo "(NO-)ADD  : $ADD"
echo "PUSH      : $PUSH"

if [ -d _pipeline-resources ]
then
  pushd _pipeline-resources || exit
  if [ -z "$ADD" ]
  then
    git add .
  fi
  git commit -m "$ISSUE: ${MSG}"
  if [ -n "$PUSH" ]
  then
    git push
  fi
  popd || exit
fi

if [ -z "$ADD" ]
then
  git add .
fi
git commit -m "$ISSUE: ${MSG}"
if [ -n "$PUSH" ]
then
  git push
fi

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


New: sbo_wwws.sh to search with SBo's form search

#!/usr/bin/env bash

me=$(basename $0)

usage() {
cat << EOF
Usage:
$me string [string2 string3 stringN]

About:
$me acts as a command-line interface to SBo's form search.

Given a string, send a request to http://slackbuilds.org/result/
and display a formated output.

Examples:

  $me php

  $me vim emacs

Notes:

Since this depends on http://slackbuilds.org/result/ (and their
security) you can not use wildcards in the string.
EOF
}

set -e

search() {
    server="http://slackbuilds.org"
    resource="result/?search=$1&sv=13.37"

    lynx -dump "$server/$resource" | grep "$server/repository/" | \
        sed 's/^.*repository/\/usr\/ports/'
}

# MAIN
case $# in
    0)
        usage
        exit 1
        ;;
    1)
        if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
            usage
            exit 1
        else
            search $1 | sed '/\/usr\/ports\/13.37\/$/d'
        fi
        ;;
    *)
        for string in $@; do
            search $string | sed '/\/usr\/ports\/13.37\/$/d'
        done
        ;;
esac

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


a script to compile leveldb with the -fPIC flag

git-svn-id: ab31aa9d750fa55c180f0babe9bbbc56aba70783@14 72a8a67b-58ad-ce6a-cf8f-6a8106eb947b

#!/bin/sh

(cd leveldb-read-only; make OPT='-fPIC -O2 -DNDEBUG')

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


Don't clobber Solaris/OpenIndiana MANPATH

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/psprint/zplugin.git/'


zplugin: A second try to hunt down a bug #135


Add modis download shell script

Add modis download shell script

#!/bin/bash
Rscript 'modis-download/01-modis.download.R'
Rscript 'modis-download/02-modis.process.R'

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


rvm use default if exists

rvm use default if exists

# rvm
if [ -f "$HOME/.rvm/scripts/rvm" ]; then
	source "$HOME/.rvm/scripts/rvm"
	rvm use default > /dev/null
fi

error: pathspec 'zsh/rvm.zsh' did not match any file(s) known to git


- Add script that can generate the build system for applications - Add build system for appres

#!/bin/sh

for each line of symlink.sh
    if line is symlink_app then
	print "symlink_$appname() {"
	print "src_dir $applocation"
	print "dst_dir $appdestination"
	for each c and h file
	    print "    action $filename"
	print
	for each man file
	    print "    action $filename"
	print "}"
	print ""
	print "symlink_app() {"
	print "    symlink_$appname"
    else
	print line

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


Fix reference error and add script for packing pypi package (#1172)

* cycle reference

* script for packing whl

#!/usr/bin/env bash

#
# Copyright 2016 The BigDL Authors.
#
# Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

set -e
RUN_SCRIPT_DIR=$(cd $(dirname $0) ; pwd)
echo $RUN_SCRIPT_DIR
BIGDL_DIR="$(cd ${RUN_SCRIPT_DIR}/../../../../; pwd)"
echo $BIGDL_DIR
BIGDL_PYTHON_DIR="$(cd ${RUN_SCRIPT_DIR}/../../../../pyspark; pwd)"
echo $BIGDL_PYTHON_DIR

if (( $# < 2)); then
  echo "Bad parameters. Uasge: release.sh mac spark_2.x"
  exit -1
fi

platform=$1
spark_profile=$2
quick=$3

bigdl_version=$(python -c "exec(open('$BIGDL_DIR/pyspark/bigdl/version.py').read()); print(__version__)")

cd ${BIGDL_DIR}
if [ "$platform" ==  "mac" ]; then
    echo "Building bigdl for mac system"
    dist_profile="-P mac -P $spark_profile"
    verbose_pname="macosx_10_11_x86_64"
elif [ "$platform" == "linux" ]; then
    echo "Building bigdl for linux system"
    dist_profile="-P $spark_profile"
    verbose_pname="manylinux1_x86_64"
else
    echo "unsupport platform"
fi

bigdl_build_command="${BIGDL_DIR}/make-dist.sh ${dist_profile}"
if [ "$quick" == "true" ]; then
    echo "Skip disting BigDL"
else
    echo "Dist BigDL: $bigdl_build_command"
    $bigdl_build_command
fi

cd $BIGDL_PYTHON_DIR
sdist_command="python setup.py sdist"
echo "packing source code: ${sdist_command}"
$sdist_command

wheel_command="python setup.py bdist_wheel --plat-name ${verbose_pname}"
echo "Packing python distribution:   $wheel_command"
${wheel_command}

upload_command="twine upload dist/BigDL-${bigdl_version}-py2.py3-none-${verbose_pname}.whl"
echo "Please manually upload with this command:  $upload_command"

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


Add xz dependency

Add xz dependency

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/loli10K/scripts.git/'


git-svn: add test for --add-author-from and --use-log-author

This adds a minimalistic set of tests to recently added --add-author-from
option and existing --use-log-author option to git-svn.

Signed-off-by: Junio C Hamano <a6723cc3f76163bf7adb636a73ac3b0ceb3e6b9b@pobox.com>

#!/bin/sh

test_description='git svn authorship'
. ./lib-git-svn.sh

test_expect_success 'setup svn repository' '
	svn checkout "$svnrepo" work.svn &&
	(
		cd work.svn &&
		echo >file
		svn add file
		svn commit -m "first commit" file
	)
'

test_expect_success 'interact with it via git-svn' '
	mkdir work.git &&
	(
		cd work.git &&
		git svn init "$svnrepo"
		git svn fetch &&

		echo modification >file &&
		test_tick &&
		git commit -a -m second &&

		test_tick &&
		git svn dcommit &&

		echo "further modification" >file &&
		test_tick &&
		git commit -a -m third &&

		test_tick &&
		git svn --add-author-from dcommit &&

		echo "yet further modification" >file &&
		test_tick &&
		git commit -a -m fourth &&

		test_tick &&
		git svn --add-author-from --use-log-author dcommit &&

		git log &&

		git show -s HEAD^^ >../actual.2 &&
		git show -s HEAD^  >../actual.3 &&
		git show -s HEAD   >../actual.4

	) &&

	# Make sure that --add-author-from without --use-log-author
	# did not affect the authorship information
	myself=$(grep "^Author: " actual.2) &&
	unaffected=$(grep "^Author: " actual.3) &&
	test "z$myself" = "z$unaffected" &&

	# Make sure lack of --add-author-from did not add cruft
	! grep "^    From: A U Thor " actual.2 &&

	# Make sure --add-author-from added cruft
	grep "^    From: A U Thor " actual.3 &&
	grep "^    From: A U Thor " actual.4 &&

	# Make sure --add-author-from with --use-log-author affected
	# the authorship information
	grep "^Author: A U Thor " actual.4
'

test_done

error: pathspec 't/t9122-git-svn-author.sh' did not match any file(s) known to git


Add .drone.io.sh

Add .drone.io.sh

#!/bin/sh
sudo apt-get update
sudo apt-get install python2.6 python2.6-dev

pip install --use-mirrors --upgrade detox
find src/ -name "*.py" | misspellings -f -
detox

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


Boost micro file download procedure

Boost micro file download procedure

#!/bin/env bash
# Cuz `curl -O -L ` takes 11 key strokes, let's boost!!
# NOTICE: for non-proxy situation, use curldl.sh <url> -x http:// instead
# USAGE: curldl.sh https://exmaple.tld/path/to/resource

PROXY='socks://127.0.0.1:1088'

curl -x $PROXY -O -L $@

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


fix: next(freeglut-svn)

fix: next(freeglut-svn)

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/takeutch-kemeco/private-build-script.git/'


added test post

added test post

curl 'localhost:7070/create?blockType=random'
curl 'localhost:7070/create?blockType=post'
curl 'localhost:7070/create?blockType=tolog'

curl -d '{"Endpoint":"http://localhost:7070/blocks/1/set_rule", "keyMapping":[{"MsgKey": "random_int", "QueryKey": "Period"}] }' 'localhost:7070/blocks/2/set_rule'

curl 'localhost:7070/connect?from=1&to=2'
curl 'localhost:7070/connect?from=1&to=3'

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


python starter added

python starter added

python mami.py &
python zigatova_mami.py &

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


Adding record my desktop

Adding record my desktop

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/ThomasMarcel/fedora-setup.git/'


Obsoleted by soxt-config script.

Obsoleted by soxt-config script.

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/Alexpux/SoXt.git/'


Set HAVE_FLYVIEWER to "true" to build the flyviewer component example.


bnes script added

bnes script added

#!/usr/bin/env bash

set -e

REPO=bnes-libretro
CORE=bnes_libretro
PRGNAM=libretro-bnes
TMP=${TMP:-/tmp}
PKG=$TMP/package-$REPO
BUILD=1

# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i486 ;;
    arm*) ARCH=arm ;;
    # Unless $ARCH is already set, use uname -m for all other archs:
       *) ARCH=$( uname -m ) ;;
  esac
fi

if [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

rm -rf $PKG
rm -rf $TMP/$REPO

mkdir -p $PKG
cd $TMP
git clone https://github.com/libretro/${REPO}.git
cd $REPO

chown -R root:root .
find -L . \
 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  -o -perm 511 \) -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

CWD=`pwd`
VERSION=`git rev-parse --short HEAD`

# Download the core info file from the libretro-super project directly into the package
mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/libretro/info
cd $PKG/usr/lib$LIBDIRSUFFIX/libretro/info
curl -O https://raw.githubusercontent.com/libretro/libretro-super/master/dist/info/${CORE}.info

# build and install the core
cd $CWD
make
mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/libretro
cp libretro.so $PKG/usr/lib$LIBDIRSUFFIX/libretro/bnes_libretro.so

find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

cd $PKG
/sbin/makepkg -l y -c n $TMP/$PRGNAM-$VERSION-$ARCH-${BUILD}.txz

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


bootstrap_upip.sh: Allow to install into a path given by argument.

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/mpalomer/micropython.git/'


[cortana] Add script to renew LE certs, update ZNC cert in place

#!/usr/bin/bash
#
# Renew LetsEncrypt certificates and deploy new certificate to ZNC
#

LE_CERTS='/etc/letsencrypt/live/irc.jwf.io'
ZNC_CERT='/var/lib/znc/.znc/znc.pem'

certbot renew
cat $LE_CERTS/{privkey,cert,chain}.pem > $ZNC_CERT
chmod 440 $ZNC_CERT
systemctl restart znc

error: pathspec 'scripts/cortana/renew_ssl_certs.sh' did not match any file(s) known to git


Create create_fullcert.sh

Create create_fullcert.sh

#!/bin/sh

#
# SSL証明書の発行 (ECC/RSA)
#   (hogehoge.com)
#
# Author: corokada
#

if [ -z "$1" ]; then
  echo "usage:$0 [domain-name]"
  exit 1
fi

DOMAIN=$1

## それぞれ環境に合わせて修正をしてください。
CERTDIR="`dirname $0`/"

# httpdのパス
HTTPD="/usr/sbin/httpd"

# pythonのパス
PYTHON="/usr/bin/python"

# 発行プログラムのパス
SIGNPG="${CERTDIR}acme_tiny.py"

#CONF
CONFFILE=`$HTTPD -S 2>/dev/null | grep "port 80" | grep " $DOMAIN" | tr -d ' ' | cut -d'(' -f2 | cut -d':' -f1`
if [ "$CONFFILE" == "" ]; then
  echo "'$DOMAIN'のヴァーチャルドメイン設定をしてください."
  exit 1
fi

# ドキュメントルート
WEBROOT=`cat $CONFFILE | grep DocumentRoot | sed -e 's/"//g' -e "s/'//g" | awk '{print $2}' | uniq`

## ディレクトリ作成
mkdir -p $WEBROOT/.well-known/acme-challenge/

## BASIC認証回避
echo "Satisfy any"      >> ${WEBROOT}/.well-known/acme-challenge/.htaccess
echo "order allow,deny" >> ${WEBROOT}/.well-known/acme-challenge/.htaccess
echo "allow from all"   >> ${WEBROOT}/.well-known/acme-challenge/.htaccess

# ユーザー認証情報
USERKEY="${CERTDIR}user.key"
if [ ! -f $USERKEY ]; then
  openssl genrsa 4096 > $USERKEY
fi

#
# RSA暗号対応
#
# 秘密鍵作成
RSAKEY="${CERTDIR}${DOMAIN}.key"
if [ ! -f $RSAKEY ]; then
  openssl genrsa 4096 > $RSAKEY
fi

# CSR作成
RSACSR="${CERTDIR}${DOMAIN}.csr"
if [ ! -f $RSACSR ]; then
  openssl req -new -sha256 -key $RSAKEY -subj "/CN=${DOMAIN}" > $RSACSR
fi

# RSA証明書発行処理
RSACERT="${CERTDIR}${DOMAIN}.crt"
RSACA="${CERTDIR}${DOMAIN}.ca-bundle"
RSAFULLCERT="${CERTDIR}${DOMAIN}.crt-ca-bundle"
if [ -f $RSAFULLCERT ]; then
  # 発行済みRSA証明書バックアップ
  AFTER=`openssl x509 -noout -text -dates -in $RSAFULLCERT | grep notAfter | cut -d'=' -f2`
  AFTER=`env TZ=JST-9 date --date "$AFTER" +%Y%m%d-%H%M`
  /bin/cp --force -pr $RSAFULLCERT ${RSAFULLCERT}.limit$AFTER
fi
if [ -f $RSACERT ]; then
  # 発行済みRSA証明書バックアップ
  AFTER=`openssl x509 -noout -text -dates -in $RSACERT | grep notAfter | cut -d'=' -f2`
  AFTER=`env TZ=JST-9 date --date "$AFTER" +%Y%m%d-%H%M`
  /bin/cp --force -pr $RSACERT ${RSACERT}.limit$AFTER
fi
cd $CERTDIR
$PYTHON $SIGNPG --account-key $USERKEY --csr $RSACSR --acme-dir ${WEBROOT}/.well-known/acme-challenge/ > $RSAFULLCERT

#
# サーバー証明書とルート証明書を分ける
#
POS=`grep -n "^$" $RSAFULLCERT | cut -d':' -f1`
POS=$(($POS-1))
sed -n "1,${POS}p" $RSAFULLCERT > $RSACERT

SPOS=`grep -n "^$" $RSAFULLCERT | cut -d':' -f1`
SPOS=$(($SPOS+1))
EPOS=`cat $RSAFULLCERT | wc -l`
sed -n "${SPOS},${EPOS}p" $RSAFULLCERT > $RSACA

#
# 楕円曲線暗号対応
#
if openssl ecparam -list_curves 2>/dev/null | grep -sq prime256v1; then
  # 秘密鍵作成
  ECCKEY="${CERTDIR}${DOMAIN}-ecc.key"
  if [ ! -f $ECCKEY ]; then
    openssl ecparam -name prime256v1 -genkey -out $ECCKEY
  fi

  # CSR作成
  ECCCSR="${CERTDIR}${DOMAIN}-ecc.csr"
  if [ ! -f $ECCCSR ]; then
    openssl req -new -sha256 -key $ECCKEY -subj "/CN=${DOMAIN}" > $ECCCSR
  fi

  # ECC証明書発行処理
  ECCCERT="${CERTDIR}${DOMAIN}-ecc.crt"
  ECCCA="${CERTDIR}${DOMAIN}-ecc.ca-bundle"
  ECCFULLCERT="${CERTDIR}${DOMAIN}-ecc.crt-ca-bundle"
  if [ -f $ECCFULLCERT ]; then
    # 発行済みECC証明書バックアップ
    AFTER=`openssl x509 -noout -text -dates -in $ECCFULLCERT | grep notAfter | cut -d'=' -f2`
    AFTER=`env TZ=JST-9 date --date "$AFTER" +%Y%m%d-%H%M`
    /bin/cp --force -pr $ECCFULLCERT ${ECCFULLCERT}.limit$AFTER
  fi
  if [ -f $ECCCERT ]; then
    # 発行済みECC証明書バックアップ
    AFTER=`openssl x509 -noout -text -dates -in $ECCCERT | grep notAfter | cut -d'=' -f2`
    AFTER=`env TZ=JST-9 date --date "$AFTER" +%Y%m%d-%H%M`
    /bin/cp --force -pr $ECCCERT ${ECCCERT}.limit$AFTER
  fi
  cd $CERTDIR
  $PYTHON $SIGNPG --account-key $USERKEY --csr $ECCCSR --acme-dir ${WEBROOT}/.well-known/acme-challenge/ > $ECCFULLCERT

  #
  # サーバー証明書とルート証明書を分ける
  #
  POS=`grep -n "^$" $ECCFULLCERT | cut -d':' -f1`
  POS=$(($POS-1))
  sed -n "1,${POS}p" $ECCFULLCERT > $ECCCERT

  SPOS=`grep -n "^$" $ECCFULLCERT | cut -d':' -f1`
  SPOS=$(($SPOS+1))
  EPOS=`cat $ECCFULLCERT | wc -l`
  sed -n "${SPOS},${EPOS}p" $ECCFULLCERT > $ECCCA
fi

# 不要ファイル削除
rm -rf ${WEBROOT}/.well-known

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


DEV-Tool: Added a small script to run after a DB change, so that flask-migrate can upgrade DB

#!/bin/bash

if [ ! -z "$1" ]
then
	PASSHPORT_DIR=$1
else
	PASSHPORT_DIR="/home/passhport/passhport"
fi

if [ ! -z $2 ]
then
	PASSHPORT_RUN_ENV=$2
else
	PASSHPORT_RUN_ENV="/home/passhport/passhport-run-env"
fi

PASSHPORT_RUN_ENV_PYTHON_BIN="${PASSHPORT_RUN_ENV}/bin/python3"
PASSHPORT_RUN_ENV_FLASK_BIN="${PASSHPORT_RUN_ENV}/bin/flask"
PASSHPORT_RUN_ENV_PIP_BIN="${PASSHPORT_RUN_ENV}/bin/pip"

ps auxf | grep -e "passhport[d]$" &>/dev/null
if [ $? -eq 0 ]
then
	echo "passhportd daemon seems to be running. Please stop it and launch this script again."
	exit 1
fi

if [ ! -x "${PASSHPORT_RUN_ENV_PYTHON_BIN}" ]
then
	echo "\"${PASSHPORT_RUN_ENV_PYTHON_BIN}\" does not exist, or is not executable."
	exit 1
fi
if [ ! -x "${PASSHPORT_RUN_ENV_FLASK_BIN}" ]
then
	echo "\"${PASSHPORT_RUN_ENV_FLASK_BIN}\" does not exist, or is not executable."
	exit 1
fi
if [ ! -x "${PASSHPORT_RUN_ENV_PIP_BIN}" ]
then
       echo "\"${PASSHPORT_RUN_ENV_PIP_BIN}\" does not exist, or is not executable."
       exit 1
fi

cd "${PASSHPORT_DIR}"
echo -n "Do you want to \"git pull\" from github ? Y/n"
read ANSWER
ANSWER=`echo "${ANSWER}" | tr '[:upper:]' '[:lower:]'`

if [ "${ANSWER}" == y ] || [ -z "${ANSWER}" ]
then
	git pull origin master || exit 1
fi

cd "${PASSHPORT_DIR}/passhportd"

export FLASK_APP=/home/passhport/passhport/passhportd/upgrade-db.py
"${PASSHPORT_RUN_ENV_FLASK_BIN}" db migrate
if [ $? -ne 0 ]
then
	echo "Database migration file creation failed."
	exit 1
fi
echo "Database migration file successfully created."

error: pathspec 'tools/dev-tools/create-db-migration-files.sh' did not match any file(s) known to git


update: xorg-git

update: xorg-git


ruby 2.2.1

ruby 2.2.1

#!/bin/bash

source `dirname $0`/common.sh

docker run -v $OUTPUT_DIR:/tmp/output -v $CACHE_DIR:/tmp/cache -e VERSION=2.2.1 hone/ruby-builder:cedar-14

error: pathspec 'rubies/ruby-2.2.1.sh' did not match any file(s) known to git


script to run network with varying min input len

# token level
for LENGTH in $(seq 10 10 100); do
    if [ $LENGTH -eq 10 ]; then
	python gender.py --gpu --epochs 5 --dropout 0.3 --emb_dim 300 --load_embeddings --flavor ft --suffix wiki --level token --cache_data --min_len $LENGTH --concat
    else
	python gender.py --gpu --epochs 5 --dropout 0.3 --emb_dim 300 --load_embeddings --flavor ft --suffix wiki --level token --load_data --min_len $LENGTH --concat
    fi
done

for LENGTH in $(seq 100 100 500); do
    python gender.py --gpu --epochs 5 --dropout 0.3 --emb_dim 300 --load_embeddings --flavor ft --suffix wiki --level token --load_data --min_len $LENGTH --concat
done

# char level
for LENGTH in $(seq 140 200 1000); do
    if [ $LENGTH -eq 140 ]; then
	python gender.py --gpu --epochs 5 --dropout 0.3 --emb_dim 24 --level char --cache_data --min_len $LENGTH --concat --min_freq 500
    else
	python gender.py --gpu --epochs 5 --dropout 0.3 --emb_dim 24 --level char --load_data --min_len $LENGTH --concat --min_freq 500
    fi
done

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


nas.sh: inital checkin

nas.sh: inital checkin

Signed-off-by: Florian Eckert <ee3e4af9c48a69f5a5c47153eb4a777754bfbe6f@dev.tdt.de>

#!/bin/sh

usage(){
	echo "$(basename "$0"): do enable/disable nas"
	echo "Usage:"
	echo "$(basename "$0") [ start | stop | snapshot ]"
	exit 0
}

main(){
	case "${1}" in
		start)
			ssh root@skynet.lan "/etc/init.d/etherwake start zion"
			;;
		stop)
			ssh root@zion.lan "/sbin/shutdown -h now"
			;;
		snapshot)
			ssh root@zion.lan "/usr/sbin/zfSnap -z -s -S -a 4w -r merkur"
			;;
		*)
			usage
			;;
	esac
}
#bindfs -o ro --mirror-only=feckert /media/feckert/9b8f3224-7ade-45d0-95ea-9c8481f169c6/ /home/feckert/mnt/backup/
#fusermount -u /home/feckert/mnt/backup
main "$@"

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


Add a provision.sh script to re-run the provision process in parallel

#!/bin/sh

MAX_PROCS=4

OIFS=$IFS
IFS=" "
cd `dirname $0`
parallel_provision() {
    while read box; do
        echo "Provisioning '$box'. Output will be in: $box.out.txt" 1>&2
        echo $box
    done | xargs -P $MAX_PROCS -I"BOXNAME" \
        sh -c 'vagrant provision BOXNAME >BOXNAME.out.txt 2>&1 || echo "Error Occurred: BOXNAME"'
}

HOSTS=`vagrant status | grep -e 'running (' | awk -F" " '{print $1}'`
echo $HOSTS | parallel_provision

IFS=$OIFS

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