Added sirius-vaca-checkout back into repo

#!/usr/bin/env bash

function checkout_release_branches {

  cd $FACCODE/va; ans1=$(git status | grep "nothing to commit");
  cd $FACCODE/sirius; ans2=$(git status | grep "nothing to commit");
  cd $FACROOT/siriusdb; ans3=$(git status | grep "nothing to commit");

  if [ -z "$ans1" -o -z "$ans2" -o -z "$ans3" ]; then
    printf "At least one of the repositories has modifications. bailing out...\n"
  else
    printf "<va>\n"; cd $FACCODE/va; git fetch --all; git checkout release-v0.15.1; sudo python3 ./setup.py develop; printf "\n"
    printf "<sirius>\n"; cd $FACCODE/sirius; git fetch --all; git checkout release-v0.11.2; sudo python3 ./setup.py develop; printf "\n"
    printf "<siriusdb>\n"; cd $FACROOT/siriusdb; git fetch --all; git checkout release-v0.0.1; printf "\n"
  fi

}

function checkout_master_branches {

  printf "<va>\n"; cd $FACCODE/va; git checkout master; sudo python3 ./setup.py develop; printf "\n"
  printf "<sirius>\n"; cd $FACCODE/sirius; git checkout master; sudo python3 ./setup.py develop; printf "\n"
  printf "<siriusdb>\n"; cd $FACROOT/siriusdb; git checkout master; printf "\n"

}

function set_envs {
    # descubro o ip da máquina
    IP=$( ifconfig | grep -A 2 eth0 | grep "inet add" | cut --delimiter=":" -f 2 | cut --delimiter="B" -f 1 )
    if [ -z "$IP" ]; then
        IP=$( ifconfig | grep -A 2 eth1 | grep "inet add" | cut --delimiter=":" -f 2 | cut --delimiter="B" -f 1 )
    fi
    export EPICS_CA_ADDR_LIST=$IP
    export EPICS_CA_AUTO_ADDR_LIST=no
}

function checkout_release_run {

    checkout_release_branches
    set_envs
    sirius-vaca.py

}

if [ "$#" -eq 0 ]; then
  checkout_release_run
elif [ "$#" -eq 1 -a "$1" == "releases" ]; then
  checkout_release_branches
elif [ "$#" -eq 1 -a "$1" == "masters" ]; then
  checkout_master_branches
else
  printf "Invalid number of arguments!\n"
fi

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


feat(scripts): add python dev install script

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


don't exec the downloader, otherwise the script would stop after it

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/loom-build-tool/loom.git/'


changed permissions

changed permissions

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/satellitesharing/bloonix-satellite-raspberrypi.git/'


Introduce scripts/new_class.sh

Introduce scripts/new_class.sh

Helper script for copying template files over to the
appropriate header & source directories.

#!/bin/sh
#
#   Start a new library class -- copies template files to destination group path
#
# NOTE: This script should be ran from the project's root directory, i.e.:
#       ~/Projects/nomlib.git/
#

# PROJECT_SOURCE_DIR/include/nomlib
HEADER_INSTALL_PREFIX="include/nomlib/"

# PROJECT_SOURCE_DIR/src/
SOURCE_INSTALL_PREFIX="src/"

# PROJECT_SOURCE_DIR/Resources/SharedSupport/Template.hpp
HEADER_TEMPLATE_PATH="Resources/SharedSupport/Template.hpp"

# PROJECT_SOURCE_DIR/Resources/SharedSupport/Template.cpp
SOURCE_TEMPLATE_PATH="Resources/SharedSupport/Template.cpp"

# cp executable path to use
CP_BIN=$(which cp)  # /usr/local/bin/cp
CP_ARGS="-av"       # GNU CP

# Destination filing directory.
DEST_GROUP=$1

# Destination file name to use when copying our template class files over.
DEST_FILE=$2

# Exit if err
function check_script_paths()
{
  if [[ -d "${HEADER_INSTALL_PREFIX}" && "${SOURCE_INSTALL_PREFIX}" && "${HEADER_TEMPLATE_PATH}" && "${SOURCE_TEMPLATE_PATH}" ]]; then
    continue # Success!
  else
    echo "ERROR: One or more script variable file paths do not exist!"
    exit
  fi
}

# Exit if err
function check_dest_paths()
{
  # Destination file path is a directory, exists and is readable
  if [[ -d "${HEADER_INSTALL_PREFIX}/${DEST_GROUP}" && -r "${HEADER_INSTALL_PREFIX}/${DEST_GROUP}" ]]; then
    continue # Success!
  else
    echo "ERROR: ${HEADER_INSTALL_PREFIX}/${DEST_GROUP} does not exist, or is not readable!"
    exit
  fi

  if [[ -f "${HEADER_INSTALL_PREFIX}/${DEST_GROUP}/${DEST_FILE}.hpp" ]]; then
    echo "ERROR: ${HEADER_INSTALL_PREFIX}/${DEST_GROUP}/${DEST_FILE} already exists!"
    exit
  fi

  # Destination file path is a directory, exists and is readable
  if [[ -d "${SOURCE_INSTALL_PREFIX}/${DEST_GROUP}" && -r "${SOURCE_INSTALL_PREFIX}/${DEST_GROUP}" ]]; then
    continue # Success!
  else
    echo "ERROR: ${SOURCE_INSTALL_PREFIX}/${DEST_GROUP} does not exist, or is not readable!"
    exit
  fi

  if [[ -f "${SOURCE_INSTALL_PREFIX}/${DEST_GROUP}/${DEST_FILE}.cpp" ]]; then
    echo "ERROR: ${SOURCE_INSTALL_PREFIX}/${DEST_GROUP}/${DEST_FILE} already exists!"
    exit
  fi
}

# Print usage info and quit
function usage_info()
{
  echo "Usage: ./$0 <group> <new_class_name>"
  echo "\n"
  echo "i.e.: ./$0 gui DataViewColumn"
  exit
}

if [[ ${DEST_GROUP} != "" && ${DEST_FILE} != "" ]]; then

    # Sanity checks; exit if err
    check_dest_paths
    check_script_paths

    # Template.cpp -> <new_class_name>.hpp
    ${CP_BIN} ${CP_ARGS} ${HEADER_TEMPLATE_PATH} ${HEADER_INSTALL_PREFIX}/${DEST_GROUP}/${DEST_FILE}.hpp

    # Template.cpp -> <new_class_name>.cpp
    ${CP_BIN} ${CP_ARGS} ${SOURCE_TEMPLATE_PATH} ${SOURCE_INSTALL_PREFIX}/${DEST_GROUP}/${DEST_FILE}.cpp
else
  usage_info
fi

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


Update Contact to include payable account name

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


Añadidos ficheros de envio de tramas desde la Raspberry Pi

#!/bin/sh

nohup $HOME/dht22/dht22_file.py &
# nohup $HOME/dht22/dht22_net.py &

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


Script to compare traces side by side.

Script to compare traces side by side.

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

set -e

DUMP=${DUMP:-`dirname "$0"`/dump}

$DUMP

stripdump () {
    # http://www.theeggeadventure.com/wikimedia/index.php/Linux_Tips#Use_sed_to_remove_ANSI_colors
    $DUMP "$1" \
    | sed \
        -e 's/\x1b\[[0-9]\{1,2\}\(;[0-9]\{1,2\}\)\{0,2\}m//g' \
        -e 's/\r$//g' \
        -e 's/^[0-9]\+ //' \
        -e 's/hdc = \w\+/hdc/g' \
    | head -1000 \
    > "$2"
}

FIFODIR=`mktemp -d`
FIFO1="$FIFODIR/1"
FIFO2="$FIFODIR/2"

mkfifo "$FIFO1"
mkfifo "$FIFO2"

stripdump "$1" "$FIFO1" &
stripdump "$2" "$FIFO2" &

sdiff --width=`tput cols` --speed-large-files "$FIFO1" "$FIFO2" | less -R

rm -rf "$FIFODIR"

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


Just to commit a way to interpret parameters in bash using "getopts". But best way is not to use "getopts" or "getopt but a simple "case" and "shift"...

#!/bin/bash

SW="OpenUDC"
Version="ugen_udid.sh ($SW) 0.0.1 - devel"

# translate long options to short
# Note: This enable long options but disable "--?*" in $OPTARG, or disable long options after  "--" in option fields.
for ((i=1;$#;i++)) ; do
    case "$1" in
        --)
            # [ ${args[$((i-1))]} == ... ] || EndOpt=1 ;;& # DIRTY: we still can handle some execptions...
            EndOpt=1 ;;&
        --version) ((EndOpt)) && args[$i]="$1"  || args[$i]="-V";;
        # default case : short option use the first char of the long option:
        --?*) ((EndOpt)) && args[$i]="$1"  || args[$i]="-${1:2:1}";;
        # pass through anything else:
        *) args[$i]="$1" ;;
    esac
    shift
done
# reset the translated args
set -- "${args[@]}"

function usage {
echo "Usage: $0 [options] files" >&2
    exit $1
}

# now we can process with getopt
while getopts ":hvVc:" opt; do
    case $opt in
        h)  usage ;;
        v)  VERBOSE=true ;;
        V)  echo $Version ; exit ;;
        c)  source $OPTARG ;;
        \?) echo "unrecognized option: -$opt" ; usage -1 ;;
        :)
        echo "option -$OPTARG requires an argument"
        usage -1
        ;;
    esac
done

shift $((OPTIND-1))
[[ "$1" == "--" ]] && shift

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


Create ArduinoEventStatesURI_bashCompanion.sh

#!/bin/bash

# quick & ditry test to see if "We/I can make this particular bear dance [again]" ;D
#
# Nb: digg the following for maybe a way to know wich keys are currently pressed ( aka more than one at a time -> better to update our event states URI ;p )
# http://superuser.com/questions/248517/show-keys-pressed-in-linux
# also
# http://stackoverflow.com/questions/9731281/bash-script-listen-for-key-press-to-move-on
# &
# http://stackoverflow.com/questions/23462221/bash-read-input-only-once-and-do-not-continue-reading-until-key-is-released

# --------------------------------------------
# Source used aliases & fcns
source ~/.bash_stephaneag_functions
source ~/.bash_stephaneag_aliases

# --------------------------------------------
# trap ctrl-c and call ctrl_c() ( useful for cleanup )
trap ctrl_c INT

ctrl_c() {
  #echo
  #echo "** Trapped CTRL-C ! **"
  # do some cleanup
  cleanup

  # fix to restore the prompt ( ' having invisible commands typing, because "read" disbles local echo ( .. ) )
  #reset - as efficient but has side effects :/
  stty "$console_bckp"

  exit 0
}

#--------------------------------------------
# cleanup
cleanup(){
  # delete file descriptor used for the Arduino serial conn, aka close /dev/ttyUSB0
  exec 3>&-

  echo -en "\rcleanup done!"
}

#--------------------------------------------
# Arduino event states URI chunks -> those will be updated & used a the event states URI chunks, & also allows us to have the needed defaults in our URI
read_chunk_C1="0"   # chunk #1  ( ltrig )
read_chunk_H1="0"   # chunk #2  ( rtrig )
read_chunk_C2="128" # chunk #3  ( ljoyY )      / resting voltage 2.3V on 4.6V
read_chunk_H2="128" # chunk #4  ( rjoyY )      / resting voltage 2.3V on 4.6V
read_chunk_C3="128" # chunk #5  ( ljoyX )      / resting voltage 2.3V on 4.6V
read_chunk_H3="128" # chunk #6  ( rjoyX )      / resting voltage 2.3V on 4.6V
read_chunk_C4="1"   # chunk #7  ( ljoyS )      / HIGH by default ( 4.4V on 4.6V )
read_chunk_H4="1"   # chunk #8  ( rjoyS )      / HIGH by default ( 4.4V on 4.6V )
read_chunk_C5="1"   # chunk #9  ( btnBack )    / HIGH by default ( 4.4V on 4.6V )
read_chunk_H5="0"   # chunk #10 ( btnBlack )
read_chunk_C6="1"   # chunk #11 ( btnStart )   / HIGH by default ( 4.4V on 4.6V )
read_chunk_H6="0"   # chunk #12 ( btnWhite )
read_chunk_C7="1"   # chunk #13 ( keypadUp )   / HIGH by default ( 4.4V on 4.6V )
read_chunk_H7="0"   # chunk #14 ( btnY )
read_chunk_C8="1"   # chunk #15 ( keypadDown ) / HIGH by default ( 4.4V on 4.6V )
read_chunk_H8="0"   # chunk #16 ( btnA )
read_chunk_C9="1"   # chunk #17 ( keypadLeft ) / HIGH by default ( 4.4V on 4.6V )
read_chunk_H9="0"   # chunk #18 ( btnX )
read_chunk_C10="1"  # chunk #19 ( keypadRight ) / HIGH by default ( 4.4V on 4.6V )
read_chunk_H10="0"  # chunk #20 ( btnB )

#--------------------------------------------
# No need to specify control defaults ( & neither keyup events ) as they're automatically reset at the beginning of each loop on the uC side

