initial script added

initial script added

#!/bin/bash

GROUP_PATH=./groups/

# print usage info
usage () {
    echo "usage: $0 [OPTION] [CMD]"
    echo "  -g|--group <GROUPNAME>      (all|all-rhel6|all-squeezy)"
    echo "  -n|--dry-run                don't run any command, only show them"
    echo "  -s|--silent                 don't show servernames"
    echo "  -c|--cron                   show servername only on remote output"
    echo "  -i|--stdin			use stdin, even if CMD is not empty"
    echo "  CMD                         if empty, command is expected once(!) from stdin and sent to all (EOF expected!)"
    exit
}

if [ $# -eq 0 ]; then
  usage;
fi

gflag=0
dryrunflag=0
silentflag=0
cronflag=0
stdinflag=0

# Parse the command-line options
TEMP=`getopt -o g:nsci --long group:,dry-run,silent,cron,stdin \
     -n $0 -- "$@"`

# Note the quotes around `$TEMP': they are essential!
eval set -- "$TEMP"

while true ; do
  case "$1" in
    -g|--group) gflag=1;
      case "$2" in
        "") echo "Groupname missing!"; usage; shift 2 ;;
        *) GROUP=$2; shift 2 ;;
      esac ;;
    -n|--dry-run) dryrunflag=1; shift ;;
    -s|--silent) silentflag=1; shift ;;
    -c|--cron) cronflag=1; shift ;;
    -i|--stdin) stdinflag=1; shift ;;
    --) shift; break ;;
    *) echo "Internal error!" ; exit 1 ;;
  esac
done

if [[ $gflag = 0 ]]; then
  usage;
fi

## generate grouplist
GROUP_LIST=""

### all
if [[ "$GROUP" == "all" ]]; then
  GROUP_LIST=`cat $GROUP_PATH/*`
