Experiment with Sublime as the code editor

function grade () {
	local LANGUAGE_SPEC_FILE=".language-spec"
	local student_language=""

	if [ -f "$LANGUAGE_SPEC_FILE" ]; then
		student_language=$(cat $LANGUAGE_SPEC_FILE)

		echo -e "Found language spec file for \"$student_language\""
		if [ -z "$student_language" ]; then
			echo -e "Language in \"$LANGUAGE_SPEC_FILE\" is invalid! Fix or delete it before continuing."
		fi
	elif [ "$#" -ne 1 ]; then
		echo -e "Expected \"$LANGUAGE_SPEC_FILE\" file or invocation of the form \"grade <language>\""
		return 1
	else
		student_language="$1"
	fi

	local teacher_files=".teacher_files"
	function log_execution () {
		echo -e "---- RUNNING STUDENT PROGRAM ----\n"
		"$@" | tee $teacher_files/output.log
		echo -e "---- END STUDENT PROGRAM ----\n"
	}

	function find_files () {
		find . -type f -regextype posix-extended -iregex "$@"
	}

	function wait_for_input () {
		read -p "Press any key to continue..."
	}

	function open_documents () {
		echo "--- OPENING DOCUMENT FILES ---"
		find_files '.*\.(doc|docx|pdf|png|jpg|html)' | while read file; do
			echo "Found displayable file \"$file\""
			xdg-open "$file"
		done
		wait_for_input
	}
	function open_source_files () {
		echo "--- OPENING SOURCE FILES ---"
		echo "Opening source files that match \"$@\"..."
		find_files "$@" | xargs subl3 -n
		stty sane
	}

	local source_code_pattern=""
	function open_student_code () {
		open_source_files "$source_code_pattern"
	}

	function print_run_error () {
		echo -e "ERROR: $@ -- Time to talk to the student!" 1>&2
	}

	function run_student_code_fallback () {
		echo "No fallback script defined!" 1>&2
		return 1
	}

	function run_student_code () {
		echo "--- BUILDING STUDENT CODE ---"

		local NORMAL_BUILD_SCRIPT="./build.sh"

		local return_code=0

		if [ -f "$NORMAL_BUILD_SCRIPT" ]; then
			echo "$NORMAL_BUILD_SCRIPT detected -- running normal build script for $student_language language"
			chmod +x "$NORMAL_BUILD_SCRIPT"
			$NORMAL_BUILD_SCRIPT; return_code="$?"
		elif declare -f run_student_code_fallback > /dev/null; then
			echo "No $NORMAL_BUILD_SCRIPT found, running fallback builder"
			run_student_code_fallback; return_code="$?"
			if [ ! $return_code ]; then
				print_run_error "Fallback failed."
			fi
		else
			print_run_error "Internal error: no build script or fallback build script found for this language."
		fi

		wait_for_input

		return $return_code
	}

	function remove_file () {
		[ -f "$1" ] && rm "$1"
	}

	function clean_up () {
		unset clean_up
		unset find_files
		unset LANGUAGE_SPEC_FILE
		unset log_execution
		unset open_documents
		unset open_source_files
		unset open_student_code
		unset print_run_error
		unset run_student_code
		unset student_language
		unset teacher_files
	}

	mkdir -p $teacher_files

	case "$student_language" in
		"cplusplus"*)
			;&
		"c++"*)
			source_code_pattern='.*\.(h|cpp)'
			function run_student_code_fallback () {
				remove_file "./program.exe"
				remove_file "./a.out"
				local makefile="make"
				if [ -f "$makefile" ]; then
					make
				else
					local source_location="src"

					if ! [ -d "$source_location" ]; then
						echo -e "\"$source_location\" not found, trying to compile at root..."
						source_location="."
					fi

					g++ "$source_location"/*.cpp && log_execution ./a.out
				fi
			}
			;;

		"csharp_standalone"*)
			;&
		"cs-single"*)
			source_code_pattern='(.*\.cs)'
			function run_student_code_fallback () {
				remove_file Program.exe
				mcs Program.cs
				log_execution ./Program.exe
			}
			;;

		"csharp_visual_studio"*)
			;&
		"cs-vs"*)
			source_code_pattern='(.*\.cs)'
			function run_student_code_fallback () {
				echo "Running solution build script for C# Visual Studio..."
				rm -rf */bin
				xbuild *.sln

				for file in $(find . -type f -executable -name "*.exe"); do
					log_execution "$file"
				done
			}
			;;

		"d"*)
			source_code_pattern='(.*\.d)'
			function run_student_code_fallback () {
				log_execution rdmd ./program.d
			}
			;;

		"java"*)
			source_code_pattern='(.*\.java)'
			function run_student_code_fallback () {
				remove_file ./program.jar
				ant
				java -jar ./program.jar
			}
			;;

		"php"*)
			source_code_pattern='(.*\.php)'
			function run_student_code_fallback () {
				php program.php
			}
			;;

		"python3"*)
			source_code_pattern='(.*\.py)'
			function run_student_code_fallback () {
				python program.py
			}
			;;

		*)
			echo "Unrecognized programming language"
			clean_up
			return 1
			;;
	esac

	open_documents
	run_student_code
	open_student_code
	clean_up

	return 0
}

function grade () {
	local LANGUAGE_SPEC_FILE=".language-spec"
	local student_language=""

	if [ -f "$LANGUAGE_SPEC_FILE" ]; then
		student_language=$(cat $LANGUAGE_SPEC_FILE)

		echo -e "Found language spec file for \"$student_language\""
		if [ -z "$student_language" ]; then
			echo -e "Language in \"$LANGUAGE_SPEC_FILE\" is invalid! Fix or delete it before continuing."
		fi
	elif [ "$#" -ne 1 ]; then
		echo -e "Expected \"$LANGUAGE_SPEC_FILE\" file or invocation of the form \"grade <language>\""
		return 1
	else
		student_language="$1"
	fi

	local teacher_files=".teacher_files"
	function log_execution () {
		echo -e "---- RUNNING STUDENT PROGRAM ----\n"
		"$@" | tee $teacher_files/output.log
		echo -e "---- END STUDENT PROGRAM ----\n"
	}

	function find_files () {
		find . -type f -regextype posix-extended -iregex "$@"
	}

	function wait_for_input () {
		read -p "Press any key to continue..."
	}

	function open_documents () {
		echo "--- OPENING DOCUMENT FILES ---"
		find_files '.*\.(doc|docx|pdf|png|jpg|html)' | while read file; do
			echo "Found displayable file \"$file\""
			xdg-open "$file"
		done
		wait_for_input
	}
	function open_source_files () {
		echo "--- OPENING SOURCE FILES ---"
		echo "Opening source files that match \"$@\"..."
		find_files "$@" | xargs vim -O
		stty sane
	}

	local source_code_pattern=""
	function open_student_code () {
		open_source_files "$source_code_pattern"
	}

	function print_run_error () {
		echo -e "ERROR: $@ -- Time to talk to the student!" 1>&2
	}

	function run_student_code_fallback () {
		echo "No fallback script defined!" 1>&2
		return 1
	}

	function run_student_code () {
		echo "--- BUILDING STUDENT CODE ---"

		local NORMAL_BUILD_SCRIPT="./build.sh"

		local return_code=0

		if [ -f "$NORMAL_BUILD_SCRIPT" ]; then
			echo "$NORMAL_BUILD_SCRIPT detected -- running normal build script for $student_language language"
			chmod +x "$NORMAL_BUILD_SCRIPT"
			$NORMAL_BUILD_SCRIPT; return_code="$?"
		elif declare -f run_student_code_fallback > /dev/null; then
			echo "No $NORMAL_BUILD_SCRIPT found, running fallback builder"
			run_student_code_fallback; return_code="$?"
			if [ ! $return_code ]; then
				print_run_error "Fallback failed."
			fi
		else
			print_run_error "Internal error: no build script or fallback build script found for this language."
		fi

		wait_for_input

		return $return_code
	}

	function remove_file () {
		[ -f "$1" ] && rm "$1"
	}

	function clean_up () {
		unset clean_up
		unset find_files
		unset LANGUAGE_SPEC_FILE
		unset log_execution
		unset open_documents
		unset open_source_files
		unset open_student_code
		unset print_run_error
		unset run_student_code
		unset student_language
		unset teacher_files
	}

	mkdir -p $teacher_files

	case "$student_language" in
		"cplusplus"*)
			;&
		"c++"*)
			source_code_pattern='.*\.(h|cpp)'
			function run_student_code_fallback () {
				remove_file "./program.exe"
				remove_file "./a.out"
				local makefile="make"
				if [ -f "$makefile" ]; then
					make
				else
					local source_location="src"

					if ! [ -d "$source_location" ]; then
						echo -e "\"$source_location\" not found, trying to compile at root..."
						source_location="."
					fi

					g++ "$source_location"/*.cpp && log_execution ./a.out
				fi
			}
			;;

		"csharp_standalone"*)
			;&
		"cs-single"*)
			source_code_pattern='(.*\.cs)'
			function run_student_code_fallback () {
				remove_file Program.exe
				mcs Program.cs
				log_execution ./Program.exe
			}
			;;

		"csharp_visual_studio"*)
			;&
		"cs-vs"*)
			source_code_pattern='(.*\.cs)'
			function run_student_code_fallback () {
				echo "Running solution build script for C# Visual Studio..."
				rm -rf */bin
				xbuild *.sln

				for file in $(find . -type f -executable -name "*.exe"); do
					log_execution "$file"
				done
			}
			;;

		"d"*)
			source_code_pattern='(.*\.d)'
			function run_student_code_fallback () {
				log_execution rdmd ./program.d
			}
			;;

		"java"*)
			source_code_pattern='(.*\.java)'
			function run_student_code_fallback () {
				remove_file ./program.jar
				ant
				java -jar ./program.jar
			}
			;;

		"php"*)
			source_code_pattern='(.*\.php)'
			function run_student_code_fallback () {
				php program.php
			}
			;;

		"python3"*)
			source_code_pattern='(.*\.py)'
			function run_student_code_fallback () {
				python program.py
			}
			;;

		*)
			echo "Unrecognized programming language"
			clean_up
			return 1
			;;
	esac

	open_documents
	run_student_code
	open_student_code
	clean_up

	return 0
}


Add find stale semaphores script

Add find stale semaphores script

#!/bin/bash
# Looks for semaphore arrays for which every semaphore in the array has a pid
# associated with it that no longer exists. It then spits out a list of ipcrm
# commands you can use to clean them up.
SETS=$(ipcs -s | tail -n +4 | awk '{print $2}')
for s in $SETS; do
    PIDS=$(ipcs -s -i $s | tail -n +9 | awk '{print $NF}')
    PID_FOUND=
    for p in $PIDS; do
        [[ -d /proc/$p ]] && PID_FOUND=1
    done
    if [[ -z $PID_FOUND ]]; then
        echo "ipcrm -s $s"
    fi
done

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


moved old script to dead folder

moved old script to dead folder

#!/bin/bash
# Use once to set the rights to www-data

cyberDojoHome=/var/www/cyber-dojo
cd $cyberDojoHome

apt-get install -y acl

# cyber-dojo creates folders under katas
echo "chown/chgrp www-data katas"
chmod g+rwsx katas
setfacl -d -m group:www-data:rwx $cyberDojoHome/katas
setfacl -m group:www-data:rwx $cyberDojoHome/katas

# ensure pulled files have correct rights
for folder in admin_scripts app config exercises languages lib log notes public script spec test
do
  echo "chown www-data:www-data ${folder}"
  chown -R www-data:www-data $cyberDojoHome/$folder
