build-toolchain.sh to customize build-tools/build.sh

#!/bin/bash

export RISCV_HOME=$PWD
export RISCV_BUILD=$RISCV_HOME/build
export RISCV_TOOLS=$RISCV_HOME/riscv
export RISCV=$RISCV_TOOLS

export PATH=$RISCV/bin:$PATH
export LD_LIBRARY_PATH=$RISCV/lib

rm -fr riscv

(cd riscv-tools; git clean -fdx; \
 . build.common.sh; \
 build_project riscv-gnu-toolchain --prefix=$RISCV --enable-linux --disable-multilib --with-xlen=64 --with-arch=IMAFD ; \
)
ls riscv/bin
#(cd procs/RV64G_multicycle; make gen.verilator && make -j8 -C verilator bits) || exit 2
#(cd procs/RV64G_multicycle; make -C verilator exe) || exit 3
#cd procs; ./runtests.sh

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


added convenience script to translate README.md into README.rst with pandoc

#!/bin/bash
pandoc --from=markdown --to=rst --output=README.rst README.md

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


travis: install geckodriver

travis: install geckodriver

#!/bin/bash

# Copyright 2016 splinter authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

set -ev

if [ "${DRIVER}" = "tests/test_djangoclient.py" ]; then
  pip install -q Django==${DJANGO_VERSION}
fi

if [ "${DRIVER}" = "tests/test_webdriver_remote.py" ]; then
  sleep 1

	wget http://goo.gl/PJUZfa -O selenium-server.jar
	java -jar selenium-server.jar > /dev/null 2>&1 &
	sleep 1
fi

if [ "${DRIVER}" = "tests/test_webdriver_firefox.py" ]; then
    sleep 1

    wget https://github.com/mozilla/geckodriver/releases/download/v0.11.1/geckodriver-v0.11.1-linux64.tar.gz
    mkdir geckodriver
    tar -xzf geckodriver-v0.11.1-linux64.tar.gz -C geckodriver
    export PATH=$PATH:$PWD/geckodriver

    curl "https://download.mozilla.org/?product=firefox-latest&lang=en-US&os=linux64" -L > firefox.tbz2
    bzip2 -dc firefox.tbz2 | tar xvf -
    mv ./firefox $HOME
    export PATH=$HOME/firefox:$PATH
fi

if [ "${DRIVER}" = "tests/test_webdriver_chrome.py" ]; then
    sleep 1

    FILE=`mktemp`; wget "http://chromedriver.storage.googleapis.com/2.20/chromedriver_linux64.zip" -qO $FILE && unzip $FILE chromedriver -d ~; rm $FILE; chmod 777 ~/chromedriver;
    export PATH=$HOME:$PATH
fi

#!/bin/bash

# Copyright 2016 splinter authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

set -ev

if [ "${DRIVER}" = "tests/test_djangoclient.py" ]; then
  pip install -q Django==${DJANGO_VERSION}
fi

if [ "${DRIVER}" = "tests/test_webdriver_remote.py" ]; then
  sleep 1

	wget http://goo.gl/PJUZfa -O selenium-server.jar
	java -jar selenium-server.jar > /dev/null 2>&1 &
	sleep 1
fi

if [ "${DRIVER}" = "tests/test_webdriver_firefox.py" ]; then
    sleep 1

    curl "https://download.mozilla.org/?product=firefox-latest&lang=en-US&os=linux64" -L > firefox.tbz2
    bzip2 -dc firefox.tbz2 | tar xvf -
    mv ./firefox $HOME
    export PATH=$HOME/firefox:$PATH
fi

if [ "${DRIVER}" = "tests/test_webdriver_chrome.py" ]; then
    sleep 1

    FILE=`mktemp`; wget "http://chromedriver.storage.googleapis.com/2.20/chromedriver_linux64.zip" -qO $FILE && unzip $FILE chromedriver -d ~; rm $FILE; chmod 777 ~/chromedriver;
    export PATH=$HOME:$PATH
fi


only build the rest test-suite on 5.14

only build the rest test-suite on 5.14

#!/bin/bash

echo "We are running Perl '$TRAVIS_PERL_VERSION', Coveralls status is set to '$COVERALLS'"

# Setup the environment variables
export ENSEMBL_CVS_ROOT_DIR=$PWD
export TEST_AUTHOR=$USER
export PERL5LIB=$PERL5LIB:$PWD/modules
export PERL5LIB=$PERL5LIB:$PWD/ensembl/modules
export PERL5LIB=$PERL5LIB:$PWD/ensembl-rest/lib
export PERL5LIB=$PERL5LIB:$PWD/ensembl-io/modules
export PERL5LIB=$PERL5LIB:$PWD/ensembl-hive/modules
export PERL5LIB=$PERL5LIB:$PWD/ensembl-test/modules
export PERL5LIB=$PERL5LIB:$PWD/ensembl-funcgen/modules
export PERL5LIB=$PERL5LIB:$PWD/ensembl-variation/modules
export PERL5LIB=$PERL5LIB:$PWD/ensembl-vep/modules
export PERL5LIB=$PERL5LIB:$PWD/Bio-HTS/lib:$PWD/Bio-HTS/blib/arch/auto/Bio/DB/HTS/Faidx:$PWD/Bio-HTS/blib/arch/auto/Bio/DB/HTS

ENSEMBL_PERL5OPT='-MDevel::Cover=+ignore,bioperl,+ignore,ensembl,+ignore,ensembl-test,+ignore,ensembl-variation,+ignore,ensembl-io,+ignore,ensembl-funcgen,+ignore,ensembl-vep'
ENSEMBL_TESTER="$PWD/ensembl-test/scripts/runtests.pl"
COMPARA_SCRIPTS=("$PWD/modules/t")
CORE_SCRIPTS=("$PWD/ensembl/modules/t/compara.t")
REST_SCRIPTS=("$PWD/ensembl-rest/t/genomic_alignment.t" "$PWD/ensembl-rest/t/info.t" "$PWD/ensembl-rest/t/taxonomy.t" "$PWD/ensembl-rest/t/homology.t" "$PWD/ensembl-rest/t/gene_tree.t")

if [ "$COVERALLS" = 'true' ]; then
  EFFECTIVE_PERL5OPT="$ENSEMBL_PERL5OPT"
  ENSEMBL_TESTER="$ENSEMBL_TESTER -verbose"
else
  EFFECTIVE_PERL5OPT=""
fi

echo "Running ensembl-compara test suite using $PERL5LIB"
PERL5OPT="$EFFECTIVE_PERL5OPT" perl $ENSEMBL_TESTER "${COMPARA_SCRIPTS[@]}"
rt1=$?
PERL5OPT="$EFFECTIVE_PERL5OPT" perl $ENSEMBL_TESTER "${CORE_SCRIPTS[@]}"
rt2=$?

if [[ "$TRAVIS_PERL_VERSION" != "5.14" ]]; then
  echo "Skipping ensembl-rest test suite"
  rt3=0
else
  echo "Running ensembl-rest test suite using $PERL5LIB"
  PERL5OPT="$EFFECTIVE_PERL5OPT" perl $ENSEMBL_TESTER "${REST_SCRIPTS[@]}"
  rt3=$?
fi

if [[ ($rt1 -eq 0) && ($rt2 -eq 0) && ($rt3 -eq 0) ]]; then
  if [ "$COVERALLS" = 'true' ]; then
    echo "Running Devel::Cover coveralls report"
    cover --nosummary -report coveralls
  fi
  exit $?
else
  exit 255
fi

#!/bin/bash

echo "We are running Perl '$TRAVIS_PERL_VERSION', Coveralls status is set to '$COVERALLS'"

# Setup the environment variables
export ENSEMBL_CVS_ROOT_DIR=$PWD
export TEST_AUTHOR=$USER
export PERL5LIB=$PERL5LIB:$PWD/modules
export PERL5LIB=$PERL5LIB:$PWD/ensembl/modules
export PERL5LIB=$PERL5LIB:$PWD/ensembl-rest/lib
export PERL5LIB=$PERL5LIB:$PWD/ensembl-io/modules
export PERL5LIB=$PERL5LIB:$PWD/ensembl-hive/modules
export PERL5LIB=$PERL5LIB:$PWD/ensembl-test/modules
export PERL5LIB=$PERL5LIB:$PWD/ensembl-funcgen/modules
export PERL5LIB=$PERL5LIB:$PWD/ensembl-variation/modules
export PERL5LIB=$PERL5LIB:$PWD/ensembl-vep/modules
export PERL5LIB=$PERL5LIB:$PWD/Bio-HTS/lib:$PWD/Bio-HTS/blib/arch/auto/Bio/DB/HTS/Faidx:$PWD/Bio-HTS/blib/arch/auto/Bio/DB/HTS

ENSEMBL_PERL5OPT='-MDevel::Cover=+ignore,bioperl,+ignore,ensembl,+ignore,ensembl-test,+ignore,ensembl-variation,+ignore,ensembl-io,+ignore,ensembl-funcgen,+ignore,ensembl-vep'
ENSEMBL_TESTER="$PWD/ensembl-test/scripts/runtests.pl"
COMPARA_SCRIPTS=("$PWD/modules/t")
CORE_SCRIPTS=("$PWD/ensembl/modules/t/compara.t")
REST_SCRIPTS=("$PWD/ensembl-rest/t/genomic_alignment.t" "$PWD/ensembl-rest/t/info.t" "$PWD/ensembl-rest/t/taxonomy.t" "$PWD/ensembl-rest/t/homology.t" "$PWD/ensembl-rest/t/gene_tree.t")

if [ "$COVERALLS" = 'true' ]; then
  EFFECTIVE_PERL5OPT="$ENSEMBL_PERL5OPT"
  ENSEMBL_TESTER="$ENSEMBL_TESTER -verbose"
else
  EFFECTIVE_PERL5OPT=""
fi

echo "Running ensembl-compara test suite using $PERL5LIB"
PERL5OPT="$EFFECTIVE_PERL5OPT" perl $ENSEMBL_TESTER "${COMPARA_SCRIPTS[@]}"
rt1=$?
PERL5OPT="$EFFECTIVE_PERL5OPT" perl $ENSEMBL_TESTER "${CORE_SCRIPTS[@]}"
rt2=$?

if [[ "$TRAVIS_PERL_VERSION" < "5.14" ]]; then
  echo "Skipping ensembl-rest test suite"
  rt3=0
else
  echo "Running ensembl-rest test suite using $PERL5LIB"
  PERL5OPT="$EFFECTIVE_PERL5OPT" perl $ENSEMBL_TESTER "${REST_SCRIPTS[@]}"
  rt3=$?
fi

if [[ ($rt1 -eq 0) && ($rt2 -eq 0) && ($rt3 -eq 0) ]]; then
  if [ "$COVERALLS" = 'true' ]; then
    echo "Running Devel::Cover coveralls report"
    cover --nosummary -report coveralls
  fi
  exit $?
else
  exit 255
fi


Add example of dirname command.

Add example of dirname command.

# Description: dirname - strip last component from file name

# Notes
# 1. Output each argument with its last non-slash component and trailing slashes removed.

# Common Examples
dirname relative/path/to/filename
dirname /absolute/path/to/filename

# Examples with details
dirname filename                    # Outputs . for the current directory if argument does not have any /.
dirname /home/dilbert/work          # Outputs /home/dilbert.
dirname `pwd`                       # Outputs /home/dilbert when executed from /home/dilbert/work.
dirname /dir1/file1 /dir2/file2     # Multiple arguments can be given. Output is separated using newline.
dirname -z /dir1/file1 /dir2/file2  # Use -z switch to separate output with NUL rather than newline

# Cool Tricks
# None

# TODO
# None

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


remove unused tests from pending

remove unused tests from pending

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


added cloud shell test to GitHub jobbs

added cloud shell test to GitHub jobbs


If rebuild, fetch source first

If rebuild, fetch source first

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


Added support for third party plugin installs

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/contention/wp-setup.git/'


make installer more robust

make installer more robust

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


add babel-eslint

add babel-eslint

required for create-react-app


Add systemd base images to obsoleted image list

#!/bin/bash
set -e

cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"

repos='rpi-nodejs rpi-node armv7hf-node rpi-buildpack-deps armv7hf-buildpack-deps i386-node i386-buildpack-deps armel-node amd64-node \
		armv7hf-systemd raspberrypi-systemd i386-systemd amd64-systemd armel-systemd'

for repo in $repos; do
	# Clean up old directory
	rm -rf $repo
	# Generate new dir
	mkdir $repo
	cat <<-EOF > $repo/README.md
		This repository is obsolete. Please check http://docs.resin.io/#/pages/runtime/resin-base-images.md for information about resin docker images.
	EOF

	cat <<-EOF > $repo/README-short.txt
		This repository is obsolete.
	EOF

