Install

Install

#!/bin/bash
echo "============================"
echo "* Installing Crawtext V5   *"
echo "============================"

echo "**********************"
echo "Installing required Debian Packages"
sudo apt-get install libffi-dev libssl-dev git libxml2-dev libxslt1-dev python-dev zlib1g-dev
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo "deb http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.2 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
sudo apt-get update
sudo apt-get install -y mongodb-org=3.2 mongodb-org-server=3.2 mongodb-org-shell=3.0.5 mongodb-org-mongos=3.0.5 mongodb-org-tools=3.2
sudo mkdir -p /data/db
echo "**********************"
creating a "virtual env"
virtualenv -p /usr/bin/python2.7 crawtext
source crawtext/bin/activate
#pip install -r requirements.txt

echo "Installing python dependencies"
#~ git clone https://github.com/cortext/crawtext crawtext
#~ git checkout dev

pip install -r requirements.pip
pip install requests[security]
cd ../
echo "**********************"
echo "Install of crawtext is completed!"
echo "Have fun!"
exit 0

virtualenv -p /usr/bin/python2.7 crawtext
source crawtext/bin/activate
pip install -r requirements.txt

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


More robust, download X11, added logging

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


ISIS-1465: adding interim-release.sh

ISIS-1465: adding interim-release.sh

VERSION_BASE=$1

if [ ! "$VERSION_BASE" ]; then
    echo "usage: $(basename $0) [base version]"
    echo "   eg: $(basename $0) 1.13.0"
    exit 1
fi

DATE=`date +'%Y%m%d-%H%M'`

VERSION="$VERSION_BASE.$DATE"
BRANCH="interim/$VERSION"
TAG="isis-$VERSION"

git checkout -b "$BRANCH"

echo "updating version in all pom.xml files..."
pushd core >/dev/null
mvn versions:set -DnewVersion=$VERSION > /dev/null
popd >/dev/null

echo "Committing changes"
git commit -am "bumping to $VERSION"

echo "tagging"
git tag $TAG

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


initial commit

initial commit

#!/bin/bash
# based on bosco_quickstart, first version 5/2/2013, by Marco Mambelli

LOCAL_DIR=~/.bosco
BOSCO_DIR=~/bosco

# Change to have a different log file
LOG_FILE=$LOCAL_DIR/connect_setup.log
# To have no log file use:
# LOG_FILE=/dev/null

factory_config=$LOCAL_DIR/config/condor_config.factory

fix_port () {
  # Checks if the port is available
  # If the port is already used it sweeps until a port is available
  which netstat &> /dev/null
  if [ $? -ne 0 ]; then
    echo "No netstat available, unable to verify if port $1 is free" >> $LOG_FILE
    return 1
  fi
  let start_port=$1
  let tmp_max=$start_port+2000
  let tmp_port=$start_port
  while [ $tmp_port -le $tmp_max ]; do
    netstat -tulpn 2> /dev/null | grep $tmp_port > /dev/null 2>&1
    [ $? -eq 1 ]  && break
    let tmp_port=$tmp_port+1
  done
  if [ $tmp_port -eq $start_port ]; then
      # Initial port is available
      echo "Port $tmp_port available." >> $LOG_FILE
  elif [ $tmp_port -le $tmp_max ]; then
	  # Found a free port in the range
          echo "Found available port $tmp_port." >> $LOG_FILE
  else
      echo "No free port in range $start_port to $tmp_port" >> $LOG_FILE
      return 1
  fi
  old_port=$(grep SHARED_PORT_ARGS $factory_config | cut -d ' ' -f 4)
  if [ $old_port -eq $tmp_port ]; then
      echo "Still using $tmp_port." >> $LOG_FILE
  else
      echo "Port $old_port is busy. Replacing $old_port with $tmp_port. Before:" >> $LOG_FILE
      grep $old_port $factory_config >> $LOG_FILE
      sed "s;$old_port;$tmp_port;" < $factory_config > ${factory_config}.new
      mv ${factory_config}.new ${factory_config}
      echo "After replacement:" >> $LOG_FILE
      grep $tmp_port $factory_config >> $LOG_FILE
      return 0
  fi
  return 1
}

echo "Connect Setup is starting."
echo "More information can be found in $LOG_FILE"
echo
[ -d $LOCAL_DIR ] || mkdir $LOCAL_DIR && echo "Local Bosco files can be found in $LOCAL_DIR" >> $LOG_FILE
[ -d $LOCAL_DIR/log ] || mkdir $LOCAL_DIR/log && touch $LOCAL_DIR/log/MasterLog
[ -d $LOCAL_DIR/spool ] || mkdir $LOCAL_DIR/spool
[ -d $LOCAL_DIR/execute ] || mkdir $LOCAL_DIR/execute
[ -d $LOCAL_DIR/config ] || mkdir $LOCAL_DIR/config

# Check if config files exist

CONDOR_CONFIG=$LOCAL_DIR/condor_config
LOCAL_CONFIG=$LOCAL_DIR/condor_config.local

[ -f $CONDOR_CONFIG ] || cat > $CONDOR_CONFIG  <<EOF
##  Where is the machine-specific local config file for each host?
LOCAL_CONFIG_FILE = $LOCAL_DIR/condor_config.local
LOCAL_CONFIG_DIR = $LOCAL_DIR/config
## Use a host-based security policy. By default CONDOR_HOST and the local machine will be allowed
use SECURITY: HOST_BASED
EOF

HOST_NAME=$(hostname)

[ -f $LOCAL_CONFIG ] || cat > $LOCAL_CONFIG <<EOF
RELEASE_DIR = $BOSCO_DIR
LOCAL_DIR = $LOCAL_DIR
COLLECTOR_NAME = Personal Condor at $HOST_NAME.rcc.local
FILESYSTEM_DOMAIN = rcc.local
GANGLIAD_METRICS_CONFIG_DIR = $BOSCO_DIR/etc/condor/ganglia.d
LOCK = /tmp/condor-lock.0.616903333532722
NETWORK_INTERFACE = 127.0.0.1
IS_BOSCO = True
MAIL = /bin/mailx
DAEMON_LIST = COLLECTOR, MASTER, NEGOTIATOR, SCHEDD, STARTD
UID_DOMAIN = rcc.local
PREEN_ARGS = -r
CONDOR_HOST = $HOST_NAME.rcc.local
CONDOR_IDS = 974760720.974760720
CREATE_CORE_FILES = False
GRIDMANAGER_MAX_SUBMITTED_JOBS_PER_RESOURCE = 10
EOF

[ -f $factory_config ] || echo '#
# Things you have to edit
#

##  What machine is your central manager?
CONDOR_HOST = $(FULL_HOSTNAME)
COLLECTOR_HOST = $(CONDOR_HOST):11000?sock=collector

##  This macro is used to specify a short description of your pool.
COLLECTOR_NAME      = $(CONDOR_HOST)

# What hosts can run jobs to this cluster.
FLOCK_FROM =

# Jobs submitted here can run at.
FLOCK_TO =

##############################################
# Things that are safe to leave
#

CAMPUSFACTORY = $(SBIN)/runfactory
CAMPUSFACTORY_ARGS = -c $(LIBEXEC)/campus_factory/etc/campus_factory.conf
CAMPUSFACTORY_ENVIRONMENT = "PYTHONPATH=$(LIBEXEC)/campus_factory/python-lib CAMPUSFACTORY_DIR=$(LIBEXEC)/campus_factory _campusfactory_GLIDEIN_DIRECTORY=$(LIBEXEC)/campus_factory/share/glidein_jobs"

# Enabled Shared Port
USE_SHARED_PORT = True
SHARED_PORT_ARGS = -p 11000

# What daemons should I run?
DAEMON_LIST = COLLECTOR, SCHEDD, NEGOTIATOR, MASTER, SHARED_PORT, CAMPUSFACTORY

# Remove glidein jobs that get put on hold for over 24 hours.
SYSTEM_PERIODIC_REMOVE = (GlideinJob == TRUE && JobStatus == 5 && time() - EnteredCurrentStatus > 3600*24*1)

#
# Security definitions
#
SEC_ENABLE_MATCH_PASSWORD_AUTHENTICATION = TRUE

SEC_DEFAULT_ENCRYPTION = OPTIONAL
SEC_DEFAULT_INTEGRITY = REQUIRED
# To allow status read
SEC_READ_INTEGRITY = OPTIONAL

ALLOW_ADMINISTRATOR = $(FULL_HOSTNAME) $(IP_ADDRESS)

SEC_PASSWORD_FILE = $(LOCAL_DIR)/passwdfile

# Daemons have their own passwdfile, always owned by the daemon user
COLLECTOR.SEC_PASSWORD_FILE = $(LOCAL_DIR)/passwdfile.daemon
NEGOTIATOR.SEC_PASSWORD_FILE = $(LOCAL_DIR)/passwdfile.daemon
GRIDMANAGER.SEC_PASSWORD_FILE = $(LOCAL_DIR)/passwdfile.daemon

SEC_ADVERTISE_STARTD_AUTHENTICATION = REQUIRED
SEC_ADVERTISE_STARTD_INTEGRITY = REQUIRED
SEC_ADVERTISE_STARTD_AUTHENTICATION_METHODS = PASSWORD
SEC_CLIENT_AUTHENTICATION_METHODS = FS, PASSWORD

ALLOW_ADVERTISE_STARTD = condor_pool@*/*
ALLOW_DAEMON = $(ALLOW_DAEMON) condor_pool@*/* $(FULL_HOSTNAME) $(IP_ADDRESS)

SEC_DAEMON_AUTHENTICATION = REQUIRED
SEC_DAEMON_INTEGRITY = REQUIRED
SEC_DAEMON_AUTHENTICATION_METHODS = FS,PASSWORD
SEC_WRITE_AUTHENTICATION_METHODS = FS,PASSWORD' > $factory_config

# Check if Bosco is already started
started=$(ps ux | grep condor_master | wc -l)
if [ $started -eq 1 ]; then
    # set and check user-specific port
    ID=`expr $(id -u) % 64511`
    PORT=`expr $ID + 1024`
    fix_port $PORT

    # Start Bosco
    echo "************** Starting Bosco: ***********"
    bosco_start 2>> $LOG_FILE
else
    echo "Bosco already started."
fi

REMOTE_HOST="login.ci-connect.uchicago.edu"
REMOTE_USER=$1
#REMOTE_USER=""
REMOTE_TYPE="condor"

# Connect UChicago Connect cluster
cluster_set=$(bosco_cluster -l | grep login.ci-connect.uchicago.edu | wc -w)
if [ $cluster_set -eq 1 ]; then
    # cluster already added
    echo "UChicago Connect cluster already added."
else
    echo "************** Connecting UChicago Connect cluster to BOSCO: ***********"
    echo "At any time hit [CTRL+C] to interrupt."
    echo

#    q_tmp=""
#    read -p "Type your username on $REMOTE_HOST (default $USER) and press [ENTER]: " q_tmp
#    if [ "x$q_tmp" = "x" ]; then
#	REMOTE_USER=$USER
#    else
#	REMOTE_USER=$q_tmp
#    fi

    echo "Connecting $REMOTE_HOST, user: $REMOTE_USER, queue manager: $REMOTE_TYPE"
    bosco_cluster --add $REMOTE_USER@$REMOTE_HOST $REMOTE_TYPE 2>> $LOG_FILE

    if [ $? -ne 0 ]; then
	echo "Failed to connect the cluster $REMOTE_HOST. Please check your data and retry."
	exit 2
    fi

    echo "$REMOTE_HOST connected"
fi

echo "************** Testing the cluster (resource): ***********"
echo "This may take up to 2 minutes... please wait."
test=$(bosco_cluster --test $REMOTE_USER@$REMOTE_HOST 2>> $LOG_FILE)
# MMDB move this underneath
echo "BOSCO on $REMOTE_HOST Tested"
if [ $? -ne 0 ]; then
  echo "Failed to test the cluster $REMOTE_HOST. Please check your data and retry."
  exit 3
fi

echo "************** Congratulations, Bosco is now setup to work with $REMOTE_HOST! ***********"
cat <<EOF
You are ready to submit jobs with the "condor_submit" command.
Remember to setup the environment all the time you want to use Bosco:
module load connect

Here is a quickstart guide about BOSCO:
https://twiki.grid.iu.edu/bin/view/CampusGrids/BoscoQuickStart