done

# tests create folders under tests/cyber-dojo/katas
echo "chown www-data test/cyber-dojo"
chmod g+rwsx $cyberDojoHome/test/cyber-dojo
setfacl -d -m group:www-data:rwx $cyberDojoHome/test/cyber-dojo
setfacl -m group:www-data:rwx $cyberDojoHome/test/cyber-dojo

echo "chown www-data:www-data *"
chown www-data:www-data $cyberDojoHome/*

echo "chown www-data:www-data .*"
chown www-data:www-data $cyberDojoHome/.*

echo "chown -R www-data:www-data tmp"
chown -R www-data:www-data $cyberDojoHome/tmp

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


Make bwc-ptrace.sh more fool-proof

Make bwc-ptrace.sh more fool-proof

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/mancoast/cado-nfs.git/'


Create slack.sh

Create slack.sh


added old version of add-parallel-tools.sh

#!/bin/bash

# copy this file to (or paste the contents into) a
# text file called add-parallel-tools.sh on the VM
# run this script as follows:
#   sudo bash add-parallel-tools.sh
# it will take a couple minutes to complete

export DEBIAN_PRIORITY=high
export DEBIAN_FRONTEND=noninteractive

# install fast linear algebra package and MPI functionality
# we install openMPI from source because Ubuntu-packaged version (1.6.5)
# has bug in MPI_Comm_spawn affecting Rmpi
git config --global user.email "bce@lists.berkeley.edu"
git config --global user.name "BCE Release Team"

apt-get update
apt-get install -y libopenblas-base # libopenmpi-dev openmpi-bin

MPI_VERSION=1.8.4
mkdir /usr/local/openmpi
cd /usr/local/openmpi
# get openmpi from permanent BCE repository
wget -O bce-openmpi-${MPI_VERSION}.tgz https://googledrive.com/host/0B9npFE3iDymgbTBZUGRBV3VYOEE
# temporary location (should still work if needed)
# wget http://www.stat.berkeley.edu/~paciorek/transfer/bce-openmpi-${MPI_VERSION}.tgz

tar -xvzf bce-openmpi-${MPI_VERSION}.tgz
rm bce-openmpi-${MPI_VERSION}.tgz
echo /usr/local/openmpi/lib > /etc/ld.so.conf.d/openmpi.conf
ldconfig
echo 'export PATH=${PATH}:/usr/local/openmpi/bin' >> /etc/bash.bashrc
export PATH=${PATH}:/usr/local/openmpi/bin

# install parallelization packages for Python
HOME=/root pip install multiprocessing mpi4py

PP_VERSION=1.6.4
cd /tmp
wget http://www.parallelpython.com/downloads/pp/pp-${PP_VERSION}.tar.gz
tar -xvzf pp-${PP_VERSION}.tar.gz
cd pp-${PP_VERSION}
python setup.py install

# install parallelization packages for R
cat <<EOF > /tmp/R-packages.txt
doMPI
rlecuyer
pbdDEMO
pbdSLAP
pbdBASE
pbdDMAT
pbdMPI
EOF

Rscript -e "pkgs <- scan('/tmp/R-packages.txt', what = 'char'); install.packages(pkgs, repos = 'http://cran.cnr.berkeley.edu')"

error: pathspec 'post-install/add-parallel-tools-2015-spring.sh' did not match any file(s) known to git


added integration testing script

added integration testing script

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

CODE_DIR=$1
cd $CODE_DIR

GCS_TRAIN_FILE=gs://cloudml-public/census/data/adult.data.csv
GCS_EVAL_FILE=gs://cloudml-public/census/data/adult.test.csv
CENSUS_DATA=census_data

TRAIN_FILE=$CENSUS_DATA/adult.data.csv
EVAL_FILE=$CENSUS_DATA/adult.test.csv

gsutil cp $GCS_TRAIN_FILE $TRAIN_FILE
gsutil cp $GCS_EVAL_FILE $EVAL_FILE

export TRAIN_STEPS=1000
DATE=`date '+%Y%m%d_%H%M%S'`
export OUTPUT_DIR=census_$DATE

#Local training
python trainer/task.py --train-files $TRAIN_FILE \
                       --eval-files $EVAL_FILE \
                       --job-dir $OUTPUT_DIR \
                       --train-steps $TRAIN_STEPS \
                       --eval-steps 100

rm -rf $CENSUS_DATA
rm -rf $OUTPUT_DIR

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


Revert "[CSL-1573] Remove buildbench.sh (use ./b --no-bench)"

This reverts commit ea972730d4db9cce642001640d56547f4bae4b51.
buildbench.sh script is used by networking team.

#!/bin/sh

# dev-mode : allow to generate custom genesis block
# CONFIG=.. selects section from config file (core/constants.yaml)
# dev-custom-config needed to override config file section

stack build --flag cardano-sl-core:dev-mode --flag cardano-sl-core:dev-custom-config --ghc-options=-DCONFIG=benchmark --flag cardano-sl-core:-asserts cardano-sl cardano-sl-lwallet cardano-sl-wallet cardano-sl-explorer

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


added example script for import of ratings into mpds sticker database

#!/bin/bash

# example script to import clerks flat rating files back into mpds sticker
# database. This example is for albumratings and works for flac, ogg and mp3.
# files. music_path has to be set in clerks config file.
# If you have a nicer script to do this, let me know :)

source $HOME/.config/clerk/config

findfiles () {
if [[ "$1" == "flac" ]] || [[ "$1" == "ogg" ]]; then
    cd "$(dirname "$2")"
    info="$(mutagen-inspect 01-*.flac)"
    artist="$(echo "$info" | grep "^ARTIST=" | awk -F "=" '{ print $2 }')"
    album="$(echo "$info" | grep "^ALBUM=" | awk -F "=" '{ print $2 }')"
    date="$(echo "$info" | grep "^DATE=" | awk -F "=" '{ print $2 }')"
    albumrating="$(grep "albumrating=" "$music_path"/"$2" | awk -F "=" '{ print $2 }')"

    if [[ -z "$(mpc find artist "$artist" album "$album" date "$date" disc "1" track "1")" ]]; then
        uri="$(mpc find artist "$artist" album "$album" date "$date" track "1")"
    else
        uri="$(mpc find artist "$artist" album "$album" date "$date" disc "1" track "1")"
    fi
    mpc sticker "$uri" set albumrating "$albumrating"

elif [[ "$1" == "mp3" ]]; then
    cd "$(dirname "$2")"
    info="$(mutagen-inspect 01-*.mp3)"
    artist="$(echo "$info" | grep "^TPE2=" | awk -F "=" '{ print $2 }')"
    album="$(echo "$info" | grep "^TALB=" | awk -F "=" '{ print $2 }')"
    date="$(echo "$info" | grep "^TDRC=" | awk -F "=" '{ print $2 }')"
    albumrating="$(grep "albumrating=" "$music_path"/"$2" | awk -F "=" '{ print $2 }')"

    if [[ -z "$(mpc find artist "$artist" album "$album" date "$date" disc "1" track "1")" ]]; then
        uri="$(mpc find artist "$artist" album "$album" date "$date" track "1")"
    else
        uri="$(mpc find artist "$artist" album "$album" date "$date" disc "1" track "1")"
    fi
    mpc sticker "$uri" set albumrating "$albumrating"
fi
}

cd "$music_path"
find . -name \*.albumrating | while read file; do findfiles $1 "$file"; done

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


add kill java shell

add kill java shell

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/BeaverCC/handy.git/'


Retry update of nova service tenant ID in neutron server config

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/Mirantis/octane.git/'


Create restore_objects_s3.sh

Create restore_objects_s3.sh

aws s3api list-object-versions --bucket "$BUCKET_NAME" --prefix "$PREFIX" --output text --region eu-west-1 | grep "DELETEMARKERS" >delete_markers.out
cat delete_markers.out
while read -r obj; do
  KEY=$(echo "$obj" | awk '{print $3}')
  VERSION_ID=$(echo "$obj" | awk '{print $5}')
  echo "$KEY"
  echo "$VERSION_ID"
  aws s3api delete-object --bucket "$BUCKET_NAME" --key "$KEY" --version-id "$VERSION_ID" --region eu-west-1
done <delete_markers.out

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


sync parallel

sync parallel

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


Update essentials.sh

Update essentials.sh

#!/usr/bin/env bash
### every exit != 0 fails the script
set -e
echo "Install some common tools for further installation"
apt-get update && apt-get install -y --allow-unauthenticated make grep sed sudo dpkg git wget zip build-essential python \
python-dev python-pip bzip2 mercurial locales ca-certificates subversion vim gdebi-core bash-completion apt-utils openjdk-8-jre \
openssh-server unzip curl ruby net-tools libglib2.0-0 libxext6 libsm6 libxrender1 aptitude icedtea-8-plugin synaptic \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

#!/usr/bin/env bash
### every exit != 0 fails the script
set -e
echo "Install some common tools for further installation"
apt-get update && apt-get install -y --allow-unauthenticated make grep sed sudo dpkg git wget zip build-essential python \
python-dev python-pip bzip2 mercurial locales ca-certificates subversion vim gdebi-core bash-completion apt-utils openjdk-8-jre \
openssh-server unzip curl ruby net-tools libglib2.0-0 libxext6 libsm6 libxrender1 aptitude icedtea-7-plugin synaptic \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*


launcher.sh added

launcher.sh added

#!/usr/bin/env bash

# If you want to start `systray.py` upon boot,
# then call this launcher script.
# If you call `systray.py` upon boot, it'll
# be called too early and very likely you'll
# get an error that the system tray is missing.

sleep 30    # giving some time for the system tray to come up

HERE=`dirname $0`
cd $HERE
./systray.py

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


setup: fixes node installation script

setup: fixes node installation 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/rdumont/dotfiles.git/'


add spark notebook install to provisioning 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/tolomaus/languagedetector.git/'


Removed hardcoded ports from start-kafka-pixy.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/nicolaevladescu/docker-kafka-pixy.git/'


Create runMultipleStarJob.sh

Create runMultipleStarJob.sh

This is a "beta" but appears to be working well.

#!/bin/bash
#Script written by Thomas Wentworth, contact at twentworth@gmail.com

#SGE Options:
#-----------------------------------------------------------------------------------

#Nodes To Request
nNodes=8

#e-mail address (blank for no e-mail):
eMail=twentworth@gmail.com

#Job Name (what appears in the qstat command)
jobName=starJob

#Specify qsub queue
specifyQ=True
qsubQ=test.q

#virtualEnv To Activate
activateVirtualEnv=True
virtualEnv=~/py27/bin/activate

#STAR Options:
#-----------------------------------------------------------------------------------

#Star location (where is the star program?)
starLoc=/home/tawentwo/STAR-STAR_2.4.0h/bin/Linux_x86_64_static/STAR

#Star Threads (how many processing threads do you want, on ROUS this would be 8, or maybe 16 if you think hyperthreading might help)
starThreads=16

#Paired ends or not paired ends (enter True or False)
paired=True

#Output Directory (where do you want to save everything?)
outDir=/home/tawentwo/hg19/furling_deleteThisRun

#Which STAR annotation file do you wish to use?
genomeDir=/home/tawentwo/hg19/starGenomeDir_spike_ensKnownRefSeq

#Folder where Fastq files are located
pathToFastqFiles=/home/et_wang/furling/fastq

#List of reads and output name (in the fastQ folder)
#For paired readsm format like this :
#readFilesIn = (fileA_1 fileA_2 fileAOutputName \
#	fileB_1 fileB_2 fileBOutputName \
#	fileC_1 fileC_2 fileCOutputName)
#For non-paired readsm format like this :
#readFilesIn = (fileA fileAOutputName \
#	fileB fileBOutputName \
#	fileC fileCOutputName)
#If a name or filename needs a space, use '\ ' instead of ' '

readFilesIn=( C467_RE_B00GGOZ_1_1_C5TPLACXX.IND12.fastq.gz	C467_RE_B00GGOZ_1_2_C5TPLACXX.IND12.fastq.gz     C25-40h-indCTG-3 \
C467_RE_B00GGPI_5_1_C5VH9ACXX.IND6.fastq.gz	C467_RE_B00GGPI_5_2_C5VH9ACXX.IND6.fastq.gz     C25-20h-indCTG-1 \
C467_RE_B00GGPJ_6_1_C5VH9ACXX.IND6.fastq.gz	C467_RE_B00GGPJ_6_2_C5VH9ACXX.IND6.fastq.gz     C25-20h-indCTG-2 \
C467_RE_B00GGPK_7_1_C5VH9ACXX.IND6.fastq.gz	C467_RE_B00GGPK_7_2_C5VH9ACXX.IND6.fastq.gz     C25-20h-indCTG-3 \
C467_RE_B00GGPL_1_1_C5R54ACXX.IND6.fastq.gz	C467_RE_B00GGPL_1_2_C5R54ACXX.IND6.fastq.gz     C25-20h-plus-indCTG-1 \
C467_RE_B00GGPM_2_1_C5R54ACXX.IND6.fastq.gz	C467_RE_B00GGPM_2_2_C5R54ACXX.IND6.fastq.gz     C25-20h-plus-indCTG-2 \
C467_RE_B00GGPN_3_1_C5R54ACXX.IND6.fastq.gz	C467_RE_B00GGPN_3_2_C5R54ACXX.IND6.fastq.gz     C25-20h-plus-indCTG-3 \
C467_RE_B00GGPO_4_1_C5R54ACXX.IND6.fastq.gz	C467_RE_B00GGPO_4_2_C5R54ACXX.IND6.fastq.gz     C25-40h-plus-indCTG-1 \
C467_RE_B00GGPP_5_1_C5R54ACXX.IND6.fastq.gz	C467_RE_B00GGPP_5_2_C5R54ACXX.IND6.fastq.gz     C25-40h-plus-indCTG-2 \
C467_RE_B00GGPQ_5_1_C5VH9ACXX.IND12.fastq.gz	C467_RE_B00GGPQ_5_2_C5VH9ACXX.IND12.fastq.gz     C25-40h-plus-indCTG-3 \
C467_RE_B00GGPR_6_1_C5VH9ACXX.IND12.fastq.gz	C467_RE_B00GGPR_6_2_C5VH9ACXX.IND12.fastq.gz     C25-60h-indCTG-1 \
C467_RE_B00GGPS_7_1_C5VH9ACXX.IND12.fastq.gz	C467_RE_B00GGPS_7_2_C5VH9ACXX.IND12.fastq.gz     C25-60h-indCTG-2 \
C467_RE_B00GGPT_1_1_C5R54ACXX.IND12.fastq.gz	C467_RE_B00GGPT_1_2_C5R54ACXX.IND12.fastq.gz     C25-60h-indCTG-3 \
C467_RE_B00GGPU_2_1_C5R54ACXX.IND12.fastq.gz	C467_RE_B00GGPU_2_2_C5R54ACXX.IND12.fastq.gz     C25-60h-plus-indCTG-1 \
C467_RE_B00GGPV_3_1_C5R54ACXX.IND12.fastq.gz	C467_RE_B00GGPV_3_2_C5R54ACXX.IND12.fastq.gz     C25-60h-plus-indCTG-2 \
C467_RE_B00GGPW_4_1_C5R54ACXX.IND12.fastq.gz	C467_RE_B00GGPW_4_2_C5R54ACXX.IND12.fastq.gz     C25-60h-plus-indCTG-3 \
C467_RE_B00GGPX_5_1_C5R54ACXX.IND12.fastq.gz	C467_RE_B00GGPX_5_2_C5R54ACXX.IND12.fastq.gz     C25-60h-siMBNL12-1 \
C467_RE_B00GGPY_1_1_C5TPLACXX.IND6.fastq.gz	C467_RE_B00GGPY_1_2_C5TPLACXX.IND6.fastq.gz     C25-60h-siMBNL12-2 \
C467_RE_B00GGPZ_4_1_C5TM5ACXX.IND6.fastq.gz	C467_RE_B00GGPZ_4_2_C5TM5ACXX.IND6.fastq.gz     C25-60h-siMBNL12-3 \
C467_RE_B00GGQ0_6_1_C5R54ACXX.IND12.fastq.gz	C467_RE_B00GGQ0_6_2_C5R54ACXX.IND12.fastq.gz     C25-40h-indCTG-1 \
C467_RE_B00GGQ1_4_1_C5TM5ACXX.IND12.fastq.gz	C467_RE_B00GGQ1_4_2_C5TM5ACXX.IND12.fastq.gz     C25-40h-indCTG-2 )

#Options :
#format like this:
#options=(option1Name option1Value \
#	option2Name option2Value \
#	option3Name option3Value)
#If a option value needs a space, use '\ ' instead of ' '

options=(outFilterMismatchNoverReadLmax .06 \
outFilterMismatchNmax 999 \
readFilesCommand zcat \
outFilterScoreMinOverLread 0.8 \
outFilterMismatchNoverLmax .06 \
outFilterMatchNmin 0 \
outFilterMatchNminOverLread .9 \
alignEndsType EndToEnd \
limitBAMsortRAM 30000000000
outFilterMultimapNmax 1 \
outFilterMultimapScoreRange 0 \
outSAMtype BAM\ SortedByCoordinate \
genomeLoad NoSharedMemory)

#DO NOT EDIT BELOW THIS LINE!!!!!
#-------------------------------------------------------------------------------------------------------------------------------------

#MAKE SURE THAT WE DON'T OVERWRITE DIRECTORY

if [ -d "$outDir" ]
then
	dirAdd=1
	while [ -d "${outDir}_${dirAdd}" ]
	do
		let "dirAdd+=1"
	done
	outDir=${outDir}_${dirAdd}
fi

#make the directory
mkdir -p ${outDir}

#Make command
strHead='#!/bin/bash\n#$ -S /bin/bash\n#$ -N '$jobName'\n#$ -cwd\n#$ -m bea\n#$ -M '${eMail}'\n#$ -pe whole_nodes '$nNodes'\n'

if [[ paired ]]; then
	div=3
else
	div=2
fi

optionString=''
for i in  ${!options[@]};
do
	if [ $(( i % 2 )) != 0 ];
		then
		continue
	fi
	optionString=${optionString}'--'${options[i]}' '${options[i+1]}' '
done

tmpFileSt=`cat /dev/urandom | env LC_CTYPE=C tr -dc "a-zA-Z0-9" | head -c10`
for i in ${!readFilesIn[@]};
do
	if [ $(( i % div )) != 0 ];
	then
		continue
	fi
	runStr=$strHead
	if [[ activateVirtualEnv ]]; then
		runStr=$runStr'\nsource '${virtualEnv}'\n'
	fi
	runStr=$runStr'\n'$starLoc' --genomeDir '${genomeDir}
	if [[ paired ]]; then
		outFilePrefix=${outDir}/${readFilesIn[i+2]}.
		runStr=$runStr' --readFilesIn '${pathToFastqFiles}/${readFilesIn[i]}' '${pathToFastqFiles}/${readFilesIn[i+1]}' --outFileNamePrefix '${outFilePrefix}
	else
		outFilePrefix=${outDir}/${readFilesIn[i+1]}.
		runStr=$runStr' --readFilesIn '${pathToFastqFiles}/${readFilesIn[i]}' --outFileNamePrefix '${outFilePrefix}
	fi
	runStr=$runStr' --runThreadN '${starThreads}
	runStr=$runStr' '${optionString}
	runStr=$runStr'\nsamtools index '${outFilePrefix}'Aligned.sortedByCoord.out.bam'
	flName=${tmpFileSt}`cat /dev/urandom | env LC_CTYPE=C tr -dc "a-zA-Z0-9" | head -c10`.sh

	echo -e $runStr > ${flName}

	if [[ specifyQ ]]; then
		qsub -q ${qsubQ} ${flName}
	else
		qsub ${flName}
	fi
	rm $flName

done

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


add deploy.sh to rust-uclibc

add deploy.sh to rust-uclibc

#!/bin/bash

set -ex

tag=$(date +%F)

build() {
    cd $(dirname $0)
    docker build -t japaric/rust-uclibc:$tag -f Dockerfile ..
}

test() {
    true
}

deploy() {
    docker push japaric/rust-uclibc
}

main() {
    build
    test

    if [ ! "$1" = "--test-only" ]; then
        deploy
    fi
}

main "$@"

error: pathspec 'rust-uclibc/deploy.sh' did not match any file(s) known to git


#30 update gen_ocdemo_certs.sh check if symlinks already created

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/baszoetekouw/OpenConext-deploy.git/'


shell-script that helps previewing the sphinx documentation

#!/bin/bash

abort() {
    echo >&2 "$*"; exit 1;
}

usage() {
    abort """Usage: $(basename $0) OPTIONS
    -p|--port     Port number for the HTTP server to use (default: 8000)
    -b|--browser  Browser to open the link (default: xdg-open)"""
}

require() {
    type $1 >/dev/null 2>&1
}

port=8000
browser=xdg-open
while [ "${1#-}" != "$1" ]; do
    case "$1" in
        -h) usage;;
        -p|--port) [ -z "$2" ] && usage; port="$2"; shift;;
        -b|--browser) [ -z "$2" ] && usage; browser="$2"; shift;;
        *) usage;;
    esac
    shift
done

require when-changed || abort "Please install $1 first:   sudo pip install when-changed"
require "$browser" || abort "$browser is not available -- please specify another browser"

# compile the first time
make html

# open web-browser
$browser http://localhost:$port/html &

# run HTTP server in background inside the _build dir
# NOTE: here, cd also runs in bg, so the script's current dir stays the same
cd _build && python -m SimpleHTTPServer $port &

# watch for changes
when-changed index.rst -c "make html; echo Use Ctrl-C to quit preview"

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


Rename run-meetua-staging.sh; missed file

export NODE_ENV=staging
sudo forever --uid=meetua-staging -a start -c nodemon app.js

error: pathspec 'run-meetua-staging.sh' did not match any file(s) known to git


MW OSD GUI failure script

MW OSD GUI failure 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/kkshmz/dotfiles.git/'


Add another regression test - one we don't pass right now.

#!/bin/sh
# $FreeBSD$
# A really simple script to create a swap-backed msdosfs filesystem, then test to
# make sure the case conversion issue described in msdosfs_lookup.c rev 1.46
# is fixed.

mkdir /tmp/msdosfstest/
mdconfig -a -t swap -s 128m -u 10
bsdlabel -w md10 auto
newfs_msdos -F 16 -b 8192 /dev/md10a
mount_msdosfs /dev/md10a /tmp/msdosfstest/
cat /tmp/msdosfstest/foo
touch /tmp/msdosfstest/FOO
cat /tmp/msdosfstest/foo
if [ $? -eq 0 ]; then
        echo "ok 2";
else
        echo "not ok 2";
fi
umount /tmp/msdosfstest/
mdconfig -d -u 10
rmdir /tmp/msdosfstest/

error: pathspec 'tools/regression/msdosfs/msdosfstest-2.sh' did not match any file(s) known to git


Random mute and restore.

Random mute and restore.

#/bin/env sh
VOLUME=$(osascript -e "output volume of (get volume settings)")
osascript -e 'set volume 0'
sleep 2
osascript -e "set volume output volume $VOLUME"

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


old ssh script

old ssh script

#!/bin/bash
ssh -i ucbc.pem ubuntu@54.201.0.142

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


jade to pug

jade to pug

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/vitorgalvao/dotfiles.git/'


Initial version on update_site.sh script.

#!/bin/sh
#
# Script to update dynamic parts of the site.

PROJECT_DIR="`pwd`/.."
LCTOOLS_VERSION="`cat ${PROJECT_DIR}/VERSION`"

## path settings
SITEDIR="tmp"
TUTORIAL_SOURCE_PATH="${PROJECT_DIR}/doc/tutorial.tex"
TUTORIAL_OUTPUT_PATH="${SITEDIR}/doc/${LCTOOLS_VERSION}/tutorial"
MAN_INPUT_PATH="${PROJECT_DIR}/man"
MAN_OUTPUT_PATH="${SITEDIR}/doc/${LCTOOLS_VERSION}/man"

## commands
LATEX2HTML="latex2html"
RONN="ronn"

#echo ${PROJECT_DIR}

prepare_work_dir() {
	echo " * setting up working directory"

	rm -fr ${SITEDIR}
	mkdir -p ${SITEDIR}
}

build_tutorial() {
	echo " * building tutorial"

	mkdir -p ${TUTORIAL_OUTPUT_PATH} > /dev/null 2>&1
	${LATEX2HTML} -verbosity 0 -dir ${TUTORIAL_OUTPUT_PATH} \
		${TUTORIAL_SOURCE_PATH} > /dev/null 2>&1
}

build_man() {
	echo " * building man pages"

	mkdir -p ${MAN_OUTPUT_PATH} > /dev/null 2>&1

	for man in ${MAN_INPUT_PATH}/*.ronn; do
		HTML_OUTPUT=`basename ${man}|sed -e 's|ronn$|html|'`
		${RONN} --html --pipe ${man} > \
			${MAN_OUTPUT_PATH}/${HTML_OUTPUT};
	done
}

git checkout gh-pages
exit

prepare_work_dir

build_man

build_tutorial

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


removes post-install command.

removes post-install command.

#!/usr/bin/env bash

set -e
set -x

sleep 10

BUILD_DIR=./build/standard
# composer setup
composer create-project -sdev yawik/standard ${BUILD_DIR} --no-interaction
cd ${BUILD_DIR}

# tests setup
EXIT=0
mkdir -p build/behat
mkdir -p build/autoload
cp -Rvf ${TRAVIS_BUILD_DIR}/features features
cp -Rvf ${TRAVIS_BUILD_DIR}/config/autoload/*.* config/autoload/
cp -f ${TRAVIS_BUILD_DIR}/etc/travis/behat-integration.yml behat.yml
cp -f ${TRAVIS_BUILD_DIR}/etc/travis/env-integration.env .env
php -S localhost:8081 -t public/ > /dev/null 2>&1 &
sleep 5
./vendor/bin/behat || EXIT=1

./vendor/lakion/mink-debug-extension/travis/tools/upload-textfiles \"build/behat/*.log\" || echo "no behat logs"
./vendor/lakion/mink-debug-extension/travis/tools/upload-textfiles \"log/*.log\" || echo "no yawik logs"
./vendor/lakion/mink-debug-extension/travis/tools/upload-textfiles \"log/tracy/*.*\"  || echo "no tracy logs"
IMGUR_CLIENT_ID=bec050c54e1bb52 ${TRAVIS_BUILD_DIR}/bin/imgur-uploader build/behat/*.png  || echo "no behat images"

exit ${EXIT}

#!/usr/bin/env bash

set -e
set -x

sleep 10

BUILD_DIR=./build/standard
# composer setup
composer create-project -sdev yawik/standard ${BUILD_DIR} --no-interaction
cd ${BUILD_DIR}

# @TODO: remove this when composer auto-scripts run automatically
composer run post-install-cmd

# tests setup
EXIT=0
mkdir -p build/behat
mkdir -p build/autoload
cp -Rvf ${TRAVIS_BUILD_DIR}/features features
cp -Rvf ${TRAVIS_BUILD_DIR}/config/autoload/*.* config/autoload/
cp -f ${TRAVIS_BUILD_DIR}/etc/travis/behat-integration.yml behat.yml
cp -f ${TRAVIS_BUILD_DIR}/etc/travis/env-integration.env .env
php -S localhost:8081 -t public/ > /dev/null 2>&1 &
sleep 5
./vendor/bin/behat || EXIT=1

./vendor/lakion/mink-debug-extension/travis/tools/upload-textfiles \"build/behat/*.log\" || echo "no behat logs"
./vendor/lakion/mink-debug-extension/travis/tools/upload-textfiles \"log/*.log\" || echo "no yawik logs"
./vendor/lakion/mink-debug-extension/travis/tools/upload-textfiles \"log/tracy/*.*\"  || echo "no tracy logs"
IMGUR_CLIENT_ID=bec050c54e1bb52 ${TRAVIS_BUILD_DIR}/bin/imgur-uploader build/behat/*.png  || echo "no behat images"

exit ${EXIT}


Initialization logic

Initialization logic

#!/bin/sh

unixbenchrepo=https://github.com/kdlucas/byte-unixbench.git
localdir=unixbench

if [ ! -d "$localdir" ]
    then
        echo -e "Cloning unixbench..."
        git clone --depth 1 "$unixbenchrepo" "$localdir"
    else
        echo -e "Unixbench has already been cloned. Continuing..."
fi

cd "$localdir"/UnixBench

echo -e "Compiling with -fstack-check"
sed -i '/^CFLAGS = -Wall -pedantic/ s/$/ -fstack-check' Makefile

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


Removed some lines.

Removed some lines.

#!/bin/sh
# --
# auto_build.sh - build automatically OTRS tar, rpm and src-rpm
# Copyright (C) 2001-2013 OTRS AG, http://otrs.org/
# --
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU AFFERO General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
# or see http://www.gnu.org/licenses/agpl.txt.
# --

echo "auto_build.sh - build automatically OTRS tar, rpm and src-rpm"
echo "Copyright (C) 2001-2013 OTRS AG, http://otrs.org/\n";

PATH_TO_CVS_SRC=$1
PRODUCT=OTRS
VERSION=$2
RELEASE=$3
ARCHIVE_DIR="otrs-$VERSION"
PACKAGE=otrs
PACKAGE_BUILD_DIR="/tmp/$PACKAGE-build"
PACKAGE_DEST_DIR="/tmp/$PACKAGE-packages"
PACKAGE_TMP_SPEC="/tmp/$PACKAGE.spec"
RPM_BUILD="rpmbuild"
#RPM_BUILD="rpm"

if ! test $PATH_TO_CVS_SRC || ! test $VERSION || ! test $RELEASE; then
    # --
    # build src needed
    # --
    echo ""
    echo "Usage: auto_build.sh <PATH_TO_CVS_SRC> <VERSION> <BUILD>"
    echo ""
    echo "  Try: auto_build.sh /home/ernie/src/otrs 3.1.0.beta1 01"
    echo ""
    exit 1;
else
    # --
    # check dir
    # --
    if ! test -e $PATH_TO_CVS_SRC/RELEASE; then
        echo "Error: $PATH_TO_CVS_SRC is not OTRS CVS directory!"
        exit 1;
    fi
fi

# --
# get system info
# --
if test -d /usr/src/redhat/RPMS/; then
    SYSTEM_RPM_DIR=/usr/src/redhat/RPMS/
else
    SYSTEM_RPM_DIR=/usr/src/packages/RPMS/
fi

if test -d /usr/src/redhat/SRPMS/; then
    SYSTEM_SRPM_DIR=/usr/src/redhat/SRPMS/
else
    SYSTEM_SRPM_DIR=/usr/src/packages/SRPMS/
fi

if test -d /usr/src/redhat/SOURCES/; then
    SYSTEM_SOURCE_DIR=/usr/src/redhat/SOURCES/
else
    SYSTEM_SOURCE_DIR=/usr/src/packages/SOURCES/
fi

# --
# cleanup system dirs
# --
rm -rf $SYSTEM_RPM_DIR/*/$PACKAGE*$VERSION*$RELEASE*.rpm
rm -rf $SYSTEM_SRPM_DIR/$PACKAGE*$VERSION*$RELEASE*.src.rpm

