CHANGELOG のコミットメッセージ作成時にその旨をコメント表示するようにした

これで今何をやっているかが分かりやすくなるだろう。

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/yuta-masano/dp.git/'


Installs cript for bigfoot platform

Installs cript for bigfoot platform

Change-Id: I2e7818cfba512c75731eaaf92699953a6093c2a3

#!/bin/bash

source /opt/savanna-venv/bin/activate

python /opt/savanna/setup.py install

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


db backup shell script

db backup shell script

(dependents s3cmd, configured with `docker` user)

#!/usr/bin/env bash

BUCKET_NAME=$1

TIMESTAMP=$(date +%F_%T | tr ':' '-')
TEMP_FILE=$(mktemp tmp.XXXXXXXXXX)
S3_FILE="s3://$BUCKET_NAME/postgres/$TIMESTAMP.sql"

docker-compose exec db pg_dumpall -l postgres -U postgres > $TEMP_FILE
s3cmd put $TEMP_FILE $S3_FILE
rm "$TEMP_FILE"

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


adding lock screen command

adding lock screen command

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


swig checksum kept broken

swig checksum kept broken

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/mhsieh/pitchfork.git/'


This is covered better in the docs now.

This is covered better in the docs now.

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/danfuzz/blur.git/'


新規追加：chromeのカスタマイズ用ソースを/home/chromium/chrome_rootにコピーするスクリプト

#!/bin/bash

# chrome本体(chromeos-base/chromeos-chrome)のソースを/home/chromium/chrome_root配下にコピーする。
# cros_workonしたchromeos-chromeは固定で~/chrome_root配下のソースをビルドする要になっている。
chrome_root=/home/chromium/chrome_root
if [ ! -e /home/chromium/chrome_root ]; then
  mkdir ${chrome_root}
fi
cd /var/cache/chromeos-cache/distfiles/target/chrome-src
tar cvf - . | (cd ${chrome_root}; tar xf -)

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


Extend the default timeout for killing apps and allow it to be controlled via
  an environment variable.

DELTA=8  (6 added, 0 deleted, 2 changed)

git-svn-id: 741c308154f1e22deafec9707230e8b816ec4ca6@636 7dc7ac4e-7543-0410-b95c-c1676fc8e2a3

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/chao787/GTM-mirror.git/'


Add test env boostrap script.

Add test env boostrap script.

#!/bin/bash

# Start vms
vagrant up

# Start k8s cluster
vagrant ssh kube-master -c "sudo /vagrant/bin/start_master.sh"
vagrant ssh kube-slave01 -c "sudo /vagrant/bin/start_agent.sh"
vagrant ssh kube-slave02 -c "sudo /vagrant/bin/start_agent.sh"

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


install scope manully

install scope manully

#!/bin/sh

sudo curl -L git.io/scope -o /usr/local/bin/scope
sudo chmod a+x /usr/local/bin/scope
scope launch u1604s-k8s-master u1604s-client1 u1604s-client2 u1604s-client3

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


Bash test script to test compression then decompression

It runs compression and decompression on a file, and verifies that the
the decompressed file is the same as the original.

#!/bin/bash

TEMPDIR=""
INFILE=""

on_err() {
    echo "Error $INFILE"
}

on_exit() {
    if [ -n $TEMPDIR ]; then
        rm -Rf $TEMPDIR
    fi
}

trap "on_err" ERR
trap "on_exit" EXIT

INFILE="$1"
#echo "$INFILE"
TEMPDIR=$(mktemp -d /tmp/test-lzsXXXXXXXX)
#echo "    $TEMPDIR"

lzs-compress "$1" "$TEMPDIR/file.lzs"
lzs-decompress "$TEMPDIR/file.lzs" "$TEMPDIR/file.lzs.out"

cmp -s "$1" "$TEMPDIR/file.lzs.out"

error: pathspec 'c/src/test/test-lzs.sh' did not match any file(s) known to git


Add xls_to_csv.sh script (requires xls2csv tool)

#!/bin/bash

# Check if 'xls2csv' is installed
type xls2csv >/dev/null 2>&1 || \
    { echo >&2 "Install 'xls2csv', good sir, and then we'll continue our discussion."; exit 1; }

# Remove lots of repeated commas, leave only two from each group
xls2csv $1 | perl -pe 's/,,+/,,/g'

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


- import localisation

- import localisation

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/grimneko/iroffer-modDinoex.git/'


Add user-data script

Add user-data script

#!/bin/bash

source /root/import-tags.sh

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


build: get version from /etc/openwrt_release if applicable

git-svn-id: f7818b41aa164576329f806d7c3827e8a55298bb@6016 ab181a69-ba2e-0410-a84d-ff88ab4c47bc

#!/bin/sh

local variant

if [ "${4%%/*}" = "branches" ]; then
	variant="LuCI ${4##*[-/]} Branch"
elif [ "${4%%/*}" = "tags" ]; then
	variant="LuCI ${4##*[-/]} Release"
else
	variant="LuCI Trunk"
fi

cat <<EOF > $1
local pcall, dofile, _G = pcall, dofile, _G

module "luci.version"

if pcall(dofile, "/etc/openwrt_release") and _G.DISTRIB_DESCRIPTION then
	distname    = ""
	distversion = _G.DISTRIB_DESCRIPTION
else
	distname    = "${2:-OpenWrt}"
	distversion = "${3:-Development Snapshot}"
end

luciname    = "$variant"
luciversion = "${5:-svn}"
EOF

#!/bin/sh

local variant

if [ "${4%%/*}" = "branches" ]; then
	variant="LuCI ${4##*[-/]} Branch"
elif [ "${4%%/*}" = "tags" ]; then
	variant="LuCI ${4##*[-/]} Release"
else
	variant="LuCI Trunk"
fi

cat <<EOF > $1
module "luci.version"

distname    = "${2:-OpenWrt}"
distversion = "${3:-Development Snapshot}"

luciname    = "$variant"
luciversion = "${5:-svn}"
EOF


lib.bash: display prefix in messages dynamically

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/grawity/hacks.git/'


Installer fix

Installer 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/Like-all/btce-mobile.git/'


Create star.sh

Create star.sh

#!/bin/bash

# Add the modules needed for the analysis
module add STAR/2.4.2
module add SAMtools

# Set variables
FILENAME=$1
myDIR=$2
mySCRIPTDIR=$3
myGENOMEDIR="/RQexec/johnsonr/Homo_sapiens/UCSC/hg19/Sequence/Chromosomes"

# Start the count variable from 0
count=0

#------------------------------------------------------------------------------
## Run once after you can comment the line or remove it from your script ##
#------------------------------------------------------------------------------
# Go to the STAR directory
# cd "${myGENOMEDIR}"

# Build a STAR genome index into the Chromosomes folder
# STAR  --runMode genomeGenerate --genomeDir ./ --genomeFastaFiles hg19.fa --runThreadN 4 --sjdbGTFfile /RQexec/johnsonr/Homo_sapiens/UCSC/hg19/Annotation/Genes/genes.gtf  --sjdbOverhang 10

#------------------------------------------------------------------------------
## Run from here for all samples
#------------------------------------------------------------------------------
# Go to the directory with your scripts
cd "${mySCRIPTDIR}"

while read mySAMPLE
        do
                let count++
                echo "$count $mySAMPLE"

                # Go to the STAR directory where the results will be stored
                # mkdir $SCRATCH/STAR # command to create folder if not already done
                cd $SCRATCH/STAR

                # Create the folder to store the STAR results
                mkdir "${mySAMPLE}"_STAR
                cd "${mySAMPLE}"_STAR

                # Align the RNAseq reads to the genome with STAR
                STAR --genomeDir "${myGENOMEDIR}"  --quantMode GeneCounts --runThreadN 4 --readFilesIn "${myDIR}"/"${mySAMPLE}"*1.f*q.gz "${myDIR}"/"${mySAMPLE}"*2.f*q.gz --readFilesCommand zcat --outFileNamePrefix "${mySAMPLE}"

done < $FILENAME

echo -e "\nTotal $count lines read"

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


add sonar shell

add sonar 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/sunjiesh/wechat.git/'


