Setup script for O3D plugin installer. This is the installer that we will give to users that don't have a .deb or .rpm compatible distro. Creating a new issue since the last one was broken.

Review URL: http://codereview.chromium.org/173081

git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@23918 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

#!/bin/sh
# Installs O3D plugin for Linux.
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
#     * Redistributions of source code must retain the above copyright
#       notice, this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above
#       copyright notice, this list of conditions and the following disclaimer
#       in the documentation and/or other materials provided with the
#       distribution.
#     * Neither the name of Google Inc. nor the names of its
#       contributors may be used to endorse or promote products derived from
#       this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

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

CheckArch() {
  # Look for 32 or 64 bit arch from the kernel. If we can not get a read
  # on the arch, we'll go with "unknown".
  ARCH=$(uname -m)
  case $ARCH in
    i?86 | i86*)
      ARCH="32bit";;
    x86_64 | amd64)
      ARCH="64bit";;
    *)
      ARCH="unknown";;
  esac

  echo "System architecture mapped to: $ARCH"
}

SetRootUser() {
  # We need to be root (or run as sudo) in order to perform setup.
  USER=$(id -u)
  if [ "$USER" != "0" ]; then
    echo "You must be root (or sudo) to install this package."
    exit 1
  fi
}

SetupO3d() {
  # Create npapi plugin directories, copy and symlink libs.
  O3D_DIR="/opt/google/o3d"

  PLUGIN_DIRS="/usr/lib/firefox/plugins
               /usr/lib/iceape/plugins
               /usr/lib/iceweasel/plugins
               /usr/lib/midbrowser/plugins
               /usr/lib/mozilla/plugins
               /usr/lib/xulrunner/plugins
               /usr/lib/xulrunner-addons/plugins"

  LIBS="libCg.so
        libCgGL.so
        libGLEW.so.1.5"

  LIB3D="libnpo3dautoplugin.so"

  echo -n "Creating plugin directories..."
  mkdir -p $PLUGIN_DIRS $O3D_DIR
  echo "ok"

  echo -n "Installing files to $O3D_DIR..."
  install --mode=644 ${LIB3D} $O3D_DIR
  install --mode=644 ${LIBS} $O3D_DIR
  echo "ok"

  echo -n "Creating symlinks to plugin..."
  for dir in $PLUGIN_DIRS; do
    ln -sf ${O3D_DIR}/${LIB3D} ${dir}/
  done
  echo "ok"

  # If 32bit arch, use /usr/lib. If 64bit, use /usr/lib32
  if [ "$ARCH" = "32bit" ]; then
    LIBDIR="/usr/lib"
  elif [ "$ARCH" = "64bit" ]; then
    LIBDIR="/usr/lib32"
    NP_WRAP="yes"
  else
    echo "$ARCH not recognized"
    exit 1
  fi

  echo -n "Creating symlinks to libs..."
  mkdir -p $LIBDIR
  for lib in $LIBS; do
    if [ -e "${LIBDIR}/${lib}" ]; then
      echo "$lib already exists, not replacing."
    else
      ln -s ${O3D_DIR}/${lib} ${LIBDIR}/
    fi
  done
  echo "ok"

  # 64bit only: Check for nspluginwrapper, wrap libnpo3dautoplugin.so if found.
  if [ "$NP_WRAP" = "yes" ]; then
    echo -n "Attempting to wrap $LIB3D via nspluginwrapper..."
    NSPW=$(which nspluginwrapper)
    if [ -z "$NSPW" ]; then
      echo "
      nspluginwrapper not found. Without nspluginwrapper you will be
      unable to use O3D in 64-bit browsers. Continue installation? (y/N)"
      read answer
      if [ "$answer" = "y" ]; then
        echo "Ok, Installation complete."
        exit 0
      else
        echo "Aborted install at user request."
        exit 1
      fi
    fi
    WRAPPED_PLUGIN_PATH="/usr/lib/mozilla/plugins/npwrapper.libnpo3dautoplugin.so"
    APPS="iceape iceweasel firefox xulrunner midbrowser xulrunner-addons"
    echo -n "Wrapping $LIB3D..."
    $NSPW -i ${O3D_DIR}/${LIB3D}
    echo "ok"
    echo -n "Creating symlinks to npwrapper.libnpo3dautoplugin.so..."
    for app in $APPS; do
      ln -sf $WRAPPED_PLUGIN_PATH /usr/lib/${app}/plugins/
    done
    echo "ok"
  fi

  if [ $? -ne 0 ]; then
    echo "Installation failed"
    exit 1
  else
    echo "Installation completed successfully!"
  fi
}

CheckArch
SetRootUser
SetupO3d

error: pathspec 'o3d/installer/linux/generic/setup.sh' did not match any file(s) known to git


remove -f-default-real8 from FFLAGS

remove -f-default-real8 from FFLAGS

Former-commit-id: 994aaea98e9303be2d63bf1f989644d819e625c5

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/jswhit/py-ncepbufr.git/'


reorganize and add PSPDEV

reorganize and add PSPDEV

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


Remove useless function

Remove useless function

fatal: remote error: upload-pack: not our ref ae2ea3afa499531415f71cc132cb8f47a01d9ab2
fatal: the remote end hung up unexpectedly


Add "CircuitBuildTimeout 60" to flashproxy-exercise configuration.

See similar change in 3694b80e.

#!/bin/bash

# This script registers with the flash proxy facilitator, tries to download
# check.torproject.org, and saves a timestamped log file.

FLASHPROXY_DIR="$HOME/flashproxy"
TOR="$HOME/tor/src/or/tor"
LOCAL_PORT=1080
REMOTE_PORT=7070

declare -a PIDS_TO_KILL
stop() {
	if [ -n "${PIDS_TO_KILL[*]}" ]; then
		echo "Kill pids ${PIDS_TO_KILL[@]}."
		kill "${PIDS_TO_KILL[@]}"
	fi
	exit
}
trap stop EXIT

date

cd "$FLASHPROXY_DIR"
./connector.py --register ":$LOCAL_PORT" ":$REMOTE_PORT" &
PIDS_TO_KILL+=($!)

sleep 20

"$TOR" ClientTransportPlugin "websocket socks4 127.0.0.1:$LOCAL_PORT" UseBridges 1 Bridge "websocket 127.0.0.1:$LOCAL_PORT" LearnCircuitBuildTimeout 0 CircuitBuildTimeout 60 &
PIDS_TO_KILL+=($!)

sleep 60

curl --retry 5 --socks4a 127.0.0.1:9050 http://check.torproject.org/

#!/bin/bash

# This script registers with the flash proxy facilitator, tries to download
# check.torproject.org, and saves a timestamped log file.

FLASHPROXY_DIR="$HOME/flashproxy"
TOR="$HOME/tor/src/or/tor"
LOCAL_PORT=1080
REMOTE_PORT=7070

declare -a PIDS_TO_KILL
stop() {
	if [ -n "${PIDS_TO_KILL[*]}" ]; then
		echo "Kill pids ${PIDS_TO_KILL[@]}."
		kill "${PIDS_TO_KILL[@]}"
	fi
	exit
}
trap stop EXIT

date

cd "$FLASHPROXY_DIR"
./connector.py --register ":$LOCAL_PORT" ":$REMOTE_PORT" &
PIDS_TO_KILL+=($!)

sleep 20

"$TOR" ClientTransportPlugin "websocket socks4 127.0.0.1:$LOCAL_PORT" UseBridges 1 Bridge "websocket 127.0.0.1:$LOCAL_PORT" LearnCircuitBuildTimeout 0 &
PIDS_TO_KILL+=($!)

sleep 60

curl --retry 5 --socks4a 127.0.0.1:9050 http://check.torproject.org/


strict POSIX requires a path to specified to `find`

#!/bin/sh
# Parameters:
# $1 = source dir
# $2 = dst dir
# $top_builddir = well you guessed it

die_if_not_dir()
{
	for dir in "$@"; do
		test -d "$dir" && continue
		echo "Error: '$dir' is not a directory"
		exit 1
	done
}

# Ensure that created dirs/files have 755/644 perms
umask 022

# Sanity tests
die_if_not_dir "$1"
mkdir -p "$2" 2>/dev/null
die_if_not_dir "$2"
die_if_not_dir "$top_builddir"
if ! test -x "$top_builddir/extra/scripts/unifdef"; then
	echo "Error: need '$top_builddir/extra/scripts/unifdef' executable"
	exit 1
fi

# Sanitize and copy uclibc headers
(
# We must cd, or else we'll prepend "$1" to filenames!
cd "$1" || exit 1
find . ! -name '.' -a ! -path '*/.*' | sed -e 's/^\.\///' -e '/^config\//d' \
	-e '/^config$/d'
) | \
(
IFS=''
while read -r filename; do
	if test -d "$1/$filename"; then
		mkdir -p "$2/$filename" 2>/dev/null
		continue
	fi
	if test x"${filename##libc-*.h}" = x""; then
		# Do not install libc-XXXX.h files
		continue
	fi
	# NB: unifdef exits with 1 if output is not
	# exactly the same as input. That's ok.
	# Do not abort the script if unifdef "fails"!
	# NB2: careful with sed command arguments, they contain tab character
	"$top_builddir/extra/scripts/unifdef" \
		-UUCLIBC_INTERNAL \
		-U_LIBC \
		-U__UCLIBC_GEN_LOCALE \
		-U__NO_CTYPE \
		"$1/$filename" \
	| sed -e '/^rtld_hidden_proto[ 	]*([a-zA-Z0-9_]*)$/d' \
	| sed -e '/^lib\(c\|m\|resolv\|dl\|intl\|rt\|nsl\|util\|crypt\|pthread\)_hidden_proto[ 	]*([a-zA-Z0-9_]*)$/d' \
	>"$2/$filename"
done
)

# Fix mode/owner bits
cd "$2" || exit 1
chmod -R u=rwX,go=rX . >/dev/null 2>&1
chown -R `id | sed 's/^uid=\([0-9]*\).*gid=\([0-9]*\).*$/\1:\2/'` . >/dev/null 2>&1

#!/bin/sh
# Parameters:
# $1 = source dir
# $2 = dst dir
# $top_builddir = well you guessed it

die_if_not_dir()
{
	for dir in "$@"; do
		test -d "$dir" && continue
		echo "Error: '$dir' is not a directory"
		exit 1
	done
}

# Ensure that created dirs/files have 755/644 perms
umask 022

# Sanity tests
die_if_not_dir "$1"
mkdir -p "$2" 2>/dev/null
die_if_not_dir "$2"
die_if_not_dir "$top_builddir"
if ! test -x "$top_builddir/extra/scripts/unifdef"; then
	echo "Error: need '$top_builddir/extra/scripts/unifdef' executable"
	exit 1
fi

