<filename>app/data/scripts/generate_gene_meta_tables.sh
#!/bin/bash

files_dir=${1}

if [[ -z "$files_dir" ]];then
    echo "No directory provided. Exiting"
    exit 1
else
    echo "Looking for .tsv files in: $files_dir"
fi

for f in $files_dir/*_expr_*.tsv;do
    o=${f/_expr_/_meta_gene_}
    if [[ ! -f "$o" ]];then
        cat $f | head -n 1 | cut -f 1 > $o
        cat $f | tail -n +2 | cut -f 1 | sort | uniq >> $o
        echo "$f --> $o"
    fi
done


make freeze
echo "ckkr2cardiff.github.io" > build/CNAME
git add build
git add static
#git add sitedata
git commit -am "update build"
git push origin
#git subtree push --prefix build origin gh-pages
git push origin `git subtree split --prefix build origin`:gh-pages --force


<reponame>linuxdroid/mininix-packages
MININIX_PKG_HOMEPAGE=https://trac.osgeo.org/geos
MININIX_PKG_DESCRIPTION="GEOS - Geometry Engine"
GEOS_SNAPSHOT=20180414
MININIX_PKG_VERSION=3.6.2.$GEOS_SNAPSHOT
MININIX_PKG_SHA256=c328bc960cda60606d722291eb2e2ae0a85a8e062f2a43f3ffbe275c0108c1a0
MININIX_PKG_SRCURL=https://geos.osgeo.org/snapshots/geos-$GEOS_SNAPSHOT.tar.bz2
MININIX_PKG_DEPENDS="python"
MININIX_PKG_EXTRA_CONFIGURE_ARGS="--enable-python --with-gnu-ld "


<filename>build.sh
rm -r *.o
rm -r ntp

gcc -c ntp.c -o ntp.o
gcc -c ntp_net_linux.c -o ntp_net_linux.o
gcc -c main.c -o main.o

gcc main.o ntp.o ntp_net_linux.o -o ntp


<reponame>HoaiNguyenofficial/AutoPenTest-using-DRL
#! /bin/sh

## File:      testall.sh
## Author:    <NAME> (Changed from XSB's testsuites)
##
## $Id: testall.sh,v 1.4 2010-08-19 15:03:38 spyrosh Exp $

echo "-------------------------------------------------------"
echo "--- Running XMC's testall.sh                        ---"
echo "-------------------------------------------------------"

while test 1=1
do
    case "$1" in
     *-opt*)
	    shift
	    options=$1
	    shift
	    ;;
     *-exclud*)
	    shift
	    excluded_tests=$1
	    shift
	    ;;
     *-add*)
	    shift
	    added_tests=$1
	    shift
	    ;;
     *-only*)
	    shift
	    only_tests=$1
	    shift
	    ;;
      *)
	    break
	    ;;
    esac
done

if test -z "$1" -o $# -gt 1; then
  echo "Usage: testall.sh [-opts opts] [-exclude \"excl_list\"] [-add \"added_tests\"] [-only \"test-list\"] executable"
  echo "where: opts       -- options to pass to XSB executable"
  echo "       excl_list  -- quoted, space-separated list of tests to NOT run"
  echo "       add_list   -- list of additional tests to run"
  echo "       only_list  -- run only this list of tests"
  echo "       executable -- full path name of the XSB executable"
  exit
fi

XSB=$1

# Test if element is a member of exclude list
# $1 - element
# $2 - exclude list
member ()
{
    for elt in $2 ; do
	if test "$1" = "$elt" ; then
	    return 0
	fi
    done
    return 1
}

default_testlist="ABP Leader Sieve Rether Metalock Iproto"

if test -z "$only_tests"; then
    testlist="$default_testlist $added_tests"
else
    testlist=$only_tests
fi
    echo $testlist

# Run each test in $testlist except for the tests in $excluded_tests
for tst in $testlist ; do
  if member "$tst" "$excluded_tests" ; then
    continue
  else
    cd $tst
    if test -f core ; then
	rm -f core
    fi
    ./test.sh "$XSB" "$options"
    cd ..
  fi
done


<reponame>wpwbb510582246/PocketFIlm
#!bin/bash
# 说明
echo '本程序是复制掌上系列jar包，包括掌上、掌上影视、掌上电视、掌上戏曲、掌上小品'
echo ''
echo 对应代码
echo 掌上：www
echo 掌上影视：album
echo 掌上电视：tv
echo 掌上戏曲：drama
echo 掌上小品：piece
echo 示例：
echo 启动全部程序：sh copy_jars.sh
echo 启动掌上影视：sh copy_jars.sh album
echo 启动掌上影视、掌上电视：sh copy_jars.sh album,tv
echo ''

# 程序
string=$1
array=[]
if [ ! $1 ]; then
	string="www,movie,tv,drama,piece,album"
fi
array=(${string//,/ })
# 获取 jar 包
for var in ${array[@]}
do
	# 获取jar包
	echo '正在获取 '$var' 包'
	if [ $var == www ]; then
		cp ../../WWW/target/www-0.0.1-SNAPSHOT.jar ../jars/
	elif [ $var == movie ]; then
		cp ../../Movie/target/movie-0.0.1-SNAPSHOT.jar ../jars/
	elif [ $var == tv ]; then
		cp ../../TV/target/tv-0.0.1-SNAPSHOT.jar ../jars/
	elif [ $var == drama ]; then
		cp ../../Drama/target/drama-0.0.1-SNAPSHOT.jar ../jars/
	elif [ $var == piece ]; then
		cp ../../Piece/target/piece-0.0.1-SNAPSHOT.jar ../jars/
	elif [ $var == album ]; then
		cp ../../Album/target/album-0.0.1-SNAPSHOT.jar ../jars/
	fi
	echo $var' 包获取成功'
done

# 上传 jar 包
if [ ! $1 ]; then
# 将 jar 包上传到服务器
	echo '正在将 jar 包上传到服务器'
	scp ../jars/*.jar root@172.16.17.32:/usr/local/projects/PocketFilm/files/jars/
	echo '已完成'
else
for var in ${array[@]}
do
	# 将 jar 包上传到服务器
	echo '正在将 '$var' 包上传到服务器'
	scp ../jars/${var}-*.jar root@172.16.17.32:/usr/local/projects/PocketFilm/files/jars/
	echo '已完成'
done
fi


#!/bin/bash

# Copyright (c) 2018 Oracle and/or its affiliates. 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.

# ./hack/check-gofmt.sh checks that Go code is correctly formatted according to
# gofmt.

set -o errexit
set -o nounset
set -o pipefail

echo -n "Checking gofmt: "
ERRS=$(find "$@" -type f -name \*.go | xargs gofmt -l 2>&1 || true)
if [ -n "${ERRS}" ]; then
    echo "FAIL - the following files need to be gofmt'ed:"
    for e in ${ERRS}; do
        echo "    $e"
    done
    echo
    exit 1
fi
echo "PASS"


#!/bin/sh

set -e

# Apply all CRD
kubectl apply -f aad-pod-identity/crd

# Deploy Infra
kubectl apply -f aad-pod-identity/deploy/infra/deployment.yaml

#deploy id made in create-azis.sh
kubectl apply -f srcid/aadpodidentity.yaml

#deploy binding
kubectl apply -f srcid/aadpodidentitybinding.yaml


#!/bin/bash

if [ ! -e ./parsec.cfg ]; then
    echo "error: run this script from the Parsec-Integration-With-RetroPie directory"
    exit 1
fi

echo "Made by Kozova1"

wget https://s3.amazonaws.com/parsec-build/package/parsec-rpi.deb
sudo dpkg -i parsec-rpi.deb
sudo rm -rf /etc/emulationstation/themes/carbon/parsec
rm -rf ~pi/.emulationstation/themes/carbon/parsec

if [ -e ~pi/.emulationstation/es_systems.cfg ]; then
  # don't want to add it twice
  if ! grep -q '<name>Parsec</name>' ~/.emulationstation/es_systems.cfg; then
    sed -i '$e cat parsec.cfg' ~/.emulationstation/es_systems.cfg
    echo "Parsec entry added to EmulationStation in ~pi"
  fi
fi

if [ -e /etc/emulationstation/es_systems.cfg ]; then
  # same as above: don't want to add it twice
  if ! grep -q '<name>Parsec</name>' /etc/emulationstation/es_systems.cfg; then
    sudo sed -i '$e cat parsec.cfg' /etc/emulationstation/es_systems.cfg
    echo "Parsec entry added to EmulationStation in /etc"
  fi
fi

if [ -d /etc/emulationstation/themes/carbon ]; then
  sudo cp -Rf ./carbon/. /etc/emulationstation/themes/carbon/
  echo "Carbon theme altered to fit Parsec in ~pi"
fi
if [ -d ~/.emulationstation/themes/carbon ]; then
  cp -Rf ./carbon/. ~/.emulationstation/themes/carbon
  echo "Carbon theme altered to fit Parsec in /etc"
fi
if [ -d /etc/emulationstation/themes/pixel ]; then
  sudo cp -Rf ./carbon/. /etc/emulationstation/themes/pixel/
  echo "Pixel theme altered to fit Parsec in ~pi"
fi
if [ -d ~/.emulationstation/themes/pixel ]; then
  cp -Rf ./carbon/. ~/.emulationstation/themes/pixel
  echo "Pixel theme altered to fit Parsec in /etc"
fi

mkdir -p ~/RetroPie/roms/parsec
cd ~/RetroPie/roms/parsec/
echo 'sudo parsec << EOF' >> Parsec.sh
echo 'y\n' >> Parsec.sh
echo '1\n' >> Parsec.sh
echo 'EOF' >> Parsec.sh
echo "ROM File written"

if [ "$1" != "-nodrv" ]
    then
    sudo apt install xboxdrv
    echo "Unneccessary driver removed, Installed better one."
fi


<gh_stars>1-10
echo only remove kernel if you have a newer one!
sleep 2
sudo apt remove linux-headers-5.8.15-0508015
sudo apt remove linux-image-unsigned-5.8.15-0508015-generic
sudo apt remove linux-modules-5.8.15-0508015-generic
echo linux 5.8.15 is successfully removed


<reponame>qew21/react-diary<gh_stars>0
export PYTHONPATH=. && export DATABASE_URL=sqlite:///db/sqlite3.ln
python app/main.py


<filename>scripts/start-kafka.sh
#!/bin/bash

# Optional ENV variables:
# * ADVERTISED_HOST: the external ip for the container, e.g. `docker-machine ip \`docker-machine active\``
# * ADVERTISED_PORT: the external port for Kafka, e.g. 9092
# * ZK_CHROOT: the zookeeper chroot that's used by Kafka (without / prefix), e.g. "kafka"
# * LOG_RETENTION_HOURS: the minimum age of a log file in hours to be eligible for deletion (default is 168, for 1 week)
# * LOG_RETENTION_BYTES: configure the size at which segments are pruned from the log, (default is 1073741824, for 1GB)
# * NUM_PARTITIONS: configure the default number of log partitions per topic
#https://www.confluent.io/blog/kafka-listeners-explained

# your target file
CONFIG_FILE=$KAFKA_HOME/config/server.properties

HOST_IP=$(grep $HOSTNAME /etc/hosts | awk '{print $1}')

# syntax of sed: s/regexp/replacement/flags FileName
# g - mentioning repeated search of the pattern until end of file is reached.
#If you have a slash / in the variable then use different separator
#https://askubuntu.com/questions/76808/how-do-i-use-variables-in-a-sed-command

# comment target
comment() {
  sed -r -i "s/^$1/#$1/g" $CONFIG_FILE
}

# Uncomment target
uncomment() {
  echo $1
  sed -r -i "s/^#$1/$1/g" $CONFIG_FILE
}

# Set the external host and port
if [ ! -z "$KAFKA_LISTENERS" ]; then
    echo "listner: $KAFKA_LISTENERS"
    uncomment listeners
    if grep -q "^listeners" $CONFIG_FILE; then
        sed -r -i "s|^(listeners)=(.*)|\1=$KAFKA_LISTENERS|g" $CONFIG_FILE
    else
	    echo -e '\n' >> $CONFIG_FILE
        echo "listeners = $KAFKA_LISTENERS" >> $CONFIG_FILE
    fi
fi

if [ ! -z "$KAFKA_ADVERTISED_LISTENERS" ]; then
    ADVERTISED_LISTENERS=$(echo $KAFKA_ADVERTISED_LISTENERS | sed -r "s/HOSTNAME/$HOST_IP/")
    echo "advertised listeners: $ADVERTISED_LISTENERS"
    uncomment advertised.listeners
    if grep -q "^advertised.listeners" $CONFIG_FILE; then
        sed -r -i "s|^(advertised.listeners)=(.*)|\1=$ADVERTISED_LISTENERS|g" $CONFIG_FILE
    else
        echo -e '\n' >> $CONFIG_FILE
        echo "advertised.listeners=$ADVERTISED_LISTENERS" >> $CONFIG_FILE
    fi
fi

# Map between listener names and security protocols.
if [ ! -z "$KAFKA_LISTENER_SECURITY_PROTOCOL_MAP" ]; then
    ADVERTISED_LISTENERS=$(echo $KAFKA_LISTENER_SECURITY_PROTOCOL_MAP | sed -r "s/HOSTNAME/$HOST_IP/")
    echo "listener.security.protocol.map: $KAFKA_LISTENER_SECURITY_PROTOCOL_MAP"
    uncomment listener.security.protocol.map
    if grep -q "^listener.security.protocol.map" $CONFIG_FILE; then
        sed -r -i "s|^(listener.security.protocol.map)=(.*)|\1=$KAFKA_LISTENER_SECURITY_PROTOCOL_MAP|g" $CONFIG_FILE
    else
        echo -e '\n' >> $CONFIG_FILE
        echo "listener.security.protocol.map=$KAFKA_LISTENER_SECURITY_PROTOCOL_MAP" >> $CONFIG_FILE
    fi
fi

# Name of listener used for communication between brokers.
if [ ! -z "$KAFKA_INTER_BROKER_LISTENER_NAME" ]; then
    echo "inter.broker.listener.name: $KAFKA_INTER_BROKER_LISTENER_NAME"
    echo -e '\n' >> $CONFIG_FILE
    echo "inter.broker.listener.name=$KAFKA_INTER_BROKER_LISTENER_NAME" >> $CONFIG_FILE
fi

# stores the logs under /var/log/kafka-logs/<topic.name>-<topic.partition>
echo "log.dir: /var/log/kafka-logs"
echo -e '\n' >> $CONFIG_FILE
echo "log.dir=/var/log/kafka-logs" >> $CONFIG_FILE
echo "log.dirs=/var/log/kafka-logs" >> $CONFIG_FILE
# Kafka Application Log Configuration
#export LOG_DIR=/var/log/kafka
echo 'Kafka application logs set to ' $LOG_DIR

# Set the zookeeper chroot
if [ ! -z "$ZK_CHROOT" ]; then
    # wait for zookeeper to start up
    until /usr/share/zookeeper/bin/zkServer.sh status; do
      sleep 0.1
    done

    # create the chroot node
    echo "create /$ZK_CHROOT \"\"" | /usr/share/zookeeper/bin/zkCli.sh || {
        echo "can't create chroot in zookeeper, exit"
        exit 1
    }

    # configure kafka
    sed -r -i "s/(zookeeper.connect)=(.*)/\1=localhost:2181\/$ZK_CHROOT/g" $CONFIG_FILE
fi

# Allow specification of log retention policies
if [ ! -z "$LOG_RETENTION_HOURS" ]; then
    echo "log retention hours: $LOG_RETENTION_HOURS"
    sed -r -i "s/(log.retention.hours)=(.*)/\1=$LOG_RETENTION_HOURS/g" $CONFIG_FILE
fi
if [ ! -z "$LOG_RETENTION_BYTES" ]; then
    echo "log retention bytes: $LOG_RETENTION_BYTES"
    sed -r -i "s/#(log.retention.bytes)=(.*)/\1=$LOG_RETENTION_BYTES/g" $CONFIG_FILE
fi

# Configure the default number of log partitions per topic
if [ ! -z "$NUM_PARTITIONS" ]; then
    echo "default number of partition: $NUM_PARTITIONS"
    sed -r -i "s/(num.partitions)=(.*)/\1=$NUM_PARTITIONS/g" $CONFIG_FILE
fi

# Enable/disable auto creation of topics
if [ ! -z "$AUTO_CREATE_TOPICS" ]; then
    echo "auto.create.topics.enable: $AUTO_CREATE_TOPICS"
    echo "auto.create.topics.enable=$AUTO_CREATE_TOPICS" >> $CONFIG_FILE
fi

# Run Kafka
$KAFKA_HOME/bin/kafka-server-start.sh $CONFIG_FILE


<reponame>feffes/dendrite
#!/bin/sh

GOBIN=$PWD/`dirname $0`/bin go install -v ./cmd/...


<reponame>cpucorecore/horizon
# eg. bash relay_block.sh 0x6B63f358437882B4dBeAB5a2f39425B851193DC9 15253
elc_contract_addr=$1
block_to_relay=$2
truffle --network ganache exec cli/eth2one-relay.js -e ${elc_contract_addr} --ethurl=http://localhost:8545 --block ${block_to_relay}


<filename>build.sh
#!/usr/bin/env bash

start=$(date +%s)
echo -e "Current repo: $TRAVIS_REPO_SLUG\n"

function error_exit
{
  echo -e "\e[01;31m$1\e[00m" 1>&2
  exit 1
}

if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
  git config --global user.email "<EMAIL>"
  git config --global user.name "<NAME>"

  git clone --depth=1 --branch=site https://$GH_TOKEN@github.com/jgornick/reservedwordsearch /tmp/rws/site

  node ./scripts/generate-words-json.js -w ./words -d /tmp/rws/site/rws/

  cd /tmp/rws/site

  git add .
  git add -u
  git commit -m "Regenerate from jgornick/reservedwordsearch@${TRAVIS_COMMIT}"
  git push origin site
fi

end=$(date +%s)
elapsed=$(( $end - $start ))
minutes=$(( $elapsed / 60 ))
seconds=$(( $elapsed % 60 ))
echo "Post-Build process finished in $minutes minute(s) and $seconds seconds"


<reponame>gowenrw/titanawx
#!/bin/bash

# Install requirements
ansible-galaxy collection install -r ./roles/titan_awx/requirements.yml

# Uncomment this if using vault
# ansible-playbook --vault-password-file ~/.my_ansible_vault ./titan.playbook.yml -i ./titan.inventory

# This version does not use vault
ansible-playbook ./titan.playbook.yml -i ./titan.inventory


# Do it below steps in  every server
# Disable firewall and selinux,
systemctl stop firewalld  && systemctl disable firewalld && setenforce 0 && sed -i 's/enforcing/disabled/g' /etc/selinux/config /etc/selinux/config

# Install packages
wget -O /usr/local/bin/minio https://dl.minio.io/server/minio/release/linux-amd64/minio
chmod +x /usr/local/bin/minio

# Create service file
cat > /lib/systemd/system/minio.service << EOF
[Unit]
Description=minio
Documentation=https://docs.min.io
Wants=network-online.target
After=network-online.target
AssertFileIsExecutable=/usr/local/bin/minio

[Service]
WorkingDirectory=/usr/local/
User=root
Group=root
EnvironmentFile=/etc/default/minio
ExecStart=/usr/local/bin/minio server \$MINIO_OPTS
Restart=always
LimitNOFILE=65536
TimeoutStopSec=infinity
SendSIGKILL=no

[Install]
WantedBy=multi-user.target
EOF

# Create minio enviroment file
cat > /etc/default/minio << EOF
MINIO_OPTS="http://minio01:9000/mnt/VHD http://minio02:9000/mnt/VHD http://minio03:9000/mnt/VHD http://minio04:9000/mnt/VHD"
MINIO_ACCESS_KEY="<KEY>"
MINIO_SECRET_KEY="<KEY>"
EOF

# Start Minio  serivce
$ systemctl daemon-reload && systemctl start minio  && systemctl enable minio && systemctl status minio  | grep active

# Download minio client
$ wget https://dl.min.io/client/mc/release/linux-amd64/mc
$ cp mc /usr/local/bin
$ chmod +x /usr/local/bin/mc

# Add minio cluster to local for working
$ mc config host add minio_local_cluster http://localhost:9000   AKaHEgQ4II0S7BjT6DjAUDA4BX  SKFzHq5iDoQgF7gyPYRFhzNMYSvY6ZFMpH
Added `minio_local_cluster` successfully.

$ mc admin info minio_local_cluster
●  minio01:9000
   Uptime: 22 minutes
   Version: 2020-07-24T22:43:05Z
   Network: 4/4 OK
   Drives: 1/1 OK

●  minio03:9000
   Uptime: 22 minutes
   Version: 2020-07-24T22:43:05Z
   Network: 4/4 OK
   Drives: 1/1 OK

●  minio04:9000
   Uptime: 22 minutes
   Version: 2020-07-24T22:43:05Z
   Network: 4/4 OK
   Drives: 1/1 OK

●  minio02:9000
   Uptime: 22 minutes
   Version: 2020-07-24T22:43:05Z
   Network: 4/4 OK
   Drives: 1/1 OK

40 MiB Used, 1 Bucket, 4 Objects
4 drives online, 0 drives offline

$ mc admin heal minio_local_cluster
Background healing status:
 ●  0 item(s) scanned in total
 ●  Never executed

# For getting detailed info
$ mc admin --json info minio_local_cluster

# Create bucket
$ mc mb minio_local_cluster/mybucket01

# List bucket
$ mc ls  minio_local_cluster/
[2020-07-25 21:38:31 UTC]      0B babak/
[2020-07-25 22:11:06 UTC]      0B mybucket01/
[2020-07-25 22:11:52 UTC]      0B mybucket02/
[2020-07-25 22:11:54 UTC]      0B mybucket03/

# cp files to bucket
mc cp  --recursive   /var/log/*  minio_local_cluster/babak

# List all files in bucket
mc ls --recursive   minio_local_cluster/babak

# Remove older than day ago files, --fake just for dry-run
mc rm --recursive --force --fake --older-than 30m  minio_local_cluster/babak
Removing `minio_local_cluster/babak/install-helm.sh`.
Removing `minio_local_cluster/babak/kafka.sh`.
Removing `minio_local_cluster/babak/zookeeper.sh`.
Removing `minio_local_cluster/babak/zoom_amd64.deb`.

# If you want to configure user-based access-control to buckets then you can use below link
https://docs.min.io/docs/minio-multi-user-quickstart-guide.html


#--------------------------------------------------------------------#
# Start                                                              #
#--------------------------------------------------------------------#

# Start the autosuggestion widgets
_zsh_autosuggest_start() {
	add-zsh-hook -d precmd _zsh_autosuggest_start

	_zsh_autosuggest_bind_widgets

	# Re-bind widgets on every precmd to ensure we wrap other wrappers.
	# Specifically, highlighting breaks if our widgets are wrapped by
	# zsh-syntax-highlighting widgets. This also allows modifications
	# to the widget list variables to take effect on the next precmd.
	add-zsh-hook precmd _zsh_autosuggest_bind_widgets

	if [ -n "${ZSH_AUTOSUGGEST_USE_ASYNC+x}" ]; then
		_zsh_autosuggest_async_start
	fi
}

# Start the autosuggestion widgets on the next precmd
add-zsh-hook precmd _zsh_autosuggest_start


#!/bin/sh

# cd ~/hobbit

WEBLIST=`(cd hobbitd; find webfiles -type f) | egrep -v "RCS|\.svn" | xargs echo`
WWWLIST=`(cd hobbitd; find wwwfiles -type f) | egrep -v "RCS|\.svn" | xargs echo`

(cat build/md5.dat; for F in $WEBLIST $WWWLIST; do echo "`./common/bbdigest md5 hobbitd/$F` $F"; done) | sort -k2 | uniq


<filename>images/jupyter-user/scripts/build_venv.sh<gh_stars>10-100
#!/usr/bin/env bash
set -x

if [ -d "extensions" ]; then
  echo "Building venv for jupyter user"
else
  echo "must be inside images/jupyter-user directory"
fi

if [ -d ".venv" ]; then
  echo "Updating .venv"
else
  echo "creating .venv"
  python3 -m venv .venv
fi

source .venv/bin/activate
pip install -U pip
pip install -r requirements-dev.txt
#jupyter labextension develop extensions/jupyterlab_orbit --overwrite

mkdir -p .workspace
mkdir -p .workspace/shared
mkdir -p .workspace/private
ln -sf ../../../../samples .workspace/shared/samples

pip install --no-deps jupyterhub-kubespawner~=0.15.0
echo "" > `pip  show jupyterhub-kubespawner | grep "Location:" | cut -d ':' -f 2`/kubespawner/__init__.py


<reponame>shansrin/coherence-operator<gh_stars>0
#!/usr/bin/env sh

#!/bin/sh -e -x -u

if [ -z "${WKA}" ] || [ -z "${LISTEN_PORT}" ]; then
  echo "Required WKA environment is not set."
  exit 1
fi

JAVA_OPTS="-Dcoherence.wka=${WKA} \
           -Dcoherence.wka.port=${LISTEN_PORT} \
           -Dcoherence.pof.config=test-pof-config.xml \
           -Dcoherence.cacheconfig=extend-client-cache-config.xml"

if [ -n "${CLUSTER}" ]; then
  JAVA_OPTS="${JAVA_OPTS} -Dcoherence.cluster=${CLUSTER}"
fi

CLASSPATH="/files/conf:/files/lib/*"

CMD="java -cp ${CLASSPATH} ${JAVA_OPTS} ${CLI_OPTS} custom.CloudClient"

echo "Invoking command: ${CMD}"
exec ${CMD}


#!/bin/bash -e

# tile-generator
#
# Copyright (c) 2015-Present Pivotal Software, Inc. 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.

REPO_DIR="$( cd "$( dirname "$0" )/.." && pwd )"
LOCAL_TEST_DIR="${REPO_DIR}/temp_local_test"

"${REPO_DIR}/ci/scripts/run-unittests.sh"

rm -rf "${LOCAL_TEST_DIR}"
mkdir "${LOCAL_TEST_DIR}"

. "${REPO_DIR}/ci/scripts/setup-venv.sh"
"${REPO_DIR}/sample/src/build.sh"

if [ "$1" = "withcache" ]; then
    echo "########################################################"
    echo "# Building a new .pivotal file using cache option.     #"
    echo "########################################################"
    pushd "${REPO_DIR}/sample"
    mkdir -p cache
    tile build --cache cache
    cp product/*.pivotal "${LOCAL_TEST_DIR}"
    cp tile-history*.yml "${LOCAL_TEST_DIR}"
    popd
else
    echo "#############################################################"
    echo "# Creating a new .pivotal file. Use 'withcache' argument to #"
    echo "# build using the cache option for 'tile build'.            #"
    echo "#############################################################"
    "${REPO_DIR}"/ci/scripts/tile-build.sh "${REPO_DIR}"/sample "${REPO_DIR}"/sample "${LOCAL_TEST_DIR}"
fi

"${REPO_DIR}"/ci/scripts/run-acceptancetests.sh "${LOCAL_TEST_DIR}"

rm -rf "${LOCAL_TEST_DIR}"


#!/bin/sh

npm run build

while  [ ! -d dist/proto ]; do sleep 1; done;

cp ../../proto/*.proto ./dist/proto/

npm run start:dev


#!/bin/sh
# Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
# Copyright [2016-2018] EMBL-European Bioinformatics Institute
#
# 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.

while getopts 'd:e' opt; do
  case ${opt} in
    d)  dir=${OPTARG}    ;;
  esac
done

# If requested to run interactively, do not run any jobs concurrently.
if [[ -z ${dir} ]]; then
  dir='.'
fi

# Pombe ontology sources, MOD and PBO are not in this list at the moment.
wget "http://curation.pombase.org/dumps/releases/pombase-chado-latest/pombe-embl/mini-ontologies/fypo_extension.obo" -O $dir/FYPO_EXTENSION.obo
wget "http://curation.pombase.org/dumps/releases/pombase-chado-latest/pombe-embl/mini-ontologies/quiescence.obo" -O $dir/PBQ.obo
wget "http://curation.pombase.org/dumps/releases/pombase-chado-latest/ontologies/go.obo" -O $dir/FYPO_GO.obo
wget "http://curation.pombase.org/dumps/releases/pombase-chado-latest/ontologies/fypo-simple.obo" -O $dir/FYPO.obo
wget "http://curation.pombase.org/dumps/releases/pombase-chado-latest/pombe-embl/mini-ontologies/pombe_mini_PR.obo" -O $dir/PRO.obo
wget "http://curation.pombase.org/dumps/releases/pombase-chado-latest/pombe-embl/mini-ontologies/chebi.obo" -O $dir/CHEBI.obo
wget "http://www.geneontology.org/ontology/obo_format_1_2/gene_ontology.1_2.obo" -O $dir/GO.obo
wget "https://raw.githubusercontent.com/The-Sequence-Ontology/SO-Ontologies/master/so-simple.obo" -O $dir/SO.obo
wget "http://palea.cgrb.oregonstate.edu/viewsvn/Poc/trunk/ontology/OBO_format/plant_ontology.obo?view=co" -O $dir/PO.obo
wget "http://palea.cgrb.oregonstate.edu/viewsvn/Poc/trunk/ontology/collaborators_ontology/gramene/temporal_gramene.obo?view=co" -O $dir/GRO.obo
wget "http://palea.cgrb.oregonstate.edu/viewsvn/Poc/trunk/ontology/collaborators_ontology/gramene/taxonomy/GR_tax-ontology.obo?view=co" -O $dir/GR_TAX.obo
wget "http://obo.cvs.sourceforge.net/viewvc/obo/obo/ontology/phenotype/environment/environment_ontology.obo?view=co" -O $dir/EO.obo
wget "http://palea.cgrb.oregonstate.edu/viewsvn/Poc/trunk/ontology/collaborators_ontology/gramene/traits/trait.obo?view=co" -O $dir/TO.obo
wget "http://svn.code.sf.net/p/efo/code/trunk/src/efoinobo/efo.obo" -O $dir/EFO.obo
wget "http://sourceforge.net/p/pombase/code/HEAD/tree/phenotype_ontology/peco.obo?format=raw" -O $dir/PECO.obo
wget "http://purl.obolibrary.org/obo/cl-basic.obo" -O $dir/CL.obo
wget "https://raw.githubusercontent.com/pato-ontology/pato/master/pato.obo" -O $dir/PATO.obo
wget "https://raw.githubusercontent.com/OGMS/ogms/master/src/ontology/ogms.obo" -O $dir/OGMS.obo
wget "http://www.brenda-enzymes.info/ontology/tissue/tree/update/update_files/BrendaTissueOBO" -O $dir/BTO.obo
wget "https://raw.githubusercontent.com/BFO-ontology/BFO/master/releases/2.0/bfo.obo" -O $dir/BFO.obo
wget "https://raw.githubusercontent.com/bio-ontology-research-group/unit-ontology/master/unit.obo" -O $dir/UO.obo
wget "https://raw.githubusercontent.com/evidenceontology/evidenceontology/master/eco.obo" -O $dir/ECO.obo
wget --no-check-certificate "https://build.berkeleybop.org/job/build-mp-edit/lastSuccessfulBuild/artifact/src/ontology/mp.obo/*view*/" -O $dir/MP.obo
wget "ftp://ftp.rgd.mcw.edu/pub/ontology/clinical_measurement/clinical_measurement.obo" -O $dir/CMO.obo
wget "http://purl.obolibrary.org/obo/hp.obo" -O $dir/HPO.obo
wget "https://raw.githubusercontent.com/AnimalGenome/vertebrate-trait-ontology/master/VT_v8.2" -O $dir/VT.obo