To remove Bosco you can run:
module load connect; bosco_uninstall --all

Here is a submit file example (supposing you want to run "myjob.sh"):
universe = grid
grid_resource = batch condor $REMOTE_USER@$REMOTE_HOST
Executable = myjob.sh
arguments =
output = myjob.output.txt
error = myjob.error.txt
log = myjob.log
transfer_output_files =
should_transfer_files = YES
when_to_transfer_output = ON_EXIT
queue 1
EOF

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


put the sender script into the sample data folder

# Parameters:
#
java -cp ../../../../org.mwc.debrief.dis/target/org.mwc.debrief.dis-1.0.1.jar org.mwc.debrief.dis.diagnostics.PduGenerator $1

error: pathspec 'org.mwc.cmap.combined.feature/root_installs/sample_data/other_formats/sender.sh' did not match any file(s) known to git


Fixing typo in nvm plugin

Fixing typo in nvm plugin

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


modified:   script-diagnostics.sh - changed #! to env

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


Update docker-entrypoint.sh

Update docker-entrypoint.sh

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


fwr: missing file added

fwr: missing file added

git-svn-id: 8a2ccb88241e16c78017770bc38d91d6d5396a5a@81639 6b8eccd3-e8c5-4e7d-8186-e12b5326b719

#!/bin/bash
MAILTO="@ADMIN_CONSOLE_ADMIN_MAIL@"
MAINT=@BASE_DIR@/maintenance
SUDO_USER=searchd

while getopts "u:" o
do	case "$o" in
	u)	SUDO_USER="$OPTARG";;

	esac
done

BASE_PATH=@SPHINX_BIN_DIR@
PID_FILE=@BASE_DIR@/sphinx/searchd.pid
CONFIG_FILE=@APP_DIR@/configurations/sphinx/kaltura.conf

while /bin/true ; do
#    echo "Sleeping 10 seconds ..."
    sleep 10
    KP=$(pgrep searchd)
    KF=$(find @LOG_DIR@/sphinx/data -type f -name "binlog*" -mmin -3)
    ##if [[ "X$KP" == "X" || "X$KF" == "X" ]] && [[ ! -f $MAINT ]]
    if [[ "X$KP" == "X" && ! -f $MAINT ]]
      then
          if [ -f @BASE_DIR@/searchd_is_not_running_email ]
             then
                 echo "searchd on  `hostname` is not running" | mail -r kaltura@`hostname` -s "searchd service not found on `hostname`" $MAILTO
		 rm -f @BASE_DIR@/searchd_is_not_running_email
          fi
	  touch @BASE_DIR@/searchd_is_running_email
          echo "`date` searchd on  `hostname` was restarted by `whoami`"
	  $BASE_PATH/searchd --config $CONFIG_FILE --stopwait
	  echo "Exit code for stop was $?"
	  $BASE_PATH/searchd --config $CONFIG_FILE
          sleep 2
	  continue
    fi
    if [ -f @BASE_DIR@/searchd_is_running_email ]
       then
           echo "searchd on  `hostname` is running" | mail -r kaltura@`hostname` -s "searchd service is found on `hostname`" $MAILTO
	   rm -f @BASE_DIR@/searchd_is_running_email
    fi
    touch @BASE_DIR@/searchd_is_not_running_email
done

error: pathspec 'plugins/sphinx_search/scripts/watch.daemon.onprem.sh' did not match any file(s) known to git


Updating batch_dock.sh to pass proper arguments to results_csv.py

#!/bin/bash
RESULTS=~/working/results
SCRIPTS=~/working/scripts
LOGGING=~/working/results/batch/logs

usage() {
cat << EOF

usage $0 options

This script runs dock_variants using with logging. Intended for submitting jobs
on the cluster.

Example: batch_dock.sh -t 10 -l wt_64 -d ~/working/pdb/wt_64 -p C_B

OPTIONS:
  -h  Show this message
  -t  Number of threads (Mandatory)
  -l  Label for output txt files (Mandatory)
  -d  Directory containing PDB files (Mandatory)
  -f  String passed along with --setup_foldtree to dock_variants.py (optional)
  -p  String passed along with --set_partners to dock_variants.py (optional)
  -s  Passes string "--pam64" to dock_variants.py (optional)
  -a  String passed along with --alt_tool to dock_variants.py (optional)
EOF
}
threads=
label=
pdb_dir=
set_partners=
setup_foldtree=
pam64=
pam_tool=
pam_start=0
pam_end=255

while getopts “ht:l:d:f:p:sa:” OPTION
do
    case $OPTION in
        h)
            usage
            exit 1
            ;;
        t)
            threads=$OPTARG
            ;;
        l)
            label=$OPTARG
            ;;
        d)
            pdb_dir=$OPTARG
            ;;
        f)
            setup_foldtree=$OPTARG
            ;;
        p)
            set_partners=$OPTARG
            ;;
        s)
            pam64=True
            ;;
        a)
            pam_tool=$OPTARG
            ;;
        ?)
            usage
            exit
            ;;
    esac
done

# check mandatory arguments have values
if [ -z $threads ] || [ -z $label ]  || [ -z $pdb_dir ]; then
    echo "ERROR: requires three arguments (threads, label, pdb_dir)"
    usage
    exit 1
fi

# parse optional arguments for dock_variants.py and results.csv.py
opt_dock_variants_args=""
opt_results_csv_args=""
if [ ! -z $setup_foldtree ]; then
    echo "Adding '--setup_foldtree $setup_foldtree' argument to dock_variants"
    opt_dock_variants_args+=" --setup_foldtree $setup_foldtree"
fi
if [ ! -z $set_partners ]; then
    echo "Adding '--set-partners $set_partners' argument to dock_variants"
    opt_dock_variants_args+=" --set_partners $set_partners"
fi
if [ ! -z $pam64 ]; then
    echo "Passing '--pam64' argument to dock_variants"
    opt_dock_variants_args+=" --pam64"
    pam_end=63
fi
fi p ! -z $pam_tool]; then
    echo "Adding '--alt_tool $pam_tool' argument to dock_variants"
    echo "Adding '--alt_tool $pam_tool' argument to results_csv"
    opt_dock_variants_args+=" --alt_tool $pam_tool"
    opt_results_csv_args=" --alt_tool $pam_tool"
fi

# don't write to a directory that already exists
results_dir=$RESULTS/batch/$label
if [ -d $results_dir ]; then
    echo "Directory $results_dir already exists, specify a new label"
    exit 1
fi

range=$(($pam_end-$pam_start+1))
step=$(($range/$threads))
remainder=$(($range % $threads))
pids=()

# amount of remainder to distribute to tasks
remainder_plus=$(($remainder/$threads+1))

# set so pam_first is initially pam_start
pam_last=$(($pam_start-1))

# run docking scripts for ranges in parallel
echo "Launching scripts"
i=0
while [ $i -lt $threads ]; do
    if [ $remainder -lt $(($i+1)) ]; then
        remainder_plus=0
    fi
    pam_first=$(($pam_last+1))
    pam_last=$(($pam_first+$step+$remainder_plus-1))
    log_name="$LOGGING/$label"
    log_name+="_pf_$pam_first"
    log_name+="_pl_$pam_last"
    log_name+="_thread_$i" # name for logging stdout and stderr

    out_name=$log_name
    out_name+="_out.txt"

    err_name=$log_name
    err_name+="_err.txt"

    nohup nice -n 10 python $SCRIPTS/dock_variants.py -s=$pam_first -e=$pam_last --output_dir=$results_dir --pdb_dir=$pdb_dir $opt_dock_variants_args > $out_name 2> $err_name &
    pids+=($!)
    i=$(($i+1))
done

sleep 0.5

for pid in ${pids[*]}; do
    wait $pid
done

sleep 0.5

# run CSV script
echo "Writing to CSV"
python $SCRIPTS/results_csv.py --results_dir $results_dir $opt_results_csv_args

echo "Done!"

#!/bin/bash
RESULTS=~/working/results
SCRIPTS=~/working/scripts
LOGGING=~/working/results/batch/logs

usage() {
cat << EOF

usage $0 options

This script runs dock_variants using with logging. Intended for submitting jobs
on the cluster.

Example: batch_dock.sh -t 10 -l wt_64 -d ~/working/pdb/wt_64 -p C_B

OPTIONS:
  -h  Show this message
  -t  Number of threads (Mandatory)
  -l  Label for output txt files (Mandatory)
  -d  Directory containing PDB files (Mandatory)
  -f  String passed along with --setup_foldtree to dock_variants.py (optional)
  -p  String passed along with --set_partners to dock_variants.py (optional)
  -s  Passes string "--pam64" to dock_variants.py (optional)
  -a  String passed along with --alt_tool to dock_variants.py (optional)
EOF
}
threads=
label=
pdb_dir=
set_partners=
setup_foldtree=
pam64=
pam_tool=
pam_start=0
pam_end=255

while getopts “ht:l:d:f:p:sa:” OPTION
do
    case $OPTION in
        h)
            usage
            exit 1
            ;;
        t)
            threads=$OPTARG
            ;;
        l)
            label=$OPTARG
            ;;
        d)
            pdb_dir=$OPTARG
            ;;
        f)
            setup_foldtree=$OPTARG
            ;;
        p)
            set_partners=$OPTARG
            ;;
        s)
            pam64=True
            ;;
        a)
            pam_tool=$OPTARG
            ;;
        ?)
            usage
            exit
            ;;
    esac
done

# check mandatory arguments have values
if [ -z $threads ] || [ -z $label ]  || [ -z $pdb_dir ]; then
    echo "ERROR: requires three arguments (threads, label, pdb_dir)"
    usage
    exit 1
fi

# parse optional arguments for dock_variants.py
opt_dock_variants_args=""
if [ ! -z $setup_foldtree ]; then
    echo "Adding '--setup_foldtree $setup_foldtree' argument to dock_variants"
    opt_dock_variants_args+=" --setup_foldtree $setup_foldtree"
fi
if [ ! -z $set_partners ]; then
    echo "Adding '--set-partners $set_partners' argument to dock_variants"
    opt_dock_variants_args+=" --set_partners $set_partners"
fi
if [ ! -z $pam64 ]; then
    echo "Passing '--pam64' argument to dock_variants"
    opt_dock_variants_args+=" --pam64"
    pam_end=63
fi
fi p ! -z $pam_tool]; then
    echo "Adding '--alt_tool $pam_tool' argument to dock_variants"
    opt_dock_variants_args+=" --alt_tool $pam_tool"
fi

# don't write to a directory that already exists
results_dir=$RESULTS/batch/$label
if [ -d $results_dir ]; then
    echo "Directory $results_dir already exists, specify a new label"
    exit 1
fi

range=$(($pam_end-$pam_start+1))
step=$(($range/$threads))
remainder=$(($range % $threads))
pids=()

# amount of remainder to distribute to tasks
remainder_plus=$(($remainder/$threads+1))

# set so pam_first is initially pam_start
pam_last=$(($pam_start-1))

# run docking scripts for ranges in parallel
echo "Launching scripts"
i=0
while [ $i -lt $threads ]; do
    if [ $remainder -lt $(($i+1)) ]; then
        remainder_plus=0
    fi
    pam_first=$(($pam_last+1))
    pam_last=$(($pam_first+$step+$remainder_plus-1))
    log_name="$LOGGING/$label"
    log_name+="_pf_$pam_first"
    log_name+="_pl_$pam_last"
    log_name+="_thread_$i" # name for logging stdout and stderr

    out_name=$log_name
    out_name+="_out.txt"

    err_name=$log_name
    err_name+="_err.txt"

    nohup nice -n 10 python $SCRIPTS/dock_variants.py -s=$pam_first -e=$pam_last --output_dir=$results_dir --pdb_dir=$pdb_dir $opt_dock_variants_args > $out_name 2> $err_name &
    pids+=($!)
    i=$(($i+1))
done

sleep 0.5

for pid in ${pids[*]}; do
    wait $pid
done

sleep 0.5

# run CSV script
echo "Writing to CSV"
python $SCRIPTS/results_csv.py $results_dir

echo "Done!"


Script to configure ADLS (3.0.0-alpha2) for use with the new DistCp

#! /bin/bash

machine_login_usn=$1
adls_account_name=$2
tenant_id=$3
client_id=$4
client_credential=$5

