Bluemix: fix typo in jq command args

Bluemix: fix typo in jq command args

#!/bin/bash

source .bluemixrc

#################################################################################
# Pull Dockerhub images
#################################################################################

echo "Looking up Bluemix registry images"
BLUEMIX_IMAGES=$(cf ic images | tail -n +2 | sed -r 's/([^ ]+) +([^ ]+).*/\1:\2/')

REQUIRED_IMAGES=(
    ${CONTROLLER_IMAGE}
    ${REGISTRY_IMAGE}
)

for image in ${REQUIRED_IMAGES[@]}; do
    echo $BLUEMIX_IMAGES | grep $image > /dev/null
    if [ $? -ne 0 ]; then
        echo "Pulling ${DOCKERHUB_NAMESPACE}/$image from Dockerhub"
        cf ic cpi ${DOCKERHUB_NAMESPACE}/$image ${BLUEMIX_REGISTRY_HOST}/${BLUEMIX_REGISTRY_NAMESPACE}/$image
    fi
done

#################################################################################
# Start a local controller
#################################################################################

echo "Starting controller"
cf ic group create --name amalgam8_controller \
  --publish 6379 --memory 256 --auto \
  --min 1 --max 2 --desired 1 \
  --env POLL_INTERVAL=5s \
  --env LOG_LEVEL=debug \
  ${BLUEMIX_REGISTRY_HOST}/${BLUEMIX_REGISTRY_NAMESPACE}/${CONTROLLER_IMAGE}

echo "Waiting for controller to start..."
sleep 15s

echo "Mapping route to controller: $CONTROLLER_URL"
cf ic route map --hostname $CONTROLLER_HOSTNAME --domain $ROUTES_DOMAIN amalgam8_controller

#################################################################################
# Provision Service Discovery, or start a local registry
#################################################################################

if [ "$ENABLE_SERVICEDISCOVERY" = true ]; then
    cf service sd &> /dev/null
    if [ $? -ne 0 ]; then
        echo "Creating a Service Discovery instance..."
        cf create-service service_discovery free sd
    else
        echo "Found an existing Service Discovery instance"
    fi

    if [ $(cf service-key sd sdkey | grep -ic "No service key") -gt 0 ]; then
        echo "Creating Service Discovery credentials"
        cf create-service-key sd sdkey
    else
        echo "Found existing Service Discovery credentials"
    fi

    SDKEY=$(cf service-key sd sdkey | tail -n +3)
    REGISTRY_URL=$(echo "$SDKEY" | jq -r '.url')
    REGISTRY_TOKEN=$(echo "$SDKEY" | jq -r '.auth_token')
else
    # TODO: Deploy registry containers
    echo "Not not implemented"
    exit 1
fi

#################################################################################
# Provision Message Hub, or fallback to polling
#################################################################################

if [ "$ENABLE_MESSAGEHUB" = true ]; then
    cf service mh &> /dev/null
    if [ $? -ne 0 ]; then
        echo "Creating a Message Hub instance..."
        cf create-service messagehub standard mh
    else
        echo "Found an existing Message Hub instance"
    fi

    if [ $(cf service-key mh mhkey | grep -ic "No service key") -gt 0 ]; then
        echo "Creating Message Hub credentials"
        cf create-service-key mh mhkey
    else
        echo "Found existing Message Hub credentials"
    fi

    MHKEY=$(cf service-key mh mhkey | tail -n +3)
    KAFKA_API_KEY=$(echo "$MHKEY" | jq -r '.api_key')
    KAFKA_ADMIN_URL=$(echo "$MHKEY" | jq -r '.kafka_admin_url')
    KAFKA_REST_URL=$(echo "$MHKEY" | jq -r '.kafka_rest_url')
    KAFKA_BROKERS=$(echo "$MHKEY" | jq -r '.kafka_brokers_sasl')
    KAFKA_USER=$(echo "$MHKEY" | jq -r '.user')
    KAFKA_PASSWORD=$(echo "$MHKEY" | jq -r '.password')
    KAFKA_SASL="true"
fi

#################################################################################
# Post the local tenant to controller
#################################################################################

# Wait for controller route to set up
echo "Waiting for controller route to set up"
attempt=0
while true; do
    code=$(curl -w "%{http_code}" "${CONTROLLER_URL}/health" -o /dev/null)
    if [ "$code" = "200" ]; then
        echo "Controller route is ready"
        break
    fi

    attempt=$((attempt + 1))
    if [ "$attempt" -gt 10 ]; then
        echo "Timeout waiting for controller route..."
        echo "Deploying the controlplane has failed"
        exit 1
    fi
    sleep 10s
done

echo "Setting up a new controller tenant named 'local'"
read -d '' tenant << EOF
{
    "id": "${CONTROLLER_TENANT_ID}",
    "req_tracking_header" : "X-Request-ID",
    "credentials": {
        "registry": {
            "url": "${REGISTRY_URL}",
            "token": "${REGISTRY_TOKEN}"
        }
    }
}
EOF

if [ "$ENABLE_MESSAGEHUB" = true ]; then
    read -d '' kafka << EOF
{
    "credentials": {
        "kafka": {
            "api_key": "${KAFKA_API_KEY}",
            "admin_url": "${KAFKA_ADMIN_URL}",
            "rest_url": "${KAFKA_REST_URL}",
            "brokers": ${KAFKA_BROKERS},
            "user": "${KAFKA_USER}",
            "password": "${KAFKA_PASSWORD}",
            "sasl": "${KAFKA_SASL}"
        }
    }
}
EOF
    tenant=$(jq -s '.[0] * .[1]' <(echo $tenant) <(echo $kafka))
fi

echo $tenant | curl -H "Content-Type: application/json" -d @- "${CONTROLLER_URL}/v1/tenants"

#!/bin/bash

source .bluemixrc

#################################################################################
# Pull Dockerhub images
#################################################################################

echo "Looking up Bluemix registry images"
BLUEMIX_IMAGES=$(cf ic images | tail -n +2 | sed -r 's/([^ ]+) +([^ ]+).*/\1:\2/')

REQUIRED_IMAGES=(
    ${CONTROLLER_IMAGE}
    ${REGISTRY_IMAGE}
)

for image in ${REQUIRED_IMAGES[@]}; do
    echo $BLUEMIX_IMAGES | grep $image > /dev/null
    if [ $? -ne 0 ]; then
        echo "Pulling ${DOCKERHUB_NAMESPACE}/$image from Dockerhub"
        cf ic cpi ${DOCKERHUB_NAMESPACE}/$image ${BLUEMIX_REGISTRY_HOST}/${BLUEMIX_REGISTRY_NAMESPACE}/$image
    fi
done

#################################################################################
# Start a local controller
#################################################################################

echo "Starting controller"
cf ic group create --name amalgam8_controller \
  --publish 6379 --memory 256 --auto \
  --min 1 --max 2 --desired 1 \
  --env POLL_INTERVAL=5s \
  --env LOG_LEVEL=debug \
  ${BLUEMIX_REGISTRY_HOST}/${BLUEMIX_REGISTRY_NAMESPACE}/${CONTROLLER_IMAGE}

echo "Waiting for controller to start..."
sleep 15s

echo "Mapping route to controller: $CONTROLLER_URL"
cf ic route map --hostname $CONTROLLER_HOSTNAME --domain $ROUTES_DOMAIN amalgam8_controller

#################################################################################
# Provision Service Discovery, or start a local registry
#################################################################################

if [ "$ENABLE_SERVICEDISCOVERY" = true ]; then
    cf service sd &> /dev/null
    if [ $? -ne 0 ]; then
        echo "Creating a Service Discovery instance..."
        cf create-service service_discovery free sd
    else
        echo "Found an existing Service Discovery instance"
    fi

    if [ $(cf service-key sd sdkey | grep -ic "No service key") -gt 0 ]; then
        echo "Creating Service Discovery credentials"
        cf create-service-key sd sdkey
    else
        echo "Found existing Service Discovery credentials"
    fi

    SDKEY=$(cf service-key sd sdkey | tail -n +3)
    REGISTRY_URL=$(echo "$SDKEY" | jq -r '.url')
    REGISTRY_TOKEN=$(echo "$SDKEY" | jq -r '.auth_TOKEN')
else
    # TODO: Deploy registry containers
    echo "Not not implemented"
    exit 1
fi

#################################################################################
# Provision Message Hub, or fallback to polling
#################################################################################

if [ "$ENABLE_MESSAGEHUB" = true ]; then
    cf service mh &> /dev/null
    if [ $? -ne 0 ]; then
        echo "Creating a Message Hub instance..."
        cf create-service messagehub standard mh
    else
        echo "Found an existing Message Hub instance"
    fi

    if [ $(cf service-key mh mhkey | grep -ic "No service key") -gt 0 ]; then
        echo "Creating Message Hub credentials"
        cf create-service-key mh mhkey
    else
        echo "Found existing Message Hub credentials"
    fi

    MHKEY=$(cf service-key mh mhkey | tail -n +3)
    KAFKA_API_KEY=$(echo "$MHKEY" | jq -r '.api_key')
    KAFKA_ADMIN_URL=$(echo "$MHKEY" | jq -r '.kafka_admin_url')
    KAFKA_REST_URL=$(echo "$MHKEY" | jq -r '.kafka_rest_url')
    KAFKA_BROKERS=$(echo "$MHKEY" | jq -r '.kafka_brokers_sasl')
    KAFKA_USER=$(echo "$MHKEY" | jq -r '.user')
    KAFKA_PASSWORD=$(echo "$MHKEY" | jq -r '.password')
    KAFKA_SASL="true"
fi

#################################################################################
# Post the local tenant to controller
#################################################################################

# Wait for controller route to set up
echo "Waiting for controller route to set up"
attempt=0
while true; do
    code=$(curl -w "%{http_code}" "${CONTROLLER_URL}/health" -o /dev/null)
    if [ "$code" = "200" ]; then
        echo "Controller route is ready"
        break
    fi

    attempt=$((attempt + 1))
    if [ "$attempt" -gt 10 ]; then
        echo "Timeout waiting for controller route..."
        echo "Deploying the controlplane has failed"
        exit 1
    fi
    sleep 10s
done

echo "Setting up a new controller tenant named 'local'"
read -d '' tenant << EOF
{
    "id": "${CONTROLLER_TENANT_ID}",
    "req_tracking_header" : "X-Request-ID",
    "credentials": {
        "registry": {
            "url": "${REGISTRY_URL}",
            "token": "${REGISTRY_TOKEN}"
        }
    }
}
EOF

if [ "$ENABLE_MESSAGEHUB" = true ]; then
    read -d '' kafka << EOF
{
    "credentials": {
        "kafka": {
            "api_key": "${KAFKA_API_KEY}",
            "admin_url": "${KAFKA_ADMIN_URL}",
            "rest_url": "${KAFKA_REST_URL}",
            "brokers": ${KAFKA_BROKERS},
            "user": "${KAFKA_USER}",
            "password": "${KAFKA_PASSWORD}",
            "sasl": "${KAFKA_SASL}"
        }
    }
}
EOF
    tenant=$(jq -s '.[0] * .[1]' <(echo $tenant) <(echo $kafka))
fi

echo $tenant | curl -H "Content-Type: application/json" -d @- "${CONTROLLER_URL}/v1/tenants"


Added stop shell script

Added stop shell script

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


Create scriptping.sh

Create scriptping.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/EstevesDouglas/ZABBIX-Unicamp-Community.git/'


Add VirtualBox Configure script

Add VirtualBox Configure script

#!/bin/bash
set -e

# Installing the virtualbox guest additions
VBOX_VERSION=$(cat /`whoami`/.vbox_version)
cd /tmp
mount -o loop /`whoami`/VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
sh /mnt/VBoxLinuxAdditions.run
umount /mnt
rm -rf /`whoami`/VBoxGuestAdditions_*.iso

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


add or-trues

add or-trues

#!/bin/bash

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

# This script downloads the test files from the build bucket and makes some executable.

# The script expects the following env variables:
# OS_ARCH: The operating system and the architecture separated by a hyphen '-' (e.g. darwin-amd64, linux-amd64, windows-amd64)
# VM_DRIVER: the vm-driver to use for the test
# EXTRA_START_ARGS: additional flags to pass into minikube start
# EXTRA_ARGS: additional flags to pass into minikube
# JOB_NAME: the name of the logfile and check name to update on github
#