<filename>ci/prepare.sh
#! /bin/sh
#
# Copyright 2019 <NAME>. or its subsidiaries
#
# 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

TOP_DIR=$(readlink -f $(dirname $0)/../)

rm -rf $TOP_DIR/poky
mkdir $TOP_DIR/poky
wget --no-check-certificate -O $TOP_DIR/poky/poky-2.6.tar.bz2 "https://downloads.yoctoproject.org/releases/yocto/yocto-2.6/poky-thud-20.0.0.tar.bz2"
echo 'ef3d4305054282938bfe70dc5a08eba8a701a22b49795b1c2d8ed5aed90d0581 *poky/poky-2.6.tar.bz2' | sha256sum -c

wget --no-check-certificate -O $TOP_DIR/poky/poky-3.1.tar.bz2 "http://downloads.yoctoproject.org/releases/yocto/yocto-3.1/poky-dunfell-23.0.0.tar.bz2"
echo 'c1f4a486e5f090dbdf50c15a5d22afa6689bd609604b48d63eb0643ad58eb370 *poky/poky-3.1.tar.bz2' | sha256sum -c

mkdir $TOP_DIR/poky/2.6 $TOP_DIR/poky/3.1
echo "Extracting..."
tar -xf $TOP_DIR/poky/poky-2.6.tar.bz2 -C $TOP_DIR/poky/2.6 --strip-components=1
tar -xf $TOP_DIR/poky/poky-3.1.tar.bz2 -C $TOP_DIR/poky/3.1 --strip-components=1
ln -s ../../pyrex-init-build-env $TOP_DIR/poky/2.6/
ln -s ../../pyrex-init-build-env $TOP_DIR/poky/3.1/


