Create safepac0.2.bash

Create safepac0.2.bash

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


Use Windows' "start" command. It's a cmd shell builtin... but win-bash won't spawn cmd properly. zsh and cygwin bash will. Since zsh will be around anyway, ask it to spawn cmd for us.

#!/bin/sh

# Find the network utility
if command -v wget 1>&2; then
	GET="wget -q -O -"
elif command -v curl 1>&2; then
	GET="curl -sfL"
else
	echo "You must have wget or curl installed." 1>&2
	exit 1
fi

# Verify the presence of oauthsign
if ! command -v oauthsign 1>&2; then
	echo "You need the oauthsign utility from oauth-utils installed to use this script." 1>&2
	exit 1
fi

# Find the command to open a URL, if there is one
OPEN=""
if command -v xdg-open 1>&2; then
	OPEN="xdg-open"
elif command -v open 1>&2; then
	OPEN="open"
elif command -v cmd 1>&2; then
	# Why do we need zsh? win-bash won't call cmd correctly
	# Why not fix win-bash? I can't get it to compile
	# Why not use zsh for primary shell? It doesn't have -v on command builtin
	if command -v zsh 1>&2; then
		USE_ZSH=1
		OPEN="cmd /c start"
	fi
fi

REQUEST="`oauthsign -c key123 -C sekret http://csclub.uwaterloo.ca:4567/oauth/request_token`"
TOKENS="`$GET "$REQUEST"`"

# Verify the expected output was returned
if [ "`echo $TOKENS | cut -c 1-11`" != "oauth_token" ]; then
	# Request Failed
	echo "Authentication failed on server." 1>&2
	echo "The server could be unreachable, invalid tokens were given to this script, or you could have failed to authorize this application." 1>&2
	exit 1
fi

TOKEN="`echo $TOKENS | sed 's/^oauth_token=\([^&]*\).*/\1/'`"
SECRET="`echo $TOKENS | sed 's/^[^&]*&oauth_token_secret=\(.*\)/\1/'`"

# This is the url to send the user to
URL="http://singpolyma.net/theveeb/authorize.php?oauth_token=$TOKEN"

# Output the tokens
echo "$TOKEN $SECRET"

if [ -n "$OPEN" ]; then
	# If we can open urls for the user, do so
	if [ $USE_ZSH -eq 1 ]; then
		zsh -c "$OPEN '$URL'"
	else
		$OPEN "$URL" &
	fi
else
	# If we can't, output the url they should go to on their own
	echo "Go to \"$URL\" in a browser to continue authentication." 1>&2
fi

#!/bin/sh

# Find the network utility
if command -v wget 1>&2; then
	GET="wget -q -O -"
elif command -v curl 1>&2; then
	GET="curl -sfL"
else
	echo "You must have wget or curl installed." 1>&2
	exit 1
fi

# Verify the presence of oauthsign
if ! command -v oauthsign 1>&2; then
	echo "You need the oauthsign utility from oauth-utils installed to use this script." 1>&2
	exit 1
fi

# Find the command to open a URL, if there is one
if command -v xdg-open 1>&2; then
	OPEN="xdg-open"
elif command -v open 1>&2; then
	OPEN="open"
elif command -v run 1>&2; then
	OPEN="run"
else
	OPEN=""
fi

REQUEST="`oauthsign -c key123 -C sekret http://csclub.uwaterloo.ca:4567/oauth/request_token`"
TOKENS="`$GET "$REQUEST"`"

# Verify the expected output was returned
if [ "`echo $TOKENS | cut -c 1-11`" != "oauth_token" ]; then
	# Request Failed
	echo "Authentication failed on server." 1>&2
	echo "The server could be unreachable, invalid tokens were given to this script, or you could have failed to authorize this application." 1>&2
	exit 1
fi

TOKEN="`echo $TOKENS | sed 's/^oauth_token=\([^&]*\).*/\1/'`"
SECRET="`echo $TOKENS | sed 's/^[^&]*&oauth_token_secret=\(.*\)/\1/'`"

# This is the url to send the user to
URL="http://singpolyma.net/theveeb/authorize.php?oauth_token=$TOKEN"

# Output the tokens
echo "$TOKEN $SECRET"

if [ -n "$OPEN" ]; then
	# If we can open urls for the user, do so
	$OPEN "$URL" &
else
	# If we can't, output the url they should go to on their own
	echo "Go to \"$URL\" in a browser to continue authentication." 1>&2
fi


Added in SSH Script to start edinag alerts up

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


initial import

initial import

#!/bin/sh
#
# libtool assumes that the compiler can handle the -fPIC flag
# This isn't always true (for example, nasm can't handle it)
command=""
while [ $1 ]; do
    if [ "$1" != "-fPIC" ]; then
        if [ "$1" != "-DPIC" ]; then
            command="$command $1"
        fi
    fi
    shift
done
echo $command
exec $command

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


Create switch-php.sh

Create switch-php.sh

#!/bin/bash
#
# a script to manage different PHP versions on one system
#
# author: Carsten Brandt <mail@cebe.cc>
#

# where are the different php distributions located?
PHPDIR=/srv/php

# function to show usage help
usage(){
	echo "usage:"
	echo "  $0 <buildname>   - switch php to <buildname>"
	echo "  $0 --reset       - reset system to use natively installed php version"
	echo ""
	echo "the following names are available:"
	echo ""
	ls $PHPDIR
	echo ""
	echo "you can add a new one by building php with --prefix=$PHPDIR/<buildname>"
}

# no arg shows help
if [ "$1" = "" ] ; then
	usage
	exit 1
fi

if [ ! "$1" = "--reset" ] ; then
	# check if desired php dist is available
	if [ ! -d "$PHPDIR/$1" ] ; then
		echo "$PHPDIR/$1 does not exist!"
		echo ""
		usage
		exit 1
	fi
fi

echo "removing existing alternatives..."
for p in $(update-alternatives --list php | grep "$PHPDIR") ; do
	update-alternatives --remove php $p
done
for p in $(update-alternatives --list phpize | grep "$PHPDIR") ; do
	update-alternatives --remove phpize $p
done
for p in $(update-alternatives --list php-config | grep "$PHPDIR") ; do
	update-alternatives --remove php-config $p
done
for p in $(update-alternatives --list php-cgi | grep "$PHPDIR") ; do
	update-alternatives --remove php-cgi $p
done
echo "done."

if [ ! "$1" = "--reset" ] ; then
	echo "switching PHP to $1..."

	update-alternatives --install /usr/bin/php php $PHPDIR/$1/bin/php 70 \
	                    --slave /usr/share/man/man1/php.1.gz php.1.gz $PHPDIR/$1/php/man/man1/php.1
	update-alternatives --install /usr/bin/phpize phpize $PHPDIR/$1/bin/phpize 70 \
	                    --slave /usr/share/man/man1/phpize.1.gz phpize.1.gz $PHPDIR/$1/php/man/man1/phpize.1
	update-alternatives --install /usr/bin/php-config php-config $PHPDIR/$1/bin/php-config 70 \
	                    --slave /usr/share/man/man1/php-config.1.gz php-config.1.gz $PHPDIR/$1/php/man/man1/php-config.1
	update-alternatives --install /usr/bin/php-cgi php-cgi $PHPDIR/$1/bin/php-cgi 70 \
	                    --slave /usr/share/man/man1/php-cgi.1.gz php-cgi.1.gz $PHPDIR/$1/php/man/man1/php-cgi.1
	echo "done."
fi

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


Task UpdateMediaInfoLib for UpdateVersion.sh

# tasks/UpdateMediaInfoLib.sh

function btask.UpdateMediaInfoLib.run () {

    if [ $(b.opt.get_opt --source-path) ]; then
        MIL_source=$(sanitize_arg $(b.opt.get_opt --source-path))
    else
        if [ $(b.opt.get_opt --repo-url) ]; then
            RepoURL=$(sanitize_arg $(b.opt.get_opt --repo-url))
        else
            RepoURL="git://github.com/MediaArea/MediaInfoLib/"
        fi
        getSource /tmp $RepoURL
        MIL_source=/tmp/MediaInfoLib
    fi

    echo
    echo "Passage for version with dots..."
    index=0
    MIL_files[((index++))]="Source/MediaInfo/MediaInfo_Config.cpp"
    MIL_files[((index++))]="Project/GNU/libmediainfo.dsc"
    MIL_files[((index++))]="Project/GNU/libmediainfo.spec"
    MIL_files[((index++))]="Project/Solaris/mkpkg"
    MIL_files[((index++))]="debian/changelog"
    MIL_files[((index++))]="debian/control"
    MIL_files[((index++))]="Project/GNU/Library/configure.ac"
    MIL_files[((index++))]="Source/Install/MediaInfo_DLL_Windows_i386.nsi"
    MIL_files[((index++))]="Source/Install/MediaInfo_DLL_Windows_x64.nsi"
    MIL_files[((index++))]="Project/MSVC2005/DLL/MediaInfo.rc"
    MIL_files[((index++))]="Project/MSVC2012/Dll/MediaInfo.rc"
    MIL_files[((index++))]="Project/MSVC2012/Example/HowToUse.rc"
    MIL_files[((index++))]="Project/MSVC2012/ShellExtension/MediaInfoShellExt.rc"
    MIL_files[((index++))]="Project/MSVC2010/Dll/MediaInfo.rc"
    MIL_files[((index++))]="Project/MSVC2010/Example/HowToUse.rc"
    MIL_files[((index++))]="Project/MSVC2010/ShellExtension/MediaInfoShellExt.rc"
    MIL_files[((index++))]="Project/MSVC2008/Dll/MediaInfo.rc"
    MIL_files[((index++))]="Project/MSVC2008/Example/HowToUse.rc"
    MIL_files[((index++))]="Project/MSVC2008/ShellExtension/MediaInfoShellExt.rc"
    MIL_files[((index++))]="Project/MSVC2013/Dll/MediaInfo.rc"
    MIL_files[((index++))]="Project/MSVC2013/Example/HowToUse.rc"
    MIL_files[((index++))]="Project/MSVC2013/ShellExtension/MediaInfoShellExt.rc"

    # Replace old version by new version
    for MIL_file in ${MIL_files[@]}
    do
        echo "${MIL_source}/${MIL_file}"
        updateFile $Version_old_dot $Version_new "${MIL_source}/${MIL_file}"
    done
    unset -v MIL_files

    echo
    echo "Passage for version with commas..."
    index=0
    MIL_files[((index++))]="Project/MSVC2005/DLL/MediaInfo.rc"
    MIL_files[((index++))]="Project/MSVC2012/Dll/MediaInfo.rc"
    MIL_files[((index++))]="Project/MSVC2012/Example/HowToUse.rc"
    MIL_files[((index++))]="Project/MSVC2012/ShellExtension/MediaInfoShellExt.rc"
    MIL_files[((index++))]="Project/MSVC2010/Dll/MediaInfo.rc"
    MIL_files[((index++))]="Project/MSVC2010/Example/HowToUse.rc"
    MIL_files[((index++))]="Project/MSVC2010/ShellExtension/MediaInfoShellExt.rc"
    MIL_files[((index++))]="Project/MSVC2008/Dll/MediaInfo.rc"
    MIL_files[((index++))]="Project/MSVC2008/Example/HowToUse.rc"
    MIL_files[((index++))]="Project/MSVC2008/ShellExtension/MediaInfoShellExt.rc"
    MIL_files[((index++))]="Project/MSVC2013/Dll/MediaInfo.rc"
    MIL_files[((index++))]="Project/MSVC2013/Example/HowToUse.rc"
    MIL_files[((index++))]="Project/MSVC2013/ShellExtension/MediaInfoShellExt.rc"

    # Replace old version by new version
    for MIL_file in ${MIL_files[@]}
    do
        echo "${MIL_source}/${MIL_file}"
        updateFile $Version_old_comma $Version_new_comma "${MIL_source}/${MIL_file}"
    done
    unset -v MIL_files index

    echo
    echo "Replace major/minor/patch in ${MIL_source}/Project/CMake/CMakeLists.txt"
    updateFile "set(MediaInfoLib_MAJOR_VERSION $Version_old_major)" \
        "set(MediaInfoLib_MAJOR_VERSION $Version_new_major)" \
        "${MIL_source}/Project/CMake/CMakeLists.txt"
    updateFile "set(MediaInfoLib_MINOR_VERSION $Version_old_minor)" \
        "set(MediaInfoLib_MINOR_VERSION $Version_new_minor)" \
        "${MIL_source}/Project/CMake/CMakeLists.txt"
    updateFile "set(MediaInfoLib_PATCH_VERSION $Version_old_patch)" \
        "set(MediaInfoLib_PATCH_VERSION $Version_new_patch)" \
        "${MIL_source}/Project/CMake/CMakeLists.txt"

    unset -v MIL_source
}

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