readonly TEST_ROOT="${HOME}/minikube-integration"
readonly TEST_HOME="${TEST_ROOT}/${OS_ARCH}-${VM_DRIVER}-${MINIKUBE_LOCATION}-$$-${COMMIT}"
echo ">> Starting at $(date)"
echo ""
echo "arch:      ${OS_ARCH}"
echo "build:     ${MINIKUBE_LOCATION}"
echo "driver:    ${VM_DRIVER}"
echo "job:       ${JOB_NAME}"
echo "test home: ${TEST_HOME}"
echo "sudo:      ${SUDO_PREFIX}"
echo "kernel:    $(uname -v)"
# Setting KUBECONFIG prevents the version ceck from erroring out due to permission issues
echo "kubectl:   $(env KUBECONFIG=${TEST_HOME} kubectl version --client --short=true)"
echo "docker:    $(docker version --format '{{ .Client.Version }}')"

case "${VM_DRIVER}" in
  kvm2)
    echo "virsh:     $(virsh --version)"
  ;;
  virtualbox)
    echo "vbox:      $(vboxmanage --version)"
  ;;
esac

echo ""
mkdir -p out/ testdata/

# Install gsutil if necessary.
if ! type -P gsutil >/dev/null; then
  if [[ ! -x "out/gsutil/gsutil" ]]; then
    echo "Installing gsutil to $(pwd)/out ..."
    curl -s https://storage.googleapis.com/pub/gsutil.tar.gz | tar -C out/ -zxf -
  fi
  PATH="$(pwd)/out/gsutil:$PATH"
fi

# Add the out/ directory to the PATH, for using new drivers.
PATH="$(pwd)/out/":$PATH
export PATH

echo ""
echo ">> Downloading test inputs from ${MINIKUBE_LOCATION} ..."
gsutil -qm cp \
  "gs://minikube-builds/${MINIKUBE_LOCATION}/minikube-${OS_ARCH}" \
  "gs://minikube-builds/${MINIKUBE_LOCATION}/docker-machine-driver"-* \
  "gs://minikube-builds/${MINIKUBE_LOCATION}/e2e-${OS_ARCH}" out

gsutil -qm cp "gs://minikube-builds/${MINIKUBE_LOCATION}/testdata"/* testdata/

# Set the executable bit on the e2e binary and out binary
export MINIKUBE_BIN="out/minikube-${OS_ARCH}"
export E2E_BIN="out/e2e-${OS_ARCH}"
chmod +x "${MINIKUBE_BIN}" "${E2E_BIN}" out/docker-machine-driver-*

if pgrep "minikube|e2e-"; then
  echo "WARNING: other instances of minikube may be running:"
  ps -afe | egrep "minikube|e2e-"
fi

# Cleanup stale test outputs.
echo ""
echo ">> Cleaning up after previous test runs ..."

for stale_dir in ${TEST_ROOT}/*; do
  echo "* Cleaning stale test: ${stale_dir}"
  export MINIKUBE_HOME="${stale_dir}/.minikube"
  export KUBECONFIG="${stale_dir}/kubeconfig"

  if [[ -d "${MINIKUBE_HOME}" ]]; then
    if [[ -f "${MINIKUBE_HOME}/tunnels.json" ]]; then
      echo "Stale tunnels.json:"
      cat "${MINIKUBE_HOME}/tunnels.json"
    fi
    echo "Shutting down stale minikube instance ..."
    if [[ -w "${MINIKUBE_HOME}" ]]; then
        "${MINIKUBE_BIN}" delete || true
        rm -Rf "${MINIKUBE_HOME}"
    else
      sudo -E "${MINIKUBE_BIN}" delete || true
      sudo rm -Rf "${MINIKUBE_HOME}"
    fi
  fi

  if [[ -f "${KUBECONFIG}" ]]; then
    if [[ -w "${KUBECONFIG}" ]]; then
      rm -f "${KUBECONFIG}"
    else
      sudo rm -f "${KUBECONFIG}" || true
    fi
  fi

  rmdir "${stale_dir}" || true
done

if type -P virsh; then
  virsh -c qemu:///system list --all
  virsh -c qemu:///system list --all \
    | grep minikube \
    | awk '{ print $2 }' \
    | xargs -I {} sh -c "virsh -c qemu:///system destroy {}; virsh -c qemu:///system undefine {}" \
    || true
fi

if type -P vboxmanage; then
  vboxmanage list vms || true
  vboxmanage list vms \
    | grep minikube \
    | cut -d'"' -f2 \
    | xargs -I {} sh -c "vboxmanage startvm {} --type emergencystop; vboxmanage unregistervm {} --delete" \
    || true
fi

if type -P hdiutil; then
  hdiutil info | grep -E "/dev/disk[1-9][^s]" || true
  hdiutil info \
      | grep -E "/dev/disk[1-9][^s]" \
      | awk '{print $1}' \
      | xargs -I {} sh -c "hdiutil detach {}" \
      || true
fi

if [[ "${VM_DRIVER}" == "hyperkit" ]]; then
  if [[ -e out/docker-machine-driver-hyperkit ]]; then
    sudo chown root:wheel out/docker-machine-driver-hyperkit || true
    sudo chmod u+s out/docker-machine-driver-hyperkit || true
  fi
fi

if pgrep kubectl; then
  echo "killing hung kubectl processes ..."
  ps -afe | grep kubectl | grep -v grep || true
  pgrep kubectl | xargs kill || true
fi

function cleanup_stale_routes() {
  stale_routes=$(netstat -rn -f inet | awk '{ print $1 }' | grep 10.96.0.0 || true)
  if [[ "${stale_routes}" != "" ]]; then
    echo "WARNING: deleting stale tunnel routes: ${stale_routes}"
    for route in ${stale_routes}; do
      sudo route -n delete "${route}" || true
    done
  fi
}

cleanup_stale_routes || true

mkdir -p "${TEST_HOME}"
export MINIKUBE_HOME="${TEST_HOME}/.minikube"
export MINIKUBE_WANTREPORTERRORPROMPT=False
export KUBECONFIG="${TEST_HOME}/kubeconfig"

# Display the default image URL
echo ""
echo ">> ISO URL"
"${MINIKUBE_BIN}" start -h | grep iso-url || true

echo ""
echo ">> Starting ${E2E_BIN} at $(date)"
${SUDO_PREFIX}${E2E_BIN} \
  -minikube-start-args="--vm-driver=${VM_DRIVER} ${EXTRA_START_ARGS}" \
  -minikube-args="--v=10 --logtostderr ${EXTRA_ARGS}" \
  -test.v -test.timeout=30m -binary="${MINIKUBE_BIN}" && result=$? || result=$?
echo ">> ${E2E_BIN} exited with ${result} at $(date)"
echo ""

if [[ $result -eq 0 ]]; then
  status="success"
  echo "minikube: SUCCESS"
else
  status="failure"
  echo "minikube: FAIL"
  source print-debug-info.sh
fi

echo ">> Cleaning up after ourselves ..."
${SUDO_PREFIX}${MINIKUBE_BIN} delete >/dev/null 2>/dev/null || true
cleanup_stale_routes || true

${SUDO_PREFIX} rm -Rf "${MINIKUBE_HOME}" || true
${SUDO_PREFIX} rm -f "${KUBECONFIG}" || true
rmdir "${TEST_HOME}"
echo ">> ${TEST_HOME} completed at $(date)"

if [[ "${MINIKUBE_LOCATION}" != "master" ]]; then
  readonly target_url="https://storage.googleapis.com/minikube-builds/logs/${MINIKUBE_LOCATION}/${JOB_NAME}.txt"
  curl -s "https://api.github.com/repos/kubernetes/minikube/statuses/${COMMIT}?access_token=$access_token" \
  -H "Content-Type: application/json" \
  -X POST \
  -d "{\"state\": \"$status\", \"description\": \"Jenkins\", \"target_url\": \"$target_url\", \"context\": \"${JOB_NAME}\"}"
fi
exit $result

#!/bin/bash

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

# This script downloads the test files from the build bucket and makes some executable.

# The script expects the following env variables:
# OS_ARCH: The operating system and the architecture separated by a hyphen '-' (e.g. darwin-amd64, linux-amd64, windows-amd64)
# VM_DRIVER: the vm-driver to use for the test
# EXTRA_START_ARGS: additional flags to pass into minikube start
# EXTRA_ARGS: additional flags to pass into minikube
# JOB_NAME: the name of the logfile and check name to update on github
#

readonly TEST_ROOT="${HOME}/minikube-integration"
readonly TEST_HOME="${TEST_ROOT}/${OS_ARCH}-${VM_DRIVER}-${MINIKUBE_LOCATION}-$$-${COMMIT}"
echo ">> Starting at $(date)"
echo ""
echo "arch:      ${OS_ARCH}"
echo "build:     ${MINIKUBE_LOCATION}"
echo "driver:    ${VM_DRIVER}"
echo "job:       ${JOB_NAME}"
echo "test home: ${TEST_HOME}"
echo "sudo:      ${SUDO_PREFIX}"
echo "kernel:    $(uname -v)"
# Setting KUBECONFIG prevents the version ceck from erroring out due to permission issues
echo "kubectl:   $(env KUBECONFIG=${TEST_HOME} kubectl version --client --short=true)"
echo "docker:    $(docker version --format '{{ .Client.Version }}')"

case "${VM_DRIVER}" in
  kvm2)
    echo "virsh:     $(virsh --version)"
  ;;
  virtualbox)
    echo "vbox:      $(vboxmanage --version)"
  ;;
esac

echo ""
mkdir -p out/ testdata/

# Install gsutil if necessary.
if ! type -P gsutil >/dev/null; then
  if [[ ! -x "out/gsutil/gsutil" ]]; then
    echo "Installing gsutil to $(pwd)/out ..."
    curl -s https://storage.googleapis.com/pub/gsutil.tar.gz | tar -C out/ -zxf -
  fi
  PATH="$(pwd)/out/gsutil:$PATH"
fi

# Add the out/ directory to the PATH, for using new drivers.
PATH="$(pwd)/out/":$PATH
export PATH

echo ""
echo ">> Downloading test inputs from ${MINIKUBE_LOCATION} ..."
gsutil -qm cp \
  "gs://minikube-builds/${MINIKUBE_LOCATION}/minikube-${OS_ARCH}" \
  "gs://minikube-builds/${MINIKUBE_LOCATION}/docker-machine-driver"-* \
  "gs://minikube-builds/${MINIKUBE_LOCATION}/e2e-${OS_ARCH}" out

gsutil -qm cp "gs://minikube-builds/${MINIKUBE_LOCATION}/testdata"/* testdata/

# Set the executable bit on the e2e binary and out binary
export MINIKUBE_BIN="out/minikube-${OS_ARCH}"
export E2E_BIN="out/e2e-${OS_ARCH}"
chmod +x "${MINIKUBE_BIN}" "${E2E_BIN}" out/docker-machine-driver-*

if pgrep "minikube|e2e-"; then
  echo "WARNING: other instances of minikube may be running:"
  ps -afe | egrep "minikube|e2e-"
fi

# Cleanup stale test outputs.
echo ""
echo ">> Cleaning up after previous test runs ..."

for stale_dir in ${TEST_ROOT}/*; do
  echo "* Cleaning stale test: ${stale_dir}"
  export MINIKUBE_HOME="${stale_dir}/.minikube"
  export KUBECONFIG="${stale_dir}/kubeconfig"

  if [[ -d "${MINIKUBE_HOME}" ]]; then
    if [[ -f "${MINIKUBE_HOME}/tunnels.json" ]]; then
      echo "Stale tunnels.json:"
      cat "${MINIKUBE_HOME}/tunnels.json"
    fi
    echo "Shutting down stale minikube instance ..."
    if [[ -w "${MINIKUBE_HOME}" ]]; then
        "${MINIKUBE_BIN}" delete || true
        rm -Rf "${MINIKUBE_HOME}"
    else
      sudo -E "${MINIKUBE_BIN}" delete || true
      sudo rm -Rf "${MINIKUBE_HOME}"
    fi
  fi

  if [[ -f "${KUBECONFIG}" ]]; then
    if [[ -w "${KUBECONFIG}" ]]; then
      rm -f "${KUBECONFIG}"
    else
      sudo rm -f "${KUBECONFIG}" || true
    fi
  fi

  rmdir "${stale_dir}" || true
done

if type -P virsh; then
  virsh -c qemu:///system list --all
  virsh -c qemu:///system list --all \
    | grep minikube \
    | awk '{ print $2 }' \
    | xargs -I {} sh -c "virsh -c qemu:///system destroy {}; virsh -c qemu:///system undefine {}" \
    || true
fi

if type -P vboxmanage; then
  vboxmanage list vms || true
  vboxmanage list vms \
    | grep minikube \
    | cut -d'"' -f2 \
    | xargs -I {} sh -c "vboxmanage startvm {} --type emergencystop; vboxmanage unregistervm {} --delete" \
    || true
fi

if type -P hdiutil; then
  hdiutil info | grep -E "/dev/disk[1-9][^s]" || true
  hdiutil info \
      | grep -E "/dev/disk[1-9][^s]" \
      | awk '{print $1}' \
      | xargs -I {} sh -c "hdiutil detach {}" \
      || true
fi

if [[ "${VM_DRIVER}" == "hyperkit" ]]; then
  if [[ -e out/docker-machine-driver-hyperkit ]]; then
    sudo chown root:wheel out/docker-machine-driver-hyperkit || true
    sudo chmod u+s out/docker-machine-driver-hyperkit || true
  fi
fi

if pgrep kubectl; then
  echo "killing hung kubectl processes ..."
  ps -afe | grep kubectl | grep -v grep || true
  pgrep kubectl | xargs kill || true
fi

function cleanup_stale_routes() {
  stale_routes=$(netstat -rn -f inet | awk '{ print $1 }' | grep 10.96.0.0)
  if [[ "${stale_routes}" != "" ]]; then
    echo "WARNING: deleting stale tunnel routes: ${stale_routes}"
    for route in ${stale_routes}; do
      sudo route -n delete "${route}" || true
    done
  fi
}

cleanup_stale_routes || true

mkdir -p "${TEST_HOME}"
export MINIKUBE_HOME="${TEST_HOME}/.minikube"
export MINIKUBE_WANTREPORTERRORPROMPT=False
export KUBECONFIG="${TEST_HOME}/kubeconfig"

# Display the default image URL
echo ""
echo ">> ISO URL"
"${MINIKUBE_BIN}" start -h | grep iso-url || true

echo ""
echo ">> Starting ${E2E_BIN} at $(date)"
${SUDO_PREFIX}${E2E_BIN} \
  -minikube-start-args="--vm-driver=${VM_DRIVER} ${EXTRA_START_ARGS}" \
  -minikube-args="--v=10 --logtostderr ${EXTRA_ARGS}" \
  -test.v -test.timeout=30m -binary="${MINIKUBE_BIN}" && result=$? || result=$?
echo ">> ${E2E_BIN} exited with ${result} at $(date)"
echo ""

if [[ $result -eq 0 ]]; then
  status="success"
  echo "minikube: SUCCESS"
else
  status="failure"
  echo "minikube: FAIL"
  source print-debug-info.sh
fi

echo ">> Cleaning up after ourselves ..."
${SUDO_PREFIX}${MINIKUBE_BIN} delete >/dev/null 2>/dev/null || true
cleanup_stale_routes || true

${SUDO_PREFIX} rm -Rf "${MINIKUBE_HOME}" || true
${SUDO_PREFIX} rm -f "${KUBECONFIG}" || true
rmdir "${TEST_HOME}"
echo ">> ${TEST_HOME} completed at $(date)"

if [[ "${MINIKUBE_LOCATION}" != "master" ]]; then
  readonly target_url="https://storage.googleapis.com/minikube-builds/logs/${MINIKUBE_LOCATION}/${JOB_NAME}.txt"
  curl -s "https://api.github.com/repos/kubernetes/minikube/statuses/${COMMIT}?access_token=$access_token" \
  -H "Content-Type: application/json" \
  -X POST \
  -d "{\"state\": \"$status\", \"description\": \"Jenkins\", \"target_url\": \"$target_url\", \"context\": \"${JOB_NAME}\"}"
fi
exit $result


dummy helper file

dummy helper file

#!/bin/bash

#
#for (( i=17; i<32; i++ ))
#do
#
#    find ./site_$i/imgs -iname "*.png" -type f | wc -l
#
#done

#cd /Users/isa/Experiments/BOF/helicopter_providence/beaudet_corners/bof_cross_validation
#
#t=90;
#find ./*/thresh_$t/k_means_20 -iname "run_time.txt" -type f | while read filepath
##find ./*/thresh_$t/classification_20 -iname "run_time.txt" -type f | while read filepath
#do
#
#   count=`cat $filepath`
#   echo "$filepath: $count"
#done
#
#echo ""
#
#find ./*/thresh_$t/class_histograms_20 -iname "run_time.txt" -type f | while read filepath
#do
#
#   count=`cat $filepath`
#   echo "$filepath: $count"
#done
#
#echo ""
#
#find ./*/thresh_$t/classification_20 -iname "run_time.txt" -type f | while read filepath
#do
#
#   count=`cat $filepath`
#   echo "$filepath: $count"
#done