#--------------------------------------------
# Analog controls defaults & range to be used in arithmetical expressions responsible for smoothing - not currently used
# chunk #1  ( ltrig )
ltrig_min=0
ltrig_max=255
curr_ltrig=0
# chunk #2  ( rtrig )
ltrig_min=0
ltrig_max=255
curr_ltrig=0

# chunk #3  ( ljoyY )      / resting voltage 2.3V on 4.6V
ljoyY_min=0
ljoyY_max=255
curr_ljoyY=128
# chunk #4  ( ljoyX )      / resting voltage 2.3V on 4.6V
ljoyY_min=0
ljoyY_max=255
curr_ljoyY=128
# chunk #6  ( rjoyY )      / resting voltage 2.3V on 4.6V
ljoyY_min=0
ljoyY_max=255
curr_ljoyY=128
# chunk #7  ( rjoyX )      / resting voltage 2.3V on 4.6V
ljoyY_min=0
ljoyY_max=255
curr_ljoyY=128

#--------------------------------------------
# Keyboard keys default states ( mapped with the name of their control )
state_ltrig="up"
state_rtrig="up"
state_ljoyUp="up"
state_ljoyDown="up"
state_ljoyLeft="up"
state_ljoyRight="up"
state_ljoySelect="up"
state_btnY="up"
state_btnA="up"
state_btnX="up"
state_btnB="up"
state_btnBack="up"
state_btnStart="up"
state_keypadUp="up"
state_keypadDown="up"

#--------------------------------------------
# Simple arithmetical expressions & stuff ( maybe to be used later with AAF for a character control on a map ? ;P )
x=0
x_max=100 # screen width
y=0
y_max=50 # screen height
curr_x=50
curr_y=25

zoom=0
zoom_max=100
curr_zoom=50

#--------------------------------------------
# Functions using arithmetical expressions to update curr_x & curr_y, and also curr_zoom ;) - not currently used, kept from older code ( .. )
upKeyPress(){
  if (( "$curr_x" >= "$x_max" )); then
    curr_x="$x"
  else
    let curr_x++
  fi
}
downKeyPress(){
  if (( "$curr_x" <= "$x" )); then
    curr_x="$x_max"
  else
    let curr_x--
  fi
}
leftKeyPress(){
  if (( "$curr_y" <= "$y" )); then
    curr_y="$y_max"
  else
    let curr_y--
  fi
}
rightKeyPress(){
  if (( "$curr_y" >= "$y_max" )); then
    curr_y="$y"
  else
    let curr_y++
  fi
}

#--------------------------------------------
# Key event listener - used to check if keys other than the one just pressed are already down & generate eventStatesURI accordingly before sending it to the uC
# R: the key number corresponding to the keys used, this keyboard, & the current keyboard mapping -> the list follows ..
# x     => 53  ( LTRIG )       -> ltrig      => C1
# n     => 57  ( RTRIG )       -> rtrig      => H1
# f     => 41  ( LJOY UP )     -> ljoyY      => C2
# v     => 55  ( LJOY DOWN )   -> ljoyY      => C2
# d     => 40  ( LJOY LEFT )   -> ljoyX      => C3
# g     => 42  ( LJOY RIGHT )  -> ljoyX      => C3
# r     => 27  ( LJOY SELECT ) -> ljoySelect => C4
# UP    => 111 ( BTN Y )       -> btnY       => H7
# DOWN  => 116 ( BTN A )       -> btnA       => H8
# LEFT  => 113 ( BTN X )       -> btnX       => H9
# RIGHT => 114 ( BTN B )       -> btnB       => H10
# u     => 30  ( BTN BACK )    -> btnBack    => C5
# i     => 31  ( BTN START )   -> btnStart   => C6
# o     => 32  ( KEYPAD UP )   -> keypadUp   => C7
# p     => 33  ( KEYPAD DOWN ) -> keypadDown => C8
handleOtherKeys(){
  # get the keys state ( either up or down )
  state_ltrig=$(xinput query-state "AT Translated Set 2 keyboard" | grep "key\[53]=" | cut -d "=" -f2)
  state_rtrig=$(xinput query-state "AT Translated Set 2 keyboard" | grep "key\[57]=" | cut -d "=" -f2)
  state_ljoyUp=$(xinput query-state "AT Translated Set 2 keyboard" | grep "key\[41]=" | cut -d "=" -f2)
  state_ljoyDown=$(xinput query-state "AT Translated Set 2 keyboard" | grep "key\[55]=" | cut -d "=" -f2)
  state_ljoyLeft=$(xinput query-state "AT Translated Set 2 keyboard" | grep "key\[40]=" | cut -d "=" -f2)
  state_ljoyRight=$(xinput query-state "AT Translated Set 2 keyboard" | grep "key\[42]=" | cut -d "=" -f2)
  state_ljoySelect=$(xinput query-state "AT Translated Set 2 keyboard" | grep "key\[27]=" | cut -d "=" -f2)
  state_btnY=$(xinput query-state "AT Translated Set 2 keyboard" | grep "key\[111]=" | cut -d "=" -f2)
  state_btnA=$(xinput query-state "AT Translated Set 2 keyboard" | grep "key\[116]=" | cut -d "=" -f2)
  state_btnX=$(xinput query-state "AT Translated Set 2 keyboard" | grep "key\[113]=" | cut -d "=" -f2)
  state_btnB=$(xinput query-state "AT Translated Set 2 keyboard" | grep "key\[114]=" | cut -d "=" -f2)
  state_btnBack=$(xinput query-state "AT Translated Set 2 keyboard" | grep "key\[30]=" | cut -d "=" -f2)
  state_btnStart=$(xinput query-state "AT Translated Set 2 keyboard" | grep "key\[31]=" | cut -d "=" -f2)
  state_keypadUp=$(xinput query-state "AT Translated Set 2 keyboard" | grep "key\[32]=" | cut -d "=" -f2)
  state_keypadDown=$(xinput query-state "AT Translated Set 2 keyboard" | grep "key\[33]=" | cut -d "=" -f2)

  # depending on up or down, adjust the corresponding chunk
  # triggers
  if [[ "$state_ltrig" == "down" ]]; then read_chunk_C1="1"; else read_chunk_C1="0"; fi
  if [[ "$state_rtrig" == "down" ]]; then read_chunk_H1="1"; else read_chunk_H1="0"; fi
  # left joystick Y - resting voltage 2.3V on 4.6V
  if [[ "$state_ljoyUp" == "down" && "$state_ljoyDown" == "up" ]]; then
    read_chunk_C2="255"; # go upward
  elif [[ "$state_ljoyDown" == "down" && "$state_ljoyUp" == "up" ]]; then
    read_chunk_C2="0"; # go backward
  else
    read_chunk_C2="128"; # stay still
  fi
  # left joystick X - resting voltage 2.3V on 4.6V
  if [[ "$state_ljoyLeft" == "down" && "$state_ljoyRight" == "up" ]]; then
    read_chunk_C3="0"; # go left
  elif [[ "$state_ljoyRight" == "down" && "$state_ljoyLeft" == "up" ]]; then
    read_chunk_C3="255"; # go right
  else
    read_chunk_C3="128"; # stay still
  fi
  # left joystick select - HIGH by default ( 4.4V on 4.6V )
  if [[ "$state_ljoySelect" == "down" ]]; then read_chunk_C4="0"; else read_chunk_C4="1"; fi
  # btns Y,A,X,B
  if [[ "$state_btnY" == "down" ]]; then read_chunk_H7="1"; else read_chunk_H7="0"; fi
  if [[ "$state_btnA" == "down" ]]; then read_chunk_H8="1"; else read_chunk_H8="0"; fi
  if [[ "$state_btnX" == "down" ]]; then read_chunk_H9="1"; else read_chunk_H9="0"; fi
  if [[ "$state_btnB" == "down" ]]; then read_chunk_H10="1"; else read_chunk_H10="0"; fi
  # btns back & start - HIGH by default ( 4.4V on 4.6V )
  if [[ "$state_btnBack" == "down" ]]; then read_chunk_C5="0"; else read_chunk_C5="1"; fi
  if [[ "$state_btnStart" == "down" ]]; then read_chunk_C6="0"; else read_chunk_C6="1"; fi
  # keypad up & down - HIGH by default ( 4.4V on 4.6V )
  if [[ "$state_keypadUp" == "down" ]]; then read_chunk_C7="0"; else read_chunk_C8="1"; fi
  if [[ "$state_keypadDown" == "down" ]]; then read_chunk_C8="0"; else read_chunk_C8="1"; fi

  # we already have the defaults for the ones we're not using: H2,H3,H4,H5,H6,C9,C10

  # generate the even states URI to be sent to the uC / Arduino
  eventStatesURI="$read_chunk_C1/$read_chunk_H1/$read_chunk_C2/$read_chunk_H2/$read_chunk_C3/$read_chunk_H3/$read_chunk_C4/$read_chunk_H4/$read_chunk_C5/$read_chunk_H5"
  eventStatesURI="$eventStatesURI/$read_chunk_C6/$read_chunk_H6/$read_chunk_C7/$read_chunk_H7/$read_chunk_C8/$read_chunk_H8/$read_chunk_C9/$read_chunk_H9"
  eventStatesURI="$eventStatesURI/$read_chunk_C10/$read_chunk_H10"

  # get anything present in the serial conn from the uC ( "booted" or an event states URI ) - working from here but seems slow :/
  #arduino_eventStatesURI=$(cat <&3)

  # send the event states URI to the uC / Arduino
  # ex: echo "0/0/128/128/128/128/1/1/1/0/1/0/1/0/1/0/1/0/1/0" >&3
  echo "$eventStatesURI" >&3

  # get anything present in the serial conn from the uC ( "booted" or an event states URI )
  arduino_eventStatesURI=$(cat <&3)
}

#--------------------------------------------
# Event states URI logging
# the following is the default uC callback received from serial for an input like the first line following
# 0/0/128/128/128/128/1/1/1/0/1/0/1/0/1/0/1/0/1/0
arduino_eventStatesURI="ltrig:0/rtrig:0/ljoyY:128/rjoyY:128/ljoyX:128/rjoyX:128/ljoyS:1/rjoyS:1/back:1/black:0/start:1/white:0/up:1/Y:0/down:1/A:0/left:1/X:0/right:1/B:0"
logEventStates(){
  echo -en "\rARDUINO CALLBACK: [ $arduino_eventStatesURI ]"
}

#--------------------------------------------
# Hacky handling of arrow keys ( using "A"(up), "B"(down), "D"(left), "C"(right))
hackyKeyboardHandle(){
  # fix to prevent previous lines from appearing ( contains more spaces than the most wide stuff echoed, nb: better ? -> cursor ( AAF ) )
  echo -en "\r                                                                                "
  case $key in
  # x) ltrigPress ;; # LTRIG
  # n) rtrigPress ;; # RTRIG
  # f) ljoyUp ;; # LJOY UP
  # v) ljoyDown ;; # LJOY DOWN
  # d) ljoyLeft ;; # LJOY LEFT
  # g) ljoyRight ;; # LJOY RIGHT
  # r) ljoySelect ;; # LJOY SELECT
  # A) btnYPress ;; # BTN Y
  # B) btnAPress ;; # BTN A
  # D) btnXPress ;; # BTN X
  # C) btnBPress ;; # BTN B
  # u) btnBackPress ;; # BTN BACK
  # i) btnStartPress ;; # BTN START
  # o) keypadUpPress ;; # KEYPAD UP
  # p) keypadUpPress ;; # KEYPAD DOWN
  q) ctrl_c ;; # quit ( same as Ctrl+C )
  # *) logInfos $key # helpful for debugging
  esac

  # also take in account other keys that may already be pressed - kinda hacky, but I guess it'll work ;D
  handleOtherKeys

  # todo: send the event states URI to the uC

  # to do: get the event states URI callback & update it locally

  # log either the default infos or actual infos updated after getting a serial callback from the Arduino
  logEventStates

}

#--------------------------------------------
#Init & args debug

# fix to restore the prompt ( see code in trap Ctrl-C )
console_bckp=$(stty -g)

# TODO: init the arduino serial conn & hackety trick
exec 3<> /dev/ttyUSB0
# wait for Arduino's initialization
sleep 1

#--------------------------------------------
# Automation -> if we're passed an automation script, we should source it instead of runnig an infinite loop to get the user's controls
# the so-colled automation script is
automation_path_arg="$1"
echo "AUTOMATION PATH PASSED AS ARG: $automation_path_arg"

#--------------------------------------------
# Infinite loop
while true
do
  read -s -n1 key # Read 1 characters.
  #echo -en "\rREAD: [" $key "]"
  hackyKeyboardHandle
done

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


Added a simple script to sanity check dns images.