else
  ### location and type?
  LOCATION_AND_TYPE=$(echo $GROUP |awk '/[a-z]+-[a-z]+/ { print 1 }')
  if [[ "$LOCATION_AND_TYPE" = "1" ]]; then
    #echo "Location and Type"
    GROUP_LIST=$(cat $GROUP_PATH/$GROUP)
  else
    GROUP_LIST=$(cat $GROUP_PATH/*${GROUP}*)
  fi
fi

## initialize some vars
HOST=""
PORT=""
STDIN_TEMPFILE=""

## save stdin to file, for multiple use in loop later
## only if $@ empty!
if [[ "$@" == "" || $stdinflag == 1 ]]; then
  STDIN_TEMPFILE=$(mktemp)
  cat /dev/stdin > $STDIN_TEMPFILE
fi

## loop through servers in group and execute specified command
for i in $GROUP_LIST; do
  ### ignore if first char is #
  IS_COMMENT=$(echo $i |cut -c1)
  if [[ "$IS_COMMENT" == "#" ]]; then
    continue
  fi
  ### get port
  HOST=`echo $i |cut -d":" -f1`
  PORT=`echo $i |cut -s -d":" -f2`
  if [[ "$PORT" == "" ]]; then
    PORT=22
  fi
  ssh -p $PORT $HOST "echo 0" &>/dev/null
  CONNECT_TEST=$?
  if [ "$CONNECT_TEST" != "0" ]; then
    if [[ $silentflag == 0 && $cronflag == 0 ]]; then
      echo "WARNING: $HOST:$PORT not reachable.";
    fi
    continue
  fi
  ### don't print header on "silent" parameter
  if [[ $silentflag == 0 && $cronflag == 0 ]]; then
    echo "### $i ###"
  fi

  if [ $dryrunflag == 1 ]; then
    if [[ "$@" == "" || $stdinflag == 1 ]]; then
      echo "cat <STDIN> |ssh -p $PORT -T $HOST $@"
    else
      echo "ssh -p $PORT -T $HOST $@"
    fi
  else
    if [ $cronflag == 1 ]; then
      if [[ "$@" == "" || $stdinflag == 1 ]]; then
        OUTPUT=$(cat $STDIN_TEMPFILE |ssh -p $PORT -T $HOST $@)
      else
        OUTPUT=$(ssh -p $PORT -T $HOST $@)
      fi
      if [[ "$OUTPUT" != "" ]]; then
        if [ $silentflag == 0 ]; then
	  echo "### $i #######################################################################"
	fi
	IFS="
"
        for line in $OUTPUT; do
          echo $line
	done
      fi
    else
      if [[ "$@" == "" || $stdinflag == 1 ]]; then
        cat $STDIN_TEMPFILE |ssh -p $PORT -T $HOST $@
        #cat $STDIN_TEMPFILE |ssh -p $PORT -tt $HOST $@
      else
        ssh -p $PORT -T $HOST $@
        #ssh -p $PORT -tt $HOST $@
      fi
    fi
  fi
done

## cleanup
rm -f $STDIN_TEMPFILE

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


lib: Add a script to regenerate all headers

It's quite tedious to generate this by hand, let's automate it.

#!/bin/bash

CLDR_VERSION=27
UCD_VERSION=9.0.0
EMOJI_VERSION=5.0

wget -c "https://www.unicode.org/Public/$UCD_VERSION/ucd/Blocks.txt"
wget -c "https://www.unicode.org/Public/$UCD_VERSION/ucd/Jamo.txt"
wget -c "https://www.unicode.org/Public/$UCD_VERSION/ucd/PropertyValueAliases.txt"
wget -c "https://www.unicode.org/Public/$UCD_VERSION/ucd/UnicodeData.txt"
wget -c "https://www.unicode.org/Public/cldr/$CLDR_VERSION/core.zip"
wget -c "https://www.unicode.org/Public/emoji/$EMOJI_VERSION/emoji-test.txt"
wget -c "https://www.unicode.org/Public/security/$UCD_VERSION/confusables.txt"

unzip -jo core.zip common/supplemental/supplementalData.xml

./gen-blocks.py Blocks.txt > blocks.h
./gen-confusables.py confusables.txt > confusables.h
./gen-emoji.py emoji-test.txt > emoji.h
./gen-hangul.py Jamo.txt > hangul.h
./gen-names.py UnicodeData.txt > names.h
./gen-scripts.py supplementalData.xml PropertyValueAliases.txt > scripts.h

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


bash to Start OS

bash to Start OS

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


Create startup.sh

Create startup.sh

#!/bin/bash

mkdir -p /var/run/sshd

# create an ubuntu user
# PASS=`pwgen -c -n -1 10`
PASS=ubuntu
# echo "Username: ubuntu Password: $PASS"
id -u ubuntu &>/dev/null || useradd --create-home --shell /bin/bash --user-group --groups adm,sudo ubuntu
echo "ubuntu:$PASS" | chpasswd

/usr/bin/supervisord -c /supervisord.conf

while [ 1 ]; do
    /bin/bash
done

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


make.bash: more robustly detect gold 2.20

On recent Debian systems the gold 2.20 check triggers though
Debian doesn't have version 2.20 but rather has:

        GNU gold (GNU Binutils for Debian 2.21.52.20110606) 1.11
                                                ^^^^

R=rsc, iant
CC=golang-dev
http://codereview.appspot.com/5252055

Committer: Russ Cox <5ad239cb8a44f659eaaee0aa1ea5b94947abe557@golang.org>

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/dsriram/golang.git/'


Addition of basic terminate script

Addition of basic terminate script

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


set HTTP_PROXY in loadmyvars

set HTTP_PROXY in loadmyvars

#!/bin/sh

# used like this
# . /usr/local/bin/loadmyvars.sh

DEFAULTDIR=/root/perm
LOCALDIR=/root/local

for i in \
    datamnt.conf \
    fqdn.conf \
    iocnet.conf \
    iocpool.conf \
    iocrelease.conf \
    pkgpath.couchbase.conf \
    pkgpath.ffmpeg.conf \
    pkgpath.gitlab.conf \
    pkgpath.lame.conf \
    pkgpath.libaacplus.conf \
    pkgpath.squid.conf \
    reposrc.conf \
    squid.conf \
    ; do
    if [ -e ${DEFAULTDIR}/$i ]; then
        . ${DEFAULTDIR}/$i
    fi
    if [ -e ${LOCALDIR}/$i ]; then
        . ${LOCALDIR}/$i
    fi
done

HTTP_PROXY=http://${SQUID}


add nvm settings

add nvm settings

export NVM_DIR="$HOME/.nvm"

# load nvm
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

# load nvm bash_completion
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"

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


added Lua debugging script

added Lua debugging script

#!/bin/bash

# This script helps with debugging a Lua Wireshark plugin on Linux (and possibly OSX).
# Before using it, install Zero Brane Studio IDE and start its Debugger Server.
# Open the plugin script to be debugged in the IDE from its install path (e.g. the Wireshark plugin dir).
# Make sure the ZBS variable is set to the install path of the IDE:
export ZBS=/opt/zbstudio

# In your Lua plugin add these two lines at the very top:
# _G.debug = require("debug")
# require("mobdebug").start()

# Run this script and it will stop at the above lines in the debugger.

if [[ "$(uname -m)" == "x86_64" ]]; then ARCH="x64"; else ARCH="x86"; fi

export LUA_PATH="./?.lua;$ZBS/lualibs/?/?.lua;$ZBS/lualibs/?.lua"
export LUA_CPATH="$ZBS/bin/?.so;$ZBS/bin/linux/$ARCH/clibs52/?.so"

if [ "$#" -ne 1 ]; then
    echo "usage: $0 PCAP_FILE"
    exit
fi

# If the plugin is loaded automatically by Wireshark from one of its plugin directories:
tshark -r $1
#wireshark -r $1

# If the plugin is to be manually loaded:
#tshark -X lua_script:fslibre_usb_dissector.lua -r $1
#wireshark -X lua_script:fslibre_usb_dissector.lua -r $1

error: pathspec 'lib/drivers/abbott/tools/lua_debug.sh' did not match any file(s) known to git


Add sdl-player

Add sdl-player

GIT=https://gitlab.redox-os.org/redox-os/sdl-player.git
BUILD_DEPENDS=(ffmpeg liborbital sdl zlib)

function recipe_version {
    echo "1.0.0"
    skip=1
}

function recipe_update {
    echo "skipping update"
    skip=1
}

function recipe_build {
    sysroot="$(realpath ../sysroot)"
    export CPPFLAGS="-I$sysroot/include"
    export LDFLAGS="-L$sysroot/lib"
    make -j"$(nproc)"
    skip=1
}

function recipe_test {
    echo "skipping test"
    skip=1
}

function recipe_clean {
    make clean
    skip=1
}

function recipe_stage {
    dest="$(realpath $1)"
    mkdir -pv "$dest/bin"
    cp -v "player" "$dest/bin/sdl-player"
    skip=1
}

error: pathspec 'recipes/sdl-player/recipe.sh' did not match any file(s) known to git


Adds a simple test runner program for jvst tests

Runs on tests extracted by extract.sh

#! /bin/sh

if [ -z "${JVST}" ]; then
  echo "JVST must be set"
  exit 1
fi

if [ -z "${OUTDIR}" ]; then
  echo "OUTDIR must be set"
  exit 1
fi

succ=0
skip=0
fail=0
ntest=0
ntotcase=0
while [ $# -gt 0 ]; do
  testdir=$1 ; shift
  schema=${testdir}/schema.json
  desc_file=${testdir}/description

  desc=`sed -e '1q' ${desc_file}`

  if [ ! -r $schema ]; then
    echo "cannot find schema in ${schema}"
    exit 1
  fi

  outcase=${OUTDIR}/${testdir}
  mkdir -p ${outcase}

  ncase=0
  succ_case=0
  fail_case=0
  skip_case=0

  printf " ---------[ %s: %s ]----------\n" "$testdir" "$desc"

  for testfile in ${testdir}/test_*.json ; do
    ncase=$(( $ncase + 1 ))
    ntotcase=$(( $ntotcase + 1 ))
    testbase=`basename ${testfile}`
    testbase=${testbase%.json}

    # XXX - direct this to ${BUILD} somehow...
    outfile=${OUTDIR}/${testdir}/${testbase}.out

    casenum=${testbase#test_}
    casenum=${casenum%_invalid}
    casenum=${casenum%_valid}

    casedesc=`awk -v CN=$casenum -- '$1 == CN { print }' < ${desc_file} | sed -e 's/^[0-9]\{1,\}[ 	]\{1,\}//'`

    ${JVST} -c -r ${schema} ${testfile} > ${outfile} 2>&1
    valid=$?
    if [ $valid != 0 ]; then
      # standardize valid to be 0 (success) or 1 (failure)
      valid=1
    fi

    if [ "${testfile%_valid.json}_valid.json" = "${testfile}" ]; then
      expected=0
      expect_str="VALID"
    elif [ "${testfile%_invalid.json}_invalid.json" = "${testfile}" ]; then
      expected=1
      expect_str="INVALID"
    else
      # echo "unknown result for test ${testfile}"
      expected="skip"
      expect_str="<skip>"
    fi

    if [ $valid = 0 ]; then
      actual_str="VALID"
    else
      actual_str="INVALID"
    fi

    if [ $valid = $expected ]; then
      succ=$(( $succ + 1 ))
      succ_case=$(( $succ_case + 1 ))
      result="OK"
    elif [ "$expected" = "skip" ]; then
      skip=$(( $skip + 1 ))
      skip_case=$(( $skip_case + 1 ))
      result="SKIP"
    else
      fail=$(( $fail + 1 ))
      fail_case=$(( $fail_case + 1 ))
      result="FAILED"
    fi

    if [ "$COLORIZE" = "1" ]; then
      case $result in
        FAILED) clr="\\033[37;1;41m" ;;
        OK)     clr="\\033[32;1m" ;;
        SKIP)   clr="\\033[30;1;43m" ;;
        *)      clr="" ;;
      esac
      printf "\\033[37;1m%-18.18s\\033[0m\t%-40.40s\t${clr}[%s]\\033[0m\n" "$testbase" "$casedesc" "$result"
    else
      printf "%-18.18s\t%-40.40s\t[%s]\n" "$testbase" "$casedesc" "$result"
    fi

  done

  if [ ${succ_case} -lt ${ncase} ]; then
    echo "${testdir}: ${succ_case} successes, ${fail_case} failures, ${skip_case} skipped, ${ncase} cases"
  fi
done

nfail=$(( $ntotcase - $succ ))
echo "SUMMARY: ${succ} successes, ${nfail} failures, ${ntotcase} cases"

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


ADDED: sample bash script to create a p2 repository from a set of maven bundles

#!/bin/bash

OSGITOOLS_REPO_PATH=
ECLIPSE_PATH=
BUNDLES_TO_ECLIPSIFY=

cp $OSGITOOLS_REPO_PATH/scripts/pom.xml ./
mvn package
java -jar $OSGITOOLS_REPO_PATH/plugins/bundle-eclipsifier/target/bundle-eclipsifier.jar $PWD/target/plugins/ $BUNDLES_TO_ECLIPSIFY
$OSGITOOLS_REPO_PATH/scripts/repositify.sh -a $ECLIPSE_PATH $PWD/target/
rm -rf pom.xml target/

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


[scripts/import-components] Import chef-server components into this repo

This script is a one-time-use script to import the components that
make up chef-server into this repository.  The final layout will look like:

.
|-- CONTRIBUTING.md
|-- LICENSE
|-- MAINTAINERS.md
|-- README.md
|-- oc-chef-pedant
|   |-- ...
|-- omnibus
|   |-- ...
`-- src
    |-- bookshelf
    |-- chef-mover
    |-- chef-server-bootstrap
    |-- oc-id
    |-- oc_bifrost
    |-- oc_erchef
    `-- opscode-expander

After this import, subsequent commits will be needed to the omnibus
build configuration to account for this layout.

#!/bin/bash
#
# import-components: A one-time script to document the import
# procedure of the chef-server component repositories
#
set -e

PROJECTS="bookshelf chef-mover chef-server-bootstrap oc-chef-pedant oc-id oc_bifrost oc_erchef opscode-expander"

# Enable dotglob and extglob to enable generating git mv commands more
# easily
shopt -s dotglob extglob

add_remote() {
    project=$1
    git remote add "$project" "https://github.com/chef/${project}.git"

}

checkout_project() {
    project=$1
    git fetch "${project}"
    git checkout -b "${project}-master" "$project/master"
}

# This assumes you are checked out into the component project branch
#
# An explicit git-mv at some point in the history (either before or
# after the merge) appears to be the only way to get `git log
# --follow` to work on the resulting repository correctly
move_files() {
    proj=$1
    mkdir $1
    git mv !(${proj}|.git) ${proj}/
    git commit -m "Move ${proj} files into ${proj}/"
}

# This assumes you are on master
#
# Move many of the components into src/ We don't move them here
# straight-away because many of the repositories already have a src/
# directory, which gets pretty messy without the intermediate move
move_files_2() {
    # Don't move oc-chef-pedant
    mkdir src/
    for i in ${PROJECTS//oc-chef-pedant}; do
        git mv $i/ src/${i}/
    done
    git commit -m "Move components into src/"
}

import_component() {
    proj=$1
    checkout_project $proj
    move_files $proj
    git checkout master
    git merge "${proj}-master" -m "Import $proj into chef-server repository"
}

# Opscode-omnibus is a bit different from the PROJECTS since the
# dirname will be different so we do this one by hand
add_remote "opscode-omnibus"
checkout_project "opscode-omnibus"
mkdir omnibus
git mv !(omnibus|.git) omnibus/
git commit -m "Move opscode-omnibus files into omnibus/"
git checkout master
git merge opscode-omnibus-master -m "Import opscode-omnibus into chef-server repository"

for proj in $PROJECTS; do
    echo "Adding remote for $proj"
    add_remote $proj
done

for proj in $PROJECTS; do
    import_component $proj
done

move_files_2

# Disable Dotglob
shopt -u dotglob

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


Cert renewal script.

Cert renewal script.

#!/bin/bash

if [ $# -lt 1 ]; then
	echo "Usage: $0 <domain"
	exit
fi

certbot certonly --standalone --tls-sni-01-port 10443 --domain $1

cp /etc/letsencrypt/live/$1/fullchain.pem /opt/libjaypea/artifacts/ssl.crt

cp /etc/letsencrypt/live/$1/privkey.pem /opt/libjaypea/artifacts/ssl.key

touch artifacts/ready.lock

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


script for calc source code lines number

find src \( -name *.java -o -name *.xml -o -name *.js -o -name *.html -o -name *.css -o -name *.properties -o -name *.jsp \) -exec cat {} \; | wc -l

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


First commit

First commit

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/jerius/ubermover.git/'


Fix up check for empty terraform output variables.

Fails better maybe.

Signed-off-by: Caleb Miles <906dbe5b21c7025e252f807d6724eb4d0fd7fb4c@pivotal.io>

#!/usr/bin/env bash

set -e -x

source bosh-cpi-release/ci/tasks/utils.sh

check_param aws_access_key_id
check_param aws_secret_access_key
check_param base_os

#copy tf template file from cpi-release directory
cp bosh-cpi-release/ci/assets/bosh-workspace.tf terraform-state

export_file=terraform-${base_os}-exports.sh

cd terraform-state

state_file=${base_os}-bats.tfstate

#heredoc variables.tf
cat > "terraform.tfvars" <<EOF
access_key = "${aws_access_key_id}"
secret_key = "${aws_secret_access_key}"
build_id = "bats-${base_os}"
EOF

/terraform/terraform destroy -force -state=$state_file

# applies the plan, generates a state file
/terraform/terraform apply -state=$state_file

# exports values into an exports file
echo -e "#!/usr/bin/env bash" >> $export_file
echo -e "export DIRECTOR=$(/terraform/terraform output -state=${state_file} director_vip)" >> $export_file
echo -e "export VIP=$(/terraform/terraform output -state=${state_file} bats_vip)" >> $export_file
echo -e "export SUBNET_ID=$(/terraform/terraform output -state=${state_file} subnet_id)" >> $export_file
echo -e "export SECURITY_GROUP_NAME=$(/terraform/terraform output -state=${state_file} security_group_name)" >> $export_file
echo -e "export AVAILABILITY_ZONE=$(/terraform/terraform output -state=${state_file} availability_zone)" >> $export_file

# fail the build if any expected output variables have not been set
[ -z /terraform/terraform output -state=${state_file} director_vip ]
[ -z terraform/terraform output -state=${state_file} bats_vip ]
[ -z /terraform/terraform output -state=${state_file} subnet_id ]
[ -z /terraform/terraform output -state=${state_file} security_group_name ]
[ -z /terraform/terraform output -state=${state_file} availability_zone ]

#!/usr/bin/env bash

set -e -x

source bosh-cpi-release/ci/tasks/utils.sh

check_param aws_access_key_id
check_param aws_secret_access_key
check_param base_os

#copy tf template file from cpi-release directory
cp bosh-cpi-release/ci/assets/bosh-workspace.tf terraform-state

export_file=terraform-${base_os}-exports.sh

cd terraform-state

state_file=${base_os}-bats.tfstate

#heredoc variables.tf
cat > "terraform.tfvars" <<EOF
access_key = "${aws_access_key_id}"
secret_key = "${aws_secret_access_key}"
build_id = "bats-${base_os}"
EOF

/terraform/terraform destroy -force -state=$state_file

# applies the plan, generates a state file
/terraform/terraform apply -state=$state_file

# exports values into an exports file
echo -e "#!/usr/bin/env bash" >> $export_file
echo -e "export DIRECTOR=$(/terraform/terraform output -state=${state_file} director_vip)" >> $export_file
echo -e "export VIP=$(/terraform/terraform output -state=${state_file} bats_vip)" >> $export_file
echo -e "export SUBNET_ID=$(/terraform/terraform output -state=${state_file} subnet_id)" >> $export_file
echo -e "export SECURITY_GROUP_NAME=$(/terraform/terraform output -state=${state_file} security_group_name)" >> $export_file
echo -e "export AVAILABILITY_ZONE=$(/terraform/terraform output -state=${state_file} availability_zone)" >> $export_file

# fail the build if any expected output variables have not been set
/terraform/terraform output -state=${state_file} director_vip | grep -v ""
/terraform/terraform output -state=${state_file} bats_vip | grep -v ""
/terraform/terraform output -state=${state_file} subnet_id | grep -v ""
/terraform/terraform output -state=${state_file} security_group_name | grep -v ""
/terraform/terraform output -state=${state_file} availability_zone | grep -v ""


Added loop_test script

Added loop_test script

Added a script to perform loop testing of FIO.

#!/bin/bash

for j in 1 2 4 8 16 32 64
do
	for d in 1 8 16 32 64 128 256 512
	do
		echo "Creating Directory"
		mkdir -p $1'/Num_Jobs_'$j'/IO_Depth_'$d'/read'
		./latency.sh -f /dev/nvme0n1 -r 100 -n $j -i $d
		mv *.png $1'/Num_Jobs_'$j'/IO_Depth_'$d'/read/'

		mkdir -p $1'/Num_Jobs_'$j'/IO_Depth_'$d'/write'
		./latency.sh -f /dev/nvme0n1 -r 0 -n $j -i $d
		mv *.png $1'/Num_Jobs_'$j'/IO_Depth_'$d'/write/'
	done
done

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


the lib seq

the lib seq

as -o swtch.o swtch.s
cc -c -o thread.o thread.c
cc -c -o mem.o mem.c
cc -c -o fmt.o fmt.c
cc -c -o assert.o assert.c
cc -c -o except.o except.c
cc -c -o chan.o chan.c
ar ruv libcii.a mem.o fmt.o assert.o except.o thread.o swtch.o chan.o
cc -g -c -o spin.o spin.c
cc -g -o spin spin.o libcii.a

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


update: next(svn)

update: next(svn)

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


update: next(openssl)

update: next(openssl)


fix: next(sdl1)

fix: next(sdl1)


Start of nightly builds script

Start of nightly builds script

#!/bin/bash

# Script that performs nightly builds of IncludeOS dev and master branches.
#
# Deletes previous and launches a new VM
# Downloads and installs IncludeOS + dependencies
# Runs all tests
# Stops VM when done

BRANCH=$1	# Dev or master will be specified
VM_NAME='nightly_build_$BRANCH'

# Delete previous VM
./openstack_control.py --vm_delete $VM_NAME

# Launch new VM
./openstack_control.py --vm_create $VM_NAME

# Install dependencies
until ssh $IP_ADDRESS 'which git > /dev/null' > /dev/null 2>&1  # Repeats until correct
do
    ssh $IP_ADDRESS 'export PROJECT='"'$PROJECT'"'; sudo sh -c "echo 127.0.1.1 vm-$PROJECT >> /etc/hosts";
                     sudo apt-get update > /dev/null 2>&1;
                     sudo apt-get -y install git > /dev/null 2>&1;
                     sudo apt-get -y install arping > /dev/null 2>&1;
                     ' > /dev/null 2>&1
    sleep 2
done

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


Update docker-plex-wrapper.sh

Update docker-plex-wrapper.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/atomney/scripts.git/'


Added map downsize (create 3000 px JPEG preview)

#!/bin/bash
root=/mnt/datasets/api.npolar.no/_file/map/archive # Disk root of map archive originals
dest=/mnt/public/Datasets/kartarkiv

function resize_image {
  original=$1
  preview=$2
  size=$3
  quality=80

  if [[ ! -f $preview ]] ; then
    mkdir -p `dirname $preview`
    echo "[$size] $preview [quality $quality] <- $original"
    `nice convert -resize $size -quality $quality $original $preview 2> /dev/null`
  fi
}

# Loop all (non-restricted) map archive originals => PNG files [-size +1M] ?
find $root -type f -iname *.png | grep -v "\/restricted\/" | while read filename
do

  basename=`basename "$filename" .png`
  basename=`basename "$basename" .PNG`

  id=`echo $filename | grep -oE '/_file\/map\/archive\/.*/' | grep -oE '[0-9a-fA-F-]{36,}'`

  medium="$dest/$id/$basename-1920px.jpeg"
  large="$dest/$id/$basename-3000px.jpeg"
  jpeg="$dest/$id/$basename.jpeg"

  #resize_image "$filename" "$medium" 1920
  resize_image "$filename" "$large" 3000
  #create_jpeg "$filename" "$jpeg"
done

error: pathspec 'bin/map-archive-downsize.sh' did not match any file(s) known to git


Initialize pyenv

Initialize pyenv

# init according to man page
if (( $+commands[pyenv] ))
then
  eval "$(pyenv init -)"
fi

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


First pass at an "update TZDB" script

First pass at an "update TZDB" script

This only tackles 1.3. I think it's going to be easiest to
have one of these scripts per minor release, and then one
to call them all (moving some of this script there).

It doesn't rebuild any documentation, so the docs will still show
(e.g.) 1.3.2... but I think that's okay.

I've used this to build a 1.3.3, but I won't push that just yet - I
want to make the web site automatically detect the new release too,
before I do that.

Fixes #360.

#!/bin/bash

set -e

declare -r GSUTIL=gsutil.cmd
declare -r ROOT=$(realpath $(dirname $0)/..)

rm -rf tmp
mkdir -p tmp/releases
cd tmp/releases

# Work out the current release, fetch and extract it
declare -r RELEASE=$(\
    $GSUTIL ls gs://nodatime/releases | \
    grep -o -E 'NodaTime-1\.3\.[0-9]+\.zip' | \
    sort -r | \
    head -n 1 | \
    sed s/NodaTime-// | \
    sed s/.zip//)
echo "Fetching and expanding release ${RELEASE}"
$GSUTIL -q cp gs://nodatime/releases/NodaTime-${RELEASE}.zip .
$GSUTIL -q cp gs://nodatime/releases/NodaTime-${RELEASE}-src.zip .
curl -s -S https://api.nuget.org/packages/nodatime.${RELEASE}.nupkg -o nodatime.${RELEASE}.nupkg
unzip -q NodaTime-${RELEASE}.zip
unzip -q NodaTime-${RELEASE}-src.zip
unzip -q nodatime.${RELEASE}.nupkg -d NodaTime-${RELEASE}-nupkg

# Handy "increment version number" code from http://stackoverflow.com/questions/8653126
declare -r NEW_RELEASE=`echo $RELEASE | perl -pe 's/^((\d+\.)*)(\d+)(.*)$/$1.($3+1).$4/e'`

# Update all the files that need updating
echo "Updating to reflect ${NEW_RELEASE}"
mv NodaTime-${RELEASE} NodaTime-${NEW_RELEASE}
mv NodaTime-${RELEASE}-src NodaTime-${NEW_RELEASE}-src
cp $ROOT/src/NodaTime/TimeZones/Tzdb.nzd NodaTime-${NEW_RELEASE}-src/src/NodaTime/TimeZones
sed -i s/\"$RELEASE\"/\"$NEW_RELEASE\"/g NodaTime-${NEW_RELEASE}-src/src/NodaTime/Properties/AssemblyInfo.cs
sed -i s/\<version\>$RELEASE\</\<version\>$NEW_RELEASE\</g NodaTime-${NEW_RELEASE}-src/src/NodaTime/NodaTime.nuspec
zip -q -r -9 NodaTime-${NEW_RELEASE}-src.zip NodaTime-${NEW_RELEASE}-src

# Perform the build
echo "Building ${NEW_RELEASE}"
cp "../../../NodaTime Release.snk" NodaTime-${NEW_RELEASE}-src
msbuild.exe NodaTime-${NEW_RELEASE}-src/src/NodaTime/NodaTime.csproj /property:Configuration="Signed Release" /verbosity:quiet
msbuild.exe NodaTime-${NEW_RELEASE}-src/src/NodaTime/NodaTime.csproj /property:Configuration="Signed Release Portable"  /verbosity:quiet
cp NodaTime-${RELEASE}-nupkg/lib/net35-Client/NodaTime.xml "NodaTime-${NEW_RELEASE}-src/src/NodaTime/bin/Signed Release"
cp NodaTime-${RELEASE}-nupkg/lib/portable*/NodaTime.xml "NodaTime-${NEW_RELEASE}-src/src/NodaTime/bin/Signed Release Portable"

# Build the NuGet package and new binary zip
echo "Packaging ${NEW_RELEASE}"
nuget pack NodaTime-${NEW_RELEASE}-src/src/NodaTime/NodaTime.nuspec -Symbols
cp "NodaTime-${NEW_RELEASE}-src/src/NodaTime/bin/Signed Release"/NodaTime.dll NodaTime-${NEW_RELEASE}
cp "NodaTime-${NEW_RELEASE}-src/src/NodaTime/bin/Signed Release Portable"/NodaTime.dll NodaTime-${NEW_RELEASE}/Portable
zip -q -r -9 NodaTime-${NEW_RELEASE}.zip NodaTime-${NEW_RELEASE}

cd ../..

echo "Done. Remaining tasks:"
echo "- Push package to nuget"
echo "- Copy src/binary releases to GCS"

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


Add initial "configuration" script for the Digiges build

#!/bin/bash -e

set -e

export BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

echo "Disable stages 3 to 5"
touch ${BASE_DIR}/stage{3,4,5}/SKIP

echo "Remove unwanted image and noobs exports"
rm -f ${BASE_DIR}/stage{4,5}/EXPORT_IMAGE
rm -f ${BASE_DIR}/stage*/EXPORT_NOOBS

echo "Adapt image name"
echo "IMG_NAME=DigOnPi" > ${BASE_DIR}/config

error: pathspec 'configure-dig-on-pi.sh' did not match any file(s) known to git


missed a spot in run_android

missed a spot in run_android

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/sbj42/roze.git/'


Add test script.

Add test script.

#!/bin/ksh

echo -n "Testing owrite..."
./owrite
if [ $? -ne 0 ]; then
	echo "failed!"
	exit 1
else
	echo "ok"
fi

echo -n "Testing oread..."
./oread > /dev/null		# oread will print to console
if [ $? -ne 0 ]; then
	echo "failed."
	exit 1
else
	echo "ok"
fi

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


Create install_raspbian.sh

Create install_raspbian.sh

Init

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


Introduced object management and reflection framework.

###########################################################################
##
##  Purpose:
##    Defines concrete introspection methods for all objects.
##
###########################################################################
reflect_impl(){
  ###########################################################################
  ##
  ##  Purpose:
  ##    Object types encode their specific concrete implementation of
  ##    an abstract interface via a set of bash functions whose names
  ##    mirror the ones defined by the given abstract interface.  These
  ##    concrete functions are encapsulated (defined) within a function whose
  ##    name matches the concrete type (a.k.a object's type name).  To ensure
  ##    the proper execution of a given object's concrete methods, this
  ##    encapsulating function should/must be executed before invoking any of
  ##    the object's methods, as it will define new/override existing function
  ##    definitions potentially implemented by other object types which
  ##    implement the same abstract interface.
  ##
  ##  Inputs:
  ##    $1 - The this pointer - reference to an associative map variable.
  ##
  ##  When successful:
  ##    bash maintained function definition table reflects the concrete
  ##    implementation of one or more abstract interfaces.
  ##
  ###########################################################################
  reflect_type_Active(){
    local typeNameConcrete
    reflect_type_Get "$1" 'typeNameConcrete'
    local -r typeNameConcrete
    if ! $typeNameConcrete; then
      ScriptUnwind "$LINENO" "Unknown concrete type name: '$typeNameConcrete'."
    fi
  }
  ###########################################################################
  ##
  ##  Purpose:
  ##    Optimizes function overriding by comparing the given object's
  ##    concrete interface implementation with a value that reflects the
  ##    most recently defined/invoked concrete interface to determine
  ##    if it's necessary to update bash's function definition table.
  ##
  ##  Inputs:
  ##    $1 - An object's this pointer.
  ##    $2 - A variable name whose value reflects the most recently
  ##         invoked concrete object type
  ##
  ##  When successful:
  ##    bash maintained function definition table reflects the concrete
  ##    implementation of one or more abstract interfaces.
  ##    $2 - The variable value reflects the most recent concrete interface
  ##         name.
  ##
  ###########################################################################
  reflect_type_ActiveOptimize(){
    local -r typeNameCurrVarName_ref="$2"
    eval local \-r typeNameCurrValue_lcl\=\"\$$typeNameCurrVarName_ref\"
    local _typeNameConcrete
    reflect_type_Get "$1" '_typeNameConcrete'
    local -r _typeNameConcrete
    if [ "${_typeNameConcrete}" == "$typeNameCurrValue_lcl" ]; then return; fi
    if ! ${_typeNameConcrete} 2>/dev/null; then
      ScriptUnwind "$LINENO" "Unknown concrete type name: '${_typeNameConcrete}'."
    fi
    ref_simple_value_Set "$typeNameCurrVarName_ref" "${_typeNameConcrete}"
  }
  ###########################################################################
  ##
  ##  Purpose:
  ##    Return an object's concrete type name.  This name is the same one
  ##    assigned to a bash function that encapsulates an object's
  ##    implemented interface(s).
  ##
  ##    Why would this be public?
  ##      > Permits access by type converters and optimizers.
  ##
  ##  Inputs:
  ##    $1 - The this pointer - reference to an associative map variable.
  ##    $2 - Variable name that accepts the type name value.
  ##
  ##  Outputs:
  ##    $2 - Value of this variable is assigned this object's concrete type name.
  ##
  ###########################################################################
  reflect_type_Get(){
    _reflect_field_Get $1 'TypeName' "$2"
  }
  ###########################################################################
  ##
  ##  Purpose:
  ##    A private function used by object constructor to remember the object's
  ##    concrete interface name.
  ##
  ##  Inputs:
  ##    $1 - An object's this pointer.
  ##    $2 - The object's concrete type.
  ##
  ##  Outputs:
  ##    $1 - 'TypeName' field reflect's object's concrete type.
  ##
  ###########################################################################
  _reflect_type_Set(){
    _reflect_field_Set $1 'TypeName' "$2"
  }
  ###########################################################################
  ##
  ##  Purpose:
  ##    Facilitate assignment to an object's properties.
  ##
  ##  Inputs:
  ##    $1 - The this pointer - reference to an associative map variable.
  ##    $2 - Object field name
  ##    $3   Object field value
  ##    $n+1 - see $2
  ##    $n+2 - see $3
  ##  Outputs:
  ##    $1 - update to reflect assigned object key value pairs.
  ##
  ###########################################################################
  _reflect_field_Set(){
    local -r this_ref="$1"
    set -- "${@:2}"
    while (( $# > 1 )); do
      eval $this_ref\[\"\$1\"\]\=\"\$2\"
      shift 2
    done
    if (( $# > 0 )); then
      ScriptUnwind "$LINENO" "Field name: '$1' lacks value."
    fi
  }
  #############################################################################
  ##
  ##  Purpose:
  ##    Encode recurrent method to an object's property value(s).
  ##
  ##  Inputs:
  ##    $1 - The this pointer - reference to an associative map variable.
  ##    $2 - Object field name
  ##    $3   Variable to receive field's value.
  ##    $n+1 - see $2
  ##    $n+2 - see $3
  ##  Outputs:
  ##    $n+2 - update to reflect field value for given field name ($n+1).
  ##
  #############################################################################
  _reflect_field_Get(){
    local -r this_ref="$1"
    set -- "${@:2}"
    while (( $# > 1 )); do
      eval $2\=\"\$\{$this_ref\[\"\$1\"\]\}\"
      shift 2
    done
    if (( $# > 0 )); then
      ScriptUnwind "$LINENO" "Field name: '$1' lacks receiving variable name."
    fi
  }
}
reflect_impl
###############################################################################
##
##  Purpose:
##    Construct an object's context and then execute a function within this
##    context.  An object's context refers to all the sub-objects, data members,
##    encapsulated with in the object itself.
##
##  Inputs:
##    $2 - A function to execute within the constructed context.  The function
##         must not pass variables.  To pass variables, encapsulate the desired
##         function call within the body of function.
##    $1 - A function which generates a serialized stream of object definitions
##         to SYSOUT.  The serialized stream is defined as:
##         '<ObjectName>' '<ConcreteObjectType>' ['<ConstructorArgument>']...
##         '<ObjectName>' = The bash variable name (member name) assigned a
##           bash map variable type.
##         '<ConcreteObjectType>' The concrete type assigned to the object.  A
##           concrete object type refers to a function that implements one or
##           more interfaces for the given type.  By convention and necessity,
##           one of the implemented methods must be named '<ConcreteObjectType>_Create()'
##         '<ConstructorArgument>' an argument to be passed to the constructor.
##
###############################################################################
object_Context(){
  local -r objectSerialFunc="$1"
  local -r funcClosure="$2"
  local -a objList
  local objConstruct
  while read -r objConstruct; do
    eval set -- "$objConstruct"
    ## $2 represents <ObjectName>
    eval local \-\A $2\=\(\)
    ## $1 represents <ConcreteObjectType>. Establish concrete type's functions as the current ones.
    $1
    _Create "${@:2}"
    objList+=( "$2" )
  done < <( $objectSerialFunc)
  ###############################################################################
  ##
  ##  Purpose:
  ##    Iterate over every object in the current object context and execute
  ##    a method, implemented by each one that accepts a this pointer and
  ##    potentially one or more other arguments.
  ##
  ##  Note:
  ##   The current object context may include other inherited object contexts.  If
  ##   a derived object context defines a variable with same name as an inherited
  ##   one, the variable within the derived context hides the inherited one.
  ##
  ##  Inputs:
  ##    $1 - A function name to execute that's implemented for every object in
  ##         the provided context.  The function may pass variables.
  ##
  ###############################################################################
  object_list_Iterate(){
    local -r funcClosure="$1"
    local ixObj
    local typeCurrent=''
    for (( ixObj=0; ixObj < ${#objList[@]}; ixObj++ ))
    do
      local objName="${objList[$ixObj]}"
      # performance optimization
      reflect_type_ActiveOptimize "$objName" 'typeCurrent'
      $funcClosure "$objName" "${@:2}"
    done
  }
  eval $funcClosure
}

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


+ install script

+ install 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/mrXCray/XCrataPult.php.git/'


Update agent.sh

Update agent.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/wolfboys/opencron.git/'


autoexec for raspi

autoexec for raspi

#!/bin/bash
while :
do
        echo "Starting.."
        cd /home/pi/airwellhvac/command_parsing
        python ir_comms.py
        echo "re-starting.."
        sleep 10
done

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


Minor fix

Minor fix

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/webintrinsics/clusterlite.git/'


Updates for 22.04

Updates for 22.04

# Download the Microsoft repository GPG keys
wget -q https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb

# Register the Microsoft repository GPG keys
dpkg -i packages-microsoft-prod.deb

# Update the list of products
apt-get update

# Enable the "universe" repositories
add-apt-repository universe

# Install PowerShell
apt-get install -y powershell

# List version
pwsh -v

error: pathspec 'spec/fixtures/scripts/install_pwsh/ubuntu_22.04.sh' did not match any file(s) known to git


pptp: autorestart script if ping down

pptp: autorestart script if ping down

#!/bin/bash
# Auto restart pptp VPN if down.

main() {
  if [[ $# -ne 2 ]]; then
    echo "Usage: $0 <vpn name> <interface>"
    exit 1
  fi
  if [[ -z "$DAEMON" ]]; then
    DAEMON=1 nohup "$0" "$@" >/dev/null 2>&1 &
    exit
  fi
  loop "$1" "$2"
}

loop() {
  while sleep 60; do
    if ! alive "$2"; then
      poff "$1"
      pon "$1"
    fi
  done
}

alive() {
  local fail
  for fail in {1..5}; do
    if beat "$1"; then
      return 0
    fi
  done
  return 1
}

beat() {
  ping -I "$1" -c 1 8.8.8.8 >/dev/null
}

if [ "${BASH_SOURCE[0]}" = "$0" ]; then
  main "$@"
fi

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


Remove Darwin check for Node install 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/'


[node] add node install from homebrew

[node] add node install from homebrew

if test ! $(which node)
then
  echo "  Installing node for you."
  brew install node > /tmp/node-install.log
fi

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


Trying to have a script to modify the .plist to allow connections to foosey.futbol

#!/bin/bash

PLIST=platforms/ios/*/*-Info.plist

cat << EOF |
Add :NSAppTransportSecurity dict
Add :NSAppTransportSecurity:NSExceptionDomains dict
Add :NSAppTransportSecurity:NSExceptionDomains:foosey.futbol dict
Add :NSAppTransportSecurity:NSExceptionDomains:foosey.futbol:NSIncludesSubdomains bool YES
Add :NSAppTransportSecurity:NSExceptionDomains:foosey.futbol:NSExceptionAllowsInsecureHTTPLoads bool YES
EOF
while read line
do
    /usr/libexec/PlistBuddy -c "$line" $PLIST
done

true

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


Create change_root_password.sh

Create change_root_password.sh

#!/bin/bash

set -u

read -p "What is your password? " MYPASS
read -p "What do you want to change root password to ?" ROOTPASS

if [ -z $MYPASS ] ; then
  echo "YOU DO NOT HAVE $MYPASS variable set"
  exit 5
else
  for HOST in `cat servers`; do

    sshpass -e scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /usr/bin/sshpass $HOST:/tmp
    echo $MYPASS |sshpass -e ssh -t -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $HOST "sudo -S bash -c \"echo root:$ROOTPASS | /usr/sbin/chpasswd | echo $? \"" 2>&1 | tee --append /tmp/my.log

  done

fi

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


add mpd-notifier

add mpd-notifier

mpc idleloop player | while read event
do
	notify-send "`mpc status`"
done

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


ENH: setup_ambiance_radiance_themes.sh

ENH: setup_ambiance_radiance_themes.sh

#!/bin/bash
#cd ~

wget "http://gnome-look.org/CONTENT/content-files/146674-Ambiance&Radiance-XfceLXDE-11-10-2.tar.gz"
sudo tar xzvf "146674-Ambiance&Radiance-XfceLXDE-11-10-2.tar.gz"
sudo mv Ambiance-Xfce-LXDE /usr/share/themes/
sudo mv Radiance-Xfce-LXDE /usr/share/themes/
rm "146674-Ambiance&Radiance-XfceLXDE-11-10-2.tar.gz"

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


new script to clear cach with mysql escapes etc.

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/relic7/prodimages.git/'


Added fetchPlugins script

Added fetchPlugins script

#!/bin/sh

OUTFILE="plugins.txt"

ESC_SEQ="\033["
COL_RESET="${ESC_SEQ}0m"
COL_GREEN="${ESC_SEQ}1;32m"
COL_CYAN="${ESC_SEQ}36m"

if [ "$#" -ne 1 ]; then
    script=`basename ${0}`
    echo "Usage: ${script} <user:pass@jenkinshost.example.org>"
    exit 1
fi

list=$(curl -sSL "http://${1}/pluginManager/api/xml?depth=1&xpath=/*/*/shortName|/*/*/version&wrapper=plugins" | perl -pe 's/.*?<shortName>([\w-]+).*?<version>([^<]+)()(<\/\w+>)+/\1 \2\n/g'|sed 's/ /:/' | sort -f)
if [ "$?" -ne 0 ] || [ "$list" == "" ]; then
    exit 1
fi

echo "Retrieved plugins:\n${COL_CYAN}${list}${COL_RESET}\n"

read -p "Overwrite ${OUTFILE}? [y/N] " -n 1 -r
echo
if [[ ${REPLY} =~ ^[Yy]$ ]]
then
    echo "${list}" > plugins.txt
    echo "\n${COL_GREEN}Updated ${OUTFILE}${COL_RESET}\n"
else
    exit 1
fi

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


Add file event trigger script

Add file event trigger script

#!/bin/bash

set -u

# The MIT License (MIT)
#
# Copyright (c) 2015 Kirk Leon Guerrero
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

# Requires inotify-tools
# Example:
# $ file-watch-trigger -e <event> -f <file_to_watch> -tr ./<executable trigger>
# $ file-watch-trigger -e modify -f /tmp/data -t ./cat.sh

usage="
-f      File to watch
-e      Event to monitor
-t      Trigger when event occurs on file
-l      List inotify events
-h      Help
"

if [[ $# == 0 ]]; then
    echo "$usage" >&2
    exit 1
fi

while getopts "f:t:e:lh" opt; do
    case $opt in
        f)
            file_to_watch=$OPTARG
            ;;
        e)
            event=$OPTARG
            ;;
        t)
            trigger=$OPTARG
            ;;
        l)
            inotifywait --help | grep -A50 Events
            exit 1
            ;;
        h)
            echo "$usage" >&2
            exit 1
            ;;
        \?)
            echo "$usage" >&2
            exit 1
            ;;
        :)
            echo "$usage" >&2
            exit 1
            ;;
    esac
done

if [[ "$trigger" != *"/"* ]]; then
    echo "You need to specify the full path to $trigger for execution." >&2
    exit 1
fi

echo "Watching \"$file_to_watch\" for event \"$event\" with trigger \"$trigger\"" >&2
while true; do
    inotifywait -e ${event} $file_to_watch >/dev/null 2>&1 && $trigger
    sleep 1
done

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


added function tpc

added function tpc

tolerance-ping-counter; true ping counter; counts interrupted pings and alerts when tolerance has been met

#!/bin/bash
# 20170302
# Israel Torres
# true ping counter
# tolerance-ping-counter
#
function t_p_c () {
#
counter=0
for x in {1..100}
 do
    ping -c 1 "$domain" \
    | grep -v -i ping \
    | grep "timeout" \
    | grep -v round && counter=$((counter+1)) \
    || counter=0; echo -en "$counter:$x\t";

    if [[ $"counter" -eq "5" ]]
        then
            echo "counter equals 5; $domain \
                has encountered bad result 5 times in a row"
        else
            echo "$domain is OK"
        fi

    sleep 1

 done #for loop
}
#
# --- test case 01 begin ---
# expected input
domain="israeltorres.org"
#
t_p_c "$domain"
# expected output
#0:1	israeltorres.org is OK
#0:2	israeltorres.org is OK
# --- test case 01 end ---
#EOF

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


install script

install script

sed 's/pkill -9 mcad/exit 0\n        pkill -9 mcad/;s/pkill -9 wpa_supplicant/exit 0\n        pkill -9 wpa_supplicant/' /usr/etc/syswrapper.sh > /etc/persistent/syswrapper.sh
chmod 755 /etc/persistent/syswrapper.sh
wget --no-check-certificate https://raw.githubusercontent.com/magcode/mpower-tools/master/rc.poststart -O /etc/persistent/rc.poststart
chmod 755 /etc/persistent/rc.poststart
save

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


doc: fix generate-doc

doc: fix generate-doc

#!/bin/sh
##
## Author(s):
##  - Cedric GESTES <gestes@aldebaran-robotics.com>
##
## Copyright (C) 2010 Aldebaran Robotics
##

set -e

CURDIR=$(dirname "$(readlink -f $0 2>/dev/null)")/

cd ${CURDIR}

python doc/tools/generate_doc_from_cmake.py \
  "cmake/qibuild" \
  "cmake/samples" \
  "build-doc"

PYTHONPATH=. python qibuild/tools/generate_asciidoc.py build-doc/qibuild-manpage.txt

if [ -f /etc/asciidoc/javascripts/asciidoc-xhtml11.js ] ; then
  cp "/etc/asciidoc/javascripts/asciidoc-xhtml11.js" "build-doc"
fi
cp "doc/asciidoc/pygments.css"                     "build-doc"
cp "doc/asciidoc/bare.css"                         "build-doc"
cp "cmake/qibuild/index.txt"                       "build-doc"

find ${CURDIR}/build-doc/ -type f -name '*.txt' | while read f ; do
  #asciidoc is stupid about css...
  #we desactivated default theme, set the stylesheet to bare.css, and disable embedded css
  asciidoc -a toc -a toclevels=1  -a linkcss -a 'theme=' -a stylesheet="bare.css" -a pygments "$f"
done

#!/bin/sh
##
## Author(s):
##  - Cedric GESTES <gestes@aldebaran-robotics.com>
##
## Copyright (C) 2010 Aldebaran Robotics
##

set -e

CURDIR=$(dirname "$(readlink -f $0 2>/dev/null)")/

cd ${CURDIR}

python doc/tools/generate_doc_from_cmake.py \
  "cmake/qibuild" \
  "cmake/samples" \
  "build-doc"

PYTHONPATH=. python qibuild/tools/generate_asciidoc.py > "build-doc/qibuild-manpage.txt"

if [ -f /etc/asciidoc/javascripts/asciidoc-xhtml11.js ] ; then
  cp "/etc/asciidoc/javascripts/asciidoc-xhtml11.js" "build-doc"
fi
cp "doc/asciidoc/pygments.css"                     "build-doc"
cp "doc/asciidoc/bare.css"                         "build-doc"
cp "cmake/qibuild/index.txt"                       "build-doc"

find ${CURDIR}/build-doc/ -type f -name '*.txt' | while read f ; do
  #asciidoc is stupid about css...
  #we desactivated default theme, set the stylesheet to bare.css, and disable embedded css
  asciidoc -a toc -a toclevels=1  -a linkcss -a 'theme=' -a stylesheet="bare.css" -a pygments "$f"
done


Added build script

Added build 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/04n0/goldfish.git/'


Wrote a badass build script to format go files, run unit tests, and try to build the interpreter

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/zsck/UnicornFig.git/'


Add build script

Add build script

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


Add new platform to build.sh: NetBSD

Add new platform to build.sh: NetBSD

#!/usr/bin/env bash

usage()
{
    echo "Usage: $0 [managed] [native] [BuildArch] [BuildType] [clean] [verbose] [clangx.y] [platform]"
    echo "managed - optional argument to build the managed code"
    echo "native - optional argument to build the native code"
    echo "The following arguments affect native builds only:"
    echo "BuildArch can be: x64, arm"
    echo "BuildType can be: Debug, Release"
    echo "clean - optional argument to force a clean build."
    echo "verbose - optional argument to enable verbose build output."
    echo "clangx.y - optional argument to build using clang version x.y."
    echo "platform can be: Windows, Linux, OSX, FreeBSD, NetBSD"

    exit 1
}

setup_dirs()
{
    echo Setting up directories for build

    mkdir -p "$__BinDir"
    mkdir -p "$__IntermediatesDir"
}

# Performs "clean build" type actions (deleting and remaking directories)

clean()
{
    echo "Cleaning previous output for the selected configuration"
    rm -rf "$__BinDir"
    rm -rf "$__IntermediatesDir"
    setup_dirs
}

# Check the system to ensure the right pre-reqs are in place

check_managed_prereqs()
{
    __monoversion=$(mono --version | grep "version 4.[1-9]")

    if [ $? -ne 0 ]; then
        # if built from tarball, mono only identifies itself as 4.0.1
        __monoversion=$(mono --version | egrep "version 4.0.[1-9]+(.[0-9]+)?")
        if [ $? -ne 0 ]; then
            echo "Mono 4.0.1.44 or later is required to build corefx. Please see https://github.com/dotnet/corefx/blob/master/Documentation/building/unix-instructions.md for more details."
            exit 1
        else
            echo "WARNING: Mono 4.0.1.44 or later is required to build corefx. Unable to assess if current version is supported."
        fi
    fi

    if [ ! -e "$__referenceassemblyroot/.NETPortable" ]; then
        echo "PCL reference assemblies not found. Please see https://github.com/dotnet/corefx/blob/master/Documentation/building/unix-instructions.md for more details."
        exit 1
    fi
}

check_native_prereqs()
{
    echo "Checking pre-requisites..."

    # Check presence of CMake on the path
    hash cmake 2>/dev/null || { echo >&2 "Please install cmake before running this script"; exit 1; }

    # Check for clang
    hash clang-$__ClangMajorVersion.$__ClangMinorVersion 2>/dev/null ||  hash clang$__ClangMajorVersion$__ClangMinorVersion 2>/dev/null ||  hash clang 2>/dev/null || { echo >&2 "Please install clang before running this script"; exit 1; }
}

# Prepare the system for building

prepare_managed_build()
{
    # Pull NuGet.exe down if we don't have it already
    if [ ! -e "$__nugetpath" ]; then
        which curl wget > /dev/null 2> /dev/null
        if [ $? -ne 0 -a $? -ne 1 ]; then
            echo "cURL or wget is required to build corefx. Please see https://github.com/dotnet/corefx/blob/master/Documentation/building/unix-instructions.md for more details."
            exit 1
        fi
        echo "Restoring NuGet.exe..."

        # curl has HTTPS CA trust-issues less often than wget, so lets try that first.
        which curl > /dev/null 2> /dev/null
        if [ $? -ne 0 ]; then
           mkdir -p $__packageroot
           wget -q -O $__nugetpath https://api.nuget.org/downloads/nuget.exe
        else
           curl -sSL --create-dirs -o $__nugetpath https://api.nuget.org/downloads/nuget.exe
        fi

        if [ $? -ne 0 ]; then
            echo "Failed to restore NuGet.exe."
            exit 1
        fi
    fi

    # Grab the MSBuild package if we don't have it already
    if [ ! -e "$__msbuildpath" ]; then
        echo "Restoring MSBuild..."
        mono "$__nugetpath" install $__msbuildpackageid -Version $__msbuildpackageversion -source "https://www.myget.org/F/dotnet-buildtools/" -OutputDirectory "$__packageroot"
        if [ $? -ne 0 ]; then
            echo "Failed to restore MSBuild."
            exit 1
        fi
    fi

    # Run Init-Tools to restore BuildTools and ToolRuntime
    chmod a+x $__scriptpath/init-tools.sh
    sh $__scriptpath/init-tools.sh
}

prepare_native_build()
{
    # Specify path to be set for CMAKE_INSTALL_PREFIX.
    # This is where all built CoreClr libraries will copied to.
    export __CMakeBinDir="$__BinDir"

    # Configure environment if we are doing a clean build.
    if [ $__CleanBuild == 1 ]; then
        clean
    fi

    # Configure environment if we are doing a verbose build
    if [ $__VerboseBuild == 1 ]; then
        export VERBOSE=1
    fi
}

build_managed_corefx()
{
    __buildproj=$__scriptpath/build.proj
    __buildlog=$__scriptpath/msbuild.log

    ReferenceAssemblyRoot=$__referenceassemblyroot $__scriptpath/Tools/corerun $__scriptpath/Tools/MSBuild.exe "$__buildproj" /nologo /verbosity:minimal "/fileloggerparameters:Verbosity=normal;LogFile=$__buildlog" /t:Build /p:OSGroup=$__BuildOS /p:COMPUTERNAME=$(hostname) /p:USERNAME=$(id -un) /p:TestNugetRuntimeId=$__TestNugetRuntimeId /p:ToolNugetRuntimeId=$__TestNugetRuntimeId $__UnprocessedBuildArgs
    BUILDERRORLEVEL=$?

    echo

    # Pull the build summary from the log file
    tail -n 4 "$__buildlog"
    echo Build Exit Code = $BUILDERRORLEVEL
}

build_native_corefx()
{
    # All set to commence the build

    echo "Commencing build of corefx native components for $__BuildOS.$__BuildArch.$__BuildType"
    cd "$__IntermediatesDir"

    # Regenerate the CMake solution
    echo "Invoking cmake with arguments: \"$__nativeroot\" $__CMakeArgs"
    "$__nativeroot/gen-buildsys-clang.sh" "$__nativeroot" $__ClangMajorVersion $__ClangMinorVersion $__CMakeArgs

    # Check that the makefiles were created.

    if [ ! -f "$__IntermediatesDir/Makefile" ]; then
        echo "Failed to generate native component build project!"
        exit 1
    fi

    # Get the number of processors available to the scheduler
    # Other techniques such as `nproc` only get the number of
    # processors available to a single process.
    if [ `uname` = "FreeBSD" ]; then
        NumProc=`sysctl hw.ncpu | awk '{ print $2+1 }'`
    elif [ `uname` = "NetBSD" ]; then
        NumProc=$(($(getconf NPROCESSORS_ONLN)+1))
    else
        NumProc=$(($(getconf _NPROCESSORS_ONLN)+1))
    fi

    # Build

    echo "Executing make install -j $NumProc"

    make install -j $NumProc
    if [ $? != 0 ]; then
        echo "Failed to build corefx native components."
        exit 1
    fi

    echo "CoreFX native components successfully built."
    echo "Product binaries are available at $__BinDir"
}

__scriptpath=$(cd "$(dirname "$0")"; pwd -P)
__nativeroot=$__scriptpath/src/Native
__packageroot=$__scriptpath/packages
__sourceroot=$__scriptpath/src
__nugetpath=$__packageroot/NuGet.exe
__nugetconfig=$__sourceroot/NuGet.Config
__rootbinpath="$__scriptpath/bin"
__msbuildpackageid="Microsoft.Build.Mono.Debug"
__msbuildpackageversion="14.1.0.0-prerelease"
__msbuildpath=$__packageroot/$__msbuildpackageid.$__msbuildpackageversion/lib/MSBuild.exe
__BuildArch=x64
__buildmanaged=false
__buildnative=false
__TestNugetRuntimeId=win7-x64

# Use uname to determine what the OS is.
OSName=$(uname -s)
case $OSName in
    Linux)
        __HostOS=Linux
        __TestNugetRuntimeId=ubuntu.14.04-x64
        ;;

    Darwin)
        __HostOS=OSX
        __TestNugetRuntimeId=osx.10.10-x64
        ;;

    FreeBSD)
        __HostOS=FreeBSD
        # TODO: Add native version
        __TestNugetRuntimeId=osx.10.10-x64
        ;;

    NetBSD)
        __HostOS=NetBSD
        # TODO: Add native version
        __TestNugetRuntimeId=osx.10.10-x64
        ;;

    *)
        echo "Unsupported OS $OSName detected, configuring as if for Linux"
        __HostOS=Linux
        __TestNugetRuntimeId=ubuntu.14.04-x64
        ;;
esac
__BuildOS=$__HostOS
__BuildType=Debug
__CMakeArgs=DEBUG

case $__HostOS in
    FreeBSD)
        __monoroot=/usr/local
        ;;
    OSX)
        __monoroot=/Library/Frameworks/Mono.framework/Versions/Current
        ;;
    *)
        __monoroot=/usr
        ;;
esac

__referenceassemblyroot=$__monoroot/lib/mono/xbuild-frameworks
BUILDERRORLEVEL=0

# Set the various build properties here so that CMake and MSBuild can pick them up
__UnprocessedBuildArgs=
__CleanBuild=false
__VerboseBuild=false
__ClangMajorVersion=3
__ClangMinorVersion=5

for i in "$@"
    do
        lowerI="$(echo $i | awk '{print tolower($0)}')"
        case $lowerI in
        -?|-h|--help)
            usage
            exit 1
            ;;
        managed)
            __buildmanaged=true
            ;;
        native)
            __buildnative=true
            ;;
        x64)
            __BuildArch=x64
            __MSBuildBuildArch=x64
            ;;
        arm)
            __BuildArch=arm
            __MSBuildBuildArch=arm
            ;;
        debug)
            __BuildType=Debug
            ;;
        release)
            __BuildType=Release
            __CMakeArgs=RELEASE
            ;;
        clean)
            __CleanBuild=1
            ;;
        verbose)
            __VerboseBuild=1
            ;;
        clang3.5)
            __ClangMajorVersion=3
            __ClangMinorVersion=5
            ;;
        clang3.6)
            __ClangMajorVersion=3
            __ClangMinorVersion=6
            ;;
        clang3.7)
            __ClangMajorVersion=3
            __ClangMinorVersion=7
            ;;
        windows)
            __BuildOS=Windows_NT
            ;;
        linux)
            __BuildOS=Linux
            __TestNugetRuntimeId=ubuntu.14.04-x64
            ;;
        osx)
            __BuildOS=OSX
            __TestNugetRuntimeId=osx.10.10-x64
            ;;
        freebsd)
            __BuildOS=FreeBSD
            ;;
        netbsd)
            __BuildOS=NetBSD
            ;;
        *)
          __UnprocessedBuildArgs="$__UnprocessedBuildArgs $i"
    esac