#cd /Users/isa/Experiments/BOF/helicopter_providence/corners/k_3/bof_cross_validation
#
#t=90;
#find ./trial_*/thresh_$t/k_means_20 -iname "run_time.txt" -type f | while read filepath
##find ./*/thresh_$t/classification_20 -iname "run_time.txt" -type f | while read filepath
#do
#
#   count=`cat $filepath`
#   echo "$filepath: $count"
#done
#
#echo ""
#
#find ./*/thresh_$t/class_histograms_20 -iname "run_time.txt" -type f | while read filepath
#do
#
#   count=`cat $filepath`
#   echo "$filepath: $count"
#done
#
#echo ""
#
#find ./*/thresh_$t/classification_20 -iname "run_time.txt" -type f | while read filepath
#do
#
#   count=`cat $filepath`
#   echo "$filepath: $count"
#done

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


add basic configs to get mylar post-processing working again

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


added start script for testing

added start script for testing

#!/bin/sh
mkdir -p log
erl -sname jangah -setcookie nocookie -pa $PWD/ebin $PWD/deps/*/ebin -boot start_sasl -s janga_core -s observer -config ../janga/etc/app.config

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


Split version

Split version

#!/bin/sh

# set some variables
. ./setVars.sh

abort()
{
    if [ "$?" = "0" ]
    then
        return
    else
      echo >&2 '
      ***************
      *** ABORTED ***
      ***************
      '
      echo "An error occurred on line $1. Exiting..." >&2
      exit 1
    fi
}

summary()
{
  echo_msg "Current Apps & Services in CF_SPACE"
  cf apps
  cf services
}

echo_msg()
{
  echo ""
  echo "************** ${1} **************"
}

deploy()
{
  echo_msg "Deploying $1"
  cd $BASE_DIR/$1
  cf push -f build/manifest.yml
  if [ $? -eq 0 ]
  then
    echo "Successfully deployed $1"
  else
    echo "Could not deploy $1" >&2
    exit 1
  fi
}

main()
{
  APPS=`cat microServices.list`

  for app in ${APPS[@]}
  do
    deploy $app &
    sleep 8
  done
  wait

  summary
}

trap 'abort $LINENO' 0
SECONDS=0
SCRIPTNAME=`basename "$0"`

main

printf "\nExecuted $SCRIPTNAME in $SECONDS seconds.\n"
exit 0

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


In our run.sh, rebase not merge the git pull to update local code.   If there are local commits, or on a different branch than master   this was causing the editor to popup with a merge commit message   and was disrupting the run.sh script.

#!/bin/bash
REDIS_HOST=${REDIS_HOST:-localhost}
REDIS_PORT=${REDIS_PORT:-6379}
DB_TYPE=${DB_TYPE:-sqlite3}
DB_NAME=${DB_NAME:-shipyard.db}
DB_USER=${DB_USER:-}
DB_PASS=${DB_PASS:-}
DB_HOST=${DB_HOST:-}
DB_PORT=${DB_PORT:-}
VE_DIR=/opt/ve/shipyard
EXTRA_CMD=${EXTRA_CMD:-}
EXTRA_REQUIREMENTS=${EXTRA_REQUIREMENTS:-}
CONFIG=/opt/apps/shipyard/shipyard/local_settings.py
cd /opt/apps/shipyard
echo "REDIS_HOST=\"$REDIS_HOST\"" > $CONFIG
echo "REDIS_PORT=$REDIS_PORT" >> $CONFIG
cat << EOF >> $CONFIG
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.${DB_TYPE}',
        'NAME': '${DB_NAME}',
        'USER': '${DB_USER}',
        'PASSWORD': '${DB_PASS}',
        'HOST': '${DB_HOST}',
        'PORT': '${DB_PORT}',
    }
}
EOF
git pull origin master --rebase
if [ ! -z "$EXTRA_CMD" ]; then
    /bin/bash -c "$EXTRA_CMD"
fi
$VE_DIR/bin/pip install -r requirements.txt
if [ ! -z "$EXTRA_REQUIREMENTS" ]; then
    $VE_DIR/bin/pip install $EXTRA_REQUIREMENTS
fi
$VE_DIR/bin/python manage.py syncdb --noinput
$VE_DIR/bin/python manage.py migrate --noinput
$VE_DIR/bin/python manage.py create_api_keys
supervisord -c /opt/apps/shipyard/.docker/supervisor.conf -n

#!/bin/bash
REDIS_HOST=${REDIS_HOST:-localhost}
REDIS_PORT=${REDIS_PORT:-6379}
DB_TYPE=${DB_TYPE:-sqlite3}
DB_NAME=${DB_NAME:-shipyard.db}
DB_USER=${DB_USER:-}
DB_PASS=${DB_PASS:-}
DB_HOST=${DB_HOST:-}
DB_PORT=${DB_PORT:-}
VE_DIR=/opt/ve/shipyard
EXTRA_CMD=${EXTRA_CMD:-}
EXTRA_REQUIREMENTS=${EXTRA_REQUIREMENTS:-}
CONFIG=/opt/apps/shipyard/shipyard/local_settings.py
cd /opt/apps/shipyard
echo "REDIS_HOST=\"$REDIS_HOST\"" > $CONFIG
echo "REDIS_PORT=$REDIS_PORT" >> $CONFIG
cat << EOF >> $CONFIG
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.${DB_TYPE}',
        'NAME': '${DB_NAME}',
        'USER': '${DB_USER}',
        'PASSWORD': '${DB_PASS}',
        'HOST': '${DB_HOST}',
        'PORT': '${DB_PORT}',
    }
}
EOF
git pull origin master
if [ ! -z "$EXTRA_CMD" ]; then
    /bin/bash -c "$EXTRA_CMD"
fi
$VE_DIR/bin/pip install -r requirements.txt
if [ ! -z "$EXTRA_REQUIREMENTS" ]; then
    $VE_DIR/bin/pip install $EXTRA_REQUIREMENTS
fi
$VE_DIR/bin/python manage.py syncdb --noinput
$VE_DIR/bin/python manage.py migrate --noinput
$VE_DIR/bin/python manage.py create_api_keys
supervisord -c /opt/apps/shipyard/.docker/supervisor.conf -n


Escape dollar sign in postfix's header check

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/B-LUC/AdminTools.git/'


Add a rudimentary test.

Add a rudimentary test.

#!/bin/sh

# basically just a sanity test

if [ -z $SCHEME_IMPL ]; then
    SCHEME_IMPL='csi -q'
fi

cd src
cat >test-input.txt <<EOF
(test2)
4
9
EOF
cat >expected-output.txt <<EOF
13
OK

EOF
$SCHEME_IMPL test.scm < test-input.txt > test-output.txt || exit 1
diff -u expected-output.txt test-output.txt
RESULT=$?
rm -f test-input.txt expected-output.txt test-output.txt
exit $RESULT

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


added a script for setting up an environment and running test scene

#!/usr/bin/env bash

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

# set up env vars
export HOUDINI_DSO_PATH="&:$ROOT/dso"
export HOUDINI_DSO_ERROR=1

cd $ROOT
houdini -foreground test.hip


Create test.sh

Create test.sh

#!/bin/bash

set -x

mono packages/NUnit.Runners.2.6.4/tools/nunit-console.exe bin/FilmWebAPI.Test.dll


Added script to start tests

Added script to start tests

#!/bin/sh

#
#   Clouseau
#
#    Copyright (C) 2015 Pavel Tisnovsky <ptisnovs@redhat.com>
#
# Bytecode synth is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# Bytecode synth is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Bytecode synth; see the file COPYING.  If not, write to the
# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA.
#
# Linking this library statically or dynamically with other modules is
# making a combined work based on this library.  Thus, the terms and
# conditions of the GNU General Public License cover the whole
# combination.
#
# As a special exception, the copyright holders of this library give you
# permission to link this library with independent modules to produce an
# executable, regardless of the license terms of these independent
# modules, and to copy and distribute the resulting executable under
# terms of your choice, provided that you also meet, for each linked
# independent module, the terms and conditions of the license of that
# module.  An independent module is a module which is not derived from
# or based on this library.  If you modify this library, you may extend
# this exception to your version of the library, but you are not
# obligated to do so. If you do not wish to do so, delete this
# exception statement from your version.
#

lein test


Run certain scripts on each CI run

Run certain scripts on each CI run

#!/bin/sh

set -e

DIR="$(cd "$(dirname "${0}")" && pwd)"
cd "${DIR}"

function init_parallel() {
  mkdir -p "${HOME}/.parallel"
  touch "${HOME}/.parallel/ignored_vars"
}

function run_parallel() {
  local piped="$(cat -)"
  init_parallel
  parallel --dry-run "${1}" ::: ${piped}
  parallel --env _ --joblog - "${1}" ::: ${piped}
}

function run_all_scripts_in_dir_in_parallel() {
  ls "${1}" | run_parallel "bash ${1}/{}"
}

echo "Testing scripts for dependency caches"
run_all_scripts_in_dir_in_parallel "${DIR}/cache"

echo "Testing scripts for custom packages"
run_all_scripts_in_dir_in_parallel "${DIR}/packages"

echo "Testing utility scripts"
run_all_scripts_in_dir_in_parallel "${DIR}/utilities"


Adding a test script.

Adding a test script.

#!/bin/bash -xe

export CHEF_VALIDATION_KEY=/var/jenkins_home/.chef/chef_validationkey.pem
export CHEF_VALIDATION_CLIENT_NAME=newmediadenver-validator
export CHEF_CLIENT_KEY=/var/jenkins_home/.chef/chef_clientkey.pem
export CHEF_NODE_NAME=jenkins_ac
export CHEF_SERVER_URL=https://api.opscode.com/organizations/newmediadenver
export COOKBOOK_NAME=`awk '$1=="name"{print $2}' $WORKSPACE/metadata.rb | sed "s/'//g"`

env

OUTPUT=`knife ssh -A "$COOKBOOK_NAME:action" "sudo chef-client" --ssh-user jenkins_ac`


Create tf2d.sh

Create tf2d.sh

#!/bin/sh
#
# Simple script to start TF2 server
# Sat Dec  8 17:43:19 IST 2012
#
# NOTE: This expects the TF2 server to be run as user "tf2server"
#
# Ensure this script is run as tf2server (EUID 500) only.
if [[ $EUID -ne 500 ]]; then
   echo "This script can ONLY be run as user: tf2server"
   echo `/bin/grep tf2server /etc/passwd`
   echo "Perhaps you're root? Your EUID seems to be $EUID"
   exit 1
fi

MAP="jump_4starters_a9"
MAXPLAYERS="24"
GAMEIP="192.168.1.113"
GAMEPORT="27015"
GAMEPID="/home/tf2server/pids/tf2d.pid"
GAMEDIR="/home/tf2server/hlds/gameserver/orangebox"
GAMEBIN="./srcds_run"
STEAMBIN="/home/tf2server/hlds/steam"
GAMEOPTS="-game tf -autoupdate -steambin $STEAMBIN -maxplayers $MAXPLAYERS +map $MAP +ip $GAMEIP -port $GAMEPORT -pidfile $GAMEPID"

start() {
  if ! /usr/bin/pgrep srcds ; then
    rm -f $GAMEPID
    if [ -x /home/tf2server/hlds/gameserver/orangebox/srcds_run -a -x /home/tf2server/hlds/steam ] ; then
         echo "Starting TF2 server with detached screen-name: tf2"
	  echo "You can use screen -r tf2 to bring it back up and Ctrl + A + D will minimize the console."
	  echo "Ctrl+D will terminate the session and Ctrl + A + [ will allow you to scroll through it."
	  echo ""

      cd $GAMEDIR
      /usr/bin/screen -A -m -d -S tf2 $GAMEBIN $GAMEOPTS
	echo "Your server is starting with these options:"
	echo ""
	echo ""
	echo "./srcds "
	echo "$GAMEOPTS"
    fi
  fi
}

stop() {
  if [ -e "$GAMEPID" ]; then
    echo "Stopping Team Fortress server..."
    pid=$(cat $GAMEPID)
    /bin/kill $pid 1> /dev/null 2> /dev/null
    # Just in case:
    /usr/bin/pkill srcds 1> /dev/null 2> /dev/null
    rm -f $GAMEPID
  fi
}

reload() {
  echo "Reloading Team Fortress configuration..."
  if [ -e "$GAMEPID" ]; then
    pid=$(cat $GAMEPID)
    kill -HUP $pid
  else
    /usr/bin/pkill -HUP srcds
  fi
}

config() {
  if [ -x $GAMEDIR/$GAMEBIN -a -x $STEAMBIN ] ; then
	clear
	echo ""
	echo "SRCDS and Steam binaries look good.."
	sleep 1
	echo ""
	echo "My TF 2 config is as follows:"
	sleep 1
  	echo ""
  	echo "Server IP/PORT:	$GAMEIP:$GAMEPORT"
  	echo "Steam directory:  $STEAMBIN"
  	echo "Game directory:	$GAMEDIR"
  	echo "As user: "	`/bin/grep tf2server /etc/passwd`
  	echo ""
	echo ""
	sleep 1
	echo "SRCDS TF server will start with these options:"
	echo ""
	echo "$GAMEOPTS"
	echo ""
  else
	echo "Uhm..."
	echo "SRCDS and Steam binary paths seem invalid!"
  fi
}

status() {
  if /usr/bin/pgrep srcds 2>/dev/null ; then
    echo "Team Fortress 2 server is running."
  else
    echo "Team Fortress server is stopped."
  fi
}

# See how we were called.
case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
  restart)
    stop
    start
    ;;
  reload)
    reload
    ;;
  config)
    config
    ;;
  status)
    status
    ;;
  *)
    echo $"Usage: $0 {start|stop|restart|reload|status}"
    ;;
esac

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


Script to time the execution of the parser.

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


fix es index name for pre

fix es index name for pre

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


add reject_unlisted_recipient before greylisting, fixes #127

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


Handle dollar signs in backup script

Handle dollar signs in backup 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/bashrc/freedombone.git/'


Restoring from backup

Restoring from backup


Don't import mail files for the writer variant


Longer timeout

Longer timeout


Subscribe the user to the public mailing list


Owncloud requires mariaDB

Owncloud requires mariaDB


More mediagoblin

More mediagoblin


Установка JDK на Ubuntu.

Установка JDK на Ubuntu.

#!/bin/bash
set -x # echo on

# Standard Java or Java compatible Development Kit

sudo apt-get -qq install default-jdk

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


install script to deploy atav on a EC2 instance

#!/bin/bash

mkdir -p /home/ec2-user
cd /home/ec2-user
# Install git
sudo yum -y install git
# Install Maven
wget http://apache.claz.org/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
tar xvzf apache-maven-3.3.9-bin.tar.gz
rm apache-maven-3.3.9-bin.tar.gz*
export PATH=/home/ec2-user/apache-maven-3.3.9/bin:$PATH
export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=256m"
#  setup java 8
sudo yum remove java-1.7.0 -y
sudo yum install java-1.8.0-openjdk-devel -y
export JAVA_HOME=/usr
# Install ADAM
git clone -b dragen https://github.com/igm-team/atav.git
cd /home/ec2-user
mkdir -p atav_home
cp -r atav/config atav_home/
cp -r atav/data atav_home/
cp -r atav/lib atav_home/
export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=256m"

# mvn clean package -DskipTests
cd /home/ec2-user/atav
echo "=============================="
echo $JAVA_HOME
mvn clean package assembly:single

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


Make installed binary executable.

Make installed binary executable.

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/ibrt/go-gomg.git/'


Fix installer.

Fix installer.


Create actions-runner-force-node16.sh

Create actions-runner-force-node16.sh

unset ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION

export ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION=$_ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION

error: pathspec 'recipes/actions-runner/deactivate.d/actions-runner-force-node16.sh' did not match any file(s) known to git


first commit m31-001.sh

first commit m31-001.sh

# m31_001.sh
# not included 1006 search button on top of advanced search form
#
echo 'Starting m31-001 tests '
sh issue.sh 1007
sh issue.sh 1008
sh issue.sh 1010
echo 'Finished m31-001 tests'

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


The iOS package script installed ldid as ldid.arm.

#!/bin/bash

set -e -x

cycc -i2.0 -m10.5 -oldid.arm -- ldid.cpp sha1.c -x c lookup2.c -I .

rm -rf _
mkdir -p _/usr/bin
cp -a ldid.arm _/usr/bin/ldid
mkdir -p _/DEBIAN
./control.sh _ >_/DEBIAN/control
mkdir -p debs
ln -sf debs/ldid_$(./version.sh)_iphoneos-arm.deb ldid.deb
dpkg-deb -b _ ldid.deb
readlink ldid.deb

#!/bin/bash

set -e -x

cycc -i2.0 -m10.5 -oldid.arm -- ldid.cpp sha1.c -x c lookup2.c -I .

rm -rf _
mkdir -p _/usr/bin
cp -a ldid.arm _/usr/bin
mkdir -p _/DEBIAN
./control.sh _ >_/DEBIAN/control
mkdir -p debs
ln -sf debs/ldid_$(./version.sh)_iphoneos-arm.deb ldid.deb
dpkg-deb -b _ ldid.deb
readlink ldid.deb


renamed

renamed

#!/bin/sh
if [ $# -ne 1 ]; then
  echo Usage:
  echo $ ./itx.sh input.itx
  exit
fi
i=$1 # input file name
o=${1%.*}.root # output file name
echo converting $i to $o ...
dos2unix -c mac $i # replace
 with \r
root -b -q -l itx.C\(\"$i\",\"$o\"\)
echo done!

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


Adding main file

Adding main file

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


Create vicp.sh

Create vicp.sh

Visual cp command ( vicp )

#!/bin/bash

trap "leave" EXIT HUP INT TERM KILL
export DIALOGOPTS="--backtitle \"ViCp\""

leave ()
{
#make sure all the lights are off
   if [ ! -z $DIAPID ];then
      tput cup $(($(tput lines)-1)) 0
      echo  "//@@EOF@@//" >$FIFO
   fi
   rm $FIFO 2>/dev/null
   kill -9 $CPPID $DIAPID  2>/dev/null
}

DATAARRAY=""
NOGRAPH=0
RECURSE=0
ARRAYCNT=0
DIAPID=""
TOTALFILES=0
CURRENTFILE=0
SIMULATE=0

#'cos I'm anal that way!
prettyprint ()
{
   local RETVAL="$1"

   if [ ! -z "$RETVAL" ];then
      RETVAL=${RETVAL#./}
      RETVAL="${RETVAL%/}"

      if [ "$RETVAL" = "." ];then
         RETVAL="$PWD"
      fi

      if [ "${RETVAL:0:1}" != "/" ];then
         RETVAL="$PWD/$RETVAL"
      fi
   fi
   echo "$RETVAL"
}

#check some stuff before doing the copy
sanitycheck ()
{
   if [ ${#DATAARRAY[@]} -gt 2 ] && [ ! -d ${DATAARRAY[ARRAYCNT - 1]} ];then
      echo "vicp: target is not a directory"
      exit -1
   fi

   if [ $RECURSE -eq 0 ];then

      for (( CNT=0;CNT<(( $ARRAYCNT - 1 ));CNT++ ))
         do
#non-fatal error dont copy directories unless using recurse
            if [ -d "${DATAARRAY[$CNT]}" ];then
               echo "vicp: omitting directory ${DATAARRAY[$CNT]}"
               DATAARRAY[$CNT]=""
            fi
         done
   fi

   for (( CNT=0;CNT<ARRAYCNT-1;CNT++ ))
      do
         if [ ! -e "${DATAARRAY[$CNT]}" ];then
            echo "vicp: cannot stat ${DATAARRAY[$CNT]} : No such file or directory"
            exit -1
         fi
         DATAARRAY[$CNT]=$(prettyprint "${DATAARRAY[$CNT]}")
         TOTALFILES=$((TOTALFILES+$(find "${DATAARRAY[$CNT]}" ! -type d |wc -l)))
      done

   OUT=$(prettyprint "${DATAARRAY[$CNT]}")
}

#Check command line parameters
doparams ()
{
   local PARAMS CNT

   for PARAMS in "$@"

      do
         case $PARAMS in

         -[[:alnum:]]*)
            for (( CNT=1;CNT<${#PARAMS};CNT++ ))
               do
#peel off -r and -X
                  if [ ${PARAMS:CNT:1} = "r" -o ${PARAMS:CNT:1} = "R" ];then
                     RECURSE=1
                     continue
                  fi
                  if [ ${PARAMS:CNT:1} = "X" ];then
                     NOGRAPH=1
                     continue
                  fi
#EVALSTRING is eventually passed to the "real" cp command
                  EVALSTRING="${EVALSTRING} -${PARAMS:CNT:1}"
               done
            ;;

#we do recursive
         --recursive)
            RECURSE=1
            ;;

#just checking
         --simulate)
            SIMULATE=1
            NOGRAPH=1
            ;;

         --[[:alnum:]]*)
            EVALSTRING="${EVALSTRING} ${PARAMS}"
            ;;

         *)
            DATAARRAY[$ARRAYCNT]="${PARAMS}"
            (( ARRAYCNT++ ))
            ;;
         esac
      done
}

#main cp routine
docp ()
{
   local TOSIZE PERCENT

#either do a fancy dialog output
   if [ $NOGRAPH -eq 0 ];then
      while (( FROMSIZE>TOSIZE )) && ps $CPPID &>/dev/null
         do
            TOSIZE=$(stat "$2" 2>/dev/null |grep Size|awk '{print $2}')
            TOSIZE=${TOSIZE:-0}

            PERCENT=$(echo "scale=2 ;100/($FROMSIZE/($TOSIZE+1))"|bc -l 2>/dev/null )
            PERCENT=${PERCENT%.?*}
            if (( PERCENT>100 ));then
               PERCENT=100
            fi
#if only copying one file then no overall progress bar
#from file=$1 to file =$2
            if [ $TOTALFILES -gt 1 ];then
               echo "$1@$2@$TOSIZE@$FROMSIZE@$CURRENTFILE@$PERCENT" >$FIFO
            else
               echo "$1@$2@$TOSIZE@$FROMSIZE@$PERCENT" >$FIFO
            fi
         done
#or a dull command line output
   else
      while (( FROMSIZE>TOSIZE )) && ps $CPPID &>/dev/null
         do
            TOSIZE=$(stat "$2" 2>/dev/null |grep Size|awk '{print $2}')
            TOSIZE=${TOSIZE:-0}
            PERCENT=$(echo "scale=2 ;100/($FROMSIZE/($TOSIZE))"|bc -l 2>/dev/null )
            echo -en "\rCopied ${TOSIZE}B of ${FROMSIZE}B (${PERCENT%.?*}%) to $2"
         done
   fi

#just clean up command line output
   if [ $NOGRAPH -eq 1 ];then

      TOSIZE=$(stat "$2" 2>/dev/null |grep Size|awk '{print $2}')
      TOSIZE=${TOSIZE:-0}

      if [ "$FROMSIZE$TOSIZE" = "00" ];then
         PERCENT=100
      else
         PERCENT=$(echo "scale=2 ;100/($FROMSIZE/($TOSIZE))"|bc -l 2>/dev/null )
      fi

      echo -e "\rCopied ${TOSIZE}B of ${FROMSIZE}B (${PERCENT%.?*}%) to $2"
   fi
}

#the bit does the actual copying
dovicp ()
{
   local TONAME="$2"

#cp is run in the back ground

   if [ $SIMULATE -eq 1 ];then
      echo "cp $EVALSTRING \"$1\" \"$TONAME\""
      return
   else
      cp $EVALSTRING "$1" "$TONAME" &
   fi

   CPPID=$!
   FROMSIZE=$(stat "$1" 2>/dev/null |grep Size|awk '{print $2}')

   if [ -d "$2" ];then
      TONAME="$TONAME/$(basename "$1")"
   fi

   (( CURRENTFILE++ ))
   if [ $NOGRAPH -eq 1 ] && [ $TOTALFILES -gt 1 ];then
      echo "File $CURRENTFILE of $TOTALFILES"
   fi

#run the output stuff
   docp "$1" "$TONAME"
}

#set up the overall progress bar
setupoverbar ()
{
   FROMBAR="                             "
   BAR=""

   BARSIZE=$(($(tput cols)-10))
   while (( ${#FROMBAR}<BARSIZE ))
      do
         FROMBAR="${FROMBAR}${FROMBAR}"
      done
   FROMBAR=${FROMBAR:0:$(($BARSIZE-12))}
   MID=$(((BARSIZE/2)-5))
}

#main loop takes care of recursion
main ()
{
#simple case
   if [ $RECURSE -eq 0 ] && [ $ARRAYCNT -eq 2 ];then
      dovicp "${DATAARRAY[0]}" "${DATAARRAY[1]}"
      exit 0
   fi

   for (( CNT=0;CNT<(( $ARRAYCNT - 1 ));CNT++ ))
      do

#dropped bad file name passed on command line
         if [ -z "${DATAARRAY[$CNT]}" ];then
            continue
         fi

#if its a directory then recurse
         if [ -d "${DATAARRAY[$CNT]}" ];then
            TOFOLD=$(basename "${DATAARRAY[$CNT]}")
            TOUT="${OUT}/${TOFOLD}"
            cd "${DATAARRAY[$CNT]}"
            find -mindepth 1 -type d -exec mkdir -p "${TOUT}"/'{}' \;
            while read
               do
                  FROMFILE=$(prettyprint "$REPLY")
                  TOFILE="${OUT}/$(basename "${DATAARRAY[$CNT]}")${FROMFILE##"${DATAARRAY[$CNT]}"}"
                  dovicp "$FROMFILE" "$TOFILE"
               done < <(find  ! -type d)
            cd $OLDPWD
#else just a file copy
         else
            dovicp "${DATAARRAY[$CNT]}" "$OUT/$(basename "${DATAARRAY[$CNT]}")"
         fi
      done
}

#run the dialog in the background
rundialog ()
{
#taller dialog for multifile copy
   if [ $TOTALFILES -gt 1 ];then
      HEIGHT=11
   else
      HEIGHT=8
   fi

   (
   while [ -e $FIFO ]
      do
         read <$FIFO

#time to go
         if [ X"$REPLY" = X"//@@EOF@@//" ];then
            exit 0
         fi

#print fancy stuff in the dialog box
         echo "XXX"
         if [ $(echo "$REPLY"|awk -F "@" '{print NF }') -gt 5 ];then
            CURRENTFILE=$(echo "$REPLY"|awk -F "@" '{print $5}')

#dialog won't let me have two bars so roll my own
            TOTSLICES=$(echo "scale=2 ;($BARSIZE/$TOTALFILES*$CURRENTFILE)+0.5"|bc -l 2>/dev/null)
            TOTSLICES=${TOTSLICES%.?*}

            PERCENT=$(echo "scale=2 ;100/($TOTALFILES/$CURRENTFILE)"|bc -l 2>/dev/null )
            PERCENT=${PERCENT%.?*}
            PERCENT=${PERCENT:-0}

            BAR="${FROMBAR:0:$MID}${PERCENT}%${FROMBAR:$MID:$BARSIZE}"
            TOBAR="\Zb\Z3\Zr  ${BAR:0:$((TOTSLICES))}\Zn\Z3\Zb${BAR:$((TOTSLICES)):$(( BARSIZE-(TOTSLICES) ))}"

            echo "\Zb\Z3File \Zn$CURRENTFILE \Zb\Z3of \Zn$TOTALFILES"
            echo "\Zb\Z3Overall Progress\Zn"
            echo "$TOBAR"
         fi
         echo "$REPLY"|awk -F "@" '{print "\\Zb\\Z3From:\\Zn"$1}'
         echo "$REPLY"|awk -F "@" '{print "\\Zb\\Z3To:\\Zn"$2}'
         echo "$REPLY"|awk -F "@" '{print "\\Zb\\Z3Copied \\Zn" $3 "B \\Zb\\Z3of \\Zn" $4 "B"}'
         echo "XXX"
         echo "$REPLY"|awk -F "@" '{print $NF }'

      done |dialog --colors --title "Copying..." --no-collapse --gauge "" $HEIGHT $(($(tput cols)-10))

#run it in the background as a sub proccess
   )&
   DIAPID=$!
}

#lets get going
setterm -msg off
doparams "$@"
sanitycheck
FIFO=$(tempfile)
mkfifo $FIFO 2>/dev/null
#TOTALFILES=34
setupoverbar

if [ $NOGRAPH -eq 0 ];then
   rundialog
fi

main
leave

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


Create reweb.sh

Create reweb.sh

#!/bin/bash

sudo rm -r /var/www/html/
sudo mkdir /var/www/html/
sudo cp -r /tmp/Email-Server/* /var/www/html/
sudo cp -r /tmp/Email-Server/.[^.]* /var/www/html/
sleep 1
sudo service apache2 restart

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


Script to count source files and lines of code.

#!/bin/sh

# Count lines
find examples inc src test tools NativeJIT/Examples NativeJIT/inc NativeJIT/src NativeJIT/test -type f | xargs wc -l

# Count files
find examples inc src test tools NativeJIT/Examples NativeJIT/inc NativeJIT/src NativeJIT/test -type f | wc -l

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


added lock script for i3 config alt-shift-l

#!/usr/bin/env bash

cfg_tmpdir="/run/user/$UID/i3lock-extra"
cfg_pixelize_scale='10'

err() { printf '%s\n' "$*" >&2; }

usage() {
	while read; do printf '%s\n' "$REPLY"; done <<- EOF
		Usage: i3lock-extra [flags]
		    Flags:
		        --help|-h                       Show this message.
		        --umask|-u                      Set umask.
		        --tmpdir|-d                     Directory to store temporary files in.
		                                          This should not be accessible by other users!
		        --image_file|-i                 Lock screen with an image.
		        --screenshot|-s                 Lock screen with a screenshot of your current workspace.

		        # Modifiers (apply to both screenshots and specified images):
		        --overlay-image|-o              Overlay another image over the main one.
		                                          Gets applied after all other modifiers.
		        --grayscale|-g                  Make the image grayscale.
		        --pixelize|-p                   Pixelize the image.
		        --pixelize-scale|-P             Sets the number by which the image is resized down and up
		                                          again to achieve the pixelize effect. For example, 4 means
		                                          that it will be resized to 1/4 of the original and blown back up.
		        --blur|-b                       Blur the image.
	EOF
}

deskshot() {
	scrot "$cfg_tmpdir/lockbg.png"
	image_file="${cfg_tmpdir}/lockbg.png"
}

image_prepare() {
	declare -a convert_args
	declare scale_down scale_up

	if (( f_grayscale )); then
		convert_args+=( -grayscale rec601luma )
	fi

	if (( f_pixelize )); then
		scale_down=$(( 100/cfg_pixelize_scale ))
		scale_up=$(( ( 100/cfg_pixelize_scale ) * cfg_pixelize_scale * cfg_pixelize_scale ))

		convert_args+=( -scale "$scale_down%" -scale "$scale_up%" )
	fi

	if (( f_blur )); then
		convert_args+=( -blur 4x8 )
	fi

	if [[ "$convert_args" ]]; then
		convert "$image_file" "${convert_args[@]}" "$cfg_tmpdir/lockbg.png"
		image_file="$cfg_tmpdir/lockbg.png"
	fi

	if [[ "$overlay_image" ]]; then
		convert -gravity center -composite -matte "$image_file" "$overlay_image" "$cfg_tmpdir/lockbg.png"
		image_file="$cfg_tmpdir/lockbg.png"
	fi
}

main() {
	umask 0077 # All files and dirs created should only be accessible by the user.

	# Restart i3lock on non-zero exit code by default.
	f_secloop=1

	while (( $# )); do
		case "$1" in
			--help|-h) usage; return 0;;

			--tmpdir|-d) cfg_tmpdir=$2; shift;;
			--umask|-u) umask "$2"; shift;;
			--image-file|-i) image_file=$2; shift;;
			--overlay-image|-o) overlay_image=$2; shift;;

			--screenshot|-s) f_screenshot=1;;
			--grayscale|-g) f_grayscale=1;;
			--pixelize|-p) f_pixelize=1;;
			--pixelize-scale|-P) cfg_pixelize_scale=$2; shift;;
			--blur|-b) f_blur=1;;

			--unsecure) f_secloop=0;;

			--) shift; break;;
			-*)
				err "Unknown key: $1"
				usage
				return 1
			;;

			*) break;;
		esac
		shift
	done

	if ! [[ -d "$cfg_tmpdir" ]]; then
		mkdir -p "$cfg_tmpdir" || {
			return 1
		}
	fi

	if (( f_screenshot )); then
		deskshot
	fi

	if ! [[ $image_file ]]; then
		usage
		return 1
	fi

	image_prepare

	if (( f_secloop )); then
		until i3lock -n -t -i "$image_file"; do
			true
		done
	else
		i3lock -n -t -i "$image_file"
	fi
}

main "$@"

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


Fixed bash bug

Fixed bash bug

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


java: convenience .sh script for full gradle run

cleanstart.sh downloads the current seed data and does a full, clean
setup of the Samplestack Java tier and finishes by launching bootrun.

It is not expected to work on Windows. In the future, a cross-platform
solution may be developed in gradle.

For now, it represents the expected path for successful launch of the
Java stack after retrieving the code from git (minus all browser-related
commands).

It should work for a clean install and for a reinstall.

echo "Enter <username:password> (e.g. ssalsbur:notMyPassword) for wiki.marklogic.com:"
read -s creds
rm -rf ../../database/seed-data
curl -L -u $creds -o seed.tgz https://wiki.marklogic.com/download/attachments/31359376/seed-data1.3.tgz?api=v2 -o seed.tgz
tar -zxvf seed.tgz -C ../..
rm -rf seed.tgz
./gradlew dbteardown
./gradlew clean
./gradlew dbinit
./gradlew dbconfigure
./gradlew test
./gradlew dbload
./gradlew bootrun

error: pathspec 'appserver/java-spring/cleanstart.sh' did not match any file(s) known to git


Add script to fetch dependencies and start server

#!/bin/sh

cloneDependency()
{
    dep="$1"

    rep="$2"
    if [ "$2" == "" ]; then
        rep="requirejs"
    fi

    if [ ! -d "$dep" ]; then
        echo "INFO: Cloning ${rep}/${dep}..."

        RESULT=`git clone https://github.com/${rep}/${dep}.git`

        if [ "$RESULT" != "" ]; then
            echo "FAILED: This build requires ${rep}/${dep}, but failed with ${RESULT}!"
            exit $RESULT;
        fi
    fi

    echo "INFO: Updating ${rep}/${dep}..."
    cd $dep && git fetch origin && git reset --hard origin/master && git pull > /dev/null
    RESULT="$?"
    cd ..

    if [ "$RESULT" != "0" ]; then
        echo "FAILED: Unable to get latest ${rep}/${dep}, failed with ${RESULT}!"
        exit 127;
    fi
}

cloneDependency "text"
cloneDependency "i18n"
cloneDependency "domReady"
cloneDependency "requirejs" "jrburke"
cloneDependency "reqwirejs" "tkissing"

node server.js

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


Updating run.sh for bugfix and better readability

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/Sgoettschkes/ansible-playbooks.git/'


added helper run.sh

added helper run.sh

#!/bin/bash

export SHRUTI_CLIENT_HOST=0.0.0.0
export SHRUTI_CLIENT_PORT=9576
export SHRUTI_CLIENT_ID=webclient1234567
export SHRUTI_CLIENT_REFRESH_INTERVAL=10
export SHRUTI_API_URL=http://127.0.0.1:9574/
export SHRUTI_IVONA_URL=http://127.0.0.1:9575/

export SHRUTI_PUSHER_API_KEY=
export SHRUTI_PUSHER_CHANNEL=shruti
export SHRUTI_PUSHER_EVENT=new-notification

rm shruti-client
go build
./shruti-client


Remove check if package is installed

Remove check if package is installed

For now I’ll just remove it. We can add a better working check later on
because this is not working.

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/wendbv/wercker-step-typings.git/'


Restore docker test for docker pipelines

# exit on failure of any test line
set -x
set -e
# Modify test/regression to add tests
docker run -u $(id -u ${USER}):$(id -g ${USER}) -v $(pwd):/OpenROAD openroad/openroad bash -c "/OpenROAD/test/regression"

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


Create menu-update-script-vps.sh

Create menu-update-script-vps.sh

#!/bin/bash
clear

flag=0
if [[ $USER != "root" ]]; then
	echo "Maaf, Anda harus menjalankan ini sebagai root"
	exit
fi
#MYIP=$(wget -qO- ipv4.icanhazip.com);

# get the VPS IP
#ip=`ifconfig venet0:0 | grep 'inet addr' | awk {'print $2'} | sed s/.*://`

MYIP=`ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0' | head -n1`;
#MYIP=$(ifconfig | grep 'inet addr:' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | cut -d: -f2 | awk '{ print $1}' | head -1)
if [ "$MYIP" = "" ]; then
	MYIP=$(wget -qO- ipv4.icanhazip.com)
fi

#vps="zvur";
vps="aneka";

#if [[ $vps = "zvur" ]]; then
	#source="http://"
#else
	source="https://raw.githubusercontent.com/syahz86/y"
#fi

# go to root
cd

# check registered ip
wget -q -O IP $source/debian7/IP.txt
if ! grep -w -q $MYIP IP; then
	echo "Maaf, hanya IP yang terdaftar yang bisa menggunakan script ini!"
	if [[ $vps = "zvur" ]]; then
		echo "Hubungi: editor SYAHZ86"
	else
		echo "Hubungi: editor SYAHZ86"
	fi
	rm -f /root/IP
	exit
fi
cd
function update_script() {
cd
wget -O /usr/bin/updatescript.sh $source/debian7/updatescript.sh && clear && chmod +x /usr/bin/updatescript.sh && /usr/bin/updatescript.sh && rm -f /root/IP && rm -f /root/IPcarding
}
function anti_ddos() {
if [ -d '/usr/local/ddos' ]; then
echo; echo; echo "Gagal boss,Anti ddos sudah terinstal silahkan uninstall terlebih dulu."
exit 0
else
mkdir /usr/local/ddos
fi
clear
echo; echo "Installing DOS-Deflate 0.6"; echo
echo; echo -n 'Downloading source files...'
wget -q -O /usr/local/ddos/ddos.conf http://www.inetbase.com/scripts/ddos/ddos.conf
echo -n '.'
wget -q -O /usr/local/ddos/LICENSE http://www.inetbase.com/scripts/ddos/LICENSE
echo -n '.'
wget -q -O /usr/local/ddos/ignore.ip.list http://www.inetbase.com/scripts/ddos/ignore.ip.list
echo -n '.'
wget -q -O /usr/local/ddos/ddos.sh http://www.inetbase.com/scripts/ddos/ddos.sh
chmod 0755 /usr/local/ddos/ddos.sh
cp -s /usr/local/ddos/ddos.sh /usr/local/sbin/ddos
echo '...done'
echo; echo -n 'Creating cron to run script every minute.....(Default setting)'
/usr/local/ddos/ddos.sh --cron > /dev/null 2>&1
echo '.....done'
echo; echo 'Installation has completed.'
echo 'Config file is at /usr/local/ddos/ddos.conf'
echo 'Please send in your comments and/or suggestions to yusuf-ardiansyah.com'
}

function card() {
	if [[ ! -e /root/sqlmap ]]; then
	echo "Maaf boss sqlmap belum di install, Silahkan install dulu :p" | lolcat
	exit
	fi
	cd
	carding_hack
	}

clear
echo "SELAMAT DATANG DI MENU UPDATE SCRIPT VPS" | boxes -d dog | lolcat
PS3='Silahkan ketik angka 1-5 lalu ENTER: '
options=("Update Script VPS" "Install DDOS deflate" "Install SQLmap" "Carding" "Quit")
select opt in "${options[@]}"
do
    case $opt in
        "Update Script VPS")
        update_script

        break
        ;;
	"Install DDOS deflate")
	anti_ddos
	break
	;;
	"Install SQLmap")
	cd /root
	wget -O /usr/bin/install-sqlmap.sh $source/debian7/install-sqlmap.sh
	chmod 755 /usr/bin/install-sqlmap.sh
	clear
	/usr/bin/install-sqlmap.sh
	rm -f /root/IPcarding
	rm /usr/bin/install-sqlmap.sh

	break
	;;
	"Carding")
	card
	break
	;;
        "Quit")
        exit
        break
        ;;

        *) echo invalid option;
	esac
done

error: pathspec 'menu-update-script-vps.sh' did not match any file(s) known to git


Documentation

Documentation

#!/bin/sh
if [ "$1" = "" ]; then
  echo "Usage: $0 <UCSC-assembly>"
  exit 1
fi
# Why is there no web-api for the hgTables stuff?
URL="http://hgdownload.cse.ucsc.edu/goldenPath/$1/database/refGene.txt.gz"
wget -q -O - "$URL" | gunzip -c | \
  fgrep -w cmpl | awk '$3 ~ /^chr..?$/ {print $3,$9,$10,$11,$7,$8}' | fgrep -v chrUn | fgrep -v '_' | \
  sed -e 's/^chr//' -e 's/^X/100/' -e 's/^Y/101/' | \
  awk '{split($3,s,","); split($4,e,","); for (i=1;i<=$2;i++) {if (e[i] >= $5 && s[i] <= $6) { si = s[i]; if ($5 > si) { si = $5 }; ei = e[i]; if ($6 < ei) { ei = $6 }; print $1"\t"si"\t"ei}}}' | \
  sort -k1n,1 -k2n,2 -k3n,3 | \
  sed -e 's/^100/X/' -e 's/^101/Y/' | \
  uniq

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


updated

updated

#!/bin/bash

# To list other hash algorithms supported by openssl:
#   $ openssl list -digest-algorithms
HASH_ALGORITHM=ssl3-sha1

bash ./random_password.sh | openssl dgst -$HASH_ALGORITHM | awk '{print $2}'

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


add test.sh for step_1 folder

add test.sh for step_1 folder

docker build -t noel/ff ff

docker run -d -p  8080:80 noel/ff

docker build -t noel/photonscoop photonscoop

docker run -d -p  8081:80 noel/photonscoop

docker build -t noel/proxy proxy

docker run -d -p  80:80 noel/proxy

curl "http://carrock:8080/"
curl "http://carrock:8081/"

curl "http://ff.photonscoop.local"
curl "http://photonscoop.local"

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


Create build.sh

Create build.sh

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


Data preparation script

Data preparation script

#!/bin/sh

# Clear out existing data
rm -rf data/*

# Copy data from source folders, converting coordsys to EPSG:900913

src=/usr/local/data

echo "Compiling basemap data set" > prep_data.log

for series in topo50 topo250 topo500; do
mkdir data/$series
for f in $src/$series/*.shp; do
   echo "Processing $f"
   echo "Processing $f" >> prep_data.log
   tf="data/$series/"`basename $f .shp`"_gm.shp"
   ogr2ogr -t_srs EPSG:900913 $tf $f >> prep_data.log 2>&1
   echo "Indexing $tf" >> prep_data.log
   shapeindex $tf >> prep_data.log 2>&1
done;
echo "Compiling $series/coastline polygons"
echo "Compiling $series/coastline polygons" >> prep_data.log
python makepoly.py data/$series/coastline_gm.shp data/$series/coastline_poly_gm.shp >> prep_data.log 2>&1

shapeindex data/$series/coastline_poly_gm.shp
done;

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


PV and PVC notes

PV and PVC notes

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/javiroman/reproducible-research.git/'


Build script for kafka for RHEL 7.6

Build script for kafka for RHEL 7.6

# ----------------------------------------------------------------------------
#
# Package       : kafka
# Version       : 1.1.1, 2.2.0, 2.2.1-rc1
# Source repo   : https://github.com/apache/kafka
# Tested on     : rhel_7.4
# Script License: Apache License, Version 2 or later
# Maintainer    : Priya Seth <sethp@us.ibm.com>
#
# Disclaimer: This script has been tested in non-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.
#
# ----------------------------------------------------------------------------
#!/bin/bash

if [ "$#" -gt 0 ]
then
    VERSION=$1
else
    VERSION="2.2.0"
fi

#Install dependencies
sudo yum update -y
sudo yum install -y git wget unzip java-1.8.0-openjdk java-1.8.0-openjdk-devel

cd $HOME
wget https://services.gradle.org/distributions/gradle-4.8-bin.zip
unzip gradle-4.8-bin.zip

#Set required environment variables
export PATH=$HOME/gradle-4.8/bin:$PATH

#Build and run unit tests
cd $HOME
git clone https://github.com/apache/kafka
cd kafka
git checkout ${VERSION}

#Note: Downgrading snappy version as version 1.1.7.2 links to GLIBC 2.2, and hence
#does not work on RHEL where we have an older version of GLIBC
#sed -i 's/  snappy: "1.1.7.1",/  snappy: "1.1.4",/g' gradle/dependencies.gradle
sed -i 's/  snappy: "1.1.7.2",/  snappy: "1.1.4",/g' gradle/dependencies.gradle

gradle clean
gradle
./gradlew jar
./gradlew releaseTarGz -x signArchives

#Please uncomment below line if you want to to execute unit tests
#Results are "5031 tests completed, 1 failed, 1 skipped"
#./gradlew unitTest

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


Added success_build.sh.

Added success_build.sh.

#!/bin/bash -e

echo "copy artifact."
[[ -f /mnt/artifact/isono-*.gem ]] && rm -f /mnt/artifact/isono-*.gem
cp isono-*.gem /mnt/artifact

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


add composer install to provision.sh

add composer install to provision.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/rohmann/obsidian.git/'


shells

shells

#!/bin/bash

# python3 lc_create_shells.py 114 MD10 1000 remaped_position_L15
# python3 lc_create_shells.py 113 MD10 1000 remaped_position_L15
# python3 lc_create_shells.py 112 MD10 1000 remaped_position_L15
# python3 lc_create_shells.py 111 MD10 1000 remaped_position_L15
# python3 lc_create_shells.py 110 MD10 1000 remaped_position_L15
# python3 lc_create_shells.py 109 MD10 1000 remaped_position_L15
# python3 lc_create_shells.py 108 MD10 1000 remaped_position_L15
# python3 lc_create_shells.py 107 MD10 1000 remaped_position_L15
# python3 lc_create_shells.py 106 MD10 1000 remaped_position_L15
# python3 lc_create_shells.py 105 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 104 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 103 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 102 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 101 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 100 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 99 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 98 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 97 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 96 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 95 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 94 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 93 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 92 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 91 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 90 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 89 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 88 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 87 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 86 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 85 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 84 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 83 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 82 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 81 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 80 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 79 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 78 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 77 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 76 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 75 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 74 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 73 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 72 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 71 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 70 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 69 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 68 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 67 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 66 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 65 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 64 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 63 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 62 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 61 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 60 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 59 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 58 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 57 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 56 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 55 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 54 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 53 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 52 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 51 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 50 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 49 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 48 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 47 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 46 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 45 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 44 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 43 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 42 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 41 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 40 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 39 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 38 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 37 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 36 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 35 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 34 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 33 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 32 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 31 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 30 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 29 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 28 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 27 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 26 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 25 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 24 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 23 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 22 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 21 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 20 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 19 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 18 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 17 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 16 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 15 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 14 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 13 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 12 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 11 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 10 MD10 1000 remaped_position_L15
python3 lc_create_shells.py 9 MD10 1000 remaped_position_L15

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


Fix ssh keys insertion in box-repackage script

Public keys are inserted correctly, but since VMs are shutdown
immediately after the filesystem modification, the data is not stored.
Call `sync` to fix that.

#!/bin/bash -e
#
# 1. Remove vagrant-assigned static IP from /etc/network/interfaces;
# 2. Put insecure vagrant SSH key for vagrant and root users;
# 3. Repackage box
#

SCRIPT=$(basename $0)

error_exit() {
    echo $* 1>&2
    echo 1>&2
    echo "Usage: $SCRIPT --box <box name> [-f, --force]" 1>&2

    exit 1
}

while [[ $# -ge 1 ]]; do
    case $1 in
        -f | --force)
            shift
            forced=1
            ;;
        --box)
            shift
            box=$1
            shift
            ;;
        *) error_exit "Invalid arg $1";;
    esac
done

if [[ -z $box || "$box" != 'grizzly' && "$box" != 'icehouse' ]]; then
    error_exit "Invalid box name provided: '$box'. Should be one of 'grizzly' or 'icehouse'."
fi

ssh_config=$(vagrant ssh-config $box)
ssh_host=$(echo "$ssh_config" | grep HostName | cut -d' ' -f4)
ssh_port=$(echo "$ssh_config" | grep Port | cut -d' ' -f4)
ssh_private_key=$(echo "$ssh_config" | grep IdentityFile | cut -d' ' -f4)
ssh_user=$(echo "$ssh_config" | grep '\<User\>' | cut -d' ' -f4)
ssh_users_private_key=~/.ssh/id_rsa.pub
ssh_opts='-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR'

insecure_pub_key=~/.vagrant.d/vagrant.pub
insecure_private_key=~/.vagrant.d/insecure_private_key

ssh_cmd() {
    local private_key="$1"
    local cmd="$2"

    ssh $ssh_user@$ssh_host -p $ssh_port -i $private_key $ssh_opts "$cmd"
}

# grizzly box has eth1 udev rules which must be flushed
# to correctly assign eth device index on boot
# Icehouse box doesn't have this because it runs more recent Ubuntu
if [[ $box == 'grizzly' ]]; then
    grizzly_mac_re='([0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2})'
    grizzly_eth1_mac=$(ssh_cmd $ssh_private_key "ip link show eth1 | sed -r -n 's/.*\<$grizzly_mac_re\>.*/\1/p'")
    echo "Removing $grizzly_eth1_mac from udev net rules"
    ssh_cmd $ssh_private_key "sudo sed -i -r '/$grizzly_eth1_mac/d' /etc/udev/rules.d/70-persistent-net.rules"