<reponame>tardate/LittleCodingKata
#!/bin/sh
# starts prometheus in a Docker container

CONTAINER_NAME=demoserver
IMAGE_NAME=prom/prometheus
PACKAGE_ROOT="$(cd "$(dirname "$0")"; pwd)/${CONTAINER_NAME}"

function shutdown() {
  echo "Stopping/removing any previous docker container.."
  docker stop ${CONTAINER_NAME}
  docker rm ${CONTAINER_NAME}
}

function startup() {
  echo "Starting ${CONTAINER_NAME} prometheus container with web access on port 9090.."
  docker run -d -p 9090:9090 --name=${CONTAINER_NAME} \
    -v ${PACKAGE_ROOT}/demo_targets.json:/etc/prometheus/demo_targets.json:ro \
    -v ${PACKAGE_ROOT}/prometheus.yml:/etc/prometheus/prometheus.yml:ro \
    ${IMAGE_NAME}
}

ACTION=${1:-start}

case ${ACTION} in

start)
  shutdown
  startup
  ;;

stop)
  shutdown
  ;;

shell)
  docker exec -it ${CONTAINER_NAME} sh
  ;;

logs)
  docker logs ${CONTAINER_NAME}
  ;;

*)
  echo "$0 start|stop|shell|logs"
  ;;

esac


<reponame>tanikawa04/lstm-transformer
#!/bin/sh

case "$1" in
"LSTMTransformer")
  echo "Train LSTM+Transformer model."
  python -O src/train.py \
    --data data/wikitext-103 \
    --model LSTMTransformer \
    --emsize 512 \
    --nhid 1024 \
    --nlayers 5 \
    --clip 5.0 \
    --epochs 5 \
    --batch_size 16 \
    --bptt 64 \
    --dropout 0.1 \
    --seed 1111 \
    --cuda \
    --val-interval 5000 \
    --log-interval 100 \
    --save models/lstmtransformer.pth \
    --tb-log logs/lstmtransformer \
    --nhead 8
  ;;
"Transformer")
  echo "Train Transformer model."
  python -O src/train.py \
    --data data/wikitext-103 \
    --model Transformer \
    --emsize 512 \
    --nhid 1024 \
    --nlayers 6 \
    --clip 5.0 \
    --epochs 5 \
    --batch_size 16 \
    --bptt 64 \
    --dropout 0.1 \
    --seed 1111 \
    --cuda \
    --val-interval 5000 \
    --log-interval 100 \
    --save models/transformer.pth \
    --tb-log logs/transformer \
    --nhead 8
  ;;
"LSTM")
  echo "Train LSTM model."
  python -O src/train.py \
    --data data/wikitext-103 \
    --model LSTM \
    --emsize 512 \
    --nhid 512 \
    --nlayers 3 \
    --step-size 1 \
    --clip 5.0 \
    --epochs 5 \
    --batch_size 16 \
    --bptt 64 \
    --dropout 0.2 \
    --seed 1111 \
    --cuda \
    --val-interval 5000 \
    --log-interval 100 \
    --save models/lstm.pth \
    --tb-log logs/lstm
  ;;
*)
  echo "Usage:"
  echo "./train.sh {LSTMTransformer,Transformer,LSTM}"
  ;;
esac


#!/bin/sh

/usr/local/openwrt/staging_dir/host/usr/bin/phpize --clean && /usr/local/openwrt/staging_dir/host/usr/bin/phpize && \
./configure --with-php-config=/usr/local/openwrt/staging_dir/host/usr/bin/php-config  '--target=mips-openwrt-linux' '--host=mips-openwrt-linux' '--build=x86_64-linux-gnu' '--exec-prefix=/vagrant/src/phpsrc/staging/usr' 'build_alias=x86_64-linux-gnu' 'host_alias=mips-openwrt-linux' 'target_alias=mips-openwrt-linux' \
TOOLCHAIN_DIR="/usr/local/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2" \
STAGING_DIR="/usr/local/openwrt/staging_dir/target-mips_34kc_uClibc-0.9.33.2" \
TARGET_DIR="/usr/local/openwrt/build_dir/target-mips_34kc_uClibc-0.9.33.2/php-5.6.16" \
CC="mips-openwrt-linux-uclibc-gcc" \
CFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float"  \
LDFLAGS="-L$TARGET_DIR/usr/lib -L$TARGET_DIR/lib -L$TOOLCHAIN_DIR/usr/lib -L$TOOLCHAIN_DIR/lib -L$TARGET_DIR/usr/lib/libiconv-stub/lib -L$TARGET_DIR/usr/lib/libintl-stub/lib -L$STAGING_DIR/usr/lib" \
CPPFLAGS="-I$TARGET_DIR/usr/include -I$TARGET_DIR/include -I$TOOLCHAIN_DIR/usr/include -I$TOOLCHAIN_DIR/include -I$TARGET_DIR/usr/lib/libiconv-stub/include -I$TARGET_DIR/usr/lib/libintl-stub/include -I$STAGING_DIR/usr/include" \
CXX="mips-openwrt-linux-uclibc-g++" \
CXXFLAGS="-Os  -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float" \
LIBTOOL='/usr/local/openwrt/tools/libtool --tag=CC' \
PWM_DIR='/usr/local/openwrt/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr'


<reponame>zapatero-cldr/edge2ai-workshop<filename>setup/terraform/close-registration.sh
#!/bin/bash
set -o errexit
set -o nounset
BASE_DIR=$(cd $(dirname $0); pwd -L)
source $BASE_DIR/common.sh

function syntax() {
  echo "Syntax: $0 <namespace>"
  show_namespaces
}

if [ $# -lt 1 ]; then
  syntax
  exit 1
fi
NAMESPACE=$1
load_env $NAMESPACE

echo "Closing public access to the web server"
web_sg=$(security_groups web)
remove_ingress "$web_sg" 0.0.0.0/0 tcp 80 force

echo "Processing remaining access grants"
$BASE_DIR/sync-ip-addresses.sh "${NAMESPACE}" 2>/dev/null


#!/bin/bash

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

tmp_ssh_file="$(mktemp)"

terraform output host_ssh_key > $tmp_ssh_file

chmod 400 $tmp_ssh_file

ssh -i $tmp_ssh_file ubuntu@$(terraform output grocy_host)


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

COLOR_RED="\033[0;31m"
COLOR_GREEN="\033[0;32m"
COLOR_OFF="\033[0m"

printInfo() {
    printf "$COLOR_GREEN$1 $COLOR_OFF \n"
}

printError() {
    printf "$COLOR_RED$1 $COLOR_OFF \n"
}

loadEnvConfig() {
    local DEPLOYENV=$1
    local DEPLOYMENT_CONFIG_FILE="$CONFIG_FOLDER/deployment.$DEPLOYENV"

    if [ ! -e $DEPLOYMENT_CONFIG_FILE ]; then
        printf "$COLOR_RED Unknown Environment: $DEPLOYENV $COLOR_OFF \n"
        exit 1
    fi

    source $DEPLOYMENT_CONFIG_FILE
}

ask() {
    local DEFAULT=1
    local DEFAULT_TEMPLATE="(Y/N=Default)"

    case ${2:-} in
        [0] ) DEFAULT=0; DEFAULT_TEMPLATE="(Y=Default/N)";;
        * ) DEFAULT=1;;
    esac

    printf "$COLOR_GREEN$1 $COLOR_OFF \n"
    read -p "Answer: $DEFAULT_TEMPLATE: " yn

    case $yn in
        [Yy]* ) return 0;;
        [Nn]* ) return 1;;
        * ) return $DEFAULT;;
    esac
}

executeSSH() {
    local SCRIPT=$1

   /bin/drone-ssh --host "$DEPLOY_HOST" \
    --port "$DEPLOY_PORT" \
    --username "$DEPLOY_USER" \
    --script "$SCRIPT"
}

callRecipeEvent() {
    local RECIPE=$1
    local FILE=$RECIPES_FOLDER/$RECIPE/$2.sh

    if [ -f "$FILE" ]; then
        $FILE
        return $?
    fi

    return 0
}


IPNAME=${1:-my-external-ip}

echo "Reserving an External Global IP as '$IPNAME'"
gcloud compute addresses create $IPNAME \
    --ip-version=IPV4 \
    --global
IP=$(gcloud compute addresses describe $IPNAME \
    --format="get(address)" \
    --global)

echo "$IPNAME has been created"
echo "Configure your DNS to point your FQDN $IP"


#!/bin/sh

bindir="${DESTDIR}${1}"

# Do not create bindir, because if it is not there now, we have a problem
cp "${MESON_SOURCE_ROOT}/tools/libinput-list-devices.compat" "${bindir}/libinput-list-devices"
cp "${MESON_SOURCE_ROOT}/tools/libinput-debug-events.compat" "${bindir}/libinput-debug-events"


<filename>docker/tools/yum_upload/setup_yum_repo_upload.sh<gh_stars>0
#!/bin/bash -e

mkdir -p /home/couchbase/.aws /home/couchbase/.ssh

# Copy needed GPG and AWS credential files from /ssh into .ssh and .aws,
# ensure ownership and permissions are correct
if [[ ! -d /ssh ]] || [[ ! "$(ls -A /ssh)" ]]
then
    echo "Missing key configuration files in /ssh"
    exit 1