done

# If neither managed nor native are passed as arguments, default to building both

if [ "$__buildmanaged" = false -a "$__buildnative" = false ]; then
    __buildmanaged=true
    __buildnative=true
fi

# Disable the native build when targeting Windows.

if [ "$__BuildOS" != "$__HostOS" ]; then
    echo "Warning: cross compiling native components is not yet supported"
    __buildnative=false
fi

# Set the remaining variables based upon the determined build configuration
__IntermediatesDir="$__rootbinpath/obj/$__BuildOS.$__BuildArch.$__BuildType/Native"
__BinDir="$__rootbinpath/$__BuildOS.$__BuildArch.$__BuildType/Native"

# Make the directories necessary for build if they don't exist

setup_dirs

if $__buildmanaged; then

    # Check prereqs.

    check_managed_prereqs

    # Prepare the system

    prepare_managed_build

    # Build the corefx native components.

    build_managed_corefx

    # Build complete
fi

# If managed build failed, exit with the status code of the managed build
if [ $BUILDERRORLEVEL != 0 ]; then
    exit $BUILDERRORLEVEL
fi

if $__buildnative; then

    # Check prereqs.

    check_native_prereqs

    # Prepare the system

    prepare_native_build

    # Build the corefx native components.

    build_native_corefx

    # Build complete