fi

# remove vagrant-assigned static IP
echo "Removing static configuration for eth1 network interface"
ssh_cmd $ssh_private_key 'sudo sed -i "/^#VAGRANT-BEGIN/,\$d" /etc/network/interfaces'
echo "Updating authorized keys for vagrant user"
ssh_cmd $ssh_private_key "echo '$(cat $insecure_pub_key)' > ~/.ssh/authorized_keys"
echo "Updating authorized keys for root user"
ssh_cmd $insecure_private_key "echo '$(cat $insecure_pub_key)' | sudo tee /root/.ssh/authorized_keys >/dev/null"

vagrant_key_updated=$(ssh_cmd $insecure_private_key "grep insecure ~/.ssh/authorized_keys")
if [[ $? != 0 || ! $vagrant_key_updated ]]; then
    error_exit "Something went wrong during SSH keys substitution. Please check your box. Packaging will be aborted"
fi

echo "Writing caches to disk"
ssh_cmd $insecure_private_key "sync"

vm_name=$(VBoxManage list runningvms | grep $box | head -1 | cut -d' ' -f1 | sed 's/"//g')

echo "Shutting down $box VM"
VBoxManage controlvm $vm_name poweroff

if [[ ! $forced ]]; then
    read -p "Please verify the VM name: $vm_name " vm_name_from_user
    if [[ -n $vm_name_from_user ]]; then
        vm_name=$vm_name_from_user
    fi