else
    cp -a /ssh/*.gpg /home/couchbase/.ssh
    cp -a /ssh/GPG-KEY-COUCHBASE-1.0 /home/couchbase/.ssh
    cp -a /ssh/aws-credentials /home/couchbase/.aws/credentials
fi

chown -R couchbase:couchbase /home/couchbase/.aws /home/couchbase/.ssh
chmod 600 /home/couchbase/.aws/* /home/couchbase/.ssh/*

[[ "$1" == "debug" ]] && {
    shift
    exec "$@"
}

# Run repo_upload program with 'yum' option
cd /home/couchbase
exec /usr/local/bin/repo_upload -c /etc/repo_upload.ini -r yum "$@"


<gh_stars>0
#!/bin/bash
# Manually emulate ionic/cordova application
# <NAME> 2014

echo "Emulating..."
cd ./platforms/ios/build/emulator
var=$(pwd)

ios-sim launch "$var"/*.app


<gh_stars>1-10
# This file will selectively autopass some commits.

# At present bumps to the GUI only are auto passed.

# shellcheck disable=SC1091
. tests/framework/utils/fake_pass.sh

check_for_autopass() {
    # currently defined tests:
    # integration-tests-existing-filesystem-configuration
    # integration-tests-shared-storage-configuration
    # test-services
    # upgrade-tests
    # unit-tests
    # vvvvvvvvvvv this should come from a pragma in the commit message
    local all_tests="integration-tests-existing-filesystem-configuration
                     integration-tests-shared-storage-configuration
                     test-services
                     unit-tests
                     upgrade-tests"
    local commit_message tests_to_run
    commit_message=$(git log -n 1)
    tests_to_run=$(echo "$commit_message" | sed -ne '/^ *Run-tests:/s/^ *Run-tests: *//p')
    if [ -n "$tests_to_run" ]; then
        tests_to_skip=$all_tests
        for t in $tests_to_run; do
            tests_to_skip=${tests_to_skip/$t/}
        done
    else
        tests_to_skip=$(echo "$commit_message" | sed -ne '/^ *Skip-tests:/s/^ *Skip-tests: *//p')
    fi

    # set any environment the test run wants
    local environment
    environment=$(echo "$commit_message" | sed -ne '/^ *Environment:/s/^ *Environment: *//p')
    if [ -n "$environment" ]; then
        # shellcheck disable=SC2163
        # shellcheck disable=SC2086
        export ${environment?}
    fi

    copr_modules=$(echo "$commit_message" | sed -ne '/^ *COPR Module: */s/^ *COPR Module: *\(.*\)\/\(.*\)/https:\/\/copr.fedorainfracloud.org\/coprs\/\1\/\2\/repo\/epel-7\/\1-\2-epel-7.repo/gp')
    if [ -n "$copr_modules" ]; then
        export STORAGE_SERVER_REPOS="$copr_modules $STORAGE_SERVER_REPOS"
    fi

    local t
    for t in $tests_to_skip; do
        if [[ $JOB_NAME == "$t" || $JOB_NAME == "$t/*" ]]; then
            echo "skipping this test due to {Run|Skip}-tests pragma"
            fake_test_pass "tests_skipped_because_commit_pragma" "$WORKSPACE/test_reports/" "$BUILD_NUMBER"
            exit 1
        fi
    done

    # regex matches separated by |
    supported_distro_versions="7\\.[0-9]+"
    if [[ ! $TEST_DISTRO_VERSION =~ $supported_distro_versions ]] && ([ -z "$UPGRADE_TEST_DISTRO" ] || [[ ! $UPGRADE_TEST_DISTRO =~ $supported_distro_versions ]]); then
      fake_test_pass "tests_skipped_because_unsupported_distro_$TEST_DISTRO_VERSION" "$WORKSPACE/test_reports/" "$BUILD_NUMBER"
      exit 0
    fi

}  # end of check_for_autopass()


#!/bin/bash
#
# Copyright 2020-2021 Xilinx, Inc.
#
# 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.
#
#
# Copyright 2020-2021 Xilinx, Inc.
#
# 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.
#

gsql_command="java -jar $HOME/gsql_client/gsql_client.jar"
function gsql () {
     $gsql_command "$@"
}

function usage() {
    echo "Usage: $0 -u TG-username -p TG-password [optional options]"
    echo "Optional options:"
    echo "  -a alveoProject      : Alveo partition project basename. It can include a path (.e.g /path/to/alveo_proj"
	echo "  -c compileMode       : 0: skip database creation and gsql compilation"
	echo "                         1: recreate database and compile all (default)"
	echo "                         2: only compile query gsql"
	echo "  -x partitionMode          : 0: Use existing partitions from disks; "
	echo "                         1: Generate partitions from TigerGraph memory"
	echo "                         2: Generate partitions from .mtx file"
	echo "                         3: Generate partitions from TigerGraph using whole-graph technique (default)"
	echo "  -r runMode           : 0: Skip both CPU and Alveo run (i.e. only run partition)"
	echo "                         1: Run only on CPU"
	echo "                         2: Run only on Alveo (default)"
	echo "                         3: Run on both CPU and Alveo"
    echo "  -d numDevices        : number of FPGAs needed (default=1)"
    echo "  -f                   : Force (re)install"
    echo "  -g graphName         : graph name (default=social_<username>"
    echo "  -i sshKey            : SSH key for user tigergraph"
    echo "  -n numPartitionsNode : Number of Alveo partitions "
    echo "  -s dataSource        : A .mtx file containing input graph. default=../data/as-Skitter-r100.mtx"
    echo "  -o                   : Generate output log files. Log file path and name:"
    echo "                         CPU run: ~tigergraph/output-cpu.log"
    echo "                         Alveo run: ~tigergraph/output_alveo.txt.clustInfo"
    echo "  -v                   : Print verbose messages"
    echo "  -h                   : Print this help message"
}

tg_home=$(readlink -f ~tigergraph)
tg_data_root=$(cat $tg_home/.tg.cfg | jq .System.DataRoot | tr -d \")

# default values for optional options
username=$USER
password=<PASSWORD>
data_source="$script_dir/../data/as-Skitter-wt-r100.mtx"
num_nodes=$(cat $tg_data_root/gsql/udf/xilinx-plugin-config.json | jq .numNodes | tr -d \")
num_partitions_node=1
verbose=0
xgraph="social_$username"
force_clean=0
compile_mode=1
partition_mode=3
run_mode=2
force_clean_flag=
verbose_flag=
gen_outfile=0
alveo_prj=""

# set default ssh_key for tigergraph
if [ -f ~/.ssh/tigergraph_rsa ]; then
    ssh_key_flag="-i ~/.ssh/tigergraph_rsa"
fi

while getopts "c:fg:i:lm:n:p:r:s:u:vx:ha:" opt
do
case $opt in
    a) alveo_prj=$OPTARG;;
    c) compile_mode=$OPTARG;;
    f) force_clean=1; force_clean_flag=-f;;
    g) xgraph=$OPTARG;;
    i) ssh_key=$OPTARG; ssh_key_flag="-i $ssh_key";;
    m) num_nodes=$OPTARG;;
    n) num_partitions_node=$OPTARG;;
    o) gen_outfile=1;;
    p) password=$OPTARG;;
    r) run_mode=$OPTARG;;
    s) data_source=$OPTARG;;
    u) username=$OPTARG;;
    v) verbose=1; verbose_flag=-v;;
    x) partition_mode=$OPTARG;;
    h) usage; exit 0;;
    ?) echo "ERROR: Unknown option: -$OPTARG"; usage; exit 1;;
esac
done

if [ -z "$username" ] || [ -z "$password" ]; then
    echo "ERROR: username and password are required."
    usage
    exit 2
fi

if [ -z "$alveo_prj" ]; then
    echo "ERROR: Alveo project must be specified."
    usage
    exit 3
fi
# need to download gsql client first before using it to check for other error conditions
#if [ ! -f "$HOME/gsql-client/gsql_client.jar" ]; then
#    mkdir -p $HOME/gsql-client
#    wget -o wget.log -O $HOME/gsql-client/gsql_client.jar \
#        'https://dl.bintray.com/tigergraphecosys/tgjars/com/tigergraph/client/gsql_client/3.1.0/gsql_client-3.1.0.jar'
#    echo "INFO: Downloaded the latest gsql client"
#fi

if [ $(gsql -u $username -p $password "show user" | grep -c $username) -lt 1 ]; then
    echo "ERROR: TigerGraph user $username does not exist."
    echo "Please create the user by logging in as user tigergraph and doing:"
    echo "    gsql \"create user\""
    echo "supplying $username for User Name."
    echo "Additionally, if you plan on creating graphs and installing queries, please also do:"
    echo "    gsql \"grant role globaldesigner to $username\""
    exit 3
fi

if [ $verbose -eq 1 ]; then
    echo "INFO: username=$username"
    echo "      password=$password"
    echo "      dataSource=$data_source"
    echo "      alveo_prj=$alveo_prj"
    echo "      numPartitionsNode=$num_partitions_node"
    echo "      xgraph=$xgraph"
    echo "      numNodes=$num_nodes"
    echo "      compileMode=$compile_mode"
    echo "      partitionMode=$partition_mode"
    echo "      runMode=$run_mode"
    echo "      sshKey=$ssh_key"
fi


<gh_stars>1-10
#!/usr/bin/env bash

# File:      software/install/install_conda_environment.sh
# By:        <NAME>
# For:       Myself
# Usage:     cd ~/workspace/TSO_project/software/jetson && bash install/install_conda_environment.sh

CONDA_ENV_NAME="school"
PYTHON_VERSION="3.7"
ONNX_VERSION="1.4.1"
PYTORCH_VERSION="1.7"
TORCHVISION_VERSION="0.8"

conda update --yes --name base --channel defaults conda && \
conda create --yes --name ${CONDA_ENV_NAME} --channel pytorch --channel conda-forge --channel esri numpy==1.19.5 pandas opencv matplotlib pycocotools tqdm onnx=${ONNX_VERSION} cupy lxml pybind11 imagesize jupyterlab ipywidgets widgetsnbextension scipy scikit-learn imgaug albumentations tensorflow-gpu tensorflow-estimator tensorflow-datasets tensorflow-addons keras keras-applications keras-preprocessing pytorch=${PYTORCH_VERSION} torchvision=${TORCHVISION_VERSION} tensorboard cudatoolkit pip python=${PYTHON_VERSION} && \
conda init bash && \
source activate ${CONDA_ENV_NAME} && \
if [[ "$(echo $PS1 | cut -d' ' -f1 | tr -d '()')" == "${CONDA_ENV_NAME}" ]]
then
    yes | python -m pip install --upgrade cvlib onnxruntime scikit-multilearn && \
    yes | python -m pip install -e pyuarm
else
    echo "Could not source activate ${CONDA_ENV_NAME}..."
fi


<filename>entrypoint.sh<gh_stars>0
#!/usr/bin/env bash
set -x # enable debug
set -e # fail fast
# simple script to cancel a github actions workflow given its name

if [ -z "$GITHUB_TOKEN" ]
then
  echo "Must specify GITHUB_TOKEN"
  exit 1
fi

if [ -z "$GITHUB_REPOSITORY" ]
then
  echo "Must specify GITHUB_REPOSITORY"
  exit 1
fi

if [ -z "$GITHUB_RUN_ID" ]
then
  echo "Must specify GITHUB_RUN_ID"
  exit 1
fi

GITHUB_API=https://api.github.com

auth_header="Authorization: token ${GITHUB_TOKEN}"
accept_header="Accept: application/vnd.github.v3+json"

function extractMetaInformation() {
  jq "{ workflow_id: .workflow_id, branch: .head_branch, repo: .head_repository.full_name}"
}

function convertToKeyValuePairs() {
  jq -r "to_entries | map(\"\(.key)=\(.value | tostring)\") | .[]"
}

function getRunningWorkflowIds() {
  local workflow_ids=$(jq ".workflow_runs | .[] | select(.head_branch==\"${branch}\" and .head_repository.full_name==\"${repo}\" and .status==\"in_progress\" or .status==\"queued\" or .status== \"waiting\") | .id ")
  local condition="<"
  for id in $workflow_ids; do
    if [[ "$id" -gt "$GITHUB_RUN_ID" ]]; then
      condition="<="
      break
    fi
  done
  echo $workflow_ids | jq "select( . "$condition" "$GITHUB_RUN_ID" )"
}

function exportAll() {
  for var in $1; do
    export $var
  done
}

# extract meta information for current workflow run
exportAll "$(curl -s "${GITHUB_API}/repos/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" -H "${auth_header}" -H "${accept_header}" | extractMetaInformation | convertToKeyValuePairs)"
echo "workflow id: $workflow_id"
echo "branch: $branch"
echo "repo: $repo"

# get the run ids for runs on same branch/repo
run_ids=$(curl -s ${GITHUB_API}/repos/${GITHUB_REPOSITORY}/actions/workflows/${workflow_id}/runs -H "${auth_header}" -H "${accept_header}" | getRunningWorkflowIds)

echo "run ids: ${run_ids}"

# cancel the previous runs
for run_id in $run_ids; do
  curl -s -X POST -H "${auth_header}" -H "${accept_header}" ${GITHUB_API}/repos/${GITHUB_REPOSITORY}/actions/runs/${run_id}/cancel
  echo "Cancelled run $run_id"
done


# platform = Red Hat Enterprise Linux 6

# Include source function library.
. /usr/share/scap-security-guide/remediation_functions

rhel6_perform_audit_adjtimex_settimeofday_stime_remediation


<filename>docs/dind/nrooms-start.sh<gh_stars>0
#!/bin/sh

#
# wait for docker to start
#

until docker ps
do
  echo "waiting for docker..."
  sleep 1
done

#
# create traefik network
#

docker network create --attachable traefik

#
# (re)start traefik
#

docker stop traefik
docker rm traefik
docker run -d \
    --restart unless-stopped \
    --name traefik \
    --network=traefik \
    -p "80:80" \
    -v "/var/run/docker.sock:/var/run/docker.sock:ro" \
    -e "TZ=${TZ}" \
    traefik:2.4 \
      --providers.docker=true \
      --providers.docker.watch=true \
      --providers.docker.exposedbydefault=false \
      --providers.docker.network=traefik \
      --entrypoints.web.address=:80;

# pull some neko images...
docker pull m1k1o/neko:firefox
docker pull m1k1o/neko:chromium

#
# (re)start neko-rooms
#