# Sanitize and copy uclibc headers
(
# We must cd, or else we'll prepend "$1" to filenames!
cd "$1" || exit 1
find ! -name '.' -a ! -path '*/.*' | sed -e 's/^\.\///' -e '/^config\//d' \
	-e '/^config$/d'
) | \
(
IFS=''
while read -r filename; do
	if test -d "$1/$filename"; then
		mkdir -p "$2/$filename" 2>/dev/null
		continue
	fi
	if test x"${filename##libc-*.h}" = x""; then
		# Do not install libc-XXXX.h files
		continue
	fi
	# NB: unifdef exits with 1 if output is not
	# exactly the same as input. That's ok.
	# Do not abort the script if unifdef "fails"!
	# NB2: careful with sed command arguments, they contain tab character
	"$top_builddir/extra/scripts/unifdef" \
		-UUCLIBC_INTERNAL \
		-U_LIBC \
		-U__UCLIBC_GEN_LOCALE \
		-U__NO_CTYPE \
		"$1/$filename" \
	| sed -e '/^rtld_hidden_proto[ 	]*([a-zA-Z0-9_]*)$/d' \
	| sed -e '/^lib\(c\|m\|resolv\|dl\|intl\|rt\|nsl\|util\|crypt\|pthread\)_hidden_proto[ 	]*([a-zA-Z0-9_]*)$/d' \
	>"$2/$filename"
done
)

# Fix mode/owner bits
cd "$2" || exit 1
chmod -R u=rwX,go=rX . >/dev/null 2>&1
chown -R `id | sed 's/^uid=\([0-9]*\).*gid=\([0-9]*\).*$/\1:\2/'` . >/dev/null 2>&1


Remove redundant file

Remove redundant file

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


Added terminal-notifier

Added terminal-notifier

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


Add a shell script to recreate the certificate stores

#!/bin/bash

KEYSIZE=1024
VALIDITY=1460
rm -f serverStore.p12 serverTrustStore.p12 caKey.pem caCert.pem request.crs clientStore.p12 clientCert.crt clientStore.jks

echo ---=== Generating Certificates ===---
echo This tools will request several parameters.
echo The names are free, but it is recommended
echo to enter a name that identifies the certificate
echo for example TestServer, TestCA, TestClient, TestInvalidClient
echo Enter 123456 when asked for a password
echo

# Server Cert
echo --== Generating Server Certificate ==--
keytool -genkey -keyalg RSA -alias notnoop-server \
  -keystore serverStore.p12 -storepass 123456 -storetype PKCS12 \
  -validity ${VALIDITY} -keysize ${KEYSIZE}
keytool -exportcert -alias notnoop-server \
  -keystore serverStore.p12 -storepass 123456 -storetype PKCS12 | keytool -printcert

# Client Cert CA
echo --== Generating Client CA Certificate ==--
keytool -genkey -keyalg RSA -alias notnoop-ca \
  -keystore serverTrustStore.p12 -storetype pkcs12 -storepass 123456 \
  -validity ${VALIDITY} -keysize ${KEYSIZE}
keytool -exportcert -alias notnoop-ca \
  -keystore serverTrustStore.p12 -storepass 123456 -storetype PKCS12 | keytool -printcert

openssl pkcs12 -in serverTrustStore.p12 -nocerts -out caKey.pem
openssl pkcs12 -in serverTrustStore.p12 -clcerts -nokeys -out caCert.pem

echo --== Generating Client Certificate ==--
keytool -genkey -keyalg RSA -keystore clientStore.p12 -storepass 123456 -storetype PKCS12 -alias notnoop-client \
  -validity ${VALIDITY} -keysize ${KEYSIZE}
keytool -certreq -keystore clientStore.p12 -storepass 123456 -storetype PKCS12 -alias notnoop-client -file request.crs

echo --== Signing Client Certificate with CA ==--
openssl x509 -req -CA CACert.pem -CAkey CAKey.pem -in request.crs -out clientCert.crt \
  -days ${VALIDITY} -CAcreateserial -outform PEM -set_serial 1
cat caCert.pem >> clientCert.crt
keytool -import -keystore clientStore.p12 -storepass 123456 -storetype PKCS12 -file clientCert.crt -alias notnoop-client
keytool -exportcert -alias notnoop-client \
  -keystore clientStore.p12 -storepass 123456 -storetype PKCS12 | keytool -printcert

echo --== Generating JKS Client Keystore with Client Certificate ==--
keytool -importkeystore \
  -srckeystore clientStore.p12 -srcstorepass 123456 -srcstoretype PKCS12 -srcalias notnoop-client \
  -destkeystore clientStore.jks -deststorepass 123456 -deststoretype JKS -destalias notnoop-client

echo --== Generating Invalid Client Certificate ==--
keytool -genkeypair -keyalg RSA -keystore clientStore.jks -storepass 123456 -storetype JKS -alias notused

keytool -list -keystore clientStore.jks -storepass 123456 -storetype JKS

rm caKey.pem caCert.pem request.crs clientCert.crt

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


slight mod on BLAST shell script

slight mod on BLAST shell 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/karoraw1/xMetaPipeline.git/'


ifcmgtool_precompile.sh added

ifcmgtool_precompile.sh added

#! /bin/bash

/opt/cmg/ifcmgkernel/bin/ifcmgtool_compile_all /opt/cmg/ifcmgdb/share/ifcmgdb /opt/cmg/ifcmgdb/share/ifcmgdb-pre

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


Returned electron-start.sh

Returned electron-start.sh

#!/usr/bin/env bash
BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../" && pwd )"

cd $BASEDIR

./node_modules/.bin/electron ./electron

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


Add bash script to generate changelog entry.

#!/usr/bin/env bash

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

: ${GITHUB_CHANGELOG_GENERATOR:=github_changelog_generator}
: ${GEM:=gem}

generate_changelog() {
    local -r sVersion="${1?One parameter required: <release-to-generate>}"

    if ! command -v "${GITHUB_CHANGELOG_GENERATOR}" >/dev/null 2>&1;then
        echo "This script requires the '${GITHUB_CHANGELOG_GENERATOR}' Ruby Gem"

        if ! command -v "${GEM}" >/dev/null 2>&1;then
            echo "Could not find the '${GEM}' command needed to install 'github_changelog_generator'!" >&2
            echo 'Aborting.'
            exit 67
        else
            echo "Installing '${GITHUB_CHANGELOG_GENERATOR}'..."
            gem install github_changelog_generator
        fi
    fi

    local -r sChangelog="$(
        "${GITHUB_CHANGELOG_GENERATOR}"                 \
            --user Dealerdirect                         \
            --project phpcodesniffer-composer-installer \
            --token "$(cat ~/.github-token)"            \
            --future-release "${sVersion}"              \
            --enhancement-label '### Changes'           \
            --bugs-label '### Fixes'                    \
            --issues-label '### Closes'                 \
            --usernames-as-github-logins                \
            --bug-labels 'bug - confirmed'              \
            --enhancement-labels  'improvement','documentation','builds / deploys / releases','feature request' \
            --exclude-labels 'bug - unconfirmed',"can't reproduce / won't fix",'invalid','triage' \
            --unreleased-only                           \
            --output '' 2>/dev/null
    )" || echo "There was a problem running '${GITHUB_CHANGELOG_GENERATOR}'"

    echo "${sChangelog}" | sed -E 's/\[\\(#[0-9]+)\]\([^)]+\)/\1/' | head -n -3
}

if [[ "${BASH_SOURCE[0]}" != "$0" ]]; then
    export -f generate_changelog
else
    generate_changelog "${@}"
    exit $?
fi

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


Add tool to migrate files from tempest into lib

This commit adds a new tool to migrate files with history into
tempest-lib. When migrating functionality into tempest we need to
use this instead of copying and pasting files so that we preserve the
commit history from tempest.

#!/bin/bash
#
# Use this script to move over a set of files from tempest master with commit
# history into the tempest lib. You must only do this for files that haven't
# been migrated over already.
#
# To use:
#  1. Create a new branch in the tempest-lib 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/migrate_from_tempest.sh tempest/

function usage {
    echo "Usage: $0 [OPTION] file1 file2"
    echo "Migrate files from tempest"
    echo ""
    echo "-o, --output_dir      Specify an directory relative to the repo root to move the migrated files into."
}

set -e

output_dir=""

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

TEMPEST_GIT_URL=git://git.openstack.org/openstack/tempest

tmpdir=$(mktemp -d -t tempest-migrate.XXXX)
tempest_lib_dir=$(dirname "$0")

function count_commits {
    echo
    echo "Have $(git log --oneline | wc -l) commits"
}

# Clone tempest and cd into it
git clone $TEMPEST_GIT_URL $tmpdir
cd $tmpdir

# Build the grep pattern for ignoring files that we want to keep
keep_pattern="\($(echo $files | sed -e 's/ /\\|/g')\)"
# Prune all other files in every commit
pruner="git ls-files | grep -v \"$keep_pattern\" | git update-index --force-remove --stdin; git ls-files > /dev/stderr"

# Find all first commits with listed files and find a subset of them that
# predates all others
roots=""
for file in $files; do
    file_root="$(git rev-list --reverse HEAD -- $file | head -n1)"
    fail=0
    for root in $roots; do
         if git merge-base --is-ancestor $root $file_root; then
             fail=1
             break
         elif !git merge-base --is-ancestor $file_root $root; then
             new_roots="$new_roots $root"
         fi
     done
     if [ $fail -ne 1 ]; then
         roots="$new_roots $file_root"
     fi
done

set_roots="
if [ '' $(for root in $roots; do echo " -o \"\$GIT_COMMIT\" == '$root' "; done) ]; then
    echo ''
else
    cat
fi"

# Enhance git_commit_non_empty_tree to skip merges with:
# a) either two equal parents (commit that was about to land got purged as well
# as all commits on mainline);
# b) or with second parent being an ancestor to the first one (just as with a)
# but when there are some commits on mainline).
# In both cases drop second parent and let git_commit_non_empty_tree to decide
# if commit worth doing (most likely not).