#!/bin/bash
# This script runs some very basic commands to ensure that the newly build
# images are working correctly. Invoke as:
# ./image-checks.sh <image-tag> <registry-name>
# Kill with Ctrl + C once sidecar starts up successfully.
TAG=$1
REGISTRY=${2:-gcr.io/google-containers}
echo "Verifying that iptables exists in node-cache image"
docker run --rm -it --entrypoint=iptables ${REGISTRY}/k8s-dns-node-cache:${TAG}
echo "Verifying that node-cache binary exists in node-cache image"
docker run --rm -it --entrypoint=/node-cache ${REGISTRY}/k8s-dns-node-cache:${TAG}
echo "Verifying dnsmasq-nanny startup"
docker run --rm -it --entrypoint=/dnsmasq-nanny ${REGISTRY}/k8s-dns-dnsmasq-nanny:${TAG}
echo "Verifying kube-dns startup"
docker run --rm -it --entrypoint=/kube-dns ${REGISTRY}/k8s-dns-kube-dns:${TAG}
echo "Verifying sidecar startup"
docker run --rm -it --entrypoint=/sidecar ${REGISTRY}/k8s-dns-sidecar:${TAG}

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


add heroky, yarn and docker. remove gwd

add heroky, yarn and docker.
remove gwd

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


update jekins

update jekins

#!/bin/bash -xe
cd $WORKSPACE/bitsharesx
git submodule init
git submodule update
mkdir $WORKSPACE/build
cd $WORKSPACE/build
export BITSHARES_ROOT=$WORKSPACE
. ../bitshares_toolkit/setenv.sh
cmake -DINCLUDE_QT_WALLET=TRUE -DCMAKE_TOOLCHAIN_FILE=$WORKSPACE/toolchain.invictus/toolchain.invictus.cmake ../bitsharesx
make -j8

#!/bin/bash -xe
cd $WORKSPACE/bitshares_toolkit
git submodule init
git submodule update
mkdir $WORKSPACE/build
cd $WORKSPACE/build
export BITSHARES_ROOT=$WORKSPACE
. ../bitshares_toolkit/setenv.sh
cmake -DINCLUDE_QT_WALLET=TRUE -DCMAKE_TOOLCHAIN_FILE=$WORKSPACE/toolchain.invictus/toolchain.invictus.cmake ../bitshares_toolkit
make -j8


Turn back on S3

Turn back on S3

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/rwood-moz/automation.git/'


Added backup scripts directory and mondb backup script

#!/bin/sh

short_month="$(date +%b)"
year="$(date +%Y)"

db_backup_base_dir="$HOME/bkp/db/$year/$short_month"
db_backup_dir_name="db-$(date +%F)"
db_backup_dir_path="$db_backup_base_dir/$db_backup_dir_name/dump"

take_bakup() {
    # echo "$db_backup_dir_path"
    mongodump --host localhost --db testdb --out "$db_backup_dir_path"

    if [ "$?" != "0" ]; then
        exit
    fi

    zip_the_backup_and_clean

}

zip_the_backup_and_clean() {
    cd "$db_backup_base_dir"
    zip -r "$db_backup_dir_name.zip" "$db_backup_dir_name"
    rm -r "$db_backup_dir_name"
}

if [ "$1" = "" ] || [ "$1" = "--b" ] || [ "$1" = "--bkp" ] || [ "$1" = "--backup" ]; then
    take_bakup
elif [ "$1" = "--r" ] || [ "$1" = "--rs" ] || [ "$1" = "--restore" ]; then
    echo "Restoring The DB"
fi

error: pathspec 'db-backup-scripts/mongodb/mongob-bkp.sh' did not match any file(s) known to git


add miniconda install

add miniconda install