fi

exit $BUILDERRORLEVEL

#!/usr/bin/env bash

usage()
{
    echo "Usage: $0 [managed] [native] [BuildArch] [BuildType] [clean] [verbose] [clangx.y] [platform]"
    echo "managed - optional argument to build the managed code"
    echo "native - optional argument to build the native code"
    echo "The following arguments affect native builds only:"
    echo "BuildArch can be: x64, arm"
    echo "BuildType can be: Debug, Release"
    echo "clean - optional argument to force a clean build."
    echo "verbose - optional argument to enable verbose build output."
    echo "clangx.y - optional argument to build using clang version x.y."
    echo "platform can be: Windows, Linux, OSX, FreeBSD"

    exit 1
}

setup_dirs()
{
    echo Setting up directories for build

    mkdir -p "$__BinDir"
    mkdir -p "$__IntermediatesDir"
}

# Performs "clean build" type actions (deleting and remaking directories)

clean()
{
    echo "Cleaning previous output for the selected configuration"
    rm -rf "$__BinDir"
    rm -rf "$__IntermediatesDir"
    setup_dirs
}

# Check the system to ensure the right pre-reqs are in place

check_managed_prereqs()
{
    __monoversion=$(mono --version | grep "version 4.[1-9]")

    if [ $? -ne 0 ]; then
        # if built from tarball, mono only identifies itself as 4.0.1
        __monoversion=$(mono --version | egrep "version 4.0.[1-9]+(.[0-9]+)?")
        if [ $? -ne 0 ]; then
            echo "Mono 4.0.1.44 or later is required to build corefx. Please see https://github.com/dotnet/corefx/blob/master/Documentation/building/unix-instructions.md for more details."
            exit 1
        else
            echo "WARNING: Mono 4.0.1.44 or later is required to build corefx. Unable to assess if current version is supported."
        fi
    fi

    if [ ! -e "$__referenceassemblyroot/.NETPortable" ]; then
        echo "PCL reference assemblies not found. Please see https://github.com/dotnet/corefx/blob/master/Documentation/building/unix-instructions.md for more details."
        exit 1
    fi
}