# --
# RPM and SRPM dir
# --
rm -rf $PACKAGE_DEST_DIR
mkdir $PACKAGE_DEST_DIR
mkdir -p $PACKAGE_DEST_DIR/RPMS/fedora/4
mkdir -p $PACKAGE_DEST_DIR/RPMS/rhel/5
mkdir -p $PACKAGE_DEST_DIR/RPMS/rhel/6
mkdir -p $PACKAGE_DEST_DIR/RPMS/suse/10.0
mkdir -p $PACKAGE_DEST_DIR/RPMS/suse/11.0

mkdir -p $PACKAGE_DEST_DIR/SRPMS/fedora/4
mkdir -p $PACKAGE_DEST_DIR/SRPMS/rhel/5
mkdir -p $PACKAGE_DEST_DIR/SRPMS/rhel/6
mkdir -p $PACKAGE_DEST_DIR/SRPMS/suse/10.0
mkdir -p $PACKAGE_DEST_DIR/SRPMS/suse/11.0

# --
# build
# --
rm -rf $PACKAGE_BUILD_DIR || exit 1;
mkdir -p $PACKAGE_BUILD_DIR/$ARCHIVE_DIR/ || exit 1;

cp -a $PATH_TO_CVS_SRC/.*rc.dist $PACKAGE_BUILD_DIR/$ARCHIVE_DIR/ || exit 1;
cp -a $PATH_TO_CVS_SRC/.mailfilter.dist $PACKAGE_BUILD_DIR/$ARCHIVE_DIR/ || exit 1;
cp -a $PATH_TO_CVS_SRC/* $PACKAGE_BUILD_DIR/$ARCHIVE_DIR/ || exit 1;

# --
# update RELEASE
# --
RELEASEFILE=$PACKAGE_BUILD_DIR/$ARCHIVE_DIR/RELEASE
echo "PRODUCT = $PRODUCT" > $RELEASEFILE
echo "VERSION = $VERSION" >> $RELEASEFILE
echo "BUILDDATE = `date`" >> $RELEASEFILE
echo "BUILDHOST = `hostname -f`" >> $RELEASEFILE

# --
# cleanup
# --
cd $PACKAGE_BUILD_DIR/$ARCHIVE_DIR/ || exit 1;

# remove old sessions, articles and spool and other stuff
# (remainders of a running system, should not really happen)
rm -rf .gitignore var/sessions/* var/article/* var/spool/* Kernel/Config.pm
# remove development content
rm -rf development
# remove swap/temp stuff
find -name ".#*" | xargs rm -rf
find -name ".keep" | xargs rm -f

# mk ARCHIVE
bin/otrs.CheckSum.pl -a create

# --
# create tar
# --
cd $PACKAGE_BUILD_DIR/ || exit 1;
SOURCE_LOCATION=$SYSTEM_SOURCE_DIR/$PACKAGE-$VERSION.tar.gz
rm $SOURCE_LOCATION
echo "Building tar.gz..."
tar -czf $SOURCE_LOCATION $ARCHIVE_DIR/ || exit 1;
cp $SOURCE_LOCATION $PACKAGE_DEST_DIR/

# --
# create bzip2
# --
cd $PACKAGE_BUILD_DIR/ || exit 1;
SOURCE_LOCATION=$SYSTEM_SOURCE_DIR/$PACKAGE-$VERSION.tar.bz2
rm $SOURCE_LOCATION
echo "Building tar.bz2..."
tar -cjf $SOURCE_LOCATION $ARCHIVE_DIR/ || exit 1;
cp $SOURCE_LOCATION $PACKAGE_DEST_DIR/

# --
# create zip
# --
cd $PACKAGE_BUILD_DIR/ || exit 1;
SOURCE_LOCATION=$SYSTEM_SOURCE_DIR/$PACKAGE-$VERSION.zip
rm $SOURCE_LOCATION
echo "Building zip..."
zip -r $SOURCE_LOCATION $ARCHIVE_DIR/ || exit 1;
cp $SOURCE_LOCATION $PACKAGE_DEST_DIR/

# --
# create rpm spec files
# --
DESCRIPTION=$PATH_TO_CVS_SRC/scripts/auto_build/description.txt
FILES=$PATH_TO_CVS_SRC/scripts/auto_build/files.txt

# --
# build SuSE 11.0 rpm
# --
echo "Building SuSE 11.0 rpm..."
specfile=$PACKAGE_TMP_SPEC
# replace version and release
cat $ARCHIVE_DIR/scripts/suse-otrs-11.0.spec | sed "s/^Version:.*/Version:      $VERSION/" | sed "s/^Release:.*/Release:      $RELEASE/" > $specfile.tmp
# replace sourced files
perl -e "open(SPEC, '< $specfile.tmp');while(<SPEC>){\$spec.=\$_;};open(IN, '< $FILES');while(<IN>){\$i.=\$_;}\$spec=~s/<FILES>/\$i/g;print \$spec;" > $specfile.tmp1
# replace package description
perl -e "open(SPEC, '< $specfile.tmp1');while(<SPEC>){\$spec.=\$_;};open(IN, '< $DESCRIPTION');while(<IN>){\$i.=\$_;}\$spec=~s/<DESCRIPTION>/\$i/g;print \$spec;" > $specfile
$RPM_BUILD -ba --clean $specfile || exit 1;
rm $specfile || exit 1;