skip_empty=$(cat << \EOF
if [ $# = 5 ] && git merge-base --is-ancestor $5 $3; then
    git_commit_non_empty_tree $1 -p $3
else
    git_commit_non_empty_tree "$@"
fi
EOF
)

git filter-branch --index-filter "$pruner" --parent-filter "$set_roots" --commit-filter "$skip_empty" HEAD

# Pull changes
cd -
git remote add tempest-migrate $tmpdir
git pull tempest-migrate master
git remote rm tempest-migrate

for file in $files; do
    filename=`basename $file`
    if [ -n "$output_dir" ]; then
        git mv $file "$output_dir/$filename"
    else
        git mv $file "tempest_lib/$filename"
    fi
done
rm -r tempest
git add .
git commit -m "Moved files from previous merge as part of tempest migration"

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


fixed bug

fixed bug

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


Added a script for all the jenkins activities.

virtualenv .
source bin/activate
python setup.py develop
easy_install nose
easy_install mock
easy_install requests
easy_install coverage
nosetests jenkinsapi_tests --with-xunit --with-coverage --cover-html --cover-html-dir=$WORKSPACE/coverage_report --cover-package=jenkinsapi

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


First commit of organize.sh

First commit of organize.sh

Basic folder unpacking system in the works

#!/bin/bash
#
#This script takes any number of .zip files from the myCourses site
#   and organizes the code submissions appropriately.
#
#Authors:
#
#   Schuyler Martin @schuylermartin45
#

####  CONSTANTS  ####
#Mark of failure
MRKFAIL="FAIL_"

####    FLAGS    ####

#### GLOBAL VARS ####
#List of zip files passed in
zipList=()
#Localized pathing that aligns with the files passed in
pathList=()

####  FUNCTIONS  ####

#Functions for wrapping echo for color and STDERR
function echoerr {
    if [[ ! ${CRON} = ${ON} ]]; then
        tput setaf 1
    fi
    echo "ERROR: "${@} 1>&2
    if [[ ! ${CRON} = ${ON} ]]; then
        tput sgr0
    fi
}

function echowarn {
    if [[ ! ${CRON} = ${ON} ]]; then
        tput setaf 3
    fi
    echo "WARNING: "${@}
    if [[ ! ${CRON} = ${ON} ]]; then
        tput sgr0
    fi
}

function echosucc {

    if [[ ! ${CRON} = ${ON} ]]; then
        tput setaf 2
    fi
    echo ${@}
    if [[ ! ${CRON} = ${ON} ]]; then
        tput sgr0
    fi
}

#Takes the zip files and makes the appropriate directory structure
#@param:
#        $1..$N top-level zip files to organize. Each one will be put into
#           a lab folder, then a section.
#           Example: "Lab 10 Download Jun 8, 2014 1110 AM.zip" will go into
#           lab10/sec_a and then the next file passed in will become sec_b, etc
#
#@return:
#        - newFolderName the new, sanitized folder name
#
#@global:
#
function mkZipDirs {
    #starting code to count up letters
    local asciiCode=97
    #folder prefix constants
    local LABNAME="lab"
    local SECNAME="sec_"
    #local naming vars
    local secChar=""
    local labNum=0
    local i=0
    for zip in "${@}"; do
        labNum=$(echo ${zip} | grep -o -e "Lab [0-9][0-9]*" | sed 's/Lab //')
        secChar=$(printf "\x$(printf %x ${asciiCode})")
        pathList[$i]="${LABNAME}${labNum}/${SECNAME}${secChar}"
        echo mkdir -p "${pathList[$i]}"
        #if folder creation is successful, continue with unpacking the zips
        if [[ $? = 0 ]]; then
            #now unzip the file into the newly created folder

            if [[ ! $? = 0 ]]; then
                echoerr "Failed to unpack ${zip}"
                #mark failures to keep list in alignment and for future checks
                pathList[$i]=${MRKFAIL}"${pathList[$i]}"
            fi
        else
            echoerr "Failed create folder for ${zip}"
            pathList[$i]=${MRKFAIL}"${pathList[$i]}"
        fi
        let asciiCode++
        let i++
    done
}

#Parses the file name into the proper file name
#@param:
#        $1 string (original file name) to parse
#
#@return:
#        - newFileName the new, sanitized file name
#
#@global:
#
function parseFileName {
    local orgFile="$1"
}

#Groups files into folders by Unique IDs and renames files accordingly
#@param:
#        $1
#        $2
#
#@return:
#        - var1
#        - var2
#
#@global:
#        - var1
#        - var2
function groupByUID {
    echo blah
}

#[DESCRIPTION]
#@param:
#        $1
#        $2
#
#@return:
#        - var1
#        - var2
#
#@global:
#        - var1
#        - var2
function name {
    echo blah
}

####   GETOPTS   ####
#May include flags/modes of operation later
#while getopts ":v" opt; do
#  case $opt in
#    v)
#
#      ;;
#    *)
#
#      ;;
#  esac
#done

####    MAIN     ####
function main {
    #record list of file names from command line args
    zipList=("${@}")
    mkZipDirs "${zipList[@]}"
}

main "${@}"

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


Added script to provision VMs with Terraform using Packer images. * Relies on prepare_tools.sh to install Terraform and decrypt OpenStack credentials. * Relies on create_image.sh to generate a Packer image and print its ID to 'packer_output.txt'. * Script fails if image ID can't be found in output.

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/cwardgar/nexus-IaC.git/'


initializing Java ENV (WIP)

initializing Java ENV (WIP)

brew install java
brew install jenv

# Configure jenv
#
eval "$(jenv init -)"
jenv enable-plugin export
jenv enable-plugin ant
jenv enable-plugin golo
jenv enable-plugin gradle
jenv enable-plugin groovy
jenv enable-plugin maven

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


Remove function g()

Remove function g()

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/ernestas-poskus/dot13.git/'


Convenient script to install a sample ksvc

#!/usr/bin/env bash

NAME=helloworld

# Create a sample Knative Service
cat <<EOF | kubectl apply -f -
apiVersion: serving.knative.dev/v1alpha1
kind: Service
metadata:
  name: $NAME
spec:
  template:
    spec:
      containers:
        - image: gcr.io/knative-samples/helloworld-go
          env:
            - name: TARGET
              value: "World"
EOF

# Wait for the Knative Service to be ready
while output=$(kubectl get ksvc $NAME); do
  echo "$output"
  echo $output | grep True >/dev/null && break
  sleep 2
done

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


Update run-pm2.sh

Update run-pm2.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/golden-tech-native/dtlib.git/'


add skip ci to messages (#35)

add skip ci to messages (#35)

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


Add script to copy repositories as files

echo "Deleting old files"
rm -rf old
rm -f android.zip
rm -f ios.zip
rm -rf calabash-android-master
rm -rf calabash-ios-master

echo "Downloading android files"
curl --silent -L -o master.zip https://codeload.github.com/calabash/calabash-android/zip/master
mv master.zip android.zip
echo "Downloading ios files"
curl --silent -L -o master.zip https://codeload.github.com/calabash/calabash-ios/zip/master
mv master.zip ios.zip

echo "Creating directories"
mkdir -p old/android
mkdir -p old/ios

echo "Unzipping android files"
unzip android.zip
echo "Unzipping ios files"
unzip ios.zip

echo "Moving android files"
mv calabash-android-master/* old/android

echo "Moving ios files"
mv calabash-ios-master/* old/ios

rm -f android.zip
rm -f ios.zip
rm -rf calabash-android-master
rm -rf calabash-ios-master

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


Webserver based on NetCat and Bash Shell

Not as stable as the Flask based Webserver

#!/usr/bin/env bash

printf "%s\t: %s\n" "Starting RestServer" "$(date +%F_%T)"
printf "%s\t: %s\n" "Program Directory  " "$(pwd)"

# Create the named pipe
tmppipe=$(mktemp -u)
mkfifo -m 600 "$tmppipe"
printf "%s\t: %s\n" "Temp Pipe Location " "$tmppipe"

trap ctrl_c INT

function ctrl_c() {
    rm -f "$tmppipe" && printf "\n%s\t%s\n" $(date +%F_%T) ": Ctrl-c detected, restServer gracefully shut down.\n" && exit
}

function HTTP_Response() {
    printf "%s" "$2"
    HTTP_200="HTTP/1.1 200 OK"
    HTTP_CT="Content-Type: text/html"
    HTTP_LOC="Location: $1"
    HTTP_CL="Content-Length: $((${#2} + 0))"
    HTTP_SC="Connection: close"
    HTTP_OUTPUT=$(printf "%s\n%s\n%s\n%s\n%s" "$HTTP_200" "$HTTP_LOC" "$HTTP_CL" "$HTTP_CT" "$HTTP_SC")
    HTTP_OUTPUT=$(printf "%s\n\n%s" "$HTTP_OUTPUT" "$2")
#    printf "%s" "$HTTP_OUTPUT"
    printf "%s" "$HTTP_OUTPUT" >"$tmppipe"
}

while true
do
    cat "$tmppipe" | nc -l 1500 > >( # parse the netcat output, to build the answer redirected to the pipe "out".
    export REQUEST=
    while read line
    do
        line=$(echo "$line" | tr -d '[\r\n]')
        timestamp=$(date +%F_%T)
        if echo "$line" | grep -qE '^GET /' # if line starts with "GET /"
        then
            REQUEST=$(echo "$line" | cut -d ' ' -f2) # extract the request
            printf "\n%s" "$timestamp :  $REQUEST - > "
        elif [ "x$line" = x ] # empty line / end of request
        then
            HTTP_200="HTTP/1.1 200 OK"
            HTTP_LOCATION="Location:"
            HTTP_404="HTTP/1.1 404 Not Found"
            # call a script here
            # Note: REQUEST is exported, so the script can parse it (to answer 200/403/404 status code + content)
            if echo $REQUEST | grep -qE '^/ping/'
            then
                cmd_output=$(ping -c1 ${REQUEST#"/ping/"} >/dev/null && echo '{"state":"online"}' || echo '{"state":"offline"}')
                HTTP_Response "$REQUEST" "$cmd_output"
#                printf "%s\n%s %s\n\n%s\n" "$HTTP_200" "$HTTP_LOCATION" $REQUEST ${REQUEST#"/echo/"} >"$tmppipe"
            elif echo $REQUEST | grep -qE '^/hottub'
            then
                cmd_output=$(ping -c1 10.0.0.35 >/dev/null && echo '{"state":"online"}' || echo '{"state":"offline"}')
                printf "%s\n%s %s\n\n%s\n" "$HTTP_200" "$HTTP_LOCATION" $REQUEST $cmd_output >"$tmppipe"
                printf "%s" "$cmd_output"
            elif echo $REQUEST | grep -qE '^/alive'
            then
                HTTP_Response "$REQUEST" "Yes"
            else
                printf "%s\n%s %s\n\n%s\n" "$HTTP_404" "$HTTP_LOCATION" $REQUEST "Resource $REQUEST NOT FOUND!" >"$tmppipe"
            fi
        fi
    done
    )
done

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


added post instal script.

added post instal 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/svendavison/SvenNinjaWebsite.git/'


Create slamseq_workflow.sh

Create slamseq_workflow.sh

#!/bin/bash
#
#SBATCH --get-user-env
#SBATCH -J slmSeq
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=4
#SBATCH --mem=20000
#SBATCH --output=slmSeq.out
#SBATCH --error=slmSeq.err
#SBATCH --qos=medium
#SBATCH --time=1-0:00:00       # one day

set -e

## Parameters ##
function usage() {
    echo "Usage:"
    echo "      $0 -i BAM -r REF_FASTA -b UTR_BED -a GTF -o OUT_DIR -x XREF"
    exit 1
}
# Parse options.
minq=27
readlen=100
while getopts 'i:r:b:a:o:q:l:x:' flag; do
  case "${flag}" in
    i) bam="${OPTARG}" ;;			# folder of bams
    r) ref="${OPTARG}" ;;			# whole reference fasta for alignment
    b) bed="${OPTARG}" ;;			# bed of 3'UTRs (for map filtering)
    a) annot="${OPTARG}" ;;			# GTF annotation (for counting)
    o) outdir="${OPTARG}" ;;		# output directory
    q) minq="${OPTARG}" ;;			# minimum alignement quality (10)
    l) readlen="${OPTARG}" ;;		# maximum read length
    x) xref="${OPTARG}" ;;		    # "Name" to other IDs
    *) usage ;;
  esac
done

wait_for_jobs(){
  echo "waiting"
  sleep 60  # seconds, give time to the scheduler to put up the task
  sleeptime=120  # ask every 2 mins, for the first 10 mins
  n=1
  while true; do
    if [ $(squeue | grep kimon.fr | grep -c $1) -eq 0 ]; then
      break
    else
      echo "sleep another" $((sleeptime / 60)) "minutes..."
      sleep $sleeptime
    fi
    n=$((n + 1))
    if [ $n -eq 5 ]; then
      sleeptime=300  # if still running after 10 mins, ask every 5 mins
    fi
    if [ $n -eq 10 ]; then
      sleeptime=600  # if still running after 30 mins, ask every 10 mins
    fi
  done
}

mkdir -p ${outdir}/fastqc_pre ${outdir}/fastqc_post ${outdir}/fastq ${outdir}/fastq_trimmed ${outdir}/dunk ${outdir}/alleyoop ${outdir}/multiqc_pre ${outdir}/multiqc_post ${outdir}/multiqc_alleyoop

# echo "$bam - BAM to FASTQ"
# fileutilities.py T $bam/*bam --loop sbatch ,-J bam2fq ,--get-user-env ,--wrap "'samtools bam2fq -0 ${outdir}/fastq/{bas}.fastq {abs}'"
# wait_for_jobs bam2fq
# fileutilities.py T ${outdir}/fastq/*.fastq --loop sbatch ,-J fqzip ,--get-user-env ,--wrap "'gzip -f {abs}'"
# wait_for_jobs fqzip
#
# echo "$bam - QC"
# fileutilities.py T ${outdir}/fastq/*.fastq.gz --loop sbatch ,-J fastQC ,--get-user-env ,--wrap "'fastqc -o ${outdir}/fastqc_pre {abs}'"
# wait_for_jobs fastQC
#
# echo "$bam - trim, filter, QC"
# fileutilities.py T ${outdir}/fastq/*.fastq.gz --loop sbatch ,--ntasks=1 ,-c 4 ,-J trimgalo ,--get-user-env trim_galore ,-j 4 ,-o ${outdir}/fastq_trimmed ,--stringency 3 ,--gzip ,--fastqc ,--fastqc_args "',--outdir ${outdir}/fastqc_post/'" {abs}
# wait_for_jobs trimgalo

# # source ~/miniconda3/bin/deactivate
# # source ~/miniconda3/bin/activate slamdunk

echo "$bam - slamdunk"
fileutilities.py T ${outdir}/fastq_trimmed/*_trimmed.fq.gz --loop sbatch ,-c 6 ,--mem=24G ,-J slamdunk ,--wrap "'source ~/miniconda3/bin/activate slamdunk && slamdunk all -r $ref -b $bed -o ${outdir}/dunk -5 12 -n 100 -c 2 -mv 0.2 -t 4 -rl $readlen -mbq $minq -m -ss {abs}'"
wait_for_jobs slamdunk

echo "$bam - alleyoop"
mkdir -p ${outdir}/alleyoop/summary/ ${outdir}/alleyoop/rates ${outdir}/alleyoop/utrrates ${outdir}/alleyoop/tcperreadpos ${outdir}/alleyoop/tcperutrpos

sbatch --qos short --time=0-0:10:00 --ntasks=1 -J alleyoop --wrap "source ~/miniconda3/bin/activate slamdunk && alleyoop summary -t ${outdir}/dunk/count/ -o ${outdir}/alleyoop/summary/summary.txt ${outdir}/dunk/filter/*bam"
fileutilities.py T ${outdir}/dunk/filter/*bam --loop sbatch ,-c 4 ,-J alleyoop ,--wrap "'source ~/miniconda3/bin/activate slamdunk && alleyoop rates -o ${outdir}/alleyoop/rates -r $ref -t 4 -mq $minq {abs}'"
fileutilities.py T ${outdir}/dunk/filter/*bam --loop sbatch ,-c 4 ,-J alleyoop ,--wrap "'source ~/miniconda3/bin/activate slamdunk && alleyoop utrrates -o ${outdir}/alleyoop/utrrates -r $ref -t 4 -b $bed -l $readlen {abs}'"
fileutilities.py T ${outdir}/dunk/filter/*bam --loop sbatch ,-c 4 ,-J alleyoop ,--wrap "'source ~/miniconda3/bin/activate slamdunk && alleyoop tcperreadpos -o ${outdir}/alleyoop/tcperreadpos -r $ref -s ${outdir}/dunk/snp -l $readlen -mq $minq -t 4 {abs}'"
fileutilities.py T ${outdir}/dunk/filter/*bam --loop sbatch ,-c 4 ,-J alleyoop ,--wrap "'source ~/miniconda3/bin/activate slamdunk && alleyoop tcperutrpos -o ${outdir}/alleyoop/tcperutrpos -r $ref -b $bed -s ${outdir}/dunk/snp -l $readlen -mq $minq -t 4 ${outdir}/dunk/filter/*bam'"
wait_for_jobs alleyoop
# # echo "# slamdunk summary v0.3.4" > ${outdir}/alleyoop/summary.txt
# # echo "FileName	SampleName	SampleType	SampleTime	Sequenced	Mapped	Deduplicated	MQ-Filtered	Identity-Filtered	NM-Filtered	Multimap-Filtered	Retained	Counted	Annotation" >> ${outdir}/alleyoop/summary.txt
# # cat ${outdir}/alleyoop/summary/*summary.txt | tail -n 1 >> ${outdir}/alleyoop/summary.txt

echo "$bam - MultiQC"
srun --qos short --ntasks=1 --mpi=none multiqc -f -o ${outdir}/multiqc_pre ${outdir}/fastqc_pre
srun --qos short --ntasks=1 --mpi=none multiqc -f -o ${outdir}/multiqc_post ${outdir}/fastqc_post
srun --qos short --ntasks=1 --mpi=none multiqc -f -o ${outdir}/multiqc_alleyoop ${outdir}/alleyoop/summary ${outdir}/alleyoop/rates ${outdir}/alleyoop/tcperreadpos ${outdir}/alleyoop/tcperutrpos ${outdir}/alleyoop/utrrates

if [ -e "${xref}" ] ; then
    echo "$bam - Adding crossreferencing IDs"
    xref.R ${outdir}/dunk/count $xref 4 1 '.tsv'
fi

# # Prepare file headers for pasting
# # mkdir ${outdir}/dunk/count_renamed
# # fileutilities.py T ${outdir}/dunk/count --dir tcount.tsv | perl -e 'while(<>){~s/(\t\d+).*$/$1/;print}' |  ???

# # Extract and collate the counts, lose the commented command.
# # fileutilities.py T ${outdir}/dunk/count/*txt -i -l --cols 6 | perl -e 'while(<>){~s/_\|6//g;print}' > ${outdir}/counts/all_counts.tsv

# Clean up file pollution
# rm ./slurm*

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


script added

script added

#!/bin/bash
function steamL {
	steam
	if [ $? ]
	then
		xbmcL
	fi
}
function xbmcL {
	xbmc
	if [ $? ]
	then
		steamL
	fi
}
xbmcL
exit

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


Annotator based "compile and run tests" script for android bot.

BUG=
TEST=

Review URL: http://codereview.chromium.org/8536052

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@110983 0039d316-1c4b-4281-b951-d872f2087c98

#!/bin/bash
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# "compile and run tests" script for the android build of chromium.
# Intended for use by buildbot.
# At this time, we only have one bot which is both a builder and
# tester.  Script assumes it runs in the "build" directory.
#
# This script uses buildbot "Annotator" style for steps.
# This script does not sync the source tree.

set -e
set -x

NEED_CLOBBER=0

echo "@@@BUILD_STEP cd into source root@@@"
SRC_ROOT=$(cd "$(dirname $0)/../.."; pwd)
cd $SRC_ROOT

echo "@@@BUILD_STEP Basic setup@@@"
export ANDROID_SDK_ROOT=/usr/local/google/android-sdk-linux_x86
export ANDROID_NDK_ROOT=/usr/local/google/android-ndk-r7
for mandatory_directory in "${ANDROID_SDK_ROOT}" "${ANDROID_NDK_ROOT}" ; do
  if [[ ! -d "${mandatory_directory}" ]]; then
    echo "Directory ${mandatory_directory} does not exist."
    echo "Build cannot continue."
    exit 1
  fi
done

if [ ! -n "$BUILDBOT_CLOBBER" ]; then
  NEED_CLOBBER=1
fi

## Build and test steps

echo "@@@BUILD_STEP Configure with envsetup.sh@@@"
. build/android/envsetup.sh

if [ "$NEED_CLOBBER" -eq 1 ]; then
  echo "@@@BUILD_STEP Clobber@@@"
  rm -rf "${SRC_ROOT}"/out
fi

echo "@@@BUILD_STEP android_gyp@@@"
android_gyp

echo "@@@BUILD_STEP Compile@@@"
make -j4

echo "@@@BUILD_STEP Run Tests@@@"
build/android/run_tests.py -e --xvfb

exit 0

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


Adding solution to 'Cut#5'

Adding solution to 'Cut#5'

error: pathspec 'LinuxShell/Bash/Cut#5/Cut#5.sh' did not match any file(s) known to git


Script to limit the CPU usage of SlowKDF

#!/bin/bash

while true; do

date
processID=$(ps a | grep slowkdf | grep python | head -n 1 | cut -d " " -f 1)

echo "Process ID: \"$processID\""

if [ -n "$processID" ] && [ "$processID" -eq "$processID" ] 2>/dev/null; then
  echo "cpulimit -l 50 -p \"$processID\""
  cpulimit -l 50 -p "$processID"
else
  echo "Process not found."
fi

echo "sleeping 1 second..."
sleep 1

done

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


Add shell script for creating posts

Add shell script for creating posts

#!/bin/bash
if [ "$#" -ne 1 ]; then
  echo "Pass the post name filename suffix"
  exit 1
fi
fn="`dirname $0`/_posts/`date +\%Y-\%m-\%d-`$1.md"

touch $fn
echo "---" > $fn
echo "layout: post" >> $fn
echo "title: <ENTER TITLE HERE>" >> $fn
echo "---" >> $fn
printf "\n" >> $fn
vi $fn -c "normal zR3ggf<vf>"

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


Import release script

Import release 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/YourCursus/bootstrap-slider-rails.git/'


Script for update route 53 zones from dynamic updates

#!/bin/bash

# (optional) You might need to set your PATH variable at the top here
# depending on how you run this script
#PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

# Hosted Zone ID e.g. BJBK35SKMM9OE
ZONEID="enter zone id here"

# The CNAME you want to update e.g. hello.example.com
RECORDSET="enter cname here"

# More advanced options below
# The Time-To-Live of this recordset
TTL=300
# Change this if you want
COMMENT="Auto updating @ `date`"
# Change to AAAA if using an IPv6 address
TYPE="A"

# Get the external IP address from OpenDNS (more reliable than other providers)
IP=`dig +short myip.opendns.com @resolver1.opendns.com`

function valid_ip()
{
    local  ip=$1
    local  stat=1

    if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
        OIFS=$IFS
        IFS='.'
        ip=($ip)
        IFS=$OIFS
        [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \
            && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]]
        stat=$?
    fi
    return $stat
}

# Get current dir
# (from http://stackoverflow.com/a/246128/920350)
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
LOGFILE="$DIR/update-route53.log"
IPFILE="$DIR/update-route53.ip"

if ! valid_ip $IP; then
    echo "Invalid IP address: $IP" >> "$LOGFILE"
    exit 1
fi

# Check if the IP has changed
if [ ! -f "$IPFILE" ]
    then
    touch "$IPFILE"
fi

if grep -Fxq "$IP" "$IPFILE"; then
    # code if found
    echo "IP is still $IP. Exiting" >> "$LOGFILE"
    exit 0
else
    echo "IP has changed to $IP" >> "$LOGFILE"
    # Fill a temp file with valid JSON
    TMPFILE=$(mktemp /tmp/temporary-file.XXXXXXXX)
    cat > ${TMPFILE} << EOF
    {
      "Comment":"$COMMENT",
      "Changes":[
        {
          "Action":"UPSERT",
          "ResourceRecordSet":{
            "ResourceRecords":[
              {
                "Value":"$IP"
              }
            ],
            "Name":"$RECORDSET",
            "Type":"$TYPE",
            "TTL":$TTL
          }
        }
      ]
    }
EOF

    # Update the Hosted Zone record
    aws route53 change-resource-record-sets \
        --hosted-zone-id $ZONEID \
        --change-batch file://"$TMPFILE" >> "$LOGFILE"
    echo "" >> "$LOGFILE"

    # Clean up
    rm $TMPFILE
fi

# All Done - cache the IP address for next time
echo "$IP" > "$IPFILE"

error: pathspec 'update-route53-dynamic-dns.sh' did not match any file(s) known to git


King Size Cracking WPA/WPA2

King Size Cracking WPA/WPA2

#!/bin/bash

TITLE="King Size Cracking WPA/WPA2"
DATE=$(date +'%d-%m-%Y-%H-%M')
AUTHOR="João Lucas <joaolucas@linuxmail.org>"
VERSION="0.1"
LICENSE="GPL"
OUTPUT="Capturas"

function_verificar_usuario(){
	if [ `id -u` != "0" ]
	then
		yad --title="$TITLE" \
		--text="Execute o script como root!" \
		--image error \
		--image-on-top \
		--timeout=5 \
		--timeout-indicador=button \
		--button gtk-ok \
		--center
		exit 1
	fi
}

function_verificar_diretorio(){
	if [ ! -d "$OUTPUT" ]
	then
		mkdir $OUTPUT

	fi
}

function_about(){
	yad --text="$TITLE \nversão $VERSION \n\nCracking WPA/WPA2 utilizando suite aircrack-ng e yad dialog \n\nSoftware sob a licença GNU GPL versão3 \nCodigo fonte disponível no Github \n<https://github.com/joao-lucas/Shell-script> \n\nAuthor: $AUTHOR" \
		--text-align=center \
                --image gtk-about \
                --image-on-top \
                --button gtk-close \
                --no-markup \
                --undecorated \
                --buttons-layout="center" \
		--center
}

function_modo_monitoramento(){
	airmon-ng start $INTERFACE | yad --title "$TITLE" \
	--text-info \
	--maximized \
	--button gtk-ok
}

function_escanear_todas_redes(){
	airodump-ng $INTERFACE_MON | yad --tile "$TITLE" \
	--text-info \
	--text="Anote ESSID, BSSID e CHANNEL" \
	--image find \
	--image-on-top \
	--maximized \
	--button gtk-ok
}

function_setar_parametros(){
	PARAMETROS=$(yad --title "$TITLE" \
	--form \
	--center \
	--field "BSSID" "" \
	--field "ESSID" "" \
	--field "Channel" "" \
	--field "Interface Mon" "eth0mon" \
	--field "Salvar em" "$DATE.cap" \
	--field "[ Wordlist ]":BTN "yad --file --maximized" \
	#--field "[ Salvar na pasta ]":BTN "yad --title $TITLE --maximized --file --directory" \
	--button gtk-cancel \
	--button gtk-ok );

	BSSID=$(echo "$PARAMETROS" | cut -d '|' -f 1)
	ESSID=$(echo "$PARAMETROS" | cut -d '|' -f 2)
	CHANNEL=$(echo "$PARAMETROS" | cut -d '|' -f 3)
	INTERFACE_MON=$(echo "$PARAMETROS" | cut -d '|' -f 4)
	#DIR=$(echo "$PARAMETROS" | cut -d '|' -f 5)
	ARQ=$(echo "$PARAMETROS" | cut -d '|' -f 5)
}

function_escanear_uma_rede(){

if [ -z $BSSID ] || [ -z $ESSID ] || [ -z $CHANNEL ] || [ -z $INTERFACE_MON ] || [ ! -e $ARQ ]
then
		yad --text="Você deve setar os parametros para fazer o escaneamento!" \
		--text-align=center \
                --image gtk-error \
                --image-on-top \
                --button gtk-close \
                --no-markup \
                --undecorated \
                --buttons-layout="center" \
		--center

		function_menu
fi

airodump-ng --bssid $BSSID --essid $ESSID --channel $CHANNEL \
	--write $OUTPUT/$ARQ $INTERFACE_MON | yad --title "$TITLE" \
	--text-info \
	--image find \
	--image-on-top \
	--maximized \
	--button gtk-ok
}

function_deauth(){
	aireplay-ng --deauth 1 -a BSSID -e $ESSID $INTERFACE_MON | yad --title $TITLE \
	--text-info \
	--maximized \
	--button-ok
}

function_injetar(){
	aireplay-ng --interactive 1000 -c $CLIENTE $INTERFACE_MON | yad --title $TITLE \
	--text-info \
	--maximized \
	--button gtk-ok \
        --buttons-layout="center"
}

function_quebrar(){
        aircrack-ng -w $WORD_LIST $ARQ | yad --title $TITLE \
	--text-info \
	--maximized \
	--button gtk-ok \
        --buttons-layout="center"
}

function_menu(){
	while true
	do
		MENU=$(yad --title "$TITLE" \
			--list \
			--text="King Size Cracking WPA/WPA2 \n$DATE \n\nAuthor: João lucas" \
			--column="Icones:IMG" \
			--column="Opção" \
			--column="Descrição" \
			--image emblem-debian \
			--image-on-top \
			--maximized \
			--no-buttons \
			find "Monitor" "Ativar modo monitoramento" \
			find "Escanear" "Escanear todas redes alcançadas" \
			img "Setar" "Parâmetros para o ataque" \
			find "Escanear uma rede" "Escanear apenas uma rede especifica" \
			emblem-debian "Deauth" "Fazer desautenticação dos hosts no AP" \
			emblem-debian "Injetar" "Injetar pacotes no AP" \
			emblem-debian "Quebrar" "Tentar quebrar a senha com força bruta" \
			gtk-about "Sobre" "Informações sobre o script" \
			gtk-quit "Sair" "Sair do script")

		MENU=$(echo "$MENU" | cut -d "|" -f2)

		case "$MENU" in
		"Monitor") function_modo_monitoramento ;;
		"Escanear") function_escanear_todas_redes ;;
		"Setar") function_setar_parametros ;;
		"Escanear uma rede") function_escanear_uma_rede ;;
		"Deauth") function_deauth ;;
		"Injetar") function_injetar ;;
		"Quebrar") function_quebrar ;;
		"Sobre") function_about ;;
		"Sair") exit 0 ;;
	esac
done
}

function_verificar_usuario
function_verificar_diretorio
function_menu

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


post_install: set dark mode automatically

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


Added new comment line in humanities.bash, testing.

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/SparklineData/jupyterhub-k8s.git/'


t/t8007: test textconv support for cat-file

Test the correct functionning of textconv with cat-file <sha1:blob>
and cat-file HEAD^ <file>. Test the case when no driver is specified

Signed-off-by: Clément Poulain <dc615927f3210eb22790cef2f4fa089d76b644e6@ensimag.imag.fr>
Signed-off-by: Diane Gasselin <27505e2b02e80c15219024397758a121fab1885d@ensimag.imag.fr>
Signed-off-by: Axel Bonnet <6d8c09ea200e94e932c0026c3a0655cbdf6fd8ea@ensimag.imag.fr>
Signed-off-by: Junio C Hamano <a6723cc3f76163bf7adb636a73ac3b0ceb3e6b9b@pobox.com>

#!/bin/sh

test_description='git cat-file textconv support'
. ./test-lib.sh

cat >helper <<'EOF'
#!/bin/sh
sed 's/^/converted: /' "$@"
EOF
chmod +x helper

test_expect_success 'setup ' '
	echo test >one.bin &&
	git add . &&
	GIT_AUTHOR_NAME=Number1 git commit -a -m First --date="2010-01-01 18:00:00" &&
	echo test version 2 >one.bin &&
	GIT_AUTHOR_NAME=Number2 git commit -a -m Second --date="2010-01-01 20:00:00"
'

cat >expected <<EOF
fatal: git cat-file --textconv: unable to run textconv on :one.bin
EOF

test_expect_success 'no filter specified' '
	git cat-file --textconv :one.bin 2>result
	test_cmp expected result
'

test_expect_success 'setup textconv filters' '
	echo "*.bin diff=test" >.gitattributes &&
	git config diff.test.textconv ./helper &&
	git config diff.test.cachetextconv false
'

cat >expected <<EOF
test version 2
EOF

test_expect_success 'cat-file without --textconv' '
	git cat-file blob :one.bin >result &&
	test_cmp expected result
'

cat >expected <<EOF
test
EOF

test_expect_success 'cat-file without --textconv on previous commit' '
	git cat-file -p HEAD^:one.bin >result &&
	test_cmp expected result
'

cat >expected <<EOF
converted: test version 2
EOF

test_expect_success 'cat-file --textconv on last commit' '
	git cat-file --textconv :one.bin >result &&
	test_cmp expected result
'

cat >expected <<EOF
converted: test
EOF

test_expect_success 'cat-file --textconv on previous commit' '
	git cat-file --textconv HEAD^:one.bin >result &&
	test_cmp expected result
'
test_done

error: pathspec 't/t8007-cat-file-textconv.sh' did not match any file(s) known to git


Added bash script which easens the tracing process

TRACE_DIR=/tmp/cvmfs-trace
rm -rf $TRACE_DIR
mkdir $TRACE_DIR
chmod a+rw $TRACE_DIR

echo "*** Writing config file..."

sudo cp /etc/cvmfs/default.local $TRACE_DIR/config.backup
sudo truncate -s0 /etc/cvmfs/default.local

sudo echo "CVMFS_REPOSITORIES=sft.cern.ch" >> /etc/cvmfs/default.local
sudo echo "CVMFS_HTTP_PROXY=http://ca-proxy.cern.ch:3128" >> /etc/cvmfs/default.local
sudo echo "CVMFS_TRACEFILE=$TRACE_DIR/cvmfs-@fqrn@.trace.log" >> /etc/cvmfs/default.local
sudo echo "CVMFS_TRACEBUFFER=16384" >> /etc/cvmfs/default.local
sudo echo "CVMFS_TRACEBUFFER_THRESHOLD=4092" >> /etc/cvmfs/default.local

echo "*** Restarting autofs"

sudo service autofs restart

echo "*** Sleeping for a few seconds..."
sleep 4

echo "*** Starting bash - Please ONLY enter commands that should be traced now..."

bash

echo "*** Bash is done..."
REPOSITORIES=`sudo find /var/lib/cvmfs/shared -maxdepth 1 -name "cvmfs_io*"`
for REPO_PATH in ${REPOSITORIES[@]}
do
  REPO=${REPO_PATH#/var/lib/cvmfs/shared/cvmfs_io.}
  echo "*** Flushing buffer of $REPO"
  sudo cvmfs_talk -i $REPO tracebuffer flush
done
sudo cvmfs_talk tracebuffer flush

echo "*** Writing config file..."
sudo rm /etc/cvmfs/default.local
sudo cp $TRACE_DIR/config.backup /etc/cvmfs/default.local
echo "*** Restarting autofs"
sudo service autofs restart

echo "*** DONE: Tracefiles can be found in $REPO"

error: pathspec 'add-ons/tools/export_plugin/trace.sh' did not match any file(s) known to git


Create src_specialfont.sh

Create src_specialfont.sh

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


install mutt-patched

install mutt-patched

debian/1-system.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

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


Add a simple script to test built packages

This script can be used to test the newly-built deb files inside a
pbuilder or similar chroot, so that all language bindings are tested and
shown to work, at least at the level of example programs; extensive
tests are done via the upstream unittests at build time, this is just to
make sure the libraries and headers are installed correctly from the
debs.

#!/bin/sh

# Script to automate running the provided example programs to test all
# language binding (cpp, python, java)

# Needs to be run from the directory containing the newly-built deb's

set -e

test -f protobuf-compiler_*.deb || \
    { echo "Cannot find protobuf-compiler deb file, exiting" 1>&2; exit 1; }

echo "*** Installing dependencies (hardcoded list)"

apt-get install -y openjdk-6-jdk python python-support

echo "*** Installing packages"

dpkg -i *.deb

cd /usr/share/doc/protobuf-compiler/examples

export CLASSPATH=/usr/share/java/protobuf.jar

echo "*** Building example programs"

make

TEST_FILE=`mktemp`
echo "Test file is $TEST_FILE"

echo "*** Adding via cpp"
./add_person_cpp $TEST_FILE << EOF
1
Person One

EOF

echo "*** Adding via python"

./add_person_python $TEST_FILE << EOF
2
Person Two
two@example.net

EOF

echo "*** Adding via java"

./add_person_java $TEST_FILE << EOF
2
Person Two

555-1234
work

EOF

for kind in cpp python java; do
  echo "*** Listing via $kind"
  ./list_people_$kind $TEST_FILE
done

rm $TEST_FILE

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


Much better to create separate file than to modify /etc/apt/sources.list

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


Remove extra dquotes.

Remove extra dquotes.

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


Create first utility

Create first utility

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


Adding dev Salt master bootstrap script.

# Install some pre-reqs
yum install -y unzip wget git GitPython vim
git config --global user.name "drawsmcgraw"

# Fetch, then run, the Salt-bootstrap script
# -M to install salt-master
# -L to also install apache-libcloud (for salt-cloud)
wget https://raw.githubusercontent.com/saltstack/salt-bootstrap/stable/bootstrap-salt.sh
sh bootstrap-salt.sh -M -L

# Install salt-vim files
git clone https://github.com/saltstack/salt-vim.git
if [ ! -d ~/.vim ]; then
mkdir ~/.vim
fi
cp -r salt-vim/* ~/.vim/.

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


[3008]Check datatools version used in BIRT build

# User specific environment and startup programs
umask 002

BASE_PATH=.:/bin:/usr/bin:/usr/bin/X11:/usr/local/bin:/usr/bin:/usr/X11R6/bin
LD_LIBRARY_PATH=.
BASH_ENV=$HOME/.bashrc
USERNAME=`whoami`
xhost +$HOSTNAME
DISPLAY=:0.0
export DISPLAY

CVS_RSH=ssh
ulimit -c unlimited
export CVS_RSH USERNAME BASH_ENV LD_LIBRARY_PATH DISPLAY

if [ "x"$ANT_HOME = "x" ]; then export ANT_HOME=/usr/local/apache-ant-1.6.5; fi
if [ "x"$JAVA_HOME = "x" ]; then export JAVA_HOME=/usr/local/j2sdk1.4.2_13; fi
export PATH=${PATH}:${ANT_HOME}/bin:/usr/local/bin

proc=$$

# directory in which to export builder projects
builderDir=/home/adb/releng.250/org.eclipse.birt.releng.birtbuilder/

# buildtype determines whether map file tags are used as entered or are replaced with HEAD
buildType=I

# directory where to copy build
postingDirectory=/home/adb/releng/BIRTOutput/BIRT2.5-download

# flag to indicate if test build
testBuild=""

# path to javadoc executable
javadoc=""

# value used in buildLabel and for text replacement in index.php template file
builddate=`date +%Y%m%d`
buildtime=`date +%H%M`

buildinfoDate=`date +%F%t%H:%M:%S`
buildinfounivDate=`date +%c%z`

timestamp=$builddate$buildtime

# After the above the build type is left in $1.
buildType=$1

# Set default buildId and buildLabel if none explicitly set
if [ "$buildId" = "" ]
then
		 #buildId=$buildType$builddate-$buildtime
		 buildId=v$builddate-$buildtime
fi

if [ "$buildLabel" = "" ]
then
		 buildLabel=$buildId
fi

#Set the tag to HEAD for Nightly builds
if [ "$buildType" = "N" ]
then
        tag="-DfetchTag=HEAD"
        versionQualifier="-DforceContextQualifier=$buildId"
fi

# tag for eclipseInternalBuildTools on ottcvs1
internalToolsTag=$buildProjectTags

# tag for exporting org.eclipse.releng.basebuilder
baseBuilderTag=$buildProjectTags

# tag for exporting the custom builder
customBuilderTag=$buildProjectTags

# directory where features and plugins will be compiled
buildDirectory=/home/adb/farrah/BIRT_Build_Dir

cd $builderDir

chmod -R 755 $builderDir

#default value of the bootclasspath attribute used in ant javac calls.
bootclasspath="/usr/local/j2sdk1.4.2_13/jre/lib/rt.jar:/usr/local/j2sdk1.4.2_13/jre/lib/jsse.jar"
bootclasspath_15="/usr/local/jdk1.5.0_02/jre/lib/rt.jar"
jvm15_home="/usr/local/jdk1.5.0_02"

cd /home/adb/releng.250/org.eclipse.birt.releng.birtbuilder

#the base command used to run AntRunner headless
antRunner="/usr/local/jdk1.5.0_02/bin/java -Xmx500m -jar ../org.eclipse.releng.basebuilder/plugins/org.eclipse.equinox.launcher.jar -Dosgi.os=linux -Dosgi.ws=gtk -Dosgi.arch=ppc -application org.eclipse.ant.core.antRunner"

ant -buildfile eclipse/helper.xml getDTPDownloads.fromlocal -propertyfile build.properties -propertyfile config.properties > updatedtp.log

error: pathspec 'build/org.eclipse.birt.releng.birtbuilder/updatedtp.sh' did not match any file(s) known to git


Ensemble statistics script

Ensemble statistics script

#!/usr/bin/env bash

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

function usage {
    echo "Calculate an ensemble statistic"
    echo " "
    echo "USAGE: bash $0 statistic infile1 infile2 ... infileN outfile"
    echo "   statistic:  Choices: ensmin, ensmax, enssum, ensmean, ensavg,"
    echo "                        ensvar, ensvar1, ensstd, ensstd1,"
    echo "                        enspctl,P (where P is the percentile)"
    echo "   infile:     Input file name"
    echo "   outfile:    Output file name"
    echo " "
    echo "   e.g. bash $0 ensmean indata1.nc indata2.nc indata3.nc outdata.nc"
    echo "   e.g. bash $0 enspctl,90 indata1.nc indata2.nc indata3.nc indata4.nc outdata.nc"
    exit 1
}

function xmlcheck()  {
    infile=$1
    if [ ! -f $infile ] ; then
        echo "Input file doesn't exist: " $infile
        usage
    fi

    # Check if input is an XML file

    temp_dir=$(mktemp -d)
    function cleanup {
        rm -rf $temp_dir
    }
    trap cleanup EXIT

    inbase=`basename $infile`
    extn=`expr match "${inbase}" '.*\.\(.*\)'`
    if [ $extn = 'xml' ] ; then
        tmp_in=${temp_dir}/xml_concat.$$.nc
        python ${CWSL_CTOOLS}/utils/xml_to_nc.py None $infile $tmp_in
        infile=$tmp_in
    else
        infile=$infile
    fi
}

# Read the input arguments

if [ $# -ge 4 ] ; then
    inargs=( "$@" )
    statistic=${inargs[0]}
    infiles=${inargs[@]:1:`expr $# - 2`}
    outfile=${inargs[@]: -1}
else
    usage
fi

checked_infiles=()
for file in ${infiles[@]} ; do
    xmlcheck $file
    checked_infiles+=("$infile")
done

# Execute the cdo function

echo cdo ${statistic} ${checked_infiles[@]} $outfile

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


feat(bin): add z jumper

feat(bin): add z jumper

# Copyright (c) 2009 rupa deadwyler under the WTFPL license

# maintains a jump-list of the directories you actually use
#
# INSTALL:
#     * put something like this in your .bashrc/.zshrc:
#         . /path/to/z.sh
#     * cd around for a while to build up the db
#     * PROFIT!!
#     * optionally:
#         set $_Z_CMD in .bashrc/.zshrc to change the command (default z).
#         set $_Z_DATA in .bashrc/.zshrc to change the datafile (default ~/.z).
#         set $_Z_NO_RESOLVE_SYMLINKS to prevent symlink resolution.
#         set $_Z_NO_PROMPT_COMMAND if you're handling PROMPT_COMMAND yourself.
#         set $_Z_EXCLUDE_DIRS to an array of directories to exclude.
#         set $_Z_OWNER to your username if you want use z while sudo with $HOME kept
#
# USE:
#     * z foo     # cd to most frecent dir matching foo
#     * z foo bar # cd to most frecent dir matching foo and bar
#     * z -r foo  # cd to highest ranked dir matching foo
#     * z -t foo  # cd to most recently accessed dir matching foo
#     * z -l foo  # list matches instead of cd
#     * z -c foo  # restrict matches to subdirs of $PWD

[ -d "${_Z_DATA:-$HOME/.z}" ] && {
    echo "ERROR: z.sh's datafile (${_Z_DATA:-$HOME/.z}) is a directory."
}

_z() {

    local datafile="${_Z_DATA:-$HOME/.z}"

    # bail if we don't own ~/.z and $_Z_OWNER not set
    [ -z "$_Z_OWNER" -a -f "$datafile" -a ! -O "$datafile" ] && return

    # add entries
    if [ "$1" = "--add" ]; then
        shift

        # $HOME isn't worth matching
        [ "$*" = "$HOME" ] && return

        # don't track excluded dirs
        local exclude
        for exclude in "${_Z_EXCLUDE_DIRS[@]}"; do
            [ "$*" = "$exclude" ] && return
        done

        # maintain the data file
        local tempfile="$datafile.$RANDOM"
        while read line; do
            # only count directories
            [ -d "${line%%\|*}" ] && echo $line
        done < "$datafile" | awk -v path="$*" -v now="$(date +%s)" -F"|" '
            BEGIN {
                rank[path] = 1
                time[path] = now
            }
            $2 >= 1 {
                # drop ranks below 1
                if( $1 == path ) {
                    rank[$1] = $2 + 1
                    time[$1] = now
                } else {
                    rank[$1] = $2
                    time[$1] = $3
                }
                count += $2
            }
            END {
                if( count > 9000 ) {
                    # aging
                    for( x in rank ) print x "|" 0.99*rank[x] "|" time[x]
                } else for( x in rank ) print x "|" rank[x] "|" time[x]
            }
        ' 2>/dev/null >| "$tempfile"
        # do our best to avoid clobbering the datafile in a race condition
        if [ $? -ne 0 -a -f "$datafile" ]; then
            env rm -f "$tempfile"
        else
            [ "$_Z_OWNER" ] && chown $_Z_OWNER:$(id -ng $_Z_OWNER) "$tempfile"
            env mv -f "$tempfile" "$datafile" || env rm -f "$tempfile"
        fi

    # tab completion
    elif [ "$1" = "--complete" -a -s "$datafile" ]; then
        while read line; do
            [ -d "${line%%\|*}" ] && echo $line
        done < "$datafile" | awk -v q="$2" -F"|" '
            BEGIN {
                if( q == tolower(q) ) imatch = 1
                q = substr(q, 3)
                gsub(" ", ".*", q)
            }
            {
                if( imatch ) {
                    if( tolower($1) ~ tolower(q) ) print $1
                } else if( $1 ~ q ) print $1
            }
        ' 2>/dev/null

    else
        # list/go
        while [ "$1" ]; do case "$1" in
            --) while [ "$1" ]; do shift; local fnd="$fnd${fnd:+ }$1";done;;
            -*) local opt=${1:1}; while [ "$opt" ]; do case ${opt:0:1} in
                    c) local fnd="^$PWD $fnd";;
                    h) echo "${_Z_CMD:-z} [-chlrtx] args" >&2; return;;
                    x) sed -i -e "\:^${PWD}|.*:d" "$datafile";;
                    l) local list=1;;
                    r) local typ="rank";;
                    t) local typ="recent";;
                esac; opt=${opt:1}; done;;
             *) local fnd="$fnd${fnd:+ }$1";;
        esac; local last=$1; shift; done
        [ "$fnd" -a "$fnd" != "^$PWD " ] || local list=1

        # if we hit enter on a completion just go there
        case "$last" in
            # completions will always start with /
            /*) [ -z "$list" -a -d "$last" ] && cd "$last" && return;;
        esac

        # no file yet
        [ -f "$datafile" ] || return

        local cd
        cd="$(while read line; do
            [ -d "${line%%\|*}" ] && echo $line
        done < "$datafile" | awk -v t="$(date +%s)" -v list="$list" -v typ="$typ" -v q="$fnd" -F"|" '
            function frecent(rank, time) {
                # relate frequency and time
                dx = t - time
                if( dx < 3600 ) return rank * 4
                if( dx < 86400 ) return rank * 2
                if( dx < 604800 ) return rank / 2
                return rank / 4
            }
            function output(files, out, common) {
                # list or return the desired directory
                if( list ) {
                    cmd = "sort -n >&2"
                    for( x in files ) {
                        if( files[x] ) printf "%-10s %s\n", files[x], x | cmd
                    }
                    if( common ) {
                        printf "%-10s %s\n", "common:", common > "/dev/stderr"
                    }
                } else {
                    if( common ) out = common
                    print out
                }
            }
            function common(matches) {
                # find the common root of a list of matches, if it exists
                for( x in matches ) {
                    if( matches[x] && (!short || length(x) < length(short)) ) {
                        short = x
                    }
                }
                if( short == "/" ) return
                # use a copy to escape special characters, as we want to return
                # the original. yeah, this escaping is awful.
                clean_short = short
                gsub(/[\(\)\[\]\|]/, "\\\\&", clean_short)
                for( x in matches ) if( matches[x] && x !~ clean_short ) return
                return short
            }
            BEGIN {
                gsub(" ", ".*", q)
                hi_rank = ihi_rank = -9999999999
            }
            {
                if( typ == "rank" ) {
                    rank = $2
                } else if( typ == "recent" ) {
                    rank = $3 - t
                } else rank = frecent($2, $3)
                if( $1 ~ q ) {
                    matches[$1] = rank
                } else if( tolower($1) ~ tolower(q) ) imatches[$1] = rank
                if( matches[$1] && matches[$1] > hi_rank ) {
                    best_match = $1
                    hi_rank = matches[$1]
                } else if( imatches[$1] && imatches[$1] > ihi_rank ) {
                    ibest_match = $1
                    ihi_rank = imatches[$1]
                }
            }
            END {
                # prefer case sensitive
                if( best_match ) {
                    output(matches, best_match, common(matches))
                } else if( ibest_match ) {
                    output(imatches, ibest_match, common(imatches))
                }
            }
        ')"
        [ $? -gt 0 ] && return
        [ "$cd" ] && cd "$cd"
    fi
}

alias ${_Z_CMD:-z}='_z 2>&1'

[ "$_Z_NO_RESOLVE_SYMLINKS" ] || _Z_RESOLVE_SYMLINKS="-P"

if compctl >/dev/null 2>&1; then
    # zsh
    [ "$_Z_NO_PROMPT_COMMAND" ] || {
        # populate directory list, avoid clobbering any other precmds.
        if [ "$_Z_NO_RESOLVE_SYMLINKS" ]; then
            _z_precmd() {
                _z --add "${PWD:a}"
            }
        else
            _z_precmd() {
                _z --add "${PWD:A}"
            }
        fi
        [[ -n "${precmd_functions[(r)_z_precmd]}" ]] || {
            precmd_functions[$(($#precmd_functions+1))]=_z_precmd
        }
    }
    _z_zsh_tab_completion() {
        # tab completion
        local compl
        read -l compl
        reply=(${(f)"$(_z --complete "$compl")"})
    }
    compctl -U -K _z_zsh_tab_completion _z
elif complete >/dev/null 2>&1; then
    # bash
    # tab completion
    complete -o filenames -C '_z --complete "$COMP_LINE"' ${_Z_CMD:-z}
    [ "$_Z_NO_PROMPT_COMMAND" ] || {
        # populate directory list. avoid clobbering other PROMPT_COMMANDs.
        grep "_z --add" <<< "$PROMPT_COMMAND" >/dev/null || {
            PROMPT_COMMAND="$PROMPT_COMMAND"$'\n''_z --add "$(command pwd '$_Z_RESOLVE_SYMLINKS' 2>/dev/null)" 2>/dev/null;'
        }
    }
fi

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


fetch latest tags

fetch latest tags

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


Delete secure-kube-context-setup.sh

Delete secure-kube-context-setup.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/kalise/Kubernetes-Lab-Tutorial.git/'


Added debug functions. Added sleep for some scripts

source install-parameters.sh
if [ -z $1 ]
	then
		echo "Using default controller host name: "$controller_host_name
	else
		controller_host_name = $1
fi
local_ip=`hostname -I`
echo "IP to be configured in /etc/hosts: "$local_ip
controller_ip_address=$local_ip

echo_and_sleep "About to setup KeyStone..." 5
bash controller/install-and-update-keystone.sh $keystone_db_password $mysql_user $mysql_password $controller_host_name $admin_tenant_password

echo_and_sleep "About to setup Glance..." 5
bash controller/install-and-update-glance.sh $glance_db_password $mysql_user $mysql_password $controller_host_name $admin_tenant_password $glance_password

echo_and_sleep "About to setup NOVA..."
bash controller/install-and-update-nova.sh $nova_db_password $mysql_user $mysql_password $controller_host_name $admin_tenant_password $nova_password $rabbitmq_password

error: pathspec 'install-controller-step-3.sh' did not match any file(s) known to git


redirect stdin to /dev/null for ssh, second trial

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/JonnyCE/project-platform.git/'


Add zola new script

Add zola new script

#!/usr/bin/env bash

#
# Enable strict bash mode
set -euo pipefail
# IFS=$'\t\n'

SCRIPT_PATH=`readlink -f $0`
SCRIPT_DIR=`dirname ${SCRIPT_PATH}`
ROOT_DIR=`dirname ${SCRIPT_DIR}`

POSTS_DIR="${ROOT_DIR}/content/posts"

post_title="$*"
post_title="${post_title:-Demo Draft}"

post_name=`date +%F`
for each_arg in ${post_title}; do
    post_name="${post_name}-${each_arg}"
done
post_name="${post_name}.md"

draft_path="${POSTS_DIR}/${post_name}"

cat - <<EOF > "${draft_path}"
+++
title = "$post_title"
description = "$post_title"
date = 2018-02-06T13:08:22+08:00
draft = false
# template = "page.html"
[taxonomies]
categories =  ["category here"]
tags = ["tag 1", "tag 2", "tag 3"]
+++

Content goes here.

EOF

echo "Create new post: \"${draft_path}\""

# vim:nu:tabstop=4:shiftwidth=4:ft=sh

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


feat(rofi): Added new rofi script to use text snippets.

#!/bin/bash

SNIPS=/storage/src/dot_files/text_snippets

FILE=$(ls $SNIPS | rofi -dmenu)

if [ -f $SNIPS/$FILE ]; then
	DATA=$([ -x "$SNIPS/$FILE"] && bash "$SNIPS/$FILE" || head --bytes=-1 $SNIPS/$FILE)
	printf "$DATA" | xclip -selection clipboard
	printf "$DATA" | xclip -selection primary
	xdotool key shift+Insert
fi

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


Adding maven release

Adding maven release

#!/usr/bin/env bash

mvn release:clean
mvn -B release:prepare
mvn release:perform

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


add init data

add init data

#!/bin/bash
# set setuid so that it is run with the user which checked out the
# orginal git

# would like to set -e, but this causes odd errors
# set -e

echo "Content-type: text/plain"
echo ""

TAG=init-data
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export HOME=/home/`whoami`
GIT_DIR=$HOME/git/bitquant
LOG_DIR=$GIT_DIR/web/log

if [ -e $LOG_DIR/$TAG.done ] ; then
rm -f $LOG_DIR/$TAG.done
rm -f $LOG_DIR/$TAG.log
fi

(
flock -x -n 200 || (echo "process already running" ; exit 1)
# Redirect STDERR to STDOUT
exec 6>&1
exec > $LOG_DIR/$TAG.log
exec 2>&1

echo "Running from directory $GIT_DIR as user "`whoami`
echo "Shutting down servers"
sudo systemctl stop bitquant
echo "Doing init data"
$GIT_DIR/git/init-og.sh
echo "Starting up servers"
sudo systemctl enable bitquant
sudo systemctl start bitquant
touch $LOG_DIR/$TAG.done
echo "(done)"
exec 1>&6
) 200> $LOG_DIR/$TAG.lock &

error: pathspec 'web/cgi-bin/bittrader/init-data.sh' did not match any file(s) known to git


Moved comments

Moved comments

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


removed psensor

removed psensor

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/ksangers/uamp-dev-environment.git/'


Add script to install LRTE release.

Add script to install LRTE release.

# This script will install the prebuilt release deb packages hosted by
# github.

# Make sure apt support pulling package using https
apt-get install -y apt-transport-https
apt-add-repository 'deb https://github.com/mzhaom/lrte/releases/download/v2.0_0 ./'
apt-get update
apt-get install lrtev2-crosstoolv2-gcc-4.9 lrtev2-crosstoolv2-clang-3.7

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


Create Spotify script

Create Spotify script

#!/usr/bin/env bash
clear

# Make sure only root can run this script
if [[ $EUID -ne 0 ]]; then
   echo "This script must be run as root" 1>&2
   exit 1
fi

# 1. Add the Spotify repository signing key to be able to verify downloaded packages
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys D2C19886

# 2. Add the Spotify repository
echo deb http://repository.spotify.com stable non-free | sudo tee /etc/apt/sources.list.d/spotify.list

# 3. Update list of available packages
sudo apt-get update

# 4. Install Spotify
sudo apt-get install spotify-client --reinstall

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


trying to save errors

trying to save errors

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


Bash command; docker container logic

Bash command; docker container logic

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


contrib/slurm: add cleanup script

contrib/slurm: add cleanup script

#!/bin/bash

HOSTNAME="$(hostname)"
echo "[$HOSTNAME] $(screen -ls)"
screen -ls | grep Detached | grep scalaris_ | cut -d. -f1 | awk '{print $1}' | xargs -r kill
echo "[$HOSTNAME] killing epmd process..."
pkill epmd

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


remove un-necessary temp variables

remove un-necessary temp variables

[#148034521]

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/pvsone/pcf-pipelines.git/'


added new commands

added new commands

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


Plot generation & fitting.

Plot generation & fitting.

#!/bin/bash

cat << END | gnuplot
set term png
set output 'time.png'
f(x) = a*x + b
g(x) = x / 55 * 10
fit f(x) "output" u (g(\$1)):2 via a,b
title_f(a,b) = sprintf('%.2g * size + %.2g', a, b)
plot "output" u (g(\$1)):2 w p ps 0.1 pt 4 title "pts",\
     "output" u (g(\$1)):(f(g(\$1))) w l ls 2 title title_f(a,b)
END

error: pathspec 'acid-state/gen_plot.sh' did not match any file(s) known to git


1.0.1

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


Reverting my last change (r403). The trailing slash makes django.zip unusable on OS X. http://groups.google.de/group/codereview-list/browse_thread/thread/60a8725b9fdfe129

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/nicko96/Chrome-Infra.git/'


Mame Slackbuild added

Mame Slackbuild added

#!/usr/bin/env bash

set -e

REPO=mame
PRGNAM=$REPO
CORE=mame_libretro
TMP=${TMP:-/tmp}
PKG=$TMP/package-$REPO
BUILD=1

# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i486 ;;
    arm*) ARCH=arm ;;
    # Unless $ARCH is already set, use uname -m for all other archs:
       *) ARCH=$( uname -m ) ;;
  esac
fi

if [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

rm -rf $PKG
rm -rf $TMP/$REPO

mkdir -p $PKG
cd $TMP
git clone https://github.com/libretro/${REPO}.git
cd $REPO

chown -R root:root .
find -L . \
 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  -o -perm 511 \) -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

CWD=`pwd`
VERSION=`git rev-parse --short HEAD`

# Download the core info file from the libretro-super project directly into the package
mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/libretro/info
cd $PKG/usr/lib$LIBDIRSUFFIX/libretro/info
curl -O https://raw.githubusercontent.com/libretro/libretro-super/master/dist/info/${CORE}.info

# build and install the core
cd $CWD
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
LDFLAGS="-L/usr/lib${LIBDIRSUFFIX}" \
make -f Makefile.libretro

mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/libretro
cp *.so $PKG/usr/lib$LIBDIRSUFFIX/libretro/

find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

cd $PKG
/sbin/makepkg -l y -c n $TMP/$PRGNAM-$VERSION-$ARCH-${BUILD}.txz

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


tmux - i3wm aware navigation script - fix bug  where error is fired if tmux does have any split windows

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


add testallssa.sh

add testallssa.sh

#!/bin/bash
for d in gobyexample/*
do
 echo "Test running:" $d
 cd $d
 ssadump -run *.go
 cd ~/go/src/github.com/tardisgo/tardisgo-samples
done

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


Add diff and exa aliases

Add diff and exa aliases

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


initial commit for the script that will take two containers and cross join them in each others network.

#!/usr/bin/env bash
#===============================================================================
#
#          FILE: cross-join-containers.sh
#
#         USAGE: ./cross-join-containers.sh
#
#   DESCRIPTION: This script has a very specific purpose and that is to take
#                a container from one network and add it to a other network
#                and then do the same for a container in the other network.
#                This is for the scenario that there are two app stacks with
#                two sets of docker containers each with their own network.
#                This is used when there needs to be two containers that need
#                to talk to each other while sitting in their separate network.
#                Effectively the same type of container in each network will be
#                cross joined to the others network, so each container will be
#                part of two networks.
#
#       OPTIONS: ---
#  REQUIREMENTS: ---
#          BUGS: ---
#         NOTES: ---
#        AUTHOR: Bob Lozano - bob@devops.center
#                Gregg Jensen - gjensen@devops.center
#  ORGANIZATION: devops.center
#       CREATED: 04/29/2018 17:37:19
#      REVISION:  ---
#
# Copyright 2014-2017 devops.center llc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#===============================================================================

#set -o nounset     # Treat unset variables as an error
#set -o errexit     # exit immediately if command exits with a non-zero status
#set -o verbose     # print the shell lines as they are executed
#set -x             # essentially debug mode

usage()
{
cat << EOF

USAGE: cross-join-containers.sh --app1 appName1 --app2 appName2 --type containerType

    --app1|-a1 appName1 is the application name for one of the app stacks that is
              running in it's own network.

    --app2|-a2 appName2 is the application name for one of the app stacks that is
              running in it's own network.

    --type|-t containerType take the word from the name of the container that describes
              the type.
              Example: f1-local-web-1 and f2-local-web-1 need to cross joined in the
              others network.  The type is: web  so:

              cross-join-containres.sh -t web

EOF
}

#---  FUNCTION  ----------------------------------------------------------------
#          NAME:  checkForTwoRunningContainers
#   DESCRIPTION:  checks for two containers that have the given type are running
#    PARAMETERS:
#       RETURNS:
#-------------------------------------------------------------------------------
checkForTwoRunningContainers ()
{
    local A1=$1
    local A2=$2
    local ATYPE=$3
    local RET=0

    # need to run the docker command to see the running contianers
    c=0
    NAME_LIST=$(docker ps --format '{{.Names}}')
    if [[ ${NAME_LIST} == *"${A1}-local-${ATYPE}"* ]]; then
        c=$((c+1))
    fi

    if [[ ${NAME_LIST} == *"${A2}-local-${ATYPE}"* ]]; then
        c=$((c+1))
    fi

    if [[ $c -ne 2 ]]; then
        RET=1
    fi

    echo ${RET}
}	# ----------  end of function checkForTwoRunningContainers  ----------

#---  FUNCTION  ----------------------------------------------------------------
#          NAME:  checkForTwoNetworks
#   DESCRIPTION:  check to see if the network for each app has been set up
#    PARAMETERS:
#       RETURNS:
#-------------------------------------------------------------------------------
checkForTwoNetworks ()
{
    local A1=$1
    local A2=$2
    local RET=0
    # need to check for both app stacks network has been set up
    c=0
    NETWORK_LIST=$(docker network ls --format '{{.Name}}')
    if [[ ${NETWORK_LIST} == *"${A1}_local_network"* ]]; then
        c=$((c+1))
    fi

    if [[ ${NETWORK_LIST} == *"${A2}_local_network"* ]]; then
        c=$((c+1))
    fi

    if [[ $c -ne 2 ]]; then
        RET=1
    fi

    echo ${RET}
}	# ----------  end of function checkForTwoNetworks  ----------
#-------------------------------------------------------------------------------
# Make sure there are the exact number of arguments
#-------------------------------------------------------------------------------
if [[ $# -le 1 ]]; then
    usage
    exit 1
fi

#-------------------------------------------------------------------------------
# Loop through the arguments and assign input args with the appropriate variables
#-------------------------------------------------------------------------------

while [[ $# -gt 0 ]]; do
    case ${1} in
      --app1|-a1 )   shift
             APP_1=$1
             ;;
      --app2|-a2 )   shift
             APP_2=$1
             ;;
      --type|-t )   shift
             CONTAINER_TYPE=$1
             ;;
      * )    usage
             exit 1
    esac
    shift
done

#-------------------------------------------------------------------------------
# Now see if there are two containers running with that type
#-------------------------------------------------------------------------------
RET_VAL=$(checkForTwoRunningContainers ${APP_1} ${APP_2} ${CONTAINER_TYPE})

if [[ ${RET_VAL} -eq 1 ]]; then
    exit 1
fi

#-------------------------------------------------------------------------------
# OK, there must be two running so lets continue.
# now check for the two networks
#-------------------------------------------------------------------------------
RET_VAL=$(checkForTwoNetworks ${APP_1} ${APP_2})

if [[ ${RET_VAL} -eq 1 ]]; then
    exit 1
fi

#-------------------------------------------------------------------------------
# And if we get here, then the containers are running and the two networks are
# setup.  So, now we need to see if the containers are already cross joined
#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------
# OK, lets join each container to the others network
#-------------------------------------------------------------------------------
APP1_NAME=$(docker ps  --filter name="$APP_1-local-${CONTAINER_TYPE}*" --format '{{.Names}}')
NETWORK1_NAME=${APP_1}_local_network
APP2_NAME=$(docker ps  --filter name="$APP_2-local-${CONTAINER_TYPE}*" --format '{{.Names}}')
NETWORK2_NAME=${APP_2}_local_network

# to to cross
docker network connect ${NETWORK2_NAME} ${APP1_NAME} >/dev/null 2>&1
docker network connect ${NETWORK1_NAME} ${APP2_NAME} >/dev/null 2>&1

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


Add overlay.

Add overlay.

if [ "$CI_PULL_REQUEST" = "12709" ] || [ "$CI_BRANCH" = "hint-pattern-out" ]; then

    coqhammer_CI_REF=hint-pattern-out
    coqhammer_CI_GITURL=https://github.com/ppedrot/coqhammer

fi

error: pathspec 'dev/ci/user-overlays/12709-ppedrot-hint-pattern-out.sh' did not match any file(s) known to git


added level0 helper script

added level0 helper script

#!/bin/bash
# pulls a txt file converted from osm file using osmconvert
# from a remote server matching a pattern, then opens it
# in console browser (lynx)
#
# used to fix and expand abbreviated street names in slovakia
#
# recommended way of editing on raspberry pi. tested with raspi 1
#
# accepts three arguments, two of them are optional:
#
# ./adresy2level0editor {pattern} [format] [file]
#
# where
#  pattern = pattern string to search (uses grep pattern-matching)
#  format = if set to josm, lynx is not invoked but instead a series of [nwr]<id> is generated
#           this can be then pasted to josm's download object dialog window
#  file = filename on the remote server
pattern=$1
format=$2
file=adresy_jun12.txt
server=cpi

#######################
if [ ! -z "$3" ]
	then
	file="$3"
	fi
test -z "${format}" && { format="level0" ; }

if [ ${format} == "josm" ]
	then
		ssh ${server} "grep \"${pattern}\" ${file}" | \
		awk -F'\t' '$2 == "node"{type="n"} $2=="way"{type="w"} {printf "%s%s,",type,$1}' | \
		sed 's/,$/\n/'
	else
		ssh ${server} "grep \"${pattern}\" ${file}"  | \
		# too long lines causes issues so splitting at 1000B
		awk -F'\t' '{printf "%s/%s,",$2,$1}{sumlen=sumlen+length($1)+length($2);if (sumlen>1000){sumlen=0;print ""}}'   | \
		sed 's%^%lynx http://level0.osmz.ru/?url=%'   | \
		sed 's/,$/\n/'  | while read -r i
			do
			echo "starting lynx $i"
			eval "$i </dev/null"
			done
	fi

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


added compton script

added compton script

#!/bin/sh

if [ -x "$(command -v compton)" ]; then
    compton -f
fi

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


branching script from the hadoop repo

branching script from the hadoop repo

#!/bin/bash
TAG=$1
URL=$2
BASE_IMAGE="spark-base"
echo $URL > $BASE_IMAGE/url
grep -l -r "$BASE_IMAGE:latest" | grep -v branch.sh |xargs sed -i "s/$BASE_IMAGE:latest/$BASE_IMAGE:$TAG/g"

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