hooks/pre-configure/00-gnu-configure-asneeded.sh: don't error on $configure_script with spaces.

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/Bubble-be/void-packages.git/'


Added bash script which gets a date and an optional charging day and returns the billrun key

#!/bin/bash

###  script arguments as follow:
###  1) date to check on (YYYY-mm-dd)
###  2) charging day

if [ $1 ]; then
        by_date=$1;
else
	echo "please supply the date in YYYY-mm-dd format"
	exit 2
fi

if [ $2 ]; then
        charging_day=$2;
else
	charging_day=25
fi

day=${by_date:8:2}

if [ "$day" -lt "$charging_day" ]; then
	date_from=${by_date}
else
	date_from=`date -d "${by_date} -$(date -d "$by_date" +%d) days +1 month +1 day" +'%F'`
fi

echo ${date_from:0:4}${date_from:5:2}

error: pathspec 'application/helpers/Scripts/billrun_key.sh' did not match any file(s) known to git


add ntfs-3g

add ntfs-3g

source stage0n_variables
source stage01_variables
source stage02_variables

PKGNAME=ntfs-3g_ntfsprogs
PKGVERSION=2014.2.15

# Download:

[ -f ${SRCDIR}/${PKGNAME}-${PKGVERSION}.tgz ] || wget -O ${SRCDIR}/${PKGNAME}-${PKGVERSION}.tgz \
	http://tuxera.com/opensource/${PKGVERSION}/${PKGNAME}-${PKGVERSION}.tgz

# Unpack and patch

workdir=` pwd `
mkdir -p ${CLFS}/build/${PKGNAME}-${PKGVERSION}
cd ${CLFS}/build/${PKGNAME}-${PKGVERSION}
tar xvzf ${SRCDIR}/${PKGNAME}-${PKGVERSION}.tgz
cd ${CLFS}/build/${PKGNAME}-${PKGVERSION}/${PKGNAME}-${PKGVERSION}
sed -i 's/ linux-uclibc\*/linux-uclibc\* | linux-musl\*/g' ./config.sub

# Build and install

./configure --prefix=/usr --host=${CLFS_TARGET} --with-fuse=external
make || exit 1
make prefix=${CLFS}/targetfs install || exit 1
rm -rf ${CLFS}/targetfs/usr/share/doc
rm -rf ${CLFS}/targetfs/usr/lib/pkgconfig
rm -rf ${CLFS}/targetfs/usr/lib/libntfs-3g.{,l}a
${CLFS}/cross-tools/bin/${CLFS_TARGET}-strip ${CLFS}/targetfs/usr/bin/ntfs*
${CLFS}/cross-tools/bin/${CLFS_TARGET}-strip ${CLFS}/targetfs/usr/sbin/ntfs*
${CLFS}/cross-tools/bin/${CLFS_TARGET}-strip ${CLFS}/targetfs/usr/lib/libntfs*
# Clean up

rm -rf ${CLFS}/build/${PKGNAME}-${PKGVERSION}/${PKGNAME}-${PKGVERSION}

error: pathspec 'stage02/0034_ntfs-3g.sh' did not match any file(s) known to git


Add rfc.sh to help with gerrit workflow.

Change-Id: I1672ec098ea190a5068df941e48f140409b83e66

#!/bin/sh -e
# Copyright (c) 2010-2011 Gluster, Inc. <http://www.gluster.com>
# This initial version of this file was taken from the source tree
# of GlusterFS. It was not directly attributed, but is assumed to be
# Copyright (c) 2010-2011 Gluster, Inc and release GPLv3
# Subsequent modifications are Copyright (c) 2011 OpenStack, LLC.
#
# GlusterFS 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 3 of the License,
# or (at your option) any later version.
#
# GlusterFS 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 this program.  If not, see
# <http://www.gnu.org/licenses/>.

branch="master";

set_hooks_commit_msg()
{
    top_dir=`git rev-parse --show-toplevel`
    f="${top_dir}/.git/hooks/commit-msg";
    u="https://review.openstack.org/tools/hooks/commit-msg";

    if [ -x "$f" ]; then
        return;
    fi

    curl -o $f $u || wget -O $f $u;

    chmod +x $f;

    GIT_EDITOR=true git commit --amend
}

add_remote()
{
    username=$1
    project=$2

    echo "No remote set, testing ssh://$username@review.openstack.org:29418"
    if ssh -p29418 -o StrictHostKeyChecking=no $username@review.openstack.org gerrit ls-projects >/dev/null 2>&1
    then
        echo "$username@review.openstack.org:29418 worked."
        echo "Creating a git remote called gerrit that maps to:"
        echo "  ssh://$username@review.openstack.org:29418/$project"
        git remote add gerrit ssh://$username@review.openstack.org:29418/$project
        return 0
    fi
    return 1
}

check_remote()
{
    if ! git remote | grep gerrit >/dev/null 2>&1
    then
        origin_project=`git remote show origin | grep 'Fetch URL' | perl -nle '@fields = split(m|[:/]|); $len = $#fields; print $fields[$len-1], "/", $fields[$len];'`
        if add_remote $USERNAME $origin_project
        then
            return 0
        else
            echo "Your local name doesn't work on Gerrit."
            echo -n "Enter Gerrit username (same as launchpad): "
            read gerrit_user
            if add_remote $gerrit_user $origin_project
            then
                return 0
            else
                echo "Can't infer where gerrit is - please set a remote named"
                echo "gerrit manually and then try again."
                echo
                echo "For more information, please see:"
                echo "\thttp://wiki.openstack.org/GerritWorkflow"
                exit 1
            fi
        fi
    fi
}

rebase_changes()
{
    git fetch;

    GIT_EDITOR=true git rebase -i origin/$branch || exit $?;
}

assert_diverge()
{
    if ! git diff origin/$branch..HEAD | grep -q .
    then
	echo "No changes between the current branch and origin/$branch."
	exit 1
    fi
}

main()
{
    set_hooks_commit_msg;

    check_remote;

    rebase_changes;

    assert_diverge;

    bug=$(git show --format='%s %b' | perl -nle 'if (/\b([Bb]ug|[Ll][Pp])\s*[#:]?\s*(\d+)/) {print "$2"; exit}')

    bp=$(git show --format='%s %b' | perl -nle 'if (/\b([Bb]lue[Pp]rint|[Bb][Pp])\s*[#:]?\s*([0-9a-zA-Z-_]+)/) {print "$2"; exit}')

    if [ "$DRY_RUN" = 1 ]; then
        drier='echo -e Please use the following command to send your commits to review:\n\n'
    else
        drier=
    fi

    local_branch=`git branch | grep -Ei "\* (.*)" | cut -f2 -d' '`
    if [ -z "$bug" ]; then
	if [ -z "$bp" ]; then
            $drier git push gerrit HEAD:refs/for/$branch/$local_branch;
	else
	    $drier git push gerrit HEAD:refs/for/$branch/bp/$bp;
	fi
    else
        $drier git push gerrit HEAD:refs/for/$branch/bug/$bug;
    fi
}

main "$@"

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


Create stop-start-instances.sh

Create stop-start-instances.sh

#!/bin/bash
set -eu

# This script is aimed to help with the power off and on of the OS cluster
# From time to time, we've to shut down the instances because of power cut
# This script will shut off all the instances which are actually running
# and keep then in files so when the power come back it knows which ones
# should be running.

# Change to start to power on intances.
MODE=stop
INSTANCES_SERVICE=${PWD}/instances-service.txt
INSTANCES_TESTING=${PWD}/instances-testing.txt
INSTANCES_KUBERNETES=${PWD}/instances-kubernetes.txt

if [ "${MODE}" == "stop" ]; then

	## Services
	echo "" > ${INSTANCES_SERVICE}
	source /home/nordri/services-openrc
	INSTANCES=$(openstack server list | grep ACTIVE | awk '{ print $4 }')
	for INSTANCE in ${INSTANCES}
	do
		echo powering off ${INSTANCE}...
		openstack server stop ${INSTANCE}
		echo ${INSTANCE} >> ${INSTANCES_SERVICE}
		sleep 10
	done

	## Testing
	echo "" > ${INSTANCES_TESTING}
	source /home/nordri/testing-openrc
	INSTANCES=$(openstack server list | grep ACTIVE | awk '{ print $4 }')
	for INSTANCE in ${INSTANCES}
	do
		echo powering off ${INSTANCE}...
		openstack server stop ${INSTANCE}
		echo $INSTANCE >> ${INSTANCES_TESTING}
		sleep 10
	done

	## Kubernetes
	echo "" > ${INSTANCES_KUBERNETES}
	source /home/nordri/kubernetes-openrc
	INSTANCES=$(openstack server list | grep ACTIVE | awk '{ print $4 }')
	for INSTANCE in ${INSTANCES}
	do
		echo powering off ${INSTANCE}...
		openstack server stop ${INSTANCE}
		echo $INSTANCE >> ${INSTANCES_KUBERNETES}
		sleep 10
	done
else
	## Services
	source /home/nordri/services-openrc
	for INSTANCE in $(cat ${INSTANCES_SERVICE})
	do
		echo powering up ${INSTANCE}...
		openstack server start ${INSTANCE}
		sleep 60
	done

	## Testing
	source /home/nordri/testing-openrc
	for INSTANCE in $(cat ${INSTANCES_TESTING})
	do
		echo powering up ${INSTANCE}...
		openstack server start ${INSTANCE}
		sleep 60
	done

	## kubernetes
	source /home/nordri/kubernetes-openrc
	for INSTANCE in $(cat ${INSTANCES_KUBERNETES})
	do
		echo powering up ${INSTANCE}...
		openstack server start ${INSTANCE}
		sleep 60
	done

	rm ${INSTANCES_SERVICE}
	rm ${INSTANCES_TESTING}
	rm ${INSTANCES_KUBERNETES}
fi

error: pathspec 'stop-start-instances.sh' did not match any file(s) known to git


new test script

new test script

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


Adds a script for MySQL.

Adds a script for MySQL.

This configures a basic development install, allowing local connections and
default users/passwords.

#!/bin/bash

# set a root password of "vagrant"
debconf-set-selections <<< "mysql-server mysql-server/root_password password vagrant"
debconf-set-selections <<< "mysql-server mysql-server/root_password_again password vagrant"

apt-get install -qy mysql-server libmysqlclient-dev

# enable listening on all addresses
sed -i.bak "s/bind-address\s*= 127.0.0.1/bind-address = 0.0.0.0/g" /etc/mysql/my.cnf

# create a local user which can connect from anywhere
mysql -u root -pvagrant -e "CREATE USER 'vagrant'@'%' IDENTIFIED BY 'vagrant'; GRANT ALL PRIVILEGES ON *.* TO 'vagrant'@'%' IDENTIFIED BY 'vagrant';"

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


Fully working installation supervise boot not working still

Signed-off-by: Fady Matar <b81398f79bbb31440ce59ec81cfe27b3e44c3771@godaddy.com>

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


Edits to setup.sh which Anne and myself made to download latest virtualenvironment python package

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/crukci-bioinformatics/chipseq-installer.git/'


Adding setup script that installs dependencies for mcsema and remill.

#!/usr/bin/env bash
# Copyright (c) 2017 Trail of Bits, Inc.
#
# 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.

SCRIPTS_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
SRC_DIR=$( cd "$( dirname "${SCRIPTS_DIR}" )" && pwd )
CURR_DIR=$( pwd )

SetupLinux() {
  printf "Getting dependencies for platform: linux\n"

  printf " > Updating the system...\n"
  sudo apt-get -qq update
  if [ $? -ne 0 ] ; then
    printf " x The package database could not be updated\n"
    return 1
  fi

  printf " > Installing the required packages...\n"
  sudo apt-get install -qqy \
     git \
     cmake \
     python2.7 python-pip python-virtualenv \
     wget \
     build-essential \
     gcc-multilib g++-multilib \
     libtinfo-dev \
     lsb-release \
     realpath \
     zip liblzma-dev zlib1g-dev \
     gnat

  if [ $? -ne 0 ] ; then
    printf " x Could not install the required dependencies\n"
    return 1
  fi

  printf " > Adding i386 architecture support\n"
  sudo dpkg --add-architecture i386
  sudo apt-get install -qqy zlib1g-dev:i386
  if [ $? -ne 0 ] ; then
    printf " x Could not install the i386 dependencies\n"
    return 1
  fi

  printf " > The system has been successfully initialized\n"
  return 0
}

SetupMaxOSX() {
  printf "Getting dependencies for platform: osx\n"
  printf " x This platform is not yet supported\n"
  return 1
}

main() {
  # macOS packages.
  if [[ "$OSTYPE" == "darwin"* ]]; then
    SetupLinux
    return $?

  # Linux
  elif [[ "$OSTYPE" == "linux-gnu" ]]; then
    SetupLinux
    return $?

  # Unsupported.
  else
    printf "Getting dependencies for platform: $OSTYPE\n"
    printf " x This platform is not yet supported\n"
    return 1
  fi
}