mv $SYSTEM_RPM_DIR/*/$PACKAGE*$VERSION*$RELEASE*.rpm $PACKAGE_DEST_DIR/RPMS/suse/11.0/
mv $SYSTEM_SRPM_DIR/$PACKAGE*$VERSION*$RELEASE*.src.rpm $PACKAGE_DEST_DIR/SRPMS/suse/11.0/

# --
# build SuSE 10.0 rpm
# --
echo "Building SuSE 10.0 rpm..."
specfile=$PACKAGE_TMP_SPEC
# replace version and release
cat $ARCHIVE_DIR/scripts/suse-otrs-10.0.spec | sed "s/^Version:.*/Version:      $VERSION/" | sed "s/^Release:.*/Release:      $RELEASE/" > $specfile.tmp
# replace sourced files
perl -e "open(SPEC, '< $specfile.tmp');while(<SPEC>){\$spec.=\$_;};open(IN, '< $FILES');while(<IN>){\$i.=\$_;}\$spec=~s/<FILES>/\$i/g;print \$spec;" > $specfile.tmp1
# replace package description
perl -e "open(SPEC, '< $specfile.tmp1');while(<SPEC>){\$spec.=\$_;};open(IN, '< $DESCRIPTION');while(<IN>){\$i.=\$_;}\$spec=~s/<DESCRIPTION>/\$i/g;print \$spec;" > $specfile
$RPM_BUILD -ba --clean $specfile || exit 1;
rm $specfile || exit 1;