done

#!/bin/bash
set -e

cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"

repos='rpi-nodejs rpi-node armv7hf-node rpi-buildpack-deps armv7hf-buildpack-deps i386-node i386-buildpack-deps armel-node amd64-node'

for repo in $repos; do
	# Clean up old directory
	rm -rf $repo
	# Generate new dir
	mkdir $repo
	cat <<-EOF > $repo/README.md
		This repository is obsolete. Please check http://docs.resin.io/#/pages/runtime/resin-base-images.md for information about resin docker images.
	EOF

	cat <<-EOF > $repo/README-short.txt
		This repository is obsolete.
	EOF

done


Update branch names used by several proposals (#42)

#!/bin/bash
# Update tests based on upstream repositories.
set -e
set -u
set -o pipefail

ignore_dirs='document interpreter test/harness'

repos='
  spec
  threads
  simd
  exception-handling
  gc
  bulk-memory-operations
  tail-call
  host-bindings
  reference-types
  annotations
  function-references
  memory64
'

log_and_run() {
    echo ">>" $*
    if ! $*; then
        echo "sub-command failed: $*"
        exit
    fi
}

try_log_and_run() {
    echo ">>" $*
    $*
}

pushdir() {
    pushd $1 >/dev/null || exit
}

popdir() {
    popd >/dev/null || exit
}

update_repo() {
    local repo=$1
    local branch=$2
    pushdir repos
        if [ -d ${repo} ]; then
            log_and_run git -C ${repo} fetch origin
            log_and_run git -C ${repo} reset origin/${branch} --hard
        else
            log_and_run git clone https://github.com/WebAssembly/${repo}
        fi

        # Add upstream spec as "spec" remote.
        if [ "${repo}" != "spec" ]; then
            pushdir ${repo}
                if ! git remote | grep spec >/dev/null; then
                    log_and_run git remote add spec https://github.com/WebAssembly/spec
                fi

                log_and_run git fetch spec
            popdir
        fi
    popdir
}

merge_with_spec() {
    local repo=$1
    local branch=$2

    [ "${repo}" == "spec" ] && return

    pushdir repos/${repo}
        # Create and checkout "try-merge" branch.
        if ! git branch | grep try-merge >/dev/null; then
            log_and_run git branch try-merge origin/${branch}
        fi
        log_and_run git checkout try-merge

        # Attempt to merge with spec/master.
        log_and_run git reset origin/${branch} --hard
        try_log_and_run git merge -q spec/master -m "merged"
        if [ $? -ne 0 ]; then
            # Ignore merge conflicts in non-test directories.
            # We don't care about those changes.
            try_log_and_run git checkout --ours ${ignore_dirs}
            try_log_and_run git add ${ignore_dirs}
            try_log_and_run git -c core.editor=true merge --continue
            if [ $? -ne 0 ]; then
                git merge --abort
                popdir
                return 1
            fi
        fi
    popdir
    return 0
}

echo -e "Update repos\n" > commit_message

failed_repos=

for repo in ${repos}; do
    echo "++ updating ${repo}"
    if [ "${repo}" = "simd" -o \
         "${repo}" = "threads" -o \
         "${repo}" = "exception-handling" -o \
         "${repo}" = "memory64" -o \
         "${repo}" = "host-bindings" ]; then
      branch=main
    else
      branch=master
    fi
    update_repo ${repo} ${branch}

    if ! merge_with_spec ${repo} ${branch}; then
        echo -e "!! error merging ${repo}, skipping\n"
        failed_repos="${failed_repos} ${repo}"
        continue
    fi

    if [ "${repo}" = "spec" ]; then
        wast_dir=.
        log_and_run cp $(find repos/${repo}/test/core -name \*.wast) ${wast_dir}
    else
        wast_dir=proposals/${repo}
        mkdir -p ${wast_dir}

        # Don't add tests from proposal that are the same as spec.
        pushdir repos/${repo}
            for new in $(find test/core -name \*.wast); do
                old=../../repos/spec/${new}
                if [[ ! -f ${old} ]] || ! diff ${old} ${new} >/dev/null; then
                    log_and_run cp ${new} ../../${wast_dir}
                fi
            done
        popdir
    fi

    # Check whether any files were removed.
    for old in $(find ${wast_dir} -maxdepth 1 -name \*.wast); do
      new=$(find repos/${repo}/test/core -name ${old##*/})
      if [[ ! -f ${new} ]]; then
          log_and_run git rm ${old}
      fi
    done

    # Check whether any files were updated.
    if [ $(git status -s ${wast_dir} | wc -l) -ne 0 ]; then
        log_and_run git add ${wast_dir}/*.wast

        repo_sha=$(git -C repos/${repo} log --max-count=1 --oneline origin/${branch}| sed -e 's/ .*//')
        echo "  ${repo}:" >> commit_message
        echo "    https://github.com/WebAssembly/${repo}/commit/${repo_sha}" >> commit_message
    fi

    echo -e "-- ${repo}\n"
done

echo "" >> commit_message
echo "This change was automatically generated by \`update-testsuite.sh\`" >> commit_message
git commit -a -F commit_message
# git push

echo "done"

if [ -n "${failed_repos}" ]; then
  echo "!! failed to update repos: ${failed_repos}"
fi

#!/bin/bash
# Update tests based on upstream repositories.
set -e
set -u
set -o pipefail

ignore_dirs='document interpreter test/harness'

repos='
  spec
  threads
  simd
  exception-handling
  gc
  bulk-memory-operations
  tail-call
  host-bindings
  reference-types
  annotations
  function-references
  memory64
'

log_and_run() {
    echo ">>" $*
    if ! $*; then
        echo "sub-command failed: $*"
        exit
    fi
}

try_log_and_run() {
    echo ">>" $*
    $*
}

pushdir() {
    pushd $1 >/dev/null || exit
}

popdir() {
    popd >/dev/null || exit
}

update_repo() {
    local repo=$1
    local branch=$2
    pushdir repos
        if [ -d ${repo} ]; then
            log_and_run git -C ${repo} fetch origin
            log_and_run git -C ${repo} reset origin/${branch} --hard
        else
            log_and_run git clone https://github.com/WebAssembly/${repo}
        fi

        # Add upstream spec as "spec" remote.
        if [ "${repo}" != "spec" ]; then
            pushdir ${repo}
                if ! git remote | grep spec >/dev/null; then
                    log_and_run git remote add spec https://github.com/WebAssembly/spec
                fi

                log_and_run git fetch spec
            popdir
        fi
    popdir
}

merge_with_spec() {
    local repo=$1
    local branch=$2

    [ "${repo}" == "spec" ] && return

    pushdir repos/${repo}
        # Create and checkout "try-merge" branch.
        if ! git branch | grep try-merge >/dev/null; then
            log_and_run git branch try-merge origin/${branch}
        fi
        log_and_run git checkout try-merge

        # Attempt to merge with spec/master.
        log_and_run git reset origin/${branch} --hard
        try_log_and_run git merge -q spec/master -m "merged"
        if [ $? -ne 0 ]; then
            # Ignore merge conflicts in non-test directories.
            # We don't care about those changes.
            try_log_and_run git checkout --ours ${ignore_dirs}
            try_log_and_run git add ${ignore_dirs}
            try_log_and_run git -c core.editor=true merge --continue
            if [ $? -ne 0 ]; then
                git merge --abort
                popdir
                return 1
            fi
        fi
    popdir
    return 0
}

echo -e "Update repos\n" > commit_message

failed_repos=

for repo in ${repos}; do
    echo "++ updating ${repo}"
    if [ "${repo}" = "simd" ]; then
      branch=main
    else
      branch=master
    fi
    update_repo ${repo} ${branch}

    if ! merge_with_spec ${repo} ${branch}; then
        echo -e "!! error merging ${repo}, skipping\n"
        failed_repos="${failed_repos} ${repo}"
        continue
    fi

    if [ "${repo}" = "spec" ]; then
        wast_dir=.
        log_and_run cp $(find repos/${repo}/test/core -name \*.wast) ${wast_dir}
    else
        wast_dir=proposals/${repo}
        mkdir -p ${wast_dir}

        # Don't add tests from proposal that are the same as spec.
        pushdir repos/${repo}
            for new in $(find test/core -name \*.wast); do
                old=../../repos/spec/${new}
                if [[ ! -f ${old} ]] || ! diff ${old} ${new} >/dev/null; then
                    log_and_run cp ${new} ../../${wast_dir}
                fi
            done
        popdir
    fi

    # Check whether any files were removed.
    for old in $(find ${wast_dir} -maxdepth 1 -name \*.wast); do
      new=$(find repos/${repo}/test/core -name ${old##*/})
      if [[ ! -f ${new} ]]; then
          log_and_run git rm ${old}
      fi
    done

    # Check whether any files were updated.
    if [ $(git status -s ${wast_dir} | wc -l) -ne 0 ]; then
        log_and_run git add ${wast_dir}/*.wast

        repo_sha=$(git -C repos/${repo} log --max-count=1 --oneline origin/${branch}| sed -e 's/ .*//')
        echo "  ${repo}:" >> commit_message
        echo "    https://github.com/WebAssembly/${repo}/commit/${repo_sha}" >> commit_message
    fi

    echo -e "-- ${repo}\n"
done

echo "" >> commit_message
echo "This change was automatically generated by \`update-testsuite.sh\`" >> commit_message
git commit -a -F commit_message
# git push

echo "done"

if [ -n "${failed_repos}" ]; then
  echo "!! failed to update repos: ${failed_repos}"
fi


add rpi-backup.sh

add rpi-backup.sh

#!/bin/sh

#mount USB device
# usbmount=/mnt
# mkdir -p $usbmount
# if [ -z $1 ]; then
# 	echo "no argument, assume the mount device is /dev/sda1 ? Y/N"
# 	read key
# 	if [ "$key" = "y" -o "$key" = "Y" ]; then
# 		sudo mount -t vfat -o uid=1000 /dev/sda1 $usbmount
# 	else
# 		echo "$0 [backup dest device name], e.g. $0 /dev/sda1"
# 		exit 0
# 	fi
# else
# 	sudo mount -t vfat -o uid=1000 $1 $usbmount
# fi
# if [ -z "`grep $usbmount /etc/mtab`" ]; then
# 	echo "mount fail, exit now"
# 	exit 0
# fi

usbmount=/home/pi/nas-data

usbmountsz=`df -P $usbmount | grep /dev | awk '{print $4}'`
if [ $usbmountsz -lt 16809984 ]; then
	echo "df -P $usbmount"
	df -P $usbmount
	echo "$usbmount not enough space!!! exit now"
	exit 0
fi

# img=$usbmount/iNovaBear-`date +%Y%m%d-%H%M`.img
img=$usbmount/rpi.img

#install tools
#sudo apt-get -y install dosfstools dump parted kpartx
# sudo apt-get -y install rsync dosfstools parted kpartx

echo ===================== part 1, create a new blank img ===============================
# New img file
# Remove old file
rm -f $img
bootsz=`df -P | grep /boot | awk '{print $2}'`
rootsz=`df -P | grep /dev/root | awk '{print $3}'`
totalsz=`echo $bootsz $rootsz | awk '{print int(($1+$2)*1.3/1024)}'`
sudo dd if=/dev/zero of=$img bs=1M count=$totalsz

# format virtual disk
bootstart=`sudo fdisk -l /dev/mmcblk0 | grep mmcblk0p1 | awk '{print $2}'`
bootend=`sudo fdisk -l /dev/mmcblk0 | grep mmcblk0p1 | awk '{print $3}'`
rootstart=`sudo fdisk -l /dev/mmcblk0 | grep mmcblk0p2 | awk '{print $2}'`
echo "boot: $bootstart >>> $bootend, root: $rootstart >>> end"
#rootend=`sudo fdisk -l /dev/mmcblk0 | grep mmcblk0p2 | awk '{print $3}'`
sudo parted $img --script -- mklabel msdos
sudo parted $img --script -- mkpart primary fat32 ${bootstart}s ${bootend}s
sudo parted $img --script -- mkpart primary ext4 ${rootstart}s -1
loopdevice=`sudo losetup -f --show $img`
device=/dev/mapper/`sudo kpartx -va $loopdevice | sed -E 's/.*(loop[0-9])p.*/\1/g' | head -1`
sleep 5
sudo mkfs.vfat ${device}p1 -n boot
sudo mkfs.ext4 ${device}p2

echo ===================== part 2, fill the data to img =========================
# mount partitions
mountb=$usbmount/backup_boot/
mountr=$usbmount/backup_root/
mkdir -p $mountb $mountr
# backup /boot
sudo mount -t vfat ${device}p1 $mountb
sudo cp -rfp /boot/* $mountb
sync
sudo umount $mountb
echo "...Boot partition done"
# backup /root
sudo mount -t ext4 ${device}p2 $mountr
if [ -f /etc/dphys-swapfile ]; then
        SWAPFILE=`cat /etc/dphys-swapfile | grep ^CONF_SWAPFILE | cut -f 2 -d=`
	if [ "$SWAPFILE" = "" ]; then
		SWAPFILE=/var/swap
	fi
	EXCLUDE_SWAPFILE="--exclude $SWAPFILE"
fi
sudo rsync --force -rltWDEgopt --delete --stats --progress\
	$EXCLUDE_SWAPFILE \
	--exclude '.gvfs' \
	--exclude '/dev' \
        --exclude '/media' \
	--exclude '/mnt' \
	--exclude '/proc' \
        --exclude '/run' \
	--exclude '/sys' \
	--exclude '/tmp' \
        --exclude 'lost\+found' \
	--exclude '$usbmount' \
	// $mountr
# special dirs
for i in dev media mnt proc run sys boot; do
	if [ ! -d $mountr/$i ]; then
		sudo mkdir $mountr/$i
	fi
done
if [ ! -d $mountr/tmp ]; then
	sudo mkdir $mountr/tmp
	sudo chmod a+w $mountr/tmp
fi
sudo rm -f $mountr/etc/udev/rules.d/70-persistent-net.rules

sync
ls -lia $mountr/home/pi/
sudo umount $mountr
echo "...Root partition done"
# if using the dump/restore
# tmp=$usbmount/root.ext4
# sudo chattr +d $img $mountb $mountr $tmp
# sudo mount -t ext4 ${device}p2 $mountr
# cd $mountr
# sudo dump -0uaf - / | sudo restore -rf -
# cd

# umount loop device
sudo kpartx -d $loopdevice
sudo losetup -d $loopdevice
sudo umount $usbmount
rm -rf $mountb $mountr
echo "==== All done. You can un-plug the backup device"

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


remove jenkins stuff from script to chef

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


convenience for use as a separate fcgi app

#!/bin/sh
killall loader.rb
rm /tmp/neotoyz.fcgi
export loc_conf="/var/www/dev/phunkybb/config/config.xml"
spawn-fcgi /var/www/dev/neotoyz/loader.rb -s /tmp/neotoyz.fcgi -P /tmp/neotoyz.pid
chown www-data /tmp/neotoyz.fcgi

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


Create setup_dev_env.sh

Create setup_dev_env.sh

closes #4

error: pathspec 'gnome-16-04/scripts/setup_dev_env.sh' did not match any file(s) known to git


Make auto update less hacky by using date -r

#
# auto-update.sh - check for updates (to anything) regularly
#
# Can be used for things like checking if dotfiles repos have new changes, if
# package managers have updates, renewing credentials, etc.
#
# Author
#   Jake Zimmerman <jake@zimmerman.io>
#
# Usage
#   - Requires my colors.sh to have been sourced already for colorized output
#   - source this file to check if the "system is out of date" (i.e., hasn't
#     been updated in UPDATE_THRESHOLD seconds)
#   - call `update` to run general update checks and checks defined by the
#     system
#     - define a function `update-host` and bind it to the environment before
#       calling update!
#
# Notes
#   This file will only check for updates every time it's sourced. It's meant
#   to be sourced in a bashrc or zshrc so that every time you open a new tab or
#   pane it reminds you if you haven't updated in a while. It neither checks
#   continuously for updates, nor fetches the updates themselves.
#
# TODOs
#   Maybe some day I'll turn this into a fully-configurable file, but for now
#   most things are hard coded.

# Number of seconds to wait before printing a reminder
UPDATE_THRESHOLD="86400"

[ ! -e $HOME/.last_update ] && touch $HOME/.last_update
# Initialize for when we have no GNU date available
last_check=0
time_now=0

# Darwin uses BSD, check for gdate, else use date
if [[ $(uname) = "Darwin" && -n $(which gdate) ]]; then
  last_login=$(gdate -r ~/.last_update +%s)
  time_now=$(gdate +%s)
else
  # Ensure this is GNU grep
  if [ -n "$(date --version 2> /dev/null | grep GNU)" ]; then
    last_login=$(date -r ~/.last_update +%s)
    time_now=$(date +%s)
  fi
fi

time_since_check=$((time_now - last_login))

if [ "$time_since_check" -ge "$UPDATE_THRESHOLD" ]; then
  echo "$cred==>$cwhiteb Your system is out of date!$cnone"
  echo 'Run `update` to bring it up to date.'
fi

# update - fetch updates
# usage:
#   update
#
# You will likely also want to define a function `update-host` for each host
# that you will run `update` from. Ensure that this function is sourced before
# calling `update`.
update() {
  # Record that we've update
  touch $HOME/.last_update

  # --- Host-independent updates ---

  # Update dotfiles repo
  cd ~/.dotfiles/
  echo "$cblueb==>$cwhiteb Updating dotfiles...$cnone"
  git fetch --quiet origin
  if [ "$(git rev-parse HEAD)" != "$(git rev-parse origin/master)" ]; then echo "$credb  --> outdated.$cnone"; fi

  # Update each submodule in the dotfiles repo
  echo "$cblueb==>$cwhiteb Checking for outdated dotfiles submodules...$cnone"
  git submodule foreach --quiet 'git fetch --quiet && if [ "$(git rev-parse HEAD)" != "$(git rev-parse origin/master)" ]; then echo $path; fi'
  cd - &> /dev/null

  # --- Host-dependent updates ---

  update-host
}

#
# auto-update.sh - check for updates (to anything) regularly
#
# Can be used for things like checking if dotfiles repos have new changes, if
# package managers have updates, renewing credentials, etc.
#
# Author
#   Jake Zimmerman <jake@zimmerman.io>
#
# Usage
#   - Requires my colors.sh to have been sourced already for colorized output
#   - source this file to check if the "system is out of date" (i.e., hasn't
#     been updated in UPDATE_THRESHOLD seconds)
#   - call `update` to run general update checks and checks defined by the
#     system
#     - define a function `update-host` and bind it to the environment before
#       calling update!
#
# Notes
#   This file will only check for updates every time it's sourced. It's meant
#   to be sourced in a bashrc or zshrc so that every time you open a new tab or
#   pane it reminds you if you haven't updated in a while. It neither checks
#   continuously for updates, nor fetches the updates themselves.
#
# TODOs
#   Maybe some day I'll turn this into a fully-configurable file, but for now
#   most things are hard coded.

# Number of seconds to wait before printing a reminder
UPDATE_THRESHOLD="86400"

[ ! -e $HOME/.last_update ] && touch $HOME/.last_update
# Initialize for when we have no GNU date available
last_check=0
time_now=0

last_check_string=$(ls -l $HOME/.last_update | awk '{print $6" "$7" "$8}')

# Darwin uses BSD, check for gdate, else use date
if [[ $(uname) = "Darwin" && -n $(which gdate) ]]; then
  last_login=$(gdate -d"$last_check_string" +%s)
  time_now=$(gdate +%s)
else
  # Ensure this is GNU grep
  if [ -n "$(date --version 2> /dev/null | grep GNU)" ]; then
    last_login=$(date -d"$last_check_string" +%s)
    time_now=$(date +%s)
  fi
fi

time_since_check=$((time_now - last_login))

if [ "$time_since_check" -ge 86400 ]; then
  echo "$cred==>$cwhiteb Your system is out of date!$cnone"
  echo 'Run `update` to bring it up to date.'
fi

# update - fetch updates
# usage:
#   update
#
# You will likely also want to define a function `update-host` for each host
# that you will run `update` from. Ensure that this function is sourced before
# calling `update`.
update() {
  # Record that we've update
  touch $HOME/.last_update

  # --- Host-independent updates ---

  # Update dotfiles repo
  cd ~/.dotfiles/
  echo "$cblueb==>$cwhiteb Updating dotfiles...$cnone"
  git fetch --quiet origin
  if [ "$(git rev-parse HEAD)" != "$(git rev-parse origin/master)" ]; then echo "$credb  --> outdated.$cnone"; fi

  # Update each submodule in the dotfiles repo
  echo "$cblueb==>$cwhiteb Checking for outdated dotfiles submodules...$cnone"
  git submodule foreach --quiet 'git fetch --quiet && if [ "$(git rev-parse HEAD)" != "$(git rev-parse origin/master)" ]; then echo $path; fi'
  cd - &> /dev/null

  # --- Host-dependent updates ---

  update-host
}


Create install-cross-qt5.sh

Create install-cross-qt5.sh

#!/bin/bash

VER=2019.1

export RTM_GWAS_VERSION=$VER

PKG=rtm-gwas-$VER-$1

TOP=$(pwd)

rm -rf rtm-gwas-snpldb
git clone https://github.com/njau-sri/rtm-gwas-snpldb.git

rm -rf rtm-gwas-gsc
git clone https://github.com/njau-sri/rtm-gwas-gsc.git

rm -rf rtm-gwas-assoc
git clone https://github.com/njau-sri/rtm-gwas-assoc.git

rm -rf rtm-gwas-gui
git clone https://github.com/njau-sri/rtm-gwas-gui.git

cd $TOP/rtm-gwas-snpldb
chmod +x install-cross.sh
./install-cross.sh $1 || exit 1

cd $TOP/rtm-gwas-gsc
chmod +x install-cross.sh
./install-cross.sh $1 || exit 1

cd $TOP/rtm-gwas-assoc
if [[ $1 == glnx64 ]]; then
    chmod +x install-glnx64-mkl.sh
    ./install-glnx64-mkl.sh $1 || exit 1
else
    chmod +x install-cross-lapack.sh
    ./install-cross-lapack.sh $1 || exit 1
fi

cd $TOP/rtm-gwas-gui
chmod +x install-cross-qt5.sh
./install-cross-qt5.sh $1 || exit 1

cd $TOP
rm -rf $PKG
mkdir $PKG

cp $TOP/rtm-gwas-snpldb/$1/rtm-gwas-snpldb* $PKG/
cp $TOP/rtm-gwas-gsc/$1/rtm-gwas-gsc* $PKG/
cp $TOP/rtm-gwas-assoc/$1/rtm-gwas-assoc* $PKG/

if [[ $1 == glnx64 ]]; then
    cp $TOP/rtm-gwas-gui/$1/rtm-gwas-gui $PKG/
    tar zcf $PKG.tar.gz $PKG
else
    cp -r $TOP/rtm-gwas-gui/$1/* $PKG/
    zip -qr $PKG.zip $PKG
fi

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


add installer

add installer

#!/bin/bash

echo 'MF templates installer'

MF_TEMPLATES_VER='MF templates v0.0.1'
SCRIPT_DIR=$(dirname $0)

MF_TEMPLATES_DST_DIR='MF Templates v0.1'

force=

usage(){
cat << EOF
usage: $0 [options]

Install / update templates for ${MF_TEMPLATES_VER}

OPTIONS:
-f	force overwrite if directories exist
-h	this help
EOF
}

while getopts "fhu" OPTION; do
case "$OPTION" in
f)
force=1
;;
h)
usage
exit 0
;;
u)
;;
esac
done

# Make sure root is not executed
if [[ "$(id -u)" == "0" ]]; then
echo ""
echo "Error: Do not run this script as root." 1>&2
echo ""
echo "'root' is no longer supported" 1>&2
echo ""
echo "RECOMMENDED WAY:" 1>&2
echo " $0 -f" 1>&2
echo ""
#exit 1
fi

copy_files(){
SRC_DIR="${SCRIPT_DIR}/${1}"
rsync -r --exclude=.svn "$SRC_DIR" "$2"
}

check_dst_dir(){
if [[ -d $DST_DIR ]];  then
	if [[ $force ]]; then
		echo "removing old libraries: ${DST_DIR}"
		rm -rf "$DST_DIR"
	else
		echo "templates already installed. To force a re-install use the '-f' parameter"
		exit 1
fi
fi

echo ...creating destination directory: $DST_DIR
mkdir -p "$DST_DIR"
}

copy_mf_templates_files(){
echo ...copying MF templates files
copy_files "File Templates" "$LIBS_DIR"
}

print_template_banner(){
echo ''
echo ''
echo ''
echo "$1"
echo '----------------------------------------------------'
echo ''
}

# Xcode4 templates
copy_xcode4_project_templates(){
TEMPLATE_DIR="$HOME/Library/Developer/Xcode/Templates/$MF_TEMPLATES_DST_DIR/"

print_template_banner "Installing MF templates"

DST_DIR="$TEMPLATE_DIR"
check_dst_dir

LIBS_DIR="$DST_DIR"
mkdir -p "$LIBS_DIR"
copy_mf_templates_files

echo ...copying template files
copy_files "Project Templates/MF-Xcode-Templates" "$DST_DIR"

# Move File Templates to correct position
DST_DIR="$HOME/Library/Developer/Xcode/Templates/File Templates/$MF_TEMPLATES_DST_DIR/"
OLD_DIR="$HOME/Library/Developer/Xcode/Templates/$MF_TEMPLATES_DST_DIR/"

check_dst_dir

echo done!
}

# copy Xcode4 templates
copy_xcode4_project_templates

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


Added install webserver file to configure environment

#!/bin/bash

sudo apt-get update -y
sudo apt-get install -y apache2

echo "Hello! I am Thanusha Chandrahasa. Course:ITMO544-444, Week05Assignment" > /tmp/hello.txt

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


"nice" the Zimbra processes

"nice" the Zimbra processes

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


[utils] local-test

[utils] local-test

#!/bin/bash
# Copyright (c) 2016-2017, rryqszq4 <ngxphp@gmail.com>
NGX_PATH='/usr/local/nginx_php_dev/sbin'
ls ${NGX_PATH}
${NGX_PATH}/nginx -V
export PATH=${NGX_PATH}:$PATH
prove -r -p t
if [ $? -eq 0 ];then
    echo $?;
else
    echo $?;
fi

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


stylecheck warnings for potentially dangerous calls added (fixes #32)

#! /bin/bash

T=$(mktemp dzbXXX)

function _check() {
    # usage:
    #   _check <regex> <text>
    egrep -n --include=*.[ch] "$1" src/* > $T
    if [ "$?" -eq "0" ]; then
            echo "$2"
            cut -f1,2 -d: < $T
    fi
    rm -f $T
}

function _warncheck() {
    _check "$1" "!! There are $2:"
}

function _warnfncheck() {
    _check "$1\\(" "!! Use $2 instead of $1 here:"
}

_warncheck '.{80,}' '80+ chars lines'
_warncheck ' +$'    'trailing spaces'
_warncheck '//'     'C99-style comments'

_warnfncheck 'sprintf'    'snprintf'
_warnfncheck 'strcmp'     'strncmp'
_warnfncheck 'strcasecmp' 'strncasecmp'
_warnfncheck 'atoi'       'strtol'

#! /bin/bash

T=$(mktemp dzbXXX)

function _check() {
    # usage:
    #   _check <regex> <text>
    egrep -n --include=.*\.[ch]$ "$1" src/* > $T
    if [ "$?" -eq "0" ]; then
            echo "$2"
            cut -f1,2 -d: < $T
    fi
}

function _warncheck() {
    _check "$1" "!! There are $2:"
}

_warncheck '.{80,}' '80+ chars lines'
_warncheck ' +$'    'trailing spaces'
_warncheck '//'     'C99-style comments'

#rm -f $T;


Added machine learning packages

Added machine learning packages

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/PrabhanshuAttri/dev-files.git/'


vagrant: fixed solr config

vagrant: fixed solr config

#!/bin/sh

sudo cp -R /var/www/dist/solr/* /etc/solr/conf/
sudo service tomcat6 restart
mkdir /var/www/src/public/assets
rm /var/www/src/data/* -rf
chown www-data:www-data /var/www/* -R
chmod 777 /var/www/* -R
# sudo su - www-data -c "(cd /var/www/src/assets;npm cache clean)"
# sudo su - www-data -c "(cd /var/www/src/assets;npm install)"
sudo su - www-data -c "(cd /var/www/src/assets;npm update)"
# sudo su - www-data -c "(cd /var/www/src/assets;bower cache clean)"
sudo su - www-data -c "(cd /var/www/src/assets;bower --config.analytics=false update)"
sudo su - www-data -c "pm2 start /var/www/src/assets/node_modules/athene2-editor/server/server.js"
sudo su - www-data -c "(cd /var/www/;COMPOSER_PROCESS_TIMEOUT=5600 php composer.phar install -o)"
sudo su - www-data -c "(cd /var/www/;COMPOSER_PROCESS_TIMEOUT=5600 php composer.phar update -o)"
# sudo su - www-data -c "grunt dev &"

#!/bin/sh

mkdir /var/www/src/public/assets
rm /var/www/src/data/* -rf
chown www-data:www-data /var/www/* -R
chmod 777 /var/www/* -R
# sudo su - www-data -c "(cd /var/www/src/assets;npm cache clean)"
# sudo su - www-data -c "(cd /var/www/src/assets;npm install)"
sudo su - www-data -c "(cd /var/www/src/assets;npm update)"
# sudo su - www-data -c "(cd /var/www/src/assets;bower cache clean)"
sudo su - www-data -c "(cd /var/www/src/assets;bower --config.analytics=false update)"
sudo su - www-data -c "pm2 start /var/www/src/assets/node_modules/athene2-editor/server/server.js"
sudo su - www-data -c "(cd /var/www/;COMPOSER_PROCESS_TIMEOUT=5600 php composer.phar install -o)"
sudo su - www-data -c "(cd /var/www/;COMPOSER_PROCESS_TIMEOUT=5600 php composer.phar update -o)"
# sudo su - www-data -c "grunt dev &"


Upgrade kernel to 4.11.6

Upgrade kernel to 4.11.6


Add git aliases.

Add git aliases.

alias g='git'
alias gf='git flow'
alias gap='git add -p'
alias gst='git status'

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


Create install-etcd.sh

Create install-etcd.sh

#!/bin/bash

mkdir /tmp/etcd
wget -q https://github.com/coreos/etcd/releases/download/v0.4.4/etcd-v0.4.4-linux-amd64.tar.gz && tar -xvf etcd-v0.4.4-linux-amd64.tar.gz -C /tmp/etcd
mv /tmp/etcd/etcd-v0.4.4-linux-amd64/etcd /usr/bin && mv /tmp/etcd/etcd-v0.4.4-linux-amd64/etcdctl /usr/bin

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


deploy gh-pages script is added

deploy gh-pages script is added

#!/bin/bash

version=$1

cd docs
if [ -d "api/"$version ]; then rm -Rf api/$version; fi
doxygen Doxyfile
cd ..
git add .
git commit –m “documentation is generated for ”$version
git push

git checkout gh-pages
rm -r docs/api/$version/*
git checkout master — docs/api/$version
git add .
git commit “documentation is updated to ”$version
git push
git checkout master

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


Add acceptance tests WIP

Add acceptance tests WIP

This patchs add acceptance tests using [bats]
(https://github.com/sstephenson/bats).

The tests are based on the scenarios described
in the [wiki](https://github.com/redhat-nfvpe/koko/wiki/Examples)

You only need to install bats and run it in the same folder as the
`koko` binary.

```sh
$ bats tests/acceptance.bats

 ✓ Docker .. Docker
 ✓ netns .. netns
 - Docker .. netns (skipped)
 - Docker .. Docker (VXLAN) (skipped)
 - netns .. netns (VXLAN) (skipped)
 - Docker .. netns (VXLAN) (skipped)
 - Docker .. VLAN (skipped)
 - netns .. VLAN (skipped)
 - Docker .. macvlan (skipped)
 - Docker .. Docker (Mirroring) (skipped)
 - Docker .. VXLAN (Mirroring) (skipped)

11 tests, 0 failures, 9 skipped
```

Signed-off-by: aojea <b2c7061d039a233d9cce0b30fa4bdfb51dbe12e8@gmail.com>

#!/usr/bin/env bats

setup() {
# Create dockers and namespaces
    DOCKER1="$(docker run --rm -d -it alpine sh)"
    DOCKER2="$(docker run --rm -d -it alpine sh)"
    sudo ip netns add NS1
    sudo ip netns add NS2
}

teardown() {
# Delete dockers and namespaces
    docker rm -f $DOCKER1
    docker rm -f $DOCKER2
    sudo ip netns del NS1
    sudo ip netns del NS2
}

@test "Docker .. Docker" {
      sudo ./koko -d $DOCKER1,vethD1D2,10.10.10.1/29 \
             -d $DOCKER2,vethD2D1,10.10.10.2/29
      run docker exec $DOCKER1 ping -c 3 -w 5 10.10.10.2
      [ "$status" -eq 0 ]
}

@test "netns .. netns" {
      sudo ./koko -n NS1,vethNS1NS2,10.10.10.1/29 \
                  -n NS2,vethNS2NS1,10.10.10.2/29
      run sudo ip netns exec NS1 ping -c 3 -w 5 10.10.10.2
      [ "$status" -eq 0 ]
}

@test "Docker .. netns" {
      skip
      echo "TODO"
}

@test "Docker .. Docker (VXLAN)" {
      skip
      echo "TODO"
}

@test "netns .. netns (VXLAN)" {
      skip
      echo "TODO"
}

@test "Docker .. netns (VXLAN)" {
      skip
      echo "TODO"
}

@test "Docker .. VLAN" {
      skip
      echo "TODO"
}

@test "netns .. VLAN" {
      skip
      echo "TODO"
}

@test "Docker .. macvlan" {
      skip
      echo "TODO"
}

@test "Docker .. Docker (Mirroring)" {
      skip
      echo "TODO"
}

@test "Docker .. VXLAN (Mirroring)" {
      skip
      echo "TODO"
}

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


First attempt at creating VirtualBox .VDI image

#!/bin/bash

# Convert kernel/rootfs images generated by build-yocto-qemux86
# into a .VDI image suitable to be executed from VirtualBox

# BIG FAT WARNING
# A few dangerous commands are executed as sudo and may destroy your host filesystem if buggy.
# USE AT YOUR OWN RISK - YOU HAVE BEEN WARNED!!!

TOPDIR=$PWD/tmp/build-gemini-5.0.0-qemux86

MACHINE=qemux86
FSTYPE=tar.bz2
KERNEL=$TOPDIR/tmp/deploy/images/$MACHINE/bzImage-$MACHINE.bin
ROOTFS=$TOPDIR/tmp/deploy/images/$MACHINE/gemini-image-$MACHINE.$FSTYPE

RAW_IMAGE=test.raw
VDI_IMAGE=test.vdi

MNT_ROOTFS=/tmp/rootfs

set -e
set -x

# Create QEMU image
# See http://en.wikibooks.org/wiki/QEMU/Images

qemu-img create -f raw $RAW_IMAGE 256M

# TODO: Also need to make part1 bootable?

fdisk $RAW_IMAGE <<END
n
p
1

w
END

#sfdisk -l $RAW_IMAGE

#fdisk -l $RAW_IMAGE
# ==> Partition 1 starts at sector 2048

# See http://stackoverflow.com/questions/1419489/loopback-mounting-individual-partitions-from-within-a-file-that-contains-a-parti
sudo kpartx -v -a $RAW_IMAGE | tee kpartx.tmp

# loop0p1
ROOTPART=`cut -d' ' -f3 kpartx.tmp`
echo "DBG: ROOTPART=$ROOTPART"

sudo mkfs -t ext3 /dev/mapper/$ROOTPART

mkdir -p $MNT_ROOTFS
sudo mount -o loop /dev/mapper/$ROOTPART $MNT_ROOTFS

sudo tar xvfj $ROOTFS -C $MNT_ROOTFS

# TODO: Should copy /boot/grub.conf to MNT_ROOTFS
# TODO: Grub install on /dev/mapper/$ROOTPART

sudo umount $MNT_ROOTFS

sudo kpartx -d $RAW_IMAGE

qemu-img convert -f raw -O vdi $RAW_IMAGE $VDI_IMAGE

# TODO: Test: Run QEMU against VDI_IMAGE
# TODO: Test: Run VirtualBox against VDI_IMAGE

#sudo losetup -a

# See also: http://libguestfs.org/

exit 0;

# EOF

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


sorting + python

sorting + python

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


Use --assume-unchanged version.go

Use --assume-unchanged version.go

#! /bin/sh

VERSION=$(git describe --tags --abbrev=0)

cat > version.go <<EOF
package main

var Version string = "$VERSION"
EOF

# Dear git, please don't bother us with changes to this file.
git update-index --assume-unchanged version.go


Better start.sh errors on Mac OS X

Better start.sh errors on Mac OS X

Signed-off-by: Jeffrey Morgan <ed44c26e472545c167e88c1767e26e2a8b36f912@gmail.com>

#!/bin/bash

VM=default
DOCKER_MACHINE=/usr/local/bin/docker-machine
VBOXMANAGE=/Applications/VirtualBox.app/Contents/MacOS/VBoxManage

BLUE='\033[0;34m'
GREEN='\033[0;32m'
NC='\033[0m'

unset DYLD_LIBRARY_PATH
unset LD_LIBRARY_PATH

clear

if [ ! -f "${DOCKER_MACHINE}" ]; then
  echo "Docker Machine is not installed. Please re-run the Toolbox Installer and try again."
  exit 1
fi

if [ ! -f "${VBOXMANAGE}" ]; then
  echo "VirtualBox is not installed. Please re-run the Toolbox Installer and try again."
  exit 1
fi

"${VBOXMANAGE}" list vms | grep \""${VM}"\" &> /dev/null
VM_EXISTS_CODE=$?

if [ $VM_EXISTS_CODE -eq 1 ]; then
  "${DOCKER_MACHINE}" rm -f "${VM}" &> /dev/null
  rm -rf ~/.docker/machine/machines/"${VM}"
  "${DOCKER_MACHINE}" create -d virtualbox --virtualbox-memory 2048 --virtualbox-disk-size 204800 "${VM}"
fi

VM_STATUS="$(${DOCKER_MACHINE} status ${VM} 2>&1)"
if [ "${VM_STATUS}" != "Running" ]; then
  "${DOCKER_MACHINE}" start "${VM}"
  yes | "${DOCKER_MACHINE}" regenerate-certs "${VM}"
fi

eval "$(${DOCKER_MACHINE} env --shell=bash ${VM})"

clear
cat << EOF

                        ##         .
                  ## ## ##        ==
               ## ## ## ## ##    ===
           /"""""""""""""""""\___/ ===
      ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
           \______ o           __/
             \    \         __/
              \____\_______/

EOF
echo -e "${BLUE}docker${NC} is configured to use the ${GREEN}${VM}${NC} machine with IP ${GREEN}$(${DOCKER_MACHINE} ip ${VM})${NC}"
echo "For help getting started, check out the docs at https://docs.docker.com"
echo

USER_SHELL="$(dscl /Search -read /Users/${USER} UserShell | awk '{print $2}' | head -n 1)"
if [[ "${USER_SHELL}" == *"/bash"* ]] || [[ "${USER_SHELL}" == *"/zsh"* ]] || [[ "${USER_SHELL}" == *"/sh"* ]]; then
  "${USER_SHELL}" --login
else
  "${USER_SHELL}"
fi

#!/bin/bash

VM=default
DOCKER_MACHINE=/usr/local/bin/docker-machine
VBOXMANAGE=/Applications/VirtualBox.app/Contents/MacOS/VBoxManage

BLUE='\033[0;34m'
GREEN='\033[0;32m'
NC='\033[0m'

unset DYLD_LIBRARY_PATH
unset LD_LIBRARY_PATH

clear

if [ ! -f "${DOCKER_MACHINE}" ] || [ ! -f "${VBOXMANAGE}" ]; then
  echo "Either VirtualBox or Docker Machine are not installed. Please re-run the Toolbox Installer and try again."
  exit 1
fi

"${VBOXMANAGE}" list vms | grep \""${VM}"\" &> /dev/null
VM_EXISTS_CODE=$?

if [ $VM_EXISTS_CODE -eq 1 ]; then
  "${DOCKER_MACHINE}" rm -f "${VM}" &> /dev/null
  rm -rf ~/.docker/machine/machines/"${VM}"
  "${DOCKER_MACHINE}" create -d virtualbox --virtualbox-memory 2048 --virtualbox-disk-size 204800 "${VM}"
fi

VM_STATUS="$(${DOCKER_MACHINE} status ${VM} 2>&1)"
if [ "${VM_STATUS}" != "Running" ]; then
  "${DOCKER_MACHINE}" start "${VM}"
  yes | "${DOCKER_MACHINE}" regenerate-certs "${VM}"
fi

eval "$(${DOCKER_MACHINE} env --shell=bash ${VM})"

clear
cat << EOF

                        ##         .
                  ## ## ##        ==
               ## ## ## ## ##    ===
           /"""""""""""""""""\___/ ===
      ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
           \______ o           __/
             \    \         __/
              \____\_______/

EOF
echo -e "${BLUE}docker${NC} is configured to use the ${GREEN}${VM}${NC} machine with IP ${GREEN}$(${DOCKER_MACHINE} ip ${VM})${NC}"
echo "For help getting started, check out the docs at https://docs.docker.com"
echo

USER_SHELL="$(dscl /Search -read /Users/${USER} UserShell | awk '{print $2}' | head -n 1)"
if [[ "${USER_SHELL}" == *"/bash"* ]] || [[ "${USER_SHELL}" == *"/zsh"* ]] || [[ "${USER_SHELL}" == *"/sh"* ]]; then
  "${USER_SHELL}" --login
else
  "${USER_SHELL}"
fi


added script that brings in the .git directory to the localized project folder

#!/bin/sh
\cp -pRf /home/bgstack15/ansible.clean/.git /etc/ansible

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


Add testcase for a failed create

Add testcase for a failed create

#!/bin/bash
#
set -euo pipefail

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

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

tag=$1

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

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

echo "Test $TEST_DIR $tag"
container_name='test_'$(echo "$tag" | tr ':/-' '_')
echo "Cleaning up left-over containers from previous runs"
container_cleanup "$container_name"
echo "Running $container_name"
if docker run --name "$container_name" "$tag" solr-create -c 'bad/core?name:here'; then
  echo "Bad core creation did not return a failure"
  exit 1
fi

container_cleanup "$container_name"

echo "Test $TEST_DIR $tag succeeded"

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


kubernetes: Add boot.sh options to preserve state dir and to set MAC

Not having to redo the kubeadm-init.sh step massively speeds up the test/dev
cycle. Having the same MAC (and hence same IP) is useful there too since you
don't need to figure out the mac on each boot.

Signed-off-by: Ian Campbell <a8db091655a7f47ecb9c39a2d278e9662e440dc0@docker.com>

#!/bin/sh

set -e

: ${KUBE_MASTER_VCPUS:=2}
: ${KUBE_MASTER_MEM:=1024}
: ${KUBE_MASTER_DISK:=4G}

: ${KUBE_NODE_VCPUS:=2}
: ${KUBE_NODE_MEM:=4096}
: ${KUBE_NODE_DISK:=8G}

: ${KUBE_NETWORKING:=default}
: ${KUBE_RUN_ARGS:=}
: ${KUBE_EFI:=}
: ${KUBE_MAC:=}
: ${KUBE_PRESERVE_STATE:=}

[ "$(uname -s)" = "Darwin" ] && KUBE_EFI=1

suffix=".iso"
[ -n "${KUBE_EFI}" ] && suffix="-efi.iso" && uefi="--uefi"

if [ $# -eq 0 ] ; then
    img="kube-master"
    data=""
    state="kube-master-state"

    : ${KUBE_VCPUS:=$KUBE_MASTER_VCPUS}
    : ${KUBE_MEM:=$KUBE_MASTER_MEM}
    : ${KUBE_DISK:=$KUBE_MASTER_DISK}
elif [ $# -gt 1 ] || [ $# -eq 1 -a -n "${KUBE_PRESERVE_STATE}" ] ; then
    case $1 in
	''|*[!0-9]*)
	    echo "Node number must be a number"
	    exit 1
	    ;;
	0)
	    echo "Node number must be greater than 0"
	    exit 1
	    ;;
	*) ;;
    esac
    img="kube-node"
    name="node-${1}"
    shift
    data="${*}"
    state="kube-${name}-state"

    : ${KUBE_VCPUS:=$KUBE_NODE_VCPUS}
    : ${KUBE_MEM:=$KUBE_NODE_MEM}
    : ${KUBE_DISK:=$KUBE_NODE_DISK}
else
    echo "Usage:"
    echo " - Boot master:"
    echo "   ${0}"
    echo " - Boot node:"
    echo "   ${0} <node> <join_args>"
    exit 1
fi
set -x
if [ -z "${KUBE_PRESERVE_STATE}" ] ; then
    rm -rf "${state}"
    mkdir "${state}"
    if [ -n "${KUBE_MAC}" ] ; then
	echo -n "${KUBE_MAC}" > "${state}"/mac-addr
    fi
fi
linuxkit run ${KUBE_RUN_ARGS} -networking ${KUBE_NETWORKING} -cpus ${KUBE_VCPUS} -mem ${KUBE_MEM} -state "${state}" -disk size=${KUBE_DISK} -data "${data}" ${uefi} "${img}${suffix}"

#!/bin/sh

set -e

: ${KUBE_MASTER_VCPUS:=2}
: ${KUBE_MASTER_MEM:=1024}
: ${KUBE_MASTER_DISK:=4G}

: ${KUBE_NODE_VCPUS:=2}
: ${KUBE_NODE_MEM:=4096}
: ${KUBE_NODE_DISK:=8G}

: ${KUBE_NETWORKING:=default}
: ${KUBE_RUN_ARGS:=}
: ${KUBE_EFI:=}

[ "$(uname -s)" = "Darwin" ] && KUBE_EFI=1

suffix=".iso"
[ -n "${KUBE_EFI}" ] && suffix="-efi.iso" && uefi="--uefi"

if [ $# -eq 0 ] ; then
    img="kube-master"
    data=""
    state="kube-master-state"

    : ${KUBE_VCPUS:=$KUBE_MASTER_VCPUS}
    : ${KUBE_MEM:=$KUBE_MASTER_MEM}
    : ${KUBE_DISK:=$KUBE_MASTER_DISK}
elif [ $# -gt 1 ] ; then
    case $1 in
	''|*[!0-9]*)
	    echo "Node number must be a number"
	    exit 1
	    ;;
	0)
	    echo "Node number must be greater than 0"
	    exit 1
	    ;;
	*) ;;
    esac
    img="kube-node"
    name="node-${1}"
    shift
    data="${*}"
    state="kube-${name}-state"

    : ${KUBE_VCPUS:=$KUBE_NODE_VCPUS}
    : ${KUBE_MEM:=$KUBE_NODE_MEM}
    : ${KUBE_DISK:=$KUBE_NODE_DISK}
else
    echo "Usage:"
    echo " - Boot master:"
    echo "   ${0}"
    echo " - Boot node:"
    echo "   ${0} <node> <join_args>"
    exit 1
fi
set -x
rm -rf "${state}"
linuxkit run ${KUBE_RUN_ARGS} -networking ${KUBE_NETWORKING} -cpus ${KUBE_VCPUS} -mem ${KUBE_MEM} -state "${state}" -disk size=${KUBE_DISK} -data "${data}" ${uefi} "${img}${suffix}"


first commit

first commit

#!/bin/bash
# !!! IN PROGRESS !!!
# Script to save and purge docker container.
#
# TODO:
#  * purge archives
#  * save dir as parameter
#  * keep duration as parameter
#  * cleanup, comments and refactoring
#  * other stuff
#

# GZip compression between 1 (fastest) and 9 (best) - default: 6
[[ $1 =~ ^[1-9]$ ]] && COMPRESSION="$1" || COMPRESSION="6"

function generic_image_name()
{
	echo $(echo $1 | cut -d' ' -f1 | cut -d'.' -f2,3)
}

function format_date()
{
	echo ${1:0:4}-${1:4:2}-${1:6:2} ${1:8:2}:${1:10:2}
}

DATE=`date '+%Y%m%d%H%M'`
LOG=${DIRSAVE}/log/${DATE}.log

running_containers=`docker ps`
containers_id=($(echo "$running_containers" | awk 'NR>1 {print $1}'))
containers_image=($(echo "$running_containers" | awk 'NR>1 {print $2}'))

for image_name in ${containers_image[@]}
do
	image_name_formatted=`sed 's#/\|:#_#g' <<< "$image_name"`
	containers_image_formatted=("${containers_image_formatted[@]}" $image_name_formatted)
	echo "Image name $image_name formatted to $image_name_formatted."
done

for i in $(seq 0 $((${#containers_id[@]}-1)))
do
	new_image=save.${containers_image_formatted[$i]}.${containers_id[$i]}.$DATE
	tar_file=$DATE.${containers_image_formatted[$i]}.${containers_id[$i]}.tar
	echo "Docker commit container ID ${containers_id[$i]} to $new_image"
	docker commit -p ${containers_id[$i]} $new_image
	echo "Saving new image to $tar_file"
	docker save -o /save/$tar_file $new_image
	echo "Compressing TAR file with GZip (compression $COMPRESSION): $tar_file.gz"
	gzip -$COMPRESSION /save/$tar_file
done

docker_images=`docker images`
saved_images=($(echo "$docker_images" | awk 'NR>1 {if($1 ~ /^save\..+\.[0-9a-f]+\.[0-9]+$/) print $1 "." $3}'))
# echo "${saved_images[@]}"
# echo ${#saved_images[@]}

# Do not purge when there is only one backup
for ((i = 0; i < ${#saved_images[@]}; i++))
do
	names=("${names[@]}" "$(generic_image_name ${saved_images[$i]})")
done

single_images=($(printf '%s\n' "${names[@]}" | sort | uniq -u))

for ((i = 0; i < ${#saved_images[@]}; i++))
do
	image=$(generic_image_name ${saved_images[$i]})
	if [[ ! "${single_images[@]}" =~ "$image" ]]; then
		purgeable_images_tmp=("${purgeable_images_tmp[@]}" "${saved_images[$i]}")
		purgeable_images_generic_tmp=("${purgeable_images_generic_tmp[@]}" "$image")
	fi
done

purgeable_images_generic=($(printf '%s\n' "${purgeable_images_generic_tmp[@]}" | sort | uniq))
purgeable_images=($(printf '%s\n' "${purgeable_images_tmp[@]}" | sort))

for ((i = 0; i < ${#purgeable_images_generic[@]}; i++))
do
	for ((j = 0; j < ${#purgeable_images[@]}; j++))
	do
		if [[ ${purgeable_images[$j]} == save.${purgeable_images_generic[$i]}* ]]; then
			save_date=$(format_date $(cut -d'.' -f4 <<< "${purgeable_images[$j]}"))

			# > 0 means newer
			date_diff=$(( $(date --date="$save_date" +%s) - $(date --date="30 days ago" +%s) ))
			# TMP DEV
			# if [[ date_diff < 0 ]]; then
			if [[ date_diff > 0 ]]; then
				to_purge=("${to_purge[@]}" ${purgeable_images[$j]})
			fi
		fi
	done
done

printf '%s\n' "${to_purge[@]}"
for (( i = 0; i < ${#to_purge[@]}; i++ )); do
	image_id=$(cut -d. -f5 <<< ${to_purge[$i]})
	docker rmi $image_id
done

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


Delete group_vars.sh

Delete group_vars.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/lukasondrejka/ansible-ubuntu.git/'


emacs plugin: use full application path

emacs plugin: use full application path

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


Added basic deploy script for the cloudlets.

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


Create shell_stone_switch.sh

Create shell_stone_switch.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/jerry-0824/017_stone.git/'


update squash tool version

update squash tool version

#!/bin/bash -e
# $1 - Specifies distribution - RHEL7/CentOS7
# $2 - Specifies PHP version - 5.5
# TEST_MODE - If set, build a candidate image and test it
OS=$1
VERSION=$2

# Array of all versions of PHP
declare -a VERSIONS=(5.5)

function squash {
  # install the docker layer squashing tool
  easy_install --user docker-scripts==0.3.3
  base=$(awk '/^FROM/{print $2}' Dockerfile)
  $HOME/.local/bin/docker-scripts squash -f $base ${IMAGE_NAME}
}

# TODO: Remove this hack once Docker 1.5 is in use,
# which supports building of named Dockerfiles.
function docker_build {
  TAG=$1
  DOCKERFILE=$2

  if [ -n "$DOCKERFILE" -a "$DOCKERFILE" != "Dockerfile" ]; then
    # Swap Dockerfiles and setup a trap restoring them
    mv Dockerfile Dockerfile.centos7
    mv "${DOCKERFILE}" Dockerfile
    trap "mv Dockerfile ${DOCKERFILE} && mv Dockerfile.centos7 Dockerfile" ERR RETURN
  fi

  docker build -t ${TAG} . && trap - ERR
  squash
}

if [ -z ${VERSION} ]; then
  # Build all versions
  dirs=${VERSIONS}
else
  # Build only specified version of PHP
  dirs=${VERSION}
fi

for dir in ${dirs[@]}; do
  IMAGE_NAME=openshift/php-${dir//./}-${OS}
  if [ -v TEST_MODE ]; then
    IMAGE_NAME="${IMAGE_NAME}-candidate"
  fi
  echo ">>>> Building ${IMAGE_NAME}"

  pushd ${dir} > /dev/null

  if [ "$OS" == "rhel7" ]; then
    docker_build ${IMAGE_NAME} Dockerfile.rhel7
  else
    docker_build ${IMAGE_NAME}
  fi

  if [ -v TEST_MODE ]; then
    IMAGE_NAME=${IMAGE_NAME} test/run
  fi

  popd > /dev/null
done

#!/bin/bash -e
# $1 - Specifies distribution - RHEL7/CentOS7
# $2 - Specifies PHP version - 5.5
# TEST_MODE - If set, build a candidate image and test it
OS=$1
VERSION=$2

# Array of all versions of PHP
declare -a VERSIONS=(5.5)

# TODO: Remove this hack once Docker 1.5 is in use,
# which supports building of named Dockerfiles.
function docker_build {
  TAG=$1
  DOCKERFILE=$2

  if [ -n "$DOCKERFILE" -a "$DOCKERFILE" != "Dockerfile" ]; then
    # Swap Dockerfiles and setup a trap restoring them
    mv Dockerfile Dockerfile.centos7
    mv "${DOCKERFILE}" Dockerfile
    trap "mv Dockerfile ${DOCKERFILE} && mv Dockerfile.centos7 Dockerfile" ERR RETURN
  fi

  docker build -t ${TAG} . && trap - ERR
}

if [ -z ${VERSION} ]; then
  # Build all versions
  dirs=${VERSIONS}
else
  # Build only specified version of PHP
  dirs=${VERSION}
fi

for dir in ${dirs[@]}; do
  IMAGE_NAME=openshift/php-${dir//./}-${OS}
  if [ -v TEST_MODE ]; then
    IMAGE_NAME="${IMAGE_NAME}-candidate"
  fi
  echo ">>>> Building ${IMAGE_NAME}"

  pushd ${dir} > /dev/null

  if [ "$OS" == "rhel7" ]; then
    docker_build ${IMAGE_NAME} Dockerfile.rhel7
  else
    docker_build ${IMAGE_NAME}
  fi

  if [ -v TEST_MODE ]; then
    IMAGE_NAME=${IMAGE_NAME} test/run
  fi

  popd > /dev/null
done


Add Debian haxing script

Add Debian haxing script

#!/bin/bash
set -e
fpm -s python \
    -t deb \
    --python-bin python3 \
    --python-package-name-prefix python3 \
    -a all \
    -m "Alistair Lynn <alistair@thread.com>" \
    --deb-compression xz \
    --deb-suggests python3-etcd \
    --deb-suggests python3-sqlalchemy \
    --deb-suggests python3-psycopg2 \
    -d python3 \
    --force \
    jacquard-split

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


[OpenMP]: bugfix linux install

[OpenMP]: bugfix linux install

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


@kim @adam adds script for installing nvm/node/packages

if [ ! -f ~/.nvm/nvm.sh ]; then
    curl https://raw.githubusercontent.com/creationix/nvm/v0.23.0/install.sh | bash
fi

source ~/.nvm/nvm.sh
nvm install
nvm use
npm install

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


Involve Jenkins

Involve Jenkins

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


Renamed docs build script

Renamed docs build script

JODOC_PATH=/development/projects/github/sidelab/joDoc
JODOC_DEPS_PATH=/development/tools/perl

perl $JODOC_PATH/joDoc \
     --output dist/docs \
     --markdown $JODOC_DEPS_PATH/Markdown.pl \
     --smartypants $JODOC_DEPS_PATH/SmartyPants.pl \
     --title "Tile5 API Documentation" \
     --template docs/html/template.html \
     docs/ src/js

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


Adding AWS with ELB script

Adding AWS with ELB script

#!/bin/bash
#
# concrete5 Installation Shell to AWS with ELB (Alpha):
# ----------
# Version 0.1a
# By katzueno

# INSTRUCTION:
# ----------
# https://github.com/katzueno/concrete5-install-shell-scripts

# USE IT AT YOUR OWN RISK!

# VARIABLES
# ----------

ADMIN_EMAIL="concrete5@example.com"
ADMIN_PASS="t4wbSIDuQgfy"
SITE_NAME="concrete5 Demo"
SAMPLE_DATA="elemental_full"
CONCRETE5_DOWNLOAD="http://www.concrete5.org/download_file/-/view/85780/"
CONCRETE5_VERSION="concrete5.7.5.6"
MYSQL_USER="concrete5"
MYSQL_PASS="concrete5"
MYSQL_SERVER="127.0.0.1"
MYSQL_DATABASE="c9"
DESTINATION="/vaw/www/html"
CONCRETE_PHP_RAW="https://raw.githubusercontent.com/katzueno/cloud9-concrete5-install-script/master/config/cloud9.concrete.php"
# INSTALL_PHPMYADMIN="yes"

# STARTS HERE
# ----------

cd ${DESTINATION}
wget ${CONCRETE5_DOWNLOAD} -O concrete5.zip
unzip concrete5.zip
mv ${DESTINATION}/${CONCRETE5_VERSION}/* ${DESTINATION}/
chmod 755 concrete/bin/concrete5
concrete/bin/concrete5 c5:install --db-server=${MYSQL_SERVER} --db-username=${MYSQL_USER} --db-password=${MYSQL_PASS} --db-database=${MYSQL_DATABASE} --site="${SITE_NAME}" --starting-point=${SAMPLE_DATA} --admin-email=${ADMIN_EMAIL} --admin-password="${ADMIN_PASS}"
curl ${CONCRETE_PHP_RAW} > ${DESTINATION}/application/config/concrete.php
rm -f concrete5.zip
rm -rf ${CONCRETE5_VERSION}*

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


add notify ip

add notify ip

#!/bin/bash
# Author: @mirontoli 2016
# save this file on your raspberry pi - notify-ip.sh
# make it executable: chmod +x notify-ip.sh
# run it: ./notify-ip.sh &
# make sure it runs even after you quit your ssh session: disown %1
TOKEN="your-token-generated-by-slack"
SLACK_URL="https://hooks.slack.com/services/${TOKEN}"
SLACK_ICON=':pager:'
function post_to_slack() {
  IP=$(curl -s https://api.ipify.org)
  SLACK_MESSAGE="Current IP Address is \`\`\`${IP}\`\`\`"
  curl -X POST --data "payload={\"text\": \"${SLACK_ICON} ${SLACK_MESSAGE}\"}" ${SLACK_URL}
}

while :
do
  post_to_slack
  sleep 3600 #one hour
done

error: pathspec 'python_scripts/notify-ip.sh' did not match any file(s) known to git


Add script to support /cluster bumping

Add script to support /cluster bumping

#!/usr/bin/env bash

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

set -o xtrace
set -o errexit
set -o nounset
set -o pipefail

CLOUD_PROVIDER_PATH="${CLOUD_PROVIDER_PATH:-$GOPATH/src/k8s.io/cloud-provider-gcp}"
KUBERNETES_PATH="${KUBERNETES_PATH:-$GOPATH/src/k8s.io/kubernetes}"

cd "${CLOUD_PROVIDER_PATH}"

rm -rf cluster
cp -R "${KUBERNETES_PATH}/cluster" ./

rm -rf cluster/images
rm -rf cluster/README.md
git checkout cluster/addons/pdcsi-driver
git checkout cluster/OWNERS
git checkout cluster/addons/cloud-controller-manager
git checkout cluster/bin/kubectl
git checkout cluster/clientbin.sh
git checkout cluster/common.sh
git checkout cluster/gce/manifests/cloud-controller-manager.manifest
git checkout cluster/gce/manifests/pdcsi-controller.yaml
git checkout cluster/kubectl.sh
git checkout cluster/util.sh

for f in $(git ls-files -m | grep -e '\.sh$'); do gawk -i inplace '{ gsub(/source "\$\{KUBE_ROOT\}\/hack\/lib\/util\.sh"$/, "source \"${KUBE_ROOT}/cluster/util.sh\"") }; { print }' $f ; done

for new_owner_file in $(git ls-files --others --exclude-standard | grep -e 'OWNERS$'); do
  rm $new_owner_file
done

for build_file in $(git ls-files -d | grep BUILD); do
  git checkout $build_file
done

echo "

Please review all remaning chagnes. We want to keep:
  * Custom kubectl
  * PDSCI plugin
  * Enabled CCM
  * Credential provider specific code (look for credential sidecar)
  * Bumped master size
  * Bumped node size
  * Enabled ENABLE_DEFAULT_STORAGE_CLASS
  * Restore 'cluster/util.sh' instead of 'hack/lib/util.sh'

 This might not be the whole list of changes that needs to be reverted.

"

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


Remove unnecessary curly brackets.

Remove unnecessary curly brackets.

# Dumb terminals lack support.
if [[ "$TERM" == 'dumb' ]]; then
  return
fi

# The default styles.
zstyle ':prompt:' vicmd '<<<'         # Indicator to notify of vi command mode.
zstyle ':prompt:' completion "..."    # Indicator to notify of generating completion.

# Beep on error in line editor.
setopt beep

# Reset to default key bindings.
bindkey -d

# Allow command line editing in an external editor.
autoload -Uz edit-command-line
zle -N edit-command-line

# Use human-friendly identifiers.
zmodload zsh/terminfo
typeset -g -A keyinfo
keyinfo=(
  'Control'   '\C-'
  'Escape'    '\e'
  'Meta'      '\M-'
  'F1'        "$terminfo[kf1]"
  'F2'        "$terminfo[kf2]"
  'F3'        "$terminfo[kf3]"
  'F4'        "$terminfo[kf4]"
  'F5'        "$terminfo[kf5]"
  'F6'        "$terminfo[kf6]"
  'F7'        "$terminfo[kf7]"
  'F8'        "$terminfo[kf8]"
  'F9'        "$terminfo[kf9]"
  'F10'       "$terminfo[kf10]"
  'F11'       "$terminfo[kf11]"
  'F12'       "$terminfo[kf12]"
  'Backspace' "$terminfo[kbs]"
  'Insert'    "$terminfo[kich1]"
  'Home'      "$terminfo[khome]"
  'PageUp'    "$terminfo[kpp]"
  'Delete'    "$terminfo[kdch1]"
  'End'       "$terminfo[kend]"
  'PageDown'  "$terminfo[knp]"
  'Up'        "$terminfo[kcuu1]"
  'Left'      "$terminfo[kcub1]"
  'Down'      "$terminfo[kcud1]"
  'Right'     "$terminfo[kcuf1]"
  'BackTab'   "$terminfo[kcbt]"
)

if [[ "$KEYMAP" == (emacs|) ]]; then
  # Use Emacs key bindings.
  bindkey -e

  bindkey "$keyinfo[Escape]b" emacs-backward-word
  bindkey "$keyinfo[Escape]f" emacs-forward-word
  bindkey "$keyinfo[Escape]$keyinfo[Left]" emacs-backward-word
  bindkey "$keyinfo[Escape]$keyinfo[Right]" emacs-forward-word

  # Kill to the beginning of the line.
  bindkey "$keyinfo[Control]u" backward-kill-line

  # Kill to the beginning of the word.
  bindkey "$keyinfo[Control]w" backward-kill-word

  # Undo/Redo
  bindkey "$keyinfo[Control]_" undo
  bindkey "$keyinfo[Escape]_" redo

  # Search character.
  bindkey "$keyinfo[Control]]" vi-find-next-char
  bindkey "$keyinfo[Escape]$keyinfo[Control]]" vi-find-prev-char

  # Edit command in an external editor.
  bindkey "$keyinfo[Control]x$keyinfo[Control]e" edit-command-line

  # Expand .... to ../..
  if check-bool "$DOT_EXPANSION"; then
    bindkey "." expand-dot-to-parent-directory-path
  fi

  # Bind to history substring search plugin if enabled;
  # otherwise, bind to built-in ZSH history search.
  if (( $+widgets[history-incremental-pattern-search-backward] )); then
    bindkey "$keyinfo[Control]r" history-incremental-pattern-search-backward
    bindkey "$keyinfo[Control]s" history-incremental-pattern-search-forward
  else
    bindkey "$keyinfo[Control]r" history-incremental-search-backward
    bindkey "$keyinfo[Control]s" history-incremental-search-forward
  fi
elif [[ "$KEYMAP" == 'vi' ]]; then
  # Use vi key bindings.
  bindkey -v

  # Restores RPROMPT when exiting vicmd.
  function vi-restore-rprompt() {
    if (( $+RPROMPT_CACHED )); then
      RPROMPT="$RPROMPT_CACHED"
      unset RPROMPT_CACHED
      zle reset-prompt
      return 0
    fi
    return 1
  }
  add-zsh-trap INT vi-restore-rprompt

  # Displays the current vi mode (command).
  function zle-keymap-select() {
    if ! vi-restore-rprompt && [[ "$KEYMAP" == 'vicmd' ]]; then
      RPROMPT_CACHED="$RPROMPT"
      zstyle -s ':prompt:' vicmd RPROMPT
      zle reset-prompt
    fi
  }
  zle -N zle-keymap-select

  # Resets the prompt after exiting edit-command-line.
  function zle-line-init() {
    vi-restore-rprompt
  }
  zle -N zle-line-init

  # Resets the prompt after the line has been accepted.
  function zle-line-finish() {
    vi-restore-rprompt
  }
  zle -N zle-line-finish

  # Edit command in an external editor.
  bindkey -M vicmd "v" edit-command-line

  # Show cursor position.
  bindkey -M vicmd "ga" what-cursor-position

  # Undo/Redo
  bindkey -M vicmd "u" undo
  bindkey -M vicmd "$keyinfo[Control]r" redo

  # Expand .... to ../..
  if check-bool "$DOT_EXPANSION"; then
    bindkey -M viins "." expand-dot-to-parent-directory-path
  fi

  # Switch to command mode.
  bindkey -M viins "jk" vi-cmd-mode
  bindkey -M viins "kj" vi-cmd-mode

  # Emacs key bindings in insert mode.
  bindkey -M viins "$keyinfo[Control]a" beginning-of-line
  bindkey -M viins "$keyinfo[Control]b" backward-char
  bindkey -M viins "$keyinfo[Escape]b" emacs-backward-word
  bindkey -M viins "$keyinfo[Control]d" delete-char-or-list
  bindkey -M viins "$keyinfo[Escape]d" kill-word
  bindkey -M viins "$keyinfo[Control]e" end-of-line
  bindkey -M viins "$keyinfo[Control]f" forward-char
  bindkey -M viins "$keyinfo[Escape]f" emacs-forward-word
  bindkey -M viins "$keyinfo[Control]k" kill-line
  bindkey -M viins "$keyinfo[Control]u" backward-kill-line
  bindkey -M viins "$keyinfo[Control]w" backward-kill-word
  bindkey -M viins "$keyinfo[Escape]w" copy-region-as-kill
  bindkey -M viins "$keyinfo[Escape]h" run-help
  bindkey -M viins "$keyinfo[Escape]$keyinfo[Left]" emacs-backward-word
  bindkey -M viins "$keyinfo[Escape]$keyinfo[Right]" emacs-forward-word

  # History
  bindkey -M vicmd "gg" beginning-of-history
  bindkey -M vicmd "G" end-of-history

  # Bind to history substring search plugin if enabled;
  # otherwise, bind to built-in ZSH history search.
  if (( $+plugins[(er)history-substring-search] )); then
    bindkey -M vicmd "k" history-substring-search-up
    bindkey -M vicmd "j" history-substring-search-down
  else
    bindkey -M vicmd "k" up-line-or-history
    bindkey -M vicmd "j" down-line-or-history
  fi

  if (( $+widgets[history-incremental-pattern-search-backward] )); then
    bindkey -M vicmd "?" history-incremental-pattern-search-backward
    bindkey -M vicmd "/" history-incremental-pattern-search-forward

    # Emacs key bindings in insert mode.
    bindkey -M viins "$keyinfo[Control]r" history-incremental-pattern-search-backward
    bindkey -M viins "$keyinfo[Control]s" history-incremental-pattern-search-forward
  else
    bindkey -M vicmd "?" history-incremental-search-backward
    bindkey -M vicmd "/" history-incremental-search-forward

    # Emacs key bindings in insert mode.
    bindkey -M viins "$keyinfo[Control]r" history-incremental-search-backward
    bindkey -M viins "$keyinfo[Control]s" history-incremental-search-forward
  fi
else
  echo "oh-my-zsh: KEYMAP must be set 'emacs' or 'vi' but is set to '$KEYMAP'" >&2
  return 1
fi

# The next key bindings are for both Emacs and Vi.
bindkey "$keyinfo[Home]" beginning-of-line
bindkey "$keyinfo[End]" end-of-line

bindkey "$keyinfo[Insert]" overwrite-mode
bindkey "$keyinfo[Delete]" delete-char
bindkey "$keyinfo[Backspace]" backward-delete-char

bindkey "$keyinfo[Left]" backward-char
bindkey "$keyinfo[Right]" forward-char

# Expand history on space.
bindkey ' ' magic-space

if (( $+plugins[(er)history-substring-search] )); then
  bindkey "$keyinfo[Up]" history-substring-search-up
  bindkey "$keyinfo[Down]" history-substring-search-down
  bindkey "$keyinfo[Control]p" history-substring-search-up
  bindkey "$keyinfo[Control]n" history-substring-search-down
else
  bindkey "$keyinfo[Up]" up-line-or-history
  bindkey "$keyinfo[Down]" down-line-or-history
  bindkey "$keyinfo[Control]p" up-line-or-history
  bindkey "$keyinfo[Control]n" down-line-or-history
fi

# Clear screen.
bindkey "$keyinfo[Control]l" clear-screen

# Expand command name to full path.
bindkey "$keyinfo[Escape]e" expand-cmd-path

# Duplicate the previous word.
bindkey "$keyinfo[Escape]m" copy-prev-shell-word

# Bind Shift + Tab to go to the previous menu item.
bindkey "$keyinfo[BackTab]" reverse-menu-complete

# Complete in the middle of word.
bindkey "$keyinfo[Control]i" expand-or-complete-prefix

# Convert .... to ../.. automatically.
if check-bool "$DOT_EXPANSION"; then
  function expand-dot-to-parent-directory-path() {
    if [[ $LBUFFER = *.. ]]; then
      LBUFFER+=/..
    else
      LBUFFER+=.
    fi
  }
  zle -N expand-dot-to-parent-directory-path
  # Do not expand .... to ../..  during incremental search.
  bindkey -M isearch . self-insert 2>/dev/null
fi

# Display an indicator when completing.
if check-bool "$COMPLETION_INDICATOR"; then
  function expand-or-complete-prefix-with-indicator() {
    zstyle -s ':prompt:' completion indicator
    print -Pn "$indicator"
    unset indicator
    zle expand-or-complete-prefix
    zle redisplay
  }
  zle -N expand-or-complete-prefix-with-indicator
  bindkey "$keyinfo[Control]i" expand-or-complete-prefix-with-indicator
fi

# Dumb terminals lack support.
if [[ "$TERM" == 'dumb' ]]; then
  return
fi

# The default styles.
zstyle ':prompt:' vicmd '<<<'         # Indicator to notify of vi command mode.
zstyle ':prompt:' completion "..."    # Indicator to notify of generating completion.

# Beep on error in line editor.
setopt beep

# Reset to default key bindings.
bindkey -d

# Allow command line editing in an external editor.
autoload -Uz edit-command-line
zle -N edit-command-line

# Use human-friendly identifiers.
zmodload zsh/terminfo
typeset -g -A keyinfo
keyinfo=(
  'Control'   '\C-'
  'Escape'    '\e'
  'Meta'      '\M-'
  'F1'        "${terminfo[kf1]}"
  'F2'        "${terminfo[kf2]}"
  'F3'        "${terminfo[kf3]}"
  'F4'        "${terminfo[kf4]}"
  'F5'        "${terminfo[kf5]}"
  'F6'        "${terminfo[kf6]}"
  'F7'        "${terminfo[kf7]}"
  'F8'        "${terminfo[kf8]}"
  'F9'        "${terminfo[kf9]}"
  'F10'       "${terminfo[kf10]}"
  'F11'       "${terminfo[kf11]}"
  'F12'       "${terminfo[kf12]}"
  'Backspace' "${terminfo[kbs]}"
  'Insert'    "${terminfo[kich1]}"
  'Home'      "${terminfo[khome]}"
  'PageUp'    "${terminfo[kpp]}"
  'Delete'    "${terminfo[kdch1]}"
  'End'       "${terminfo[kend]}"
  'PageDown'  "${terminfo[knp]}"
  'Up'        "${terminfo[kcuu1]}"
  'Left'      "${terminfo[kcub1]}"
  'Down'      "${terminfo[kcud1]}"
  'Right'     "${terminfo[kcuf1]}"
  'BackTab'   "${terminfo[kcbt]}"
)

if [[ "$KEYMAP" == (emacs|) ]]; then
  # Use Emacs key bindings.
  bindkey -e

  bindkey "${keyinfo[Escape]}b" emacs-backward-word
  bindkey "${keyinfo[Escape]}f" emacs-forward-word
  bindkey "${keyinfo[Escape]}${keyinfo[Left]}" emacs-backward-word
  bindkey "${keyinfo[Escape]}${keyinfo[Right]}" emacs-forward-word

  # Kill to the beginning of the line.
  bindkey "${keyinfo[Control]}u" backward-kill-line

  # Kill to the beginning of the word.
  bindkey "${keyinfo[Control]}w" backward-kill-word

  # Undo/Redo
  bindkey "${keyinfo[Control]}_" undo
  bindkey "${keyinfo[Escape]}_" redo

  # Search character.
  bindkey "${keyinfo[Control]}]" vi-find-next-char
  bindkey "${keyinfo[Escape]}${keyinfo[Control]}]" vi-find-prev-char

  # Edit command in an external editor.
  bindkey "${keyinfo[Control]}x${keyinfo[Control]}e" edit-command-line

  # Expand .... to ../..
  if check-bool "$DOT_EXPANSION"; then
    bindkey "." expand-dot-to-parent-directory-path
  fi

  # Bind to history substring search plugin if enabled;
  # otherwise, bind to built-in ZSH history search.
  if (( ${+widgets[history-incremental-pattern-search-backward]} )); then
    bindkey "${keyinfo[Control]}r" history-incremental-pattern-search-backward
    bindkey "${keyinfo[Control]}s" history-incremental-pattern-search-forward
  else
    bindkey "${keyinfo[Control]}r" history-incremental-search-backward
    bindkey "${keyinfo[Control]}s" history-incremental-search-forward
  fi
elif [[ "$KEYMAP" == 'vi' ]]; then
  # Use vi key bindings.
  bindkey -v

  # Restores RPROMPT when exiting vicmd.
  function vi-restore-rprompt() {
    if (( $+RPROMPT_CACHED )); then
      RPROMPT="$RPROMPT_CACHED"
      unset RPROMPT_CACHED
      zle reset-prompt
      return 0
    fi
    return 1
  }
  add-zsh-trap INT vi-restore-rprompt

  # Displays the current vi mode (command).
  function zle-keymap-select() {
    if ! vi-restore-rprompt && [[ "$KEYMAP" == 'vicmd' ]]; then
      RPROMPT_CACHED="$RPROMPT"
      zstyle -s ':prompt:' vicmd RPROMPT
      zle reset-prompt
    fi
  }
  zle -N zle-keymap-select

  # Resets the prompt after exiting edit-command-line.
  function zle-line-init() {
    vi-restore-rprompt
  }
  zle -N zle-line-init

  # Resets the prompt after the line has been accepted.
  function zle-line-finish() {
    vi-restore-rprompt
  }
  zle -N zle-line-finish

  # Edit command in an external editor.
  bindkey -M vicmd "v" edit-command-line

  # Show cursor position.
  bindkey -M vicmd "ga" what-cursor-position

  # Undo/Redo
  bindkey -M vicmd "u" undo
  bindkey -M vicmd "${keyinfo[Control]}r" redo

  # Expand .... to ../..
  if check-bool "$DOT_EXPANSION"; then
    bindkey -M viins "." expand-dot-to-parent-directory-path
  fi

  # Switch to command mode.
  bindkey -M viins "jk" vi-cmd-mode
  bindkey -M viins "kj" vi-cmd-mode

  # Emacs key bindings in insert mode.
  bindkey -M viins "${keyinfo[Control]}a" beginning-of-line
  bindkey -M viins "${keyinfo[Control]}b" backward-char
  bindkey -M viins "${keyinfo[Escape]}b" emacs-backward-word
  bindkey -M viins "${keyinfo[Control]}d" delete-char-or-list
  bindkey -M viins "${keyinfo[Escape]}d" kill-word
  bindkey -M viins "${keyinfo[Control]}e" end-of-line
  bindkey -M viins "${keyinfo[Control]}f" forward-char
  bindkey -M viins "${keyinfo[Escape]}f" emacs-forward-word
  bindkey -M viins "${keyinfo[Control]}k" kill-line
  bindkey -M viins "${keyinfo[Control]}u" backward-kill-line
  bindkey -M viins "${keyinfo[Control]}w" backward-kill-word
  bindkey -M viins "${keyinfo[Escape]}w" copy-region-as-kill
  bindkey -M viins "${keyinfo[Escape]}h" run-help
  bindkey -M viins "${keyinfo[Escape]}${keyinfo[Left]}" emacs-backward-word
  bindkey -M viins "${keyinfo[Escape]}${keyinfo[Right]}" emacs-forward-word

  # History
  bindkey -M vicmd "gg" beginning-of-history
  bindkey -M vicmd "G" end-of-history

  # Bind to history substring search plugin if enabled;
  # otherwise, bind to built-in ZSH history search.
  if (( $+plugins[(er)history-substring-search] )); then
    bindkey -M vicmd "k" history-substring-search-up
    bindkey -M vicmd "j" history-substring-search-down
  else
    bindkey -M vicmd "k" up-line-or-history
    bindkey -M vicmd "j" down-line-or-history
  fi

  if (( ${+widgets[history-incremental-pattern-search-backward]} )); then
    bindkey -M vicmd "?" history-incremental-pattern-search-backward
    bindkey -M vicmd "/" history-incremental-pattern-search-forward

    # Emacs key bindings in insert mode.
    bindkey -M viins "${keyinfo[Control]}r" history-incremental-pattern-search-backward
    bindkey -M viins "${keyinfo[Control]}s" history-incremental-pattern-search-forward
  else
    bindkey -M vicmd "?" history-incremental-search-backward
    bindkey -M vicmd "/" history-incremental-search-forward

    # Emacs key bindings in insert mode.
    bindkey -M viins "${keyinfo[Control]}r" history-incremental-search-backward
    bindkey -M viins "${keyinfo[Control]}s" history-incremental-search-forward
  fi
else
  echo "oh-my-zsh: KEYMAP must be set 'emacs' or 'vi' but is set to '$KEYMAP'" >&2
  return 1
fi

# The next key bindings are for both Emacs and Vi.
bindkey "${keyinfo[Home]}" beginning-of-line
bindkey "${keyinfo[End]}" end-of-line

bindkey "${keyinfo[Insert]}" overwrite-mode
bindkey "${keyinfo[Delete]}" delete-char
bindkey "${keyinfo[Backspace]}" backward-delete-char

bindkey "${keyinfo[Left]}" backward-char
bindkey "${keyinfo[Right]}" forward-char

# Expand history on space.
bindkey ' ' magic-space

if (( $+plugins[(er)history-substring-search] )); then
  bindkey "${keyinfo[Up]}" history-substring-search-up
  bindkey "${keyinfo[Down]}" history-substring-search-down
  bindkey "${keyinfo[Control]}p" history-substring-search-up
  bindkey "${keyinfo[Control]}n" history-substring-search-down
else
  bindkey "${keyinfo[Up]}" up-line-or-history
  bindkey "${keyinfo[Down]}" down-line-or-history
  bindkey "${keyinfo[Control]}p" up-line-or-history
  bindkey "${keyinfo[Control]}n" down-line-or-history
fi

# Clear screen.
bindkey "${keyinfo[Control]}l" clear-screen

# Expand command name to full path.
bindkey "${keyinfo[Escape]}e" expand-cmd-path

# Duplicate the previous word.
bindkey "${keyinfo[Escape]}m" copy-prev-shell-word

# Bind Shift + Tab to go to the previous menu item.
bindkey "${keyinfo[BackTab]}" reverse-menu-complete

# Complete in the middle of word.
bindkey "${keyinfo[Control]}i" expand-or-complete-prefix

# Convert .... to ../.. automatically.
if check-bool "$DOT_EXPANSION"; then
  function expand-dot-to-parent-directory-path() {
    if [[ $LBUFFER = *.. ]]; then
      LBUFFER+=/..
    else
      LBUFFER+=.
    fi
  }
  zle -N expand-dot-to-parent-directory-path
  # Do not expand .... to ../..  during incremental search.
  bindkey -M isearch . self-insert 2>/dev/null
fi

# Display an indicator when completing.
if check-bool "$COMPLETION_INDICATOR"; then
  function expand-or-complete-prefix-with-indicator() {
    zstyle -s ':prompt:' completion indicator
    print -Pn "$indicator"
    unset indicator
    zle expand-or-complete-prefix
    zle redisplay
  }
  zle -N expand-or-complete-prefix-with-indicator
  bindkey "${keyinfo[Control]}i" expand-or-complete-prefix-with-indicator
fi


Create backupBukkitStart.sh

Create backupBukkitStart.sh

#!/bin/bash

W=$(cat server.properties | grep level-name= | cut -c 12-40)
#Gets level-name
Z=$W"_$(date +%d-%m-%Y-%H:%M:%S).zip"
#Defines what the zip filename should be
zip -r ${Z} ${W}
#Zips the world file (${W})recursively to ${Z}
bash /home/${USER}/Desktop/serverFiles/regBukkitStart.sh
#Starts the server

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


Add core shell script.

Add core shell script.

#!/bin/sh

# PURPOSE: Find (and list) the branches that contain changes to a particular
#          file which have not yet been merged back into a specific branch.

# Get the arguments passed to this script.
while getopts ":d:p:n:f:" opt; do
    case $opt in
        d) repo_directory="$OPTARG"
        ;;
        p) for_each_ref_pattern="$OPTARG"
        ;;
        n) not_yet_merged_into="$OPTARG"
        ;;
        f) file_in_question="$OPTARG"
        ;;
        \?) echo "Invalid option -$OPTARG" >&2
        ;;
    esac
done

# Make sure all the arguments were provided.
if [ "$repo_directory" == "" ]; then
    echo "You must specify the directory of the Git repo (using the -d argument)";
    echo "EXAMPLE: -d \".\"";
    exit 1;
fi;
if [ "$for_each_ref_pattern" == "" ]; then
    echo "You must specify the for-each-ref pattern (using the -p argument)";
    echo "EXAMPLE: -p \"refs/remotes/origin/\"";
    exit 1;
fi;
if [ "$not_yet_merged_into" == "" ]; then
    echo "You must specify the not-yet-merged-into branch name (using the -n argument)";
    echo "EXAMPLE: -n \"develop\"";
    exit 1;
fi;
if [ "$file_in_question" == "" ]; then
    echo "You must specify the file in question (using the -f argument)";
    echo "EXAMPLE: -f \"application/composer.json\"";
    exit 1;
fi;

# Output a visual separator.
echo -----

## TEMP: Show the given arguments.
# printf "Argument repo_directory is %s\n" "$repo_directory"
# printf "Argument for_each_ref_pattern is %s\n" "$for_each_ref_pattern"
# printf "Argument not_yet_merged_into is %s\n" "$not_yet_merged_into"
# printf "Argument file_in_question is %s\n" "$file_in_question"
# exit

# Change to the repo's directory.
cd $repo_directory

# Get the list of branches we should examine.
RELEVANT_BRANCHES="$(git for-each-ref --format="%(refname:short)" $for_each_ref_pattern | grep -v "^master$" | grep -v "^origin/master$" | grep -v "develop$" | grep -v "origin/develop$" | grep -v "^origin/HEAD$")"

# For each of the relevant branches that we'll examine...
while read -r br; do

    # TEMP
    #echo "$br";

    # See if any commits have not yet been merged back into the named branch.
    git cherry $not_yet_merged_into $br | while read x h; do

        if [ "`git log -n 1 --format=%H $h -- $file_in_question`" = "$h" ]; then
            echo "$br"
        fi;
    done;

done <<< "$RELEVANT_BRANCHES" | sort -u # Sort the results, removing duplicates.

echo '-----'
echo 'Done.'

error: pathspec 'find-branches-with-changes-to-file.sh' did not match any file(s) known to git


compfiles

compfiles

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


chore: add script for tagging containers (#16)

#!/bin/bash

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

# This script finds all container images with the provided version tag and adds
# the "latest" tag to them.
#
# For example:
# 1. Add a "latest" tag to the v1.23.1 images
#
#     ./tag_latest 1.23.1
#
# 2. Print out the gcloud commands without running them:
#
#     ./tag_latest 1.23.1 -dry-run
#

if [ "$1" = "" ]
then
    echo "Usage: $0 <version without the v prefix to tag as latest> [-dry-run]"
    exit 1
fi

dry_run=false
if [ "$2" = "-dry-run" ]
then
    dry_run=true
fi

tag_latest() {
    local new_version=$1
    for registry in "gcr.io" "us.gcr.io" "eu.gcr.io" "asia.gcr.io"
    do
        local base_image="$registry/alloydb-connectors/alloydb-auth-proxy"
        cmd="gcloud container images add-tag '$base_image:$new_version' '$base_image:latest'"
        if [ "$dry_run" != true ]
        then
            eval "$cmd"
        else
            echo "[DRY RUN] $cmd"
        fi
    done
}

tag_latest "$1"

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


Script para automatizar a geração de senhas criptografadas

#!/bin/bash

if [[ ! $JBOSS_HOME ]]; then
  echo "A variável JBOSS_HOME não foi definida"
  exit -2
fi

if [[ ! $1 ]]; then
  echo "Uso: $(basename $0) <senha a ser criptografada>"
  exit -1
fi

java -cp $JBOSS_HOME/modules/system/layers/base/org/picketbox/main/picketbox-4.0.19.SP8-redhat-1.jar:\
$JBOSS_HOME/modules/system/layers/base/org/picketbox/main/picketbox-4.0.19SP8-redhat-1.jar:\
$JBOSS_HOME/modules/system/layers/base/org/jboss/logging/main/jboss-logging-3.1.4.GA-redhat-1.jar:\
$JBOSS_HOME/modules/system/layers/base/org/picketbox/main/picketbox-commons-1.0.0.final-redhat-2.jar:\
$CLASSPATH org.picketbox.datasource.security.SecureIdentityLoginModule $1

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