main $@
exit $?

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


Add scripts/start.sh

Add scripts/start.sh

export DISPLAY=:1
Xvfb :1 -screen 0 1024x768x24 &

java -jar /opt/selenium-server-standalone-2.49.1.jar -port 4444

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


add missing file.

add missing file.

ICINGA2_USER=icinga
ICINGA2_GROUP=icingacmd
ICINGA2_CONFIG_FILE=/etc/icinga2/icinga.cfg
ICINGA2_ERROR_LOG=/var/log/icinga2/error.log

/usr/sbin/icinga2 -d -e $ICINGA2_ERROR_LOG -u $ICINGA2_USER  -g $ICINGA2_GROUP $ICINGA2_CONFIG_FILE && echo icinga is started...


examples: use portable uname to detect the running OS. Place detection code

under "main part"

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/stackforce/serial-interface-cli.git/'


fix startup

fix startup

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/thetanil/thetasynth-pi.git/'


A script for plucking packages and their runtime dependencies for nanobsd images.

#!/bin/sh
#
# Copyright (c) 2009 Poul-Henning Kamp.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $FreeBSD$
#
# Usage:
# 	$0 PACKAGE_DUMP NANO_PACKAGE_DIR /usr/ports/foo/bar ...
#
# Will symlink the packages listed, including their runtime dependencies,
# from the PACKAGE_DUMP to the NANO_PACKAGE_DIR.
#

NANO_PKG_DUMP=$1
shift;
if [ ! -d $NANO_PKG_DUMP ] ; then
	echo "$NANO_PKG_DUMP not a directory" 1>&2
	exit 1
fi

NANO_PACKAGE_DIR=$1
shift;

ports_recurse() (
	of=$1
	shift
	for d
	do
		if [ ! -d $d ] ; then
			echo "Missing port $d" 1>&2
			exit 2
		fi
		if grep -q "^$d\$" $of ; then
			true
		else
			(
			cd $d
			rd=`make -V RUN_DEPENDS`
			ld=`make -V LIB_DEPENDS`

			for x in $rd $ld
			do
				ports_recurse $of `echo $x |
				    sed 's/^[^:]*:\([^:]*\).*$/\1/'`
			done
			)
			echo $d >> $of
		fi
	done
)

rm -rf $NANO_PACKAGE_DIR
mkdir -p $NANO_PACKAGE_DIR

PL=$NANO_PACKAGE_DIR/_list
true > $PL
for i
do
	ports_recurse `pwd`/$PL $i
done

for i in `cat $PL`
do
	p=`(cd $i && make -V PKGNAME)`
	if [ -f $NANO_PKG_DUMP/$p.tbz ] ; then
		ln -s $NANO_PKG_DUMP/$p.tbz $NANO_PACKAGE_DIR
	else
		echo "Package $p misssing in $NANO_PKG_DUMP" 1>&2
		exit 1
	fi
done

rm -f $PL
exit 0

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