docker stop nrooms
docker rm nrooms
docker run -t \
    --restart unless-stopped \
    --name nrooms \
    --network=traefik \
    -v "/var/run/docker.sock:/var/run/docker.sock" \
    -v "/data:/data" \
    -e "TZ=${TZ}" \
    -e "NEKO_ROOMS_EPR=${NEKO_ROOMS_EPR}" \
    -e "NEKO_ROOMS_NAT1TO1=${NEKO_ROOMS_NAT1TO1}" \
    -e "NEKO_ROOMS_INSTANCE_URL=${NEKO_ROOMS_INSTANCE_URL}" \
    -e "NEKO_ROOMS_TRAEFIK_DOMAIN=*" \
    -e "NEKO_ROOMS_TRAEFIK_ENTRYPOINT=web" \
    -e "NEKO_ROOMS_TRAEFIK_NETWORK=traefik" \
    -e "NEKO_ROOMS_STORAGE_ENABLED=true" \
    -e "NEKO_ROOMS_STORAGE_INTERNAL=/data" \
    -e "NEKO_ROOMS_STORAGE_EXTERNAL=/data" \
    -l "traefik.enable=true" \
    -l "traefik.http.services.neko-rooms-frontend.loadbalancer.server.port=8080" \
    -l "traefik.http.routers.neko-rooms.entrypoints=web" \
    -l 'traefik.http.routers.neko-rooms.rule=HostRegexp(`{host:.+}`)' \
    -l 'traefik.http.routers.neko-rooms.priority=1' \
    m1k1o/neko-rooms:latest;


#!/bin/bash

if [ $(whoami) != "root" ]; then
    echo 'You are not root.'
    echo 'You need to be root authority to execute.'
    exit 1
fi

curl -sSL https://get.docker.com | sh
apt remove --purge -y docker-ce docker-ce-cli containerd.io
apt install -y docker-ce=18.06.3~ce~3-0~raspbian
apt-mark hold docker-ce

usermod -aG docker pi

echo
echo 'Done.'
echo 'You should reboot your Raspberry Pi.'

exit 0


<reponame>bbonenfant/avr-dot-games<filename>flash.sh
#! /usr/bin/env bash
avrdude -v -p atmega328p -P /dev/ttyACM0 -c arduino -b 115200 -D -U flash:w:target/avr-atmega328p/release/dot_games.elf:e


#!/usr/bin/sh

tee -a /etc/dnf/dnf.conf <<EOF
fastestmirror=True
max_parallel_downloads=10
keepcache=True
EOF


#!/bin/bash

# Downloads the needed APKs (using wget), installs them to the current device (using adb),
# and configures them (using adb). The configuring consists of permission assignment
# and running Kõnele's GetPutPreferenceActivity to change the Kõnele settings.
# Work in progress (relies on an unreleased version of Kõnele).

cmd=adb
basedir=$(mktemp -d)

ver_k6nele=1.6.98
ver_ekispeak=1.2.03
ver_trigger=0.1.21
ver_launcher=0.0.2

fakedir=$HOME/Desktop/APK/

function download {
    echo "wget -P $basedir $1"
    wget -P $basedir $1
}

$cmd connect Android.local

echo "Installing Kõnele..."
download https://github.com/Kaljurand/K6nele/releases/download/v${ver_k6nele}/K6nele-${ver_k6nele}.apk
##cp $fakedir/K6nele-${ver_k6nele}.apk $basedir
$cmd install $basedir/K6nele-${ver_k6nele}.apk
$cmd shell pm grant ee.ioc.phon.android.speak android.permission.RECORD_AUDIO

echo "Installing Speech Trigger..."
download https://github.com/Kaljurand/speech-trigger/releases/download/v${ver_trigger}/SpeechTrigger-${ver_trigger}.apk
$cmd install $basedir/SpeechTrigger-${ver_trigger}.apk
$cmd shell pm grant ee.ioc.phon.android.speechtrigger android.permission.RECORD_AUDIO
$cmd shell pm grant ee.ioc.phon.android.speechtrigger android.permission.WRITE_EXTERNAL_STORAGE

echo "Installing EKI Speak..."
download https://github.com/Kaljurand/EKISpeak/releases/download/v${ver_ekispeak}/EKISpeak-${ver_ekispeak}.apk
$cmd install $basedir/EKISpeak-${ver_ekispeak}.apk

echo "Installing Things Kõnele Launcher..."
download https://github.com/Kaljurand/things-k6nelelauncher/releases/download/v${ver_launcher}/things-k6nelelauncher-${ver_launcher}.apk
$cmd install $basedir/things-k6nelelauncher-${ver_launcher}.apk
$cmd shell pm grant ee.ioc.phon.android.things.k6nelelauncher com.google.android.things.permission.USE_PERIPHERAL_IO

echo "Installed the following APKs:"
ls -l $basedir
$cmd shell 'pm list packages'

echo "Installation done. Reboot using: adb shell reboot"
echo "or start the app by: adb shell am start -n ee.ioc.phon.android.things.k6nelelauncher/.ActivityLauncherActivity"


<reponame>CristiRO/Monalisa<filename>MonaLisa/Repository/buildWSClients.sh
#!/bin/bash

#- tomcat curat
#- axis curat
#- mysql-store
#- webapps
#- jstoreclient
#- libs (mysql, ml, axis)
#- deploy

# current configuration. change this to your liking
TOMCAT="tomcat"
AXIS="axis-1_1"
DEST="monalisaWSClients"
###################################################

#make sure no leftovers are here
rm -rf ${DEST} ${DEST}.tgz

#init
mkdir ${DEST}
mkdir ${DEST}/lib
mkdir ${DEST}/conf

#- axis
for jar in jaxrpc saaj axis commons-discovery commons-logging log4j-1.2.8 wsdl4j; do
    cp ${AXIS}/lib/${jar}.jar ${DEST}/lib
done