fi

echo "Vagrant box packaging started for $box (VirtualBox VM name is $vm_name)"

packaged_box_name=${box}-$(date +%d%m%y_%H%M%S).box
vagrant package --base $vm_name --output $packaged_box_name

#!/bin/bash -e
#
# 1. Remove vagrant-assigned static IP from /etc/network/interfaces;
# 2. Put insecure vagrant SSH key for vagrant and root users;
# 3. Repackage box
#

SCRIPT=$(basename $0)

error_exit() {
    echo $* 1>&2
    echo 1>&2
    echo "Usage: $SCRIPT --box <box name> [-f, --force]" 1>&2

    exit 1
}

while [[ $# -ge 1 ]]; do
    case $1 in
        -f | --force)
            shift
            forced=1
            ;;
        --box)
            shift
            box=$1
            shift
            ;;
        *) error_exit "Invalid arg $1";;
    esac
done

if [[ -z $box || "$box" != 'grizzly' && "$box" != 'icehouse' ]]; then
    error_exit "Invalid box name provided: '$box'. Should be one of 'grizzly' or 'icehouse'."
fi

ssh_config=$(vagrant ssh-config $box)
ssh_host=$(echo "$ssh_config" | grep HostName | cut -d' ' -f4)
ssh_port=$(echo "$ssh_config" | grep Port | cut -d' ' -f4)
ssh_private_key=$(echo "$ssh_config" | grep IdentityFile | cut -d' ' -f4)
ssh_user=$(echo "$ssh_config" | grep '\<User\>' | cut -d' ' -f4)
ssh_users_private_key=~/.ssh/id_rsa.pub
ssh_opts='-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR'