mv $SYSTEM_RPM_DIR/*/$PACKAGE*$VERSION*$RELEASE*.rpm $PACKAGE_DEST_DIR/RPMS/suse/10.0/
mv $SYSTEM_SRPM_DIR/$PACKAGE*$VERSION*$RELEASE*.src.rpm $PACKAGE_DEST_DIR/SRPMS/suse/10.0/

# --
# build Fedora rpm
# --
echo "Building Fedora rpm..."
cp $ARCHIVE_DIR/scripts/redhat-rpmmacros ~/.rpmmacros || exit 1
specfile=$PACKAGE_TMP_SPEC
cat $ARCHIVE_DIR/scripts/fedora-otrs-4.spec | sed "s/^Version:.*/Version:      $VERSION/" | sed "s/^Release:.*/Release:      $RELEASE/" > $specfile.tmp
# replace sourced files
perl -e "open(SPEC, '< $specfile.tmp');while(<SPEC>){\$spec.=\$_;};open(IN, '< $FILES');while(<IN>){\$i.=\$_;}\$spec=~s/<FILES>/\$i/g;print \$spec;" > $specfile.tmp1
# replace package description
perl -e "open(SPEC, '< $specfile.tmp1');while(<SPEC>){\$spec.=\$_;};open(IN, '< $DESCRIPTION');while(<IN>){\$i.=\$_;}\$spec=~s/<DESCRIPTION>/\$i/g;print \$spec;" > $specfile
$RPM_BUILD -ba --clean $specfile || exit 1;
rm $specfile || exit 1;
rm ~/.rpmmacros || exit 1;

mv $SYSTEM_RPM_DIR/*/$PACKAGE*$VERSION*$RELEASE*.rpm $PACKAGE_DEST_DIR/RPMS/fedora/4/
mv $SYSTEM_SRPM_DIR/$PACKAGE*$VERSION*$RELEASE*.src.rpm $PACKAGE_DEST_DIR/SRPMS/fedora/4/

# --
# build RHEL6 rpm
# --
echo "Building RHEL6 rpm..."
cp $ARCHIVE_DIR/scripts/redhat-rpmmacros ~/.rpmmacros || exit 1
specfile=$PACKAGE_TMP_SPEC
cat $ARCHIVE_DIR/scripts/rhel6-otrs.spec | sed "s/^Version:.*/Version:      $VERSION/" | sed "s/^Release:.*/Release:      $RELEASE/" > $specfile.tmp
# replace sourced files
perl -e "open(SPEC, '< $specfile.tmp');while(<SPEC>){\$spec.=\$_;};open(IN, '< $FILES');while(<IN>){\$i.=\$_;}\$spec=~s/<FILES>/\$i/g;print \$spec;" > $specfile.tmp1
# replace package description
perl -e "open(SPEC, '< $specfile.tmp1');while(<SPEC>){\$spec.=\$_;};open(IN, '< $DESCRIPTION');while(<IN>){\$i.=\$_;}\$spec=~s/<DESCRIPTION>/\$i/g;print \$spec;" > $specfile
$RPM_BUILD -ba --clean $specfile || exit 1;
rm $specfile || exit 1;
rm ~/.rpmmacros || exit 1;

mv $SYSTEM_RPM_DIR/*/$PACKAGE*$VERSION*$RELEASE*.rpm $PACKAGE_DEST_DIR/RPMS/rhel/6/
mv $SYSTEM_SRPM_DIR/$PACKAGE*$VERSION*$RELEASE*.src.rpm $PACKAGE_DEST_DIR/SRPMS/rhel/6/

echo "-----------------------------------------------------------------";
echo "You will find your tar.gz, RPMs and SRPMs in $PACKAGE_DEST_DIR";
cd $PACKAGE_DEST_DIR
find . -name "*$PACKAGE*" | xargs ls -lo
echo "-----------------------------------------------------------------";
if which md5sum >> /dev/null; then
    echo "MD5 message digest (128-bit) checksums in wiki table format";
    find . -name "*$PACKAGE*" | xargs md5sum | sed -e "s/^/| /" -e "s/\.\//| http:\/\/ftp.otrs.org\/pub\/otrs\//" -e "s/$/ |/"
else
    echo "No md5sum found in \$PATH!"
fi
echo "--------------------------------------------------------------------------";
echo "Note: You may have to tag your git tree: git tag rel-3_x_x -a -m \"3.x.x\"";
echo "--------------------------------------------------------------------------";

# --
# cleanup
# --
rm -rf $PACKAGE_BUILD_DIR
rm -rf $PACKAGE_TMP_SPEC

#!/bin/sh
# --
# auto_build.sh - build automatically OTRS tar, rpm and src-rpm
# Copyright (C) 2001-2013 OTRS AG, http://otrs.org/
# --
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU AFFERO General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
# or see http://www.gnu.org/licenses/agpl.txt.
# --

echo "auto_build.sh - build automatically OTRS tar, rpm and src-rpm"
echo "Copyright (C) 2001-2013 OTRS AG, http://otrs.org/\n";

PATH_TO_CVS_SRC=$1
PRODUCT=OTRS
VERSION=$2
RELEASE=$3
ARCHIVE_DIR="otrs-$VERSION"
PACKAGE=otrs
PACKAGE_BUILD_DIR="/tmp/$PACKAGE-build"
PACKAGE_DEST_DIR="/tmp/$PACKAGE-packages"
PACKAGE_TMP_SPEC="/tmp/$PACKAGE.spec"
RPM_BUILD="rpmbuild"
#RPM_BUILD="rpm"

if ! test $PATH_TO_CVS_SRC || ! test $VERSION || ! test $RELEASE; then
    # --
    # build src needed
    # --
    echo ""
    echo "Usage: auto_build.sh <PATH_TO_CVS_SRC> <VERSION> <BUILD>"
    echo ""
    echo "  Try: auto_build.sh /home/ernie/src/otrs 3.1.0.beta1 01"
    echo ""
    exit 1;
else
    # --
    # check dir
    # --
    if ! test -e $PATH_TO_CVS_SRC/RELEASE; then
        echo "Error: $PATH_TO_CVS_SRC is not OTRS CVS directory!"
        exit 1;
    fi
fi

# --
# get system info
# --
if test -d /usr/src/redhat/RPMS/; then
    SYSTEM_RPM_DIR=/usr/src/redhat/RPMS/
else
    SYSTEM_RPM_DIR=/usr/src/packages/RPMS/
fi

if test -d /usr/src/redhat/SRPMS/; then
    SYSTEM_SRPM_DIR=/usr/src/redhat/SRPMS/
else
    SYSTEM_SRPM_DIR=/usr/src/packages/SRPMS/
fi

if test -d /usr/src/redhat/SOURCES/; then
    SYSTEM_SOURCE_DIR=/usr/src/redhat/SOURCES/
else
    SYSTEM_SOURCE_DIR=/usr/src/packages/SOURCES/
fi

# --
# cleanup system dirs
# --
rm -rf $SYSTEM_RPM_DIR/*/$PACKAGE*$VERSION*$RELEASE*.rpm
rm -rf $SYSTEM_SRPM_DIR/$PACKAGE*$VERSION*$RELEASE*.src.rpm

# --
# RPM and SRPM dir
# --
rm -rf $PACKAGE_DEST_DIR
mkdir $PACKAGE_DEST_DIR
mkdir -p $PACKAGE_DEST_DIR/RPMS/fedora/4
mkdir -p $PACKAGE_DEST_DIR/RPMS/rhel/5
mkdir -p $PACKAGE_DEST_DIR/RPMS/rhel/6
mkdir -p $PACKAGE_DEST_DIR/RPMS/suse/10.0
mkdir -p $PACKAGE_DEST_DIR/RPMS/suse/11.0