Changed temp_dir to /var/temp/roundcube to avoid loss on reboot. (#1302)

#!/bin/bash
# Webmail with Roundcube
# ----------------------

source setup/functions.sh # load our functions
source /etc/mailinabox.conf # load global vars

# ### Installing Roundcube

# We install Roundcube from sources, rather than from Ubuntu, because:
#
# 1. Ubuntu's `roundcube-core` package has dependencies on Apache & MySQL, which we don't want.
#
# 2. The Roundcube shipped with Ubuntu is consistently out of date.
#
# 3. It's packaged incorrectly --- it seems to be missing a directory of files.
#
# So we'll use apt-get to manually install the dependencies of roundcube that we know we need,
# and then we'll manually install roundcube from source.

# These dependencies are from `apt-cache showpkg roundcube-core`.
echo "Installing Roundcube (webmail)..."
apt_install \
	dbconfig-common \
	php7.0-cli php7.0-sqlite php7.0-mcrypt php7.0-intl php7.0-json php7.0-common \
	php-auth php-net-smtp php-net-socket php-net-sieve php-mail-mime php-crypt-gpg \
	php7.0-gd php7.0-pspell tinymce libjs-jquery libjs-jquery-mousewheel libmagic1 php7.0-mbstring

apt_get_quiet remove php-mail-mimedecode # no longer needed since Roundcube 1.1.3

# We used to install Roundcube from Ubuntu, without triggering the dependencies #NODOC
# on Apache and MySQL, by downloading the debs and installing them manually. #NODOC
# Now that we're beyond that, get rid of those debs before installing from source. #NODOC
apt-get purge -qq -y roundcube* #NODOC

# Install Roundcube from source if it is not already present or if it is out of date.
# Combine the Roundcube version number with the commit hash of plugins to track
# whether we have the latest version of everything.
VERSION=1.3.3
HASH=903a4eb1bfc25e9a08d782a7f98502cddfa579de
PERSISTENT_LOGIN_VERSION=dc5ca3d3f4415cc41edb2fde533c8a8628a94c76
HTML5_NOTIFIER_VERSION=4b370e3cd60dabd2f428a26f45b677ad1b7118d5
CARDDAV_VERSION=2.0.4
CARDDAV_HASH=d93f3cfb3038a519e71c7c3212c1d16f5da609a4

UPDATE_KEY=$VERSION:$PERSISTENT_LOGIN_VERSION:$HTML5_NOTIFIER_VERSION:$CARDDAV_VERSION

# paths that are often reused.
RCM_DIR=/usr/local/lib/roundcubemail
RCM_PLUGIN_DIR=${RCM_DIR}/plugins
RCM_CONFIG=${RCM_DIR}/config/config.inc.php

needs_update=0 #NODOC
if [ ! -f /usr/local/lib/roundcubemail/version ]; then
	# not installed yet #NODOC
	needs_update=1 #NODOC
elif [[ "$UPDATE_KEY" != `cat /usr/local/lib/roundcubemail/version` ]]; then
	# checks if the version is what we want
	needs_update=1 #NODOC
fi
if [ $needs_update == 1 ]; then
	# install roundcube
	wget_verify \
		https://github.com/roundcube/roundcubemail/releases/download/$VERSION/roundcubemail-$VERSION-complete.tar.gz \
		$HASH \
		/tmp/roundcube.tgz
	tar -C /usr/local/lib --no-same-owner -zxf /tmp/roundcube.tgz
	rm -rf /usr/local/lib/roundcubemail
	mv /usr/local/lib/roundcubemail-$VERSION/ $RCM_DIR
	rm -f /tmp/roundcube.tgz

	# install roundcube persistent_login plugin
	git_clone https://github.com/mfreiholz/Roundcube-Persistent-Login-Plugin.git $PERSISTENT_LOGIN_VERSION '' ${RCM_PLUGIN_DIR}/persistent_login

	# install roundcube html5_notifier plugin
	git_clone https://github.com/kitist/html5_notifier.git $HTML5_NOTIFIER_VERSION '' ${RCM_PLUGIN_DIR}/html5_notifier

	# download and verify the full release of the carddav plugin
	wget_verify \
		https://github.com/blind-coder/rcmcarddav/releases/download/v${CARDDAV_VERSION}/carddav-${CARDDAV_VERSION}.zip \
		$CARDDAV_HASH \
		/tmp/carddav.zip

	# unzip and cleanup
	unzip -q /tmp/carddav.zip -d ${RCM_PLUGIN_DIR}
	rm -f /tmp/carddav.zip

	# record the version we've installed
	echo $UPDATE_KEY > ${RCM_DIR}/version
fi

# ### Configuring Roundcube

# Generate a safe 24-character secret key of safe characters.
SECRET_KEY=$(dd if=/dev/urandom bs=1 count=18 2>/dev/null | base64 | fold -w 24 | head -n 1)

# Create a configuration file.
#
# For security, temp and log files are not stored in the default locations
# which are inside the roundcube sources directory. We put them instead
# in normal places.
cat > $RCM_CONFIG <<EOF;
<?php
/*
 * Do not edit. Written by Mail-in-a-Box. Regenerated on updates.
 */
\$config = array();
\$config['log_dir'] = '/var/log/roundcubemail/';
\$config['temp_dir'] = '/var/tmp/roundcubemail/';
\$config['db_dsnw'] = 'sqlite:///$STORAGE_ROOT/mail/roundcube/roundcube.sqlite?mode=0640';
\$config['default_host'] = 'ssl://localhost';
\$config['default_port'] = 993;
\$config['imap_conn_options'] = array(
  'ssl'         => array(
     'verify_peer'  => false,
     'verify_peer_name'  => false,
   ),
 );
\$config['imap_timeout'] = 15;
\$config['smtp_server'] = 'tls://127.0.0.1';
\$config['smtp_port'] = 587;
\$config['smtp_user'] = '%u';
\$config['smtp_pass'] = '%p';
\$config['smtp_conn_options'] = array(
  'ssl'         => array(
     'verify_peer'  => false,
     'verify_peer_name'  => false,
   ),
 );
\$config['support_url'] = 'https://mailinabox.email/';
\$config['product_name'] = '$PRIMARY_HOSTNAME Webmail';
\$config['des_key'] = '$SECRET_KEY';
\$config['plugins'] = array('html5_notifier', 'archive', 'zipdownload', 'password', 'managesieve', 'jqueryui', 'persistent_login', 'carddav');
\$config['skin'] = 'larry';
\$config['login_autocomplete'] = 2;
\$config['password_charset'] = 'UTF-8';
\$config['junk_mbox'] = 'Spam';
?>
EOF

# Configure CardDav
cat > ${RCM_PLUGIN_DIR}/carddav/config.inc.php <<EOF;
<?php
/* Do not edit. Written by Mail-in-a-Box. Regenerated on updates. */
\$prefs['_GLOBAL']['hide_preferences'] = true;
\$prefs['_GLOBAL']['suppress_version_warning'] = true;
\$prefs['ownCloud'] = array(
	 'name'         =>  'ownCloud',
	 'username'     =>  '%u', // login username
	 'password'     =>  '%p', // login password
	 'url'          =>  'https://${PRIMARY_HOSTNAME}/cloud/remote.php/carddav/addressbooks/%u/contacts',
	 'active'       =>  true,
	 'readonly'     =>  false,
	 'refresh_time' => '02:00:00',
	 'fixed'        =>  array('username','password'),
	 'preemptive_auth' => '1',
	 'hide'        =>  false,
);
EOF

# Create writable directories.
mkdir -p /var/log/roundcubemail /var/tmp/roundcubemail $STORAGE_ROOT/mail/roundcube
chown -R www-data.www-data /var/log/roundcubemail /var/tmp/roundcubemail $STORAGE_ROOT/mail/roundcube

# Ensure the log file monitored by fail2ban exists, or else fail2ban can't start.
sudo -u www-data touch /var/log/roundcubemail/errors

# Password changing plugin settings
# The config comes empty by default, so we need the settings
# we're not planning to change in config.inc.dist...
cp ${RCM_PLUGIN_DIR}/password/config.inc.php.dist \
	${RCM_PLUGIN_DIR}/password/config.inc.php

tools/editconf.py ${RCM_PLUGIN_DIR}/password/config.inc.php \
	"\$config['password_minimum_length']=8;" \
	"\$config['password_db_dsn']='sqlite:///$STORAGE_ROOT/mail/users.sqlite';" \
	"\$config['password_query']='UPDATE users SET password=%D WHERE email=%u';" \
	"\$config['password_dovecotpw']='/usr/bin/doveadm pw';" \
	"\$config['password_dovecotpw_method']='SHA512-CRYPT';" \
	"\$config['password_dovecotpw_with_method']=true;"

# so PHP can use doveadm, for the password changing plugin
usermod -a -G dovecot www-data

# set permissions so that PHP can use users.sqlite
# could use dovecot instead of www-data, but not sure it matters
chown root.www-data $STORAGE_ROOT/mail
chmod 775 $STORAGE_ROOT/mail
chown root.www-data $STORAGE_ROOT/mail/users.sqlite
chmod 664 $STORAGE_ROOT/mail/users.sqlite

# Fix Carddav permissions:
chown -f -R root.www-data ${RCM_PLUGIN_DIR}/carddav
# root.www-data need all permissions, others only read
chmod -R 774 ${RCM_PLUGIN_DIR}/carddav

# Run Roundcube database migration script (database is created if it does not exist)
${RCM_DIR}/bin/updatedb.sh --dir ${RCM_DIR}/SQL --package roundcube
chown www-data:www-data $STORAGE_ROOT/mail/roundcube/roundcube.sqlite
chmod 664 $STORAGE_ROOT/mail/roundcube/roundcube.sqlite

# Enable PHP modules.
phpenmod -v php7.0 mcrypt imap
restart_service php7.0-fpm

#!/bin/bash
# Webmail with Roundcube
# ----------------------

source setup/functions.sh # load our functions
source /etc/mailinabox.conf # load global vars

# ### Installing Roundcube

# We install Roundcube from sources, rather than from Ubuntu, because:
#
# 1. Ubuntu's `roundcube-core` package has dependencies on Apache & MySQL, which we don't want.
#
# 2. The Roundcube shipped with Ubuntu is consistently out of date.
#
# 3. It's packaged incorrectly --- it seems to be missing a directory of files.
#
# So we'll use apt-get to manually install the dependencies of roundcube that we know we need,
# and then we'll manually install roundcube from source.

# These dependencies are from `apt-cache showpkg roundcube-core`.
echo "Installing Roundcube (webmail)..."
apt_install \
	dbconfig-common \
	php7.0-cli php7.0-sqlite php7.0-mcrypt php7.0-intl php7.0-json php7.0-common \
	php-auth php-net-smtp php-net-socket php-net-sieve php-mail-mime php-crypt-gpg \
	php7.0-gd php7.0-pspell tinymce libjs-jquery libjs-jquery-mousewheel libmagic1 php7.0-mbstring

apt_get_quiet remove php-mail-mimedecode # no longer needed since Roundcube 1.1.3

# We used to install Roundcube from Ubuntu, without triggering the dependencies #NODOC
# on Apache and MySQL, by downloading the debs and installing them manually. #NODOC
# Now that we're beyond that, get rid of those debs before installing from source. #NODOC
apt-get purge -qq -y roundcube* #NODOC

# Install Roundcube from source if it is not already present or if it is out of date.
# Combine the Roundcube version number with the commit hash of plugins to track
# whether we have the latest version of everything.
VERSION=1.3.3
HASH=903a4eb1bfc25e9a08d782a7f98502cddfa579de
PERSISTENT_LOGIN_VERSION=dc5ca3d3f4415cc41edb2fde533c8a8628a94c76
HTML5_NOTIFIER_VERSION=4b370e3cd60dabd2f428a26f45b677ad1b7118d5
CARDDAV_VERSION=2.0.4
CARDDAV_HASH=d93f3cfb3038a519e71c7c3212c1d16f5da609a4

UPDATE_KEY=$VERSION:$PERSISTENT_LOGIN_VERSION:$HTML5_NOTIFIER_VERSION:$CARDDAV_VERSION

# paths that are often reused.
RCM_DIR=/usr/local/lib/roundcubemail
RCM_PLUGIN_DIR=${RCM_DIR}/plugins
RCM_CONFIG=${RCM_DIR}/config/config.inc.php

needs_update=0 #NODOC
if [ ! -f /usr/local/lib/roundcubemail/version ]; then
	# not installed yet #NODOC
	needs_update=1 #NODOC
elif [[ "$UPDATE_KEY" != `cat /usr/local/lib/roundcubemail/version` ]]; then
	# checks if the version is what we want
	needs_update=1 #NODOC
fi
if [ $needs_update == 1 ]; then
	# install roundcube
	wget_verify \
		https://github.com/roundcube/roundcubemail/releases/download/$VERSION/roundcubemail-$VERSION-complete.tar.gz \
		$HASH \
		/tmp/roundcube.tgz
	tar -C /usr/local/lib --no-same-owner -zxf /tmp/roundcube.tgz
	rm -rf /usr/local/lib/roundcubemail
	mv /usr/local/lib/roundcubemail-$VERSION/ $RCM_DIR
	rm -f /tmp/roundcube.tgz

	# install roundcube persistent_login plugin
	git_clone https://github.com/mfreiholz/Roundcube-Persistent-Login-Plugin.git $PERSISTENT_LOGIN_VERSION '' ${RCM_PLUGIN_DIR}/persistent_login

	# install roundcube html5_notifier plugin
	git_clone https://github.com/kitist/html5_notifier.git $HTML5_NOTIFIER_VERSION '' ${RCM_PLUGIN_DIR}/html5_notifier

	# download and verify the full release of the carddav plugin
	wget_verify \
		https://github.com/blind-coder/rcmcarddav/releases/download/v${CARDDAV_VERSION}/carddav-${CARDDAV_VERSION}.zip \
		$CARDDAV_HASH \
		/tmp/carddav.zip

	# unzip and cleanup
	unzip -q /tmp/carddav.zip -d ${RCM_PLUGIN_DIR}
	rm -f /tmp/carddav.zip

	# record the version we've installed
	echo $UPDATE_KEY > ${RCM_DIR}/version
fi

# ### Configuring Roundcube

# Generate a safe 24-character secret key of safe characters.
SECRET_KEY=$(dd if=/dev/urandom bs=1 count=18 2>/dev/null | base64 | fold -w 24 | head -n 1)

# Create a configuration file.
#
# For security, temp and log files are not stored in the default locations
# which are inside the roundcube sources directory. We put them instead
# in normal places.
cat > $RCM_CONFIG <<EOF;
<?php
/*
 * Do not edit. Written by Mail-in-a-Box. Regenerated on updates.
 */
\$config = array();
\$config['log_dir'] = '/var/log/roundcubemail/';
\$config['temp_dir'] = '/tmp/roundcubemail/';
\$config['db_dsnw'] = 'sqlite:///$STORAGE_ROOT/mail/roundcube/roundcube.sqlite?mode=0640';
\$config['default_host'] = 'ssl://localhost';
\$config['default_port'] = 993;
\$config['imap_conn_options'] = array(
  'ssl'         => array(
     'verify_peer'  => false,
     'verify_peer_name'  => false,
   ),
 );
\$config['imap_timeout'] = 15;
\$config['smtp_server'] = 'tls://127.0.0.1';
\$config['smtp_port'] = 587;
\$config['smtp_user'] = '%u';
\$config['smtp_pass'] = '%p';
\$config['smtp_conn_options'] = array(
  'ssl'         => array(
     'verify_peer'  => false,
     'verify_peer_name'  => false,
   ),
 );
\$config['support_url'] = 'https://mailinabox.email/';
\$config['product_name'] = '$PRIMARY_HOSTNAME Webmail';
\$config['des_key'] = '$SECRET_KEY';
\$config['plugins'] = array('html5_notifier', 'archive', 'zipdownload', 'password', 'managesieve', 'jqueryui', 'persistent_login', 'carddav');
\$config['skin'] = 'larry';
\$config['login_autocomplete'] = 2;
\$config['password_charset'] = 'UTF-8';
\$config['junk_mbox'] = 'Spam';
?>
EOF

# Configure CardDav
cat > ${RCM_PLUGIN_DIR}/carddav/config.inc.php <<EOF;
<?php
/* Do not edit. Written by Mail-in-a-Box. Regenerated on updates. */
\$prefs['_GLOBAL']['hide_preferences'] = true;
\$prefs['_GLOBAL']['suppress_version_warning'] = true;
\$prefs['ownCloud'] = array(
	 'name'         =>  'ownCloud',
	 'username'     =>  '%u', // login username
	 'password'     =>  '%p', // login password
	 'url'          =>  'https://${PRIMARY_HOSTNAME}/cloud/remote.php/carddav/addressbooks/%u/contacts',
	 'active'       =>  true,
	 'readonly'     =>  false,
	 'refresh_time' => '02:00:00',
	 'fixed'        =>  array('username','password'),
	 'preemptive_auth' => '1',
	 'hide'        =>  false,
);
EOF

# Create writable directories.
mkdir -p /var/log/roundcubemail /tmp/roundcubemail $STORAGE_ROOT/mail/roundcube
chown -R www-data.www-data /var/log/roundcubemail /tmp/roundcubemail $STORAGE_ROOT/mail/roundcube

# Ensure the log file monitored by fail2ban exists, or else fail2ban can't start.
sudo -u www-data touch /var/log/roundcubemail/errors

# Password changing plugin settings
# The config comes empty by default, so we need the settings
# we're not planning to change in config.inc.dist...
cp ${RCM_PLUGIN_DIR}/password/config.inc.php.dist \
	${RCM_PLUGIN_DIR}/password/config.inc.php

tools/editconf.py ${RCM_PLUGIN_DIR}/password/config.inc.php \
	"\$config['password_minimum_length']=8;" \
	"\$config['password_db_dsn']='sqlite:///$STORAGE_ROOT/mail/users.sqlite';" \
	"\$config['password_query']='UPDATE users SET password=%D WHERE email=%u';" \
	"\$config['password_dovecotpw']='/usr/bin/doveadm pw';" \
	"\$config['password_dovecotpw_method']='SHA512-CRYPT';" \
	"\$config['password_dovecotpw_with_method']=true;"

# so PHP can use doveadm, for the password changing plugin
usermod -a -G dovecot www-data

# set permissions so that PHP can use users.sqlite
# could use dovecot instead of www-data, but not sure it matters
chown root.www-data $STORAGE_ROOT/mail
chmod 775 $STORAGE_ROOT/mail
chown root.www-data $STORAGE_ROOT/mail/users.sqlite
chmod 664 $STORAGE_ROOT/mail/users.sqlite

# Fix Carddav permissions:
chown -f -R root.www-data ${RCM_PLUGIN_DIR}/carddav
# root.www-data need all permissions, others only read
chmod -R 774 ${RCM_PLUGIN_DIR}/carddav

# Run Roundcube database migration script (database is created if it does not exist)
${RCM_DIR}/bin/updatedb.sh --dir ${RCM_DIR}/SQL --package roundcube
chown www-data:www-data $STORAGE_ROOT/mail/roundcube/roundcube.sqlite
chmod 664 $STORAGE_ROOT/mail/roundcube/roundcube.sqlite

# Enable PHP modules.
phpenmod -v php7.0 mcrypt imap
restart_service php7.0-fpm


added script to rerun specific lou-run

added script to rerun specific lou-run

#!/bin/bash

OUT="lou/rerun"
EPA="../bin/epa"
LUCAS="data/lucas"
BASEDIR=$(dirname $0)

mkdir -p "$OUT/$1"

echo "RUNNING EPA"
$EPA "$1/tree.newick" "$LUCAS/msa.fasta" -O -w "$OUT/$1"

echo "OLD RESULTS:"
./jplace_compare.py -v "$1/RAxML_portableTree.leave_one_out.jplace" "$1/epa_result.jplace"

echo "NEW RESULTS:"
./jplace_compare.py -v "$1/RAxML_portableTree.leave_one_out.jplace" "$OUT/$1/epa_result.jplace"

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


Create ubuntu-git.sh

Create ubuntu-git.sh

#!/bin/bash

# Install git from ppa
# base on https://launchpad.net/~git-core/+archive/ppa

sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update

sudo apt-get install -y git

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


Bash pour mettre à jour le ldap

Bash pour mettre à jour le ldap

#!/bin/bash

. bin/config.inc
LOCK="/tmp/compte_update_ldap.lock"
SEQ="/tmp/compte_update_ldap.seq"
if test -f $LOCK ; then
    exit 1
fi
touch $LOCK
if test -s $SEQ; then
    SINCESEQ=$(echo -n "&since="$(cat $SEQ))
fi

curl -s "http://$COUCHDBDOMAIN:$COUCHDBPORT/$COUCHDBBASE/_changes?feed=continuous&timeout=59000"$SINCESEQ | grep "COMPTE" | grep -v "_design" | while read ligne
do
    echo $ligne | sed 's/.*"seq"://' | sed 's/,.*//' | sed 's/"//g' > $SEQ
    php symfony compte:ldap-update $SYMFONYTASKOPTIONS $(echo $ligne | sed 's/.*"id":"//' | sed 's/",.*//' )
done

rm $LOCK

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


Create example.sh

Create example.sh

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


keygeneration: Add a script to sanity check versions for a keyset

Add a script that runs sanity checks on the versions in a keyset.
In particular, tests whether the actual key versions match those
in key.versions. Also runs consistency checks (for example: firmware
version should match kernel subkey version).

BUG=none
TEST=run on all of our keysets
BRANCH=none

Change-Id: I5b509ba33127364f6b63252ad167646eb7dce710
Reviewed-on: https://chromium-review.googlesource.com/190790
Reviewed-by: Mike Frysinger <8f3f75c74bd5184edcfa6534cab3c13a00a2f794@chromium.org>
Tested-by: Gaurav Shah <2987db6a10bcfe664554a372d01e80df7fd325a3@chromium.org>

#!/bin/bash
# Copyright 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# Script that sanity checks a keyset to ensure actual key versions
# match those set in key.versions.

# Load common constants and variables.
. "$(dirname "$0")/common.sh"

# Abort on errors.
set -e

if [ $# -ne 1 ]; then
  cat <<EOF
Usage: $0 <keyset directory>

Sanity check a keyset directory for key versions.
EOF
  exit 1
fi

KEY_DIR="$1"
VERSION_FILE="${KEY_DIR}/key.versions"

keyblock_version() {
  local keyblock="$1"
  echo "$(vbutil_keyblock --unpack "${keyblock}" | grep 'Data key version' |
    cut -f 2 -d : | tr -d ' ')"
}

key_version() {
  local key="$1"
  echo "$(vbutil_key --unpack "${key}" | grep 'Key Version' | cut -f 2 -d : |
    tr -d ' ')"
}