#- scripts
cp -r ws-scripts/* ${DEST}
chmod a+x ${DEST}/install.sh
mv ${DEST}/MWS.sh ${DEST}/conf/MWS.sh

#- WS clients
cp -r ../Clients/WS ${DEST}/WS-Clients

#make the tarball
tar -czf ${DEST}.tgz ${DEST}

#cleanup
rm -rf ${DEST}


<filename>pod.sh
pod trunk push MPDebug.podspec --allow-warnings


#!/bin/bash
#
#===============================================================================
# Last modified: March 19, 2017
#
# Creates a website link for Markdown documents. Instead of typing a bunch of
# things, it is much better to use a script that automates the creation of
# website links. See below for usage details.
#===============================================================================

if [[ $# == 2 ]]; then

   http=$1
   name=$2

   #echo "${name}: ${http}"

   weblink="
[${name}](${http})
"

elif [[ $# == 1 ]]; then

   http=$1

   #echo "${http}"

   weblink="
[${http}](${http})
"

else
   echo ""
   echo "Usage:"
   echo ""
   echo "   $0 http_link [link_name]"
   echo ""
   echo "Examples:"
   echo ""
   echo "   $0 http://www.google.com Google"
   echo ""
   echo "   $0 http://www.google.com 'Click here to go to Google'"
   echo ""
   echo "   $0 http://www.google.com"
   echo ""
   exit 0
fi

echo ""
echo $weblink
echo ""

#
# End of script
#


<filename>mounted-space/refresh.sh<gh_stars>0
#!/usr/bin/env bash
cd /mounted-space/app/frappe-bench/  && bench clear-cache  && bench update --build && bench migrate


#!/usr/bin/env bash

curl -H "Content-Type: application/json" -d '
{
  "user": "U 2"
}' http://localhost:9090/engines/test_ur/queries
echo

curl -H "Content-Type: application/json" -d '
{
  "user": "U 2",
  "rules": [
    {
       "name": "categories",
       "values": ["Tablets", "Phones"],
       "bias": -1
    }
  ]
}' http://localhost:9090/engines/test_ur/queries
echo


<filename>hack/container/docker-push.sh
#!/bin/bash

set -e

VERSION="${1:-devel}"

echo "$QUAY_BOT_PASS" | docker login -u="$QUAY_BOT_USER" --password-stdin quay.io
docker build -t quay.io/fromani/kubevirt-metrics-collector:$VERSION .
docker push quay.io/fromani/kubevirt-metrics-collector:$VERSION
docker logout quay.io


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

echo "Importing signing key..."
openssl aes-256-cbc -K $encrypted_4b7d603e7466_key -iv $encrypted_4b7d603e7466_iv -in build/signing.key.enc -out build/signing.key -d

gpg --version
gpg --batch --import build/signing.key
rm build/signing.key

echo "Signing key import finished!"


#!/bin/sh
# <NAME> - 2017
#
# Security fix for RHSA-2011:0838
#
# Security announcement date: 2011-05-31 15:05:29 UTC
# Script generation date:     2017-01-01 21:13:08 UTC
#
# Operating System: Red Hat 5
# Architecture: x86_64
#
# Vulnerable packages fix on version:
#   - gimp-debuginfo.i386:2.2.13-2.0.7.el5_6.2
#   - gimp-libs.i386:2.2.13-2.0.7.el5_6.2
#   - gimp.x86_64:2.2.13-2.0.7.el5_6.2
#   - gimp-debuginfo.x86_64:2.2.13-2.0.7.el5_6.2
#   - gimp-libs.x86_64:2.2.13-2.0.7.el5_6.2
#   - gimp-devel.i386:2.2.13-2.0.7.el5_6.2
#   - gimp-devel.x86_64:2.2.13-2.0.7.el5_6.2
#
# Last versions recommanded by security team:
#   - gimp-debuginfo.i386:2.2.13-3.el5_10
#   - gimp-libs.i386:2.2.13-3.el5_10
#   - gimp.x86_64:2.2.13-3.el5_10
#   - gimp-debuginfo.x86_64:2.2.13-3.el5_10
#   - gimp-libs.x86_64:2.2.13-3.el5_10
#   - gimp-devel.i386:2.2.13-3.el5_10
#   - gimp-devel.x86_64:2.2.13-3.el5_10
#
# CVE List:
#   - CVE-2009-1570
#   - CVE-2010-4540
#   - CVE-2010-4541
#   - CVE-2010-4542
#   - CVE-2010-4543
#   - CVE-2011-1178
#
# More details:
#   - https://www.cyberwatch.fr/vulnerabilites
#
# Licence: Released under The MIT License (MIT), See LICENSE FILE
sudo yum install gimp-debuginfo.i386-2.2.13 -y
sudo yum install gimp-libs.i386-2.2.13 -y
sudo yum install gimp.x86_64-2.2.13 -y
sudo yum install gimp-debuginfo.x86_64-2.2.13 -y
sudo yum install gimp-libs.x86_64-2.2.13 -y
sudo yum install gimp-devel.i386-2.2.13 -y
sudo yum install gimp-devel.x86_64-2.2.13 -y


<filename>workflow/report.sh
# HTML
mkdir -p report
mkdir -p report/v003
snakemake -s workflow/download.smk --report report/v003/download.html
snakemake -s workflow/preprocess_known_human.smk --report report/v003/preprocess_known_human.html
snakemake -s workflow/preprocess_known_otherspecies.smk --report report/v003/preprocess_known_otherspecies.html
snakemake -s workflow/preprocess_putative_human.smk --report report/v003/preprocess_putative_human.html
snakemake -s workflow/preprocess_putative_otherspecies.smk --report report/v003/preprocess_putative_otherspecies.html
snakemake -s workflow/preprocess_putative_allspecies.smk --report report/v003/preprocess_putative_allspecies.html
snakemake -s workflow/csv.smk --report report/v003/csv.html
snakemake -s workflow/sqlite.smk --report report/v003/sqlite.html
snakemake -s workflow/metadata.smk --report report/v003/metadata.html
snakemake -s workflow/plot.smk --report report/v003/plot.html


<reponame>heuermh/benchmarks
#!/bin/bash

#
# Copyright 2019 held jointly by the individual 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 -x

#ADAM="adam-shell"
ADAM="../../adam/bin/adam-shell"
#ADAM="adam-shell --conf spark.kryo.registrationRequired=true"

SAMPLE="NA12878.alignedHg38.duplicateMarked.baseRealigned"
export INPUT="$SAMPLE.alignments.adam"
export OUTPUT="$SAMPLE.out.bam"

time ($ADAM -i convert_parquet_alignments_adam_dataset.scala &> /dev/null)
rm -Rf $OUTPUT

time ($ADAM -i convert_parquet_alignments_adam_rdd.scala &> /dev/null)
rm -Rf $OUTPUT

time ($ADAM -i convert_parquet_alignments_disq_adam.scala &> /dev/null)
rm -Rf $OUTPUT

#time ($ADAM -i convert_parquet_alignments_disq_convert.scala &> /dev/null)
#rm -Rf $SAMPLE.alignments.adam

export OUTPUT="$SAMPLE.out.cram"

# https://github.com/bigdatagenomics/adam/issues/2214

#time ($ADAM -i convert_parquet_alignments_adam_dataset.scala &> /dev/null)
#rm -Rf $OUTPUT

#time ($ADAM -i convert_parquet_alignments_adam_rdd.scala &> /dev/null)
#rm -Rf $OUTPUT

#time ($ADAM -i convert_parquet_alignments_disq_adam.scala &> /dev/null)
#rm -Rf $OUTPUT

#time ($ADAM -i convert_parquet_alignments_disq_convert.scala &> /dev/null)
#rm -Rf $SAMPLE.alignments.adam

time ($ADAM -i count_parquet_alignments_adam_dataframe.scala &> /dev/null)
time ($ADAM -i count_parquet_alignments_adam_dataset.scala &> /dev/null)
time ($ADAM -i count_parquet_alignments_adam_rdd.scala &> /dev/null)
time ($ADAM -i count_parquet_alignments_sparksql.scala &> /dev/null)

time ($ADAM -i filter_parquet_alignments_adam_dataset.scala &> /dev/null)
time ($ADAM -i filter_parquet_alignments_adam_rdd.scala &> /dev/null)
time ($ADAM -i filter_parquet_alignments_sparksql.scala &> /dev/null)

time ($ADAM -i range_filter_parquet_alignments_adam_dataset.scala &> /dev/null)
time ($ADAM -i range_filter_parquet_alignments_adam_rdd.scala &> /dev/null)
time ($ADAM -i range_filter_parquet_alignments_sparksql.scala &> /dev/null)

export INPUT="$SAMPLE.alignments.1m.adam"

time ($ADAM -i range_filter_parquet_alignments_adam_partitioned_dataset.scala &> /dev/null)
time ($ADAM -i range_filter_parquet_alignments_adam_partitioned_rdd.scala &> /dev/null)
time ($ADAM -i range_filter_parquet_alignments_adam_partitioned_dataset.scala &> /dev/null)
time ($ADAM -i range_filter_parquet_alignments_adam_partitioned_rdd.scala &> /dev/null)

export INPUT="$SAMPLE.alignments.adam"
export OUTPUT="$SAMPLE.out.alignments.adam"

time ($ADAM -i rw_parquet_alignments_adam_dataframe.scala &> /dev/null)
rm -Rf $OUTPUT

time ($ADAM -i rw_parquet_alignments_adam_dataset.scala &> /dev/null)
rm -Rf $OUTPUT

time ($ADAM -i rw_parquet_alignments_adam_rdd.scala &> /dev/null)
rm -Rf $OUTPUT


<filename>scripts/wait_for_images.sh
#!/usr/bin/env bash

set -e

log() {
    local level=$1
    shift
    echo "$(date -u -Ins) - $level - $*"
}

IFS='#' read -ra cip <<< "$1"
block_docker=${cip[0]}
block_singularity=${cip[1]}

log DEBUG "Block for Docker images: $block_docker"
log DEBUG "Block for Singularity images: $block_singularity"

if [ -n "$block_docker" ]; then
    log INFO "blocking until Docker images ready: $block_docker"
    IFS=',' read -ra RES <<< "$block_docker"
    declare -a missing
    while :
        do
        for image in "${RES[@]}";  do
            if [ -z "$(docker images -q "$image" 2>/dev/null)" ]; then
                missing=("${missing[@]}" "$image")
            fi
        done
        if [ ${#missing[@]} -eq 0 ]; then
            log INFO "all Docker images present"
            break
        else
            unset missing
        fi
        sleep 1
    done
fi

if [ -n "$block_singularity" ]; then
    log INFO "blocking until Singularity images ready: $block_singularity"
    log DEBUG "Singularity cache dir: ${SINGULARITY_CACHEDIR}"
    IFS=',' read -ra RES <<< "$block_singularity"
    declare -a missing
    while :
        do
        for image in "${RES[@]}";  do
            if [ ! -f "${SINGULARITY_CACHEDIR}/${image}" ]; then
                missing=("${missing[@]}" "$image")
            fi
        done
        if [ ${#missing[@]} -eq 0 ]; then
            log INFO "all Singularity images present"
            break
        else
            unset missing
        fi
        sleep 1
    done
fi


<gh_stars>0
#!/bin/sh

set -e
SCRIPT_DIR=`realpath $(dirname "$0")`

cd $SCRIPT_DIR/..

WATERSTREAM_LB=`terraform output waterstream_lb`

cd $SCRIPT_DIR

mosquitto_pub -h $WATERSTREAM_LB -p 1883 -t "sample_topic" -i mosquitto_l_ta2 -q 0 -m "Hello, world!" \
      --cafile tls/waterstream_demo_ca.pem


<reponame>PeteDiMarco/misc-tools
#!/bin/bash
#***************************************************************************
#* Copyright 2019 <NAME>
#*
#* 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.
#***************************************************************************
#
# Name: myhelp.sh
# Version: 0.1
# Date: 2019-10-14
# Written by: <NAME> <<EMAIL>>
#
# Description:
# A "super help" command that tries to identify the name(s) provided on the
# commandline.
#
# See also:
# http://mywiki.wooledge.org/BashFAQ/081
#
# Dependencies:
# man, file, type, which, alias, info, ps

# Defaults:
DEBUG=false
FOUND=false				# Found something about current argument.
my_name=$(basename "$0")		# This script's name.
my_shell=$(basename "$BASH")		# This script's shell.
preferred_shell=$(basename "$SHELL")	# User's shell from passwd.
declare -A ALIASES=()			# Hash of aliases to values.
declare -A PACKAGES=()			# Hash of package types to package lists.

NO_SUCH_FILE_REGEX='.*No such file or directory.*'
SHELL_VAR_REGEX='^\$.+$'

# We need a temporary file to store the output of `alias`.
temp_file=$(mktemp /tmp/${my_name}.XXXXXX)
trap "rm -f $temp_file" 0 2 3 15

# Are we being sourced?
(return 0 2>/dev/null) && SOURCED=1 || SOURCED=0

#***************************************************************************
# Functions
#***************************************************************************

#***************************************************************************
# Name:         print_declare
# Description:  Uses the `declare` built-in to determine if $1 is a declared
#               variable or function.  Prints the results.
# Parameters:   $1: Name to look for.
# Globals:      FOUND
# Returns:      None
#***************************************************************************
print_declare () {
    local retval value attrs attr name full_desc='' desc
    local -A attr_desc

    # Map `declare` attributes to descriptions.
    attr_desc['-']='shell variable'
    attr_desc['a']='indexed array'
    attr_desc['A']='associative array'
    attr_desc['i']='integer'
    attr_desc['r']='read-only'
    attr_desc['x']='exported'

    # Extract attributes followed by NAME or NAME=VALUE:
    retval=$( declare -p "$1" 2>/dev/null | grep '^declare ' | \
              sed -e 's/^declare \(-[^ ]*\) \(.*\)$/\1 \2/')
    if [[ $? -eq 0 ]] && [[ -n "${retval}" ]]; then
        debug_msg "print_declare: retval=${retval}"
        attrs=$( sed -e 's/^-\([^ ]*\) .*$/\1/' <<< $retval | sed -e 's/\(.\)/\1 /g' )
        name=$( sed -e 's/^[^ ]* //' <<< $retval )
        value=''
        if [[ "${name}" == *=* ]]; then
          value=$( sed -e 's/^[^=]*=//' <<< $name )
          name=$( sed -e 's/=.*$//' <<< $name )
        fi

        # For each attribute, add its description to full_desc:
        for attr in ${attrs}; do
            desc="${attr_desc[$attr]}"
            if [[ -n "${desc}" ]]; then
                if [[ -z "${full_desc}" ]]; then
                    full_desc="${desc}"
                else
                    full_desc="${full_desc}, ${desc}"
                fi
            else
                echo "Unknown attribute: ${attr}"
            fi
        done

        # Print results:
        echo "$1 is declared with the following attributes: ${full_desc}"
        if [[ -n "${value}" ]]; then
            echo "$1 has the value: ${value}"
            FOUND=true
        fi
    fi

    # Look for shell functions:
    retval=$(declare -f "$1")
    if [[ $? -eq 0 ]]; then
        echo "$1 is declared as a function."
        FOUND=true
    fi
}

#***************************************************************************
# Name:         parse_type
# Description:  Parses the output of the `type` built-in.  Prints the results.
# Parameters:   $1: Text to parse.
#               $2: Name being examined.
# Globals:      FOUND
# Returns:      3 if the type is unrecognized.
#***************************************************************************
parse_type () {
    local length index=0
    local -a array

    debug_msg "parse_type $1 $2"
    IFS=$'\r\n' read -ra array <<< "$1"
    length=${#array[@]}
    while [[ $index < $length ]]; do
        debug_msg "${index} -> ${array[$index]}"
        case "${array[$index]}" in
            *\ is\ a\ function)
                echo ${array[$index]}
                FOUND=true
                ;;

            *\ is\ a\ shell\ keyword)
                echo ${array[$index]}
                FOUND=true
                help -d "$2"
                ;;

            *\ is\ a\ shell\ builtin)
                echo ${array[$index]}
                FOUND=true
                help -d "$2"
                ;;

            *\ is\ aliased\ to\ *)
                echo ${array[$index]}
                FOUND=true
                ;;

            *\ is\ hashed\ \(*)
                echo 'WARNING: ' ${array[$index]} '.  USE "hash -r" TO CLEAR.'
                FOUND=true
                ;;

            *\ \(\))
                index=$((index + 1))
                while [[ ! ${array[$index]} =~ ^\}\s*$ ]]; do
                    index=$((index + 1))
                done
                ;;

            *\ is\ *)
                filename=$( sed -e 's/^.* is //' <<< ${array[$index]} )
                echo "$2 is the executable file $filename"
                FOUND=true
                ;;

            *)
                echo "ERROR: Unrecognized type: $1"
                return 3
                ;;
        esac
        index=$((index + 1))
    done
}

#***************************************************************************
# Name:         debug_msg
# Description:  Prints the message if $DEBUG is true.
# Parameters:   $1: Message.
# Globals:      DEBUG
# Returns:      None.
#***************************************************************************
debug_msg () {
    if [[ "$DEBUG" = true ]]; then
        echo 'DEBUG: '"$1"
    fi
}

#***************************************************************************
# Name:         print_help
# Description:  Prints the help text and exits the script.
# Parameters:   None.
# Globals:      my_name
# Returns:      None.
#***************************************************************************
print_help () {
    cat <<HelpInfoHERE
Usage: ${my_name} [-h] [-D] [-a] name1 [name2 ...]

Identifies the names provided.  Tries every test imaginable.  Looks for:
man pages, info pages, executables in PATH, aliases, shell variables, running
processes, shell functions, built-in shell commands, and files relative to
the current working directory.  If called in its own subshell, this script will
not be able to identify variables from the parent shell unless they are
exported.  To get around this, use either:
    source ${my_name} name1 ...
or pipe the current aliases into the script:
    alias | ${my_name} -a name1 ...

Optional Arguments:
  -h, --help            Show this help message and exit.
  -a, --aliases         Read a list of aliases from standard input.
  -D, --DEBUG	        Set debugging mode.
HelpInfoHERE
}

#***************************************************************************
# Name:         check_variable
# Description:  Checks if parameter is a shell variable.  If it is, prints
#               its value.
# Parameters:   $1: Possible shell variable.
# Globals:      FOUND
# Returns:      None.
#***************************************************************************
check_variable () {
    local reference
    export bad_sub_test=$1
    # Must check in sub-shell first to catch "bad substitution" errors.
    bash -c 'echo "${!bad_sub_test}" 2>&1 >/dev/null' >/dev/null 2>&1
    if [[ $? -eq 0 ]]; then
        reference=${!1}       # If $1 is a shell variable, what is its value?
        if [[ -n "${reference}" ]]; then
            echo "There is a shell variable named ${1} with value: ${reference}"
            FOUND=true
        fi
    fi
}

#***************************************************************************
# Name:         print_file_type
# Description:  Checks if parameter is a file.  Prints its file type.
# Parameters:   $1: One or more possible file names.
# Globals:      FOUND
# Returns:      None.
#***************************************************************************
print_file_type () {
    local retval line
    for line in "$1"; do
        retval=$( file -b "${line}" )
        if [[ $? -eq 0 ]] && ! [[ "${retval}" =~ $NO_SUCH_FILE_REGEX ]]; then
            echo "File ${line} is ${retval}."
            FOUND=true
        fi
    done
}

#***************************************************************************
# Name:         read_packages
# Description:  Reads a list of packages into the PACKAGES hash.
# Parameters:   $1: Package type
#               $2: Package command
#               $3: Package command filter
# Globals:      PACKAGES
# Returns:      None.
#***************************************************************************
read_packages() {
    debug_msg "read_packages: $1, $2, $3"

    if [[ -n "${PACKAGES[$1]}" ]]; then
        echo "ERROR: PACKAGES already contains a list of type ${1}.  It's value is:"
        echo "${PACKAGES[$1]}"
        return 1
    fi

#    PACKAGES["$1"]=
    if which "$2" >/dev/null 2>&1; then
        PACKAGES["$1"]=$(eval $3)
    fi
}

#***************************************************************************
# Name:         search_packages
# Description:  Searches lists of packages in the PACKAGES hash.
# Parameters:   $1: Package name
# Globals:      PACKAGES
# Returns:      None.
#***************************************************************************
search_packages() {
    local k

    debug_msg "search_packages: $1"

    for k in "${!PACKAGES[@]}"
    do
        if [[ -n "${PACKAGES[$k]}" ]]; then
            if grep "^$1\$" >/dev/null 2>&1 <<< ${PACKAGES[$k]}; then
                echo "There is a $k called $1."
                FOUND=true
            fi
        fi
    done
}

#***************************************************************************
# Main Code
#***************************************************************************

# Make sure we have the correct version of get_opt:
getopt --test > /dev/null
if [[ $? -ne 4 ]]; then
    echo "ERROR: This script requires the enhanced version of 'getopt'."
    if [[ "${SOURCED}" -eq 1 ]]; then
        return 4
    else
        exit 4
    fi
fi

# Parse commandline options:
OPTIONS='hDa'
LONGOPTIONS='help,DEBUG,aliases'

PARSED=$(getopt --options=$OPTIONS --longoptions=$LONGOPTIONS --name "$0" -- "$@")
if [[ $? -ne 0 ]]; then
    # If getopt has complained about wrong arguments to stdout:
    echo 'ERROR: Bad arguments.'
    if [[ "${SOURCED}" -eq 1 ]]; then
        return 2
    else
        exit 2
    fi
fi

# Read getopt's output this way to handle the quoting right:
eval set -- "$PARSED"

# Process options in order:
while true; do
    case "$1" in
        -h|--help)
            print_help
            if [[ "${SOURCED}" -eq 1 ]]; then
                return 0
            else
                exit 0
            fi
            ;;

        -D|--DEBUG)
            DEBUG=true
            shift
            ;;

        -a|--aliases)
            while IFS= read -r line; do
                key=$(sed -e 's/^alias \([^=]*\).*$/\1/' <<< "$line")
                val=$(sed -e 's/^[^=]*=\(.*\)$/\1/' <<< "$line")
                ALIASES["$key"]="$val"
            done
            shift
            ;;

        --)             # WHY IS THIS NECESSARY?
            shift
            break
            ;;

        *)
            echo "Unrecognized option: $1"
            print_help
            if [[ "${SOURCED}" -eq 1 ]]; then
                return 3
            else
                exit 3
            fi
            ;;
    esac
done

# If the user supplies more than 1 argument, print a blank line between each
# report.
separate=$(( $# > 1 ))

# Get scannable lists:

# Get the names of all the running processes.
# Process names in brackets []:
progs=$(ps --no-headers -Ao args -ww | grep '^\[' | sed -Ee 's/^\[([^]/:]+).*$/\1/')
# Process names without brackets and append to progs:
progs=${progs}$(ps --no-headers -Ao args -ww | grep -v '^\[' | sed -e 's/ .*$//')
# Filter and sort progs:
progs=$(echo "${progs}" | sort | uniq | xargs basename -a)

read_packages 'KDE applet' 'kpackagetool5' \
              "kpackagetool5 --list --type Plasma/Applet -g | \
               grep -v '^Listing service types:' | sed -e 's/^org\.kde\.plasma\.//'"

read_packages 'Debian package' 'dpkg' \
              "dpkg -l | grep '^ii'| sed -e 's/   */\t/g' | cut -f 2 | sed -e 's/:.*$//'"