#!/bin/bash
MINICONDA=Miniconda3-latest-Linux-x86_64.sh
MINICONDA_MD5=$(curl -s http://repo.continuum.io/miniconda/ | grep -A3 $MINICONDA | sed -n '4p' | sed -n 's/ *<td>\(.*\)<\/td> */\1/p')
wget http://repo.continuum.io/miniconda/$MINICONDA
if [[ $MINICONDA_MD5 != $(md5sum $MINICONDA | cut -d ' ' -f 1) ]]; then
    echo "Miniconda MD5 mismatch"
    exit 1
fi
bash $MINICONDA -b
rm -f $MINICONDA

export PATH=$HOME/miniconda3/bin:$PATH

conda update -yq conda
conda install -yq conda-build

error: pathspec 'devtools/travis-ci/install_miniconda.sh' did not match any file(s) known to git


Fix some seem-to-be-wrong TIMIT word alignments

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


Adding taring of old files

Adding taring of old files

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


Remove update_mocks.sh

Remove update_mocks.sh

#! /bin/bash -e

mockgen github.com/golang/mock/gomock Matcher \
  > gomock/mock_matcher/mock_matcher.go
mockgen github.com/golang/mock/sample Index,Embed,Embedded \
  > sample/mock_user/mock_user.go
gofmt -w gomock/mock_matcher/mock_matcher.go sample/mock_user/mock_user.go

echo >&2 "OK"


backup *.sh file.

backup *.sh file.

#!/bin/bash
# author:zhaoming23@gmail.com
echo "git add *.go"
git add *.go

if [ -z $1 ];then
	echo "git commit -m 'no message'"
	git commit -m "no message"
else
	echo "git commit -m '$*'"
	git commit -m "$*"
fi
echo "git push..."
git push

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


skip if given tags are not found on ECR

skip if given tags are not found on ECR

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/Naoya-Horiguchi/hl-tools.git/'


changed heredoc error in mongodb script

changed heredoc error in mongodb script

error: pathspec 'MongoDB' did not match any file(s) known to git
error: pathspec 'Installation' did not match any file(s) known to git
error: pathspec 'Scripts/mongodb-installation-script-for-ubuntu.sh' did not match any file(s) known to git


Update django.plugin.zsh

Update django.plugin.zsh

activate django plugin on command "django-admin"

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


Even more DEs!

Even more DEs!

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/pastapojken/ALIS.sh.git/'


add install redis on brew

add install redis on brew

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


moom and jitouch

moom and jitouch

#!/usr/bin/env bash

# Install command-line tools using Homebrew.

# Make sure we’re using the latest Homebrew.
brew update

# Upgrade any already-installed formulae.
brew upgrade

# Save Homebrew’s installed location.
BREW_PREFIX=$(brew --prefix)

# Install GNU core utilities (those that come with macOS are outdated).
# Don’t forget to add `$(brew --prefix coreutils)/libexec/gnubin` to `$PATH`.
brew install coreutils
ln -s "${BREW_PREFIX}/bin/gsha256sum" "${BREW_PREFIX}/bin/sha256sum"

# Install some other useful utilities like `sponge`.
brew install moreutils
# Install GNU `find`, `locate`, `updatedb`, and `xargs`, `g`-prefixed.
brew install findutils
# Install GNU `sed`, overwriting the built-in `sed`.
brew install gnu-sed --with-default-names
# Install a modern version of Bash.
brew install bash
brew install bash-completion2

# Switch to using brew-installed bash as default shell
if ! fgrep -q "${BREW_PREFIX}/bin/bash" /etc/shells; then
  echo "${BREW_PREFIX}/bin/bash" | sudo tee -a /etc/shells;
  chsh -s "${BREW_PREFIX}/bin/bash";
fi;

# Install `wget` with IRI support.
brew install wget --with-iri

# Install GnuPG to enable PGP-signing commits.
brew install gnupg

# Install more recent versions of some macOS tools.
brew install vim --with-override-system-vi
brew install grep
brew install openssh
brew install screen
brew install php
brew install gmp

# Install font tools.
brew tap bramstein/webfonttools
brew install sfnt2woff
brew install sfnt2woff-zopfli
brew install woff2

# Install some CTF tools; see https://github.com/ctfs/write-ups.
brew install aircrack-ng
brew install bfg
brew install binutils
brew install binwalk
brew install cifer
brew install dex2jar
brew install dns2tcp
brew install fcrackzip
brew install foremost
brew install hashpump
brew install hydra
brew install john
brew install knock
brew install netpbm
brew install nmap
brew install pngcheck
brew install socat
brew install sqlmap
brew install tcpflow
brew install tcpreplay
brew install tcptrace
brew install ucspi-tcp # `tcpserver` etc.
brew install xpdf
brew install xz

# Install other useful binaries.
brew install ack
#brew install exiv2
brew install git
brew install git-lfs
brew install gs
brew install imagemagick --with-webp
brew install lua
brew install lynx
brew install p7zip
brew install pigz
brew install pv
brew install rename
brew install rlwrap
brew install ssh-copy-id
brew install tree
brew install vbindiff
brew install zopfli

# Install Cask utility
brew install caskroom/cask/brew-cask

# install the most common apps w/ cask
brew cask install spotify
brew cask install google-chrome
brew cask install skype
brew cask install transmission
brew cask install the-unarchiver
brew cask install dash
brew cask install mysqlworkbench
brew cask install teamviewer
brew cask install appcleaner
brew cask install dropbox
brew cask install sequel-pro
brew cask install sourcetree
brew cask install firefox
brew cask install opera
brew cask install phpstorm
brew cask install 1password
brew cask install transmit
brew cask install flash-player
brew cask install java
brew cask install eve
brew cask install mamp
brew cask install jitouch
brew cask install moom

# some cask quicklook extensions
brew cask install qlcolorcode
brew cask install qlstephen
brew cask install qlmarkdown
brew cask install quicklook-json
brew cask install qlprettypatch
brew cask install quicklook-csv
brew cask install betterzipql
brew cask install webp-quicklook
brew cask install suspicious-package

# Some other tools like composer, node, bower, gulp...
brew install composer
brew install node

# Remove outdated versions from the cellar.
brew cleanup

#!/usr/bin/env bash

# Install command-line tools using Homebrew.

# Make sure we’re using the latest Homebrew.
brew update

# Upgrade any already-installed formulae.
brew upgrade

# Save Homebrew’s installed location.
BREW_PREFIX=$(brew --prefix)

# Install GNU core utilities (those that come with macOS are outdated).
# Don’t forget to add `$(brew --prefix coreutils)/libexec/gnubin` to `$PATH`.
brew install coreutils
ln -s "${BREW_PREFIX}/bin/gsha256sum" "${BREW_PREFIX}/bin/sha256sum"

# Install some other useful utilities like `sponge`.
brew install moreutils
# Install GNU `find`, `locate`, `updatedb`, and `xargs`, `g`-prefixed.
brew install findutils
# Install GNU `sed`, overwriting the built-in `sed`.
brew install gnu-sed --with-default-names
# Install a modern version of Bash.
brew install bash
brew install bash-completion2

# Switch to using brew-installed bash as default shell
if ! fgrep -q "${BREW_PREFIX}/bin/bash" /etc/shells; then
  echo "${BREW_PREFIX}/bin/bash" | sudo tee -a /etc/shells;
  chsh -s "${BREW_PREFIX}/bin/bash";
fi;

# Install `wget` with IRI support.
brew install wget --with-iri

# Install GnuPG to enable PGP-signing commits.
brew install gnupg

# Install more recent versions of some macOS tools.
brew install vim --with-override-system-vi
brew install grep
brew install openssh
brew install screen
brew install php
brew install gmp

# Install font tools.
brew tap bramstein/webfonttools
brew install sfnt2woff
brew install sfnt2woff-zopfli
brew install woff2

# Install some CTF tools; see https://github.com/ctfs/write-ups.
brew install aircrack-ng
brew install bfg
brew install binutils
brew install binwalk
brew install cifer
brew install dex2jar
brew install dns2tcp
brew install fcrackzip
brew install foremost
brew install hashpump
brew install hydra
brew install john
brew install knock
brew install netpbm
brew install nmap
brew install pngcheck
brew install socat
brew install sqlmap
brew install tcpflow
brew install tcpreplay
brew install tcptrace
brew install ucspi-tcp # `tcpserver` etc.
brew install xpdf
brew install xz

# Install other useful binaries.
brew install ack
#brew install exiv2
brew install git
brew install git-lfs
brew install gs
brew install imagemagick --with-webp
brew install lua
brew install lynx
brew install p7zip
brew install pigz
brew install pv
brew install rename
brew install rlwrap
brew install ssh-copy-id
brew install tree
brew install vbindiff
brew install zopfli

# Install Cask utility
brew install caskroom/cask/brew-cask

# install the most common apps w/ cask
brew cask install spotify
brew cask install google-chrome
brew cask install skype
brew cask install transmission
brew cask install the-unarchiver
brew cask install dash
brew cask install mysqlworkbench
brew cask install teamviewer
brew cask install appcleaner
brew cask install dropbox
brew cask install sequel-pro
brew cask install sourcetree
brew cask install firefox
brew cask install opera
brew cask install phpstorm
brew cask install 1password
brew cask install transmit
brew cask install flash-player
brew cask install java
brew cask install eve
brew cask install mamp

# some cask quicklook extensions
brew cask install qlcolorcode
brew cask install qlstephen
brew cask install qlmarkdown
brew cask install quicklook-json
brew cask install qlprettypatch
brew cask install quicklook-csv
brew cask install betterzipql
brew cask install webp-quicklook
brew cask install suspicious-package

# Some other tools like composer, node, bower, gulp...
brew install composer
brew install node

# Remove outdated versions from the cellar.
brew cleanup


Add version bump script for release prep. Thanks @Wolf480pl

#!/bin/bash

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

echo "Getting current version from pom.xml"
CURRENT_VERSION="`sed -n 's|.*<version>\(.*\)</version>.*|\1|p' pom.xml | awk '{ print $1; exit }'`"  && echo "Current version from pom.xml: $CURRENT_VERSION"

read -p "New version: " NEW_VERSION || die_with "Prompt for new version failed"

if ! echo $NEW_VERSION | grep -i -- '-SNAPSHOT' >/dev/null; then echo "WARNING: changing to a release version!"; fi

echo "Updating the project version in build.gradle, pom.xml and README.md to $NEW_VERSION"
sed -ri "s/"`echo $CURRENT_VERSION | sed 's/\./\\\\./g'`"/$NEW_VERSION/g" build.gradle pom.xml README.md || die_with "Failed to update the project version!"

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


fix for glog lib/lib64 issue

fix for glog lib/lib64 issue

cd ${INSTALL_DIR}/install

if [ -d "lib64" ] && ! [ -d "lib" ]; then
    ln -s lib64 lib
fi

error: pathspec 'package/lib-glog-trunk/scripts.linux/post-install2.sh' did not match any file(s) known to git


test: assert that the progress meter displays positive progress

#!/usr/bin/env bash

. "test/testlib.sh"

begin_test "progress meter displays positive progress"
(
  set -e

  reponame="progress-meter"
  setup_remote_repo "$reponame"
  clone_repo "$reponame" "$reponame"

  git lfs track "*.dat"
  git add .gitattributes
  git commit -m "initial commit"

  for i in `seq 1 128`; do
    printf "$i" > "$i.dat"
  done

  git add *.dat
  git commit -m "add many objects"

  git push origin master 2>&1 | tee push.log
  [ "0" -eq "${PIPESTATUS[0]}" ]

  grep "Git LFS: (128 of 128 files) 276 B / 276 B" push.log
)
end_test

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


dist.sh updated

dist.sh updated

git-svn-id: f9726a030cf96f23c68a92ccd14a73e10c8cadff@21512 a5903396-d722-0410-b921-86c7d4935375

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


Adding exec.sh file to run experiments

Adding exec.sh file to run experiments

#!/usr/bin/env bash

RUN_ID="euclid128"

# conda init bash
eval "$(conda shell.bash hook)"
conda activate keen
python train.py \
        --debug=False \
        --run_id=$RUN_ID \
        --model=DistEuclidean \
        --dims=128 \
        --loss_fn=PairwiseHingeLoss \
        --lr=1e-3 \
        --max_epochs=150 \
        --neg_sample_size=1 \

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


test case for INIT_SOLR_HOME

test case for INIT_SOLR_HOME

#!/bin/bash
#
set -euo pipefail

TEST_DIR="$(dirname -- "${BASH_SOURCE-$0}")"

if (( $# == 0 )); then
  echo "Usage: $BASH_SOURCE tag"
  exit
fi

tag=$1

if [[ ! -z "${DEBUG:-}" ]]; then
  set -x
fi

source "$TEST_DIR/../shared.sh"

echo "Test $tag"
container_name='test_'$(echo "$tag" | tr ':/-' '_')
echo "Cleaning up left-over containers from previous runs"
container_cleanup "$container_name"
echo "Running $container_name"
if [ -d mysolrhome ]; then
  docker run --rm -v "$PWD/mysolrhome:/mysolrhome" "$tag" bash -c "rm -fr /mysolrhome/*"
  rm -fr mysolrhome
fi

mkdir mysolrhome
chmod a+w mysolrhome
docker run --name "$container_name" -d -v "$PWD/mysolrhome:/mysolrhome" -e SOLR_HOME=/mysolrhome -e INIT_SOLR_HOME=yes -d "$tag" "solr-demo"
SLEEP_SECS=5
echo "Sleeping $SLEEP_SECS seconds..."
sleep $SLEEP_SECS
container_status=$(docker inspect --format='{{.State.Status}}' "$container_name")
echo "container $container_name status: $container_status"
if [[ $container_status == 'exited' ]]; then
  docker logs "$container_name"
  exit 1
fi

SLEEP_SECS=10
echo "Sleeping $SLEEP_SECS seconds..."
sleep $SLEEP_SECS
echo "Checking Solr is running"
status=$(docker exec "$container_name" /opt/docker-solr/scripts/wait-for-solr.sh)
if ! egrep -q 'solr is running' <<<$status; then
  echo "Test test_simple $tag failed; solr did not start"
  container_cleanup "$container_name"
  exit 1
fi
sleep 5
echo "Checking data"
data=$(docker exec --user=solr "$container_name" wget -q -O - 'http://localhost:8983/solr/demo/select?q=address_s%3ARound Rock')
if ! egrep -q 'One Dell Way Round Rock, Texas 78682' <<<$data; then
  echo "Test test_simple $tag failed; data did not load"
  exit 1
fi
container_cleanup "$container_name"

docker run --rm -v "$PWD/mysolrhome:/mysolrhome" "$tag" bash -c "rm -fr /mysolrhome/*"
rmdir mysolrhome

echo "Test $BASH_SOURCE $tag succeeded"

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


fix(tests): add htmlparser2 dependency to teamcity/run-server.sh

#!/usr/bin/env bash

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

set -o errexit # exit on first command with non-zero status

BASENAME=$(basename $0)
DIRNAME=$(dirname $0)

if [ "x$1" = "x" ]; then
    echo "Usage: $0 test-name"
    exit
fi
FXA_TEST_NAME=$1

source $DIRNAME/defaults.sh
source $DIRNAME/$FXA_TEST_NAME

# optionally, GIT_COMMIT can be set in the environment to override
if [ -z "$GIT_COMMIT" ]; then
  GIT_COMMIT=$(curl -s "$FXA_CONTENT_VERSION" | jsawk  "return this.commit" | perl -pe 's/^OUT: //')
else
  echo "Using GIT_COMMIT from the environment $GIT_COMMIT"
fi

echo "FXA_TEST_NAME       $FXA_TEST_NAME"
echo "FXA_CONTENT_ROOT    $FXA_CONTENT_ROOT"
echo "FXA_AUTH_ROOT       $FXA_AUTH_ROOT"
echo "FXA_OAUTH_APP_ROOT  $FXA_OAUTH_APP_ROOT"
echo "FXA_DEV_BOX         $FXA_DEV_BOX"
echo "FXA_FIREFOX_BINARY  $FXA_FIREFOX_BINARY"
echo "GIT_COMMIT          $GIT_COMMIT"

echo "FXA_CONTENT_VERSION $FXA_CONTENT_VERSION"
echo "FXA_OAUTH_VERSION   $FXA_OAUTH_VERSION"
echo "FXA_PROFILE_VERSION $FXA_PROFILE_VERSION"
echo "FXA_AUTH_VERSION    $FXA_AUTH_VERSION"

echo ""
echo "Server versions:"
curl -s $FXA_CONTENT_VERSION
curl -s $FXA_OAUTH_VERSION
curl -s $FXA_PROFILE_VERSION
curl -s $FXA_AUTH_VERSION
echo ""

WORKDIR=fxa-content-server-"$FXA_TEST_NAME"-server
rm -rf "$WORKDIR"
git clone https://github.com/mozilla/fxa-content-server.git -b master "$WORKDIR"
cd "$WORKDIR"
git checkout $GIT_COMMIT
git show --summary

npm config set cache ~/.fxacache
export npm_config_cache=~/.fxacache
export npm_config_tmp=~/fxatemp
npm install                  \
  bower@1.7.1                \
  convict@1.0.2              \
  extend@3.0.0               \
  firefox-profile@0.3.11     \
  htmlparser2@3.9.0          \
  intern@3.0.6               \
  mozlog@2.0.2               \
  node-statsd@0.1.1          \
  proxyquire@1.6.0           \
  request@2.67.0             \
  shane-tomlinson/node-uap.git#13fa830e8 \
  sinon@1.15.4               \
  sync-exec@0.6.1            \
  universal-analytics@0.3.9  \
  zaach/node-XMLHttpRequest.git#onerror

set -o xtrace # echo the following commands

./node_modules/.bin/intern-client \
  config=tests/intern_server \
  fxaContentRoot="$FXA_CONTENT_ROOT" \
  fxaProduction="true" \
  fxaDevBox="$FXA_DEV_BOX" \
  asyncTimeout=10000

#!/usr/bin/env bash

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

set -o errexit # exit on first command with non-zero status

BASENAME=$(basename $0)
DIRNAME=$(dirname $0)

if [ "x$1" = "x" ]; then
    echo "Usage: $0 test-name"
    exit
fi
FXA_TEST_NAME=$1

source $DIRNAME/defaults.sh
source $DIRNAME/$FXA_TEST_NAME

# optionally, GIT_COMMIT can be set in the environment to override
if [ -z "$GIT_COMMIT" ]; then
  GIT_COMMIT=$(curl -s "$FXA_CONTENT_VERSION" | jsawk  "return this.commit" | perl -pe 's/^OUT: //')
else
  echo "Using GIT_COMMIT from the environment $GIT_COMMIT"
fi

echo "FXA_TEST_NAME       $FXA_TEST_NAME"
echo "FXA_CONTENT_ROOT    $FXA_CONTENT_ROOT"
echo "FXA_AUTH_ROOT       $FXA_AUTH_ROOT"
echo "FXA_OAUTH_APP_ROOT  $FXA_OAUTH_APP_ROOT"
echo "FXA_DEV_BOX         $FXA_DEV_BOX"
echo "FXA_FIREFOX_BINARY  $FXA_FIREFOX_BINARY"
echo "GIT_COMMIT          $GIT_COMMIT"

echo "FXA_CONTENT_VERSION $FXA_CONTENT_VERSION"
echo "FXA_OAUTH_VERSION   $FXA_OAUTH_VERSION"
echo "FXA_PROFILE_VERSION $FXA_PROFILE_VERSION"
echo "FXA_AUTH_VERSION    $FXA_AUTH_VERSION"

echo ""
echo "Server versions:"
curl -s $FXA_CONTENT_VERSION
curl -s $FXA_OAUTH_VERSION
curl -s $FXA_PROFILE_VERSION
curl -s $FXA_AUTH_VERSION
echo ""

WORKDIR=fxa-content-server-"$FXA_TEST_NAME"-server
rm -rf "$WORKDIR"
git clone https://github.com/mozilla/fxa-content-server.git -b master "$WORKDIR"
cd "$WORKDIR"
git checkout $GIT_COMMIT
git show --summary

npm config set cache ~/.fxacache
export npm_config_cache=~/.fxacache
export npm_config_tmp=~/fxatemp
npm install intern@3.0.6     \
  bower@1.7.1                \
  zaach/node-XMLHttpRequest.git#onerror \
  firefox-profile@0.3.11     \
  request@2.67.0             \
  sync-exec@0.6.1            \
  convict@1.0.2              \
  mozlog@2.0.2               \
  node-statsd@0.1.1          \
  proxyquire@1.6.0           \
  shane-tomlinson/node-uap.git#13fa830e8 \
  sinon@1.15.4               \
  extend@3.0.0               \
  universal-analytics@0.3.9

set -o xtrace # echo the following commands

./node_modules/.bin/intern-client \
  config=tests/intern_server \
  fxaContentRoot="$FXA_CONTENT_ROOT" \
  fxaProduction="true" \
  fxaDevBox="$FXA_DEV_BOX" \
  asyncTimeout=10000


Added buildscript for request-promise-native for ubuntu_18.04 (#1603)

#! /bin/bash -e
# -----------------------------------------------------------------------------
#
# Package	      : request-promise-native
# Version	      : 1.0.7
# Source repo     : https://github.com/request/request-promise-native
# Tested on    	  : Ubuntu 18.04 (Docker)
# Language        : Node
# Travis-Check    : True
# Script License  : Apache License, Version 2 or later
# Maintainer	  : Sumit Dubey <sumit.dubey2@ibm.com>
#
# Disclaimer: This script has been tested in root mode on given
# ==========  platform using the mentioned version of the package.
#             It may not work as expected with newer versions of the
#             package and/or distribution. In such case, please
#             contact "Maintainer" of this script.
# ----------------------------------------------------------------------------

set -ex

WORK_DIR=`pwd`

PACKAGE_NAME=request-promise-native
PACKAGE_VERSION=v1.0.7
PACKAGE_URL=https://github.com/request/request-promise-native.git

# install dependencies
apt-get update -y
apt-get install git curl -y

# install nodejs
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
nvm install 10.24.1
node -v

# clone package
cd $WORK_DIR
git clone $PACKAGE_URL
cd $PACKAGE_NAME
git checkout $PACKAGE_VERSION

# to install
npm install yarn -g
yarn --ignore-engines

# to execute tests
npm run test-publish

error: pathspec 'r/request-promise-native/request-promise-native-1.0.7_ubuntu_18.04.sh' did not match any file(s) known to git


script to calculate genome coverage given a transcriptome and file of short reads

#!/bin/bash

function usage() {
cat <<EOF

USAGE: $0 <subj_seq_file> <qry_seq_file>

subj_seq_file   :   A (nucleotide) Fasta file to index.
qry_seq_file    :   A (nucleotide) Fasta file to query the index.

EOF
}

function print_error() {
cat <<ERR

ERROR: Command line not parsed correctly. Check input.

ERR
}

if [ $# -lt 2 ]; then
    print_error
    usage
    exit 1
fi

for prog in formatdb blastall samtools
do
  hash $prog &> /dev/null
  if [ $? -eq 1 ]; then
      echo >&2 "$prog is required but it's not installed. Exiting."
      exit 1
  fi
done

subjSeq=$1
qrySeq=$2
subjseqFile=$(echo ${subjSeq%.*})
qryseqFile=$(echo ${qrySeq%.*})
db=${subjSeq}_blastdb
blastout=${qryseqFile}_${subjseqFile}.blastn
sam=${qryseqFile}_${subjseqFile}.sam
bam=${qryseqFile}_${subjseqFile}.bam
bamsort=${qryseqFile}_${subjseqFile}_sort

## create the database
formatdb -p F -i $subjSeq -n $db

## run blast
blastall -p blastn -e 1e-10 -a 8 -i $qrySeq -d $db -o $blastout 2> /dev/null

echo -e "blast done...\n"
## convert blast to sam
perl blast2sam.pl $blastout > $sam

echo -e "blast2sam conversion done...\n"
## convert sam to bam, using reference to generate sam headers
samtools view -T $subjSeq -bS $sam > $bam

echo -e "sam to bam conversion done...\n"
## sort the bam
samtools sort $bam $bamsort

echo -e "sam sort done...\n"
## calculate the depth of coverage
samtools depth ${bamsort}.bam | awk '{sum+=$3} END { print "Average = ",sum/NR}'

echo -e "samtools depth done...\n"
## clean up
rm ${db}.*

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


add upgrade shell script for db changes

add upgrade shell script for db changes

#!/bin/bash

MY_DIR=$(dirname $0)
mysql -u$1 --password=$2 < $MY_DIR/schema-0.4.0-upgrade.sql
echo "Updated to 0.4.0 release";

error: pathspec 'install/setup/sql/mysql/thinkbig/0.4.0/upgrade-schema.sh' did not match any file(s) known to git


Update examples-sync.sh

Update examples-sync.sh

Fixes: https://github.com/openshift/openshift-ansible/issues/722

#!/bin/bash

# Utility script to update the ansible repo with the latest templates and image
# streams from several github repos
#
# This script should be run from openshift-ansible/roles/openshift_examples

EXAMPLES_BASE=$(pwd)/files/examples
find files/examples -name '*.json' -delete
TEMP=`mktemp -d`
pushd $TEMP
wget https://github.com/openshift/origin/archive/master.zip -O origin-master.zip
wget https://github.com/openshift/django-ex/archive/master.zip -O django-ex-master.zip
wget https://github.com/openshift/rails-ex/archive/master.zip -O rails-ex-master.zip
wget https://github.com/openshift/nodejs-ex/archive/master.zip -O nodejs-ex-master.zip
wget https://github.com/openshift/dancer-ex/archive/master.zip -O dancer-ex-master.zip
wget https://github.com/openshift/cakephp-ex/archive/master.zip -O cakephp-ex-master.zip
wget https://github.com/jboss-openshift/application-templates/archive//ose-v1.0.2.zip -O application-templates-master.zip
unzip origin-master.zip
unzip django-ex-master.zip
unzip rails-ex-master.zip
unzip nodejs-ex-master.zip
unzip dancer-ex-master.zip
unzip cakephp-ex-master.zip
unzip application-templates-master.zip
cp origin-master/examples/db-templates/* ${EXAMPLES_BASE}/db-templates/
cp origin-master/examples/jenkins/jenkins-*template.json ${EXAMPLES_BASE}/quickstart-templates/
cp origin-master/examples/image-streams/* ${EXAMPLES_BASE}/image-streams/
cp django-ex-master/openshift/templates/* ${EXAMPLES_BASE}/quickstart-templates/
cp rails-ex-master/openshift/templates/* ${EXAMPLES_BASE}/quickstart-templates/
cp nodejs-ex-master/openshift/templates/* ${EXAMPLES_BASE}/quickstart-templates/
cp dancer-ex-master/openshift/templates/* ${EXAMPLES_BASE}/quickstart-templates/
cp cakephp-ex-master/openshift/templates/* ${EXAMPLES_BASE}/quickstart-templates/
mv application-templates-master/jboss-image-streams.json ${EXAMPLES_BASE}/xpaas-streams/
find application-templates-master/ -name '*.json' ! -wholename '*secret*' -exec mv {} ${EXAMPLES_BASE}/xpaas-templates/ \;
popd
git diff files/examples

#!/bin/bash

# Utility script to update the ansible repo with the latest templates and image
# streams from several github repos
#
# This script should be run from openshift-ansible/roles/openshift_examples

EXAMPLES_BASE=$(pwd)/files/examples
find files/examples -name '*.json' -delete
TEMP=`mktemp -d`
pushd $TEMP
wget https://github.com/openshift/origin/archive/master.zip -O origin-master.zip
wget https://github.com/openshift/django-ex/archive/master.zip -O django-ex-master.zip
wget https://github.com/openshift/rails-ex/archive/master.zip -O rails-ex-master.zip
wget https://github.com/openshift/nodejs-ex/archive/master.zip -O nodejs-ex-master.zip
wget https://github.com/openshift/dancer-ex/archive/master.zip -O dancer-ex-master.zip
wget https://github.com/openshift/cakephp-ex/archive/master.zip -O cakephp-ex-master.zip
wget https://github.com/jboss-openshift/application-templates/archive/master.zip -O application-templates-master.zip
unzip origin-master.zip
unzip django-ex-master.zip
unzip rails-ex-master.zip
unzip nodejs-ex-master.zip
unzip dancer-ex-master.zip
unzip cakephp-ex-master.zip
unzip application-templates-master.zip
cp origin-master/examples/db-templates/* ${EXAMPLES_BASE}/db-templates/
cp origin-master/examples/jenkins/jenkins-*template.json ${EXAMPLES_BASE}/quickstart-templates/
cp origin-master/examples/image-streams/* ${EXAMPLES_BASE}/image-streams/
cp django-ex-master/openshift/templates/* ${EXAMPLES_BASE}/quickstart-templates/
cp rails-ex-master/openshift/templates/* ${EXAMPLES_BASE}/quickstart-templates/
cp nodejs-ex-master/openshift/templates/* ${EXAMPLES_BASE}/quickstart-templates/
cp dancer-ex-master/openshift/templates/* ${EXAMPLES_BASE}/quickstart-templates/
cp cakephp-ex-master/openshift/templates/* ${EXAMPLES_BASE}/quickstart-templates/
mv application-templates-master/jboss-image-streams.json ${EXAMPLES_BASE}/xpaas-streams/
find application-templates-master/ -name '*.json' ! -wholename '*secret*' -exec mv {} ${EXAMPLES_BASE}/xpaas-templates/ \;
popd
git diff files/examples


Add abandon_old_review script

Add abandon_old_review script

This patch adds the abandon_old_review script that neutron and nova
both use. The scipt has been updated to work with congress projects.

Change-Id: I689ddc05d2521ef45a30f198256696d465562d70

#!/bin/bash
#
# 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.
#
# before you run this modify your .ssh/config to create a
# review.openstack.org entry:
#
#   Host review.openstack.org
#   User <yourgerritusername>
#   Port 29418
#

# Note: due to gerrit bug somewhere, this double posts messages. :(

# first purge the all reviews that are more than 4w old and blocked by a core -2

set -o errexit

function abandon_review {
    local gitid=$1
    shift
    local msg=$@
    echo "Abandoning $gitid"
    # echo ssh review.openstack.org gerrit review $gitid --abandon --message \"$msg\"
    ssh review.openstack.org -p 29418 gerrit review $gitid --abandon --message \"$msg\"
}

PROJECTS="(project:stackforge/congress OR project:stackforge/python-openstackclient)"

blocked_reviews=$(ssh review.openstack.org -p 29418 "gerrit query --current-patch-set --format json $PROJECTS status:open age:4w label:Code-Review<=-2" | jq .currentPatchSet.revision | grep -v null | sed 's/"//g')

blocked_msg=$(cat <<EOF

This review is > 4 weeks without comment and currently blocked by a
core reviewer with a -2. We are abandoning this for now.

Feel free to reactivate the review by pressing the restore button and
contacting the reviewer with the -2 on this review to ensure you
address their concerns.

EOF
)

# For testing, put in a git rev of something you own and uncomment
# blocked_reviews="b6c4218ae4d75b86c33fa3d37c27bc23b46b6f0f"

for review in $blocked_reviews; do
    # echo ssh review.openstack.org gerrit review $review --abandon --message \"$msg\"
    echo "Blocked review $review"
    abandon_review $review $blocked_msg
done

# then purge all the reviews that are > 4w with no changes and Jenkins has -1ed

failing_reviews=$(ssh review.openstack.org -p 29418 "gerrit query  --current-patch-set --format json $PROJECTS status:open age:4w NOT label:Verified>=1,jenkins" | jq .currentPatchSet.revision | grep -v null | sed 's/"//g')

failing_msg=$(cat <<EOF

This review is > 4 weeks without comment, and failed Jenkins the last
time it was checked. We are abandoning this for now.

Feel free to reactivate the review by pressing the restore button and
leaving a 'recheck' comment to get fresh test results.

EOF
)

for review in $failing_reviews; do
    echo "Failing review $review"
    abandon_review $review $failing_msg
done

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


Never override existing values

Never override existing values

MONO_DEBUG_IF_AVAILABLE() {
	local PREVIOUS_MONO_DEBUG="$MONO_DEBUG"

	# Add change if needed
	if [ -z "$PREVIOUS_MONO_DEBUG" ]; then
		export MONO_DEBUG="$1"
	elif echo "$PREVIOUS_MONO_DEBUG" | grep -Fq "$1"; then
		echo "Success: $1 already exists"
		return 0
	else
		export MONO_DEBUG="${PREVIOUS_MONO_DEBUG},${1}"
	fi

	# If we did a change, check if Mono supports that option
	# If not, it will be listed as invalid option on line 1
	if mono "" 2>&1 | head -n 1 | grep -Fq "$1"; then
		echo "Failure: $1"
		export MONO_DEBUG="$PREVIOUS_MONO_DEBUG"
		return 1
	fi

	echo "Success: $1"
	return 0
}

VERSION_GREATER() {
	if [ "$1" = "$2" ]; then
		return 1
	fi

	! VERSION_LESS_EQUAL "$1" "$2"
}

VERSION_GREATER_EQUAL() {
	! VERSION_LESS "$1" "$2"
}

VERSION_LESS() {
	if [ "$1" = "$2" ]; then
		return 1
	fi

	VERSION_LESS_EQUAL "$1" "$2"
}

VERSION_LESS_EQUAL() {
	[  "$1" = "$(echo -e "$1\n$2" | sort -V | head -n 1)" ]
}

echo "Mono environment setup executed!"

MONO_VERSION="$(mono -V | head -n 1 | cut -d ' ' -f 5)"

echo "Mono version: $MONO_VERSION"

if VERSION_GREATER_EQUAL "$MONO_VERSION" "4.6.0"; then
	echo "INFO: Appending no-compact-seq-points to MONO_DEBUG..."
	MONO_DEBUG_IF_AVAILABLE "no-compact-seq-points"
fi

if [ -z "$MONO_DNS" ]; then
	echo "INFO: Setting MONO_DNS to: 1"
	export MONO_DNS=1
else
	echo "INFO: Skipping setting of MONO_DNS as it's already declared with value: $MONO_DNS"
fi

if [ -z "$MONO_ENV_OPTIONS" ]; then
	echo "INFO: Setting MONO_ENV_OPTIONS to: --server -O=all"
	export MONO_ENV_OPTIONS="--server -O=all"
else
	echo "INFO: Skipping setting of MONO_ENV_OPTIONS as it's already declared with value: $MONO_ENV_OPTIONS"
fi

echo "Mono environment setup finished!"

MONO_DEBUG_IF_AVAILABLE() {
	local PREVIOUS_MONO_DEBUG="$MONO_DEBUG"

	# Add change if needed
	if [ -z "$PREVIOUS_MONO_DEBUG" ]; then
		export MONO_DEBUG="$1"
	elif echo "$PREVIOUS_MONO_DEBUG" | grep -Fq "$1"; then
		echo "Success: $1 already exists"
		return 0
	else
		export MONO_DEBUG="${PREVIOUS_MONO_DEBUG},${1}"
	fi

	# If we did a change, check if Mono supports that option
	# If not, it will be listed as invalid option on line 1
	if mono "" 2>&1 | head -n 1 | grep -Fq "$1"; then
		echo "Failure: $1"
		export MONO_DEBUG="$PREVIOUS_MONO_DEBUG"
		return 1
	fi

	echo "Success: $1"
	return 0
}

VERSION_GREATER() {
	if [ "$1" = "$2" ]; then
		return 1
	fi

	! VERSION_LESS_EQUAL "$1" "$2"
}

VERSION_GREATER_EQUAL() {
	! VERSION_LESS "$1" "$2"
}

VERSION_LESS() {
	if [ "$1" = "$2" ]; then
		return 1
	fi

	VERSION_LESS_EQUAL "$1" "$2"
}

VERSION_LESS_EQUAL() {
	[  "$1" = "$(echo -e "$1\n$2" | sort -V | head -n 1)" ]
}

echo "Mono environment setup executed!"

MONO_VERSION="$(mono -V | head -n 1 | cut -d ' ' -f 5)"

echo "Mono version: $MONO_VERSION"

if VERSION_GREATER_EQUAL "$MONO_VERSION" "4.6.0"; then
	echo "Appending no-compact-seq-points to MONO_DEBUG..."
	MONO_DEBUG_IF_AVAILABLE "no-compact-seq-points"
fi

export MONO_DNS=1
export MONO_ENV_OPTIONS="--server -O=all"

echo "Mono environment setup finished!"


feat: enforce shellcheck rules

feat: enforce shellcheck rules

Signed-off-by: Manan Gupta <78fb1e040152fc0d289292783ed01a56d3ae9465@planetscale.com>

#!/bin/bash

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

# This script is used to build and copy the Angular 2 based vtctld UI
# into the release folder (app) for checkin. Prior to running this script,
# bootstrap.sh and bootstrap_web.sh should already have been run.

# github.base_ref $1

target_release=""

base_release_branch=$(echo "$1" | grep -E 'release-[0-9]*.0$')
if [ "$base_release_branch" != "" ]; then
  major_release=$(echo "$base_release_branch" | sed 's/release-*//' | sed 's/\.0//')
  target_major_release=$((major_release-1))
  target_release=$(git show-ref --tags | grep -E 'refs/tags/v[0-9]*.[0-9]*.[0-9]*$' | sed 's/[a-z0-9]* refs\/tags\/v//' | awk -v FS=. -v RELEASE="$target_major_release" '{if ($1 == RELEASE) print; }' | sort -nr | head -n1)
else
  target_major_release=$(git show-ref | grep -E 'refs/remotes/origin/release-[0-9]*\.0$' | sed 's/[a-z0-9]* refs\/remotes\/origin\/release-//' | sed 's/\.0//' | sort -nr | head -n1)
  target_release=$(git show-ref --tags | grep -E 'refs/tags/v[0-9]*.[0-9]*.[0-9]*$' | sed 's/[a-z0-9]* refs\/tags\/v//' | awk -v FS=. -v RELEASE="$target_major_release" '{if ($1 == RELEASE) print; }' | sort -nr | head -n1)
  if [ -z "$target_release" ]
  then
    target_release="release-$target_major_release.0"
  fi
fi

echo "$target_release"

#!/bin/bash

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

# This script is used to build and copy the Angular 2 based vtctld UI
# into the release folder (app) for checkin. Prior to running this script,
# bootstrap.sh and bootstrap_web.sh should already have been run.

# github.base_ref $1

target_release=""

base_release_branch=$(echo "$1" | grep -E 'release-[0-9]*.0$')
if [ "$base_release_branch" != "" ]; then
  major_release=$(echo "$base_release_branch" | sed 's/release-*//' | sed 's/\.0//')
  target_major_release=$((major_release-1))
  target_release=$(git show-ref --tags | grep -E 'refs/tags/v[0-9]*.[0-9]*.[0-9]*$' | sed 's/[a-z0-9]* refs\/tags\/v//' | awk -v FS=. -v RELEASE=$target_major_release '{if ($1 == RELEASE) print; }' | sort -nr | head -n1)
else
  target_major_release=$(git show-ref | grep -E 'refs/remotes/origin/release-[0-9]*\.0$' | sed 's/[a-z0-9]* refs\/remotes\/origin\/release-//' | sed 's/\.0//' | sort -nr | head -n1)
  target_release=$(git show-ref --tags | grep -E 'refs/tags/v[0-9]*.[0-9]*.[0-9]*$' | sed 's/[a-z0-9]* refs\/tags\/v//' | awk -v FS=. -v RELEASE=$target_major_release '{if ($1 == RELEASE) print; }' | sort -nr | head -n1)
  if [ -z "$target_release" ]
  then
    target_release="release-$target_major_release.0"
  fi
fi

echo "$target_release"


travis

travis

#!/usr/bin/env bash
set -e

MAKE="make --jobs=$NUM_THREADS"

ver=1.0

wget http://web.eecs.umich.edu/~jahausw/download/sirius-application-$ver.tar.gz
wget http://web.eecs.umich.edu/~jahausw/download/sirius-suite-$ver.tar.gz
wget http://web.eecs.umich.edu/~jahausw/download/sirius-caffe-$ver.tar.gz

tar xzf sirius-application-$ver.tar.gz sirius-application
tar xzf sirius-suite-$ver.tar.gz sirius-suite
tar xzf sirius-caffe-$ver.tar.gz sirius-caffe

cd sirius-caffe;
sudo ./make-and-install.sh
cd ..;

cd sirius-suite;
make test;
cd ..;

cd sirius-application;
sudo ./get-dependencies.sh
./get-kaldi.sh
./compile-sirius-servers.sh
cd ..;

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


Add vscode extensions installer

Add vscode extensions installer

code \
	--install-extension ms-python.python \
	--install-extension ms-azuretools.vscode-docker \
	--install-extension jeff-hykin.better-dockerfile-syntax \
	--install-extension esbenp.prettier-vscode \
	--install-extension jasonnutter.search-node-modules \
	--install-extension prisma.vscode-graphql \
	--install-extension jpoissonnier.vscode-styled-components \
	--install-extension 2gua.rainbow-brackets \
	--install-extension eamodio.gitlens \
	--install-extension equinusocio.vsc-material-theme

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


Address review comments in #1.

Address review comments in #1.

	* Switch -top check to being a warning.
	* Change revision statement error text to be clearer.
	* Clarify check for module prefix.
	* Clarify leaf naming convention.

#!/bin/bash

TESTDIR="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

mkdir -p $TESTDIR/.deps
(cd .deps; curl -O https://raw.githubusercontent.com/openconfig/public/master/release/models/openconfig-extensions.yang)

for i in `ls $TESTDIR/*.yang`; do
    pyang --plugindir $TESTDIR/../pyang-plugins --openconfig --strict -p $TESTDIR/.deps $i
done

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


Add bats test for default suite

Add bats test for default suite

#!/usr/bin/env bats

@test "nmap binary is found in PATH" {
    run which nmap
    [ "$status" -eq 0 ]
}

error: pathspec 'test/integration/default/bats/nmap_installed.bats' did not match any file(s) known to git


20150424.1707

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


adds autorotate aws key script

adds autorotate aws key script

#!/bin/bash
PROFILE=($(cat ~/.aws/credentials | awk 'NR>1{print $1}' RS=[ FS=] | tr ' ' '\n'))
for UPDATE in "${PROFILE[@]}"; do
        aws-rotate-key -y -profile $UPDATE
done

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


Create lamp.sh

Create lamp.sh

#!/bin/bash

echo "Soporte para LAMP"
echo El script se iniciará en 3s si no cierra el Terminal...
sleep 3s

#Buscamos la sesion del equipo
salidaWhoami=$(whoami)

#instalacion de apache y php
sudo apt-get install apache2 -y
sudo apt-get install php5 libapache2-mod-php5 -y
sudo /etc/init.d/apache2 restart

sudo chown -R $salidaWhoami:www-data /var/www
sudo chmod -R 777 /var/www
sudo chmod -R 777 /var/www/html
cat /media/$salidaWhoami/Archivos/OptimizarUbuntu/phpinfo.txt > /var/www/html/info.php

#                                       instalando mysql server
sudo apt-get install mysql-server mysql-client -y
sudo apt-get install php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl -y
sudo /etc/init.d/apache2 restart#!/bin/bash

#Personalizando servidor mysql
sudo cp /etc/mysql/my.cnf /etc/mysql/my.cnf.bak
sudo cp /media/$salidaWhoami/Archivos/OptimizarUbuntu/my.cnf /etc/mysql/my.cnf
sudo ufw allow 3306
sudo mysql service restart
#----------------Importante!!!
#-----------no olvidar hacer esto dentro de la consola de mysql para crear usuarios, entrar como root a no se puede.

#CREATE USER 'usuario'@'localhost' IDENTIFIED BY 'escribir password del usuario	';
#FLUSH PRIVILEGES;
#para conectarse desde el cliente:
#mysql -u and -p -h dir-ip-del-server

echo ¡Instrucciones para crear usuarios en mysql,consultar dentro del archivo

#para joomla:

#1.Descargar el fichero
#2.Crear la base de datos llamada Joomla en el usuario a usar
#3.Entrar en mysql como root y poner:
      # GRANT ALL PRIVILEGES ON Joomla.* TO usuarioCreado@localhost IDENTIFIED BY 'password';

#REstaurando permisos seguros
sudo chmod -R 751 /var/www
sudo chmod -R 751 /var/www/html

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


RID helper script

RID helper script

#!/bin/bash

if [ "${2}" == "" ]; then
    echo "${0} dX1/rid_1 .. dXN/rid_N"
    exit 1
fi

fname=""
for i in $*; do
    depot=$(echo ${i} | cut -f1 -d/)
    rid=$(echo ${i} | cut -f2 -d/)
    echo "Processing RID ${depot}/${rid}"
    warmer_query.py --fname --prefix "@:" --rid ${rid} > /tmp/${depot}r${rid}.$$
    echo "      $(wc -l /tmp/${depot}r${rid}.$$ | cut -f1 -d\  ) files"
    if [ "${fname}" == "" ]; then
        fname="${depot}r${rid}"
    else
        fname="${fname}_${depot}r${rid}"
    fi
done

fname="${fname}"
echo "Composite name: ${fname}"

cat /tmp/*.$$ | sort | uniq > /tmp/${fname}.w
rm /tmp/*.$$

echo "Total files: $(wc -l /tmp/${fname}.w | cut -f1 -d\  )"

error: pathspec 'lserver/files/usr/local/bin/multi_drepair_list.sh' did not match any file(s) known to git


Set up keygen and worked on flow

Set up keygen and worked on flow

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


Send ntpdate output to syslog

Send ntpdate output to syslog

#!/bin/sh

NOTSYNCED="true"
SERVER=`cat /cf/conf/config.xml | grep timeservers | cut -d">" -f2 | cut -d"<" -f1`

while [ "$NOTSYNCED" = "true" ]; do
	ntpdate -s $SERVER
	if [ "$?" = "0" ]; then
		NOTSYNCED="false"
	fi
	sleep 5
done

# Launch -- we have net.
killall ntpd 2>/dev/null
sleep 1
/usr/local/sbin/ntpd -s -f /var/etc/ntpd.conf

#!/bin/sh

NOTSYNCED="true"
SERVER=`cat /cf/conf/config.xml | grep timeservers | cut -d">" -f2 | cut -d"<" -f1`

while [ "$NOTSYNCED" = "true" ]; do
	ntpdate $SERVER
	if [ "$?" = "0" ]; then
		NOTSYNCED="false"
	fi
	sleep 5
done

# Launch -- we have net.
killall ntpd 2>/dev/null
sleep 1
/usr/local/sbin/ntpd -s -f /var/etc/ntpd.conf


spideroak: Add script to disable SpiderOak Hive

#!/bin/bash
#
# Disable SpiderOak Hive share
#
# On headless systems I don't have a need for the default sync folder called
# "SpiderOak Hive" that comes with every spideroak installation. This uses some
# recent (2014) additions to client that allows you to set a preferences file
# with all the options that you can't set via CLI.

set -e
set -u

preference_file=/etc/SpiderOak/Preferences

# Make sure SpiderOak is in path or exit
which SpiderOak &>/dev/null || exit 2

# Since this file isn't created automatically if it exists then someone must
# have had a good reason for it. So just be safe and exit
if [[ -f "${preference_file}" ]]; then
    echo "${preference_file} exists. See script for manual instructions."
    exit 3
fi

# Create preference file and disable GlobalSync (what they call spideroak hive)
echo "Creating preference file"
mkdir "${preference_file%/*}"
cat > "${preference_file}" <<"_EOF_"
{
    "GlobalSyncEnabled": false
}
_EOF_
echo

# Debated making this automated as well but for the people that just copy and
# paste something they find on the web I don't want to just be removing stuff
# off the system (granted it's "Their Own Fault" for doing that but). So just
# going to say what to do.

cat <<"_EOF_"
Preference file created. At this point SpiderOak Hive will no longer be synced
to spideroak. You may now choose to remove the local folder as well as all
history as seen from this system by running the following commands. Be aware
that the purge command will permanently remove all traces of the file from your
spideroak account.

These commands assume you are root

rm -rf "/root/SpiderOak Hive"
SpiderOak --purge "/root/SpiderOak Hive"
SpiderOak --verbose --batchmode
_EOF_

exit 0

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


Add the script used to deprecate sys.path hacks

#! /bin/sh
export TARGET=$1
for path in $(find ${TARGET}/djangoapps/ -name '*.py' | grep -v migrations); do
    export new_path=$(echo $path | sed "s#${TARGET}/djangoapps/#sys_path_hacks/${TARGET}/#")
    export python_path=$(echo $path | sed "s#/#.#g" | sed "s#.py##" | sed "s#.__init__##")
    export old_python_path=$(echo $python_path | sed "s#${TARGET}.djangoapps.##")
    mkdir -p $(dirname $new_path)
    echo > $new_path <<SCRIPT
import warnings
import textwrap
warnings.warn(textwrap.dedent("""\
    Importing $old_python_path instead of $python_path is deprecated. See https://github.com/edx/edx-platform/blob/master/docs/decisions/0007-sys-path-modification-removal.rst.
""", stacklevel=2)

from $python_path import *
SCRIPT
done

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


Add new test to ensure git-merge handles more than 25 refs.

The old shell version handled only 25 refs but we no longer have this
limitation. Add a test to make sure this limitation will not be
introduced again in the future.

Signed-off-by: Miklos Vajna <16f13092e03e3d9e997de904d0f86cc803fb6ef7@frugalware.org>
Signed-off-by: Junio C Hamano <a6723cc3f76163bf7adb636a73ac3b0ceb3e6b9b@pobox.com>

#!/bin/sh

test_description='git-merge

Testing octopus merge with more than 25 refs.'

. ./test-lib.sh

test_expect_success 'setup' '
	echo c0 > c0.c &&
	git add c0.c &&
	git commit -m c0 &&
	git tag c0 &&
	i=1 &&
	while test $i -le 30
	do
		git reset --hard c0 &&
		echo c$i > c$i.c &&
		git add c$i.c &&
		git commit -m c$i &&
		git tag c$i &&
		i=`expr $i + 1` || return 1
	done
'

test_expect_failure 'merge c1 with c2, c3, c4, ... c29' '
	git reset --hard c1 &&
	i=2 &&
	refs="" &&
	while test $i -le 30
	do
		refs="$refs c$i"
		i=`expr $i + 1`
	done
	git merge $refs &&
	test "$(git rev-parse c1)" != "$(git rev-parse HEAD)" &&
	i=1 &&
	while test $i -le 30
	do
		test "$(git rev-parse c$i)" = "$(git rev-parse HEAD^$i)" &&
		i=`expr $i + 1` || return 1
	done &&
	git diff --exit-code &&
	i=1 &&
	while test $i -le 30
	do
		test -f c$i.c &&
		i=`expr $i + 1` || return 1
	done
'

test_done

error: pathspec 't/t7602-merge-octopus-many.sh' did not match any file(s) known to git


Update docker-entrypoint.sh

Update docker-entrypoint.sh

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


Create fix_mit-magic.sh

Create fix_mit-magic.sh

#! /usr/bin/env bash
# 1st param is user name for whom correct MIT-COOKIE installed
TEMP-COOKIE=$(su $1 -c xauth list $DISPLAY)
echo $TEMP-COOKIE
xauth add $TEMP-COOKIE

error: pathspec 'Scripts/NixScripts/fix_mit-magic.sh' did not match any file(s) known to git


Create ping.sh

Create ping.sh

bash script for @host returns output
should sendmail > not working yet

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/Darknet-Industries/rasp.git/'


Add a script for creating a service account to auto-deploy Prow.

#!/bin/bash
# Copyright 2019 The Kubernetes Authors.
#
# 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 errexit
set -o nounset
set -o pipefail

# This script will create a 'prow-deployer' GCP service account with permissions
# to deploy to the GKE cluster and load a service account key into the cluster's
# test-pods namespace. This should only be done when the Prow instance is using a
# separate build cluster and only trusted jobs are running in the service cluster.
# Setting up a deployer service account is necessary for Prow to update itself with
# a postsubmit job.

# To use, point your kubeconfig at the correct cluster context and specify gcp
# PROJECT and service account DESCRIPTION environment variables.

gcloud beta iam service-accounts create prow-deployer --project="${PROJECT}" --description="${DESCRIPTION}" --display-name="Prow Self Deployer SA"
gcloud projects add-iam-policy-binding "${PROJECT}" --member="serviceAccount:prow-deployer@${PROJECT}.iam.gserviceaccount.com" --role roles/container.developer
gcloud iam service-accounts keys create prow-deployer-sa-key.json --project="${PROJECT}"  --iam-account="prow-deployer@${PROJECT}.iam.gserviceaccount.com"

kubectl create secret generic -n test-pods prow-deployer-service-account --from-file=service-account.json=prow-deployer-sa-key.json

rm prow-deployer-sa-key.json

error: pathspec 'prow/gcloud-deployer-service-account.sh' did not match any file(s) known to git


add new utilisy script

add new utilisy script

if [ "$#" -ne 3 ]; then
  echo $0 " rootfile towerid etaminval"
  exit
fi

export TOWERID=$2
export ROTTFILENAME=$1
export OUTFILENAME="output_compute_pca_const.out"

echo "Using " $ROTTFILENAME " for Tower " $TOWERID " out " $OUTFILENAME
> $OUTFILENAME

declare -a arr=("2.0;3.0" "3.0;7.0" "7.0;12.0" "12.0;18.0" "18.0;25.0" "25.0;50.0" "50.0;100.0" "100.0;200.0")

for i in "${arr[@]}"
do
  echo $i " Gev mu+" >> $OUTFILENAME
  export FFILE="results_rphi_"$i"_p.txt"
  FILENAME=${FFILE//;/_}
  echo $FILENAME
  ./generatepca_split --eta-range="0.4;0.8" -k --rphi-plane --charge-sign=+ --pt-range="$i" -D $TOWERID $ROTTFILENAME >> $OUTFILENAME
  ./fitpca_split_single -c "./pca_const.txt" --eta-range="0.4;0.8" -k --rphi-plane --charge-sign=+ --pt-range="$i" -D $TOWERID $ROTTFILENAME >> $OUTFILENAME
  mv results.txt $FILENAME
  echo ""

  echo $i " Gev mu-" >> $OUTFILENAME
  export FFILE="results_rphi_"$i"_n.txt"
  FILENAME=${FFILE//;/_}
  echo $FILENAME
  ./generatepca_split --eta-range="0.4;0.8" -k --rphi-plane --charge-sign=- --pt-range="$i" -D $TOWERID $ROTTFILENAME >> $OUTFILENAME
  ./fitpca_split_single -c "./pca_const.txt" --eta-range="0.4;0.8" -k --rphi-plane --charge-sign=- --pt-range="$i" -D $TOWERID $ROTTFILENAME >> $OUTFILENAME
  mv results.txt $FILENAME
  echo ""

  for j in `seq 5 10`
  do
    echo "Removing layer " $j
    echo $i " Gev mu+" >> $OUTFILENAME
    export FFILE="results_rphi_"$i"_p_fk"$j".txt"
    FILENAME=${FFILE//;/_}
    echo $FILENAME
    ./generatepca_split --eta-range="0.4;0.8" --fk-five-hits=$j -k --rphi-plane --charge-sign=+ --pt-range="$i" -D $TOWERID $ROTTFILENAME >> $OUTFILENAME
    ./fitpca_split_single -c "./pca_const.txt" --eta-range="0.4;0.8" --fk-five-hits=$j -k --rphi-plane --charge-sign=+ --pt-range="$i" -D $TOWERID $ROTTFILENAME >> $OUTFILENAME
    mv results.txt $FILENAME
    echo ""

    echo $i " Gev mu-" >> $OUTFILENAME
    export FFILE="results_rphi_"$i"_n_fk"$j".txt"
    FILENAME=${FFILE//;/_}
    echo $FILENAME
    ./generatepca_split --eta-range="0.4;0.8" --fk-five-hits=$j -k --rphi-plane --charge-sign=- --pt-range="$i" -D $TOWERID $ROTTFILENAME >> $OUTFILENAME
    ./fitpca_split_single -c "./pca_const.txt" --eta-range="0.4;0.8" --fk-five-hits=$j -k --rphi-plane --charge-sign=- --pt-range="$i" -D $TOWERID $ROTTFILENAME >> $OUTFILENAME
    mv results.txt $FILENAME
    echo ""
  done

done

export k=$3
for i in `seq 1 8`;
do
  export start=$k
  k=$(echo "$k + 0.05" | bc | awk '{printf "%f", $0}')
  echo "Eta range: " $start " "  $k >> $OUTFILENAME
  export rage=$start";"$k
  ./generatepca_split -x --rz-plane --eta-range="$rage" -k --fk-five-hits=5 -D $TOWERID $ROTTFILENAME >> $OUTFILENAME
  ./fitpca_split_single -c "./pca_const.txt" -x --rz-plane --eta-range="$rage" -k --fk-five-hits=5 -D $TOWERID $ROTTFILENAME >> $OUTFILENAME
  mv results.txt results_fk5_rz_$i.txt

  ./generatepca_split -x --rz-plane --eta-range="$rage" -k --fk-five-hits=6 -D $TOWERID $ROTTFILENAME >> $OUTFILENAME
  ./fitpca_split_single -c "./pca_const.txt" -x --rz-plane --eta-range="$rage" -k --fk-five-hits=6 -D $TOWERID $ROTTFILENAME >> $OUTFILENAME
  mv results.txt results_fk6_rz_$i.txt

  ./generatepca_split -x --rz-plane --eta-range="$rage" -k --fk-five-hits=7 -D $TOWERID $ROTTFILENAME >> $OUTFILENAME
  ./fitpca_split_single -c "./pca_const.txt" -x --rz-plane --eta-range="$rage" -k --fk-five-hits=7 -D $TOWERID $ROTTFILENAME >> $OUTFILENAME
  mv results.txt results_fk7_rz_$i.txt

  ./generatepca_split -x --rz-plane --eta-range="$rage" -k -D $TOWERID $ROTTFILENAME >> $OUTFILENAME
  ./fitpca_split_single -c "./pca_const.txt" -x --rz-plane --eta-range="$rage" -k -D $TOWERID $ROTTFILENAME >> $OUTFILENAME
  mv results.txt results_rz_$i.txt
  echo ""
done

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


Create pm-install-split-apk.sh

Create pm-install-split-apk.sh

#!/system/bin/sh

# get the total size in byte
total=0
for apk in *.apk
do
	o=( $(ls -l $apk) )
	let total=$total+${o[3]}
done

echo "pm install-create total size $total"

create=$(pm install-create -S $total)
sid=$(echo $create |grep -E -o '[0-9]+')

echo "pm install-create session id $sid"

for apk in *.apk
do
	_ls_out=( $(ls -l $apk) )
	echo "write $apk to $sid"
	cat $apk | pm install-write -S ${_ls_out[3]} $sid $apk -
done

pm install-commit $sid

error: pathspec 'tools/pm-install-split-apk.sh' did not match any file(s) known to git


add restarter for play apps

add restarter for play apps

#!/bin/bash
APP_NAME=$1
/opt/der/deploy/stop-play-app.sh $APP_NAME
/opt/der/deploy/start-play-app.sh $APP_NAME

error: pathspec 'root/opt/der/deploy/restart-play-app.sh' did not match any file(s) known to git


rename ubuntu

rename ubuntu

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


Create source release for infer including clang binaries

#!/bin/bash

# Copyright (c) 2013 - present Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.

set -x
set -e

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_INFER_DIR=$SCRIPT_DIR/..
CLANG_PLUGIN_DIR=$ROOT_INFER_DIR/facebook-clang-plugins
PLATFORM=`uname`
INFER_SOURCE=$ROOT_INFER_DIR/infer-source

#Build infer and facebook-clang-plugins
cd $ROOT_INFER_DIR
git submodule update --init --recursive
facebook-clang-plugins/clang/setup.sh
./compile-fcp.sh
make -C infer

VERSION=$($ROOT_INFER_DIR/infer/bin/infer --version 2>&1 | head -1 | awk '{print $3}')
if [ $PLATFORM == 'Darwin' ]; then
    RELEASE_NAME=infer-osx-$VERSION
else
    RELEASE_NAME=infer-linux64-$VERSION
fi
RELEASE_TARBALL=$RELEASE_NAME.tar.xz

# Build package.
PKG_DIR=$ROOT_INFER_DIR/$RELEASE_NAME

#Get a fresh copy of infer source
git clone https://github.com/facebook/infer.git $INFER_SOURCE

# Copy infer source
mkdir -p $PKG_DIR
rsync -a $INFER_SOURCE/ $PKG_DIR

# Add facebook-clang-plugin binaries
PKG_PLUGIN_DIR=$PKG_DIR/facebook-clang-plugins
mkdir -p $PKG_PLUGIN_DIR/clang/{bin,lib,include}
mkdir -p $PKG_PLUGIN_DIR/libtooling/build
mkdir -p $PKG_PLUGIN_DIR/clang-ocaml/build
cp $CLANG_PLUGIN_DIR/{CONTRIBUTING.md,LICENSE,LLVM-LICENSE,PATENTS,README.md} $PKG_PLUGIN_DIR
cp -r $CLANG_PLUGIN_DIR/clang/bin/clang* $PKG_PLUGIN_DIR/clang/bin
cp -r $CLANG_PLUGIN_DIR/clang/lib/* $PKG_PLUGIN_DIR/clang/lib
cp -r $CLANG_PLUGIN_DIR/clang/include/* $PKG_PLUGIN_DIR/clang/include
rm -f $PKG_PLUGIN_DIR/clang/lib/*.a

cp -r $CLANG_PLUGIN_DIR/libtooling/build/* $PKG_PLUGIN_DIR/libtooling/build
cp -r $CLANG_PLUGIN_DIR/clang-ocaml/build/* $PKG_PLUGIN_DIR/clang-ocaml/build
cp -r $CLANG_PLUGIN_DIR/clang-ocaml/*.ml $PKG_PLUGIN_DIR/clang-ocaml/

FBONLY=FB-ONLY
if grep -r $FBONLY $PKG_DIR; then
    echo "Found files marked $FBONLY"
    exit 1
fi

cd $ROOT_INFER_DIR && tar cJf $RELEASE_TARBALL $RELEASE_NAME

# Cleanup.
rm -rf $PKG_DIR $INFER_SOURCE

# vim: sw=2 ts=2 et:

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


script to start a small cluster easily with an external zk setup

git-svn-id: 308d55f399f3bd9aa0560a10e81a003040006c48@1245219 13f79535-47bb-0310-9956-ffa450edef68

#!/usr/bin/env bash

zkaddress = localhost:2181/solr

cd ..

rm -r -f example2
rm -r -f example3
rm -r -f example4
rm -r -f example5
rm -r -f example6

rm -r -f dist
rm -r -f build
rm -r -f example/solr/zoo_data
rm -r -f example/solr/data
rm -f example/example.log

ant example dist

cp -r -f example example2
cp -r -f example example3
cp -r -f example example4
cp -r -f example example5
cp -r -f example example6

java -classpath lib/*:dist/*:build/lucene-libs/* org.apache.solr.cloud.ZkController "$zkaddress" 8983 example/solr/conf conf1

cd example
java -DzkHost="$zkaddress" -DnumShards=2 -DSTOP.PORT=7983 -DSTOP.KEY=key -jar start.jar 1>example.log 2>&1 &

cd ../example2
java -Djetty.port=7574 -DzkHost="$zkaddress" -DSTOP.PORT=6574 -DSTOP.KEY=key -jar start.jar 1>example2.log 2>&1 &

cd ../example3
java -Djetty.port=7575 -DzkHost="$zkaddress" -DSTOP.PORT=6575 -DSTOP.KEY=key -jar start.jar 1>example3.log 2>&1 &

cd ../example4
java -Djetty.port=7576 -DzkHost="$zkaddress" -DSTOP.PORT=6576 -DSTOP.KEY=key -jar start.jar 1>example4.log 2>&1 &

cd ../example5
java -Djetty.port=7577 -DzkHost="$zkaddress" -DSTOP.PORT=6577 -DSTOP.KEY=key -jar start.jar 1>example5.log 2>&1 &

cd ../example6
java -Djetty.port=7578 -DzkHost="$zkaddress" -DSTOP.PORT=6578 -DSTOP.KEY=key -jar start.jar 1>example6.log 2>&1 &

error: pathspec 'solr/cloud-dev/solrcloud-extzk-start.sh' did not match any file(s) known to git


Add pwmaskcat: Shows files with passwords dimmed but still possible to copy

#!/bin/sh -eu
#
#  pwmaskcat -- Shows files with passwords dimmed but still possible to copy
#
#  Copyright (c) 2018 Samuel Lidén Borell <samuel@kodafritt.se>
#
#  Permission is hereby granted, free of charge, to any person obtaining a copy
#  of this software and associated documentation files (the "Software"), to deal
#  in the Software without restriction, including without limitation the rights
#  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#  copies of the Software, and to permit persons to whom the Software is
#  furnished to do so, subject to the following conditions:
#
#  The above copyright notice and this permission notice shall be included in
#  all copies or substantial portions of the Software.
#
#  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
#  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
#  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
#  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
#  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
#  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
#  THE SOFTWARE.
#

esc='\x1B'
# any except space and control characters
any='[[:graph:]]'
alt1="$any*[a-z]$any*[A-Z]$any*"
alt2="$any*[A-Z]$any*[0-9]$any*"
alt3="$any*[0-9]$any*[a-z]$any*"
alt3="$any*[\x21-\x40]$any*[a-z]$any*"
match="($alt1|$alt2|$alt3)"
# black (makes it impossible to see what you have selected)
#replacement="$esc[30;40m\1$esc[0m"
# light gray on gray, with blink + underscore
replacement="$esc[37;47;1;4;5m\1$esc[0m"
#
#replacement="$esc[37;1m\1$esc[0m"

regex="s/$match/$replacement/g"
#echo "$regex"
sed -E -- "$regex" "$@"

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


Delete sexygnome.sh

Delete sexygnome.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/lingawakad/dotfiles.git/'


add k8s.sh

add k8s.sh

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


don't flood me with data

don't flood me with data

#!/usr/bin/env bash

# Personal Release Assistant (TM)

set -e

if [ -z "$1" ]; then
    echo "workflow: $0 <command> [arg]"
    echo "    prep <version>"
    echo "    upload <devpi username>"
    echo "    test <devpi username> (optional)"
    echo "    release"
    exit 1
fi

if [ -z "$2" ]; then
    # if not passed: take it from tag created in prep
    VERSION=$(git describe --abbrev=0 --tags)
else
    # only the prep step needs the version
    VERSION=$2
fi

dispatch () {
    if [ "$1" == "prep" ]; then
        if [ -z "$2" ]; then
            echo "usage: $0 prep <version>"
            exit 1
        fi
        prep
    elif [ "$1" == "upload" ]; then
         devpi_upload
    elif [ "$1" == "test" ]; then
         devpi_cloud_test
    elif [ "$1" == "release" ]; then
        pypi_upload
    else
        exit 1
    fi
}

prep () {
    python3.6 tasks/pre-process-changelog.py
    towncrier --draft --version ${VERSION}
    towncrier --yes --version ${VERSION}
    pip install -U readme-renderer
    python setup.py check -r -s
    _confirm "towncrier news rendered - move on?"
    git add CHANGELOG.rst
    git status
    _confirm "changes to repository o.k.?"
    git commit -m "release preparation for ${VERSION}"
    git tag -s ${VERSION} -m "release tox ${VERSION}"
    pip install -U dist *.tar.gz
    _confirm "version of package o.k.?"
    tox --version
    _confirm "rm dist/*, build, git tag ${VERSION}"
    rm dist/tox*
    python setup.py sdist bdist_wheel
}

devpi_upload () {
    if [ ! -d dist ]; then
        echo "needs builds in dist. Build first."
        exit 1
    fi
    echo "loggging in to devpi $1"
    devpi login $1
    devpi use https://devpi.net/$1/dev
    echo "upload to devpi: $(ls dist/*)"
    _confirm
    devpi upload dist/*
}

devpi_cloud_test () {
    cloudTestPath=../devpi-cloud-test-tox
    if [ ! -d "$cloudTestPath" ]; then
        echo "needs $cloudTestPath"
        exit 1
    fi
    echo "trigger devpi cloud tests for ${VERSION}?"
    _confirm
    cd ${cloudTestPath}
    dct trigger ${VERSION}
    xdg-open https://github.com/obestwalter/devpi-cloud-test-tox
    cd ../tox
}

# TODO get devpi push to work again
pypi_upload () {
    PACKAGES=$(ls dist/*)
    _confirm "upload to pypi: $PACKAGES"
    twine upload ${PACKAGES}
    git push upstream master
    git push upstream ${VERSION}
}

_confirm () {
    echo "please confirm: $1"
    select confirmation in yes no; do
        if [ ${confirmation} == "no" ]; then
            exit 1
        else
            break
        fi
    done
}

dispatch $1 $2

#!/usr/bin/env bash

# Personal Release Assistant (TM)

set -e

if [ -z "$1" ]; then
    echo "workflow: $0 <command> [arg]"
    echo "    prep <version>"
    echo "    upload <devpi username>"
    echo "    test <devpi username> (optional)"
    echo "    release"
    exit 1
fi

if [ -z "$2" ]; then
    # if not passed: take it from tag created in prep
    VERSION=$(git describe --abbrev=0 --tags)
else
    # only the prep step needs the version
    VERSION=$2
fi

dispatch () {
    if [ "$1" == "prep" ]; then
        if [ -z "$2" ]; then
            echo "usage: $0 prep <version>"
            exit 1
        fi
        prep
    elif [ "$1" == "upload" ]; then
         devpi_upload
    elif [ "$1" == "test" ]; then
         devpi_cloud_test
    elif [ "$1" == "release" ]; then
        pypi_upload
    else
        exit 1
    fi
}

prep () {
    python3.6 tasks/pre-process-changelog.py
    towncrier --draft --version ${VERSION}
    towncrier --yes --version ${VERSION}
    pip install -U readme-renderer
    python setup.py check -r -s
    _confirm "towncrier news rendered - move on?"
    git add CHANGELOG.rst
    git status --verbose
    _confirm "changes to repository o.k.?"
    git commit -m "release preparation for ${VERSION}"
    git tag -s ${VERSION} -m "release tox ${VERSION}"
    pip install -U dist *.tar.gz
    _confirm "version of package o.k.?"
    tox --version
    _confirm "rm dist/*, build, git tag ${VERSION}"
    rm dist/tox*
    python setup.py sdist bdist_wheel
}

devpi_upload () {
    if [ ! -d dist ]; then
        echo "needs builds in dist. Build first."
        exit 1
    fi
    echo "loggging in to devpi $1"
    devpi login $1
    devpi use https://devpi.net/$1/dev
    echo "upload to devpi: $(ls dist/*)"
    _confirm
    devpi upload dist/*
}

devpi_cloud_test () {
    cloudTestPath=../devpi-cloud-test-tox
    if [ ! -d "$cloudTestPath" ]; then
        echo "needs $cloudTestPath"
        exit 1
    fi
    echo "trigger devpi cloud tests for ${VERSION}?"
    _confirm
    cd ${cloudTestPath}
    dct trigger ${VERSION}
    xdg-open https://github.com/obestwalter/devpi-cloud-test-tox
    cd ../tox
}

# TODO get devpi push to work again
pypi_upload () {
    PACKAGES=$(ls dist/*)
    _confirm "upload to pypi: $PACKAGES"
    twine upload ${PACKAGES}
    git push upstream master
    git push upstream ${VERSION}
}

_confirm () {
    echo "please confirm: $1"
    select confirmation in yes no; do
        if [ ${confirmation} == "no" ]; then
            exit 1
        else
            break
        fi
    done
}

dispatch $1 $2


add performance regression tests

add performance regression tests

Signed-off-by: Alberto Donato <3d6ca22374542c32836b344db03c69e81292ccc8@canonical.com>

#!/bin/sh -eu
#
# Performance tests runner
#

[ -n "${GOPATH:-}" ] && export "PATH=${GOPATH}/bin:${PATH}"

PERF_LOG_CSV="perf.csv"

import_subdir_files() {
    test  "$1"
    # shellcheck disable=SC2039
    local file
    for file in "$1"/*.sh; do
        # shellcheck disable=SC1090
        . "$file"
    done
}

import_subdir_files includes

log_message() {
    echo "==>" "$@"
}

run_benchmark() {
    # shellcheck disable=SC2039
    local label description opts
    label="$1"
    description="$2"
    shift 2

    log_message "Benchmark start: $label - $description"
    lxd_benchmark "$@" --report-file "$PERF_LOG_CSV" --report-label "$label"
    log_message "Benchmark completed: $label"
}

lxd_benchmark() {
    # shellcheck disable=SC2039
    local opts
    [ "${LXD_TEST_IMAGE:-}" ] && opts="--image $LXD_TEST_IMAGE" || opts=""
    lxd-benchmark "$@" $opts
}

cleanup() {
    if [ "$TEST_RESULT" != "success" ]; then
        rm -f "$PERF_LOG_CSV"
    fi
    lxd_benchmark delete  # ensure all test containers have been deleted
    kill_lxd "$LXD_DIR"
    cleanup_lxds "$TEST_DIR"
    log_message "Performance tests result: $TEST_RESULT"
}

trap cleanup EXIT HUP INT TERM

# Setup test directories
TEST_DIR=$(mktemp -d -p "$(pwd)" tmp.XXX)
LXD_DIR=$(mktemp -d -p "${TEST_DIR}" XXX)
export LXD_DIR
chmod +x "${TEST_DIR}" "${LXD_DIR}"

if [ -z "${LXD_BACKEND:-}" ]; then
    LXD_BACKEND="dir"
fi

import_storage_backends

spawn_lxd "${LXD_DIR}" true

# shellcheck disable=SC2034
TEST_RESULT=failure

run_benchmark "create-one" "create 1 container" spawn --count 1 --start=false
run_benchmark "start-one" "start 1 container" start
run_benchmark "stop-one" "stop 1 container" stop
run_benchmark "delete-one" "delete 1 container" delete
run_benchmark "create-128" "create 128 containers" spawn --count 128 --start=false
run_benchmark "delete-128" "delete 128 containers" delete

# shellcheck disable=SC2034
TEST_RESULT=success

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


Added start script for jersey example application

#!/usr/bin/env bash

../../gradlew appRun

error: pathspec 'catnap-examples/catnap-examples-jersey/run.sh' did not match any file(s) known to git


Start notebook script

Start notebook script

#!/bin/bash
IPYTHON_OPTS="notebook --port 8888 \
    --notebook-dir=~/workspace \
    --ip='*' --no-browser"
jupyter $IPYTHON_OPTS > /dev/null 2>&1 &

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