# Compare versions and print out error if there is a mismatch.
check_versions() {
  local expected="$1"
  local got="$2"
  local expected_label="$3"
  local got_label="$4"
  if [[ ${expected} != ${got} ]]; then
    echo "ERROR: ${expected_label} version does not match ${got_label} version"
    echo "EXPECTED (${expected_label} version): ${expected}"
    echo "GOT (${got_label} version): ${got}"
    return 1
  fi
  return 0
}

main() {
 local testfail=0

 local expected_kkey="$(get_version kernel_key_version)"
 local expected_fkey="$(get_version firmware_key_version)"
 local expected_firmware="$(get_version firmware_version)"
 local expected_kernel="$(get_version kernel_version)"

 check_versions "${expected_firmware}" "${expected_kkey}" \
   "firmware" "kernel key" || testfail=1

 local got_fkey_keyblock="$(keyblock_version ${KEY_DIR}/firmware.keyblock)"
 local got_fkey="$(key_version ${KEY_DIR}/firmware_data_key.vbpubk)"

 local got_kkey_keyblock="$(keyblock_version ${KEY_DIR}/kernel.keyblock)"
 local got_ksubkey="$(key_version ${KEY_DIR}/kernel_subkey.vbpubk)"
 local got_kdatakey="$(key_version ${KEY_DIR}/kernel_data_key.vbpubk)"

 check_versions "${got_fkey_keyblock}" "${got_fkey}" "firmware keyblock key" \
   "firmware key" || testfail=1
 check_versions "${got_kkey_keyblock}" "${got_ksubkey}" "kernel keyblock key" \
   "kernel subkey" || testfail=1
 check_versions "${got_kdatakey}" "${got_ksubkey}" "kernel data key" \
   "kernel subkey" || testfail=1
 check_versions "${expected_fkey}" "${got_fkey}" "key.versions firmware key" \
   "firmware key" || testfail=1
 check_versions "${expected_kkey}" "${got_kdatakey}" "key.versions kernel key" \
   "kernel datakey" || testfail=1
 check_versions "${expected_kkey}" "${got_ksubkey}" "key.versions kernel key" \
   "kernel subkey" || testfail=1
 exit ${testfail}
}

main "$@"

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


Added update_all.sh

Added update_all.sh

#!/bin/sh

echo Updating everything &&
git pull &&
git submodule foreach git submodule update --recursive --remote

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


16s pipeline added

16s pipeline added

NAME="CDNA"
LOCATION="/Users/metagenomics/Documents/2014_COBS_Spruce_cdna/test"
INDEX_FILE="/Users/metagenomics/Documents/2014_COBS_Spruce_cdna/0_original/Undetermined_S0_L001_I1_001.fastq.gz"
READ_1="/Users/metagenomics/Documents/2014_COBS_Spruce_cdna/0_original/Undetermined_S0_L001_R1_001.fastq.gz"
READ_2="/Users/metagenomics/Documents/2014_COBS_Spruce_cdna/0_original/Undetermined_S0_L001_R2_001.fastq.gz"
MAP="/Users/metagenomics/Documents/2014_COBS_Spruce_cdna/0_original/rdp_mapping_file_rev.txt"
FAN_PY="/Users/metagenomics/Documents/Fan/code"
UPARSE_PY="/Users/metagenomics/python_scripts"
REF_16S="/Users/metagenomics/Documents/Databases/RDPClassifier_16S_trainsetNo10_rawtrainingdata/trainset10_082014_rmdup.fasta"
MODEL_16S="/Users/metagenomics/gene_resources_and_models/RRNA_16S_BACTERIA/model.cm"

SEQFILTER="/Users/metagenomics/RDPTools/SeqFilters.jar"
PANDASEQ="/Users/metagenomics/RDP_Assembler/pandaseq/pandaseq"
USEARCH="/Users/metagenomics/usearch70"
CMALIGN="/Users/metagenomics/infernal111/bin/cmalign"
CLUST="/Users/metagenomics/RDPTools/Clustering.jar"
CLASSIFIER="/Users/metagenomics/RDPTools/Classifier.jar"
FASTTREE="/Users/metagenomics/FastTree"

DIST="0.03"
SETP="0.03"
BOOTSTRAP_VALUE="0.5"

cd $LOCATION

#echo "assembling pair-ended reads ..."
#mkdir 1_"$NAME"_demultiplex 1_"$NAME"_demultiplex/assembled
#
#$PANDASEQ -N -o 10 -e 25 -F -d rbfkms -l 250 -L 280 -f $READ_1 -r $READ_2 1> 1_"$NAME"_demultiplex/assembled/assembled_reads.fastq 2>  1_"$NAME"_demultiplex/assembled/assembled_reads_stats.txt
#echo "done."
#
#echo "parsing index file ..."
#java -jar $SEQFILTER --seq-file $INDEX_FILE --tag-file $MAP --outdir 1_"$NAME"_demultiplex/parse_index
#echo "moving quality trimmed index reads to directory 'trimmed_tags'"
#mkdir 1_"$NAME"_demultiplex/parse_index/trimmed_tags
#mv 1_"$NAME"_demultiplex/parse_index/result_dir/*/*_trimmed.fasta 1_"$NAME"_demultiplex/parse_index/trimmed_tags/
#echo "done."
#
#echo "demultiplexing assembled reads ..."
#cd 1_"$NAME"_demultiplex/parse_index/trimmed_tags
#mv NoTag_trimmed.fasta $LOCATION/1_"$NAME"_demultiplex/parse_index/result_dir/NoTag
#python $FAN_PY/bin_reads.py $LOCATION/1_"$NAME"_demultiplex/assembled/assembled_reads.fastq
#cd $LOCATION
#mkdir 1_"$NAME"_demultiplex/demultiplexed_assembled_reads
#mv 1_"$NAME"_demultiplex/parse_index/trimmed_tags/*_assem.fastq 1_"$NAME"_demultiplex/demultiplexed_assembled_reads
#echo "done."
#
#echo "prune reads to maxee=0.5 ..."
#mkdir 2_"$NAME"_uparse 2_"$NAME"_uparse/quality_filtered
#cd 1_"$NAME"_demultiplex/demultiplexed_assembled_reads
#for i in *.fastq; do $USEARCH -fastq_filter $i -fastq_maxee 0.5 -fastaout $LOCATION/2_"$NAME"_uparse/quality_filtered/"$i"_maxee_0.5.fasta; done
#echo "done."
#
#echo "dereplicate reads ..."
#mkdir $LOCATION/2_"$NAME"_uparse/derep
#cd $LOCATION/2_"$NAME"_uparse/quality_filtered
#for i in *_0.5.fasta; do $USEARCH -derep_fulllength $i -output $LOCATION/2_"$NAME"_uparse/derep/"$i"_unique.fasta -sizeout; done
#echo "done."
#
#echo "sorting by cluster size and removing singltons ..."
#mkdir $LOCATION/2_"$NAME"_uparse/sorted
#cd $LOCATION/2_"$NAME"_uparse/derep
#for i in *_unique.fasta; do $USEARCH -sortbysize $i -output $LOCATION/2_"$NAME"_uparse/sorted/"$i"_sorted.fa -minsize 2; done
#echo "done."
#
#echo "removing chimeras using de novo ..."
#mkdir $LOCATION/2_"$NAME"_uparse/chime_denovo
#cd $LOCATION/2_"$NAME"_uparse/sorted
#for i in *.fa; do $USEARCH -cluster_otus $i -otuid 0.985 -otus $LOCATION/2_"$NAME"_uparse/chime_denovo/"$i"_otu1.fa; done
#echo "done."
#
#echo "removing chimeras using references ..."
#mkdir $LOCATION/2_"$NAME"_uparse/chime_ref $LOCATION/2_"$NAME"_uparse/chime_ref/stats $LOCATION/2_"$NAME"_uparse/chime_ref/chimeras $LOCATION/2_"$NAME"_uparse/chime_ref/good_otus
#cd $LOCATION/2_"$NAME"_uparse/chime_denovo
#for i in *_otu1.fa; do $USEARCH -uchime_ref $i -db $REF_16S -uchimeout $LOCATION/2_"$NAME"_uparse/chime_ref/stats/"$i".uchime -strand plus -selfid -mindiv 1.5 -mindiffs 5 -chimeras $LOCATION/2_"$NAME"_uparse/chime_ref/chimeras/"$i"_chimera.fa -nonchimeras $LOCATION/2_"$NAME"_uparse/chime_ref/good_otus/"$i"_good.fa; done
#echo "done."
#
#echo "renaming otus that are rid of chimeras to 'OTU_XX' ..."
#mkdir $LOCATION/2_"$NAME"_uparse/chime_ref/good_otus_renamed
#cd $LOCATION/2_"$NAME"_uparse/chime_ref/good_otus
#for i in *_good.fa; do python $UPARSE_PY/fasta_number.py $i OTU_ > $LOCATION/2_"$NAME"_uparse/chime_ref/good_otus_renamed/"$i"_otu2.fa; done
#echo "done"
#
#echo "mapping all sequences (including singletons) back to good OTU's of individual samples ..."
#mkdir $LOCATION/2_"$NAME"_uparse/mapped $LOCATION/2_"$NAME"_uparse/mapped/uc $LOCATION/2_"$NAME"_uparse/mapped/seqs
#cd 2_"$NAME"_uparse/quality_filtered
#for i in *.5.fasta; do $USEARCH  -usearch_global $i -db $LOCATION/2_"$NAME"_uparse/chime_ref/good_otus_renamed/"$i"_unique.fasta_sorted.fa_otu1.fa_good.fa_otu2.fa -strand plus -id 0.985 -uc $LOCATION/2_"$NAME"_uparse/mapped/uc/"$i"_map.uc -matched $LOCATION/2_"$NAME"_uparse/mapped/seqs/"$i"_matched.fa; done
#echo "done"
#
echo "prepare finalized sequences for alignment and clustering ..."
echo "cancatenate and dereplicate ..."
mkdir $LOCATION/3_"$NAME"_alignment_and_cluster mkdir $LOCATION/3_"$NAME"_alignment_and_cluster/Derep_alignment
cd $LOCATION/2_"$NAME"_uparse/mapped/seqs
java -Xmx16g -jar $CLUST derep --unaligned -o $LOCATION/3_"$NAME"_alignment_and_cluster/Derep_alignment/all_seqs_derep.fasta $LOCATION/3_"$NAME"_alignment_and_cluster/Derep_alignment/all_seqs.ids $LOCATION/3_"$NAME"_alignment_and_cluster/Derep_alignment/all_seqs.samples *_matched.fa

echo "align finalized sequences ..."
cd $LOCATION/3_"$NAME"_alignment_and_cluster/Derep_alignment
$CMALIGN -g --noprob $MODEL_16S all_seqs_derep.fasta | esl-reformat --informat stockholm afa > all_seqs_derep_aligned.fasta

echo "Calculating distance matrix ..."
mkdir $LOCATION/3_"$NAME"_alignment_and_cluster/complete_linkage_cluster $LOCATION/3_"$NAME"_alignment_and_cluster/complete_linkage_cluster/distance_matrix
cd $LOCATION/3_"$NAME"_alignment_and_cluster/Derep_alignment
java -Xmx16g -jar $CLUST dmatrix --id-mapping $LOCATION/3_"$NAME"_alignment_and_cluster/Derep_alignment/all_seqs.ids --in $LOCATION/3_"$NAME"_alignment_and_cluster/Derep_alignment/all_seqs_derep_aligned.fasta --outfile $LOCATION/3_"$NAME"_alignment_and_cluster/complete_linkage_cluster/distance_matrix/all_seqs_derep_aligned.fasta_matrix.bin --mask #=GC_RF -l 25 --dist-cutoff $DIST

echo "Performing complete linkage clustering ..."
java -Xmx16g -jar $CLUST cluster --method complete --id-mapping $LOCATION/3_"$NAME"_alignment_and_cluster/Derep_alignment/all_seqs.ids --sample-mapping $LOCATION/3_"$NAME"_alignment_and_cluster/Derep_alignment/all_seqs.samples --dist-file $LOCATION/3_"$NAME"_alignment_and_cluster/complete_linkage_cluster/distance_matrix/all_seqs_derep_aligned.fasta_matrix.bin --outfile $LOCATION/3_"$NAME"_alignment_and_cluster/complete_linkage_cluster/all_seqs_derep_aligned.fasta_complete.clust --step $STEP