hn=`hostname`

distcp_jar_name='hadoop-distcp-2.9.0-SNAPSHOT-cbs-java1.7compat.jar'
distcp_jar_url='http://azuresscripts.blob.core.windows.net/distcp'

adl_sdk_jar_name='azure-data-lake-store-sdk-2.1.5.jar'
adl_sdk_jar_url='http://central.maven.org/maven2/com/microsoft/azure/azure-data-lake-store-sdk/2.1.5'

adl_driver_jar_name='hadoop-azure-datalake-3.0.0-alpha2.jar'
adl_driver_jar_url='http://central.maven.org/maven2/org/apache/hadoop/hadoop-azure-datalake/3.0.0-alpha2'

function ConfigureADLSWithNewDistCp()
{
	rm $adl_sdk_jar_name
	wget $adl_sdk_jar_url/$adl_sdk_jar_name
	rm $adl_driver_jar_name
	wget $adl_driver_jar_url/$adl_driver_jar_name

	rm $distcp_jar_name
	wget $distcp_jar_url/$distcp_jar_name

	jackson_files_colon=`find $HADOOP_HOME/share/hadoop/tools/lib/ -name jackson-core* | tr '\n' ':'`
	jackson_files_csv=`echo $jackson_files_colon | tr ':' ','`

	unset HADOOP_CLASSPATH
	export HADOOP_CLASSPATH=$jackson_files_colon/home/$machine_login_usn/$adl_sdk_jar_name:/home/$machine_login_usn/$adl_driver_jar_name:/home/$machine_login_usn/$distcp_jar_name:`hadoop classpath`
	export LIBJARS=$jackson_files_csv/home/$machine_login_usn/$adl_sdk_jar_name,/home/$machine_login_usn/$adl_driver_jar_name,/home/$machine_login_usn/$distcp_jar_name

	echo $HADOOP_CLASSPATH
	echo $LIBJARS

	alias adlsHdfs='hdfs dfs -libjars $LIBJARS -D fs.AbstractFileSystem.adl.impl=org.apache.hadoop.fs.adl.Adl -D fs.adl.impl=org.apache.hadoop.fs.adl.AdlFileSystem -D dfs.adls.oauth2.access.token.provider.type=ClientCredential -D dfs.adls.oauth2.refresh.url=https://login.windows.net/$tenant_id/oauth2/token -D dfs.adls.oauth2.client.id=$client_id -D dfs.adls.oauth2.credential=$client_credential'

	alias adlsHadoopDistCp='hadoop distcp -libjars $LIBJARS -D fs.AbstractFileSystem.adl.impl=org.apache.hadoop.fs.adl.Adl -D fs.adl.impl=org.apache.hadoop.fs.adl.AdlFileSystem -D dfs.adls.oauth2.access.token.provider.type=ClientCredential -D dfs.adls.oauth2.refresh.url=https://login.windows.net/$tenant_id/oauth2/token -D dfs.adls.oauth2.client.id=$client_id -D dfs.adls.oauth2.credential=$client_credential'
}

function Test() {
	adlsHdfs -ls adl://$adls_account_name.azuredatalakestore.net/
}

function TestDistCp() {
	dirName='tmp'
	cpyBuffSize=4194304
	blksPerChnk=10
	nMappers=4
	adlsHdfs -rmr -skipTrash adl://$adls_account_name.azuredatalakestore.net/*
	adlsHadoopDistCp -blocksperchunk $blksPerChnk -m $nMappers -copybuffersize $cpyBuffSize -bandwidth 10000 /$dirName/ adl://$adls_account_name.azuredatalakestore.net/
	adlsHdfs -ls adl://$adls_account_name.azuredatalakestore.net/$dirName/
}

function PrintLine() {
	DATE=`date +%Y-%m-%d" "%H:%M:%S,%3N`
	echo "$DATE - $1"
}

function Main() {
    PrintLine "Configure ADLS with new DistCp on host: $hn"

	# all params are mandatory
    if [ ! -z "$machine_login_usn" -a "$machine_login_usn" != " " ]
        then
            PrintLine "User Name provided: $machine_login_usn"
        else
            PrintLine "User Name not provided! => EXIT"
            exit
    fi

	    if [ ! -z "$adls_account_name" -a "$adls_account_name" != " " ]
        then
            PrintLine "ADLS account provided: $adls_account_name"
        else
            PrintLine "ADLS account NOT provided! => EXIT"
            exit
    fi

    if [ ! -z "$tenant_id" -a "$tenant_id" != " " ]
        then
            PrintLine "Tenant ID provided: $tenant_id"
        else
            PrintLine "Tenant ID NOT provided! => EXIT"
            exit
    fi

    if [ ! -z "$client_id" -a "$client_id" != " " ]
        then
            PrintLine "Client ID provided: $client_id"
        else
            PrintLine "Client ID NOT provided! => EXIT"
            exit
    fi

    if [ ! -z "$client_credential" -a "$client_credential" != " " ]
        then
            PrintLine "Client credential provided: $client_credential"
        else
            PrintLine "Client credential NOT provided! => EXIT"
            exit
    fi

	ConfigureADLSWithNewDistCp
	Test
}

Main

error: pathspec 'Samples/DistCp/ConfigureADLS-3.0.0-alpha2WithNewDistCp.sh' did not match any file(s) known to git


Trying to make tests pass

Trying to make tests pass

#!/usr/bin/env bash
# https://unix.stackexchange.com/questions/228597/how-to-copy-a-folder-recursively-in-an-idempotent-way-using-cp
shopt -s dotglob