check_native_prereqs()
{
    echo "Checking pre-requisites..."

    # Check presence of CMake on the path
    hash cmake 2>/dev/null || { echo >&2 "Please install cmake before running this script"; exit 1; }

    # Check for clang
    hash clang-$__ClangMajorVersion.$__ClangMinorVersion 2>/dev/null ||  hash clang$__ClangMajorVersion$__ClangMinorVersion 2>/dev/null ||  hash clang 2>/dev/null || { echo >&2 "Please install clang before running this script"; exit 1; }
}

# Prepare the system for building

prepare_managed_build()
{
    # Pull NuGet.exe down if we don't have it already
    if [ ! -e "$__nugetpath" ]; then
        which curl wget > /dev/null 2> /dev/null
        if [ $? -ne 0 -a $? -ne 1 ]; then
            echo "cURL or wget is required to build corefx. Please see https://github.com/dotnet/corefx/blob/master/Documentation/building/unix-instructions.md for more details."
            exit 1
        fi
        echo "Restoring NuGet.exe..."

        # curl has HTTPS CA trust-issues less often than wget, so lets try that first.
        which curl > /dev/null 2> /dev/null
        if [ $? -ne 0 ]; then
           mkdir -p $__packageroot
           wget -q -O $__nugetpath https://api.nuget.org/downloads/nuget.exe
        else
           curl -sSL --create-dirs -o $__nugetpath https://api.nuget.org/downloads/nuget.exe
        fi

        if [ $? -ne 0 ]; then
            echo "Failed to restore NuGet.exe."
            exit 1
        fi
    fi

    # Grab the MSBuild package if we don't have it already
    if [ ! -e "$__msbuildpath" ]; then
        echo "Restoring MSBuild..."
        mono "$__nugetpath" install $__msbuildpackageid -Version $__msbuildpackageversion -source "https://www.myget.org/F/dotnet-buildtools/" -OutputDirectory "$__packageroot"
        if [ $? -ne 0 ]; then
            echo "Failed to restore MSBuild."
            exit 1
        fi
    fi

    # Run Init-Tools to restore BuildTools and ToolRuntime
    chmod a+x $__scriptpath/init-tools.sh
    sh $__scriptpath/init-tools.sh
}