read_packages 'Snap package' 'snap' \
              "snap list --all | sed -e 's/ .*$//'"

read_packages 'Red Hat package' 'rpm' \
              "rpm -qa"

read_packages 'Ruby package' 'gem' \
              "gem list | sed -e 's/ (.*$//'"

read_packages 'Python package' 'pip' \
              "pip list 2>/dev/null | sed -e 's/  .*$//'"

read_packages 'Python2 package' 'pip2' \
              "pip2 list 2>/dev/null | sed -e 's/  .*$//'"

read_packages 'Python3 package' 'pip3' \
              "pip3 list 2>/dev/null | sed -e 's/  .*$//'"

read_packages 'Python conda package' 'conda' \
              "conda list | sed -e 's/  .*$//'"

#read_packages 'Node JavaScript package' 'npm' \
#              "npm ls -parseable"

#read_packages 'Yarn JavaScript package' 'yarn' \
#              "yarn list"

# TODO:  Rust: cargo or rustup?
# Perl or PHP?

# Iterate through all remaining arguments.
while [[ $# -ne 0 ]]; do
    debug_msg "Examining ${1}."
    FOUND=false

    if [[ -z "$1" ]]; then    # Skip over blanks.
        shift
        continue
    fi

    if [[ "$1" =~ $SHELL_VAR_REGEX ]]; then
        retval=$( sed -e 's/^\$//' <<< "$1" )
        check_variable "${retval}"
    fi

    check_variable "$1"

    # Use `type` built-in.
    retval=$( type -a "$1" 2>/dev/null )
    if [[ $? -eq 0 ]]; then
        parse_type "$retval" "$1"
    else
        print_declare "$1"
    fi

    print_file_type "$1"

    # Check if `info` has a page.
    retval=$( info -w "$1" )
    if [[ $? -eq 0 ]] && [[ -n "$retval" ]] && [[ "$retval" != 'dir' ]] \
       && [[ $(readlink -f "${retval}") != $(readlink -f "$1") ]]; then
        echo "There is an \"info\" page for $1."
        FOUND=true
    fi

    # Use `which`.
    retval=$( which -a "$1" 2>/dev/null )
    if [[ $? -eq 0 ]]; then
        if [[ "${1}" =~ ^/ ]]; then
            # We have an absolute path.
            echo "There is an executable called $1."
        elif [[ $(wc -l <<< "${retval}") -gt 1 ]]; then
            # We have several paths.
            echo "There is are several executables called $1 here:"
            echo "${retval}"
        else
            echo "There is an executable called $1 here: $retval"
        fi
        print_file_type "${retval}"
    fi

    # Check for a `man` page.
    retval=$( man --whatis "$1" 2>/dev/null )
    if [[ $? -eq 0 ]]; then
        echo "There is a \"man\" page for $1: $retval"
        FOUND=true
    fi

    # Check aliases in the current shell.
    alias "$1" 2>/dev/null > $temp_file     # Can't create sub-shell w/o losing aliases.
    if [[ $? -eq 0 ]]; then
        echo "There is an alias for $1: $(cat $temp_file)"
        FOUND=true
    fi

    # If aliases are piped in:
    if [[ -n "${ALIASES[$1]}" ]]; then
        echo "There is an alias for $1 in stdin: ${ALIASES[$1]}"
        FOUND=true
    fi

    # Is this program running?
    if [[ -n "${progs}" ]]; then
        if grep "^$1\$" >/dev/null 2>&1 <<< ${progs}; then
            echo "There is at least one process running called $1."
            FOUND=true
        fi
    fi

    # Is this a package?
    search_packages "$1"

    if [[ "${FOUND}" == false ]]; then
        echo "Nothing found for \"$1\"."
    fi

    if [[ "${separate}" == 1 ]]; then
        echo
    fi

    shift
done


#!/bin/bash

set -o errexit
set -o nounset
set -o pipefail

OS_ROOT=$(dirname "${BASH_SOURCE}")/../..
source "${OS_ROOT}/hack/util.sh"
source "${OS_ROOT}/hack/cmd_util.sh"
os::log::install_errexit

# This test validates basic resource retrieval and command interaction

os::cmd::expect_success_and_text 'oc types' 'Deployment Configuration'
os::cmd::expect_failure_and_text 'oc get' 'deploymentconfig'

# Test resource builder filtering of files with expected extensions inside directories, and individual files without expected extensions
os::cmd::expect_success 'oc create -f test/fixtures/resource-builder/directory -f test/fixtures/resource-builder/json-no-extension -f test/fixtures/resource-builder/yml-no-extension'
# Explicitly specified extensionless files
os::cmd::expect_success 'oc get secret json-no-extension yml-no-extension'
# Scanned files with extensions inside directories
os::cmd::expect_success 'oc get secret json-with-extension yml-with-extension'
# Ensure extensionless files inside directories are not processed by resource-builder
os::cmd::expect_failure_and_text 'oc get secret json-no-extension-in-directory' 'not found'
echo "resource-builder: ok"

os::cmd::expect_success 'oc get pods --match-server-version'
os::cmd::expect_success_and_text 'oc create -f examples/hello-openshift/hello-pod.json' 'pod "hello-openshift" created'
os::cmd::expect_success 'oc describe pod hello-openshift'
os::cmd::expect_success 'oc delete pods hello-openshift'
echo "pods: ok"

os::cmd::expect_success_and_text 'oc create -f examples/hello-openshift/hello-pod.json -o name' 'pod/hello-openshift'
os::cmd::try_until_success 'oc label pod/hello-openshift acustom=label' # can race against scheduling and status updates
os::cmd::expect_success_and_text 'oc describe pod/hello-openshift' 'acustom=label'
os::cmd::try_until_success 'oc annotate pod/hello-openshift foo=bar' # can race against scheduling and status updates
os::cmd::expect_success_and_text 'oc get -o yaml pod/hello-openshift' 'foo: bar'
os::cmd::expect_success 'oc delete pods -l acustom=label'
os::cmd::expect_failure 'oc get pod/hello-openshift'
echo "label: ok"

os::cmd::expect_success 'oc get services'
os::cmd::expect_success 'oc create -f test/integration/fixtures/test-service.json'
os::cmd::expect_success 'oc delete services frontend'
echo "services: ok"

os::cmd::expect_success 'oc create -f test/fixtures/mixed-api-versions.yaml'
os::cmd::expect_success 'oc get    -f test/fixtures/mixed-api-versions.yaml -o yaml'
os::cmd::expect_success 'oc delete -f test/fixtures/mixed-api-versions.yaml'
echo "list version conversion: ok"

os::cmd::expect_success 'oc get nodes'
(
  # subshell so we can unset kubeconfig
  cfg="${KUBECONFIG}"
  unset KUBECONFIG
  os::cmd::expect_success 'kubectl get nodes --kubeconfig="${cfg}"'
)
echo "nodes: ok"

os::cmd::expect_success 'oc get routes'
os::cmd::expect_success 'oc create -f test/integration/fixtures/test-route.json'
os::cmd::expect_success 'oc delete routes testroute'
echo "routes: ok"

# Expose service as a route
os::cmd::expect_success 'oc create -f test/integration/fixtures/test-service.json'
os::cmd::expect_failure 'oc expose service frontend --create-external-load-balancer'
os::cmd::expect_failure 'oc expose service frontend --port=40 --type=NodePort'
os::cmd::expect_success 'oc expose service frontend'
os::cmd::expect_success_and_text "oc get route frontend --output-version=v1 --template='{{.spec.to.name}}'" "frontend"           # routes to correct service
os::cmd::expect_success_and_text "oc get route frontend --output-version=v1 --template='{{.spec.port.targetPort}}'" "<no value>" # no target port for services with unnamed ports
os::cmd::expect_success 'oc delete svc,route -l name=frontend'
# Test that external services are exposable
os::cmd::expect_success 'oc create -f test/fixtures/external-service.yaml'
os::cmd::expect_success 'oc expose svc/external'
os::cmd::expect_success_and_text 'oc get route external' 'external=service'
os::cmd::expect_success 'oc delete route external'
os::cmd::expect_success 'oc delete svc external'
# Expose multiport service and verify we set a port in the route
os::cmd::expect_success 'oc create -f test/fixtures/multiport-service.yaml'
os::cmd::expect_success 'oc expose svc/frontend --name route-with-set-port'
os::cmd::expect_success_and_text "oc get route route-with-set-port --template='{{.spec.port.targetPort}}' --output-version=v1" "web"
echo "expose: ok"

os::cmd::expect_success 'oc delete all --all'

# switch to test user to be sure that default project admin policy works properly
project=$(oc project -q)
os::cmd::expect_success 'oc policy add-role-to-user admin test-user'
os::cmd::expect_success 'oc login -u test-user -p anything'
os::cmd::try_until_success 'oc project ${project}'

os::cmd::expect_success 'oc run --image=openshift/hello-openshift test'
os::cmd::expect_success 'oc run --image=openshift/hello-openshift --generator=run-controller/v1 test2'
os::cmd::expect_success 'oc run --image=openshift/hello-openshift --restart=Never test3'
os::cmd::expect_success 'oc delete dc/test rc/test2 pod/test3'

os::cmd::expect_success 'oc process -f examples/sample-app/application-template-stibuild.json -l name=mytemplate | oc create -f -'
os::cmd::expect_success 'oc delete all -l name=mytemplate'
os::cmd::expect_success 'oc new-app https://github.com/openshift/ruby-hello-world'
os::cmd::expect_success 'oc get dc/ruby-hello-world'

os::cmd::expect_success_and_text "oc get dc/ruby-hello-world --template='{{ .spec.replicas }}'" '1'
patch='{"spec": {"replicas": 2}}'
os::cmd::expect_success "oc patch dc/ruby-hello-world -p '${patch}'"
os::cmd::expect_success_and_text "oc get dc/ruby-hello-world --template='{{ .spec.replicas }}'" '2'

os::cmd::expect_success 'oc delete all -l app=ruby-hello-world'
os::cmd::expect_failure 'oc get dc/ruby-hello-world'
echo "delete all: ok"


<gh_stars>1-10
#！/bin/bash

#python run_1.py --file ../logs/HDFS_2k.log
#python run_1.py --file ../logs/Andriod_2k.log
#python run_1.py --file ../logs/Spark_2k.log
#python run_1.py --file ../logs/Thunder_2k.log
#python run_1.py --file ../logs/Windows_2k.log

nohup python run_1.py --file ../logs/error.log > error.l1 2>&1 &
nohup python run_1.py --file ../logs/HDFS_2k.log > HDFS_2k.l1 2>&1 &
nohup python run_1.py --file ../logs/HDFS.log > HDFS.l1 2>&1 &
nohup python run_1.py --file ../logs/Andriod.log > Andriod.l1 2>&1 &
nohup python run_1.py --file ../logs/Spark.log > Spark.l1 2>&1 &

nohup python run_1.py --file ../logs/Andriod_1g.log > Andriod_1g.l1 2>&1 &
nohup python run_1.py --file ../logs/HDFS_1g.log > HDFS_1g.l1 2>&1 &
nohup python run_1.py --file ../logs/Spark_1g.log > Spark_1g.l1 2>&1 &
nohup python run_1.py --file ../logs/Thunderbird_1g.log > Thunderbird_1g.l1 2>&1 &
nohup python run_1.py --file ../logs/Windows_1g.log > Windows_1g.l1 2>&1 &

nohup python run_1.py --file ../logs/Thunder_aa > Thunder_aa.l1 2>&1 &
nohup python run_1.py --file ../logs/Thunder_ab > Thunder_ab.l1 2>&1 &
nohup python run_1.py --file ../logs/Thunder_ac > Thunder_ac.l1 2>&1 &
nohup python run_1.py --file ../logs/Thunder_ad > Thunder_ad.l1 2>&1 &
nohup python run_1.py --file ../logs/Thunder_ae > Thunder_ae.l1 2>&1 &
nohup python run_1.py --file ../logs/Thunder_af > Thunder_af.l1 2>&1 &
nohup python run_1.py --file ../logs/Thunder_ag > Thunder_ag.l1 2>&1 &
nohup python run_1.py --file ../logs/Thunder_ah > Thunder_ah.l1 2>&1 &
nohup python run_1.py --file ../logs/Thunder_ai > Thunder_ai.l1 2>&1 &
nohup python run_1.py --file ../logs/Thunder_aj > Thunder_aj.l1 2>&1 &
nohup python run_1.py --file ../logs/Thunder_ak > Thunder_ak.l1 2>&1 &
nohup python run_1.py --file ../logs/Thunder_al > Thunder_al.l1 2>&1 &
nohup python run_1.py --file ../logs/Thunder_am > Thunder_am.l1 2>&1 &
nohup python run_1.py --file ../logs/Thunder_an > Thunder_an.l1 2>&1 &

sleep 1h

nohup python run_1.py --file ../logs/Thunder_ao > Thunder_ao.l1 2>&1 &
nohup python run_1.py --file ../logs/Thunder_ap > Thunder_ap.l1 2>&1 &
nohup python run_1.py --file ../logs/Thunder_aq > Thunder_aq.l1 2>&1 &
nohup python run_1.py --file ../logs/Thunder_ar > Thunder_ar.l1 2>&1 &
nohup python run_1.py --file ../logs/Thunder_as > Thunder_as.l1 2>&1 &
nohup python run_1.py --file ../logs/Thunder_at > Thunder_at.l1 2>&1 &
nohup python run_1.py --file ../logs/Thunder_au > Thunder_au.l1 2>&1 &
nohup python run_1.py --file ../logs/Thunder_av > Thunder_av.l1 2>&1 &
nohup python run_1.py --file ../logs/Thunder_aw > Thunder_aw.l1 2>&1 &
nohup python run_1.py --file ../logs/Thunder_ax > Thunder_ax.l1 2>&1 &
nohup python run_1.py --file ../logs/Thunder_ay > Thunder_ay.l1 2>&1 &
nohup python run_1.py --file ../logs/Thunder_az > Thunder_az.l1 2>&1 &
nohup python run_1.py --file ../logs/Thunder_ba > Thunder_ba.l1 2>&1 &
nohup python run_1.py --file ../logs/Thunder_bb > Thunder_bb.l1 2>&1 &
nohup python run_1.py --file ../logs/Thunder_bc > Thunder_bc.l1 2>&1 &
nohup python run_1.py --file ../logs/Thunder_bd > Thunder_bd.l1 2>&1 &
nohup python run_1.py --file ../logs/Windows_aa > Windows_aa.l1 2>&1 &
nohup python run_1.py --file ../logs/Windows_ab > Windows_ab.l1 2>&1 &
nohup python run_1.py --file ../logs/Windows_ac > Windows_ac.l1 2>&1 &
nohup python run_1.py --file ../logs/Windows_ad > Windows_ad.l1 2>&1 &
nohup python run_1.py --file ../logs/Windows_ae > Windows_ae.l1 2>&1 &
nohup python run_1.py --file ../logs/Windows_af > Windows_af.l1 2>&1 &
nohup python run_1.py --file ../logs/Windows_ag > Windows_ag.l1 2>&1 &
nohup python run_1.py --file ../logs/Windows_ah > Windows_ah.l1 2>&1 &

sleep 1h

nohup python run_1.py --file ../logs/Windows_ai > Windows_ai.l1 2>&1 &
nohup python run_1.py --file ../logs/Windows_aj > Windows_aj.l1 2>&1 &
nohup python run_1.py --file ../logs/Windows_ak > Windows_ak.l1 2>&1 &
nohup python run_1.py --file ../logs/Windows_al > Windows_al.l1 2>&1 &
nohup python run_1.py --file ../logs/Windows_am > Windows_am.l1 2>&1 &
nohup python run_1.py --file ../logs/Windows_an > Windows_an.l1 2>&1 &
nohup python run_1.py --file ../logs/Windows_ao > Windows_ao.l1 2>&1 &
nohup python run_1.py --file ../logs/Windows_ap > Windows_ap.l1 2>&1 &
nohup python run_1.py --file ../logs/Windows_aq > Windows_aq.l1 2>&1 &
nohup python run_1.py --file ../logs/Windows_ar > Windows_ar.l1 2>&1 &
nohup python run_1.py --file ../logs/Windows_as > Windows_as.l1 2>&1 &
nohup python run_1.py --file ../logs/Windows_at > Windows_at.l1 2>&1 &
nohup python run_1.py --file ../logs/Windows_au > Windows_au.l1 2>&1 &
nohup python run_1.py --file ../logs/Windows_av > Windows_av.l1 2>&1 &
nohup python run_1.py --file ../logs/Windows_aw > Windows_aw.l1 2>&1 &
nohup python run_1.py --file ../logs/Windows_ax > Windows_ax.l1 2>&1 &
nohup python run_1.py --file ../logs/Windows_ay > Windows_ay.l1 2>&1 &
nohup python run_1.py --file ../logs/Windows_az > Windows_az.l1 2>&1 &
nohup python run_1.py --file ../logs/Windows_ba > Windows_ba.l1 2>&1 &


#!/bin/bash
set -o errexit
[ -d ./build ] || { echo "No build? You have to run npm install and npm run edge:build" ; exit 2 }

cd build
aws s3 cp {origin,viewer}-{request,response}*zip s3://lambdas-dev-dplus-web-waas-disco-api-com/
cd -


<reponame>scher200/swarm-backup-restore<gh_stars>10-100
#!/bin/bash

if [ ! -z $1 ]
then
	echo "Invalid Usage. Example Usage: $0 http://domain.com/my_backup.tar.gz"
fi

# Download and extract the stacks to be applied.
curl "$1" -o restore.tar.gz
tar xvzf restore.tar.gz
rm restore.tar.gz

# Apply stacks to be restored
/app/whaleprint apply
rm *.dab


#!/usr/bin/env bash
cd "alfheimproject/conf"
for file in *.example.json;
do
    mv "$file" "${file/.example.json/.json}"
done


#!/bin/sh
if [ -z ${BASE_DIR} ]; then
    BASE_DIR=$(cd $(dirname $0)/..;pwd)
fi
if [ -z ${APP_NAME} ]; then
    APP_NAME=sample
fi
if [ ! -e ${BASE_DIR}/projects/${APP_NAME} ]; then
    mkdir -p ${BASE_DIR}/projects/${APP_NAME}
fi
docker run --user $(id -u):$(id -g) --rm -v ${BASE_DIR}/projects/${APP_NAME}:/app composer_php73:0.1 $@


#!/usr/bin/env bash

case "$TRAVIS_SBT_VERSION_TEST" in
  0.13.*) SWITCH_SBT_VERSION="";        SCRIPTED="scripted" ;;
     1.*) SWITCH_SBT_VERSION="^^1.0.0"; SCRIPTED=""         ;;
       *) echo >&2 "Aborting: Unknown TRAVIS_SBT_VERSION_TEST: $TRAVIS_SBT_VERSION_TEST"; exit 1; ;;