echo "Generating biom format file for R ..."
echo "Converting otu table to biom ..."
mkdir $LOCATION/3_"$NAME"_alignment_and_cluster/R
cd $LOCATION/3_"$NAME"_alignment_and_cluster/R
java -Xmx2g -jar $CLUST cluster-to-biom $LOCATION/3_"$NAME"_alignment_and_cluster/complete_linkage_cluster/all_seqs_derep_aligned.fasta_complete.clust $DIST > $LOCATION/3_"$NAME"_alignment_and_cluster/R/all_complete.clust.biom

echo "Classify each otu ..."
java -Xmx4g -jar $CLUST rep-seqs -c --id-mapping $LOCATION/3_"$NAME"_alignment_and_cluster/Derep_alignment/all_seqs.ids --one-rep-per-otu $LOCATION/3_"$NAME"_alignment_and_cluster/complete_linkage_cluster/all_seqs_derep_aligned.fasta_complete.clust $DIST $LOCATION/3_"$NAME"_alignment_and_cluster/Derep_alignment/all_seqs_derep_aligned.fasta

java -Xmx4g -jar $CLASSIFIER classify -c $BOOTSTRAP_VALUE -f biom -m $LOCATION/3_"$NAME"_alignment_and_cluster/R/all_complete.clust.biom

echo "Constructing phylogenetic tree ..."
cd $LOCATION/3_"$NAME"_alignment_and_cluster/R
java -Xms4g -jar $CLUST derep -f -o all_complete.clust_rep_seqs_modelonly.fasta rep_seqs.ids rep_seqs.sample all_complete.clust_rep_seqs.fasta

$FASTTREE -nt -gtr < all_complete.clust_rep_seqs.fasta > all_complete.clust_rep_seqs.nwk

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


Adding phusion baseimage regen ssh host keys file

#!/bin/bash
set -e
if [[ ! -e /etc/ssh/ssh_host_rsa_key ]]; then
	echo "No SSH host key available. Generating one..."
	export LC_ALL=C
	export DEBIAN_FRONTEND=noninteractive
	dpkg-reconfigure openssh-server
fi

error: pathspec 'baseimage-jessie/00_regen_ssh_host_keys.sh' did not match any file(s) known to git


minor change

minor change

Changed  around indentation in the tests logs. It looked a bit derpy,
but this should fix it!

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


add shell script

add shell script

#!/bin/bash
CMDNAME=`basename $0`
if [[ $1 = "help" ]]; then
  echo "Usage: $CMDNAME [clean]"
  echo ""
  exit
fi

RED=`tput setaf 1`
GREEN=`tput setaf 2`
PINK=`tput setaf 5`
LIGHTBLUE=`tput setaf 6`
NOCOLOR=`tput sgr0`

# make clean
if [[ $1 = "clean" ]]; then
  for file in `ls -d *`
  do
    if [ -e "${file}/Makefile" ]; then
      cd "${file}"
      echo "${GREEN}Clean project: " ${file} "${NOCOLOR}"
      make clean >& /dev/null
      if [ $? -ne 0 ]; then
          echo "${RED}Error: " ${file} "${NOCOLOR}"
          echo ""
          break;
      fi
	  cd ..
    fi
  done
fi

# make
for file in `ls -d *`
do
  if [ -e "${file}/Makefile" ]; then
	echo "${PINK}Start project: " ${file} "${NOCOLOR}"
    cd "${file}"
    make > /dev/null
    if [ $? -ne 0 ]; then
        echo "${RED}Compile error: " ${file} "${NOCOLOR}"
		echo ""
        break;
    fi
    cd ..
	echo "${LIGHTBLUE}Build project: " ${file} "${NOCOLOR}"
  fi
done

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


#984 added bash script for build and deployment