prepare_native_build()
{
    # Specify path to be set for CMAKE_INSTALL_PREFIX.
    # This is where all built CoreClr libraries will copied to.
    export __CMakeBinDir="$__BinDir"

    # Configure environment if we are doing a clean build.
    if [ $__CleanBuild == 1 ]; then
        clean
    fi

    # Configure environment if we are doing a verbose build
    if [ $__VerboseBuild == 1 ]; then
        export VERBOSE=1
    fi
}

build_managed_corefx()
{
    __buildproj=$__scriptpath/build.proj
    __buildlog=$__scriptpath/msbuild.log

    ReferenceAssemblyRoot=$__referenceassemblyroot $__scriptpath/Tools/corerun $__scriptpath/Tools/MSBuild.exe "$__buildproj" /nologo /verbosity:minimal "/fileloggerparameters:Verbosity=normal;LogFile=$__buildlog" /t:Build /p:OSGroup=$__BuildOS /p:COMPUTERNAME=$(hostname) /p:USERNAME=$(id -un) /p:TestNugetRuntimeId=$__TestNugetRuntimeId /p:ToolNugetRuntimeId=$__TestNugetRuntimeId $__UnprocessedBuildArgs
    BUILDERRORLEVEL=$?

    echo

    # Pull the build summary from the log file
    tail -n 4 "$__buildlog"
    echo Build Exit Code = $BUILDERRORLEVEL
}

build_native_corefx()
{
    # All set to commence the build

    echo "Commencing build of corefx native components for $__BuildOS.$__BuildArch.$__BuildType"
    cd "$__IntermediatesDir"

    # Regenerate the CMake solution
    echo "Invoking cmake with arguments: \"$__nativeroot\" $__CMakeArgs"
    "$__nativeroot/gen-buildsys-clang.sh" "$__nativeroot" $__ClangMajorVersion $__ClangMinorVersion $__CMakeArgs

    # Check that the makefiles were created.

    if [ ! -f "$__IntermediatesDir/Makefile" ]; then
        echo "Failed to generate native component build project!"
        exit 1
    fi

    # Get the number of processors available to the scheduler
    # Other techniques such as `nproc` only get the number of
    # processors available to a single process.
    if [ `uname` = "FreeBSD" ]; then
        NumProc=`sysctl hw.ncpu | awk '{ print $2+1 }'`
    else
        NumProc=$(($(getconf _NPROCESSORS_ONLN)+1))
    fi

    # Build

    echo "Executing make install -j $NumProc"

    make install -j $NumProc
    if [ $? != 0 ]; then
        echo "Failed to build corefx native components."
        exit 1
    fi

    echo "CoreFX native components successfully built."
    echo "Product binaries are available at $__BinDir"
}