insecure_pub_key=~/.vagrant.d/vagrant.pub
insecure_private_key=~/.vagrant.d/insecure_private_key

ssh_cmd() {
    local private_key="$1"
    local cmd="$2"

    ssh $ssh_user@$ssh_host -p $ssh_port -i $private_key $ssh_opts "$cmd"
}

# grizzly box has eth1 udev rules which must be flushed
# to correctly assign eth device index on boot
# Icehouse box doesn't have this because it runs more recent Ubuntu
if [[ $box == 'grizzly' ]]; then
    grizzly_mac_re='([0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2})'
    grizzly_eth1_mac=$(ssh_cmd $ssh_private_key "ip link show eth1 | sed -r -n 's/.*\<$grizzly_mac_re\>.*/\1/p'")
    echo "Removing $grizzly_eth1_mac from udev net rules"
    ssh_cmd $ssh_private_key "sudo sed -i -r '/$grizzly_eth1_mac/d' /etc/udev/rules.d/70-persistent-net.rules"
fi

# remove vagrant-assigned static IP
echo "Removing static configuration for eth1 network interface"
ssh_cmd $ssh_private_key 'sudo sed -i "/^#VAGRANT-BEGIN/,\$d" /etc/network/interfaces'
echo "Updating authorized keys for vagrant user"
ssh_cmd $ssh_private_key "echo '$(cat $insecure_pub_key)' > ~/.ssh/authorized_keys"
echo "Updating authorized keys for root user"
ssh_cmd $insecure_private_key "echo '$(cat $insecure_pub_key)' | sudo tee /root/.ssh/authorized_keys >/dev/null"