export PIPELINES_TEST_DIR="${BATS_TMPDIR}/BATS"
rm -rf "${PIPELINES_TEST_DIR}"
mkdir -p "${PIPELINES_TEST_DIR}"
cp -R "${BATS_TEST_DIRNAME}"/../../main/bash/* "${PIPELINES_TEST_DIR}/"
cp -R "${BATS_TEST_DIRNAME}"/fixtures/* "${PIPELINES_TEST_DIR}/"
cd "${PIPELINES_TEST_DIR}"

#!/usr/bin/env bash
export PIPELINES_TEST_DIR="${BATS_TMPDIR}/BATS"
rm -rf "${PIPELINES_TEST_DIR}"
mkdir -p "${PIPELINES_TEST_DIR}"
cp -rf "${BATS_TEST_DIRNAME}/../../main/bash/" "${PIPELINES_TEST_DIR}"
cp -rf "${BATS_TEST_DIRNAME}/fixtures/" "${PIPELINES_TEST_DIR}"
cd "${PIPELINES_TEST_DIR}"


initscripts: pull hostname from ni-rt.ini

hostname.sh sets the system hostname to [SystemSettings]Host_name
on ni-rt.ini. If not available, it creates a new one using the
serial number or mac address.

Signed-off-by: Alejandro del Castillo <c09cbcd73cd5840fe009d82a3ad13af11b4d7b46@ni.com>

#!/bin/sh
#
# hostname.sh   Set hostname.
#
# Version:      @(#)hostname.sh  1.10  26-Feb-2001  miquels@cistron.nl
#

# Check if there is a hostname in ni-rt.ini
HOSTNAME=`/usr/local/natinst/bin/nirtcfg --get section=SystemSettings,token=Host_Name`
if [ $? -eq 0 ] && [ -n "$HOSTNAME" ]; then
    # Set the hostname based on ni-rt.ini
    hostname "$HOSTNAME"
else
    # Generate a default hostname based on the serial# or MAC address

    MODEL=`(/sbin/fw_printenv -n DeviceDesc 2> /dev/null || echo cRIO-Linux) | sed "s/^NI //" `

    SERIAL=`/sbin/fw_printenv -n serial# 2>&1`
    # On success "fw_printenv -n serial# 2>&1" puts 0 in "$?"
    if test $? -ne 0
    then
        # If Uboot variable "fw_setenv serial# AABBCCDD" is not set,
        # use the mac address to generate the name of the target.
        echo `ifconfig -a |grep -o "HWaddr [^ ]*" |head -n 1 |\
           sed -r -e "s/HWaddr /NI-$MODEL-/g" -e "s/://g" -e 's/[^a-zA-Z0-9]+/-/g' -e 's/^-//'` | xargs hostname
    else
        # If Uboot variable is set, then use its value to generate
        # the hostname.
        echo "NI-$MODEL-$SERIAL" | sed -r -e 's/[^a-zA-Z0-9]+/-/g' -e 's/^-//' | xargs hostname
    fi

    # Set the newly generated hostname in ni-rt.ini
    /usr/local/natinst/bin/nirtcfg --set section=SystemSettings,token=Host_Name,value="`hostname`"
fi

error: pathspec 'recipes-core/initscripts/initscripts-1.0/hostname.sh' did not match any file(s) known to git


use the factorcode.org checksums when downloading boot images

#!/usr/bin/env bash

# Programs returning != 0 will not cause script to exit
set +e

# Case insensitive string comparison
shopt -s nocaseglob
#shopt -s nocasematch

OS=
ARCH=
WORD=
NO_UI=
GIT_PROTOCOL=${GIT_PROTOCOL:="git"}
GIT_URL=${GIT_URL:=$GIT_PROTOCOL"://factorcode.org/git/factor.git"}

test_program_installed() {
  	if ! [[ -n `type -p $1` ]] ; then
		return 0;
	fi
	return 1;
}

ensure_program_installed() {
	installed=0;
	for i in $* ;
	do
	    echo -n "Checking for $i..."
		test_program_installed $1
		if [[ $? -eq 0 ]]; then
			echo -n "not "
		else
			installed=$(( $installed + 1 ))
	    fi
	    echo "found!"
	done
	if [[ $installed -eq 0 ]] ; then
	    echo -n "Install "
	    if [[ $# -eq 1 ]] ; then
			echo -n $1
	    else
			echo -n "any of [ $* ]"
	    fi
	    echo " and try again."
	    exit 1
	fi
}

check_ret() {
        RET=$?
        if [[ $RET -ne 0 ]] ; then
           echo $1 failed
           exit 2
        fi
}

check_gcc_version() {
        echo -n "Checking gcc version..."
        GCC_VERSION=`gcc --version`
        check_ret gcc
        if [[ $GCC_VERSION == *3.3.* ]] ; then
                echo "bad!"
                echo "You have a known buggy version of gcc (3.3)"
                echo "Install gcc 3.4 or higher and try again."
                exit 3
        fi
        echo "ok."
}

set_downloader() {
	test_program_installed wget
	if [[ $? -ne 0 ]] ; then
		DOWNLOAD=wget
	else
		DOWNLOAD="curl -O"
	fi
}

check_installed_programs() {
        ensure_program_installed chmod
        ensure_program_installed uname
        ensure_program_installed git
        ensure_program_installed wget curl
        ensure_program_installed gcc
        ensure_program_installed make
        ensure_program_installed md5sum
        ensure_program_installed cut
        case $OS in
            netbsd) ensure_program_installed gmake;;
        esac
        check_gcc_version
}

check_library_exists() {
        GCC_TEST=factor-library-test.c
        GCC_OUT=factor-library-test.out
        echo -n "Checking for library $1..."
        echo "int main(){return 0;}" > $GCC_TEST
        gcc $GCC_TEST -o $GCC_OUT -l $1
        if [[ $? -ne 0 ]] ; then
                echo "not found!"
                echo "Warning: library $1 not found."
                echo "***Factor will compile NO_UI=1"
                NO_UI=1
        fi
        rm -f $GCC_TEST
        check_ret rm
        rm -f $GCC_OUT
        check_ret rm
        echo "found."
}

check_X11_libraries() {
        check_library_exists freetype
        check_library_exists GLU
        check_library_exists GL
        check_library_exists X11
}

check_libraries() {
        case $OS in
                linux) check_X11_libraries;;
        esac
}

check_factor_exists() {
        if [[ -d "factor" ]] ; then
                echo "A directory called 'factor' already exists."
                echo "Rename or delete it and try again."
                exit 4
        fi
}

find_os() {
        echo "Finding OS..."
        uname_s=`uname -s`
        check_ret uname
        case $uname_s in
                CYGWIN_NT-5.2-WOW64) OS=winnt;;
                *CYGWIN_NT*) OS=winnt;;
                *CYGWIN*) OS=winnt;;
                *darwin*) OS=macosx;;
                *Darwin*) OS=macosx;;
                *linux*) OS=linux;;
                *Linux*) OS=linux;;
                *NetBSD*) OS=netbsd;;
        esac
}

find_architecture() {
        echo "Finding ARCH..."
        uname_m=`uname -m`
        check_ret uname
        case $uname_m in
           i386) ARCH=x86;;
           i686) ARCH=x86;;
           *86) ARCH=x86;;
           *86_64) ARCH=x86;;
           "Power Macintosh") ARCH=ppc;;
        esac
}

write_test_program() {
        echo "#include <stdio.h>" > $C_WORD.c
        echo "int main(){printf(\"%d\", 8*sizeof(void*)); return 0; }" >> $C_WORD.c
}

find_word_size() {
        echo "Finding WORD..."
        C_WORD=factor-word-size
        write_test_program
        gcc -o $C_WORD $C_WORD.c
        WORD=$(./$C_WORD)
        check_ret $C_WORD
        rm -f $C_WORD*
}

set_factor_binary() {
        case $OS in
                winnt) FACTOR_BINARY=factor-nt;;
                macosx) FACTOR_BINARY=./Factor.app/Contents/MacOS/factor;;
                *) FACTOR_BINARY=factor;;
        esac
}

echo_build_info() {
        echo OS=$OS
        echo ARCH=$ARCH
        echo WORD=$WORD
        echo FACTOR_BINARY=$FACTOR_BINARY
        echo MAKE_TARGET=$MAKE_TARGET
        echo BOOT_IMAGE=$BOOT_IMAGE
        echo MAKE_IMAGE_TARGET=$MAKE_IMAGE_TARGET
        echo GIT_PROTOCOL=$GIT_PROTOCOL
        echo GIT_URL=$GIT_URL
}

set_build_info() {
        if ! [[ -n $OS && -n $ARCH && -n $WORD ]] ; then
                echo "OS: $OS"
                echo "ARCH: $ARCH"
                echo "WORD: $WORD"
                echo "OS, ARCH, or WORD is empty.  Please report this"
                exit 5
        fi

        MAKE_TARGET=$OS-$ARCH-$WORD
        MAKE_IMAGE_TARGET=$ARCH.$WORD
        BOOT_IMAGE=boot.$ARCH.$WORD.image
        if [[ $OS == macosx && $ARCH == ppc ]] ; then
                MAKE_IMAGE_TARGET=$OS-$ARCH
                MAKE_TARGET=$OS-$ARCH
                BOOT_IMAGE=boot.macosx-ppc.image
        fi
        if [[ $OS == linux && $ARCH == ppc ]] ; then
                MAKE_IMAGE_TARGET=$OS-$ARCH
                MAKE_TARGET=$OS-$ARCH
                BOOT_IMAGE=boot.linux-ppc.image
        fi
}

find_build_info() {
        find_os
        find_architecture
        find_word_size
        set_factor_binary
        set_build_info
        echo_build_info
}

invoke_git() {
        git $*
        check_ret git
}

git_clone() {
        echo "Downloading the git repository from factorcode.org..."
        invoke_git clone $GIT_URL
}

git_pull_factorcode() {
        echo "Updating the git repository from factorcode.org..."
        invoke_git pull $GIT_URL master
}

cd_factor() {
        cd factor
        check_ret cd
}

invoke_make() {
    case $OS in
        netbsd) make='gmake';;
        *) make='make';;
    esac
   $make $*
   check_ret $make
}

make_clean() {
        invoke_make clean
}

make_factor() {
        invoke_make NO_UI=$NO_UI $MAKE_TARGET -j5
}

update_boot_images() {
        echo "Deleting old images..."
		rm checksums.txt* > /dev/null 2>&1
        rm $BOOT_IMAGE.* > /dev/null 2>&1
		rm staging.*.image > /dev/null 2>&1
		if [[ -f $BOOT_IMAGE ]] ; then
			get_url http://factorcode.org/images/latest/checksums.txt
			factorcode_md5=`cat checksums.txt|grep $BOOT_IMAGE|cut -f2 -d' '`;
			disk_md5=`md5sum $BOOT_IMAGE|cut -f1 -d' '`;
			if [[ "$factorcode_md5" == "$disk_md5" ]] ; then
				echo "Your disk boot image matches the one on factorcode.org."
			else
				rm $BOOT_IMAGE > /dev/null 2>&1
				get_boot_image;
			fi
		else
			get_boot_image
		fi
}

get_boot_image() {
	echo "Downloading boot image $BOOT_IMAGE."
	get_url http://factorcode.org/images/latest/$BOOT_IMAGE
}

get_url() {
	if [[ $DOWNLOAD -eq "" ]] ; then
		set_downloader;
	fi
	echo $DOWNLOAD $1 ;
	$DOWNLOAD $1
	check_ret $DOWNLOAD
}

maybe_download_dlls() {
        if [[ $OS == winnt ]] ; then
                get_url http://factorcode.org/dlls/freetype6.dll
                get_url http://factorcode.org/dlls/zlib1.dll
                get_url http://factorcode.org/dlls/OpenAL32.dll
                get_url http://factorcode.org/dlls/alut.dll
                get_url http://factorcode.org/dlls/ogg.dll
                get_url http://factorcode.org/dlls/theora.dll
                get_url http://factorcode.org/dlls/vorbis.dll
                get_url http://factorcode.org/dlls/sqlite3.dll
                chmod 777 *.dll
                check_ret chmod
        fi
}

get_config_info() {
        find_build_info
        check_installed_programs
        check_libraries
}

bootstrap() {
        ./$FACTOR_BINARY -i=$BOOT_IMAGE
}

install() {
        check_factor_exists
        get_config_info
        git_clone
        cd_factor
        make_factor
        get_boot_image
        maybe_download_dlls
        bootstrap
}

update() {
        get_config_info
        git_pull_factorcode
        make_clean
        make_factor
}

update_bootstrap() {
        update_boot_images
        bootstrap
}

refresh_image() {
        ./$FACTOR_BINARY -script -e="USE: vocabs.loader refresh-all USE: memory save 0 USE: system exit"
        check_ret factor
}

make_boot_image() {
        ./$FACTOR_BINARY -script -e="\"$MAKE_IMAGE_TARGET\" USE: bootstrap.image make-image save 0 USE: system exit"
        check_ret factor

}

install_libraries() {
        yes | sudo apt-get install sudo libc6-dev libfreetype6-dev libx11-dev xorg-dev glutg3-dev wget git-core git-doc rlwrap gcc make
        check_ret sudo
}

usage() {
        echo "usage: $0 install|install-x11|self-update|quick-update|update|bootstrap|net-bootstrap"
        echo "If you are behind a firewall, invoke as:"
        echo "env GIT_PROTOCOL=http $0 <command>"
}

case "$1" in
        install) install ;;
        install-x11) install_libraries; install ;;
        self-update) update; make_boot_image; bootstrap;;
        quick-update) update; refresh_image ;;
        update) update; update_bootstrap ;;
        bootstrap) get_config_info; bootstrap ;;
        net-bootstrap) get_config_info; update_boot_images; bootstrap ;;
        *) usage ;;
esac

#!/usr/bin/env bash

# Programs returning != 0 will not cause script to exit
set +e

# Case insensitive string comparison
shopt -s nocaseglob
#shopt -s nocasematch

OS=
ARCH=
WORD=
NO_UI=
GIT_PROTOCOL=${GIT_PROTOCOL:="git"}
GIT_URL=${GIT_URL:=$GIT_PROTOCOL"://factorcode.org/git/factor.git"}

test_program_installed() {
  	if ! [[ -n `type -p $1` ]] ; then
		return 0;
	fi
	return 1;
}

ensure_program_installed() {
	installed=0;
	for i in $* ;
	do
	    echo -n "Checking for $i..."
		test_program_installed $1
		if [[ $? -eq 0 ]]; then
			echo -n "not "
		else
			installed=$(( $installed + 1 ))
	    fi
	    echo "found!"
	done
	if [[ $installed -eq 0 ]] ; then
	    echo -n "Install "
	    if [[ $# -eq 1 ]] ; then
			echo -n $1
	    else
			echo -n "any of [ $* ]"
	    fi
	    echo " and try again."
	    exit 1
	fi
}

check_ret() {
        RET=$?
        if [[ $RET -ne 0 ]] ; then
           echo $1 failed
           exit 2
        fi
}

check_gcc_version() {
        echo -n "Checking gcc version..."
        GCC_VERSION=`gcc --version`
        check_ret gcc
        if [[ $GCC_VERSION == *3.3.* ]] ; then
                echo "bad!"
                echo "You have a known buggy version of gcc (3.3)"
                echo "Install gcc 3.4 or higher and try again."
                exit 3
        fi
        echo "ok."
}

set_downloader() {
	test_program_installed wget
	if [[ $? -ne 0 ]] ; then
		DOWNLOAD=wget
	else
		DOWNLOAD="curl -O"
	fi
}

check_installed_programs() {
        ensure_program_installed chmod
        ensure_program_installed uname
        ensure_program_installed git
        ensure_program_installed wget curl
        ensure_program_installed gcc
        ensure_program_installed make
        case $OS in
            netbsd) ensure_program_installed gmake;;
        esac
        check_gcc_version
}

check_library_exists() {
        GCC_TEST=factor-library-test.c
        GCC_OUT=factor-library-test.out
        echo -n "Checking for library $1..."
        echo "int main(){return 0;}" > $GCC_TEST
        gcc $GCC_TEST -o $GCC_OUT -l $1
        if [[ $? -ne 0 ]] ; then
                echo "not found!"
                echo "Warning: library $1 not found."
                echo "***Factor will compile NO_UI=1"
                NO_UI=1
        fi
        rm -f $GCC_TEST
        check_ret rm
        rm -f $GCC_OUT
        check_ret rm
        echo "found."
}

check_X11_libraries() {
        check_library_exists freetype
        check_library_exists GLU
        check_library_exists GL
        check_library_exists X11
}

check_libraries() {
        case $OS in
                linux) check_X11_libraries;;
        esac
}

check_factor_exists() {
        if [[ -d "factor" ]] ; then
                echo "A directory called 'factor' already exists."
                echo "Rename or delete it and try again."
                exit 4
        fi
}

find_os() {
        echo "Finding OS..."
        uname_s=`uname -s`
        check_ret uname
        case $uname_s in
                CYGWIN_NT-5.2-WOW64) OS=winnt;;
                *CYGWIN_NT*) OS=winnt;;
                *CYGWIN*) OS=winnt;;
                *darwin*) OS=macosx;;
                *Darwin*) OS=macosx;;
                *linux*) OS=linux;;
                *Linux*) OS=linux;;
                *NetBSD*) OS=netbsd;;
        esac
}

find_architecture() {
        echo "Finding ARCH..."
        uname_m=`uname -m`
        check_ret uname
        case $uname_m in
           i386) ARCH=x86;;
           i686) ARCH=x86;;
           *86) ARCH=x86;;
           *86_64) ARCH=x86;;
           "Power Macintosh") ARCH=ppc;;
        esac
}

write_test_program() {
        echo "#include <stdio.h>" > $C_WORD.c
        echo "int main(){printf(\"%d\", 8*sizeof(void*)); return 0; }" >> $C_WORD.c
}

find_word_size() {
        echo "Finding WORD..."
        C_WORD=factor-word-size
        write_test_program
        gcc -o $C_WORD $C_WORD.c
        WORD=$(./$C_WORD)
        check_ret $C_WORD
        rm -f $C_WORD*
}

set_factor_binary() {
        case $OS in
                winnt) FACTOR_BINARY=factor-nt;;
                macosx) FACTOR_BINARY=./Factor.app/Contents/MacOS/factor;;
                *) FACTOR_BINARY=factor;;
        esac
}

echo_build_info() {
        echo OS=$OS
        echo ARCH=$ARCH
        echo WORD=$WORD
        echo FACTOR_BINARY=$FACTOR_BINARY
        echo MAKE_TARGET=$MAKE_TARGET
        echo BOOT_IMAGE=$BOOT_IMAGE
        echo MAKE_IMAGE_TARGET=$MAKE_IMAGE_TARGET
        echo GIT_PROTOCOL=$GIT_PROTOCOL
        echo GIT_URL=$GIT_URL
}

set_build_info() {
        if ! [[ -n $OS && -n $ARCH && -n $WORD ]] ; then
                echo "OS: $OS"
                echo "ARCH: $ARCH"
                echo "WORD: $WORD"
                echo "OS, ARCH, or WORD is empty.  Please report this"
                exit 5
        fi

        MAKE_TARGET=$OS-$ARCH-$WORD
        MAKE_IMAGE_TARGET=$ARCH.$WORD
        BOOT_IMAGE=boot.$ARCH.$WORD.image
        if [[ $OS == macosx && $ARCH == ppc ]] ; then
                MAKE_IMAGE_TARGET=$OS-$ARCH
                MAKE_TARGET=$OS-$ARCH
                BOOT_IMAGE=boot.macosx-ppc.image
        fi
        if [[ $OS == linux && $ARCH == ppc ]] ; then
                MAKE_IMAGE_TARGET=$OS-$ARCH
                MAKE_TARGET=$OS-$ARCH
                BOOT_IMAGE=boot.linux-ppc.image
        fi
}

find_build_info() {
        find_os
        find_architecture
        find_word_size
        set_factor_binary
        set_build_info
        echo_build_info
}

invoke_git() {
        git $*
        check_ret git
}

git_clone() {
        echo "Downloading the git repository from factorcode.org..."
        invoke_git clone $GIT_URL
}

git_pull_factorcode() {
        echo "Updating the git repository from factorcode.org..."
        invoke_git pull $GIT_URL master
}

cd_factor() {
        cd factor
        check_ret cd
}

invoke_make() {
    case $OS in
        netbsd) make='gmake';;
        *) make='make';;
    esac
   $make $*
   check_ret $make
}

make_clean() {
        invoke_make clean
}

make_factor() {
        invoke_make NO_UI=$NO_UI $MAKE_TARGET -j5
}

delete_boot_images() {
        echo "Deleting old images..."
        rm $BOOT_IMAGE > /dev/null 2>&1
        rm $BOOT_IMAGE.* > /dev/null 2>&1
		rm staging.*.image > /dev/null 2>&1
}

get_boot_image() {
	get_url http://factorcode.org/images/latest/$BOOT_IMAGE
}

get_url() {
	if [[ $DOWNLOAD -eq "" ]] ; then
		set_downloader;
	fi
	echo "HI"
	echo $DOWNLOAD $1 ;
	$DOWNLOAD $1
	check_ret $DOWNLOAD
}

maybe_download_dlls() {
        if [[ $OS == winnt ]] ; then
                get_url http://factorcode.org/dlls/freetype6.dll
                get_url http://factorcode.org/dlls/zlib1.dll
                get_url http://factorcode.org/dlls/OpenAL32.dll
                get_url http://factorcode.org/dlls/alut.dll
                get_url http://factorcode.org/dlls/ogg.dll
                get_url http://factorcode.org/dlls/theora.dll
                get_url http://factorcode.org/dlls/vorbis.dll
                get_url http://factorcode.org/dlls/sqlite3.dll
                chmod 777 *.dll
                check_ret chmod
        fi
}

get_config_info() {
        find_build_info
        check_installed_programs
        check_libraries
}

bootstrap() {
        ./$FACTOR_BINARY -i=$BOOT_IMAGE
}

install() {
        check_factor_exists
        get_config_info
        git_clone
        cd_factor
        make_factor
        get_boot_image
        maybe_download_dlls
        bootstrap
}

update() {
        get_config_info
        git_pull_factorcode
        make_clean
        make_factor
}

update_bootstrap() {
        delete_boot_images
        get_boot_image
        bootstrap
}

refresh_image() {
        ./$FACTOR_BINARY -script -e="USE: vocabs.loader refresh-all USE: memory save 0 USE: system exit"
        check_ret factor
}

make_boot_image() {
        ./$FACTOR_BINARY -script -e="\"$MAKE_IMAGE_TARGET\" USE: bootstrap.image make-image save 0 USE: system exit"
        check_ret factor

}

install_libraries() {
        yes | sudo apt-get install sudo libc6-dev libfreetype6-dev libx11-dev xorg-dev glutg3-dev wget git-core git-doc rlwrap gcc make
        check_ret sudo
}

usage() {
        echo "usage: $0 install|install-x11|self-update|quick-update|update|bootstrap|net-bootstrap"
        echo "If you are behind a firewall, invoke as:"
        echo "env GIT_PROTOCOL=http $0 <command>"
}

case "$1" in
        install) install ;;
        install-x11) install_libraries; install ;;
        self-update) update; make_boot_image; bootstrap;;
        quick-update) update; refresh_image ;;
        update) update; update_bootstrap ;;
        bootstrap) get_config_info; bootstrap ;;
        net-bootstrap) get_config_info; delete_boot_images; get_boot_image; bootstrap ;;
        *) usage ;;
esac


BUG: It was missing -i.

BUG: It was missing -i.

#!/bin/sh
#
# More details at
# http://www.osehra.org/wiki/importing-osehra-code-base-gtm
#
export DashboardsDir=$HOME/OSEHRA/Dashboards
mkdir -p $DashboardsDir
cd $DashboardsDir
git clone git://code.osehra.org/VistA-FOIA.git
#
# switch position of two lines to solve problem with Locks.
#
sed -i.bak -e '82 i\
 TCOMMIT  ;' $HOME/OSEHRA/Dashboards/VistA-FOIA/Packages/Kernel/Routines/ZTLOAD1.m
sed -i.bak -e '84 d' $HOME/OSEHRA/Dashboards/VistA-FOIA/Packages/Kernel/Routines/ZTLOAD1.m

#!/bin/sh
#
# More details at
# http://www.osehra.org/wiki/importing-osehra-code-base-gtm
#
export DashboardsDir=$HOME/OSEHRA/Dashboards
mkdir -p $DashboardsDir
cd $DashboardsDir
git clone git://code.osehra.org/VistA-FOIA.git
#
# switch position of two lines to solve problem with Locks.
#
sed i.bak -e '82 i\
 TCOMMIT  ;' $HOME/OSEHRA/Dashboards/VistA-FOIA/Packages/Kernel/Routines/ZTLOAD1.m
sed i.bak -e '84 d' $HOME/OSEHRA/Dashboards/VistA-FOIA/Packages/Kernel/Routines/ZTLOAD1.m


add check-is-fixed-by-CVEID.sh

add check-is-fixed-by-CVEID.sh

#!/bin/bash
# Auther: Samson-W
# Data: 2022.10.16

# This script is check CVE is fixed. Get these info from https://security-tracker.debian.org/tracker/CVEID
# Usage: bash check-is-fixed-by-CVEID.sh buster CVELISTFILE DOWNLOADHTMLDIRNAME

# This result log file path
CHECKRESULTLOG="$2-check-fixed-result.log"
echo > $CHECKRESULTLOG

# download CVE traceker html from  https://security-tracker.debian.org/tracker/$cveid
# paramers: $1 is CVEID  $2 is download html storager dir
# Example: $1=CVE-2022-20001 $2=/tmp/DIRname
downloadhtml()
{
	wget --no-check-certificate  -c https://security-tracker.debian.org/tracker/$1 -O $2/$cveid
}

# Paramers: $1 download CVE html name
# Return: pkg name
get_pkgname()
{
	set -x
	# When a CVE affects multiple packages
	if	[ $(cat $1 | sed 's/tracker\/source/&\n/g' | grep buster -c ) -gt 1 ]; then
		PKGNAME=$(cat $1 | sed 's/tracker\/source/&\n/g' | grep buster | awk -F'-package/' '{print $2}' | awk -F'">' '{print $1}' | sort | uniq | tr '\n' ' ')
	else
		# When a CVE onle effects a package
		PKGNAME=$(cat  $1  | awk -F'/tracker/source-package/' '{print $2}' | awk -F'"' '{print $1}' | grep -v "^$")
	fi
	if [ "${PKGNAME}null" == "null" ]; then
        echo "$cveid pkgname is not get!!!"
        echo "$cveid PKGNAMENOTFIND"
		PKGNAME="PKGNAMENOTFIND"
    else
        echo "$cveid $PKGNAME"
    fi
}

# check CVE has fixed in release version
# Paramers: $1 download CVE html name  $2 debina release namecode
check_has_fixed()
{
	if [ $(cat $1 | awk -F'Status' '{print $2}' | grep "<td>$2" | awk -F'<td>' '{print $5}' | grep 'fixed') ]; then
		CVEFIXED=0
	else
		CVEFIXED=1
	fi
}

# Paramers:
# $1=suite  example: when OS is debian10 $1=buster, when OS is debian11 $1=bullseye
# $2 is CVE list file
# $3 is download html storager dir
for cveid in $(cat $2)
do
	downloadhtml $cveid $3
	get_pkgname $3/$cveid
	echo "pkgname is $PKGNAME"
	check_has_fixed $3/$cveid $1
	if [ $CVEFIXED -eq 0 ]; then
		echo "$cveid has fixed."
		echo "$cveid, $PKGNAME, fixed" >> $CHECKRESULTLOG
	else
		echo "$cveid is not fix!"
		echo "$cveid, $PKGNAME, nofix"  >> $CHECKRESULTLOG
	fi
done

error: pathspec 'security-operating-script/check-is-fixed-by-CVEID.sh' did not match any file(s) known to git


Add java home helper for asdf java plugin

if [ "$ASDF_DATA_DIR/plugins/java/set-java-home.zsh" ]; then
	. "$ASDF_DATA_DIR/plugins/java/set-java-home.zsh"
fi

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


add script to summarize gene features

add script to summarize gene features

#!/bin/bash

set -euo pipefail

gt=$HOME/.tephra/gt/bin/gt
gff=$1
base=$(echo ${gff%.*})

gff_sort=${base}_sort.gff3
glen_stat=${base}_sort_genelengths.txt
elen_stat=${base}_sort_exonlengths.txt
enum_stat=${base}_sort_exon-nums.txt
ilen_stat=${base}_sort_intronlengths.txt
clen_stat=${base}_sort_cdslengths.txt

# some identifying prefix for the output
prefix=bronze-maker-round3

time $gt gff3 -sort -tidy $gff > $gff_sort

time $gt stat -genelengthdistri -addintrons -o ${prefix}-genelengthdist.txt $gff_sort > $glen_stat
time $gt stat -exonlengthdistri -o ${prefix}-exonlengthdist.txt $gff_sort > $elen_stat
time $gt stat -exonnumberdistri -o ${prefix}-exonnumberdist.txt $gff_sort > $enum_stat
time $gt stat -intronlengthdistri -addintrons -o ${prefix}-intronlengthdist.txt $gff_sort > $ilen_stat
time $gt stat -cdslengthdistri -o ${prefix}-cdslengthdist.txt $gff_sort > $clen_stat

error: pathspec 'gene_annotation/shell_scripts/gff_gene_stats.sh' did not match any file(s) known to git


date change

date change

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


add git_init.sh

add git_init.sh

#!/bin/bash

if [ -z $1 ]; then
    echo 'param error'
    exit 1
fi

DIR=$2
if [ -z $DIR ]; then
   OLD_IFS=”$IFS”
   IFS=”/”
   arr=($1)
   IFS=”$OLD_IFS”
   len=${#arr[@]}
   DIR=${arr[($len-1)]}
fi

git clone $1 $2

echo 'git cloned to $DIR'

init_gitignore.sh

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


Update brew-cask-install.sh

Update brew-cask-install.sh

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


op_switchgui: Changed to work with a config file.

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


Switch to random partitioner

Switch to random partitioner

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


example script streaming hd-h264 via rtmp local relay

#!/bin/sh
ffmpeg -i tcp://localhost:11000 -aspect 16:9 -threads:0 0 \
-c:v libx264 \
-filter_complex "
  yadif=mode=2, hqdn3d [deinter];
  movie=$HOME/overlay_hd.png [logo];
  [deinter] [logo] overlay=0:0 [out]
" -map '[out]' -maxrate:v:0 3000k -bufsize:v:0 8192k -crf:0 21 -pix_fmt:0 yuv420p -profile:v:0 main -g:v:0 25 -preset:v:0 veryfast \
-ac 1 -c:a libfdk_aac -b:a 96k -ar 44100 \
-map 0:a -filter:a:0 pan=mono:c0=FL \
-ac:a:2 2 \
-y -f flv rtmp://127.0.0.1:1935/stream/s1_native_hd

error: pathspec 'voctocore/scripts/av-stream-hd.sh' did not match any file(s) known to git


Add script to create cojam-tracks graphs

#!/bin/sh
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > cojam-tracks-$1.graphml
echo "<graphml xmlns=\"http://graphml.graphdrawing.org/xmlns\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd\">" >> cojam-tracks-$1.graphml
echo "<graph id=\"G\" edgedefault=\"undirected\">" >> cojam-tracks-$1.graphml
echo "  <key id=\"cojams_num\" for=\"edge\" attr.name=\"cojams_num\" attr.type=\"int\"/>" >> cojam-tracks-$1.graphml
julia cojam-graph-vertices.jl $1
julia cojam-graph-edges.jl $1 0 80000
julia cojam-graph-edges.jl $1 80000   160000
julia cojam-graph-edges.jl $1 160000  240000
julia cojam-graph-edges.jl $1 240000  320000
julia cojam-graph-edges.jl $1 320000  400000
julia cojam-graph-edges.jl $1 400000  480000
julia cojam-graph-edges.jl $1 480000  560000
julia cojam-graph-edges.jl $1 560000  640000
julia cojam-graph-edges.jl $1 640000  720000
julia cojam-graph-edges.jl $1 720000  800000
julia cojam-graph-edges.jl $1 800000  880000
julia cojam-graph-edges.jl $1 880000  960000
julia cojam-graph-edges.jl $1 960000  1040000
julia cojam-graph-edges.jl $1 1040000 1120000
julia cojam-graph-edges.jl $1 1120000 1200000
julia cojam-graph-edges.jl $1 1200000 1280000
julia cojam-graph-edges.jl $1 1280000 1360000
julia cojam-graph-edges.jl $1 1360000 1440000
julia cojam-graph-edges.jl $1 1440000 1480000
julia cojam-graph-edges.jl $1 1480000 1500000
julia cojam-graph-edges.jl $1 1500000 1520000
julia cojam-graph-edges.jl $1 1520000 1530000
julia cojam-graph-edges.jl $1 1530000 1540000
julia cojam-graph-edges.jl $1 1540000 1550000
julia cojam-graph-edges.jl $1 1550000 1555000
julia cojam-graph-edges.jl $1 1555000 1560000
julia cojam-graph-edges.jl $1 1560000 1565000
julia cojam-graph-edges.jl $1 1565000 1570000
julia cojam-graph-edges.jl $1 1570000 1571000
julia cojam-graph-edges.jl $1 1571000 1572000
julia cojam-graph-edges.jl $1 1572000 1573000
julia cojam-graph-edges.jl $1 1573000 1574000
julia cojam-graph-edges.jl $1 1574000 1575000
echo "</graph>" >> cojam-tracks-$1.graphml
echo "</graphml>" >> cojam-tracks-$1.graphml

error: pathspec 'generate-cojam-tracks/cojam-graph-runner.sh' did not match any file(s) known to git


[ADD] backup shell script

[ADD] backup shell script

#!/bin/bash
DIR=/opt/beautifulmind/backup/
[ ! $DIR ] && mkdir -p $DIR || :
pg_dump -U postgres beautifulmind | gzip -c > $DIR/db_$(date +"%Y%m%d%H%M%S").gz

error: pathspec 'beautifulmind/deployment/db_backup.sh' did not match any file(s) known to git


Getting output from msaccess.

Getting output from msaccess.

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


Fix wrong path name for training-guide translations

Change-Id: Icd69e35a2f9639f0fd370691f3a8b2c22da68709

#!/bin/bash -xe

# 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.

PROJECT=$1
BRANCH=$2
# Replace /'s in the branch name with -'s because Zanata does not
# allow /'s in version names.
ZANATA_VERSION=${BRANCH//\//-}

source /usr/local/jenkins/slave_scripts/common_translation_update.sh

# Propose updates for manuals
function propose_manuals {

    # Pull updated translations from Zanata.
    pull_from_zanata "$PROJECT"

    # Compress downloaded po files
    # Only touch glossary in openstack-manuals but not in any other
    # repository.
    case "$PROJECT" in
        openstack-manuals)
            compress_manual_po_files "doc" 1
            ;;
        api-site)
            compress_manual_po_files "api-ref-guides" 0
            compress_manual_po_files "api-quick-start" 0
            compress_manual_po_files "api-ref" 0
            compress_manual_po_files "openstack-firstapp" 0
            ;;
        ha-guide|operations-guide)
            compress_manual_po_files "doc" 0
            ;;
        security-doc)
            compress_manual_po_files "security-guide" 0
            ;;
    esac

    # Add imported upstream translations to git
    for FILE in ${DocFolder}/*; do
        DOCNAME=${FILE#${DocFolder}/}
        if [ -d ${DocFolder}/${DOCNAME}/locale ] ; then
            git add ${DocFolder}/${DOCNAME}/locale/*
        fi
        if [ -d ${DocFolder}/${DOCNAME}/source/locale ] ; then
            git add ${DocFolder}/${DOCNAME}/source/locale/*
        fi
    done
}

# Propose updates for training-guides
function propose_training_guides {

    # Pull updated translations from Zanata.
    pull_from_zanata "$PROJECT"

    # Compress downloaded po files
    compress_po_files "doc/upstream-training"

    # Add all changed files to git
    git add doc/upstream-training/source/locale/*
}

function update_po_files {

    DIRECTORY=$1

    # Update existing translation files with extracted messages.
    PO_FILES=$(find ${DIRECTORY}/locale -name "${PROJECT}.po")
    if [ -n "$PO_FILES" ]; then
        # Use updated .pot file to update translations
        python setup.py  $QUIET update_catalog \
            --no-fuzzy-matching --ignore-obsolete=true
    fi
}

# Propose updates for python projects
function propose_python {

    # Pull updated translations from Zanata
    pull_from_zanata "$PROJECT"

    # Extract all messages from project, including log messages.
    extract_messages
    extract_messages_log "$PROJECT"

    update_po_files "$PROJECT"
    # We cannot run update_catalog for the log files, since there is no
    # option to specify the keyword and thus an update_catalog run would
    # add the messages with the default keywords. Therefore use msgmerge
    # directly.
    for level in $LEVELS ; do
        PO_FILES=$(find ${PROJECT}/locale -name "${PROJECT}-log-${level}.po")
        if [ -n "$PO_FILES" ]; then
            for f in $PO_FILES ; do
                echo "Updating $f"
                msgmerge --update --no-fuzzy-matching $f \
                    --backup=none \
                    ${PROJECT}/locale/${PROJECT}-log-${level}.pot
                # Remove obsolete entries
                msgattrib --no-obsolete --force-po \
                    --output-file=${f}.tmp ${f}
                mv ${f}.tmp ${f}
            done
        fi
    done

    # Now add all changed files to git.
    # Note we add them here to not have to differentiate in the functions
    # between new files and files already under git control.
    git add $PROJECT/locale/*

    # Remove obsolete files.
    cleanup_po_files "$PROJECT"

    # Compress downloaded po files, this needs to be done after
    # cleanup_po_files since that function needs to have information the
    # number of untranslated strings.
    compress_po_files "$PROJECT"

    # Some files were changed, add changed files again to git, so that we
    # can run git diff properly.
    git add $PROJECT/locale/*
}

function propose_horizon {

    # Pull updated translations from Zanata.
    pull_from_zanata "$PROJECT"

    # Invoke run_tests.sh to update the po files
    # Or else, "../manage.py makemessages" can be used.
    ./run_tests.sh --makemessages -V

    # Compress downloaded po files
    compress_po_files "horizon"
    compress_po_files "openstack_dashboard"

    # Add all changed files to git
    git add horizon/locale/* openstack_dashboard/locale/*
}

function propose_django_openstack_auth {

    # Pull updated translations from Zanata.
    pull_from_zanata "$PROJECT"

    # Update the .pot file
    extract_messages

    update_po_files "openstack_auth"

    # Compress downloaded po files
    compress_po_files "openstack_auth"

    # Add all changed files to git
    git add openstack_auth/locale/*
}

function propose_magnum_ui {

    # Pull updated translations from Zanata.
    pull_from_zanata "$PROJECT"

    # Invoke run_tests.sh to update the po files
    # Or else, "../manage.py makemessages" can be used.
    ./run_tests.sh --makemessages -V

    # Compress downloaded po files
    compress_po_files "magnum_ui"

    # Add all changed files to git
    git add magnum_ui/locale/*
}

# Setup git repository for git review.
setup_git

# Check whether a review already exists, setup review commit message.
setup_review "$BRANCH"

case "$PROJECT" in
    api-site|ha-guide|openstack-manuals|operations-guide|security-doc)
        init_manuals "$PROJECT"
        setup_manuals "$PROJECT" "$ZANATA_VERSION"
        propose_manuals
        ;;
    training-guides)
        setup_training_guides "$ZANATA_VERSION"
        propose_training_guides
        ;;
    django_openstack_auth)
        setup_django_openstack_auth "$ZANATA_VERSION"
        propose_django_openstack_auth
        ;;
    horizon)
        setup_horizon "$ZANATA_VERSION"
        propose_horizon
        ;;
    magnum-ui)
        setup_magnum_ui "$ZANATA_VERSION"
        propose_magnum_ui
        ;;
    *)
        # Project specific setup.
        setup_project "$PROJECT" "$ZANATA_VERSION"
        # Setup some global vars which will be used in the rest of the
        # script.
        setup_loglevel_vars
        propose_python
        ;;
esac

# Filter out commits we do not want.
filter_commits

# Propose patch to gerrit if there are changes.
send_patch "$BRANCH"

#!/bin/bash -xe

# 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.

PROJECT=$1
BRANCH=$2
# Replace /'s in the branch name with -'s because Zanata does not
# allow /'s in version names.
ZANATA_VERSION=${BRANCH//\//-}

source /usr/local/jenkins/slave_scripts/common_translation_update.sh

# Propose updates for manuals
function propose_manuals {

    # Pull updated translations from Zanata.
    pull_from_zanata "$PROJECT"

    # Compress downloaded po files
    # Only touch glossary in openstack-manuals but not in any other
    # repository.
    case "$PROJECT" in
        openstack-manuals)
            compress_manual_po_files "doc" 1
            ;;
        api-site)
            compress_manual_po_files "api-ref-guides" 0
            compress_manual_po_files "api-quick-start" 0
            compress_manual_po_files "api-ref" 0
            compress_manual_po_files "openstack-firstapp" 0
            ;;
        ha-guide|operations-guide)
            compress_manual_po_files "doc" 0
            ;;
        security-doc)
            compress_manual_po_files "security-guide" 0
            ;;
    esac

    # Add imported upstream translations to git
    for FILE in ${DocFolder}/*; do
        DOCNAME=${FILE#${DocFolder}/}
        if [ -d ${DocFolder}/${DOCNAME}/locale ] ; then
            git add ${DocFolder}/${DOCNAME}/locale/*
        fi
        if [ -d ${DocFolder}/${DOCNAME}/source/locale ] ; then
            git add ${DocFolder}/${DOCNAME}/source/locale/*
        fi
    done
}

# Propose updates for training-guides
function propose_training_guides {

    # Pull updated translations from Zanata.
    pull_from_zanata "$PROJECT"

    # Compress downloaded po files
    compress_po_files "doc/upstream-training"

    # Add all changed files to git
    git add doc/upstream-training/locale/*
}

function update_po_files {

    DIRECTORY=$1

    # Update existing translation files with extracted messages.
    PO_FILES=$(find ${DIRECTORY}/locale -name "${PROJECT}.po")
    if [ -n "$PO_FILES" ]; then
        # Use updated .pot file to update translations
        python setup.py  $QUIET update_catalog \
            --no-fuzzy-matching --ignore-obsolete=true
    fi
}

# Propose updates for python projects
function propose_python {

    # Pull updated translations from Zanata
    pull_from_zanata "$PROJECT"

    # Extract all messages from project, including log messages.
    extract_messages
    extract_messages_log "$PROJECT"

    update_po_files "$PROJECT"
    # We cannot run update_catalog for the log files, since there is no
    # option to specify the keyword and thus an update_catalog run would
    # add the messages with the default keywords. Therefore use msgmerge
    # directly.
    for level in $LEVELS ; do
        PO_FILES=$(find ${PROJECT}/locale -name "${PROJECT}-log-${level}.po")
        if [ -n "$PO_FILES" ]; then
            for f in $PO_FILES ; do
                echo "Updating $f"
                msgmerge --update --no-fuzzy-matching $f \
                    --backup=none \
                    ${PROJECT}/locale/${PROJECT}-log-${level}.pot
                # Remove obsolete entries
                msgattrib --no-obsolete --force-po \
                    --output-file=${f}.tmp ${f}
                mv ${f}.tmp ${f}
            done
        fi
    done

    # Now add all changed files to git.
    # Note we add them here to not have to differentiate in the functions
    # between new files and files already under git control.
    git add $PROJECT/locale/*

    # Remove obsolete files.
    cleanup_po_files "$PROJECT"

    # Compress downloaded po files, this needs to be done after
    # cleanup_po_files since that function needs to have information the
    # number of untranslated strings.
    compress_po_files "$PROJECT"

    # Some files were changed, add changed files again to git, so that we
    # can run git diff properly.
    git add $PROJECT/locale/*
}

function propose_horizon {

    # Pull updated translations from Zanata.
    pull_from_zanata "$PROJECT"

    # Invoke run_tests.sh to update the po files
    # Or else, "../manage.py makemessages" can be used.
    ./run_tests.sh --makemessages -V

    # Compress downloaded po files
    compress_po_files "horizon"
    compress_po_files "openstack_dashboard"

    # Add all changed files to git
    git add horizon/locale/* openstack_dashboard/locale/*
}

function propose_django_openstack_auth {

    # Pull updated translations from Zanata.
    pull_from_zanata "$PROJECT"

    # Update the .pot file
    extract_messages

    update_po_files "openstack_auth"

    # Compress downloaded po files
    compress_po_files "openstack_auth"

    # Add all changed files to git
    git add openstack_auth/locale/*
}

function propose_magnum_ui {

    # Pull updated translations from Zanata.
    pull_from_zanata "$PROJECT"

    # Invoke run_tests.sh to update the po files
    # Or else, "../manage.py makemessages" can be used.
    ./run_tests.sh --makemessages -V

    # Compress downloaded po files
    compress_po_files "magnum_ui"

    # Add all changed files to git
    git add magnum_ui/locale/*
}

# Setup git repository for git review.
setup_git

# Check whether a review already exists, setup review commit message.
setup_review "$BRANCH"

case "$PROJECT" in
    api-site|ha-guide|openstack-manuals|operations-guide|security-doc)
        init_manuals "$PROJECT"
        setup_manuals "$PROJECT" "$ZANATA_VERSION"
        propose_manuals
        ;;
    training-guides)
        setup_training_guides "$ZANATA_VERSION"
        propose_training_guides
        ;;
    django_openstack_auth)
        setup_django_openstack_auth "$ZANATA_VERSION"
        propose_django_openstack_auth
        ;;
    horizon)
        setup_horizon "$ZANATA_VERSION"
        propose_horizon
        ;;
    magnum-ui)
        setup_magnum_ui "$ZANATA_VERSION"
        propose_magnum_ui
        ;;
    *)
        # Project specific setup.
        setup_project "$PROJECT" "$ZANATA_VERSION"
        # Setup some global vars which will be used in the rest of the
        # script.
        setup_loglevel_vars
        propose_python
        ;;
esac

# Filter out commits we do not want.
filter_commits

# Propose patch to gerrit if there are changes.
send_patch "$BRANCH"


ajout cqlsh

ajout cqlsh

#!/bin/bash

set -e # exit immediately if a simple command exits with a non-zero status.
set -u # report the usage of uninitialized variables.

export LANG=en_US.UTF-8

export CASSANDRA_BIN=/var/vcap/packages/cassandra/bin
export CASSANDRA_CONF=/var/vcap/jobs/cassandra_server/conf

export JAVA_HOME=/var/vcap/packages/openjdk
export PATH=$PATH:/var/vcap/packages/openjdk/bin:$CASSANDRA_BIN:$CASSANDRA_CONF

## export CASSANDRA_CONF=/var/vcap/jobs/cassandra_server/conf

pushd /var/vcap/packages/cassandra/bin
exec chpst -u vcap:vcap /var/vcap/packages/cassandra/bin/cqlsh
popd
exit 0

error: pathspec 'jobs/cassandra_server/templates/bin/cql-sh.sh' did not match any file(s) known to git


Knative-Client v0.13.2 build scripts added.

#----------------------------------------------------------------------------------------
#
# Package			: openshift/knative-client
# Version			: v0.13.2
# Source repo		: https://github.com/openshift/knative-client
# Tested on			: RHEL 7.6
# Script License	: Apache License Version 2.0
# Maintainer		: Pratham Murkute <prathamm@us.ibm.com>
#
# Disclaimer: This script has been tested in root mode on given
# ==========  platform using the mentioned version of the package.
#             It may not work as expected with newer versions of the
#             package and/or distribution. In such case, please
#             contact "Maintainer" of this script.
# 			  Prerequisites: "Go" version 1.13.5 or higher must be installed
#
#----------------------------------------------------------------------------------------

#!/bin/bash

# environment variables & setup
mkdir -p $HOME/go
mkdir -p $HOME/go/src
mkdir -p $HOME/go/bin
mkdir -p $HOME/go/pkg
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin

# build "kn" CLI binary
mkdir -p $GOPATH/src/github.com/openshift && cd $_ && pwd
git clone https://github.com/openshift/knative-client.git
cd knative-client && pwd
#git checkout release-v0.13.2
git checkout -b v0.13.2 tags/openshift-v0.13.2
git branch -vv

# compile the code
# executes ./hack/build.sh -f
echo "Building the code.."
export GOFLAGS="-v -x" #print the commands & print the names of packages as they are compiled
make build > kn-cli-build.txt 2>&1
./kn version | tee kn-cli-version.txt 2>&1

# run the unit tests
# executes the ./hack/build.sh -t
echo "Executing the unit tests.."
export GOFLAGS="" #only print unit test results
#sed -i '149 s|go test -v|go test -v -count=1|' ./hack/build.sh #to disable test caching explicitly use -count=1
sed -i '157 s|rm|cp $test_output ./kn-cli-unittest.txt \&\& rm|' ./hack/build.sh #copy test log before deleting
make test-unit
echo "Build and unit test complete.."

error: pathspec 'openshift-knative/knative-client-v0.13.2_rhel_7.6.sh' did not match any file(s) known to git


remove supervisor kludge.

remove supervisor kludge.

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


added shortcut for running local python server

error: pathspec 'bwi_virtour/web/serveLocal.sh' did not match any file(s) known to git


readline: add symlink to update-patch-set script

to make it easier to update the patch sets and put the file in the right place

error: pathspec 'pkgs/development/libraries/readline/update-patch-set.sh' did not match any file(s) known to git


Add -p flag to mkdir

Add -p flag to mkdir

- Allows parent directories to be automatically created if necessary

#!/usr/bin/env bash

#Generate a new project from your HTML5 Boilerplate repo clone
#by: Rick Waldron & Michael Cetrulo

##first run
# $ cd  html5-boilerplate/build
# $ chmod +x createproject.sh && ./createproject.sh

##usage
# $ cd  html5-boilerplate/build
# $ ./createproject.sh

# find project root (also ensure script is ran from within repo)
src=$(git rev-parse --show-toplevel) || {
  echo "try running the script from within html5-boilerplate directories." >&2
  exit 1
}
[[ -d $src ]] || {
  echo "fatal: could not determine html5-boilerplate's root directory." >&2
  echo "try updating git." >&2
  exit 1
}

# get a name for new project
while [[ -z $name ]]
do
    echo "To create a new html5-boilerplate project, enter a new directory name:"
    read name || exit
done
dst=$src/../$name

if [[ -d $dst ]]
then
    echo "$dst exists"
else
    #create new project
    mkdir -p -- "$dst" || exit 1

    #success message
    echo "Created Directory: $dst"

    cd -- "$src"
    cp -vr -- css js img build test *.html *.xml *.txt *.png *.ico .htaccess "$dst"

    #success message
    echo "Created Project: $dst"
fi

#!/usr/bin/env bash

#Generate a new project from your HTML5 Boilerplate repo clone
#by: Rick Waldron & Michael Cetrulo

##first run
# $ cd  html5-boilerplate/build
# $ chmod +x createproject.sh && ./createproject.sh

##usage
# $ cd  html5-boilerplate/build
# $ ./createproject.sh

# find project root (also ensure script is ran from within repo)
src=$(git rev-parse --show-toplevel) || {
  echo "try running the script from within html5-boilerplate directories." >&2
  exit 1
}
[[ -d $src ]] || {
  echo "fatal: could not determine html5-boilerplate's root directory." >&2
  echo "try updating git." >&2
  exit 1
}

# get a name for new project
while [[ -z $name ]]
do
    echo "To create a new html5-boilerplate project, enter a new directory name:"
    read name || exit
done
dst=$src/../$name

if [[ -d $dst ]]
then
    echo "$dst exists"
else
    #create new project
    mkdir -- "$dst" || exit 1

    #success message
    echo "Created Directory: $dst"

    cd -- "$src"
    cp -vr -- css js img build test *.html *.xml *.txt *.png *.ico .htaccess "$dst"

    #success message
    echo "Created Project: $dst"
fi


disable debugging

disable debugging

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


Use AES-256-GCM

Use AES-256-GCM

Signed-off-by: Kawin Viriyaprasopsook <84b7a42037b9b1d0c88115cedda61c982b57a725@gmail.com>

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


Ask for reset iptables

Ask for reset iptables

Signed-off-by: bouroo <84b7a42037b9b1d0c88115cedda61c982b57a725@gmail.com>

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


Removed clause disregarding "py" element of sys.argv

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


beam-linkage-check.sh

beam-linkage-check.sh

#!/bin/bash

# Script to compare linkage errors (checkJavaLinkage task in the root gradle project) between PR's
# branch and master branch.
# This is a temporary solution before Linkage Checker implements exclusion rules (BEAM-9206).

# Usage:
#  /bin/bash sdks/java/build-tools/beam-linkage-check.sh
#
#  By default, this checks the Maven artifacts listed in ARTIFACTS variable below.
#
#  Optionally, you can pass artifact ID to overwrite the ARTIFACTS, such as:
#    /bin/bash sdks/java/build-tools/beam-linkage-check.sh "beam-runners-google-cloud-dataflow-java"
#
#  Multiple artifact IDs (separated by a comma) will check linkage errors that would appear when
#  the two artifacts are used together. For example:
#    /bin/bash sdks/java/build-tools/beam-linkage-check.sh "beam-runners-google-cloud-dataflow-java,beam-sdks-java-io-hadoop-format"

set -o pipefail
set -e

# These default artifacts are common causes of linkage errors.
ARTIFACTS="beam-sdks-java-core
  beam-sdks-java-io-google-cloud-platform
  beam-runners-google-cloud-dataflow-java
  beam-sdks-java-io-hadoop-format"

if [ ! -z "$1" ]; then
  ARTIFACTS=$1
fi

BRANCH_NAME=$(git symbolic-ref --short HEAD)

if [ ! -d buildSrc ]; then
  echo "Please run this script in the Beam project root:"
  echo "  /bin/bash sdks/java/build-tools/beam-linkage-check.sh"
  exit 1
fi

if [ "$BRANCH_NAME" = "master" ]; then
  echo "Please run this script on a branch other than master"
  exit 1
fi

OUTPUT_DIR=build/linkagecheck
mkdir -p $OUTPUT_DIR

if [ ! -z "$(git diff)" ]; then
  echo "Uncommited change detected. Please commit changes and ensure 'git diff' is empty."
  exit 1
fi

function runLinkageCheck () {
  COMMIT=$1
  local BRANCH_NAME=$(git symbolic-ref --short HEAD)
  # An empty invocation so that the subsequent checkJavaLinkage does not
  # contain garbage
  echo "`date`:" "Installing artifacts of ${BRANCH_NAME}(${COMMIT}) to Maven local repository."
  ./gradlew -Ppublishing -PjavaLinkageArtifactIds=beam-sdks-java-core :checkJavaLinkage > /dev/null 2>&1
  for ARTIFACT in $ARTIFACTS; do
    echo "`date`:" "Running linkage check for ${ARTIFACT} in ${BRANCH_NAME}"
    # Removing time taken to have clean diff
    ./gradlew -Ppublishing -PjavaLinkageArtifactIds=$ARTIFACT :checkJavaLinkage |grep -v 'BUILD SUCCESSFUL in' | grep -v 'dependency paths' > ${OUTPUT_DIR}/${COMMIT}-${ARTIFACT}
    echo "`date`:" "Done: ${OUTPUT_DIR}/${COMMIT}-${ARTIFACT}"
  done
}

BRANCH_COMMIT=`git rev-parse --short=8 HEAD`
runLinkageCheck $BRANCH_COMMIT

git checkout master
git pull
MASTER_COMMIT=`git rev-parse --short=8 HEAD`
runLinkageCheck $MASTER_COMMIT

# Restore original branch
git checkout $BRANCH_NAME

# Diff command can return non-zero status
set +e

FOUND_DIFFERENCE=false
for ARTIFACT in $ARTIFACTS; do
  echo; echo
  echo "Linkage Check difference on $ARTIFACT between master(${MASTER_COMMIT}) and ${BRANCH_NAME}(${BRANCH_COMMIT}):"
  DIFF=$(diff ${OUTPUT_DIR}/${MASTER_COMMIT}-${ARTIFACT} ${OUTPUT_DIR}/${BRANCH_COMMIT}-${ARTIFACT})
  if [ -z "$DIFF" ]; then
   echo "(no difference)"
  else
    FOUND_DIFFERENCE=true
    echo "Lines starting with '<' mean the branch remedies the errors (good)"
    echo "Lines starting with '>' mean the branch introduces new errors (bad)"
    diff ${OUTPUT_DIR}/${MASTER_COMMIT}-${ARTIFACT} ${OUTPUT_DIR}/${BRANCH_COMMIT}-${ARTIFACT}
  fi
done

if [ "$FOUND_DIFFERENCE" == true ]; then
  exit 1
fi

error: pathspec 'sdks/java/build-tools/beam-linkage-check.sh' did not match any file(s) known to git


updates to localize the script on the live server

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


Update MAC address script

Update MAC address script

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


US4914 Sandbox migration

US4914 Sandbox migration

#!/bin/bash

#This script is to migrate the application and system collections from a 6.1 to 6.3 state.
#All ingestable data that exists in the "sli" database will be dropped.
#It should be executed before ingestion service is on.
#
#Before execution, have mongod or mongos running.
#To execute, from the current directory, run "sh 61to63DBMigration.sh"

 mongo_output=`mongo --quiet sli --eval 'db["tenant"].find().forEach(function(coll) { print(coll.body.tenantId)})    '`
   for tenant in $mongo_output
   do
       echo $tenant
       sha1DBName=$(printf '%s' "$tenant" | openssl sha1 | awk '{print $2}')

       if [[ -z "$sha1DBName" ]];
       then
           sha1DBName=$(printf '%s' "$tenant" | openssl sha1)
       fi
       #add dbName field to tenant collection
       mongodump --db $sha1DBName

  done

 mongodump --db sli

error: pathspec 'sli/opstools/migration/DumpTenantAndSliDbs.sh' did not match any file(s) known to git


Fixed repo file name checking

Fixed repo file name checking

test/full program tests/fallback targets/run.sh

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


hooks/04-generate-runtime-deps.sh: disable trap on ERR, not too useful on this hook.

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


comments, compability

comments, compability

Added some comments for the new functions. Also added some more checks
to ensure backward compatibility with 10.10.

error: pathspec 'Continuity' did not match any file(s) known to git
error: pathspec 'Activation' did not match any file(s) known to git
error: pathspec 'Tool.app/Contents/Resources/contitool.sh' did not match any file(s) known to git


Add script to install Solr on Debian.

Add script to install Solr on Debian.

#!/bin/sh

# Obtain required packages
sudo apt-get update
sudo apt-get install -y --no-install-recommends
sudo apt-get install -y --no-install-recommends curl less openjdk-7-jre tomcat8 tomcat8-admin git

# just get the WAR files.
sudo mkdir -p /usr/local/solr
cd /usr/local/solr

# Get Solr from one of the mirrors.  This location will need to be updated with local copy of solr
if [ -e /usr/local/solr/solr-4.10.1.tgz]
then
  echo "fsolr-4.10.1.tgz already present"
else
  sudo wget http://mirror.metrocast.net/apache/lucene/solr/4.10.1/solr-4.10.1.tgz
  sudo tar -xzf solr-4.10.1.tgz
fi

# Copy the fedora war file to the default CATALINA_BASE directory
if [ -e /var/lib/tomcat8/webapps/solr.war ]
then
  echo "fcrepo-webapp-4.0.0-beta-03.war already deployed to /var/lib/tomcat8/webapps/solr.war"
else
  sudo cp /usr/local/solr/solr-4.10.1/dist/solr-4.10.1.war  /var/lib/tomcat8/webapps/solr.war
fi

# Modify the /etc/default/tomcat8 to have JAVA_OPTS include the fcrepo.home.
if [ `grep -c -e '-Dsolr.solr.home' < /etc/default/tomcat8` -gt 0 ]
then
  echo "solr.solr.home option already appended to /etc/default/tomcat8"
else
  echo "\n# Add the solr.solr.home option.  Without this, Solr will not start." | sudo tee --append /etc/default/tomcat8
  echo "JAVA_OPTS=\"\${JAVA_OPTS} -Dsolr.solr.home=/usr/local/solr/solr-4.10.1\"" | sudo tee --append /etc/default/tomcat8
fi

# Restart the tomcat service
sudo service tomcat8 restart

error: pathspec 'lib/HydraBones/aws/setup-deb-solr.sh' did not match any file(s) known to git


Add post_test_hook for functional tests

Add post_test_hook for functional tests

post_test_hook will be used in muranoclient-dsvm-functional job.

Change-Id: I46ea99636f464430178f170400e634218a15da73

#!/bin/bash -xe

# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

# This script is executed inside post_test_hook function in devstack gate.

function generate_testr_results {
    if [ -f .testrepository/0 ]; then
        sudo .tox/functional/bin/testr last --subunit > $WORKSPACE/testrepository.subunit
        sudo mv $WORKSPACE/testrepository.subunit $BASE/logs/testrepository.subunit
        sudo .tox/functional/bin/python /usr/local/jenkins/slave_scripts/subunit2html.py $BASE/logs/testrepository.subunit $BASE/logs/testr_results.html
        sudo gzip -9 $BASE/logs/testrepository.subunit
        sudo gzip -9 $BASE/logs/testr_results.html
        sudo chown jenkins:jenkins $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz
        sudo chmod a+r $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz
    fi
}

export MURANOCLIENT_DIR="$BASE/new/python-muranoclient"

# Get admin credentials
cd $BASE/new/devstack
source openrc admin admin

# Go to the muranoclient dir
cd $MURANOCLIENT_DIR

sudo chown -R jenkins:stack $MURANOCLIENT_DIR

# Run tests
echo "Running muranoclient functional test suite"
set +e
# Preserve env for OS_ credentials
sudo -E -H -u jenkins tox -efunctional
EXIT_CODE=$?
set -e

# Collect and parse result
generate_testr_results
exit $EXIT_CODE

error: pathspec 'muranoclient/tests/functional/hooks/post_test_hook.sh' did not match any file(s) known to git


Create build.sh

Create build.sh

#!/usr/bin/env bash
mkdir -p out/lib
mkdir -p out/app7
mkdir -p out/app9mod
mkdir -p out/app10mod

#####################################
# Build the Library
#####################################

# Compile the library's Java 7 code

$JDK7_HOME/bin/javac -d out/lib \
    src/lib_root/kata/lib/HelloLibIF.java \
    src/lib_root/kata/lib/HelloLib.java

cp -r src/lib_root/META-INF out/lib

# Compile the library's Java 9 code

$JDK9_HOME/bin/javac -d out/lib/META-INF/versions/9 \
    src/lib_java9/kata/lib/HelloLibIF.java \
    src/lib_java9/kata/lib/HelloLib.java \
    src/lib_java9/module-info.java

# Compile the library's Java 10 code

$JDK10_HOME/bin/javac -d out/lib/META-INF/versions/10 \
    src/lib_java10/kata/lib/HelloLibIF.java \
    src/lib_java10/kata/lib/HelloLib.java \
    src/lib_java10/module-info.java

# JAR-up the library

jar -cfm lib.jar src/lib_root/META-INF/MANIFEST.MF -C out/lib .

#####################################
# Build the Apps
#####################################

# Compile the Java 7 app and JAR it

$JDK7_HOME/bin/javac -cp lib.jar -d out/app7 \
    src/app7/kata/app7/HelloApp7.java

jar -cfm app7.jar src/app7/META-INF/MANIFEST.MF -C out/app7 .

# Compile the Java 9 app and JAR it

$JDK9_HOME/bin/javac -p . -d out/app9mod \
    src/app9mod/kata/app9mod/HelloApp9Mod.java \
    src/app9mod/module-info.java

jar -cfe appmod9.jar kata.app9mod.HelloApp9Mod -C out/app9mod .

# Compile the Java 10 app and JAR it

$JDK10_HOME/bin/javac -p . -d out/app10mod \
    src/app10mod/kata/app10mod/HelloApp10Mod.java \
    src/app10mod/module-info.java

jar -cfe appmod10.jar kata.app10mod.HelloApp10Mod -C out/app10mod .

error: pathspec 'src/modules/usinglibs/hellomodusingversionedlib2/build.sh' did not match any file(s) known to git


Add script to toggle builtin laptop keyboard

#!/bin/bash

set -o errexit
set -o nounset

function builtin-keyboard-id() {
    xinput --list | grep "AT Translated" | sed 's/.*id=\([0-9]*\).*/\1/'
}