mkdir -p $PACKAGE_DEST_DIR/SRPMS/fedora/4
mkdir -p $PACKAGE_DEST_DIR/SRPMS/rhel/5
mkdir -p $PACKAGE_DEST_DIR/SRPMS/rhel/6
mkdir -p $PACKAGE_DEST_DIR/SRPMS/suse/10.0
mkdir -p $PACKAGE_DEST_DIR/SRPMS/suse/11.0

# --
# build
# --
rm -rf $PACKAGE_BUILD_DIR || exit 1;
mkdir -p $PACKAGE_BUILD_DIR/$ARCHIVE_DIR/ || exit 1;

cp -a $PATH_TO_CVS_SRC/.*rc.dist $PACKAGE_BUILD_DIR/$ARCHIVE_DIR/ || exit 1;
cp -a $PATH_TO_CVS_SRC/.mailfilter.dist $PACKAGE_BUILD_DIR/$ARCHIVE_DIR/ || exit 1;
cp -a $PATH_TO_CVS_SRC/* $PACKAGE_BUILD_DIR/$ARCHIVE_DIR/ || exit 1;

# --
# update RELEASE
# --
RELEASEFILE=$PACKAGE_BUILD_DIR/$ARCHIVE_DIR/RELEASE
echo "PRODUCT = $PRODUCT" > $RELEASEFILE
echo "VERSION = $VERSION" >> $RELEASEFILE
echo "BUILDDATE = `date`" >> $RELEASEFILE
echo "BUILDHOST = `hostname -f`" >> $RELEASEFILE

# --
# cleanup
# --
cd $PACKAGE_BUILD_DIR/$ARCHIVE_DIR/ || exit 1;

# remove old sessions, articles and spool and other stuff
# (remainders of a running system, should not really happen)
rm -rf .gitignore var/sessions/* var/article/* var/spool/* Kernel/Config.pm
# remove development content
rm -rf development
# remove swap/temp stuff
find -name ".#*" | xargs rm -rf
find -name ".keep" | xargs rm -f

# mk ARCHIVE
bin/otrs.CheckSum.pl -a create

# --
# create tar
# --
cd $PACKAGE_BUILD_DIR/ || exit 1;
SOURCE_LOCATION=$SYSTEM_SOURCE_DIR/$PACKAGE-$VERSION.tar.gz
rm $SOURCE_LOCATION
echo "Building tar.gz..."
tar -czf $SOURCE_LOCATION $ARCHIVE_DIR/ || exit 1;
cp $SOURCE_LOCATION $PACKAGE_DEST_DIR/

# --
# create bzip2
# --
cd $PACKAGE_BUILD_DIR/ || exit 1;
SOURCE_LOCATION=$SYSTEM_SOURCE_DIR/$PACKAGE-$VERSION.tar.bz2
rm $SOURCE_LOCATION
echo "Building tar.bz2..."
tar -cjf $SOURCE_LOCATION $ARCHIVE_DIR/ || exit 1;
cp $SOURCE_LOCATION $PACKAGE_DEST_DIR/

# --
# create zip
# --
cd $PACKAGE_BUILD_DIR/ || exit 1;
SOURCE_LOCATION=$SYSTEM_SOURCE_DIR/$PACKAGE-$VERSION.zip
rm $SOURCE_LOCATION
echo "Building zip..."
zip -r $SOURCE_LOCATION $ARCHIVE_DIR/ || exit 1;
cp $SOURCE_LOCATION $PACKAGE_DEST_DIR/

# --
# create rpm spec files
# --
DESCRIPTION=$PATH_TO_CVS_SRC/scripts/auto_build/description.txt
FILES=$PATH_TO_CVS_SRC/scripts/auto_build/files.txt

# --
# build SuSE 11.0 rpm
# --
echo "Building SuSE 11.0 rpm..."
specfile=$PACKAGE_TMP_SPEC
# replace version and release
cat $ARCHIVE_DIR/scripts/suse-otrs-11.0.spec | sed "s/^Version:.*/Version:      $VERSION/" | sed "s/^Release:.*/Release:      $RELEASE/" > $specfile.tmp
# replace sourced files
perl -e "open(SPEC, '< $specfile.tmp');while(<SPEC>){\$spec.=\$_;};open(IN, '< $FILES');while(<IN>){\$i.=\$_;}\$spec=~s/<FILES>/\$i/g;print \$spec;" > $specfile.tmp1
# replace package description
perl -e "open(SPEC, '< $specfile.tmp1');while(<SPEC>){\$spec.=\$_;};open(IN, '< $DESCRIPTION');while(<IN>){\$i.=\$_;}\$spec=~s/<DESCRIPTION>/\$i/g;print \$spec;" > $specfile
$RPM_BUILD -ba --clean $specfile || exit 1;
rm $specfile || exit 1;

mv $SYSTEM_RPM_DIR/*/$PACKAGE*$VERSION*$RELEASE*.rpm $PACKAGE_DEST_DIR/RPMS/suse/11.0/
mv $SYSTEM_SRPM_DIR/$PACKAGE*$VERSION*$RELEASE*.src.rpm $PACKAGE_DEST_DIR/SRPMS/suse/11.0/

# --
# build SuSE 10.0 rpm
# --
echo "Building SuSE 10.0 rpm..."
specfile=$PACKAGE_TMP_SPEC
# replace version and release
cat $ARCHIVE_DIR/scripts/suse-otrs-10.0.spec | sed "s/^Version:.*/Version:      $VERSION/" | sed "s/^Release:.*/Release:      $RELEASE/" > $specfile.tmp
# replace sourced files
perl -e "open(SPEC, '< $specfile.tmp');while(<SPEC>){\$spec.=\$_;};open(IN, '< $FILES');while(<IN>){\$i.=\$_;}\$spec=~s/<FILES>/\$i/g;print \$spec;" > $specfile.tmp1
# replace package description
perl -e "open(SPEC, '< $specfile.tmp1');while(<SPEC>){\$spec.=\$_;};open(IN, '< $DESCRIPTION');while(<IN>){\$i.=\$_;}\$spec=~s/<DESCRIPTION>/\$i/g;print \$spec;" > $specfile
$RPM_BUILD -ba --clean $specfile || exit 1;
rm $specfile || exit 1;

mv $SYSTEM_RPM_DIR/*/$PACKAGE*$VERSION*$RELEASE*.rpm $PACKAGE_DEST_DIR/RPMS/suse/10.0/
mv $SYSTEM_SRPM_DIR/$PACKAGE*$VERSION*$RELEASE*.src.rpm $PACKAGE_DEST_DIR/SRPMS/suse/10.0/

# --
# build Fedora rpm
# --
echo "Building Fedora rpm..."
cp $ARCHIVE_DIR/scripts/redhat-rpmmacros ~/.rpmmacros || exit 1
specfile=$PACKAGE_TMP_SPEC
cat $ARCHIVE_DIR/scripts/fedora-otrs-4.spec | sed "s/^Version:.*/Version:      $VERSION/" | sed "s/^Release:.*/Release:      $RELEASE/" > $specfile.tmp
# replace sourced files
perl -e "open(SPEC, '< $specfile.tmp');while(<SPEC>){\$spec.=\$_;};open(IN, '< $FILES');while(<IN>){\$i.=\$_;}\$spec=~s/<FILES>/\$i/g;print \$spec;" > $specfile.tmp1
# replace package description
perl -e "open(SPEC, '< $specfile.tmp1');while(<SPEC>){\$spec.=\$_;};open(IN, '< $DESCRIPTION');while(<IN>){\$i.=\$_;}\$spec=~s/<DESCRIPTION>/\$i/g;print \$spec;" > $specfile
$RPM_BUILD -ba --clean $specfile || exit 1;
rm $specfile || exit 1;
rm ~/.rpmmacros || exit 1;

mv $SYSTEM_RPM_DIR/*/$PACKAGE*$VERSION*$RELEASE*.rpm $PACKAGE_DEST_DIR/RPMS/fedora/4/
mv $SYSTEM_SRPM_DIR/$PACKAGE*$VERSION*$RELEASE*.src.rpm $PACKAGE_DEST_DIR/SRPMS/fedora/4/

# --
# build RHEL6 rpm
# --
echo "Building RHEL6 rpm..."
cp $ARCHIVE_DIR/scripts/redhat-rpmmacros ~/.rpmmacros || exit 1
specfile=$PACKAGE_TMP_SPEC
cat $ARCHIVE_DIR/scripts/rhel6-otrs.spec | sed "s/^Version:.*/Version:      $VERSION/" | sed "s/^Release:.*/Release:      $RELEASE/" > $specfile.tmp
# replace sourced files
perl -e "open(SPEC, '< $specfile.tmp');while(<SPEC>){\$spec.=\$_;};open(IN, '< $FILES');while(<IN>){\$i.=\$_;}\$spec=~s/<FILES>/\$i/g;print \$spec;" > $specfile.tmp1
# replace package description
perl -e "open(SPEC, '< $specfile.tmp1');while(<SPEC>){\$spec.=\$_;};open(IN, '< $DESCRIPTION');while(<IN>){\$i.=\$_;}\$spec=~s/<DESCRIPTION>/\$i/g;print \$spec;" > $specfile
$RPM_BUILD -ba --clean $specfile || exit 1;
rm $specfile || exit 1;
rm ~/.rpmmacros || exit 1;