__scriptpath=$(cd "$(dirname "$0")"; pwd -P)
__nativeroot=$__scriptpath/src/Native
__packageroot=$__scriptpath/packages
__sourceroot=$__scriptpath/src
__nugetpath=$__packageroot/NuGet.exe
__nugetconfig=$__sourceroot/NuGet.Config
__rootbinpath="$__scriptpath/bin"
__msbuildpackageid="Microsoft.Build.Mono.Debug"
__msbuildpackageversion="14.1.0.0-prerelease"
__msbuildpath=$__packageroot/$__msbuildpackageid.$__msbuildpackageversion/lib/MSBuild.exe
__BuildArch=x64
__buildmanaged=false
__buildnative=false
__TestNugetRuntimeId=win7-x64

# Use uname to determine what the OS is.
OSName=$(uname -s)
case $OSName in
    Linux)
        __HostOS=Linux
        __TestNugetRuntimeId=ubuntu.14.04-x64
        ;;

    Darwin)
        __HostOS=OSX
        __TestNugetRuntimeId=osx.10.10-x64
        ;;

    FreeBSD)
        __HostOS=FreeBSD
        __TestNugetRuntimeId=osx.10.10-x64
        ;;

    *)
        echo "Unsupported OS $OSName detected, configuring as if for Linux"
        __HostOS=Linux
        __TestNugetRuntimeId=ubuntu.14.04-x64
        ;;
esac
__BuildOS=$__HostOS
__BuildType=Debug
__CMakeArgs=DEBUG

case $__HostOS in
    FreeBSD)
        __monoroot=/usr/local
        ;;
    OSX)
        __monoroot=/Library/Frameworks/Mono.framework/Versions/Current
        ;;
    *)
        __monoroot=/usr
        ;;
esac

__referenceassemblyroot=$__monoroot/lib/mono/xbuild-frameworks
BUILDERRORLEVEL=0

# Set the various build properties here so that CMake and MSBuild can pick them up
__UnprocessedBuildArgs=
__CleanBuild=false
__VerboseBuild=false
__ClangMajorVersion=3
__ClangMinorVersion=5

for i in "$@"
    do
        lowerI="$(echo $i | awk '{print tolower($0)}')"
        case $lowerI in
        -?|-h|--help)
            usage
            exit 1
            ;;
        managed)
            __buildmanaged=true
            ;;
        native)
            __buildnative=true
            ;;
        x64)
            __BuildArch=x64
            __MSBuildBuildArch=x64
            ;;
        arm)
            __BuildArch=arm
            __MSBuildBuildArch=arm
            ;;
        debug)
            __BuildType=Debug
            ;;
        release)
            __BuildType=Release
            __CMakeArgs=RELEASE
            ;;
        clean)
            __CleanBuild=1
            ;;
        verbose)
            __VerboseBuild=1
            ;;
        clang3.5)
            __ClangMajorVersion=3
            __ClangMinorVersion=5
            ;;
        clang3.6)
            __ClangMajorVersion=3
            __ClangMinorVersion=6
            ;;
        clang3.7)
            __ClangMajorVersion=3
            __ClangMinorVersion=7
            ;;
        windows)
            __BuildOS=Windows_NT
            ;;
        linux)
            __BuildOS=Linux
            __TestNugetRuntimeId=ubuntu.14.04-x64
            ;;
        osx)
            __BuildOS=OSX
            __TestNugetRuntimeId=osx.10.10-x64
            ;;
        freebsd)
            __BuildOS=FreeBSD
            ;;
        *)
          __UnprocessedBuildArgs="$__UnprocessedBuildArgs $i"
    esac
done

# If neither managed nor native are passed as arguments, default to building both

if [ "$__buildmanaged" = false -a "$__buildnative" = false ]; then
    __buildmanaged=true
    __buildnative=true
fi

# Disable the native build when targeting Windows.

if [ "$__BuildOS" != "$__HostOS" ]; then
    echo "Warning: cross compiling native components is not yet supported"
    __buildnative=false
fi

# Set the remaining variables based upon the determined build configuration
__IntermediatesDir="$__rootbinpath/obj/$__BuildOS.$__BuildArch.$__BuildType/Native"
__BinDir="$__rootbinpath/$__BuildOS.$__BuildArch.$__BuildType/Native"

# Make the directories necessary for build if they don't exist

setup_dirs

if $__buildmanaged; then

    # Check prereqs.

    check_managed_prereqs

    # Prepare the system

    prepare_managed_build

    # Build the corefx native components.

    build_managed_corefx

    # Build complete
fi

# If managed build failed, exit with the status code of the managed build
if [ $BUILDERRORLEVEL != 0 ]; then
    exit $BUILDERRORLEVEL
fi

if $__buildnative; then

    # Check prereqs.

    check_native_prereqs

    # Prepare the system

    prepare_native_build

    # Build the corefx native components.

    build_native_corefx

    # Build complete
fi

exit $BUILDERRORLEVEL


added build script which generates javadoc, builds the source, and gets everything ready

rm -rf reference
cd src
javadoc -d ../reference/ -classpath ../library/oscP5.jar:/Applications/Processing.app/Contents/Java/core/library/core.jar:. -link http://processing.org/reference/javadoc/core/ -link http://www.sojamo.com/libraries/oscP5/reference/oscP5/ skyra.osceleton
cd ../library
javac -source 1.6 -target 1.6 -d . -classpath /Applications/Processing.app/Contents/Java/core/library/core.jar:oscP5.jar ../src/skyra/osceleton/*.java
jar -cf OSCeletonWrapper.jar skyra
rm -rf skyra
cd ..


Save Jenkins build configuration to build.sh

#!/bin/bash

# Version tag template: IMAGE_NAME-YYYY-MM-DD
DATE=$(date +'%F')
REPO=resin/rpi-raspbian:wheezy

# Create temp image before squashing
docker build --tag $REPO-temp .

docker run -t -i --name=temp $REPO-temp echo
docker export temp | docker import - $REPO

# Remove temp image
docker rmi -f $REPO-temp

docker tag $REPO $REPO-$DATE

# Push the images
docker push $REPO
docker push $REPO-$DATE


Create build.sh

Create build.sh

#!/bin/bash
grails clean && grails $UPGRADE --non-interactive && grails test-app unit: --non-interactive --stacktrace


Added remote control example script

Added remote control example script

#!/bin/sh

echocmd="/bin/echo -n"
ctlfile="$HOME/.config/pianobar/ctl"

# pianobar running? echo would block otherwise
ps -C 'pianobar' > /dev/null

if [ $? -ne 0 ]; then
	echo 'naughty.notify({title = "pianobar", text = "Not running"})' | awesome-client -
	exit 1;
fi

case "$1" in
	pp)
		$echocmd p > $ctlfile
		;;
	next)
		$echocmd n > $ctlfile
		;;
	love)
		$echocmd + > $ctlfile
		;;
	ban)
		$echocmd - > $ctlfile
		;;
esac

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


added

added

#!/bin/bash

#set -x

oasis setup
ocaml setup.ml -configure
ocaml setup.ml -build
#ocaml setup.ml -install


Initial commit of build script

Initial commit of build script

#!/bin/bash -e
#SOURCE_FILE=$NAME-$VERSION.tar.gz
# We will build the code from the github repo, but if we want specific versions,
# a new Jenkins job will be created for the version number and we'll provide
# the URL to the tarball in the configuration.
SOURCE_REPO="https://github.com/QEF/q-e.git"
# We pretend that the $SOURCE_FILE is there, even though it's actually a dir.
SOURCE_FILE=$NAME
module load ci

echo "REPO_DIR is "
echo $REPO_DIR
echo "SRC_DIR is "
echo $SRC_DIR
echo "WORKSPACE is "
echo $WORKSPACE
echo "SOFT_DIR is"
echo $SOFT_DIR

mkdir -p $WORKSPACE
mkdir -p $SRC_DIR
mkdir -p $SOFT_DIR

#  Download the source file

if [[ ! -e $SRC_DIR/$SOURCE_FILE ]] ; then
  echo "seems like this is the first build - doing a git clone  https://github.com/QEF/q-e.git $SRC_DIR/$SOURCE_FILE"
  mkdir -p $SRC_DIR
  git clone https://github.com/QEF/q-e.git $SRC_DIR/$SOURCE_FILE
else
  echo "continuing from previous builds, using source at " $SRC_DIR/$SOURCE_FILE
  cd $SRC_DIR/$SOURCE_FILE
  echo "Doing a git pull..."
  git pull
fi
# this is the equivalent of a git pull :
# tar -xvzf $SRC_DIR/$SOURCE_FILE -C $WORKSPACE
cd $WORKSPACE/$NAME-$VERSION
echo "Configuring the build"
./configure --prefix $SOFT_DIR
echo "Running the build"
make -j 8


Reverting change on build.sh

Reverting change on build.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/OnCircle/vpaid-wrapper.git/'


adding build script to package and extract JS files from parent project

#!/bin/bash

# updates the JS from the master branch by building the demo package
git clone https://github.com/cometd/cometd.git
cd cometd
mvn package -pl cometd-demo -am -Dmaven.test.skip=true && \
cp -Rv cometd-javascript/common/target/cometd-javascript-common-*/org . && \
cd ..
rm -rf cometd
git status


Fixed identify command

Fixed identify command

#!/bin/bash
. config.ini
[ "$(hostname)" != "$desktop" ] && echo "Must be run on $desktop" 1>&2 && exit 1

shopt -s nocasematch
remote_root_dir="/home/$user/img/"
transit_root_dir="/cygdrive/z/hub/img/"
dst_root_dir="/cygdrive/z/img/net/"
min_width=500
min_height=500
min_size=$[$min_width*$min_height]

#download the images
rsync -avz --remove-source-files "$user@$server_addr:$remote_root_dir" "$transit_root_dir"

#distribute the images
find "$transit_root_dir" -type f -print0|while read -d '' -r src_file; do
	echo -n "$src_file "

	#check image size
	if [[ "$src_file" =~ .*\.(jpg|png) ]]; then
		read format dimensions < <(identify -format '%r %w*%h' "$src_file" 2>/dev/null)
		if [ $? -eq 0 ]; then
			size=$(echo "$dimensions"|bc)
			if [[ "$format" == "DirectClassGrayMatte" ]]; then
				convert "$src_file" -type TrueColorMatte png32:"$src_file"
				echo -n "converted; ";
			fi
			if [[ "$size" -lt "$min_size" ]]; then
				echo "$dimensions < $min_width*$min_height"
				rm "$src_file"
				continue
			fi
		fi
	fi

	dst_file="$dst_root_dir${src_file##$transit_root_dir}"
	dst_file="$(echo $dst_file|sed -e 's/[^/]*\.2chan\.net/2chan/;s/images\.4chan\.org/4chan/;s/\/src//')"
	dst_dir="$(dirname "$dst_file")"
	mkdir -p "$dst_dir"
	mv "$src_file" "$dst_file" && echo 'ok'
done