function is-disabled() {
    xinput --list --long | grep -A 1 "id=$1" | grep -q disabled
}

id="$(builtin-keyboard-id)"

if is-disabled "$id"; then
    echo "Enabling $id"
    xinput enable "$id"
else
    echo "Disabling $id"
    xinput disable "$id"
fi

error: pathspec 'bin/bin/toggle-builtin-keyboard.sh' did not match any file(s) known to git


remove projects file

remove projects file

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


Added a script to perform updates on the NUC configuration.

ubuntu-14.04/nuc-server/sequence/1. Install OS Updates.sh

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


Update OpenSSL build script

Update OpenSSL build script

#!/usr/bin/env bash
set -Eeuo pipefail

# OpenSSL
# https://www.openssl.org/source/

build_dir="${HOME}/build/openssl"
date="2019-02-26"
version="1.1.1b"

# Check for macOS.
if [[ "$OSTYPE" != "darwin" ]]
then
    echo "Error: macOS is required." >&2
    exit 1
fi

echo "Installing openssl ${version} (${date})."
echo "sudo is required for this script."
sudo -v

# SC2103: Use a ( subshell ) to avoid having to cd back.
(
    cd "$build_dir" || exit 1
    curl -O "https://www.openssl.org/source/openssl-${version}.tar.gz"
    tar -xvzf "openssl-${version}.tar.gz"
    cd "openssl-${version}" || exit 1
    ./Configure darwin64-x86_64-cc
    make
    make test
    sudo make install
)

unset -v build_dir date version

cat << EOF
openssl installed successfully.
Reload the shell and check version.

command -v openssl
openssl version
EOF

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


Create runhmodlinux.sh

Create runhmodlinux.sh

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


update

update

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


Create INSTALL_MANAGER.sh

Create INSTALL_MANAGER.sh

if [ "$#" -ne 1 ]; then
    echo "Usage: $0 <github_account>"
fi

echo "Installing dependencies"
apt-get update
apt-get install git
apt-get install apache2 php5 libapache2-mod-php5

echo "Downloading and copying IntelMQ Manager"
git clone https://$1@github.com/certtools/intelmq-manager.git /tmp/intelmq-manager
cp -R /tmp/intelmq-manager/intelmq-manager/* /var/www/
chown -R www-data.www-data /var/www/

echo "Adding www-data to intelmq group"
usermod -a -G intelmq www-data

echo "Creating IntelMQ Manager admin account"
htpasswd -c /etc/apache2/password_file admin

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


Process each utterance separately when trying to align consecutive correct segments in pseudoalign_lattice, since we cannot reliably align overall word statistics with each utterance

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


add more deps libs for install woodpecker.

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


standalone

standalone

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