[Fix #128] Ignore README files in $fpath

#
# Defines helper functions.
#
# Authors:
#   Sorin Ionescu <sorin.ionescu@gmail.com>
#

# Checks boolean variable for "true".
# Case insensitive: "1", "y", "yes", "t", "true", "o", and "on".
function is-true {
  [[ -n "$1" && "$1" == (1|[Yy]([Ee][Ss]|)|[Tt]([Rr][Uu][Ee]|)|[Oo]([Nn]|)) ]]
}

# Prints the first non-empty string in the arguments array.
function coalesce {
  for arg in $argv; do
    print "$arg"
    return 0
  done
  return 1
}

# Checks if a file can be autoloaded by trying to load it in a subshell.
function autoloadable {
  ( unfunction $1 ; autoload -U +X $1 ) &> /dev/null
}

# Loads Oh My Zsh modules.
function omodload {
  local omodule

  # Extended globbing is needed for autoloading of module functions.
  setopt EXTENDED_GLOB

  # Add functions to fpath.
  fpath=(${argv:+${OMZ}/modules/${^argv}/functions(/FN)} $fpath)

  # Load Oh My Zsh functions.
  for ofunction in $OMZ/modules/${^argv}/functions/^([_.]*|prompt_*_setup|README*)(.N:t); do
    autoload -Uz "$ofunction"
  done
  unset ofunction

  # Extended globbing is no longer needed.
  unsetopt EXTENDED_GLOB

  for omodule in "$argv[@]"; do
    if zstyle -t ":omz:module:$omodule" loaded; then
      continue
    elif [[ ! -d "$OMZ/modules/$omodule" ]]; then
      print "$0: no such module: $omodule" >&2
      continue
    else
      if [[ -f "$OMZ/modules/$omodule/init.zsh" ]]; then
        source "$OMZ/modules/$omodule/init.zsh"
      fi

      if (( $? == 0 )); then
        zstyle ":omz:module:$omodule" loaded 'yes'
      else
        zstyle ":omz:module:$omodule" loaded 'no'
      fi
    fi
  done
}

#
# Defines helper functions.
#
# Authors:
#   Sorin Ionescu <sorin.ionescu@gmail.com>
#

# Checks boolean variable for "true".
# Case insensitive: "1", "y", "yes", "t", "true", "o", and "on".
function is-true {
  [[ -n "$1" && "$1" == (1|[Yy]([Ee][Ss]|)|[Tt]([Rr][Uu][Ee]|)|[Oo]([Nn]|)) ]]
}

# Prints the first non-empty string in the arguments array.
function coalesce {
  for arg in $argv; do
    print "$arg"
    return 0
  done
  return 1
}

# Checks if a file can be autoloaded by trying to load it in a subshell.
function autoloadable {
  ( unfunction $1 ; autoload -U +X $1 ) &> /dev/null
}

# Loads Oh My Zsh modules.
function omodload {
  local omodule

  # Extended globbing is needed for autoloading of module functions.
  setopt EXTENDED_GLOB

  # Add functions to fpath.
  fpath=(${argv:+${OMZ}/modules/${^argv}/functions(/FN)} $fpath)

  # Load Oh My Zsh functions.
  for ofunction in $OMZ/modules/${^argv}/functions/^([_.]*|prompt_*_setup)(.N:t); do
    autoload -Uz "$ofunction"
  done
  unset ofunction

  # Extended globbing is no longer needed.
  unsetopt EXTENDED_GLOB

  for omodule in "$argv[@]"; do
    if zstyle -t ":omz:module:$omodule" loaded; then
      continue
    elif [[ ! -d "$OMZ/modules/$omodule" ]]; then
      print "$0: no such module: $omodule" >&2
      continue
    else
      if [[ -f "$OMZ/modules/$omodule/init.zsh" ]]; then
        source "$OMZ/modules/$omodule/init.zsh"
      fi

      if (( $? == 0 )); then
        zstyle ":omz:module:$omodule" loaded 'yes'
      else
        zstyle ":omz:module:$omodule" loaded 'no'
      fi
    fi
  done
}


Adding a nocorrect for the heroku command as it was getting triggered by heroku logs.

setopt correct_all

alias man='nocorrect man'
alias mv='nocorrect mv'
alias mysql='nocorrect mysql'
alias mkdir='nocorrect mkdir'
alias gist='nocorrect gist'
alias heroku='nocorrect heroku'


angstrom feed uploader: blacklist less packages

#!/bin/sh
# MIT Licensed
# Initial version by Graeme 'XorA' Gregory, Further changes by Koen Kooi

# Run this from inside ${DEPLOY_DIR} e.g. tmp/deploy/glibc/

# Angstrom webserver
REMOTEM=angstrom@linuxtogo.org

# Feed dir we want to upload to
REMOTED=website/feeds/unstable/ipk/$(basename $PWD)

# create upload dir
mkdir -p upload-queue || true

# Find and delete morgue dirs, we don't need them
echo "Deleting morgue directories"
find ipk/ -name "morgue" -exec rm -rf \{\} \;

# Copy symlink packages to an upload queue
echo "Symlink packages to upload queue"
find ipk/ -name "*.ipk" -exec ln -sf ${PWD}/\{\} upload-queue/ \;

# Find file already present on webserver
echo "Getting file list from server"
scp -C $REMOTEM:$REMOTED/unsorted/files-sorted files-remote
ls upload-queue/ | grep -v morgue > files-local

# Check for files already present on webserver
echo "Checking for duplicates"
cat files-remote files-local | sort | uniq -u >files-uniq
cat files-uniq files-local | sort | uniq -d > files-trans

rm -f upload-queue/bigbuck*

# Copy over non-duplicate files
echo "Starting rsync..."
rsync -vz --partial --copy-links --progress --files-from=files-trans upload-queue/ $REMOTEM:$REMOTED/unsorted/

# Clean up temporary files
echo "Removing upload queue"
rm -rf files-remote files-local files-uniq files-trans upload-queue

#!/bin/sh
# MIT Licensed
# Initial version by Graeme 'XorA' Gregory, Further changes by Koen Kooi

# Run this from inside ${DEPLOY_DIR} e.g. tmp/deploy/glibc/

# Angstrom webserver
REMOTEM=angstrom@linuxtogo.org

# Feed dir we want to upload to
REMOTED=website/feeds/unstable/ipk/$(basename $PWD)

# create upload dir
mkdir -p upload-queue || true

# Find and delete morgue dirs, we don't need them
echo "Deleting morgue directories"
find ipk/ -name "morgue" -exec rm -rf \{\} \;

# Copy symlink packages to an upload queue
echo "Symlink packages to upload queue"
find ipk/ -name "*.ipk" -exec ln -sf ${PWD}/\{\} upload-queue/ \;

# Find file already present on webserver
echo "Getting file list from server"
scp -C $REMOTEM:$REMOTED/unsorted/files-sorted files-remote
ls upload-queue/ | grep -v morgue > files-local

# Check for files already present on webserver
echo "Checking for duplicates"
cat files-remote files-local | sort | uniq -u >files-uniq
cat files-uniq files-local | sort | uniq -d > files-trans

# Remove SGX files
rm -f upload-queue/bigbuck* upload-queue/*libgles* upload-queue/*kdrive*sgx* upload-queue/*3.00.*

# Copy over non-duplicate files
echo "Starting rsync..."
rsync -vz --partial --copy-links --progress --files-from=files-trans upload-queue/ $REMOTEM:$REMOTED/unsorted/

# Clean up temporary files
echo "Removing upload queue"
rm -rf files-remote files-local files-uniq files-trans upload-queue


Create ardulink-proxy.sh Bash shell script

Defines ARDUlink Network Proxy Server as a Service in Linux. It can be started automatically on boot.

TODO Version points to 2.0.1 because it is currently latest working one.

#!/bin/sh
### BEGIN INIT INFO
# Provides:          ardulink-proxy
# Required-Start:    $local_fs $syslog $network
# Required-Stop:     $local_fs $syslog $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# X-Interactive:     false
# Short-Description: ARDUlink Network Proxy Server
# Description:       ARDUlink Network Proxy Server runs in Java Virtual Machine and proxies ARDUlink Arduino connection. Default port is 4478.
#	To install this service (daemon) on Debian or Ubuntu follow these steps...
#	1. Login as root                su (Debian) sudo su (Ubuntu)
#	2. Install prerequisites        apt-get install unzip default-jre-headless librxtx-java
#	3. Download desired version     wget http://arduinopclink.altervista.org/wp-content/uploads/<...>/ardulink-V<...>.zip
#	4. Unzip it to /var             unzip ardulink-v<...>.zip -d /var
#	5. Fix APP_VERSION in file nano /var/ardulink/bin/ardulink-proxy.sh
#	5. Make this executable         chmod +x /var/ardulink/bin/ardulink-proxy.sh
#	6. Link it to a service         ln -s /var/ardulink/bin/ardulink-proxy.sh /etc/init.d/ardulink-proxy
#	7. Run on boot                  update-rc.d ardulink-proxy defaults
#	That's it! Start the service or reboot the OS. Following are managing commands...
#	- Disable on boot               update-rc.d ardulink-proxy disable
#	- Check service status          service ardulink-proxy status
#	- Start service manually        service ardulink-proxy start
#	- Stop service manually         service ardulink-proxy stop
#	- Restart service manually      service ardulink-proxy restart
#	- View the last log lines       tail /var/log/ardulink-proxy.log
#	If this file has syntax error ensure that TABs aren't replaced by Spaces.
### END INIT INFO
APP_VERSION="2.0.1"
APP_NAME=ardulink-proxy
SERVICE_NAME="ARDUlink Network Proxy Server"
JAR_COMMAND="/var/ardulink/lib/ardulink-networkproxyserver-$APP_VERSION.jar start"
PID_FILE=/var/run/$APP_NAME.pid
LOG=/var/log/$APP_NAME.log
case $1 in
	restart)
		if [ -f $PID_FILE ]; then
			PID=$(cat $PID_PATH_NAME);
			echo "Stopping $SERVICE_NAME on process ID $PID..."
			kill $PID;
			echo "$SERVICE_NAME stopped.";
			rm $PID_FILE
			echo "Starting $SERVICE_NAME..."
			nohup java -jar $JAR_COMMAND >> $LOG 2>&1&
						echo $! > $PID_FILE
			echo "$SERVICE_NAME started."
		else
			echo "$SERVICE_NAME is not running."
		fi
	;;
	start)
		echo "Starting $SERVICE_NAME..."
		if [ ! -f $PID_FILE ]; then
			nohup java -jar $JAR_COMMAND >> $LOG 2>&1&
						echo $! > $PID_FILE
			echo "$SERVICE_NAME started."
		else
			echo "$SERVICE_NAME is already running."
		fi
	;;
	stop)
		if [ -f $PID_FILE ]; then
			PID=$(cat $PID_FILE);
			echo "Stopping $SERVICE_NAME on process ID $PID..."
			kill $PID;
			echo "$SERVICE_NAME stopped."
			rm $PID_FILE
		else
			echo "$SERVICE_NAME is not running."
		fi
	;;
esac

error: pathspec 'deploy-dist/rootfolder/bin/ardulink-proxy.sh' did not match any file(s) known to git


Update dependency installer for VM provisioning

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


Don't forget the parallel wrapper

Don't forget the parallel wrapper

#!/usr/bin/env bash

# vgci-parallel-wrapper.sh: run a subset of the available tests with vgci.sh
# Usage: vgci-paralell-wrapper.sh vgci/test-list.txt vgci-docker-vg-local.tar.gz $CI_NODE_INDEX $CI_NODE_TOTAL junit
# Finds our share of the tests in the test list, given our 0-based index and the total node count.
# Runs each of them with the given loadable Docker image and drops a unique junit xml for the test in the given output directory.
# If we have to run more than 1 test we will duplicate vgci.sh's setup work creating venvs and so on.
# Meant to be run fromn the vg project root.

# If any test fails, stop
set +e

# Parse arguments
TEST_LIST="${1}"
shift
DOCKER_ARCHIVE="${1}"
shift
NODE_INDEX="${1}"
shift
NODE_TOTAL="${1}"
shift
OUT_DIR="${1}"
shift

# Count up all the tests we run
TEST_NUMBER=0

# Get every NODE_TOTAL'th line starting at NODE_INDEX
# See https://superuser.com/a/396557
sed -n "${NODE_INDEX}~${NODE_TOTAL}p" "${TEST_LIST}" | while read TEST_SPEC
do
    # And for each

    # Run the main vgci script for that test
    # TODO: We're hardcoding the Docker file here...
    vgci/vgci.sh -D "${DOCKER_ARCHIVE}" -t "${TEST_SPEC}" -j "${OUT_DIR}/junit.${NODE_INDEX}.${TEST_NUMBER}.xml" -H

    # Number the next test differently
    ((TEST_NUMBER+=1))
done

error: pathspec 'vgci/vgci-parallel-wrapper.sh' did not match any file(s) known to git


Edited spacing for aesthetic alignment :)

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/dls-controls/dls_ade.git/'


Add a script to rename the application

Add a script to rename the application

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/tomtomssi/AngularTemplate.git/'


Add window ID fallback for windows.

Add window ID fallback for windows.

- maybe someday use GetForegroundWindow() from User32.lib ...

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/cpcloud/oh-my-zsh.git/'


実行用シェル作成

実行用シェル作成

#!/bin/sh
# /dartsstat.sh AddUser st0098@gmail.com たけを＠紫推し http://card.dartslive.com/t/top.jsp?i=559300205543375&n=2124119876
java -cp dartsstats-0.0.1-SNAPSHOT.jar:./dependency/* org.shmztko.exec.$1 $2 $3 $4 $5

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


ogv_to_gif.bash: script for converting ogv to gif

#!/bin/bash
base=`basename $1 .ogv`
tmpdir=`mktemp -d`
mplayer $1 -ao null $1 -vo jpeg:outdir=${tmpdir}
mogrify -resize 25% ${tmpdir}/*
convert ${tmpdir}/* -delay 2 ${base}.gif

error: pathspec 'benchmark_gazebo/tools/ogv_to_gif.bash' did not match any file(s) known to git


Add livedesk-embed build script for linux

java -classpath js.jar:compiler.jar -Xss128m org.mozilla.javascript.tools.shell.Main r.js -o core.js
java -classpath js.jar:compiler.jar -Xss128m org.mozilla.javascript.tools.shell.Main r.js -o default.js
java -classpath js.jar:compiler.jar -Xss128m org.mozilla.javascript.tools.shell.Main r.js -o zeit_solo-desktop.js
java -classpath js.jar:compiler.jar -Xss128m org.mozilla.javascript.tools.shell.Main r.js -o zeit-desktop.js

error: pathspec 'plugins/livedesk-embed/build/build.sh' did not match any file(s) known to git


created the shell to automate the install, clean and execution

#! /bin/zsh/

cd src
make
./htbench www.example.com 80 5 10 10
make clean

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


Added a simple bootstrap file

Added a simple bootstrap file

# Clone translations
git clone -b macos-test https://github.com/HearthSim/HDT-Localization Translations/

# Download cards
./scripts/cards_download.sh

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


Update bootstrap script

Update bootstrap 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/vincione/vincione.git/'


Create bootstrap.sh

Create bootstrap.sh

#!/usr/bin/env bash

Update () {
    echo "-- Update packages --"
    sudo apt-get update
    sudo apt-get upgrade
}

Update

echo "-- Prepare configuration for MySQL and phpMyAdmin --"
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password password root"
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password_again password root"
sudo debconf-set-selections <<< "phpmyadmin phpmyadmin/dbconfig-install boolean true"
sudo debconf-set-selections <<< "phpmyadmin phpmyadmin/app-password-confirm password root"
sudo debconf-set-selections <<< "phpmyadmin phpmyadmin/mysql/admin-pass password root"
sudo debconf-set-selections <<< "phpmyadmin phpmyadmin/mysql/app-pass password root"
sudo debconf-set-selections <<< "phpmyadmin phpmyadmin/reconfigure-webserver multiselect apache2"

echo "-- Install tools and helpers --"
sudo apt-get install -y vim curl git python-software-properties
Update

echo "-- Install PPA's --"
sudo add-apt-repository ppa:ondrej/php5-5.6
sudo add-apt-repository ppa:ondrej/mysql-5.6
sudo add-apt-repository ppa:chris-lea/node.js
Update

echo "-- Install packages --"
sudo apt-get install -y php5 apache2 libapache2-mod-php5 php5-curl php5-gd php5-mcrypt php5-xsl mysql-server php5-mysql git-core php5-xdebug phpmyadmin nodejs npm
Update

echo "-- Configure Xdebug --"
cat << EOF | sudo tee -a /etc/php5/mods-available/xdebug.ini
xdebug.scream=1
xdebug.cli_color=1
xdebug.show_local_vars=1
EOF

echo "-- Configure Apache --"
sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php5/apache2/php.ini
sed -i "s/display_errors = .*/display_errors = On/" /etc/php5/apache2/php.ini
sed -i 's/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf
sudo a2enmod rewrite

echo "-- Restart apache --"
sudo /etc/init.d/apache2 restart

echo "-- Install Composer --"
curl -s https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
sudo chmod +x /usr/local/bin/composer

echo "-- Install phpDocumentor --"
wget http://www.phpdoc.org/phpDocumentor.phar
sudo mv phpDocumentor.phar /usr/local/bin/phpdoc
sudo chmod +x /usr/local/bin/phpdoc

echo "-- Install PHPUnit --"
wget -k https://phar.phpunit.de/phpunit.phar
sudo mv phpunit.phar /usr/local/bin/phpunit
sudo chmod +x /usr/local/bin/phpunit

echo "-- Setup database --"
mysql -uroot -proot -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION; FLUSH PRIVILEGES;"
mysql -uroot -proot -e "CREATE DATABASE my_database";


draft for bootstrap.sh script.

draft for bootstrap.sh script.

#!/bin/bash

# bootstrap.sh - for pulling up a dvmdostem development environment

#
#  Primary packages needed to compile and run dvm-dos-tem
#  * may need sudo??
#

#  NOTE: You've gotta install openmpi *after* NetCDF! This keeps NetCDF from
#  getting setup with some pesky #defines that cause errors when trying to
#  compile files that include <mpi.h>.
#  More info: http://www.unidata.ucar.edu/mailing_lists/archives/netcdfgroup/2009/msg00347.html
yum install -y git gcc-c++ jsoncpp-devel readline-devel netcdf-devel netcdf-cxx-devel boost-devel
yum install -y openmpi-devel

# Need this to fix the "H5Pset_dxpl_mpio" error that otherwise comes when
# running IPython and importing netCDF4
yum install -y hdf5-openmpi-devel

# this seems to help x11 forwarding
yum install -y xauth

# packages used for plotting
yum install -y python-matplotlib python-matplotlib-wx netcdf4-python python-ipython

# For processing/preparing the "new style" inputs
yum install -y gdal gdal-devel

# For compiling with Scons
yum install -y scons

#
# Bonus - basic functionality should exist w/o these packages and settings
#

yum install -y gitk git-gui

# For graphical debugging
# Note: If gdb is not installed, then QT Creator will complain about "Unable
#       to create a debugger engine of the type 'no engine'"
#       Also it may be necessary to install xterm. For some reason Colin and
#       Tobey's VMs (from this Vagrantfile) had xterm and gdb and Ruth's did
#       not...Strange?
yum install -y gdb xterm qt-creator

# For viewing IPython notebooks, and viewing Netcdf I/O files.
yum install -y ncview nco firefox

# The man page conflicts between vim and vim-minimal. Removing vim-minimal
# takes sudo with it, crippling later attempts at inline provisioning. So we
# make sure to reinstall sudo.
su -c "yum remove -y vim-minimal && yum install -y vim && yum install -y sudo"

# v---------NOTE NEED TO FIGURE OUT HOW TO CHANGE TO NORMAL USER FOR THIS

# add github's key to knownhosts
if [[ ! -f ~/.ssh/known_hosts ]]; then
  mkdir -p ~/.ssh
  touch ~/.ssh/known_hosts
fi

echo "Appending github's key to ~/.ssh/known_hosts..."
ssh-keyscan github.com >> $(HOME)/.ssh/known_hosts
chmod 600 ~/.ssh/known_hosts

# grab our own packages
if [ ! -d /home/vagrant/dvm-dos-tem ]
then
  git clone git@github.com:ua-snap/dvm-dos-tem.git /home/vagrant/dvm-dos-tem
fi
cd dvm-dos-tem
git remote rename origin upstream
git checkout devel
git pull --ff-only upstream devel:devel
cd ..

if [ ! -d /home/vagrant/ddtv ]
then
  git clone git@github.com:tobeycarman/ddtv.git /home/vagrant/ddtv
fi
cd ddtv
git remote rename origin upstream
git checkout master
git pull --ff-only upstream master:master
cd ..

# v---------NOTE NEED TO FIGURE OUT HOW TO CHANGE TO NORMAL USER FOR THIS

# setup the bashrc file
cat << EOF > $(HOME)/.bashrc
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
	. /etc/bashrc
fi

# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=

# User specific aliases and functions

# Add git branch to bash prompt...
source /usr/share/git-core/contrib/completion/git-prompt.sh
export PS1='[\u@\h \W$(declare -F __git_ps1 &>/dev/null && __git_ps1 " (%s)")]\$ '

# set up some environment variables
export SITE_SPECIFIC_INCLUDES=-I/usr/include/jsoncpp
export PATH=$PATH:/usr/lib64/openmpi/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/openmpi/lib

EOF

# v---------NOTE NEED TO FIGURE OUT HOW TO CHANGE TO NORMAL USER FOR THIS

# setup some vim settings.
cat << EOF >> $(HOME)/.vimrc
syntax on              " this is needed to see syntax
set ls=2               " allways show status line
set hlsearch           " highlight searches
set incsearch          " do incremental searching
set ruler              " show the cursor position all the time
set visualbell t_vb=   " turn off error beep/flash
set ignorecase         " ignore case while searching
set number             " put numbers on side
set expandtab          " insert tabs instead of spaces
set tabstop=2          " use 2 spaces
set shiftwidth=2       " how many columns to move with reindent operators (>>, <<)

EOF

# Can we setup some general git congigurations??
# user, email, editor, color, etc??


Create bootstrap.sh

Create bootstrap.sh

#!/bin/sh

BKP_TYPE=incremental

BKP_SNAPSHOT=$BKP_STORAGE/$BKP_SNAPSHOT

if [ "$1" = "full" ]; then
    BKP_TYPE=full
    rm -f $BKP_SNAPSHOT
fi
if [ ! -f $BKP_SNAPSHOT ]; then
    BKP_TYPE=full
fi

echo "Performing $BKP_TYPE backup:"

BKP_TIMESTAMP=$(date +"%Y%m%d-%H%M")
BKP_SUFFIX=tgz

cd $BKP_STORAGE
rm -f $BKP_PREFIX-*.$BKP_SUFFIX

BKP_FILE=$BKP_STORAGE/$BKP_PREFIX-$BKP_TIMESTAMP-$BKP_TYPE.$BKP_SUFFIX

echo "Collecting data ..."
cd $BKP_CONTENT
tar --listed-incremental="$BKP_SNAPSHOT" -czf "$BKP_FILE" *

# echo $BKP_TIMESTAMP
# ls -al $BKP_STORAGE

if [ -n "$BKP_LOCATION" ]; then
    echo "Uploading backup archive ..."
    curl -o /dev/zero -T $BKP_FILE $BKP_LOCATION
fi

echo "Finished!"


trivial: Fix the OpenBMC example

trivial: Fix the OpenBMC example

#!/bin/sh

meson ../ \
    -Dbash_completion=false \
    -Dcompat_cli=false \
    -Dconsolekit=false \
    -Ddocs=none \
    -Delogind=false \
    -Dfish_completion=false \
    -Dfirmware-packager=false \
    -Dgudev=false \
    -Dgusb=false \
    -Dhsi=false \
    -Dintrospection=false \
    -Dlibarchive=false \
    -Dman=false \
    -Dmetainfo=false \
    -Doffline=false \
    -Dplugin_acpi_phat=false \
    -Dplugin_amt=false \
    -Dplugin_bcm57xx=false \
    -Dplugin_cfu=false \
    -Dplugin_dell=false \
    -Dplugin_emmc=false \
    -Dplugin_ep963x=false \
    -Dplugin_fastboot=false \
    -Dplugin_logitech_bulkcontroller=false \
    -Dplugin_nitrokey=false \
    -Dplugin_nvme=false \
    -Dplugin_parade_lspcon=false \
    -Dplugin_pixart_rf=false \
    -Dplugin_powerd=false \
    -Dplugin_realtek_mst=false \
    -Dplugin_redfish=false \
    -Dplugin_synaptics_mst=false \
    -Dplugin_synaptics_rmi=false \
    -Dplugin_thunderbolt=false \
    -Dplugin_tpm=false \
    -Dplugin_uefi_capsule=false \
    -Dplugin_uf2=false \
    -Dplugin_upower=false \
    -Dpolkit=false \
    -Dsqlite=false \
    -Dtests=false \
    -Dudevdir=/tmp \
    -Dsystemd_root_prefix=/tmp \
    $@

#!/bin/sh

meson ../ \
    -Dbash_completion=false \
    -Dcompat_cli=false \
    -Dconsolekit=false \
    -Ddocs=none \
    -Delogind=false \
    -Dfish_completion=false \
    -Dfirmware-packager=false \
    -Dgudev=false \
    -Dgusb=false \
    -Dhsi=false \
    -Dintrospection=false \
    -Dlibarchive=false \
    -Dlogind=false \
    -Dman=false \
    -Dmetainfo=false \
    -Doffline=false \
    -Dplugin_acpi_phat=false \
    -Dplugin_amt=false \
    -Dplugin_bcm57xx=false \
    -Dplugin_cfu=false \
    -Dplugin_dell=false \
    -Dplugin_emmc=false \
    -Dplugin_ep963x=false \
    -Dplugin_fastboot=false \
    -Dplugin_logitech_bulkcontroller=false \
    -Dplugin_nitrokey=false \
    -Dplugin_nvme=false \
    -Dplugin_parade_lspcon=false \
    -Dplugin_pixart_rf=false \
    -Dplugin_powerd=false \
    -Dplugin_realtek_mst=false \
    -Dplugin_redfish=false \
    -Dplugin_synaptics_mst=false \
    -Dplugin_synaptics_rmi=false \
    -Dplugin_thunderbolt=false \
    -Dplugin_tpm=false \
    -Dplugin_uefi_capsule=false \
    -Dplugin_upower=false \
    -Dplugin_upower=false \
    -Dpolkit=false \
    -Dsqlite=false \
    -Dtests=false \
    -Dudevdir=/tmp \
    -Dsystemd_root_prefix=/tmp \
    $@


Brewstrap now supports both OSX and Linux

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


add ilspect.sh helper

add ilspect.sh helper

#!/bin/sh
pushd $(dirname $0) > /dev/null
SCRIPT_PATH=$(pwd)
popd > /dev/null

dotnet run --project "$SCRIPT_PATH/src/ILspect.CommandLine/ILspect.CommandLine.csproj" -- "$@"

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


Create set-timezone.sh

Create set-timezone.sh

#!/bin/bash

#
# If you're using the disable-wifi.sh script, it is likely you will also loose automatic timezone support.
# This script sets the timezone based on your computer's name, if you naming structure starts with an
# IATA airport code. e.g. DUB-Build-123 or SFO-Test-456
#

# Sets the timezone based on location
    # Extracts the first three chars from the Computer's name
SHORT_NAME="$(/usr/sbin/scutil --get ComputerName | /usr/bin/cut -c1-3)"

if [[ "$SHORT_NAME" == "DUB" ]]; then
	/usr/sbin/systemsetup -settimezone Europe/Dublin

    # NYC is a catchall airport code for JFK, EWR, LGA
elif [[ "$SHORT_NAME" == "NYC" ]]; then
       /usr/sbin/systemsetup -settimezone America/New_York

    # There is no America/San_Franciso, so we have to use Los Angeles
elif [[ "$SHORT_NAME" == "SFO" ]]; then
        /usr/sbin/systemsetup -settimezone America/Los_Angeles

elif [[ "$SHORT_NAME" == "ORD" ]]; then
        /usr/sbin/systemsetup -settimezone America/Chicago

    # There is no Australia/Sydney (seriously!), so have to use Brisbane
elif [[ "$SHORT_NAME" == "SYD" ]]; then
        /usr/sbin/systemsetup -settimezone Australia/Brisbane

else
    # If all else fails, default to the GMT timezone
        /usr/sbin/systemsetup -settimezone GMT
fi

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


Script converting a single collaboration graph to a library graph.

#!/bin/bash

HTMLPATH=$DOXYGEN_OUTPUT_DIRECTORY/html

sed -i'.back' -e 's/Collaboration diagram for /Libraries for /g'  $HTMLPATH/class$1.html
rm $HTMLPATH/class$1.html.back

# Picture name containing the "coll graph"
PICNAME=$HTMLPATH/"class"$1"__coll__graph.svg"

# Find the libraries for the class $1
root -l -b -q "libs.C(\"$1\")"

sed -i'.back' -e "s/\.so.*$/\";/" libslist.dot
rm libslist.dot.back

# Generate the dot file describing the graph for libraries
echo "digraph G {" > libraries.dot
echo "   rankdir=LR;" >>  libraries.dot
echo "   node [shape=box, fontname=Arial];" >>  libraries.dot
cat mainlib.dot >> libraries.dot;
cat libslist.dot | grep -v "\.dylib" \
                 | grep lib[A-Z] | sed -e "s/\(.*\)\(lib.*;\)$/   mainlib->\"\2/" \
                 >> libraries.dot
echo "   mainlib [shape=box, fillcolor=\"#ABACBA\", style=filled];" >>  libraries.dot
echo "}" >> libraries.dot

# Generate the SVG image of the graph
dot -Tsvg libraries.dot -o $PICNAME

# Make sure the picture size in the html file the same as the svg
PICSIZE=`grep "svg width" $PICNAME | sed -e "s/<svg //"`
sed -i'.back' -e "s/\(^.*__coll__graph.svg\"\)\( width.*\">\)\(.*$\)/\1 $PICSIZE>\3/"  $HTMLPATH/class$1.html
rm $HTMLPATH/class$1.html.back

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


uploaded STA_GAMIT_2_BERNESE.sh

uploaded STA_GAMIT_2_BERNESE.sh

uploaded Convector of Station Information File from GAMIT format to BERNESE format

#!/bin/bash
#
# ScriptConverting GAMIT_station.info into Bernese format "*.STA"
#
# ./STA_GAMIT_2_BERNESE.sh inputFile [-options]
#
# inputFile  (example) :   GAMITstation.info         : Station information file in GAMIT format
# outputFile (example) :   GAMITstation.info.STA     : Station information file in BERNESE format
#
# Options:
#    -sw      : skip Receiver firmware changes
#
# example (converting file and ignoging firmaware changes):
#
#   ./STA_GAMIT_2_BERNESE.sh inputFile -sw
#
#
# Alexandr Sokolov
# 15.12.2015

inputFile="$1"
outputFile="$inputFile.STA"
flag="001"
REMARK='by the RENAG GNSS GSAC'
date_time=$(gps_date -t -o "%d-%B-%Y %H:%M")

echo "
Converting $inputFile into Bernese format $outputFile"

echo "ORPHEON Network, conv. STA_GAMIT2BERNESE.sh; BSW VERSION 5.2;  $date_time" > $outputFile
echo "--------------------------------------------------------------------------------

FORMAT VERSION: 1.01
TECHNIQUE:      GNSS

TYPE 001: RENAMING OF STATIONS
------------------------------

STATION NAME          FLG          FROM                   TO         OLD STATION NAME      REMARK
****************      ***  YYYY MM DD HH MM SS  YYYY MM DD HH MM SS  ********************  ************************" >> $outputFile

tail -n +6 $inputFile > GAMIT.STA
more GAMIT.STA | cut --characters=2-5 | uniq > stat_list

while read SITE
do {
    line=$(grep "$SITE" GAMIT.STA | head -1)

	YY_start=$(echo "$line" | cut --characters=26-29 )
	DOY_start=$(echo "$line" | cut --characters=31-33 )
	hh_start=$(echo "$line" | cut --characters=35-36 )
	mm_start=$(echo "$line" | cut --characters=38-39 )
	ss_start=$(echo "$line" | cut --characters=41-42 )

	MM_start=$(gps_date -yd $(echo "$YY_start $DOY_start" | awk '{printf"%4d %03d", $1, $2}') -o  "%m")
	dd_start=$(gps_date -yd $(echo "$YY_start $DOY_start" | awk '{printf"%4d %03d", $1, $2}') -o  "%d")

	echo "$SITE $SITE             $flag  $YY_start $MM_start $dd_start $hh_start $mm_start $ss_start  2099 12 31 00 00 00  $SITE*                 ORPHEON, Fr.            " >> $outputFile

} done < stat_list

#SITE  Station Name      Session Start      Session Stop       Ant Ht   HtCod  Ant N    Ant E    Receiver Type         Vers                  SwVer  Receiver SN           Antenna Type     Dome   Antenna SN
#ALLE  ALLE              2011 345 19 00 00  2014  98 08 26 44   0.0000  -----   0.0000   0.0000  LEICA GRX1200+GNSS    8.10/4.007             8.10  496671                LEIAS10          NONE   UNKNOWN
#VIGY  VIGY              2011 301 10 00 00  2015 344 14 09 18   0.0000  -----   0.0000   0.0000  LEICA GRX1200+GNSS    8.20/4.007             8.20  495809                LEIAX1203+GNSS   NONE   UNKNOWN

echo "

TYPE 002: STATION INFORMATION
-----------------------------

STATION NAME          FLG          FROM                   TO         RECEIVER TYPE         RECEIVER SERIAL NBR   REC #   ANTENNA TYPE          ANTENNA SERIAL NBR    ANT #    NORTH      EAST      UP      DESCRIPTION             REMARK
****************      ***  YYYY MM DD HH MM SS  YYYY MM DD HH MM SS  ********************  ********************  ******  ********************  ********************  ******  ***.****  ***.****  ***.****  **********************  ************************" >> $outputFile

while read line
do {
	SITE=$(echo "$line" | cut --characters=1-4 )
	Description=$(echo "$line" | cut --characters=7-22 )
	YY_start=$(echo "$line" | cut --characters=25-28 )
	DOY_start=$(echo "$line" | cut --characters=30-32 )
	hh_start=$(echo "$line" | cut --characters=34-35 )
	mm_start=$(echo "$line" | cut --characters=37-38 )
	ss_start=$(echo "$line" | cut --characters=40-41 )
	YY_end=$(echo "$line" | cut --characters=44-47)
	DOY_end=$(echo "$line" | cut --characters=49-51 )
	hh_end=$(echo "$line" | cut --characters=53-54 )
	mm_end=$(echo "$line" | cut --characters=56-57 )
	ss_end=$(echo "$line" | cut --characters=59-60 )
	Ant_Ht=$(echo "$line" | cut --characters=64-70 )
	Ant_N=$(echo "$line" | cut --characters=80-86 )
	Ant_E=$(echo "$line" | cut --characters=89-95 )
	Rec_Type=$(echo "$line" | cut --characters=97-117 )
	Rec_Vers=$(echo "$line" | cut --characters=119-140 )
	Rec_SwVer=$(echo "$line" | cut --characters=142-146 )
	Rec_SN=$(echo "$line" | cut --characters=148-168 )
	Ant_Type=$(echo "$line" | cut --characters=170-185 )
	Ant_DOME=$(echo "$line" | cut --characters=187-190 )
	Ant_SN=$(echo "$line" | cut --characters=194-204 )

	# echo "$SITE $Description $YY_start,$DOY_start,$hh_start,$mm_start,$ss_start,$YY_end,$DOY_end,$hh_end,$mm_end,$ss_end,$Ant_Ht,$Ant_N,$Ant_E,$Rec_Type,$Rec_Vers,$Rec_SwVer,$Rec_SN,$Ant_Type,$Ant_DOME,$Ant_SN"

	# convert date from "YYYY DoY" to "YYYY MM DD"
	MM_start=$(gps_date -yd $(echo "$YY_start $DOY_start" | awk '{printf"%4d %03d", $1, $2}') -o  "%m")
	dd_start=$(gps_date -yd $(echo "$YY_start $DOY_start" | awk '{printf"%4d %03d", $1, $2}') -o  "%d")

	MM_end=$(gps_date -yd   $(echo "$YY_end   $DOY_end"   | awk '{printf"%4d %03d", $1, $2}') -o  "%m")
	dd_end=$(gps_date -yd   $(echo "$YY_end   $DOY_end"   | awk '{printf"%4d %03d", $1, $2}') -o  "%d")

	if [ "$Ant_DOME" = "----" ]
	then
		Ant_DOME="NONE"
	fi

	Ant_SN=$( echo "$Ant_SN" | sed 's/ *//g')
	if (( "$Ant_SN" == "UNKNOWN" || "$Ant_SN" == "Unknown" || "$Ant_SN" == "unknown" ))
	then
		Ant_SN="999999"
	fi

	if (( $(echo ${#Rec_SN}) < 6 ))
	then
		Rec_SN_short=$Rec_SN
	else
		Rec_SN_short=$(echo ${Rec_SN:(-6)})
	fi

	if (( $( echo ${#Ant_SN}) < 6 ))
	then
		Ant_SN_short=$Ant_SN
	else
		Ant_SN_short=$(echo ${Ant_SN:(-6)})
	fi

	format=( "%4s" " %-10s" "       %03d"    "  %4d"    " %2s"    " %2s"    " %2s"    " %2s"    " %2s" "  %4d"  " %2s"  " %2s"  " %2s"  " %2s"  " %2s"          "  %-20s"   "  %-20s"      "  %-6s"             "  %-15s"    " %4s"  "  %20s"       "  %6s" "  %8s"  "  %8s" "  %8s"        "  %-22s"           '  %-24s \n')
	records=($SITE    $SITE         $flag  $YY_start $MM_start $dd_start $hh_start $mm_start $ss_start $YY_end $MM_end $dd_end $hh_end $mm_end $ss_end "$(echo $Rec_Type)"   $Rec_SN "$Rec_SN_short" "$(echo $Ant_Type)" $Ant_DOME   $Ant_SN $Ant_SN_short  $Ant_N   $Ant_E $Ant_Ht "$(echo $Description)" "$(echo $Rec_Vers)")

	# print to file
	for ((i=0; i<=27; i+=1));
	do {
		# echo "${format[$i]} ${records[$i]}"
	    # printf "${format[$i]}" "${records[$i]}" >> $outputFile
		printf "${format[$i]}" "${records[$i]}" >> type2Table
	} done

} done < GAMIT.STA

### Ignore Receiver Firmware changes

if [ "$2" == "-sw" ]
then
	more type2Table | cut --characters=-4 | uniq > newList
	while read SITE
	do {
		grep $SITE type2Table > tableSite
		for ((i=1; i<=$(grep -c $SITE tableSite); i+=1));
		do {
			grep "$(head $(echo "-$i") tableSite | tail -1 | cut --characters=70-202)" tableSite > tableSiteCommon
			echo "$( head -1 tableSiteCommon | cut --characters=-47)" "$(tail -1 tableSiteCommon | cut --characters=49-226 )"  "$REMARK" >> tableReducedNew
		} done
	} done < newList

	more tableReducedNew | uniq  >> $outputFile
else
	more type2Table >> $outputFile
fi

rm GAMIT.STA
rm stat_list
rm tableReducedNew
rm newList
rm type2Table
rm tableSite
rm tableSiteCommon

echo "

TYPE 003: HANDLING OF STATION PROBLEMS
--------------------------------------

STATION NAME          FLG          FROM                   TO         REMARK
****************      ***  YYYY MM DD HH MM SS  YYYY MM DD HH MM SS  ************************************************************

TYPE 004: STATION COORDINATES AND VELOCITIES (ADDNEQ)
-----------------------------------------------------
                                            RELATIVE CONSTR. POSITION     RELATIVE CONSTR. VELOCITY
STATION NAME 1        STATION NAME 2        NORTH     EAST      UP        NORTH     EAST      UP
****************      ****************      **.*****  **.*****  **.*****  **.*****  **.*****  **.*****

TYPE 005: HANDLING STATION TYPES
--------------------------------

STATION NAME          FLG  FROM                 TO                   MARKER TYPE           REMARK
****************      ***  YYYY MM DD HH MM SS  YYYY MM DD HH MM SS  ********************  ************************

" >> $outputFile

echo "Done"

gedit $outputFile &

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


fetch origin master

fetch origin master

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/etpinard/etpinard.github.io.git/'


Add sh/apps script for setting environment for local perl library

#!/bin/sh

# Perl configuration

if command -v perl > /dev/null; then
    perl5dir="$HOME/perl5"

    if [ -d "$perl5dir" ]; then
        PATH="$perl5dir/bin${PATH:+:${PATH}}"
        PERL5LIB="$perl5dir/lib/perl5${PERL5LIB:+:${PERL5LIB}}"
        PERL_LOCAL_LIB_ROOT="$perl5dir${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"
        PERL_MB_OPT="--install_base \"$perl5dir\""
        PERL_MM_OPT="INSTALL_BASE=$perl5dir"
        export PATH PERL5LIB PERL_LOCAL_LIB_ROOT PERL_MB_OPT PERL_MM_OPT
    fi

    unset perl5dir
fi

# vim: syntax=sh cc=80 tw=79 ts=4 sw=4 sts=4 et sr

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


create XML file sooner

create XML file sooner

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/Mausy5043/raspboot.git/'


Create binsafeRun.sh

Create binsafeRun.sh

Also from Etherpad

#!/bin/sh

#This script ensures that ep-lite is automatically restarting after an error happens

#Handling Errors
# 0 silent
# 1 email
ERROR_HANDLING=0
# Your email address which should recieve the error messages
EMAIL_ADDRESS="no-reply@example.com"
# Sets the minimun amount of time betweens the sending of error emails.
# This ensures you not get spamed while a endless reboot loop
# It's the time in seconds
TIME_BETWEEN_EMAILS=600 # 10 minutes

# DON'T EDIT AFTER THIS LINE

LAST_EMAIL_SEND=0
LOG="$1"

#Move to the folder where ep-liteOneTImePad is installed
cd `dirname $0`

#Was this script started in the bin folder? if yes move out
if [ -d "../bin" ]; then
  cd "../"
fi

#check if a logfile parameter is set
if [ -z "${LOG}" ]; then
  echo "Set a logfile as the first parameter"
  exit 1
fi

shift
while [ 1 ]
do
  #try to touch the file if it doesn't exist
  if [ ! -f ${LOG} ]; then
    touch ${LOG} || ( echo "Logfile '${LOG}' is not writeable" && exit 1 )
  fi

  #check if the file is writeable
  if [ ! -w ${LOG} ]; then
    echo "Logfile '${LOG}' is not writeable"
    exit 1
  fi

  #start the application
  bin/run.sh $2 >>${LOG} 2>>${LOG}

  #Send email
  if [ $ERROR_HANDLIjNG = 1 ]; then
    TIME_NOW=$(date +%s)
    TIME_SINCE_LAST_SEND=$(($TIME_NOW - $LAST_EMAIL_SEND))

    if [ $TIME_SINCE_LAST_SEND -gt $TIME_BETWEEN_EMAILS ]; then
      printf "Server was restarted at: $(date)\nThe last 50 lines of the log before the error happens:\n $(tail -n 50 ${LOG})" | mail -s "OneTimePad Server was restarted" $EMAIL_ADDRESS

      LAST_EMAIL_SEND=$TIME_NOW
    fi
  fi

  echo "RESTART!" >>${LOG}

  #Sleep 10 seconds before restart
  sleep 10
done

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


Trigger an Envoyer deployment

Trigger an Envoyer deployment

#!/bin/sh
# Deploy via envoyer.io
#
# You can either add this here, or configure them on the environment tab of your
# project settings. See the _Deployment Hooks_ tab on Envoyer for the ID.
ENVOYER_ID=""

curl "https://envoyer.io/deploy/${ENVOYER_ID}"

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


Create osm_extracts_snapshot.sh

Create osm_extracts_snapshot.sh

#!/bin/bash
#==========##========#
BIN=/opt/cybergis-scripts.git/bin
TIMESTAMP=$(date +%s)
TEMP=/home/ubuntu/temp/
#==#
GS_USER=admin
GS_PASS=geoserver
GS='http://localhost:8080/geoserver/'
WFS=$GS"wfs"
HOST='<Database Host>'
DB=<Database Name>
DB_USER='postgres'
DB_PASS=<Database Password>
NS=osm-extracts
PRJ='EPSG:4326'
#==#
#For publishing
WS=<Workspace>
DS=<Data Store>
#===================#
#Raw (Nodes and Ways)
LG=baraka_raw_$TIMESTAMP
FTA=( "baraka_raw_node" "baraka_raw_way")
SNAPA=()
STYLESA=( "cybergis_basic_point_blue" "cybergis_basic_line_blue" )
for FT in "${FTA[@]}"
do
    SNAP=$FT"_"$TIMESTAMP
    SNAPA+=($SNAP)
    echo "Snapshoting "$FT" as "$NS"_"$FT"_"$TIMESTAMP
    $BIN/cybergis-script-pull-wfs.sh $WFS $NS $FT $PRJ $HOST $DB $DB_USER $DB_PASS $SNAP $TEMP
    python $BIN/cybergis-script-geoserver-publish-layers.py -gs $GS -ws $WS -ds $DS -ft $SNAP --username $GS_USER --password $GS_PASS
done
LAYERS=$(printf ",%s" "${SNAPA[@]}")
LAYERS=$(echo $LAYERS | cut -c 2- )
STYLES=$(printf ",%s" "${STYLESA[@]}")
STYLES=$(echo $STYLES | cut -c 2- )
python $BIN/cybergis-script-geoserver-publish-layergroup.py -gs $GS -ws $WS -lg $LG --layers "$LAYERS" --styles "$STYLES" --username $GS_USER --password $GS_PASS
#===================#
#Basic (Buildings and Roads)
LG=baraka_normal_$TIMESTAMP
FTA=( "baraka_basic_osm_buildings" "baraka_basic_osm_roads" )
SNAPA=()
STYLESA=( "cybergis_structure_buildings" "cybergis_basic_line_blue" )
for FT in "${FTA[@]}"
do
    SNAP=$FT"_"$TIMESTAMP
    SNAPA+=($SNAP)
    echo "Snapshoting "$FT" as "$NS"_"$FT"_"$TIMESTAMP
    $BIN/cybergis-script-pull-wfs.sh $WFS $NS $FT $PRJ $HOST $DB $DB_USER $DB_PASS $SNAP $TEMP
    python $BIN/cybergis-script-geoserver-publish-layers.py -gs $GS -ws $WS -ds $DS -ft $SNAP --username $GS_USER --password $GS_PASS
done
LAYERS=$(printf ",%s" "${SNAPA[@]}")
LAYERS=$(echo $LAYERS | cut -c 2- )
STYLES=$(printf ",%s" "${STYLESA[@]}")
STYLES=$(echo $STYLES | cut -c 2- )
python $BIN/cybergis-script-geoserver-publish-layergroup.py -gs $GS -ws $WS -lg $LG --layers "$LAYERS" --styles "$STYLES" --username $GS_USER --password $GS_PASS
#===================#

error: pathspec 'extractions/iccm/baraka/osm_extracts_snapshot.sh' did not match any file(s) known to git


Add script for creating generic iso

Add script for creating generic iso

#!/bin/bash

rm sotolito-iso/SotolitoOS-Stream-x86_64-8-Stream-generic.iso
rm log-sotolito.log
./create-iso.sh generic 2>&1 | tee log-sotolito.log
cp sotolito-iso/SotolitoOS-7-x86_64-Minimal-1810-* ~/space/virt-images

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


Rolling back last change.

Rolling back last change.

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


Added a sample mount helper binary.

Added a sample mount helper binary.

#!/bin/bash

# A sample "external helper" for mount(8) that can be used to set up
# compatibility with the `mount` command. Edit the variables below, then install
# as /sbin/mount_gcsfuse on OS X or /sbin/mount.gcsfuse on Linux.

# Path to the mount_gcsfuse binary obtained by running
#     go install github.com/googlecloudplatform/gcsfuse/mount_gcsfuse
MOUNT_GCSFUSE=/Users/jacobsa/go/bin/mount_gcsfuse

# A $PATH-like string containing the gcsfuse binary and (on Linux) the
# fusermount binary.
WRAPPED_PATH=/Users/jacobsa/go/bin

# Set to an output file where you want stdout and stderr to go, or /dev/null, or
# a syslog "facility.priority" spec. See `man 1 daemon` for more.
OUTPUT=/tmp/gcsfuse.output

# Run under daemon so that we return to mount(8) immediately.
daemon -f --env="PATH=$WRAPPED_PATH" --output $OUTPUT -- $MOUNT_GCSFUSE "$@"
exit

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


deploy.sh

deploy.sh

#!/bin/bash

cd "$(dirname $0)/../"
grails war -Dgrails.env=development
mv target/*.war openbeds.war

heroku deploy:war openbeds.war

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


Add live test script for mac

Add live test script for mac

#!/bin/bash
fswatch -o compiler/parse.py tests/test_parser.py|while read line; do nosetests tests/test_parser.py; done

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


Added a bash script for running tophat and cuffliks on RNAseq samples

#!/bin/sh
#before starting symlink to the appropriate annotation index genes.gtf and symlink mm9 or hg19 to the bowtie index
#once fastq files are extracted into folders, adjust the numbering and the grouping (in cuffdiff) accordingly
tophat -p 3 -G genes.gtf -o Sample10829out mm9 Sample10829/sample10829.fastq
tophat -p 3 -G genes.gtf -o Sample10830out mm9 Sample10830/Sample10830.fastq
tophat -p 3 -G genes.gtf -o Sample10831out mm9 Sample10831/Sample10831.fastq
tophat -p 3 -G genes.gtf -o Sample10832out mm9 Sample10832/Sample10832.fastq
tophat -p 3 -G genes.gtf -o Sample10833out mm9 Sample10833/Sample10833.fastq
tophat -p 3 -G genes.gtf -o Sample10834out mm9 Sample10834/Sample10834.fastq
tophat -p 3 -G genes.gtf -o Sample10835out mm9 Sample10835/Sample10835.fastq
tophat -p 3 -G genes.gtf -o Sample10836out mm9 Sample10836/Sample10836.fastq
tophat -p 3 -G genes.gtf -o Sample10837out mm9 Sample10837/Sample10837.fastq
tophat -p 3 -G genes.gtf -o Sample10838out mm9 Sample10838/Sample10838.fastq
tophat -p 3 -G genes.gtf -o Sample10839out mm9 Sample10839/Sample10839.fastq
tophat -p 3 -G genes.gtf -o Sample10840out mm9 Sample10840/Sample10840.fastq
cufflinks -p 3 -o Sample10829clout Sample10829out/accepted_hits.bam
cufflinks -p 3 -o Sample10830clout Sample10830out/accepted_hits.bam
cufflinks -p 3 -o Sample10831clout Sample10831out/accepted_hits.bam
cufflinks -p 3 -o Sample10832clout Sample10832out/accepted_hits.bam
cufflinks -p 3 -o Sample10833clout Sample10833out/accepted_hits.bam
cufflinks -p 3 -o Sample10834clout Sample10834out/accepted_hits.bam
cufflinks -p 3 -o Sample10835clout Sample10835out/accepted_hits.bam
cufflinks -p 3 -o Sample10836clout Sample10836out/accepted_hits.bam
cufflinks -p 3 -o Sample10837clout Sample10837out/accepted_hits.bam
cufflinks -p 3 -o Sample10838clout Sample10838out/accepted_hits.bam
cufflinks -p 3 -o Sample10839clout Sample10839out/accepted_hits.bam
cufflinks -p 3 -o Sample10840clout Sample10840out/accepted_hits.bam
cuffmerge -g genes.gtf -s mm9.fa -p 3 assemblies.txt
cuffdiff -o diff_out -b mm9.fa -p 3 -L GroupName1,GroupName2 -u merged_asm/merged.gtf ./Sample10829out/accepted_hits.bam,./Sample10830out/accepted_hits.bam,./Sample10831out/accepted_hits.bam,./Sample10832out/accepted_hits.bam,./Sample10833out/accepted_hits.bam,./Sample10834out/accepted_hits.bam ./Sample10835out/accepted_hits.bam,./Sample10836out/accepted_hits.bam,./Sample10837out/accepted_hits.bam,./Sample10838out/accepted_hits.bam,./Sample10839out/accepted_hits.bam,./Sample10840out/accepted_hits.bam
#merge all accepted_hits.bam into one large bam file
samtools merge all_accepted_hits.bam *out/accepted_hits.bam
#index each of the accepted_hits.bam files (including the new large one)
for i in *out/accepted_hits.bam; do echo $i; samtools index $i; done;
#counts the number of hits per chromosome for each sample and exports this as chromosome_counts.txt
for i in *out/accepted_hits.bam; do echo $i; samtools idxstats $i ; done > chromosome_counts.txt;
#list of all the gtf files in the working directory (and subdirectories)
find . -name transcripts.gtf > gtf_out_list.txt
#compares each assembly gtf  to the reference annotation
cuffcompare -i gtf_out_list.txt -r genes.gtf
#outputs a table for each assembly listing matches to reference genome... not working
#for i in 'find . -name *.tmap'; do echo $i; awk 'NR > 1 { s[$3]++ } END { \
  for (j in s) {print j, s[j] }} ' $i; done;

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


Create discourse_cronjob.sh

Create discourse_cronjob.sh

#!/bin/bash

#
# Notice: please add this line to /etc/crontab of your container
# * * * * * discourse /usr/bin/psql -t --output=/tmp/discourse_posts.json -c "SELECT * FROM _pdis_object_json;"
#

# container id of discourse
CONTAINER_ID=your_container_id

# copy from container to the path of host
sleep 3
/usr/bin/docker cp $CONTAINER_ID:/tmp/discourse_posts.json /root/discourse-updater/pdis-bot/Postgres-Discourse

# exit
exit 0

error: pathspec 'Postgres-Discourse/discourse_cronjob.sh' did not match any file(s) known to git


add_band_name

#!/bin/bash
#removes track number and inserts band name into songs files names in the current folder
#author Leonardo Leite
#license GPL v3

band='Trivium'

for song in *.mp3
do
  new_name=`echo $song | sed 's/[0-9]*\(.*\)/\1/'`
  new_name=$band$new_name
  echo 'renaming '$song
  mv "$song" "$new_name"
done

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


Little bash script to bundle for win32

Little bash script to bundle for win32

#!/bin/bash
## Pack löve game for win32
git archive -o wtfthisgame.love --format=zip -9 HEAD
wget 'https://bitbucket.org/rude/love/downloads/love-0.10.1-win32.zip'
unzip 'love-0.10.1-win32.zip'
mkdir wtfthisgame-win32
cp -v love-0.10.1-win32/{*.dll,license.txt} wtfthisgame-win32/
cat love-0.10.1-win32/love.exe wtfthisgame.love > wtfthisgame-win32/wtfthisgame.exe
zip -r -9 wtfthisgame-win32.zip wtfthisgame-win32
mv -v wtfthisgame-win32.zip bin/
rm -rfv wtfthisgame-win32 love-0.10.1-win32 love-0.10.1-win32.zip
echo 'done.'

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


Update RingOpenGL 4.4 - Build script for MacOS X

clang -c -fpic ring_opengl44.c -I $PWD/../../../include -I /usr/local/include
clang -dynamiclib -o $PWD/../../../lib/libring_opengl44.dylib ring_opengl44.o /usr/local/lib/libglew.dylib -framework OpenGL -framework GLUT -L $PWD/../../../lib  -lring

error: pathspec 'extensions/ringopengl/opengl44/buildclang.sh' did not match any file(s) known to git


script to install module dependencies

script to install module dependencies

puppet module install jgoettsch/mercurial
puppet module install puppetlabs/postgresql
puppet module install maestrodev/wget
git clone https://github.com/jurgenlust/puppet-tomcat tomcat
git clone https://github.com/glarizza/puppet-pick.git pick
git clone https://github.com/puppetlabs/puppetlabs-stdlib stdlib
git clone https://github.com/camptocamp/puppet-archive.git archive
git clone https://github.com/ripienaar/puppet-concat.git concat

error: pathspec 'master/puppet/modules/install_dependencies.sh' did not match any file(s) known to git


client: Add forgotten rm.sh file

client: Add forgotten rm.sh file

Signed-off-by: Samuel Ortiz <0ba86cb3f08bbb861958e54bd3438887adb4263c@linux.intel.com>

#!/bin/bash

rm /var/run/checkin-clear-containers/`hostname`

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


Added script to check if all required packages are installed

#!/bin/bash

# Check if there is 1 occurence of the package defined in apt-requirements in
# the dpkg -l, listing of installed packages on this system.

for line in $(cat apt-requirements.txt); do

  # Example line from dpkg -l:
  # ii  dialog                              1.1-20100428-1      [description]
  # Added [[:space:]] in front and end of $line to get a perfect match
  count=`dpkg -l | grep -e ^ii[[:space:]][[:space:]]$line[[:space:]] -c`

  if [ "$count" -eq "1" ]; then
    # Installed
    echo "$line is installed"
  else
    echo "Package '$line' is not installed. Please install."
    exit 1
  fi
done

exit 0

error: pathspec 'core/bin/server/check-installed-packages.sh' did not match any file(s) known to git


[*] не удаляется *.asm файл после работы compile_and_run.py

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/tsu-iscd/lyapas-lcc.git/'


off-by-one error, introduced in r2226. this was breaking things in the case of tguc + coasters + gram4 (but not gram2).

git-svn-id: 6ee47c8665bf46900d9baa0afb711c5b4a0eafac@2286 e2bb083e-7f23-0410-b3a8-8253ac9ef6d8

# this script must be invoked inside of bash, not plain sh

infosection() {
	echo >& "$INFO"
	echo "_____________________________________________________________________________" >& "$INFO"
	echo >& "$INFO"
	echo "        $1" >& "$INFO"
	echo "_____________________________________________________________________________" >& "$INFO"
	echo >& "$INFO"
}

info() {
	infosection "uname -a"
	uname -a 2>&1 >& "$INFO"
	infosection "id"
	id 2>&1 >& "$INFO"
	infosection "env"
	env 2>&1 >& "$INFO"
	infosection "df"
	df 2>&1 >& "$INFO"
	infosection "/proc/cpuinfo"
	cat /proc/cpuinfo 2>&1 >& "$INFO"
	infosection "/proc/meminfo"
	cat /proc/meminfo 2>&1 >& "$INFO"
	infosection "command line"
	echo $COMMANDLINE 2>&1 >& "$INFO"
}

logstate() {
	echo "Progress " `date +"%Y-%m-%d %H:%M:%S.%N%z"` " $@" >& "$INFO"
}

log() {
	echo "$@" >& "$INFO"
}

fail() {
	EC=$1
	shift
	echo $@ >"$WFDIR/status/$JOBDIR/${ID}-error"
	log $@
	info
	#exit $EC
	#let vdl-int.k handle the issues
	exit 0
}

checkError() {
	if [ "$?" != "0" ]; then
		fail $@
	fi
}

checkEmpty() {
	if [ "$1" == "" ]; then
		shift
		fail 254 $@
	fi
}

getarg() {
	NAME=$1
	shift
	VALUE=""
	SHIFTCOUNT=0
	if [ "$1" == "$NAME" ]; then
		shift
		let "SHIFTCOUNT=$SHIFTCOUNT+1"
		while [ "${1:0:1}" != "-" ] && [ "$#" != "0" ]; do
			VALUE="$VALUE $1"
			shift
			let "SHIFTCOUNT=$SHIFTCOUNT+1"
		done
	else
		fail 254 "Missing $NAME argument"
	fi
	VALUE="${VALUE:1}"
}

openinfo() {
	exec 3<> $1
	INFO=3
}

closeinfo() {
	exec 3>&-
}

COMMANDLINE=$@
WFDIR=$PWD
openinfo "wrapper.log"
ID=$1
checkEmpty "$ID" "Missing job ID"

shift

getarg "-jobdir" "$@"
JOBDIR=$VALUE
shift $SHIFTCOUNT

checkEmpty "$JOBDIR" "Missing job directory prefix"
mkdir -p $WFDIR/info/$JOBDIR
closeinfo
rm -f "$WFDIR/info/$JOBDIR/${ID}-info"
openinfo "$WFDIR/info/$JOBDIR/${ID}-info"

logstate "LOG_START"
infosection "Wrapper"

mkdir -p $WFDIR/status/$JOBDIR

getarg "-e" "$@"
EXEC=$VALUE
shift $SHIFTCOUNT

getarg "-out" "$@"
STDOUT=$VALUE
shift $SHIFTCOUNT

getarg "-err" "$@"
STDERR=$VALUE
shift $SHIFTCOUNT

getarg "-i" "$@"
STDIN=$VALUE
shift $SHIFTCOUNT

getarg "-d" "$@"
DIRS=$VALUE
shift $SHIFTCOUNT

getarg "-if" "$@"
INF=$VALUE
shift $SHIFTCOUNT

getarg "-of" "$@"
OUTF=$VALUE
shift $SHIFTCOUNT

getarg "-k" "$@"
KICKSTART=$VALUE
shift $SHIFTCOUNT

if [ "$1" == "-a" ]; then
	shift
else
	fail 254 "Missing arguments (-a option)"
fi

if [ "X$SWIFT_JOBDIR_PATH" != "X" ]; then
  log "Job directory mode is: local copy"
  DIR=${SWIFT_JOBDIR_PATH}/$JOBDIR/$ID
  COPYNOTLINK=1
else
  log "Job directory mode is: link on shared filesystem"
  DIR=jobs/$JOBDIR/$ID
  COPYNOTLINK=0
fi

PATH=$PATH:/bin:/usr/bin

if [ "$PATHPREFIX" != "" ]; then
export PATH=$PATHPREFIX:$PATH
fi

if [ "X${EXEC:0:1}" != "X/" ] ; then
export EXEC=$(which $EXEC)
fi

log "DIR=$DIR"
log "EXEC=$EXEC"
log "STDIN=$STDIN"
log "STDOUT=$STDOUT"
log "STDERR=$STDERR"
log "DIRS=$DIRS"
log "INF=$INF"
log "OUTF=$OUTF"
log "KICKSTART=$KICKSTART"
log "ARGS=$@"
log "ARGC=$#"

IFS="|"

logstate "CREATE_JOBDIR"
mkdir -p $DIR
checkError 254 "Failed to create job directory $DIR"
log "Created job directory: $DIR"

logstate "CREATE_INPUTDIR"
for D in $DIRS ; do
	mkdir -p "$DIR/$D" 2>&1 >>"$INFO"
	checkError 254 "Failed to create input directory $D"
	log "Created output directory: $DIR/$D"
done

logstate "LINK_INPUTS"
for L in $INF ; do
	if [ $COPYNOTLINK = 1 ]; then
		cp "$PWD/shared/$L" "$DIR/$L" 2>&1 >& $INFO
		checkError 254 "Failed to copy input file $L"
		log "Copied input: $PWD/shared/$L to $DIR/$L"
	else
		ln -s "$PWD/shared/$L" "$DIR/$L" 2>&1 >& $INFO
		checkError 254 "Failed to link input file $L"
		log "Linked input: $PWD/shared/$L to $DIR/$L"
	fi
done

logstate "EXECUTE"
cd $DIR

#ls >>$WRAPPERLOG
if [ ! -f "$EXEC" ]; then
	fail 254 "The executable $EXEC does not exist"
fi
if [ ! -x "$EXEC" ]; then
	fail 254 "The executable $EXEC does not have the executable bit set"
fi
if [ "$KICKSTART" == "" ]; then
	if [ "$STDIN" == "" ]; then
		"$EXEC" "$@" 1>"$STDOUT" 2>"$STDERR"
	else
		"$EXEC" "$@" 1>"$STDOUT" 2>"$STDERR" <"$STDIN"
	fi
	checkError $? "Exit code $?"
else
	if [ ! -f "$KICKSTART" ]; then
		log "Kickstart executable ($KICKSTART) not found"
		fail 254 "The Kickstart executable ($KICKSTART) was not found"
	elif [ ! -x "$KICKSTART" ]; then
		log "Kickstart executable ($KICKSTART) is not executable"
		fail 254 "The Kickstart executable ($KICKSTART) does not have the executable bit set"
	else
		mkdir -p $WFDIR/kickstart/$JOBDIR
		log "Using Kickstart ($KICKSTART)"
		if [ "$STDIN" == "" ]; then
			"$KICKSTART" -H -o "$STDOUT" -e "$STDERR" "$EXEC" "$@" 1>kickstart.xml 2>"$STDERR"
		else
			"$KICKSTART" -H -o "$STDOUT" -i "$STDIN" -e "$STDERR" "$EXEC" "$@" 1>kickstart.xml 2>"$STDERR"
		fi
		export APPEXIT=$?
		mv -f kickstart.xml "$WFDIR/kickstart/$JOBDIR/$ID-kickstart.xml" 2>&1 >& "$INFO"
		checkError 254 "Failed to copy Kickstart record to shared directory"
		if [ "$APPEXIT" != "0" ]; then
			fail $APPEXIT "Exit code $APPEXIT"
		fi
	fi
fi

cd $WFDIR

logstate "EXECUTE_DONE"
log "Job ran successfully"

MISSING=
for O in $OUTF ; do
	if [ ! -f "$DIR/$O" ]; then
		if [ "$MISSING" == "" ]; then
			MISSING=$O
		else
			MISSING="$MISSING, $O"
		fi
	fi
done
if [ "$MISSING" != "" ]; then
	fail 254 "The following output files were not created by the application: $MISSING"
fi

logstate "COPYING_OUTPUTS"
for O in $OUTF ; do
	cp "$DIR/$O" "shared/$O" 2>&1 >& "$INFO"
	checkError 254 "Failed to copy output file $O to shared directory"
done

logstate "RM_JOBDIR"
rm -rf "$DIR" 2>&1 >& "$INFO"
checkError 254 "Failed to remove job directory $DIR"

logstate "TOUCH_SUCCESS"
touch status/${JOBDIR}/${ID}-success
logstate "END"

closeinfo

# this script must be invoked inside of bash, not plain sh

infosection() {
	echo >& "$INFO"
	echo "_____________________________________________________________________________" >& "$INFO"
	echo >& "$INFO"
	echo "        $1" >& "$INFO"
	echo "_____________________________________________________________________________" >& "$INFO"
	echo >& "$INFO"
}

info() {
	infosection "uname -a"
	uname -a 2>&1 >& "$INFO"
	infosection "id"
	id 2>&1 >& "$INFO"
	infosection "env"
	env 2>&1 >& "$INFO"
	infosection "df"
	df 2>&1 >& "$INFO"
	infosection "/proc/cpuinfo"
	cat /proc/cpuinfo 2>&1 >& "$INFO"
	infosection "/proc/meminfo"
	cat /proc/meminfo 2>&1 >& "$INFO"
	infosection "command line"
	echo $COMMANDLINE 2>&1 >& "$INFO"
}

logstate() {
	echo "Progress " `date +"%Y-%m-%d %H:%M:%S.%N%z"` " $@" >& "$INFO"
}

log() {
	echo "$@" >& "$INFO"
}

fail() {
	EC=$1
	shift
	echo $@ >"$WFDIR/status/$JOBDIR/${ID}-error"
	log $@
	info
	#exit $EC
	#let vdl-int.k handle the issues
	exit 0
}

checkError() {
	if [ "$?" != "0" ]; then
		fail $@
	fi
}

checkEmpty() {
	if [ "$1" == "" ]; then
		shift
		fail 254 $@
	fi
}

getarg() {
	NAME=$1
	shift
	VALUE=""
	SHIFTCOUNT=0
	if [ "$1" == "$NAME" ]; then
		shift
		let "SHIFTCOUNT=$SHIFTCOUNT+1"
		while [ "${1:0:1}" != "-" ] && [ "$#" != "0" ]; do
			VALUE="$VALUE $1"
			shift
			let "SHIFTCOUNT=$SHIFTCOUNT+1"
		done
	else
		fail 254 "Missing $NAME argument"
	fi
	VALUE="${VALUE:1}"
}

openinfo() {
	exec 3<> $1
	INFO=3
}

closeinfo() {
	exec 3>&-
}

COMMANDLINE=$@
WFDIR=$PWD
openinfo "wrapper.log"
ID=$1
checkEmpty "$ID" "Missing job ID"

shift

getarg "-jobdir" "$@"
JOBDIR=$VALUE
shift $SHIFTCOUNT

checkEmpty "$JOBDIR" "Missing job directory prefix"
mkdir -p $WFDIR/info/$JOBDIR
closeinfo
rm -f "$WFDIR/info/$JOBDIR/${ID}-info"
openinfo "$WFDIR/info/$JOBDIR/${ID}-info"

logstate "LOG_START"
infosection "Wrapper"

mkdir -p $WFDIR/status/$JOBDIR

getarg "-e" "$@"
EXEC=$VALUE
shift $SHIFTCOUNT

getarg "-out" "$@"
STDOUT=$VALUE
shift $SHIFTCOUNT

getarg "-err" "$@"
STDERR=$VALUE
shift $SHIFTCOUNT

getarg "-i" "$@"
STDIN=$VALUE
shift $SHIFTCOUNT

getarg "-d" "$@"
DIRS=$VALUE
shift $SHIFTCOUNT

getarg "-if" "$@"
INF=$VALUE
shift $SHIFTCOUNT

getarg "-of" "$@"
OUTF=$VALUE
shift $SHIFTCOUNT

getarg "-k" "$@"
KICKSTART=$VALUE
shift $SHIFTCOUNT

if [ "$1" == "-a" ]; then
	shift
else
	fail 254 "Missing arguments (-a option)"
fi

if [ "X$SWIFT_JOBDIR_PATH" != "X" ]; then
  log "Job directory mode is: local copy"
  DIR=${SWIFT_JOBDIR_PATH}/$JOBDIR/$ID
  COPYNOTLINK=1
else
  log "Job directory mode is: link on shared filesystem"
  DIR=jobs/$JOBDIR/$ID
  COPYNOTLINK=0
fi

PATH=$PATH:/bin:/usr/bin

if [ "$PATHPREFIX" != "" ]; then
export PATH=$PATHPREFIX:$PATH
fi

if [ "X${EXEC:1:1}" != "X/" ] ; then
export EXEC=$(which $EXEC)
fi

log "DIR=$DIR"
log "EXEC=$EXEC"
log "STDIN=$STDIN"
log "STDOUT=$STDOUT"
log "STDERR=$STDERR"
log "DIRS=$DIRS"
log "INF=$INF"
log "OUTF=$OUTF"
log "KICKSTART=$KICKSTART"
log "ARGS=$@"
log "ARGC=$#"

IFS="|"

logstate "CREATE_JOBDIR"
mkdir -p $DIR
checkError 254 "Failed to create job directory $DIR"
log "Created job directory: $DIR"

logstate "CREATE_INPUTDIR"
for D in $DIRS ; do
	mkdir -p "$DIR/$D" 2>&1 >>"$INFO"
	checkError 254 "Failed to create input directory $D"
	log "Created output directory: $DIR/$D"
done

logstate "LINK_INPUTS"
for L in $INF ; do
	if [ $COPYNOTLINK = 1 ]; then
		cp "$PWD/shared/$L" "$DIR/$L" 2>&1 >& $INFO
		checkError 254 "Failed to copy input file $L"
		log "Copied input: $PWD/shared/$L to $DIR/$L"
	else
		ln -s "$PWD/shared/$L" "$DIR/$L" 2>&1 >& $INFO
		checkError 254 "Failed to link input file $L"
		log "Linked input: $PWD/shared/$L to $DIR/$L"
	fi
done

logstate "EXECUTE"
cd $DIR

#ls >>$WRAPPERLOG
if [ ! -f "$EXEC" ]; then
	fail 254 "The executable $EXEC does not exist"
fi
if [ ! -x "$EXEC" ]; then
	fail 254 "The executable $EXEC does not have the executable bit set"
fi
if [ "$KICKSTART" == "" ]; then
	if [ "$STDIN" == "" ]; then
		"$EXEC" "$@" 1>"$STDOUT" 2>"$STDERR"
	else
		"$EXEC" "$@" 1>"$STDOUT" 2>"$STDERR" <"$STDIN"
	fi
	checkError $? "Exit code $?"
else
	if [ ! -f "$KICKSTART" ]; then
		log "Kickstart executable ($KICKSTART) not found"
		fail 254 "The Kickstart executable ($KICKSTART) was not found"
	elif [ ! -x "$KICKSTART" ]; then
		log "Kickstart executable ($KICKSTART) is not executable"
		fail 254 "The Kickstart executable ($KICKSTART) does not have the executable bit set"
	else
		mkdir -p $WFDIR/kickstart/$JOBDIR
		log "Using Kickstart ($KICKSTART)"
		if [ "$STDIN" == "" ]; then
			"$KICKSTART" -H -o "$STDOUT" -e "$STDERR" "$EXEC" "$@" 1>kickstart.xml 2>"$STDERR"
		else
			"$KICKSTART" -H -o "$STDOUT" -i "$STDIN" -e "$STDERR" "$EXEC" "$@" 1>kickstart.xml 2>"$STDERR"
		fi
		export APPEXIT=$?
		mv -f kickstart.xml "$WFDIR/kickstart/$JOBDIR/$ID-kickstart.xml" 2>&1 >& "$INFO"
		checkError 254 "Failed to copy Kickstart record to shared directory"
		if [ "$APPEXIT" != "0" ]; then
			fail $APPEXIT "Exit code $APPEXIT"
		fi
	fi
fi

cd $WFDIR

logstate "EXECUTE_DONE"
log "Job ran successfully"

MISSING=
for O in $OUTF ; do
	if [ ! -f "$DIR/$O" ]; then
		if [ "$MISSING" == "" ]; then
			MISSING=$O
		else
			MISSING="$MISSING, $O"
		fi
	fi
done
if [ "$MISSING" != "" ]; then
	fail 254 "The following output files were not created by the application: $MISSING"
fi

logstate "COPYING_OUTPUTS"
for O in $OUTF ; do
	cp "$DIR/$O" "shared/$O" 2>&1 >& "$INFO"
	checkError 254 "Failed to copy output file $O to shared directory"
done

logstate "RM_JOBDIR"
rm -rf "$DIR" 2>&1 >& "$INFO"
checkError 254 "Failed to remove job directory $DIR"

logstate "TOUCH_SUCCESS"
touch status/${JOBDIR}/${ID}-success
logstate "END"

closeinfo


added clang for iOS workaround

added clang for iOS workaround

error: pathspec 'clang/scan-build-fix.sh' did not match any file(s) known to git


Import for jreese/oh-my-zsh custom script

# Copyright 2015 John Reese
# Licensed under the MIT license
#
# Update terminal/tmux window titles based on location/command

function update_title() {
  if [ -n "$TMUX" ]; then
    # escape '%' in $1, make nonprintables visible
    a=${(V)1//\%/\%\%}
    a=$(print -Pn "%20>...>$a" | tr -d "\n")
    print -Pn "\ek$a:$2\e\\"
  fi
}

# called just before the prompt is printed
function precmd() {
  update_title "zsh" "%55<...<%~"
}

# called just before a command is executed
function preexec() {
  update_title "$1" "%55<...<%~"
}

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


Trying to rebase

Trying to rebase

#!/bin/bash
#$ -V
#-pe mpi-8 8
#$ -N ZapdosInstall
#$ -M jhaase1@nd.edu
#$ -m ae
#$ -r y

#if [ -r /opt/crc/Modules/current/init/bash ]
#	then
#	    source /opt/crc/Modules/current/init/bash
#fi

#module unload intel gcc git matlab ompi allinea
#module load cmake git gcc/4.9.2 ompi/1.10.2-gcc-4.9.2 boost/1.61

#source /afs/crc.nd.edu/user/j/jhaase1/Moose-dir/moose.bash

#export CC=mpicc
#export CXX=mpicxx
#export F90=mpif90
#export F77=mpif77
#export FC=mpif90

make -j8

make METHOD=dbg -j8

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


(+)add build script for FreeBSD

(+)add build script for FreeBSD

#!/bin/sh

export BUILD_ROOT=$PWD

if [ -z $LITEIDE_ROOT ]; then
	export LITEIDE_ROOT=$PWD/../liteidex
fi

echo build liteide
echo QTDIR=$QTDIR
echo GOROOT=$GOROOT
echo BUILD_ROOT=$BUILD_ROOT
echo LITEIDE_ROOT=$LITEIDE_ROOT
echo .

if [ -z $QTDIR ]; then
	echo 'error, QTDIR is null'
	exit 1
fi

export PATH=$QTDIR/bin:$PATH

echo qmake liteide ...
echo .
qmake $LITEIDE_ROOT -spec freebsd-g++ "CONFIG+=release"

if [ $? -ge 1 ]; then
	echo 'error, qmake fail'
	exit 1
fi

echo make liteide ...
echo .
make

if [ $? -ge 1 ]; then
	echo 'error, make fail'
	exit 1
fi

go version
if [ $? -ge 1 ]; then
	echo 'error, not find go in PATH'
	exit 1
fi

echo build liteide tools ...
cd $LITEIDE_ROOT
export GOPATH=$PWD

go install -ldflags "-s" -v liteide_stub
go install -ldflags "-s" -v github.com/visualfc/goimports
go install -ldflags "-s" -v github.com/nsf/gocode

if [ $? -ge 1 ]; then
	echo 'error, go install fail'
	exit 1
fi

echo deploy ...

cd $BUILD_ROOT

rm -r liteide
mkdir -p liteide
mkdir -p liteide/bin
mkdir -p liteide/share/liteide
mkdir -p liteide/lib/liteide/plugins

cp -a -v $LITEIDE_ROOT/LICENSE.LGPL liteide
cp -a -v $LITEIDE_ROOT/LGPL_EXCEPTION.TXT liteide
cp -a -v $LITEIDE_ROOT/../README.md liteide
cp -a -v $LITEIDE_ROOT/../CONTRIBUTORS liteide

cp -a -v $LITEIDE_ROOT/liteide/bin/* liteide/bin
cp -a -v $LITEIDE_ROOT/bin/* liteide/bin
cp -a -v $LITEIDE_ROOT/liteide/lib/liteide/plugins/*.so liteide/lib/liteide/plugins

cp -r -v $LITEIDE_ROOT/deploy/* liteide/share/liteide/
cp -r -v $LITEIDE_ROOT/os_deploy/freebsd/* liteide/share/liteide/

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


add ivs-callgrind script

add ivs-callgrind script

Wraps up the options I usually use with callgrind.

#!/bin/bash -eu
################################################################
#
#        Copyright 2013, Big Switch Networks, Inc.
#
# Licensed under the Eclipse Public License, Version 1.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.eclipse.org/legal/epl-v10.html
#
# 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.
#
################################################################

export VALGRIND_OPTIONS="--tool=callgrind --cache-sim=yes --branch-sim=yes --dump-instr=yes --callgrind-out-file=profile.kcg"
trap "{ sudo chmod a+r profile.kcg; echo Output left in profile.kcg; }" EXIT
$(dirname $(readlink -f $0))/ivs-valgrind.sh "$@"

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


uninstall fixed in rpm

uninstall fixed in rpm

#!/bin/sh

for i in `rpm -q -a | grep turnserver-utils-`
do
  echo $i
  sudo rpm -e $i
done

for i in `rpm -q -a | grep turnserver-client-libs-`
do
  echo $i
  sudo rpm -e $i
done

for i in `rpm -q -a | grep turnserver.*-`
do
  echo $i
  sudo rpm -e $i
done

#!/bin/sh

for i in `rpm -q -a | grep turnserver-utils-3`
do
  echo $i
  sudo rpm -e $i
done

for i in `rpm -q -a | grep turnserver-client-libs-3`
do
  echo $i
  sudo rpm -e $i
done

for i in `rpm -q -a | grep turnserver.*-3`
do
  echo $i
  sudo rpm -e $i
done


Add script to create index by URL using hardlinks

#!/bin/sh

#
# Before:
#   > df -i /mnt/datavolume/zoomhub/
#   Filesystem      Inodes   IUsed   IFree IUse% Mounted on
#   /dev/xvdb1     6553600 1192855 5360745   19% /mnt/datavolume
#

CONTENT_BY_ID='/mnt/datavolume/zoomhub/data/content-by-id'
CONTENT_BY_URL='/mnt/datavolume/zoomhub/data/content-by-url'
for target in $CONTENT_BY_ID/*.json ;
do
  content=$(cat "$target")
  contentID=$(printf "$content" | json 'id')
  contentURL=$(printf "$content" | json url)
  targetHash=$(printf "$contentURL" | sha256sum | tr -d '[:space:]-')
  linkName="$CONTENT_BY_URL/$targetHash.json"
  echo "Processing: $contentID"
  ln $target $linkName
done

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


Add server packages, add UFW config, format the code

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/rajasdevel/machine_init.git/'


Added ez and sz aliases for quick editing zshrc

alias ez='vim ~/.zshrc'
alias sz='source ~/.zshrc'

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


Create pipeline.sh

Create pipeline.sh

#!/bin/bash

# I would actually run these in separate terminals rather than backgrounding the processes, so that I can easily see what's going on
./consume-1.usa.gov.sh | python insert_referrer_by_city.py &
python decrementer.py &
python city-bot-api.py &

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


Add script to use tempest-lib files in tempest

As many files have been migrated to tempest-lib and
we need to remove those from tempest and make use of lib.

That is easy work but doing it manually takes times.
Automating that process same way it was done for migrating files to lib.

This commit adds new script use_tempest_lib for using the files
from tempest-lib.

In short this script does below steps-

- Get the latest tempest commit-id of file.
- Clone the tempest-lib and fetch the migration commit information
  - Get the tempest commit-id of file which was migrated to lib.
- Check Diff of both (latest commit-id and migrated commit-id).
- If both are same then delete those files from tempest and edit import of
  those file using tempest-lib file.

Sample - Id28c615534235c345e31b895a77a53ceac4af1a4

Change-Id: I8177f47113b6ab9b23af8ff86b87bb946ad549ad

#!/bin/bash
#
# Use this script to use interfaces/files from tempest-lib.
# Many files have been migrated to tempest-lib and tempest has
# its own copy too.
# This script helps to remove those from tempest and make use of tempest-lib.
# It adds the change-id of each file on which they were migrated in lib.
# This should only be done for files which were migrated to lib with
# "Migrated" in commit message as done by tempest-lib/tools/migrate_from_tempest.sh script.
# "Migrated" keyword is used to fetch the migration commit history from lib.
# To use:
#  1. Create a new branch in the tempest repo so not to destroy your current
#     working branch
#  2. Run the script from the repo dir and specify the file paths relative to
#     the root tempest dir(only code and unit tests):
#
#   tools/use_tempest_lib.sh.sh tempest/file1.py tempest/file2.py

function usage {
    echo "Usage: $0 [OPTION] file1 file2 .."
    echo "Use files from tempest-lib"
    echo -e "Input files should be tempest files with path. \n  Example- tempest/file1.py tempest/file2.py .."
    echo ""
    echo "-s, --service_client Specify if files are service clients."
    echo "-u, --tempest_lib_git_url Specify the repo to clone tempest-lib from."
}

function check_all_files_valid {
    failed=0
    for file in $files; do
        # Get the latest change-id for each file
        latest_commit_id=`git log -n1 -- $file | grep "^commit" | awk '{print $2}'`
        cd $tmpdir
        filename=`basename $file`
        lib_path=`find ./ -name $filename`
        if [ -z $lib_path ]; then
            echo "ERROR: $filename does not exist in tempest-lib."
            failed=$(( failed + 1))
            cd - > /dev/null
            continue
        fi
        # Get the CHANGE_ID of tempest-lib patch where file was migrated
        migration_change_id=`git log  -n1 --grep "Migrated" -- $lib_path | grep "Change-Id: " | awk '{print $2}'`
        MIGRATION_IDS=`echo -e "$MIGRATION_IDS\n * $filename: $migration_change_id"`
        # Get tempest CHANGE_ID of file which was migrated to lib
        migrated_change_id=`git log  -n1 --grep "Migrated" -- $lib_path | grep "* $filename"`
        migrated_change_id=${migrated_change_id#*:}
        cd - > /dev/null
        # Get the commit-id of tempest which was migrated to tempest-lib
        migrated_commit_id=`git log --grep "$migrated_change_id" -- $file | grep "^commit" | awk '{print $2}'`
        DIFF=$(git diff $latest_commit_id $migrated_commit_id $file)
        if [ "$DIFF" != "" ]; then
            echo "ERROR: $filename in tempest has been updated after migration to tempest-lib. First sync the file to tempest-lib."
            failed=$(( failed + 1))
        fi
    done
    if [[ $failed -gt 0 ]]; then
        echo "$failed files had issues"
        exit $failed
    fi
}

set -e

service_client=0
file_list=''

while [ $# -gt 0 ]; do
    case "$1" in
        -h|--help) usage; exit;;
        -u|--tempest_lib_git_url) tempest_lib_git_url="$2"; shift;;
        -s|--service_client) service_client=1;;
        *) files="$files $1";;
    esac
    shift
done

if [ -z "$files" ]; then
    usage; exit
fi

TEMPEST_LIB_GIT_URL=${tempest_lib_git_url:-git://git.openstack.org/openstack/tempest-lib}

tmpdir=$(mktemp -d -t use-tempest-lib.XXXX)

# Clone tempest-lib
git clone $TEMPEST_LIB_GIT_URL $tmpdir

# Checks all provided files are present in lib and
# not updated in tempest after migration to lib.
check_all_files_valid

for file in $files; do
    rm -f $file
    tempest_dir=`pwd`
    tempest_dir="$tempest_dir/tempest/"
    tempest_dirname=`dirname $file`
    lib_dirname=`echo $tempest_dirname | sed s@tempest\/@tempest_lib/\@`
    # Convert tempest dirname to import string
    tempest_import="${tempest_dirname//\//.}"
    tempest_import=${tempest_import:2:${#tempest_import}}
    if [ $service_client -eq 1 ]; then
        # Remove /json path because tempest-lib supports JSON only without XML
        lib_dirname=`echo $lib_dirname | sed s@\/json@@`
    fi
    # Convert tempest-lib dirname to import string
    tempest_lib_import="${lib_dirname//\//.}"
    tempest_lib_import=${tempest_lib_import:2:${#tempest_lib_import}}
    module_name=`basename $file .py`
    tempest_import1="from $tempest_import.$module_name"
    tempest_lib_import1="from $tempest_lib_import.$module_name"
    tempest_import2="from $tempest_import import $module_name"
    tempest_lib_import2="from $tempest_lib_import import $module_name"
    set +e
    grep -rl "$tempest_import1" $tempest_dir | xargs sed -i'' s/"$tempest_import1"/"$tempest_lib_import1"/g 2> /dev/null
    grep -rl "$tempest_import2" $tempest_dir | xargs sed -i'' s/"$tempest_import2"/"$tempest_lib_import2"/g 2> /dev/null
    set -e
    if [[ -z "$file_list" ]]; then
        file_list="$module_name"
    else
        tmp_file_list="$file_list, $module_name"
        char_size=`echo $tmp_file_list | wc -c`
        if [ $char_size -lt 27 ]; then
            file_list="$file_list, $module_name"
        fi
    fi
done

rm -rf $tmpdir
echo "Completed. Run pep8 and fix error if any"

git add -A tempest/
# Generate a migration commit
commit_message="Use $file_list from tempest-lib"
pre_list=$"The files below have been migrated to tempest-lib\n"
pre_list=`echo -e $pre_list`
post_list=$"Now Tempest-lib provides those as stable interfaces. So Tempest should\nstart using those from lib and remove its own copy."
post_list=`echo -e $post_list`

git commit -m "$commit_message" -m "$pre_list" -m "$MIGRATION_IDS" -m "$post_list"

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


Add a top level configure script

Add a top level configure script

#!/usr/bin/env bash

if [ "$(uname)" == "Darwin" ]; then
    ./configure/mac.sh
elif [ -f /etc/os-release ]; then
    . /etc/os-release

    if [ "$NAME" == "Arch Linux" ]; then
        echo Updating Arch
        ./configure/antergos.sh
    elif [ "$NAME" == "Ubuntu" ]; then
        echo Updating Ubuntu
        ./configure/ubuntu.sh
    else
        echo Failed to detect the Linux distribution
        exit 1
    fi
else
    echo Failed to detect the OS
    exit 1
fi

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


[MAVENUPLOAD-982] Added jwebunit sync

[MAVENUPLOAD-982] Added jwebunit sync

git-svn-id: 2c527eb49caa05e19d6b2be874bf74fa9d7ea670@424324 13f79535-47bb-0310-9956-ffa450edef68

#!/bin/sh

FROM=carlossg@shell.sourceforge.net:/home/groups/j/jw/jwebunit/htdocs/m2-repo/net/sourceforge/jwebunit/
TO=net/sourceforge/jwebunit/

source ./m2-sync.sh

error: pathspec 'maven-meeper/src/bin/m2-sync/jwebunit-m2-sync.sh' did not match any file(s) known to git


Switch to using parallel-conformance.sh

Switch to using parallel-conformance.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/samsung-cnct/kraken-ci-jobs.git/'


add bash solution for Word Frequency

add bash solution for Word Frequency

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/hawkphantomnet/leetcode.git/'


package Vagrant base box, set correct VM name

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


fix services:status, refactoring to camelCase

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/wheniwork/harpoon.git/'


installing custom install script

installing custom install script

#!/bin/bash
# Install tomcat locally - https://tomcat.apache.org/index.html
#
# change the following environment variables to your project configuration as needed,
# otherwise the defaults below will be used.
# * TOMCAT_VERSION
#
# Include the following command your builds:
# \curl -sSL https://raw.githubusercontent.com/codeship/scripts/master/packages/tomcat.sh | bash -s

TOMCAT_VERSION=${TOMCAT_VERSION:="8.5.9"}
TOMCAT_DIR=${TOMCAT_DIR="$HOME/tocat"}
TOMCAT_WAIT_TIME=${TOMCAT_WAIT_TIME:="10"}

set -e
CACHED_DOWNLOAD="${HOME}/cache/apache-tomcat-${TOMCAT_VERSION}.tar.gz"

mkdir -p "${TOMCAT_DIR}"
wget --continue --output-document "${CACHED_DOWNLOAD}" "http://www-us.apache.org/dist/tomcat/tomcat-8/v${TOMCAT_VERSION}/bin/apache-tomcat-${TOMCAT_VERSION}.tar.gz"
tar -xaf "${CACHED_DOWNLOAD}" --directory "${TOMCAT_DIR}"

# Make sure to use the exact parameters you want for Tomcat and give it enough sleep time to properly start up
bash ${TOMCAT_DIR}/bash apache-tomcat-${TOMCAT_VERSION}/bin/startup.sh
sleep ${TOMCAT_SLEEP_TIME}
cd -

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


environment fix.

environment fix.

#!/bin/sh -e

if [ -z "$DDNS_USERNAME" -o -z "$DDNS_TOKEN" -o -z "$DDNS_DOMAIN" ] ; then
  echo "required environment: DDNS_USERNAME DDNS_TOKEN DDNS_DOMAIN; skipping dynamic dns"
  exit 0
fi

export DDNS_HOSTNAME=`curl --silent http://169.254.169.254/latest/meta-data/hostname | cut -f1 -d.`

ddns=/etc/cron.hourly/ddns

../../render.py < ddns > $ddns

chmod 755 $ddns

$ddns

for init in ddns ; do
    install $init.init /etc/init.d/$init
    update-rc.d $init defaults
done

# wait until the DNS catches up ...

./wait.py

#!/bin/sh -e

if [ -z "$DDNS_USERNAME" -o -z "$DDNS_TOKEN" -o -z "$DDNS_DOMAIN" ] ; then
  echo "required environment: DDNS_USERNAME DDNS_TOKEN DDNS_DOMAIN; skipping dynamic dns"
  exit 0
fi

DDNS_HOSTNAME=`curl --silent http://169.254.169.254/latest/meta-data/hostname | cut -f1 -d.`

ddns=/etc/cron.hourly/ddns

../../render.py < ddns > $ddns

chmod 755 $ddns

$ddns

for init in ddns ; do
    install $init.init /etc/init.d/$init
    update-rc.d $init defaults
done

# wait until the DNS catches up ...

./wait.py


Try to forece omake.0.9.8 even after an upgrade for CI tests (2nd).

. "$(dirname $0)/packages.bash" || exit 1
. "$(dirname $0)/opam.bash" || exit 1
mkdir dist || true
opam install omake.0.9.8.6-0.rc1
opam install $OPAM_PKGS
export OCAMLRUNPARAM=b
ocaml setup.ml -distclean
ocaml setup.ml -configure --enable-tests --enable-devel ${CONFIGURE_ARGS}
ocaml setup.ml -build
ocaml setup.ml -test ${TEST_ARGS}

. "$(dirname $0)/packages.bash" || exit 1
. "$(dirname $0)/opam.bash" || exit 1
mkdir dist || true
opam install $OPAM_PKGS
opam install omake.0.9.8.6-0.rc1
export OCAMLRUNPARAM=b
ocaml setup.ml -distclean
ocaml setup.ml -configure --enable-tests --enable-devel ${CONFIGURE_ARGS}
ocaml setup.ml -build
ocaml setup.ml -test ${TEST_ARGS}


Update PCRE to 8.40

Update PCRE to 8.40

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/elkuku/openshift-diy-php.git/'


Make sure invalid form of DURATION property value is parsed and fixed.

git-svn-id: 0c33e958600270102f91bf5868e396345dde476c@7362 e27351fd-9f3e-4f54-a53b-843176b1656c

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/red-hood/calendarserver.git/'


Added script to create bundle.

Added script to create bundle.

#!/usr/bin/env bash

cd $(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
dotnet restore -r osx-arm64
dotnet msbuild -t:BundleApp -p:RuntimeIdentifier=osx-arm64 -p:_AvaloniaUseExternalMSBuild=false

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


Create 05-install-apache.sh

Create 05-install-apache.sh

# Copyright © 2018 Feature.su. All rights reserved.
# Licensed under the Apache License, Version 2.0

if [ "`systemctl is-active apache2`" != "active" ]
then
apt-get -y install apache2 libapache2-mpm-itk php libapache2-mod-php
a2enmod mpm_prefork
a2enmod mpm_itk
a2enmod php7.0
a2enmod macro

firewall-cmd --zone=public --permanent --add-service=http
firewall-cmd --reload

sed -i "s/Listen 80/Listen 0.0.0.0:80/g" /etc/apache2/ports.conf
sed -i "s/Listen 443/Listen 0.0.0.0:443/g" /etc/apache2/ports.conf

echo "<Directory \"/var/www\">" > /etc/apache2/conf-available/allowoverride.conf
echo "Options -Indexes" >> /etc/apache2/conf-available/allowoverride.conf
echo "AllowOverride All" >> /etc/apache2/conf-available/allowoverride.conf
echo "</Directory>" >> /etc/apache2/conf-available/allowoverride.conf
a2enconf allowoverride

wget -O /etc/apache2/conf-available/vhost.conf https://raw.githubusercontent.com/faew/linux.feature/master/conf/centos7/apache24/10-vhost.conf
sed -i "s/httpd/apache2/g" /etc/apache2/conf-available/vhost.conf
sed -i "s/LoadModule/# LoadModule/g" /etc/apache2/conf-available/vhost.conf
a2enconf vhost

a2enmod remoteip
echo "RemoteIPHeader X-Forwarded-For" > /etc/apache2/conf-available/remoteip.conf
echo "RemoteIPInternalProxy 127.0.0.1" >> /etc/apache2/conf-available/remoteip.conf
echo 'LogFormat "%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined' >> /etc/apache2/conf-available/remoteip.conf
a2enconf remoteip

a2dissite 000-default
sh add-www-user.sh 000-empty.local

systemctl enable apache2
systemctl start apache2

else
echo "Warning: httpd already install"
fi

error: pathspec 'script/ubuntu16/05-install-apache.sh' did not match any file(s) known to git


[maintenance] removed custom/example.zsh

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/StyxOfDynamite/oh-my-zsh.git/'


Added prepare.sh to wuftpd.

Added prepare.sh to wuftpd.

#!/bin/bash
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
echo "compiling exploit file: wuftpd-god.c"
gcc -m32 -lresolv -lcrypt -lnsl $DIR/wuftpd-god.c > $DIR/wuftpd-god
echo "compiled exploit file."

error: pathspec 'benchmarks/wu-ftpd-2.6.0/prepare.sh' did not match any file(s) known to git


Finished backup-github-repos script.  Need to add some elegant ways to detect whether or not the user specified the github username or not.  Also need to add some detection for which version of jq to download (linux or macosx).

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/bryankaraffa/backup-git-repos.git/'


x paralllel

x paralllel

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/'


fixes error messages

fixes error messages

#!/bin/sh

PATH="$PATH:/usr/games"

cowsay "$(fortune gfortunes)"

#!/bin/sh

PATH="$PATH:/usr/games"

cowsay "$(fortune ./gfortunes)"


param

param

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/Georgetown-University-Libraries/batch-tools.git/'


solr root

solr root


add stix-json(jsmn) to shootout

add stix-json(jsmn) to shootout

[ ! -d vjson ] && hg clone https://code.google.com/p/vjson/
[ ! -d sajson ] && git clone https://github.com/chadaustin/sajson.git
[ ! -d stix-json ] && git clone -b nix-fix https://bitbucket.org/vivkin/stix-json.git
if [ ! -d shootout ]; then
	mkdir shootout
	cd shootout
	curl -O https://raw.github.com/Newbilius/big_json_import_demo/master/test_data/big.json
	curl https://raw.github.com/mrdoob/three.js/master/examples/models/animated/monster/monster.js > monster.json
	curl -O https://raw.github.com/tcorral/JSONC/master/Benchmark/obj/demo_pack_gzip_compress_with_base64/data/data.js
	echo "console.log(JSON.stringify(obj))" >> data.js
	node < data.js > data.json
	rm data.js
fi

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


jumpstack build script

jumpstack build script

#!/bin/bash

# simple script to build a devstack enabled image which
# also includes jumpgate

BLD_DIR=/tmp/bld

mkdir $BLD_DIR && cp -r ../* $BLD_DIR && pushd $BLD_DIR
sed -i 's|FROM dockerfile/ubuntu|FROM bodenr/docker-jumpgate|' $BLD_DIR/Dockerfile
docker build -t jumpstack .
popd
rm -rf $BLD_DIR

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