#remove empty directores
find "$transit_root_dir"/* -depth -type d -exec rmdir --ignore-fail-on-non-empty "{}" \;
ssh "$user@$server" "bash -c 'find \"$remote_root_dir\"/* -depth -type d -exec rmdir --ignore-fail-on-non-empty \"{}\" \;'"

#!/bin/bash
. config.ini
[ "$(hostname)" != "$desktop" ] && echo "Must be run on $desktop" 1>&2 && exit 1

shopt -s nocasematch
remote_root_dir="/home/$user/img/"
transit_root_dir="/cygdrive/z/hub/img/"
dst_root_dir="/cygdrive/z/img/net/"
min_width=500
min_height=500
min_size=$[$min_width*$min_height]

#download the images
rsync -avz --remove-source-files "$user@$server_addr:$remote_root_dir" "$transit_root_dir"

#distribute the images
find "$transit_root_dir" -type f -print0|while read -d '' -r src_file; do
	echo -n "$src_file "

	#check image size
	if [[ "$src_file" =~ .*\.(jpg|png) ]]; then
		read format dimensions <<<$(identify -format '%r %w*%h' "$src_file" 2>/dev/nll)
		if [ $? -eq 0 ]; then
			size=$(echo "$dimensions"|bc)
			if [[ "$format" == "DirectClassGrayMatte" ]]; then
				convert "$src_file" -type TrueColorMatte png32:"$src_file"
				echo -n "converted; ";
			fi
			if [[ "$size" -lt "$min_size" ]]; then
				echo "$dimensions < $min_width*$min_height"
				rm "$src_file"
				continue
			fi
		fi
	fi

	dst_file="$dst_root_dir${src_file##$transit_root_dir}"
	dst_file="$(echo $dst_file|sed -e 's/[^/]*\.2chan\.net/2chan/;s/images\.4chan\.org/4chan/;s/\/src//')"
	dst_dir="$(dirname "$dst_file")"
	mkdir -p "$dst_dir"
	mv "$src_file" "$dst_file" && echo 'ok'
done

#remove empty directores
find "$transit_root_dir"/* -depth -type d -exec rmdir --ignore-fail-on-non-empty "{}" \;
ssh "$user@$server" "bash -c 'find \"$remote_root_dir\"/* -depth -type d -exec rmdir --ignore-fail-on-non-empty \"{}\" \;'"


Adding back build.sh script

Adding back build.sh script

### Copyright (c) 2016, University of Florida Research Foundation, Inc. ###
### For more information please refer to the LICENSE.md file            ###

# Get directory where build.sh is located (this file)
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# Compile gorods.o, build libgorods.a with iRods C API
(cd $DIR/src/github.com/jjacquay712/GoRods/lib; gcc -c -fPIC wrapper.c -o build/gorods.o -I./include -I./irods/lib/core/include -I./irods/lib/api/include -I./irods/lib/md5/include -I./irods/lib/sha1/include -I./irods/server/core/include -I./irods/server/icat/include -I./irods/server/drivers/include -I./irods/server/re/include; cd build; ar rcs libgorods.a *.o)

# Replace 'tester' with your application's own package name
go install github.com/jjacquay712/GoRods && go install tester && bin/tester


added maven build script

added maven build script

#!/bin/bash
# ZooPhy Services build using Maven 3.x
mvn clean package


Add script to run mypy on workbench.

Add script to run mypy on workbench.

#!/bin/bash
if [ "${BUILDER_TOP_DIR}" = "" ]
then
    BUILDER_TOP_DIR=$( cd ../..; pwd )
fi

SCMPYTHONPATH=${BUILDER_TOP_DIR}/Source/Scm:${BUILDER_TOP_DIR}/Source/Git:${BUILDER_TOP_DIR}/Source/Hg:${BUILDER_TOP_DIR}/Source/Svn:${BUILDER_TOP_DIR}/Source/Common

# for override libraries
OVERRIDE_PYTHONPATH_1=~/wc/git/GitPython
OVERRIDE_PYTHONPATH_2=~/wc/hg/hglib-setprotocol-patch
OVERRIDE_PYTHONPATH_2=~/wc/hg/hglib-prompt-patch

export MYPYPATH=/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages

for PART in ${BUILDER_TOP_DIR}/Source/typelib "${SCMPYTHONPATH}" "${OVERRIDE_PYTHONPATH_1}" "${OVERRIDE_PYTHONPATH_2}"
do
    if [ "${PART}" != "" ]
    then
        if [ "${MYPYPATH}" = "" ]
        then
            export MYPYPATH="${PART}"
        else
            export MYPYPATH="${PART}:${MYPYPATH}"
        fi
    fi
done

PYTHON=${PYTHON:-python3}
PYTHON=$( which ${PYTHON} )

${PYTHON} -m mypy wb_scm_main.py | tee mypy.log
echo "Info: log file mypy.log ($( wc -l <mypy.log ))"

error: pathspec 'Source/Scm/wb-mypy.sh' did not match any file(s) known to git


Added what seems to be another dependency issue to OpenMM docs building.

#!/bin/bash

CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=$PREFIX"

if [[ "$OSTYPE" == "linux-gnu" ]]; then
    # setting the rpath so that libOpenMMPME.so finds the right libfftw3
    CMAKE_FLAGS+=" -DCMAKE_INSTALL_RPATH=.."
    CMAKE_FLAGS+=" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++"
    CMAKE_FLAGS+=" -DOPENCL_INCLUDE_DIR=/usr/local/cuda-6.5/include" # CUDA 6.5
    CMAKE_FLAGS+=" -DOPENCL_LIBRARY=/usr/local/cuda-6.5/lib64/libOpenCL.so" # CUDA 6.5
    CMAKE_FLAGS+=" -DCUDA_CUDART_LIBRARY=/usr/local/cuda-6.5/lib64/libcudart.so"
    CMAKE_FLAGS+=" -DCUDA_NVCC_EXECUTABLE=/usr/local/cuda-6.5/bin/nvcc"
    CMAKE_FLAGS+=" -DCUDA_TOOLKIT_INCLUDE=/usr/local/cuda-6.5/include"
    CMAKE_FLAGS+=" -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-6.5"
elif [[ "$OSTYPE" == "darwin"* ]]; then
    CMAKE_FLAGS+=" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++"
    CMAKE_FLAGS+=" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9"
    CMAKE_FLAGS+=" -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk"
    CMAKE_FLAGS+=" -DOPENMM_BUILD_OPENCL_LIB=OFF -DOPENMM_BUILD_DRUDE_OPENCL_LIB=OFF -DOPENMM_BUILD_RPMD_OPENCL_LIB=OFF -DOPENMM_BUILD_OPENCL_TESTS=FALSE -DOPENMM_BUILD_OPENCL_DOUBLE_PRECISION_TESTS=FALSE" # Don't build OpenCL on OS X
fi

# Set location for FFTW3 on both linux and mac
CMAKE_FLAGS+=" -DFFTW_INCLUDES=$PREFIX/include"
if [[ "$OSTYPE" == "linux-gnu" ]]; then
    CMAKE_FLAGS+=" -DFFTW_LIBRARY=$PREFIX/lib/libfftw3f.so"
    CMAKE_FLAGS+=" -DFFTW_THREADS_LIBRARY=$PREFIX/lib/libfftw3f_threads.so"
elif [[ "$OSTYPE" == "darwin"* ]]; then
    CMAKE_FLAGS+=" -DFFTW_LIBRARY=$PREFIX/lib/libfftw3f.dylib"
    CMAKE_FLAGS+=" -DFFTW_THREADS_LIBRARY=$PREFIX/lib/libfftw3f_threads.dylib"
fi

# TODO: What do we do about other dependencies, such as pdflatex and doxygen?
if [[ "$OSTYPE" == "linux-gnu" ]]; then
    export PATH=${PATH}
elif [[ "$OSTYPE" == "darwin"* ]]; then
    # LaTeX
    export PATH=${PATH}:/usr/texbin/
fi

# Install dependencies for building docs.
pip install ordereddict sphinxcontrib-bibtex

# Build in subdirectory.
mkdir build
cd build
cmake .. $CMAKE_FLAGS
make -j16 all DoxygenApiDocs sphinxpdf # build docs as well
make install

# Run C tests.
# Exclude OpenCL tests because @peastman suspects mesa on travis implementation is broken.
# @jchodera and @pgrinaway suspect travis is working, but AMD OpenCL tests are actually failing due to a bug.
#ctest -j2 -V -E "[A-Za-z]+OpenCL[A-Za-z]+"

# Install Python wrappers.
export OPENMM_INCLUDE_PATH=$PREFIX/include
export OPENMM_LIB_PATH=$PREFIX/lib
cd python
$PYTHON setup.py install
cd ..

# Remove one random file
#rm $PREFIX/bin/TestReferenceHarmonicBondForce

# Copy all tests to bin directory so they will be distributed with install package.
#cp `find . -name "Test*" -type f -maxdepth 1` $PREFIX/bin

#!/bin/bash

CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=$PREFIX"

if [[ "$OSTYPE" == "linux-gnu" ]]; then
    # setting the rpath so that libOpenMMPME.so finds the right libfftw3
    CMAKE_FLAGS+=" -DCMAKE_INSTALL_RPATH=.."
    CMAKE_FLAGS+=" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++"
    CMAKE_FLAGS+=" -DOPENCL_INCLUDE_DIR=/usr/local/cuda-6.5/include" # CUDA 6.5
    CMAKE_FLAGS+=" -DOPENCL_LIBRARY=/usr/local/cuda-6.5/lib64/libOpenCL.so" # CUDA 6.5
    CMAKE_FLAGS+=" -DCUDA_CUDART_LIBRARY=/usr/local/cuda-6.5/lib64/libcudart.so"
    CMAKE_FLAGS+=" -DCUDA_NVCC_EXECUTABLE=/usr/local/cuda-6.5/bin/nvcc"
    CMAKE_FLAGS+=" -DCUDA_TOOLKIT_INCLUDE=/usr/local/cuda-6.5/include"
    CMAKE_FLAGS+=" -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-6.5"
elif [[ "$OSTYPE" == "darwin"* ]]; then
    CMAKE_FLAGS+=" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++"
    CMAKE_FLAGS+=" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9"
    CMAKE_FLAGS+=" -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk"
    CMAKE_FLAGS+=" -DOPENMM_BUILD_OPENCL_LIB=OFF -DOPENMM_BUILD_DRUDE_OPENCL_LIB=OFF -DOPENMM_BUILD_RPMD_OPENCL_LIB=OFF -DOPENMM_BUILD_OPENCL_TESTS=FALSE -DOPENMM_BUILD_OPENCL_DOUBLE_PRECISION_TESTS=FALSE" # Don't build OpenCL on OS X
fi

# Set location for FFTW3 on both linux and mac
CMAKE_FLAGS+=" -DFFTW_INCLUDES=$PREFIX/include"
if [[ "$OSTYPE" == "linux-gnu" ]]; then
    CMAKE_FLAGS+=" -DFFTW_LIBRARY=$PREFIX/lib/libfftw3f.so"
    CMAKE_FLAGS+=" -DFFTW_THREADS_LIBRARY=$PREFIX/lib/libfftw3f_threads.so"
elif [[ "$OSTYPE" == "darwin"* ]]; then
    CMAKE_FLAGS+=" -DFFTW_LIBRARY=$PREFIX/lib/libfftw3f.dylib"
    CMAKE_FLAGS+=" -DFFTW_THREADS_LIBRARY=$PREFIX/lib/libfftw3f_threads.dylib"
fi

# TODO: What do we do about other dependencies, such as pdflatex and doxygen?
if [[ "$OSTYPE" == "linux-gnu" ]]; then
    export PATH=${PATH}
elif [[ "$OSTYPE" == "darwin"* ]]; then
    # LaTeX
    export PATH=${PATH}:/usr/texbin/
fi

# Install dependencies for building docs.
pip install sphinxcontrib-bibtex

# Build in subdirectory.
mkdir build
cd build
cmake .. $CMAKE_FLAGS
make -j16 all DoxygenApiDocs sphinxpdf # build docs as well
make install

# Run C tests.
# Exclude OpenCL tests because @peastman suspects mesa on travis implementation is broken.
# @jchodera and @pgrinaway suspect travis is working, but AMD OpenCL tests are actually failing due to a bug.
#ctest -j2 -V -E "[A-Za-z]+OpenCL[A-Za-z]+"

# Install Python wrappers.
export OPENMM_INCLUDE_PATH=$PREFIX/include
export OPENMM_LIB_PATH=$PREFIX/lib
cd python
$PYTHON setup.py install
cd ..

# Remove one random file
#rm $PREFIX/bin/TestReferenceHarmonicBondForce

# Copy all tests to bin directory so they will be distributed with install package.
#cp `find . -name "Test*" -type f -maxdepth 1` $PREFIX/bin