vagrant_key_updated=$(ssh_cmd $insecure_private_key "grep insecure ~/.ssh/authorized_keys")
if [[ $? != 0 || ! $vagrant_key_updated ]]; then
    error_exit "Something went wrong during SSH keys substitution. Please check your box. Packaging will be aborted"
fi

vm_name=$(VBoxManage list runningvms | grep $box | head -1 | cut -d' ' -f1 | sed 's/"//g')

echo "Shutting down $box VM"
VBoxManage controlvm $vm_name poweroff

if [[ ! $forced ]]; then
    read -p "Please verify the VM name: $vm_name " vm_name_from_user
    if [[ -n $vm_name_from_user ]]; then
        vm_name=$vm_name_from_user
    fi
fi

echo "Vagrant box packaging started for $box (VirtualBox VM name is $vm_name)"

packaged_box_name=${box}-$(date +%d%m%y_%H%M%S).box
vagrant package --base $vm_name --output $packaged_box_name


gulpRun args

gulpRun args

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/rbstudio/docker-php-development.git/'


Update docs.sh

Update docs.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/ember-vcl/build-demo.git/'


Minor fixes

Minor fixes

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


here we go

here we go

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/adrianmalacoda/mediawiki-apache.git/'


added setup script

added setup script

#!/bin/sh

pushd Playground
npm install
popd

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


implement

implement

#!/bin/bash
#####################
#
# setup bash, based on https://github.com/oscm/shell
#
# zsh will auto installed
#
# 1. mysql
# 2. nginx
# 3. php
# 4. redis
#
#####################

# zsh
curl -s https://raw.githubusercontent.com/oscm/shell/master/shell/zsh.sh  | bash
# timezone
curl -s https://raw.githubusercontent.com/oscm/shell/master/os/timezone.sh | bash
# depends
curl -s https://raw.githubusercontent.com/mythteam/shell/master/nginx-mysql/0-init.sh | bash
# mysql
curl -s https://raw.githubusercontent.com/mythteam/shell/master/nginx-mysql/1-mysql.sh | bash
# nginx
curl -s https://raw.githubusercontent.com/mythteam/shell/master/nginx-mysql/2-nginx.sh | bash
# php
curl -s https://raw.githubusercontent.com/mythteam/shell/master/nginx-mysql/3-php.sh | bash
curl -s https://raw.githubusercontent.com/mythteam/shell/master/nginx-mysql/3-1-imagick.sh | bash
curl -s https://raw.githubusercontent.com/mythteam/shell/master/nginx-mysql/3-2-intl.sh | bash
curl -s https://raw.githubusercontent.com/mythteam/shell/master/nginx-mysql/3-3-composer.sh | bash
curl -s https://raw.githubusercontent.com/mythteam/shell/master/nginx-mysql/3-4-composer.sh | bash
# redis
curl -s https://raw.githubusercontent.com/mythteam/shell/master/nginx-mysql/4-redis.sh | bash