esac

[[ "$TRAVIS_PULL_REQUEST" == "false"
&& "$TRAVIS_BRANCH" == "master"
&& "$TRAVIS_SECURE_ENV_VARS" == "true"
]]
on_the_master_branch=$?

[[ "$TRAVIS_TAG" != ""
&& "$TRAVIS_SECURE_ENV_VARS" == "true"
]]
on_a_tag=$?

if [[ $on_the_master_branch == 0 || $on_a_tag == 0 ]]; then
  PUBLISH=publish
  mkdir ~/.bintray
  cat > ~/.bintray/.credentials <<EOF
realm = Bintray API Realm
host = api.bintray.com
user = dwijnand
password = $<PASSWORD>
EOF
else
  PUBLISH=publishLocal
fi

sbt "$SWITCH_SBT_VERSION" test "$SCRIPTED" mimaReportBinaryIssues "$PUBLISH"


<filename>scripts/changeIRQAffinity.sh
for file in `find /proc/irq -name "smp_affinity_list"`
do
    # cat ${file}
    # echo $var
    sudo sh -c "echo 0-18 > ${file}"
done
# sudo bash -c "echo 7f > /proc/irq/default_smp_affinity"


<filename>hack/push_to_quay.sh
#!/bin/bash

if [ $# -ne 1 ]; then
    echo "Error invoking push_to_quay.sh: version required"
    exit 1
fi
if [ -z "$QUAY_USERNAME" ]; then
	echo "Environment variable QUAY_USERNAME missing"
	exit 2
fi
if [ -z "$QUAY_PASSWORD" ]; then
	echo "Environment variable QUAY_PASSWORD missing"
	exit 3
fi

VERSION=$1

PACKAGE=yaks
ORGANIZATION=yaks

location=$(dirname $0)
rootdir=$(realpath ${location}/..)

export AUTH_TOKEN=$(curl -sH "Content-Type: application/json" -XPOST https://quay.io/cnr/api/v1/users/login -d '{"user": {"username": "'"${QUAY_USERNAME}"'", "password": "'"<PASSWORD>}"'"}}' | jq -r '.token')

operator-courier --verbose push $rootdir/deploy/olm-catalog/${PACKAGE}/ ${ORGANIZATION} ${PACKAGE} ${VERSION} "$AUTH_TOKEN"


#!/store/2b2-busybox/bin/ash

#> FETCH fc9f85fc030e233142908241af7a846e60630aa7388de9a5fafb1f3a26840854
#>  FROM https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.bz2

set -uex

export PATH='/store/2b2-busybox/bin'
export PATH="$PATH:/store/2b1-clang/bin"
export PATH="$PATH:/store/2b3-gnumake/bin"
export LD_LIBRARY_PATH=/store/2b1-clang/lib

mkdir -p /tmp/3a-boost; cd /tmp/3a-boost
if [ -e /ccache/setup ]; then . /ccache/setup; fi

echo "### $0: aliasing ash to sh..."
mkdir aliases; ln -s /store/2b2-busybox/bin/ash aliases/sh
export PATH="/tmp/3a-boost/aliases:$PATH"

echo "### $0: unpacking Boost sources..."
tar --strip-components=1 -xf /downloads/boost_1_77_0.tar.bz2

echo "### $0: patching up Boost sources..."
sed -i 's|/bin/sh|/store/2b2-busybox/bin/ash|' \
	bootstrap.sh \
	tools/build/src/engine/build.sh
sed -i 's|/bin/sh|sh|' \
	tools/build/src/engine/execunix.cpp \
	boost/process/detail/posix/shell_path.hpp
EXTRA_INCL='/tmp/2b1-clang/extra_includes'
mkdir -p $EXTRA_INCL
cp /store/2b1-clang/lib/clang/13.0.0/include/*mmintrin.h $EXTRA_INCL/
cp /store/2b1-clang/lib/clang/13.0.0/include/mm_malloc.h $EXTRA_INCL/
cp /store/2b1-clang/lib/clang/13.0.0/include/unwind.h $EXTRA_INCL/

echo "### $0: building Boost..."
ash bootstrap.sh
./b2 --without-python -j $NPROC \
	include=/store/2a6-linux-headers/include \
	include=$EXTRA_INCL

echo "### $0: installing Boost..."
./b2 install --prefix=/store/3a-boost


<reponame>bk-rs/clickhouse-rs<filename>clickhouse-format/tests/gen_files.sh
#!/usr/bin/env bash

set -ex

# Prerequire
# ./../clickhouse_tgz_archive/download.sh

# ./tests/gen_files.sh

script_path=$(cd $(dirname $0) ; pwd -P)
script_path_root="${script_path}/"

bin_server="${script_path_root}../../clickhouse_tgz_archive/clickhouse/usr/bin/clickhouse-server"
bin_client="${script_path_root}../../clickhouse_tgz_archive/clickhouse/usr/bin/clickhouse-client"

workdir=$(mktemp -d)

mkdir -p "${workdir}/lib"
path="${workdir}/lib/"

mkdir -p "${workdir}/etc"
config_file="${workdir}/etc/config.xml"
tee "${config_file}" <<EOF >/dev/null
<yandex>
    <logger>
        <level>trace</level>
        <console>true</console>
    </logger>

    <tcp_port>9000</tcp_port>

    <path>${path}</path>

    <uncompressed_cache_size>8589934592</uncompressed_cache_size>
    <mark_cache_size>5368709120</mark_cache_size>
    <mlock_executable>true</mlock_executable>

    <users>
        <default>
            <password><PASSWORD></password>

            <networks>
                <ip>::/0</ip>
            </networks>

            <profile>default</profile>
            <quota>default</quota>
            <access_management>1</access_management>
        </default>
    </users>

    <profiles>
        <default/>
    </profiles>

    <quotas>
        <default/>
    </quotas>
</yandex>
EOF

mkdir -p "${workdir}/log"
log_file="${workdir}/log/clickhouse-server.log"
errorlog_file="${workdir}/log/clickhouse-server.err.log"

mkdir -p "${workdir}/run"
pid_file="${workdir}/run/clickhouse-server.pid"

# https://unix.stackexchange.com/questions/55913/whats-the-easiest-way-to-find-an-unused-local-port
read LOWERPORT UPPERPORT < /proc/sys/net/ipv4/ip_local_port_range
tcp_port=$(comm -23 <(seq $LOWERPORT $UPPERPORT | sort) <(ss -Htan | awk '{print $4}' | cut -d':' -f2 | sort -u) | shuf | head -n 1)

cleanup() {
  test -f "${pid_file}" && kill $(cat "${pid_file}")
  test -f "${errorlog_file}" && (cat "${errorlog_file}" | grep -v 'Connection reset by peer' | grep -v 'Broken pipe')
  rm -rf "${workdir}"
}
trap cleanup EXIT

$(${bin_server} --config-file="${config_file}" --log-file="${log_file}" --errorlog-file="${errorlog_file}" --pid-file="${pid_file}" --daemon -- --path="${path}" --tcp_port=${tcp_port})

sleep 2

files_path="${script_path_root}files"

query_create_table=$(cat <<-END
CREATE TABLE t_testing_format
(
    array1 Array(UInt8),
    array2 Array(String),
    tuple1 Tuple(UInt8, String),
    tuple2 Tuple(UInt8, Nullable(String)),
    map1 Map(String, String)
) ENGINE=Memory
END
)
$(echo ${query_create_table} | ${bin_client} --allow_experimental_map_type 1 --port ${tcp_port} --password xxx)

query_insert=$(cat <<-END
INSERT INTO t_testing_format VALUES
    ([1, 2], ['a', 'b'], (1, 'a'), (1, null), {'1':'Ready', '2':'Steady', '3':'Go'}),
    ([3, 4], ['c', 'd'], (2, 'b'), (2, 'b'), {})
END
)
$(echo ${query_insert} | ${bin_client} --allow_experimental_map_type 1 --port ${tcp_port} --password xxx)

query_select="SELECT array1, array2, tuple1, tuple2, map1 FROM t_testing_format"

formats=("JSON" "JSONStrings" "JSONCompact" "JSONCompactStrings")
for format in ${formats[*]}; do
    $(echo ${query_select} FORMAT ${format} | ${bin_client} --allow_experimental_map_type 1 --port ${tcp_port} --password xxx | python3 -m json.tool > "${files_path}/${format}.json")
done

formats=("TSV" "TSVRaw" "TSVWithNames" "TSVWithNamesAndTypes")
for format in ${formats[*]}; do
    $(echo ${query_select} FORMAT ${format} | ${bin_client} --allow_experimental_map_type 1 --port ${tcp_port} --password xxx > "${files_path}/${format}.tsv")
done

# SKIP, because don't support tuple
# formats=("CSV" "CSVWithNames")
# for format in ${formats[*]}; do
#     $(echo ${query_select} FORMAT ${format} | ${bin_client} --allow_experimental_map_type 1 --format_csv_delimiter '|' --port ${tcp_port} --password xxx > "${files_path}/${format}.csv")
# done

formats=("JSONEachRow" "JSONStringsEachRow" "JSONCompactEachRow" "JSONCompactStringsEachRow" "JSONEachRowWithProgress" "JSONStringsEachRowWithProgress" "JSONCompactEachRowWithNamesAndTypes" "JSONCompactStringsEachRowWithNamesAndTypes")
for format in ${formats[*]}; do
    $(echo ${query_select} FORMAT ${format} | ${bin_client} --allow_experimental_map_type 1 --port ${tcp_port} --password xxx > "${files_path}/${format}.txt")
done

query_drop_table="DROP TABLE t_testing_format"
$(echo ${query_drop_table} | ${bin_client} --port ${tcp_port} --password xxx)

sleep 1


<reponame>knod/docassemble
#! /bin/bash
su -c "psql -Atc \"select table_name, column_name, data_type, character_maximum_length, column_default from information_schema.columns where table_schema='public'\" docassemble" postgres