#!/bin/bash
# this script builds the project with a given profile and deploys it
# to the correct space in cloudfoundry
if [[ $0 != ./deploy/* ]]; then
  echo "Please run this script from the root of our repository!"
  exit -1
fi
PROFILE="$1"
if [ -z ${PROFILE} ]; then
  echo "Please provide a valid profile e.g.: $0 dev"
  exit -1
fi
echo "Going to run maven build and cloudfoundry deployment with profile: ${PROFILE}"
mvn -P${PROFILE} clean package
if [ $? -ne 0 ]; then
    echo "Maven build failed!"
    exit -1
fi
cf login -o DZHW -s ${PROFILE}
if [ $? -ne 0 ]; then
    echo "cf login failed!"
    exit -1
fi
cf push -f ./deploy/manifest-${PROFILE}.yml
if [ $? -ne 0 ]; then
    echo "cf push failed!"
    exit -1
fi

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


update and improve ci script

update and improve ci 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/mancoast/cado-nfs.git/'


Create tun-01_up.sh

Create tun-01_up.sh

#!/bin/sh
ip route replace 0.0.0.0/1 via $5 table 42
ip route replace 128.0.0.0/1 via $5 table 42
exit 0

error: pathspec 'basic-config/etc/openvpn/tun-01_up.sh' did not match any file(s) known to git


tasks: added dropbox blog dir task

tasks: added dropbox blog dir task

The dir in dropbox serves as a way to easily put draft files in a place
that can be picked up by the server that builds my website

#!/bin/bash

TASK_NAME=$(basename $0)
DEST=$1

die () {
    echo "$TASK_NAME: $2";
    exit $1
}

HOSTNAME=$(hostname)
if [[ $HOSTNAME == "csand-fedora-vm" ]]; then
    SRC="/home/csand/Dropbox/blog"
elif [[ $HOSTNAME == "shiny" ]]; then
    SRC="/home/csand/Dropbox/blog"
elif [[ $HOSTNAME == "obsidian" ]]; then
    SRC="/home/csand/Dropbox/blog"
elif [[ $HOSTNAME == 'fedora-vm' ]]; then
    SRC="/home/csand/storage/Dropbox/blog"
else
    echo "AAHHH, DONT KNOW WHAT TO DO WITH HOST `hostname`"
fi

test -z $SRC && die 1 "No source path defined for $HOSTNAME"

echo "$TASK_NAME: copying blog: $SRC $DEST"
rsync -haP --no-whole-file --inplace --exclude template.rst $SRC $DEST
echo "$TASK_NAME: done"

error: pathspec 'tasks/17_dropbox_blog.sh' did not match any file(s) known to git


renaming appropriately the setup data file

./setup-test-data.sh -t "path_to_tests" -d "db_svr" -m "mgt_svr" -p "hypervisor root password"

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


tests: Skip coverage for optional and uncompiled objects.

The compat.o object is optional, and in recent systems, will be an
empty stub. To avoid a warning or two during 'make coverage', skip
objects that have no coverage info.

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/algernon/libmongo-client.git/'


Allow branch name in vendor-helper script

With this, you can specify a branch name in the
vendor script instead of a commit ID. This makes it easier
to quickly test changes in dep'd repos outside of the DIND
environment.

Signed-off-by: Christy Perez <e36a6a75d8488ac8f165cb3a961f159210197059@linux.vnet.ibm.com>

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


add something

add something

#!/bin/bash

sparkdir=`ls -l /usr/local | grep '^d.*spark.*' | rev | cut -d ' ' -f1 | rev`
ln -s /usr/local/$sparkdir /usr/local/spark

cp /usr/local/spark/conf/spark-env.sh.template /usr/local/spark/conf/spark-env.sh

echo -e "
HADOOP_CONF_DIR=/usr/local/hadoop/etc/hadoop
JAVA_HOME=/usr/local/jdk
CLASSPATH=$JAVA_HOME/lib
PATH=$PATH:$JAVA_HOME/bin
" >> /usr/local/spark/conf/spark-env.sh

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


Create aliases.sh

Create aliases.sh

# Remove blank lines from file
alias noblanks='grep -v "^[[:space:]]*$"'

# Show only the lines with content in a config file, strip #comment lines and empty lines
alias meat='grep -v "^#" | noblanks'

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


Create install-node-and-mongo.sh

Create install-node-and-mongo.sh

# install node
sudo apt-get update
sudo apt-get install python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs

# install mongodb
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/10gen.list
sudo apt-get update
sudo apt-get install mongodb-10gen

error: pathspec 'utils/install-node-and-mongo.sh' did not match any file(s) known to git


update

update

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


Propose translations: Fix handling of deleted files

Today's propose_translation_update.sh run failed for ceilometer since
files were deleted but the loop in filter_commit considered these
as zero changing lines. Change the loop to check only new and modified
files.

Change-Id: I94f5389b9fe0c16d529860f57bb63ef8a3c5c64a

#!/bin/bash -xe
# Common code used by propose_translation_update.sh and
# upstream_translation_update.sh

# 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.

# Used for setup.py babel commands
QUIET="--quiet"

# Initial transifex setup
function setup_translation {
    # Track in HAS_CONFIG whether we run "tx init" since calling it
    # will add the file .tx/config - and "tx set" might update it. If
    # "tx set" updates .tx/config, we need to handle the file if it
    # existed before.
    HAS_CONFIG=1

    # Initialize the transifex client, if there's no .tx directory
    if [ ! -d .tx ] ; then
        tx init --host=https://www.transifex.com
        HAS_CONFIG=0
    fi
}

# Setup a project for transifex
function setup_project {
    local project=$1

    # Transifex project name does not include "."
    tx_project=${project/\./}
    tx set --auto-local -r ${tx_project}.${tx_project}-translations \
        "${project}/locale/<lang>/LC_MESSAGES/${project}.po" \
        --source-lang en \
        --source-file ${project}/locale/${project}.pot -t PO \
        --execute
}

# Setup project horizon for transifex
function setup_horizon {
    local project=horizon

    # Horizon JavaScript Translations
    tx set --auto-local -r ${project}.${project}-js-translations \
        "${project}/locale/<lang>/LC_MESSAGES/djangojs.po" \
        --source-lang en \
        --source-file ${project}/locale/en/LC_MESSAGES/djangojs.po \
        -t PO --execute

    # Horizon Translations
    tx set --auto-local -r ${project}.${project}-translations \
        "${project}/locale/<lang>/LC_MESSAGES/django.po" \
        --source-lang en \
        --source-file ${project}/locale/en/LC_MESSAGES/django.po \
        -t PO --execute

    # OpenStack Dashboard Translations
    tx set --auto-local -r ${project}.openstack-dashboard-translations \
        "openstack_dashboard/locale/<lang>/LC_MESSAGES/django.po" \
        --source-lang en \
        --source-file openstack_dashboard/locale/en/LC_MESSAGES/django.po \
        -t PO --execute
}

# Set global variable DocFolder for manuals projects
function init_manuals {
    project=$1

    DocFolder="doc"
    if [ $project = "api-site" -o $project = "security-doc" ] ; then
        DocFolder="./"
    fi
}

# Setup project manuals projects (api-site, openstack-manuals,
# operations-guide) for transifex
function setup_manuals {
    local project=$1

    # Fill in associative array SPECIAL_BOOKS
    declare -A SPECIAL_BOOKS
    source doc-tools-check-languages.conf

    # Generate pot one by one
    for FILE in ${DocFolder}/*; do
        # Skip non-directories
        if [ ! -d $FILE ]; then
            continue
        fi
        DOCNAME=${FILE#${DocFolder}/}
        # Ignore directories that will not get translated
        if [[ "$DOCNAME" =~ ^(www|tools|generated|publish-docs)$ ]]; then
            continue
        fi
        # Skip glossary in all repos besides openstack-manuals.
        if [ "$project" != "openstack-manuals" -a "$DOCNAME" == "glossary" ]; then
            continue
        fi
        # Minimum amount of translation done, 75 % by default.
        PERC=75
        if [ "$project" == "openstack-manuals" ]; then
            # The common and glossary directories are used by the
            # other guides, let's be more liberal here since teams
            # might only translate the files used by a single
            # guide. We use 8 % since that downloads the currently
            # translated files.
            if [ "$DOCNAME" == "common" -o "$DOCNAME" == "glossary" ]; then
                PERC=8
            fi
        fi
        IS_RST=0
        if [ ${SPECIAL_BOOKS["${DOCNAME}"]+_} ] ; then
            case "${SPECIAL_BOOKS["${DOCNAME}"]}" in
                RST)
                    IS_RST=1
                    ;;
                skip)
                    continue
                    ;;
            esac
        fi
        if [ ${IS_RST} -eq 1 ] ; then
            tox -e generatepot-rst -- ${DOCNAME}
            git add ${DocFolder}/${DOCNAME}/source/locale/${DOCNAME}.pot
            # Set auto-local
            tx set --auto-local -r openstack-manuals-i18n.${DOCNAME} \
                "${DocFolder}/${DOCNAME}/source/locale/<lang>/LC_MESSAGES/${DOCNAME}.po" \
                --source-lang en \
                --source-file ${DocFolder}/${DOCNAME}/source/locale/${DOCNAME}.pot \
                --minimum-perc=$PERC \
                -t PO --execute
        else
            # Update the .pot file
            ./tools/generatepot ${DOCNAME}
            if [ -f ${DocFolder}/${DOCNAME}/locale/${DOCNAME}.pot ]; then
                # Add all changed files to git
                git add ${DocFolder}/${DOCNAME}/locale/${DOCNAME}.pot
                # Set auto-local
                tx set --auto-local -r openstack-manuals-i18n.${DOCNAME} \
                    "${DocFolder}/${DOCNAME}/locale/<lang>.po" --source-lang en \
                    --source-file ${DocFolder}/${DOCNAME}/locale/${DOCNAME}.pot \
                    --minimum-perc=$PERC \
                    -t PO --execute
            fi
        fi
    done

}

# Setup git so that git review works
function setup_git {
    git config user.name "OpenStack Proposal Bot"
    git config user.email "openstack-infra@lists.openstack.org"
    git config gitreview.username "proposal-bot"
}

# Setup project so that git review works, sets global variable
# COMMIT_MSG.
function setup_review {
    FULL_PROJECT=$(grep project .gitreview  | cut -f2 -d= |sed -e 's/\.git$//')
    set +e
    read -d '' COMMIT_MSG <<EOF
Imported Translations from Transifex

For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure
EOF
    set -e
    git review -s

    # See if there is an open change in the transifex/translations
    # topic. If so, get the change id for the existing change for use
    # in the commit msg.
    change_info=`ssh -p 29418 proposal-bot@review.openstack.org gerrit query --current-patch-set status:open project:$FULL_PROJECT topic:transifex/translations owner:proposal-bot`
    previous=`echo "$change_info" | grep "^  number:" | awk '{print $2}'`
    if [ "x${previous}" != "x" ] ; then
        change_id=`echo "$change_info" | grep "^change" | awk '{print $2}'`
        # Read returns a non zero value when it reaches EOF. Because we use a
        # heredoc here it will always reach EOF and return a nonzero value.
        # Disable -e temporarily to get around the read.
        set +e
        read -d '' COMMIT_MSG <<EOF
Imported Translations from Transifex

For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure

Change-Id: $change_id
EOF
        set -e
    fi
    # If the open change an already approved, let's not queue a new
    # patch but let's merge the other patch first.
    # This solves the problem that when the gate pipeline backup
    # reaches roughly a day, no matter how quickly you approve the new
    # update it will always get sniped out of the gate by another.
    # It also helps, when you approve close to the time this job is
    # run.
    if [ "x${previous}" != "x" ] ; then
        # Use the JSON format since it is very compact and easy to grep
        change_info=`ssh -p 29418 proposal-bot@review.openstack.org gerrit query --current-patch-set --format=JSON $change_id`
        # Check for:
        # 1) Workflow approval (+1)
        # 2) no -1/-2 by Jenkins
        # 3) no -2 by reviewers
        # 4) no Workflow -1 (WIP)
        #
        if  `echo $change_info|grep -q '{"type":"Workflow","description":"Workflow","value":"1"'` \
            && ! `echo $change_info|grep -q '{"type":"Verified","description":"Verified","value":"-[12]","grantedOn":[0-9]*,"by":{"name":"Jenkins","username":"jenkins"}}'`  \
            && ! `echo $change_info|grep -q '{"type":"Code-Review","description":"Code-Review","value":"-2"'` \
            && ! `echo $change_info|grep -q '{"type":"Workflow","description":"Workflow","value":"-1"'`  ; then
            echo "Job already approved, exiting"
            exit 0
        fi
    fi
}

# Propose patch using COMMIT_MSG
function send_patch {

    # Revert any changes done to .tx/config
    if [ $HAS_CONFIG -eq 1 ]; then
        git reset -q .tx/config
        git checkout -- .tx/config
    else
        rm -rf .tx
    fi

    # Don't send a review if nothing has changed.
    if [ `git diff --cached |wc -l` -gt 0 ]; then
        # Commit and review
        git commit -F- <<EOF
$COMMIT_MSG
EOF
        git review -t transifex/translations

    fi
}

# Setup global variables LEVELS and LKEYWORDS
function setup_loglevel_vars {
    # Strings for various log levels
    LEVELS="info warning error critical"
    # Keywords for each log level:
    declare -g -A LKEYWORD
    LKEYWORD['info']='_LI'
    LKEYWORD['warning']='_LW'
    LKEYWORD['error']='_LE'
    LKEYWORD['critical']='_LC'
}

# Setup transifex configuration for log level message translation.
# Needs variables setup via setup_loglevel_vars.
function setup_loglevel_project {
    project=$1

    # Transifex project name does not include "."
    tx_project=${project/\./}

    for level in $LEVELS ; do
        # Bootstrapping: Create file if it does not exist yet,
        # otherwise "tx set" will fail.
        if [ ! -e  ${project}/locale/${project}-log-${level}.pot ]; then
            touch ${project}/locale/${project}-log-${level}.pot
        fi
        tx set --auto-local -r ${tx_project}.${tx_project}-log-${level}-translations \
            "${project}/locale/<lang>/LC_MESSAGES/${project}-log-${level}.po" \
            --source-lang en \
            --source-file ${project}/locale/${project}-log-${level}.pot -t PO \
            --execute
    done
}

# Run extract_messages for user visible messages and log messages.
# Needs variables setup via setup_loglevel_vars.
function extract_messages_log {
    project=$1

    # Update the .pot files
    python setup.py $QUIET extract_messages
    for level in $LEVELS ; do
        python setup.py $QUIET extract_messages --no-default-keywords \
            --keyword ${LKEYWORD[$level]} \
            --output-file ${project}/locale/${project}-log-${level}.pot
    done
}

# Setup project django_openstack_auth for transifex
function setup_django_openstack_auth {
    tx set --auto-local -r horizon.djangopo \
        "openstack_auth/locale/<lang>/LC_MESSAGES/django.po" \
        --source-lang en \
        --source-file openstack_auth/locale/openstack_auth.pot -t PO \
        --execute
}

# Filter out files that we do not want to commit
function filter_commits {
    # Don't add new empty files.
    for f in `git diff --cached --name-only --diff-filter=A`; do
        # Files should have at least one non-empty msgid string.
        if ! grep -q 'msgid "[^"]' "$f" ; then
            git reset -q "$f"
            rm "$f"
        fi
    done

    # Don't send files where the only things which have changed are
    # the creation date, the version number, the revision date,
    # comment lines, or diff file information.
    # Also, don't send files if only .pot files would be changed.
    PO_CHANGE=0
    # Don't iterate over deleted files
    for f in `git diff --cached --name-only --diff-filter=AM`; do
        # It's ok if the grep fails
        set +e
        changed=$(git diff --cached "$f" \
            | egrep -v "(POT-Creation-Date|Project-Id-Version|PO-Revision-Date)" \
            | egrep -c "^([-+][^-+#])")
        added=$(git diff --cached "$f" \
            | egrep -v "(POT-Creation-Date|Project-Id-Version|PO-Revision-Date)" \
            | egrep -c "^([+][^+#])")
        set -e
        if [ $changed -eq 0 ]; then
            git reset -q "$f"
            git checkout -- "$f"
        # Check for all files endig with ".po".
        # We will take this import if at least one change adds new content,
        # thus adding a new translation.
        # If only lines are removed, we do not need this.
        elif [[ $added -gt 0 && $f =~ .po$ ]] ; then
            PO_CHANGE=1
        fi
    done
    # If no po file was changed, only pot source files were changed
    # and those changes can be ignored as they give no benefit on
    # their own.
    if [ $PO_CHANGE -eq 0 ] ; then
        for f in `git diff --cached --name-only` ; do
            git reset -q "$f"
            git checkout -- "$f"
        done
    fi
}

# Remove obsolete files. We might have added them in the past but
# would not add them today, so let's eventually remove them.
function cleanup_po_files {
    local project=$1

    for i in `find $project/locale -name *.po `; do
        # Output goes to stderr, so redirect to stdout to catch it.
        trans=`msgfmt --statistics -o /dev/null "$i" 2>&1`
        check="^0 translated messages"
        if [[ $trans =~ $check ]] ; then
            # Nothing is translated, remove the file.
            git rm -f "$i"
        else
            if [[ $trans =~ " translated message" ]] ; then
                trans_no=`echo $trans|sed -e 's/ translated message.*$//'`
            else
                trans_no=0
            fi
            if [[ $trans =~ " untranslated message" ]] ; then
                untrans_no=`echo $trans|sed -e 's/^.* \([0-9]*\) untranslated message.*/\1/'`
            else
                untrans_no=0
            fi
            let total=$trans_no+$untrans_no
            let ratio=100*$trans_no/$total
            # Since we only download files that are at least
            # translated to 75 per cent, let's delete those that have
            # signficantly less translations.
            # For now we delete files that suddenly are less than 20
            # per cent translated.
            if [[ "$ratio" -lt "20" ]] ; then
                git rm -f "$i"
            fi
        fi
    done
}

# Reduce size of po files. This reduces the amount of content imported
# and makes for fewer imports.
# This does not touch the pot files. This way we can reconstruct the po files
# using "msgmerge POTFILE POFILE -o COMPLETEPOFILE".
function compress_po_files {
    local directory=$1

    for i in `find $directory -name *.po `; do
        msgattrib --translated --no-location "$i" --output="${i}.tmp"
        mv "${i}.tmp" "$i"
    done
}

# Reduce size of po files. This reduces the amount of content imported
# and makes for fewer imports.
# This does not touch the pot files. This way we can reconstruct the po files
# using "msgmerge POTFILE POFILE -o COMPLETEPOFILE".
# Give directory name to not touch files for example under .tox.
# Pass glossary flag to not touch the glossary.
function compress_manual_po_files {
    local directory=$1
    local glossary=$2
    for i in `find $directory -name *.po `; do
        if [ "$glossary" -eq "0" ] ; then
            if [[ $i =~ "/glossary/" ]] ; then
                continue
            fi
        fi
        msgattrib --translated --no-location "$i" --output="${i}.tmp"
        mv "${i}.tmp" "$i"
    done
}

# Reduce size of po files. This reduces the amount of content imported
# and makes for fewer imports.
# Some projects have no pot files (see function compress_po_files) but
# use the English po file as source. For these projects we should not
# touch the English po file. This way we can reconstruct the po files
# using "msgmerge EnglishPOTFILE POFILE -o COMPLETEPOFILE".
function compress_non_en_po_files {
    local directory=$1

    for i in `find $directory -name *.po `; do
        if [[ $i =~ "/locale/en/LC_MESSAGES/" ]] ; then
            continue
        fi
        msgattrib --translated --no-location "$i" --output="${i}.tmp"
        mv "${i}.tmp" "$i"
    done
}

#!/bin/bash -xe
# Common code used by propose_translation_update.sh and
# upstream_translation_update.sh

# 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.

# Used for setup.py babel commands
QUIET="--quiet"

# Initial transifex setup
function setup_translation {
    # Track in HAS_CONFIG whether we run "tx init" since calling it
    # will add the file .tx/config - and "tx set" might update it. If
    # "tx set" updates .tx/config, we need to handle the file if it
    # existed before.
    HAS_CONFIG=1

    # Initialize the transifex client, if there's no .tx directory
    if [ ! -d .tx ] ; then
        tx init --host=https://www.transifex.com
        HAS_CONFIG=0
    fi
}

# Setup a project for transifex
function setup_project {
    local project=$1

    # Transifex project name does not include "."
    tx_project=${project/\./}
    tx set --auto-local -r ${tx_project}.${tx_project}-translations \
        "${project}/locale/<lang>/LC_MESSAGES/${project}.po" \
        --source-lang en \
        --source-file ${project}/locale/${project}.pot -t PO \
        --execute
}

# Setup project horizon for transifex
function setup_horizon {
    local project=horizon

    # Horizon JavaScript Translations
    tx set --auto-local -r ${project}.${project}-js-translations \
        "${project}/locale/<lang>/LC_MESSAGES/djangojs.po" \
        --source-lang en \
        --source-file ${project}/locale/en/LC_MESSAGES/djangojs.po \
        -t PO --execute

    # Horizon Translations
    tx set --auto-local -r ${project}.${project}-translations \
        "${project}/locale/<lang>/LC_MESSAGES/django.po" \
        --source-lang en \
        --source-file ${project}/locale/en/LC_MESSAGES/django.po \
        -t PO --execute

    # OpenStack Dashboard Translations
    tx set --auto-local -r ${project}.openstack-dashboard-translations \
        "openstack_dashboard/locale/<lang>/LC_MESSAGES/django.po" \
        --source-lang en \
        --source-file openstack_dashboard/locale/en/LC_MESSAGES/django.po \
        -t PO --execute
}

# Set global variable DocFolder for manuals projects
function init_manuals {
    project=$1

    DocFolder="doc"
    if [ $project = "api-site" -o $project = "security-doc" ] ; then
        DocFolder="./"
    fi
}

# Setup project manuals projects (api-site, openstack-manuals,
# operations-guide) for transifex
function setup_manuals {
    local project=$1

    # Fill in associative array SPECIAL_BOOKS
    declare -A SPECIAL_BOOKS
    source doc-tools-check-languages.conf

    # Generate pot one by one
    for FILE in ${DocFolder}/*; do
        # Skip non-directories
        if [ ! -d $FILE ]; then
            continue
        fi
        DOCNAME=${FILE#${DocFolder}/}
        # Ignore directories that will not get translated
        if [[ "$DOCNAME" =~ ^(www|tools|generated|publish-docs)$ ]]; then
            continue
        fi
        # Skip glossary in all repos besides openstack-manuals.
        if [ "$project" != "openstack-manuals" -a "$DOCNAME" == "glossary" ]; then
            continue
        fi
        # Minimum amount of translation done, 75 % by default.
        PERC=75
        if [ "$project" == "openstack-manuals" ]; then
            # The common and glossary directories are used by the
            # other guides, let's be more liberal here since teams
            # might only translate the files used by a single
            # guide. We use 8 % since that downloads the currently
            # translated files.
            if [ "$DOCNAME" == "common" -o "$DOCNAME" == "glossary" ]; then
                PERC=8
            fi
        fi
        IS_RST=0
        if [ ${SPECIAL_BOOKS["${DOCNAME}"]+_} ] ; then
            case "${SPECIAL_BOOKS["${DOCNAME}"]}" in
                RST)
                    IS_RST=1
                    ;;
                skip)
                    continue
                    ;;
            esac
        fi
        if [ ${IS_RST} -eq 1 ] ; then
            tox -e generatepot-rst -- ${DOCNAME}
            git add ${DocFolder}/${DOCNAME}/source/locale/${DOCNAME}.pot
            # Set auto-local
            tx set --auto-local -r openstack-manuals-i18n.${DOCNAME} \
                "${DocFolder}/${DOCNAME}/source/locale/<lang>/LC_MESSAGES/${DOCNAME}.po" \
                --source-lang en \
                --source-file ${DocFolder}/${DOCNAME}/source/locale/${DOCNAME}.pot \
                --minimum-perc=$PERC \
                -t PO --execute
        else
            # Update the .pot file
            ./tools/generatepot ${DOCNAME}
            if [ -f ${DocFolder}/${DOCNAME}/locale/${DOCNAME}.pot ]; then
                # Add all changed files to git
                git add ${DocFolder}/${DOCNAME}/locale/${DOCNAME}.pot
                # Set auto-local
                tx set --auto-local -r openstack-manuals-i18n.${DOCNAME} \
                    "${DocFolder}/${DOCNAME}/locale/<lang>.po" --source-lang en \
                    --source-file ${DocFolder}/${DOCNAME}/locale/${DOCNAME}.pot \
                    --minimum-perc=$PERC \
                    -t PO --execute
            fi
        fi
    done

}

# Setup git so that git review works
function setup_git {
    git config user.name "OpenStack Proposal Bot"
    git config user.email "openstack-infra@lists.openstack.org"
    git config gitreview.username "proposal-bot"
}

# Setup project so that git review works, sets global variable
# COMMIT_MSG.
function setup_review {
    FULL_PROJECT=$(grep project .gitreview  | cut -f2 -d= |sed -e 's/\.git$//')
    set +e
    read -d '' COMMIT_MSG <<EOF
Imported Translations from Transifex

For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure
EOF
    set -e
    git review -s

    # See if there is an open change in the transifex/translations
    # topic. If so, get the change id for the existing change for use
    # in the commit msg.
    change_info=`ssh -p 29418 proposal-bot@review.openstack.org gerrit query --current-patch-set status:open project:$FULL_PROJECT topic:transifex/translations owner:proposal-bot`
    previous=`echo "$change_info" | grep "^  number:" | awk '{print $2}'`
    if [ "x${previous}" != "x" ] ; then
        change_id=`echo "$change_info" | grep "^change" | awk '{print $2}'`
        # Read returns a non zero value when it reaches EOF. Because we use a
        # heredoc here it will always reach EOF and return a nonzero value.
        # Disable -e temporarily to get around the read.
        set +e
        read -d '' COMMIT_MSG <<EOF
Imported Translations from Transifex

For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure

Change-Id: $change_id
EOF
        set -e
    fi
    # If the open change an already approved, let's not queue a new
    # patch but let's merge the other patch first.
    # This solves the problem that when the gate pipeline backup
    # reaches roughly a day, no matter how quickly you approve the new
    # update it will always get sniped out of the gate by another.
    # It also helps, when you approve close to the time this job is
    # run.
    if [ "x${previous}" != "x" ] ; then
        # Use the JSON format since it is very compact and easy to grep
        change_info=`ssh -p 29418 proposal-bot@review.openstack.org gerrit query --current-patch-set --format=JSON $change_id`
        # Check for:
        # 1) Workflow approval (+1)
        # 2) no -1/-2 by Jenkins
        # 3) no -2 by reviewers
        # 4) no Workflow -1 (WIP)
        #
        if  `echo $change_info|grep -q '{"type":"Workflow","description":"Workflow","value":"1"'` \
            && ! `echo $change_info|grep -q '{"type":"Verified","description":"Verified","value":"-[12]","grantedOn":[0-9]*,"by":{"name":"Jenkins","username":"jenkins"}}'`  \
            && ! `echo $change_info|grep -q '{"type":"Code-Review","description":"Code-Review","value":"-2"'` \
            && ! `echo $change_info|grep -q '{"type":"Workflow","description":"Workflow","value":"-1"'`  ; then
            echo "Job already approved, exiting"
            exit 0
        fi
    fi
}

# Propose patch using COMMIT_MSG
function send_patch {

    # Revert any changes done to .tx/config
    if [ $HAS_CONFIG -eq 1 ]; then
        git reset -q .tx/config
        git checkout -- .tx/config
    else
        rm -rf .tx
    fi

    # Don't send a review if nothing has changed.
    if [ `git diff --cached |wc -l` -gt 0 ]; then
        # Commit and review
        git commit -F- <<EOF
$COMMIT_MSG
EOF
        git review -t transifex/translations

    fi
}

# Setup global variables LEVELS and LKEYWORDS
function setup_loglevel_vars {
    # Strings for various log levels
    LEVELS="info warning error critical"
    # Keywords for each log level:
    declare -g -A LKEYWORD
    LKEYWORD['info']='_LI'
    LKEYWORD['warning']='_LW'
    LKEYWORD['error']='_LE'
    LKEYWORD['critical']='_LC'
}

# Setup transifex configuration for log level message translation.
# Needs variables setup via setup_loglevel_vars.
function setup_loglevel_project {
    project=$1

    # Transifex project name does not include "."
    tx_project=${project/\./}

    for level in $LEVELS ; do
        # Bootstrapping: Create file if it does not exist yet,
        # otherwise "tx set" will fail.
        if [ ! -e  ${project}/locale/${project}-log-${level}.pot ]; then
            touch ${project}/locale/${project}-log-${level}.pot
        fi
        tx set --auto-local -r ${tx_project}.${tx_project}-log-${level}-translations \
            "${project}/locale/<lang>/LC_MESSAGES/${project}-log-${level}.po" \
            --source-lang en \
            --source-file ${project}/locale/${project}-log-${level}.pot -t PO \
            --execute
    done
}

# Run extract_messages for user visible messages and log messages.
# Needs variables setup via setup_loglevel_vars.
function extract_messages_log {
    project=$1

    # Update the .pot files
    python setup.py $QUIET extract_messages
    for level in $LEVELS ; do
        python setup.py $QUIET extract_messages --no-default-keywords \
            --keyword ${LKEYWORD[$level]} \
            --output-file ${project}/locale/${project}-log-${level}.pot
    done
}

# Setup project django_openstack_auth for transifex
function setup_django_openstack_auth {
    tx set --auto-local -r horizon.djangopo \
        "openstack_auth/locale/<lang>/LC_MESSAGES/django.po" \
        --source-lang en \
        --source-file openstack_auth/locale/openstack_auth.pot -t PO \
        --execute
}

# Filter out files that we do not want to commit
function filter_commits {
    # Don't add new empty files.
    for f in `git diff --cached --name-only --diff-filter=A`; do
        # Files should have at least one non-empty msgid string.
        if ! grep -q 'msgid "[^"]' "$f" ; then
            git reset -q "$f"
            rm "$f"
        fi
    done

    # Don't send files where the only things which have changed are
    # the creation date, the version number, the revision date,
    # comment lines, or diff file information.
    # Also, don't send files if only .pot files would be changed.
    PO_CHANGE=0
    for f in `git diff --cached --name-only`; do
        # It's ok if the grep fails
        set +e
        changed=$(git diff --cached "$f" \
            | egrep -v "(POT-Creation-Date|Project-Id-Version|PO-Revision-Date)" \
            | egrep -c "^([-+][^-+#])")
        added=$(git diff --cached "$f" \
            | egrep -v "(POT-Creation-Date|Project-Id-Version|PO-Revision-Date)" \
            | egrep -c "^([+][^+#])")
        set -e
        if [ $changed -eq 0 ]; then
            git reset -q "$f"
            git checkout -- "$f"
        # Check for all files endig with ".po".
        # We will take this import if at least one change adds new content,
        # thus adding a new translation.
        # If only lines are removed, we do not need this.
        elif [[ $added -gt 0 && $f =~ .po$ ]] ; then
            PO_CHANGE=1
        fi
    done
    # If no po file was changed, only pot source files were changed
    # and those changes can be ignored as they give no benefit on
    # their own.
    if [ $PO_CHANGE -eq 0 ] ; then
        for f in `git diff --cached --name-only` ; do
            git reset -q "$f"
            git checkout -- "$f"
        done
    fi
}

# Remove obsolete files. We might have added them in the past but
# would not add them today, so let's eventually remove them.
function cleanup_po_files {
    local project=$1

    for i in `find $project/locale -name *.po `; do
        # Output goes to stderr, so redirect to stdout to catch it.
        trans=`msgfmt --statistics -o /dev/null "$i" 2>&1`
        check="^0 translated messages"
        if [[ $trans =~ $check ]] ; then
            # Nothing is translated, remove the file.
            git rm -f "$i"
        else
            if [[ $trans =~ " translated message" ]] ; then
                trans_no=`echo $trans|sed -e 's/ translated message.*$//'`
            else
                trans_no=0
            fi
            if [[ $trans =~ " untranslated message" ]] ; then
                untrans_no=`echo $trans|sed -e 's/^.* \([0-9]*\) untranslated message.*/\1/'`
            else
                untrans_no=0
            fi
            let total=$trans_no+$untrans_no
            let ratio=100*$trans_no/$total
            # Since we only download files that are at least
            # translated to 75 per cent, let's delete those that have
            # signficantly less translations.
            # For now we delete files that suddenly are less than 20
            # per cent translated.
            if [[ "$ratio" -lt "20" ]] ; then
                git rm -f "$i"
            fi
        fi
    done
}

# Reduce size of po files. This reduces the amount of content imported
# and makes for fewer imports.
# This does not touch the pot files. This way we can reconstruct the po files
# using "msgmerge POTFILE POFILE -o COMPLETEPOFILE".
function compress_po_files {
    local directory=$1

    for i in `find $directory -name *.po `; do
        msgattrib --translated --no-location "$i" --output="${i}.tmp"
        mv "${i}.tmp" "$i"
    done
}

# Reduce size of po files. This reduces the amount of content imported
# and makes for fewer imports.
# This does not touch the pot files. This way we can reconstruct the po files
# using "msgmerge POTFILE POFILE -o COMPLETEPOFILE".
# Give directory name to not touch files for example under .tox.
# Pass glossary flag to not touch the glossary.
function compress_manual_po_files {
    local directory=$1
    local glossary=$2
    for i in `find $directory -name *.po `; do
        if [ "$glossary" -eq "0" ] ; then
            if [[ $i =~ "/glossary/" ]] ; then
                continue
            fi
        fi
        msgattrib --translated --no-location "$i" --output="${i}.tmp"
        mv "${i}.tmp" "$i"
    done
}

# Reduce size of po files. This reduces the amount of content imported
# and makes for fewer imports.
# Some projects have no pot files (see function compress_po_files) but
# use the English po file as source. For these projects we should not
# touch the English po file. This way we can reconstruct the po files
# using "msgmerge EnglishPOTFILE POFILE -o COMPLETEPOFILE".
function compress_non_en_po_files {
    local directory=$1

    for i in `find $directory -name *.po `; do
        if [[ $i =~ "/locale/en/LC_MESSAGES/" ]] ; then
            continue
        fi
        msgattrib --translated --no-location "$i" --output="${i}.tmp"
        mv "${i}.tmp" "$i"
    done
}


Update brew_install.sh

Update brew_install.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/steinbaugh/steinbaugh.github.io.git/'


import FoundationNetworking

import FoundationNetworking

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