Add setup.sh

Add setup.sh

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


renamed setup script

renamed setup script

# install essential libraries
export CODE_DIR=~/code              #
#sudo apt-get install build-essential
#sudo apt-get install libjpeg-dev
#sudo apt-get install libtiff5-dev
echo "Do you want to install all packages regardless of size? [y/n] "
read dec
echo "Which branch of HotSpotter do you want? Just press [ENTER] for recommended (matt)"
read hsb
echo "Which branch of hesaff do you want? Just press [ENTER] for recommended branch (next):"
read hesaffb

# If user doesn't want to think about it anymore
if [[ "$dec" == "y" ]]
then
    #sudo apt-get install -y pkg-config
    sudo apt-get install -y python2.7      #
    sudo apt-get install -y git 		    #
    #sudo apt-get install -y libqt4-dev
    #sudo apt-get install -y cmake
    sudo apt-get install -y python-qt4     #
    sudo apt-get install -y python-pip		#
else
    #sudo apt-get install pkg-config
    sudo apt-get install python2.7      #
    sudo apt-get install git 		    #
    #sudo apt-get install libqt4-dev
    #sudo apt-get install cmake
    sudo apt-get install python-qt4     #
    sudo apt-get install python-pip		#
fi

### Python libraries ###

# Now we'll pip
# core libraries
sudo pip install Pygments
sudo pip install argparse
sudo pip install openpyxl
sudo pip install parse
sudo pip install pyreadline
sudo pip install python-dateutil
sudo pip install six

#speed libraries
sudo pip install Cython             #
sudo pip install pylru              #

# Essential Libraries
sudo pip install cmake              #

# interactive libs
#sudo pip install ipython
sudo pip install matplotlib         #
#sudo pip install python-qt

# sci libs
sudo pip install pillow             #
sudo pip install numpy              #
#sudo pip install opencv-python
sudo pip install pandas             #
sudo pip install scipy              #
sudo pip install pyflann            #

# dev tools
#sudo pip install setuptools
#sudo pip install pyinstaller
#sudo pip install flake8
#sudo pip install pep8
#sudo pip install pyflakes
#sudo pip install pylint
sudo pip install utool              #
sudo pip install networkx           #

## On to the project ##
## Start with repos  ##
# several of these scripts expect to see stuff in ~/code, so we'll do that
mkdir ~/code
cd ~/code

# FLANN - Fast Library for Approximate Nearest Neighbors
git clone https://github.com/SU-ECE-17-7/flann.git                      #

# Hessian Affine Keypoint Detector
# git clone -b BRANCH https://github.com/SU-ECE-17-7/hesaff.git
if [ -n "$hesaffb" ]
then
    git clone -b "$hesaffb" https://github.com/SU-ECE-17-7/hesaff.git                     #
else
    git clone -b next https://github.com/SU-ECE-17-7/hesaff.git                     #
fi

# opencv
git clone -b hotsbranch248 https://github.com/SU-ECE-17-7/opencv.git    #

# Main HotSpotter repo
if [ -n "$hsb" ]
then
    git clone -b "$hsb" https://github.com/SU-ECE-17-7/hotspotter.git
else
    git clone https://github.com/SU-ECE-17-7/hotspotter.git
fi

## Let's build stuff ##

# Build opencv (this takes a looooong time)
cd ~/code/opencv
./unix_configure.sh
./unix_build.sh

# Build hesaff
cd ~/code/hesaff
./unix_build.sh
# Some branches have a different name. If it errors, try this:
#~/code/hesaff/unix_hesaff_build.sh

# Setup HotSpotter
cd ~/code/hotspotter
python setup.py cython

# Move it to the right place
cp ~/code/hesaff/build/libhesaff.so ~/code/hotspotter/hstpl/extern_feat/libhesaff.so

# I guess we need to rename this for some reason?
#mv ~/
# build flann... yum
cd ~/code/flann
./unix_build.sh

# Go back to the parent dir
cd ~/code
zenity --info --text='All done setting up.\n Feel free to run HotSpotter now.'


setup: apm: add goplus

setup: apm: add goplus

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


Adding setup script

Adding setup script

#!/bin/sh
# Install dependencies
pip install -r requirements.txt
pip install -r requirements-dev.txt
# Initialize database
alembic upgrade head


created setup build script

created setup build script

#!/bin/bash
declare -r TRUE=1
declare -r FALSE=0

splitString(){

    local string=$(echo "$1")
    local delimiter="$2"

    # check if the delimiter is null
    # if yes, use " " as delimiter
    if [ -z $delimiter ];
    then
        splitted_string=($(echo "$string" | tr " " "\n"))
    else
        splitted_string=($(echo "$string" | tr $delimiter "\n"))
    fi
}

containsElement () {
  local e match="$1"
  shift
  for e;
    do
        [[ "$e" == "$match" ]] && return 0;
    done
  return 1
}
getUbuntuVersion()
{
    local distro_name=$(lsb_release -d)

    local delimiter=' '
    splitString  "$distro_name"   "$delimiter"

    re='^[0-9]*$' # to check if is a number

    for i in "${splitted_string[@]}"
    do
        if [ -z "${i//[0-9]*/}" -a ! -z "$i" ]; then #is a number
            UBUNTU_MAJOR_VERSION="${i:0:2}"
            UBUNTU_VERSION="$i"
            return $MAJOR_VERSION
        fi
    done
    echo "vish"
    return 0
}
checkDistro()
{
    local target_distro="$1"
    local test=$target_distro
    # first get the complete distro name and split it into a string
    local distro_name=$(lsb_release -d)

    if [ $VERBOSE -eq $TRUE ]; then
        echo "Distro Name: " $distro_name
    fi

    local delimiter=' '
    splitString  "$distro_name"   "$delimiter"

    containsElement "$target_distro" "$splitted_string[@]"

    if [ $?  -eq 1 ];
    then
        if [ $VERBOSE -eq $TRUE ];
            then echo "DISTRO NAME: $target_distro"
            echo $?
        fi
        TARGET_DISTRO=$target_distro
        return $TRUE
    else
        return $FALSE
    fi
}

checkVerboseFromUserInput()
{
    VERBOSE=$FALSE
    BUILD_G2O=$FALSE
    INSTALL_DEPENDENCIES=$FALSE
    options=" "
    for var in "$@"
    do
        echo $var
        if [ $var == "-v" ];
        then
            VERBOSE=$TRUE
            options="${options} -v"
        elif [ $var == "-install_dependencies" ];
        then
            INSTALL_DEPENDENCIES=$TRUE
            options="${options} -install_dependencies"
        elif [ $var == "-BUILD_G2O" ];
        then
            BUILD_G2O=$TRUE
            options="${options} -BUILD_G2O"
        fi
    done
    if [ $VERBOSE -eq $FALSE ];then
        echo "VERBOSE MODE OFF"
    else
        echo "VERBOSE MODE ON"
        echo "ENABLED OPTIONS: $options"
    fi

}

buildG2O()
{
    echo COMPILING G2O...
    wget https://github.com/RainerKuemmerle/g2o/archive/refs/tags/20201223_git.tar.gz
    tar -xf 20201223_git.tar.gz
    cd g2o-20201223_git
    mkdir build
    mkdir install
    cd build
    cmake -DCMAKE_INSTALL_PREFIX=../install -DG2O_USE_CSPARSE=ON ..
    make -j4
    make install
}

installUbuntuDependencies()
{
    echo INSTAL install_dependencies?  $INSTALL_DEPENDENCIES $TRUE
    sudo apt-get update || $(echo "apt-get update failed" exit  )
    sudo apt install build-essential || echo "apt install build-essential failed" exit
    sudo apt install libopencv-dev || echo "apt install opencv failed"  exit
    sudo apt install cmake || echo "apt install cmake failed" exit
    sudo apt install libpcl-dev || echo "apt install libpcl-dev failed"  exit
    sudo apt install libusb-1.0-0-dev || echo "apt install libusb-1.0-0-dev failed" exit
    sudo apt install libsuitesparse-dev || echo "apt install libsuitesparse-dev failed" exit
}

############# MAIN CODE #############
main()
{

    kernel_name=$(uname -s)

    checkVerboseFromUserInput "$@"

    if [ $VERBOSE -eq $TRUE ];
    then
        echo "Kernel Name: $kernel_name"
    fi

    if [ $kernel_name == "Linux" ];
    then
        checkDistro "Ubuntu"
        is_valid_distro=$?

        if [ $is_valid_distro -eq $TRUE ];
        then
            if [ $TARGET_DISTRO == "Ubuntu" ];
            then
                getUbuntuVersion

                if [ $UBUNTU_MAJOR_VERSION -ge 20 -a $INSTALL_DEPENDENCIES -eq $TRUE ]; then
                    installUbuntuDependencies
                fi
            else
                echo "your Ubuntu Version ($UBUNTU_VERSION) is not compatible"
                exit
            fi

            if [ $BUILD_G2O -eq $TRUE ]; then
                buildG2O
            fi

        elif [ $is_valid_distro -eq $FALSE ];
        then
            echo "Invalid Distro"
        fi
    else
        echo "ERROR: the system only support linux OS"
        exit 1
    fi

}

main "$@"


Changes to be committed: 	new file:   setup.sh

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


use proper command-line args - per project

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


shellscript: NEW script rouse.sh for remote WOL across LAN machines

#!/bin/zsh
# Program: rouse
# Version: 1.0
# Author: Linus Arver
# License: GPLv3

# Copyright (C) 2010 Linus Arver

# rouse: a script that checks which systems are offline, and asks user which systems to wake up via Wake-on-Lan

# Colors (comment out to disable)
c1="\x1b[1;32m" # bright green
c2="\x1b[1;33m" # bright yellow
c3="\x1b[1;34m" # bright blue
c4="\x1b[1;36m" # bright cyan
c5="\x1b[1;35m" # bright purple
c6="\x1b[1;31m" # bright red
ce="\x1b[0m"

machines=(luxion aether exelion forest ocean)
laptops=(luxion aether)
remotes=()
online=()
offline=()

# Populate remotes_foreign
for m in $machines; do
    if [[ $m != $HOST ]]; then
        # if the remote is recognized by laptops() array, connect with an
        # appended ".e"
        [[ -n ${laptops[(r)$m]} ]] && m+=".e"
        remotes+=($m)
    fi
done

# Check which systems are offline
for r in $remotes; do
    ping -c 1 -W 1 $r >/dev/null 2>&1
    if [[ $? -eq 0 ]]; then
        online+=($r)
    else
        offline+=($r)
    fi
done

# Display those systems that are online
i=0
echo "LAN status:\n"
for r in $remotes; do
    ((i++))
    if [[ -n ${online[(r)$r]} ]]; then
        echo $i\) $r "->" ${c1}online$ce
    else
        echo $i\) $r "->" ${c6}offline$ce
    fi
done

# If there are offline systems, enter interactive menu
if [[ $#offline -gt 0 ]]; then
    echo "\nChoose system to wake (q to exit):\n"
    while [[ $#offline -gt 0 ]]; do
        read -s -t 1 -k key
        case $key in
        1|2|3|4|5|6|7|8|9)
            system=$remotes[$key]
            if [[ -z $system ]]; then
                echo "Choice $key invalid"
            elif [[ -n ${online[(r)$system]} ]]; then
                echo "$system is already online"
            else
                echo "Chose system ${c3}$system$ce"
                case $system in
                exelion)
                    wol -i exelion 00:04:4B:02:51:47
                    ;;
                aether.e)
                    wol -i aether.e 00:23:26:5C:07:37
                    ;;
                luxion.e)
                    wol -i luxion.e 00:12:3F:05:85:FE
                    ;;
                forest)
                    # Gigabyte GA-P35-DS3L does not support wake-on-lan (WOL) with its own built-in ethernet ports; you
                    # have to buy a separate NIC to get it working
                    echo "Unfortunately, system ${c3}$system$ce does not support WOL"
                    ;;
                ocean)
                    wol -i ocean 00:50:8D:BC:9B:72
                    ;;
                *)
                    echo "System \`$system' not yet supported"
                    ;;
                esac
                offline[$offline[(i)$system]]=()
                echo
            fi
            ;;
        q) exit ;;
        *) ;;
        esac
        key=""
    done
else
    echo "All systems online."
fi

# vim: syntax=zsh

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