mv $SYSTEM_RPM_DIR/*/$PACKAGE*$VERSION*$RELEASE*.rpm $PACKAGE_DEST_DIR/RPMS/rhel/6/
mv $SYSTEM_SRPM_DIR/$PACKAGE*$VERSION*$RELEASE*.src.rpm $PACKAGE_DEST_DIR/SRPMS/rhel/6/

# --
# stats
# --
echo "-----------------------------------------------------------------";
echo -n "Source code lines (*.sh) : "
find $PACKAGE_BUILD_DIR/$ARCHIVE_DIR/ -name *.sh | xargs cat | wc -l
echo -n "Source code lines (*.pl) : "
find $PACKAGE_BUILD_DIR/$ARCHIVE_DIR/ -name *.pl | xargs cat | wc -l
echo -n "Source code lines (*.pm) : "
find $PACKAGE_BUILD_DIR/$ARCHIVE_DIR/ -name *.pm | xargs cat | wc -l
echo -n "Source code lines (*.t) : "
find $PACKAGE_BUILD_DIR/$ARCHIVE_DIR/ -name *.t | xargs cat | wc -l
echo -n "Source code lines (*.dtl): "
find $PACKAGE_BUILD_DIR/$ARCHIVE_DIR/ -name *.dtl | xargs cat | wc -l
echo -n "Source code lines (*.xml): "
find $PACKAGE_BUILD_DIR/$ARCHIVE_DIR/ -name *.xml | xargs cat | wc -l
echo -n "Source code lines (*.js): "
find $PACKAGE_BUILD_DIR/$ARCHIVE_DIR/ -name *.js | xargs cat | wc -l
echo -n "Source code lines (*.css): "
find $PACKAGE_BUILD_DIR/$ARCHIVE_DIR/ -name *.css | xargs cat | wc -l
echo "-----------------------------------------------------------------";
echo "You will find your tar.gz, RPMs and SRPMs in $PACKAGE_DEST_DIR";
cd $PACKAGE_DEST_DIR
find . -name "*$PACKAGE*" | xargs ls -lo
echo "-----------------------------------------------------------------";
if which md5sum >> /dev/null; then
    echo "MD5 message digest (128-bit) checksums in wiki table format";
    find . -name "*$PACKAGE*" | xargs md5sum | sed -e "s/^/| /" -e "s/\.\//| http:\/\/ftp.otrs.org\/pub\/otrs\//" -e "s/$/ |/"
else
    echo "No md5sum found in \$PATH!"
fi
echo "--------------------------------------------------------------------------";
echo "Note: You may have to tag your git tree: git tag rel-3_x_x -a -m \"3.x.x\"";
echo "--------------------------------------------------------------------------";

# --
# cleanup
# --
rm -rf $PACKAGE_BUILD_DIR
rm -rf $PACKAGE_TMP_SPEC


Added not longer used directory.

Added not longer used directory.

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


Improve fix script.

Improve fix script.

Take non-option argument specifying top directory.

Call fix-icc-includes.pl.

Quote filenames properly.

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/gartung/fnal-art.git/'


Updated comments in script.sh

Updated comments in script.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/andreiaoli/Bash-scripts-bind-apache-configuration.git/'


Add a git pre-commit dropin for ensuring licences are added.

#!/usr/bin/env bash

scripts/add_licences.sh

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


updated go to the latest stable versions

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/dbcc/go-destinygg-chatlogger.git/'


Remove lots of unnecessary stuff

Remove lots of unnecessary stuff

#!/bin/sh
# Last updated to Ubuntu 10.10

apt-get purge cheese evolution gnome-games-common transmission-gtk

# Aptitude cleanup
apt-get autoremove

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


add script to update doxygen on server CRON

#!/bin/sh

# Thanks: http://stackoverflow.com/questions/14710257/running-a-cron-job-at-230-am-every-day
# On how to automate process at 2:30 every day (type "date" to get your server time)
# crontab -e
# 30 2 * * * /your/command

echo "Update RD repo..."
cd $RD_ROOT
git pull

echo "Doxy teo-main..."
cd doc
rm -r html
/usr/local/bin/doxygen
cd ../..

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


add micca and mothur

add micca and mothur

# usage run_mothur.sh

reads=$1              # from split_libraries_fastq.py (demultiplexed and barcode-primer removed FASTQ file)
output_dir=$2
jobs_to_start=$3              # for parallel_assign_taxonomy_rdp.py
reference_fasta=$4            # for parallel_assign_taxonomy_rdp.py
reference_fasta_aligned=$5    # for mothur alignment
reference_taxonomy=$6         # for parallel_assign_taxonomy_rdp.py
study=$7
trainset_tax=$8               # for mothur classify.seqs
trainset_fasta=$9             # for mothur classify.seqs
declare -A mothur_trimlen=( ["1688"]="150" ["1686"]="150" ["1685"]="200" ["449"]="200" ["even"]="150" ["staggered"]="150" ["nematodes"]="200" ["632"]="100" ["2107"]="150")

mkdir $output_dir

reads_file=$(basename $reads)
reads_name="${reads_file%.*}"
#
# The first function of mothur's MiSeq SOP is make.contigs() which requires
# a 3-column file with the first column representing sample IDs, second
# being the forward reads and third the reverse reads. Here we make use of
# seqtk, QIIME's split_sequence_file_on_sample_ids.py and bash commands to
# create the reverse reads (reverse-complement of the forward reads) and the
# input file for make.contigs().
#
mothur_output=$output_dir/mothur_output
mkdir $othur_output
touch $mothur_output/"mothur.file"
# Reverse-complement FASTQ reads
seqtk seq -r $reads > $output_dir/${reads_name}_rc.fastq
# Split FASTA files on sample IDs
# Forward (rename output files to include 'R1')
split_sequence_file_on_sample_ids.py -i $reads -o $output_dir/split --file_type fastq
for f in $output_dir/split/*.fastq
do
	mv $f ${f%.fastq}_R1.fastq
	# Create entry for sample in mothur mapping file for make.contigs()
	file=$(basename $f .fastq)
	printf "$file ${file}_R1.fastq\n" >> $mothur_output/"mothur.file"
done
# Reverse (rename output files to include 'R2')
split_sequence_file_on_sample_ids.py -i $output_dir/${reads_name}_rc.fastq -o $output_dir/split_rc --file_type fastq
for f in $output_dir/split_rc/*.fastq
do
	mv $f ${f%.fastq}_R2.fastq
done

# Move preprocessed sequences to output directory
mv $output_dir/split/*.fastq $mothur_output
mv $output_dir/split_rc/*.fastq $mothur_output

# Overlap forward and reverse reads (generate mothur.trim.contigs.fasta
# and mothur.contigs.groups)
mothur "#make.contigs(file=${mothur_output}/mothur.file, processors=$threads)"

# Filter ambiguous sequences and sequences longer than
# ${mothur_trimlen["$study"]} (generate mothur.trim.contigs.good.fasta)
mothur "#screen.seqs(fasta=${mothur_output}/mothur.trim.contigs.fasta, group=${mothur_output}/mothur.contigs.groups, maxambig=0, maxlength=${mothur_trimlen["$study"]})"

# Dereplication (generate mothur.trim.contigs.good.unique.fasta,
# mothur.trim.contigs.good.names)
mothur "#unique.seqs(fasta=${mothur_output}/mothur.trim.contigs.good.fasta)"

# Calculate the frequencies of each sequence in each sample
mothur "#count.seqs(name=${mothur_output}/mothur.trim.contigs.good.names, group=${mothur_output}/mothur.contigs.groups)"

# Align sequences (generate mothur.trim.contigs.good.unique.align and
# mothur.trim.contigs.good.unique.align.report)
mothur "#align.seqs(fasta=${mothur_output}/mothur.trim.contigs.good.unique.fasta, reference=${reference_aligned})"

# Run summary.seqs and use output file mothur.trim.contigs.good.unique.summary to
# determine the start and end positions of alignments
mothur "#summary.seqs(fasta=${mothur_output}/mothur.trim.contigs.good.unique.align, count=${mothur_output}/mothur.trim.contigs.good.count_table)" > ${mothur_output}/summary.txt

start_pos=$(awk '{if ($1=="Median:") printf $2}' ${mothur_output}/summary.txt)
end_pos=$(awk '{if ($1=="Median:") printf $3}' ${mothur_output}/summary.txt)

# Filter sequences that fail to overlap from start_pos to end_pos
# (generate mothur.trim.contigs.good.unique.good.align)
mothur "#screen.seqs(${mothur_output}/mothur.trim.contigs.good.unique.align, count=${mothur_output}/mothur.trim.contigs.good.count_table, summary=${mothur_output}/mothur.trim.contigs.good.unique.summary, start=${start_pos}, end=${end_pos}, maxhomop=8)"
mothur "#filter.seqs(fasta=${mothur_output}/stability.trim.contigs.good.unique.good.align, vertical=T, trump=.)"

# Dereplicate aligned sequences
mothur "#unique.seqs(fasta=${mothur_output}/mothur.trim.contigs.good.unique.good.filter.fasta, count=${mothur_output}/mothur.trim.contigs.good.good.count_table)"

# Pre-cluster the aligned sequences (generate mothur.trim.contigs.good.unique.good.filter.unique.precluster.fasta
# and mothur.trim.contigs.good.unique.good.filter.unique.precluster.count_table)
mothur "#pre.cluster(fasta=${mothur_output}/mothur.trim.contigs.good.unique.good.filter.unique.fasta, count=${mothur_output}/mothur.trim.contigs.good.unique.good.filter.count_table, diffs=2)"

# Identify chimeric sequences and remove them (generate mothur.trim.contigs.good.unique.good.filter.unique.precluster.pick.fasta)
mothur "#chimera.uchime(fasta=${mothur_output}/mothur.trim.contigs.good.unique.good.filter.unique.precluster.fasta, count=${mothur_output}/mothur.trim.contigs.good.unique.good.filter.unique.precluster.count_table, dereplicate=t); remove.seqs(fasta=current, accnos=current)"

# Assign taxonomy to clean sequences, final quality control step to remove sequences
# hitting taxons other than the expected (generates mothur.trim.contigs.good.unique.good.filter.unique.precluster.pick.pds.wang.taxonomy
# and mothur.trim.contigs.good.unique.good.filter.unique.precluster.pick.pds.wang.tax.summary)
mothur "#classify.seqs(fasta=${mothur_output}/mothur.trim.contigs.good.unique.good.filter.unique.precluster.pick.fasta, count=${mothur_output}/mothur.trim.contigs.good.unique.good.filter.unique.precluster.uchime.pick.count_table, reference=${trainset_fasta}, taxonomy=${trainset_tax}, cutoff=80)"

# Remove unexpected lineages (generate mothur.trim.contigs.good.unique.good.filter.unique.precluster.pick.pds.wang.pick.taxonomy,
# mothur.trim.contigs.good.unique.good.filter.unique.precluster.pick.pick.fasta and
# mothur.trim.contigs.good.unique.good.filter.unique.precluster.uchime.pick.pick.count_table)
mothur "#remove.lineage(fasta=${mothur_output}/mothur.trim.contigs.good.unique.good.filter.unique.precluster.pick.fasta, count=${mothur_output}/mothur.trim.contigs.good.unique.good.filter.unique.precluster.uchime.pick.count_table, taxonomy=${mothur_output}/mothur.trim.contigs.good.unique.good.filter.unique.precluster.pick.pds.wang.taxonomy, taxon=Chloroplast-Mitochondria-unknown-Archaea-Eukaryota)"

# Cluster (generate mothur.trim.contigs.good.unique.good.filter.unique.precluster.pick.pick.an.unique_list.list)
# METHOD: AVERAGE LINKAGE
mothur "#cluster.split(fasta=${mothur_output}/mothur.trim.contigs.good.unique.good.filter.unique.precluster.pick.pickfasta, count=${mothur_output}/mothur.trim.contigs.good.unique.good.filter.unique.precluster.uchime.pick.pick.count_table, taxonomy=${mothur_output}/mothur.trim.contigs.good.unique.good.filter.unique.precluster.pick.pds.wang.pick.taxonomy, splitmethod=classify, taxlevel=4, cutoff=0.15, method=average)"

# Compute number of sequences in each OTU (generate mothur.trim.contigs.good.unique.good.filter.unique.precluster.pick.pick.an.unique_list.shared)
mothur "#make.shared(list=${mothur_output}/mothur.trim.contigs.good.unique.good.filter.unique.precluster.pick.pick.an.unique_list.list, count=${mothur_output}/mothur.trim.contigs.good.unique.good.filter.unique.precluster.uchime.pick.pick.count_table, label=0.03)"

# RUN PYTHON VERSION OF make_otu_list_and_pick_rep_set.pl

# Assign taxonomy
echo "parallel_assign_taxonomy_rdp.py"
parallel_assign_taxonomy_rdp.py -i $output_dir/"${reads_name}_rep.fa" -o $output_dir/rdp_assigned_taxonomy \
-T --jobs_to_start $jobs_to_start --reference_seqs_fp $reference_fasta --id_to_taxonomy_fp $reference_taxonomy

# Create BIOM table
echo "make_otu_table.py"
make_otu_table.py -i $output_dir/"${reads_name}_otus.txt" -o $output_dir/otu_table.biom \
-t $output_dir/rdp_assigned_taxonomy/otus_tax_assignments.txt

# Align sequences command
echo "parallel_align_seqs_pynast.py"
parallel_align_seqs_pynast.py -i $output_dir/"${reads_name}_rep.fa" -o $output_dir/pynast_aligned_seqs \
-T --jobs_to_start $jobs_to_start --template_fp $template_str

# Filter alignment command
echo "filter_alignment.py"
filter_alignment.py -o $output_dir/pynast_aligned_seqs -i $output_dir/pynast_aligned_seqs/otus_aligned.fasta

# Build phylogenetic tree command
echo "make_phylogeny.py"
make_phylogeny.py -i $output_dir/pynast_aligned_seqs/otus_aligned_pfiltered.fasta -o $output_dir/rep_set.tre

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


working on script-lib makefile

working on script-lib makefile

#!/bin/bash
# start up script for 16 channel controller

echo -e \\033c		# clear the terminal screen
stty cooked			# switch to buffered iput
stty echo			# turn on terminal echo

echo "************************
  starting Pcon system
************************"
echo "terminal io reinitialized"
echo "checking for active processes"

# echo $(pidof /usr/local/sbin/Dcon)
	plist=$(pidof /usr/local/sbin/Dcon)
# echo $plist
if [ "$plist" != "" ]; then
		hlist="there is an instance of Dcon active pid"
		hlist=$hlist$plist
		echo $hlist
		echo "kill instance <y><n> ? "
		read answr
		if["$answr" == "y"]; then
			echo "killing it"
			kill $plist
		elif then;
			echo -n "process "
			echo -n $hlist
			echo "left running"
		fi
	elif
		echo "there are no instances of Dcon active"
fi

plist=$(pidof /usr/local/sbin/Pcon)
if [ "$plist" != "" ]; then
		hlist="there is an instance of Pcon active pid "
		hlist=$hlist$plist
		echo $hlist
		echo "killing it"
		kill $plist
elif
	echo "there are no instances of Pcon active"
fi
echo "starting daemon"
Dcon > /home/Pcon-data/Dcon.log &
echo "Dcon started"
sleep 10
Pcon

exit 0

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


03_configs.sh: go back to using atom as default text editor


Preparing for beta2.

Preparing for beta2.

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


automate the whole process using shell

automate the whole process using shell

cd bots
source venvpy35/bin/activate
cd tweet

python get_quotes.py > programming_quote.txt

echo "tweet procured"

cat programming_quote.txt
quote=$(cat programming_quote.txt)

cd ../..

cd bayesian-classifier

deactivate

python bayes.py classify ../bots/tweet/programming_quote.txt programming non_programming > programming_index.txt

echo "classification done"

cat programming_index.txt
index=$(cat programming_index.txt | grep -o '[0-9][0-9]')

echo "index is ${index}"

cd ..

if [ "${index}" -gt 20 ]; then
	cd bots
	source venvpy35/bin/activate
	cd tweet
	python tweet.py "${quote}"

fi

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


More step fun

More step fun

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/Zonama/ZonamaDev.git/'


Initial commit of cron_setup.sh.

Initial commit of cron_setup.sh.

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


Create deploy-now.sh

Create deploy-now.sh

#!/bin/bash

# If the tests succeed on the specified `DEPLOY_BRANCH`, then deploy with https://zeit.co/now
#
#
# Installation:
#
# after_success:
#   - eval "$(curl -s https://raw.githubusercontent.com/bevry/awesome-travis/master/scripts/deploy-now.bash)"
#
#
# Configuration:
#
# The branch name that you want tested and deployed (defaults to `master`)
# travis env set DEPLOY_BRANCH "master" --public
#
# Your now token. You can create one here: https://zeit.co/account/tokens
# travis env set NOW_TOKEN "$NOW_TOKEN"
#
# Your now team, if applicable. You can fetch your teams via the `now teams list` command.
# travis env set NOW_TEAM "$NOW_TEAM"

export DEPLOY_BRANCH
if test -z "$DEPLOY_BRANCH"; then
	DEPLOY_BRANCH="master"
fi

if ([ "$TRAVIS_BRANCH" == "$DEPLOY_BRANCH" ] &&
	[ -z "$TRAVIS_TAG" ] &&
	[ "$TRAVIS_PULL_REQUEST" == "false" ]); then
	echo "deploying..."
  if [ -z "$NOW_TEAM" ]; then
    now --token "$NOW_TOKEN" teams switch "$NOW_TEAM" || exit -1
  fi
  now --token "$NOW_TOKEN" || exit -1
  now --token "$NOW_TOKEN" alias || exit -1
	echo "...deployed"
else
	echo "skipped deploy"
fi

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


Add mac line count script

Add mac line count script

cd ../src/
find . -name '*.java' | xargs wc -l

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


Add tracts load script

Add tracts load script

db=gisdb
schema=public
table=tl_2014_tract

psql -p 5432 $db -c 'DROP TABLE '"$schema"'.'"$table"''

psql -p 5432 $db -c 'CREATE TABLE tl_2014_tract
(
  gid serial NOT NULL,
  statefp character varying(2),
  countyfp character varying(3),
  tractce character varying(6),
  geoid character varying(11),
  name character varying(7),
  namelsad character varying(20),
  mtfcc character varying(5),
  funcstat character varying(1),
  aland double precision,
  awater double precision,
  intptlat character varying(11),
  intptlon character varying(12),
  geom geometry(MultiPolygon,4326),
  CONSTRAINT tl_2014_tract_pkey PRIMARY KEY (gid )
)'

for i in *.zip
  do
    x=${i%.zip}
    echo 'Loading' $i
    unzip -o $i
    ogr2ogr -f "ESRI Shapefile" proj_$x.shp $x.shp -t_srs "EPSG:4326"
    shp2pgsql -a -s 4326 -W latin1 -g geom proj_$x.shp $schema.$table $db | psql -p 5432 $db
    rm proj*
  done

psql -p 5432 $db -c 'CREATE INDEX '"$schema"'_gix ON '"$schema"'.'"$table"' USING GIST (geom);'

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


Add setup script

Add setup script

#!/bin/bash

sudo apt-get update
sudo apt-get install pasmo

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


first attempt at a shell script to install stuff in a remote machine with no-machine

#!/bin/bash

if [ "$EUID" -ne 0 ]; then
    echo "Please run as root"
    exit
fi

RESOLUTION=${1:-"2048x1280x24"}
USERNAME=${2:-"mahmoud"}

function setup_user() {
    useradd -m -d /home/${USERNAME} -s /bin/bash ${USERNAME}
    usermod -a -G admin ${USERNAME}
    passwd ${USERNAME}
}

function install_nomachine() {
    wget http://download.nomachine.com/download/4.6/Linux/nomachine_4.6.4_13_amd64.deb
    dpkg -i nomachine_4.6.4_13_amd64.deb
    echo 'DefaultDesktopCommand "/usr/bin/X11/startxfce4"' >> /usr/NX/etc/server.cfg
    echo "PhysicalDesktopAuthorization 0" >> /usr/NX/etc/server.cfg
    echo "VirtualDesktopAuthorization 0"  >> /usr/NX/etc/server.cfg
    service nxserver restart
    /usr/NX/bin/nxserver --install --setup-nomachine-key
    /usr/NX/bin/nxserver --useradd ${USERNAME}
}

function install_intellij() {
    wget http://download.jetbrains.com/idea/ideaIU-14.1.4.tar.gz
    mv ideaIU-14.1.4.tar.gz intellij-idea.tar.gz
    tar xzvf intellij-idea.tar.gz
}

function main() {
    # setup java
    echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true \
        | debconf-set-selections
    add-apt-repository -y ppa:webupd8team/java

    apt-get -qq update
    apt-get install -y oracle-java8-installer xfce4 xvfb

    COOKIE=`ps -ef | md5sum | cut -f 1 -d " "`
    AUTHFILE=$HOME/Xvfb-0.auth
    xauth add :0 MIT-MAGIC-COOKIE-1 $COOKIE
    # or custom resolution
    Xvfb :0 -auth $AUTHFILE -screen 0 ${RESOLUTION} &
    DISPLAY=:0 nohup /etc/X11/Xsession startxfce4 &

    setup_user()
    install_nomachine()
    install_intellij()
}

main
if [ $? -neq 0 ]; then
    echo "install failed. try again."
    exit -1
fi

cd intellij-idea
JAVA_HOME/usr/lib/jvm/java-8-oracle ./bin/idea.sh


setup: rename setup methods

setup: rename setup methods

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/suyash/dotfiles.git/'


extract ped file from bcf etc

extract ped file from bcf etc

#!/bin/bash

############################################################
#  Program:
#  Author :
############################################################

## BEGIN SCRIPT
usage()
{
    cat << EOF

usage: $0 OPTIONS

OPTIONS can be:
    -h      Show this message
    -f      BCF/VCF/compressed VCF file

EOF
}

# Show usage when there are no arguments.
if test -z "$1"
then
    usage
    exit
fi

VERBOSE=
FILENAME=

# Check options passed in.
while getopts "h f:" OPTION
do
    case $OPTION in
        h)
            usage
            exit 1
            ;;
        f)
            FILENAME=$OPTARG
            ;;
        ?)
            usage
            exit
            ;;
    esac
done

echo "Sample Name"

bcftools view -h $FILENAME \
    | grep "^#CHROM" \
    | cut -f 10- \
    | tr '\t' '\n'

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


example deploy script?

example deploy script?

#!/bin/bash
set -e

is_auth_cloned=false
is_api_cloned=false

if test -d sadanghaeng_auth ; then
    is_auth_cloned=true
fi

if test -d sadanghaeng_auth ; then
    is_api_cloned=true
fi

run_cmd() {
    if $verbose ; then
        "$@"
    else
        "$@" 2> /dev/null
    fi
}

setup_repo() {
  if $is_auth_cloned ; then
    run_cmd rm -rf "$(pwd)"/sadanghaeng_auth
  fi

  run_cmd git clone https://github.com/cuponthetop/sadanghaeng_auth.git

  if $is_api_cloned ; then
    run_cmd rm -rf "$(pwd)"/sadanghaeng_api
  fi

  run_cmd git clone https://github.com/cuponthetop/sadanghaeng_api.git

}

setup_npm() {

  run_cmd cd sadanghaeng_auth
  run_cmd npm install
  run_cmd cd ..

  run_cmd cd sadanghaeng_api
  run_cmd npm install
  run_cmd cd ..

}

setup_data() {
  run_cmd node sadanghaeng_auth/test/init/test-init.js
  run_cmd node sadanghaeng_api/test/init/test-init.js
}

deploy_server() {
  run_cmd node sadanghaeng_auth/lib/server/server.js &
  run_cmd node sadanghaeng_api/lib/server/server.js &
}

setup_repo

setup_npm

deploy_server

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


Allow Travis to fail when the result of the py.test run fails

Previously, Travis would report that the script passed when the py.test run
failed but the pych --testing run passed because the pych run happened last.
This allows Travis to tell us something went wrong in the first case.

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

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

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

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

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

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

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

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

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

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

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

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

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

passedPytest=$?

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

passedPych=$?
exit $passedPytest | $passedPych

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

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

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

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

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

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

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

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

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

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

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

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

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

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


Adds startup script

Adds startup 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/scottTomaszewski/tortoiseberry.git/'


Add terminal install

Add terminal install

#!/bin/sh
curl -L \
  "https://raw.githubusercontent.com/mdo/ocean-terminal/master/terminal-ocean-dark.terminal" \
  > "/tmp/terminal-ocean-dark.terminal"
open "/tmp/terminal-ocean-dark.terminal"

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


Install jenkinsflow in /tmp to make i available to Jenkins for the demo flow jobs

#!/bin/bash
set -u

target_dir=/tmp/jenkinsflow/

rsync -av --exclude .git --exclude '*~' --exclude '*.pyc' --exclude '__pycache__' ./ $target_dir
chmod -R a+r $target_dir
chmod a+x $(find $target_dir -type d)
chmod a+x $target_dir/{test,demo}/*.py

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