Add script to update old metadata

Add script to update old metadata

#!/usr/bin/env bash

set -eux

BOX_NAME=$1
BOX_SUFFIX=$2
VERSION=$3

ATLAS_URI=https://atlas.hashicorp.com/api/v1/box/${ATLAS_USERNAME}

callGETService() {
    local uri=$1

    echo "Calling URI (GET): " ${uri}
    curl -X GET "${uri}" --output "${COMM_FILE}" 2> /dev/null > "${COMM_FILE}"
}

COMM_FILE_DIR=$(pwd)/.tmpatlas
mkdir -p ${COMM_FILE_DIR}
COMM_FILE=${COMM_FILE_DIR}/atlas_comm.json

echo "==> Checking for existing version"
callGETService ${ATLAS_URI}/${BOX_NAME}?${ATLAS_ACCESS_TOKEN}

existing_version=$(jq -r ".versions[] | select(.version == \"${VERSION}\") | .version" < ${COMM_FILE})

if [[ "${BOX_NAME}" =~ i386 ]]; then
    BIT_STRING="32-bit"
else
    BIT_STRING="64-bit"
fi
DOCKER_STRING=
if [[ "${BOX_NAME}" =~ docker ]]; then
    DOCKER_STRING=" with Docker preinstalled"
fi
DESKTOP_STRING=
if [[ "${BOX_NAME}" =~ desktop ]]; then
    DESKTOP_STRING=" Desktop"
fi
RAW_VERSION=${BOX_NAME#oel}
RAW_VERSION=${RAW_VERSION%-i386}
RAW_VERSION=${RAW_VERSION%-docker}
RAW_VERSION=${RAW_VERSION%-desktop}
PRETTY_VERSION=${RAW_VERSION:0:1}.${RAW_VERSION:1}

VIRTUALBOX_VERSION=$(virtualbox --help | head -n 1 | awk '{print $NF}')
PARALLELS_VERSION=$(prlctl --version | awk '{print $3}')
VMWARE_VERSION=9.9.2

VMWARE_BOX_FILE=box/vmware/${BOX_NAME}${BOX_SUFFIX}
VIRTUALBOX_BOX_FILE=box/virtualbox/${BOX_NAME}${BOX_SUFFIX}
PARALLELS_BOX_FILE=box/parallels/${BOX_NAME}${BOX_SUFFIX}
DESCRIPTION="Oracle Enterprise Linux ${PRETTY_VERSION}${DESKTOP_STRING} (${BIT_STRING})${DOCKER_STRING}, "
if [[ -e ${VMWARE_BOX_FILE} ]]; then
    FILESIZE=$(du -k -h "${VMWARE_BOX_FILE}" | cut -f1)
    DESCRIPTION=${DESCRIPTION}"VMWare ${FILESIZE}B/"
fi
if [[ -e ${VIRTUALBOX_BOX_FILE} ]]; then
    FILESIZE=$(du -k -h "${VIRTUALBOX_BOX_FILE}" | cut -f1)
    DESCRIPTION=${DESCRIPTION}"VirtualBox ${FILESIZE}B/"
fi
if [[ -e ${PARALLELS_BOX_FILE} ]]; then
    FILESIZE=$(du -k -h "${PARALLELS_BOX_FILE}" | cut -f1)
    DESCRIPTION=${DESCRIPTION}"Parallels ${FILESIZE}B/"
fi
DESCRIPTION=${DESCRIPTION%?}
echo ${DESCRIPTION} > ${COMM_FILE_DIR}/description
if [[ -e ${VMWARE_BOX_FILE} ]]; then
    echo >> ${COMM_FILE_DIR}/description
    echo "VMware Tools ${VMWARE_VERSION}" >> ${COMM_FILE_DIR}/description
fi
if [[ -e ${VIRTUALBOX_BOX_FILE} ]]; then
    echo >> ${COMM_FILE_DIR}/description
    echo "VirtualBox Guest Additions ${VIRTUALBOX_VERSION}" >> ${COMM_FILE_DIR}/description
fi
if [[ -e ${PARALLELS_BOX_FILE} ]]; then
    echo >> ${COMM_FILE_DIR}/description
    echo "Parallels Tools ${PARALLELS_VERSION}" >> ${COMM_FILE_DIR}/description
fi

description_json="null"
if [ -n "${COMM_FILE_DIR}/description" ]; then
    description_json=$(jq -s -R . < ${COMM_FILE_DIR}/description)
fi
version_file=VERSION
version_json=$(
    jq -n "{
      version: {
        version: $(jq -R . < $version_file),
        description: ${description_json}
      }
    }"
)

token_param="access_token=${ATLAS_ACCESS_TOKEN}"
echo ${version_json}
if [ -z "${existing_version}" ]; then
  echo "==> none found; creating"
  curl -X POST -H "Content-Type: application/json" ${ATLAS_URI}/${BOX_NAME}/versions?${token_param} -d "$version_json" > ${COMM_FILE_DIR}/version_result.json
else
  echo "==> version found; updating"
  curl -X PUT -H "Content-Type: application/json" ${ATLAS_URI}/${BOX_NAME}/version/${VERSION}?${token_param} -d "$version_json" > ${COMM_FILE_DIR}/version_result.json
fi

status=$(jq -r .status < ${COMM_FILE_DIR}/version_result.json)

echo 'publishing provider'
BOXCUTTER_BASE_URL=http://cdn.boxcutter.io/oel
if [[ -e ${VMWARE_BOX_FILE} ]]; then
    PROVIDER_URL=${BOXCUTTER_BASE_URL}/vmware${VMWARE_VERSION}/${BOX_NAME}${BOX_SUFFIX}
    PROVIDER=vmware_desktop
    echo ${PROVIDER_URL}
    curl -X POST ${ATLAS_URI}/${BOX_NAME}/version/${VERSION}/providers -d "${token_param}" -d provider[name]="${PROVIDER}" -d provider[url]="${PROVIDER_URL}" > ${COMM_FILE_DIR}/provider_result.json
fi
if [[ -e ${VIRTUALBOX_BOX_FILE} ]]; then
    PROVIDER=virtualbox
    PROVIDER_URL=${BOXCUTTER_BASE_URL}/virtualbox${VIRTUALBOX_VERSION}/${BOX_NAME}${BOX_SUFFIX}
    echo ${PROVIDER_URL}
    curl -X POST ${ATLAS_URI}/${BOX_NAME}/version/${VERSION}/providers -d "${token_param}" -d provider[name]="${PROVIDER}" -d provider[url]="${PROVIDER_URL}" > ${COMM_FILE_DIR}/provider_result.json
fi
if [[ -e ${PARALLELS_BOX_FILE} ]]; then
    PROVIDER_URL=${BOXCUTTER_BASE_URL}/parallels${PARALLELS_VERSION}/${BOX_NAME}${BOX_SUFFIX}
    PROVIDER=parallels
    curl -X POST ${ATLAS_URI}/${BOX_NAME}/version/${VERSION}/providers -d "${token_param}" -d provider[name]="${PROVIDER}" -d provider[url]="${PROVIDER_URL}" > ${COMM_FILE_DIR}/provider_result.json
fi

case $status in
unreleased)
  curl -X PUT ${ATLAS_URI}/${BOX_NAME}/version/${VERSION}/release -d ${token_param}
  echo 'released!'
  ;;
active)
  echo 'already released'
  ;;
*)
  abort "cannot publish version with status '$status'"
esac
rm -rf ${COMM_FILE_DIR}

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


no message

no message

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/Ryan0520/BTApp.git/'


Add a script for running specs without covering required modules

E.g. when running spec/resolve_locals_spec.lua, include
coverage only for luacheck.stages.resolve_locals module and
not for any dependencies. This allows estimating completeness
of each individual spec.

#!/usr/bin/env bash
set -eu
set -o pipefail

# Collects test coverage for luacheck modules with associated spec files.
# Runs spec files from the arguments or all spec files.
# Each module can be covered only from its own spec file.
# Should be executed from root Luacheck directory.

declare -A spec_to_module
spec_to_module[spec/cache_spec.lua]=src/luacheck/cache.lua
spec_to_module[spec/check_spec.lua]=src/luacheck/check.lua
spec_to_module[spec/config_spec.lua]=src/luacheck/config.lua
spec_to_module[spec/expand_rockspec_spec.lua]=src/luacheck/expand_rockspec.lua
spec_to_module[spec/filter_spec.lua]=src/luacheck/filter.lua
spec_to_module[spec/format_spec.lua]=src/luacheck/format.lua
spec_to_module[spec/fs_spec.lua]=src/luacheck/fs.lua
spec_to_module[spec/globbing_spec.lua]=src/luacheck/globbing.lua
spec_to_module[spec/luacheck_spec.lua]=src/luacheck/init.lua
spec_to_module[spec/lexer_spec.lua]=src/luacheck/lexer.lua
spec_to_module[spec/cli_spec.lua]=src/luacheck/main.lua
spec_to_module[spec/options_spec.lua]=src/luacheck/options.lua
spec_to_module[spec/parser_spec.lua]=src/luacheck/parser.lua
spec_to_module[spec/cyclomatic_complexity_spec.lua]=src/luacheck/stages/detect_cyclomatic_complexity.lua
spec_to_module[spec/globals_spec.lua]=src/luacheck/stages/detect_globals.lua
spec_to_module[spec/reversed_fornum_loops_spec.lua]=src/luacheck/stages/detect_reversed_fornum_loops.lua
spec_to_module[spec/uninit_accesses_spec.lua]=src/luacheck/stages/detect_uninit_accesses.lua
spec_to_module[spec/unreachable_code_spec.lua]=src/luacheck/stages/detect_unreachable_code.lua
spec_to_module[spec/unused_fields_spec.lua]=src/luacheck/stages/detect_unused_fields.lua
spec_to_module[spec/unused_locals_spec.lua]=src/luacheck/stages/detect_unused_locals.lua
spec_to_module[spec/linearize_spec.lua]=src/luacheck/stages/linearize.lua
spec_to_module[spec/resolve_locals_spec.lua]=src/luacheck/stages/resolve_locals.lua
spec_to_module[spec/standards_spec.lua]=src/luacheck/standards.lua
spec_to_module[spec/utils_spec.lua]=src/luacheck/utils.lua

if [ $# -eq 0 ]; then
    specs="$(sort <<< "${!spec_to_module[@]}")"
else
    specs="$@"
fi

{
    echo Spec Module Hits Missed Coverage

    for spec in $specs; do
        if [ -v spec_to_module[$spec] ]; then
            module="${spec_to_module[$spec]}"

            rm -f luacov.stats.out
            rm -f luacov.report.out

            echo "busted -c $spec" >&2
            busted -c "$spec" >&2 || true
            luacov
            echo -n "$spec "
            grep -P "$module +[^ ]+ +[^ ]+ +[^ ]+" luacov.report.out || echo "$module 0 0 0.00%"
            echo >&2
        else
            echo "No associated module for spec $spec" >&2
        fi
    done
} | column -t

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


Script para tirar abajo los containers de Andino

#!/usr/bin/env bash

if [[ -f /etc/portal/latest.yml ]];
then
    cd /etc/portal && docker-compose -f /etc/portal/latest.yml down && cd .. && sudo rm -rf /etc/portal/
else
    docker kill $(docker ps -q -f name=andino)
fi

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


Made symbolic link creation message more verbose

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/altamiracorp/honeycomb.git/'


Space pruning script added

Space pruning script added

#!/bin/bash

# remove exited containers:
docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v
# remove unused containers:
yes | docker container prune
# remove unused images:
yes | docker image prune
# remove unused volumes:
yes | docker volume prune

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


remove typo

remove typo

#!/bin/sh

PROXY=/hermit/tools/proxy

ELF_OSABI_OFFSET=7
ELF_OSABI="\\x42"

# Network
/sbin/ifconfig lo 127.0.0.1 netmask 255.0.0.0 up
/sbin/ifconfig eth0 up 10.0.2.15 netmask 255.255.255.0 up
/sbin/ifconfig mmnif up 192.168.28.1 netmask 255.255.255.0 up
/sbin/route add default gw 10.0.2.2
/bin/hostname -F /etc/hostname
echo "Network setup completed"

# Load binfmt_misc kernel module and mount pseudo FS
test -d /lib/modules && modprobe binfmt_misc
grep binfmt_misc /proc/mounts || mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc

# Register new format
echo ":hermit:M:$ELF_OSABI_OFFSET:$ELF_OSABI::$PROXY:" > /proc/sys/fs/binfmt_misc/register

# Startup completed
sleep 1 && echo -e '\nWelcome to HermitCore (http://www.hermitcore.org/)!'

/bin/sh

#!/bin/sh

PROXY=/hermit/tools/proxy

ELF_OSABI_OFFSET=7
ELF_OSABI="\\x42"

# Network
/sbin/ifconfig lo 127.0.0.1 netmask 255.0.0.0 up
/sbin/ifconfig eth0 up 10.0.2.15 netmask 255.255.255.0 up
/sbin/ifconfig mmnif up 192.168.28.1 netmask 255.255.255.0 up
/sbin/route add default gw 10.0.2.2
/bin/hostname -F /etc/hostname
echo "Network setup completed"

# Load binfmt_misc kernel module and mount pseudo FS
test -d /lib/modules && modprobe binfmt_misc
grep binfmt_misc /proc/mounts || mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc

# Register new format
echo ":hermit:M:$ELF_OSABI_OFFSET:$ELF_OSABI::$PROXY:" > /proc/sys/fs/binfmt_misc/register

# Startup completed
sleep 1 && echo -e '\n\nWelcome to HermitCore (http://www.hermitcore.org/)!'

/bin/sh


Add Vagrant template script

Add Vagrant template script

import lib-download

VAGRANT_BOXES_FOLDER=~/.vagrant.d/boxes
VAGRANT_MACHINES_SUBFOLDER=./.vagrant/machines

VM_ROOT_FOLDER=~/VMs
VM_ARCHIVE_FOLDER=$VM_ROOT_FOLDER/_archives_

cdvm() {
	mkdir -p $VM_ROOT_FOLDER
	cd $VM_ROOT_FOLDER
}

# ==================================================
# Vagrant Box Administration
# ==================================================
# vagb : Vagrant box cmds https://www.vagrantup.com/docs/cli/box.html
# - vagbls : List all boxes in the catalog
# - vagbadd [_instance] : Add boxes
# - vagbrm [box catalog name] : Remove boxes from ls

# https://www.vagrantup.com/docs/boxes.html
# https://atlas.hashicorp.com/boxes/

vagbls() {
	# ls $VAGRANT_BOXES_FOLDER
	echo "=== Vagrant boxes catalog ==="
	vagrant box list
	echo ""
	echo "=> Remove any box from Catalog with 'vagbrm [box name]'"
	echo ""
	echo "=== Vagrant instances ==="
	vagrant global-status --prune

	if [[ -d $VAGRANT_MACHINES_SUBFOLDER ]]; then
		echo "== List local vagrant name =="
		ls $VAGRANT_MACHINES_SUBFOLDER
	fi
}

vagbadd_win8() {
	# vagbadd Windows8 http://aka.ms/vagrant-win8-ie10 Win8.IE10.For.Vagrant.box
	vagbadd Windows81 http://aka.ms/vagrant-win81-ie11 Win8.1.IE11.For.Vagrant.box
}

vagbadd_aerospike() {
	# http://www.aerospike.com/docs/operations/install/vagrant/mac/
	# https://s3-us-west-1.amazonaws.com/aerospike-vagrant/previous_version/virtualbox/as_centos-6.6-x86_64.box
	# vagbadd aerospike/centos-6.5 https://atlas.hashicorp.com/aerospike/boxes/centos-6.5/versions/3.8.1/providers/virtualbox.box vagrant-aerospike-centos-6.5-3.8.1.box
	vagbadd aerospike/centos-6.5 https://atlas.hashicorp.com/aerospike/boxes/centos-6.5/versions/3.8.2.3/providers/virtualbox.box vagrant-aerospike-centos-6.5-3.8.2.3.box
}

vagbadd_centos_puppet() {
	vagbadd puppetlabs/centos-6.6-64-puppet https://atlas.hashicorp.com/puppetlabs/boxes/centos-6.6-64-puppet/versions/1.0.3/providers/virtualbox.box vagrant-puppetlabs-centos-6.6-64-1.0.3.box
}

vagbadd_docker() {
	vagbadd boot2docker https://atlas.hashicorp.com/hashicorp/boxes/boot2docker/versions/1.7.8/virtualbox.box vagrant-boot2docker-1.7.8.box
	# vagrant plugin install vagrant-docker-compose
}
vagbadd_centos() {
	vagbadd centos65 https://github.com/2creatives/vagrant-centos/releases/download/v6.5.3/centos65-x86_64-20140116.box vagrant-centos65-v6.5.3_64.box
}
vagbadd_ubuntu() {
	# vagbadd precise64 http://files.vagrantup.com/precise64.box
	#vagbadd precise64 https://atlas.hashicorp.com/hashicorp/boxes/precise64/versions/1.1.0/providers/virtualbox.box vagrant-ubuntu-precise64-1.1.0.box
	vagbadd ubuntu/trusty64 https://vagrantcloud.com/ubuntu/boxes/trusty64/versions/20170810.0.0/providers/virtualbox.box vagrant-ubuntu-trusty64-20170810.box
}

vagbadd_docker_centos() {
	vagbadd centos2docker https://atlas.hashicorp.com/blacklabelops/boxes/dockerdev/versions/1.0.5/providers/virtualbox.box vagrant-centos2docker-1.0.5.box
	# vagrant plugin install vagrant-docker-compose
}

vagbadd_docker_ubuntu_trusty() {
	vagbadd ubuntu-trusty64-docker https://vagrantcloud.com/williamyeh/boxes/ubuntu-trusty64-docker/versions/1.12.1.20160830/providers/virtualbox.box vagrant-williamyeh--ubuntu-trusty64-docker-1.12.1.20160830.box
	# vagrant plugin install vagrant-docker-compose
}

vagbadd_docker_ubuntu() {
	BOX_FILENAME=$VM_ARCHIVE_FOLDER/docker-ubuntu-trusty64.box
	BOX_NAME=docker-ubuntu-trusty64

	echo "vagrant box add $BOX_NAME $BOX_FILENAME"
	vagrant box add $BOX_NAME $BOX_FILENAME

	echo "vagrant init $BOX_NAME"
	vagrant init $BOX_NAME
}

vagbadd() {
	echo $@
	if [ $# -eq 0 ]; then
      echo "vagbadd BOX_NAME [BOX_URL] [BOX_FILENAME]"
      return
  	fi

  	local BOX_NAME=$1
   	if [ -z "$3" ]
    	then
        	local BOX_FILENAME=$VM_ARCHIVE_FOLDER/$1.box
	    else
    	    local BOX_FILENAME=$VM_ARCHIVE_FOLDER/$3
  	fi

	# Download file ONLY if it doesn't exist
	if [ ! -f $BOX_FILENAME ];
		then
			mkdir -p $VM_ARCHIVE_FOLDER
			wgetsafe $BOX_FILENAME $2
	    else
    	    echo "Vagrant Box file exist, use this one $BOX_FILENAME"
	fi
	echo "vagrant box add $BOX_NAME $BOX_FILENAME --force"
	vagrant box add $BOX_NAME $BOX_FILENAME --force

	echo "vagrant init $BOX_NAME"
	vagrant init $BOX_NAME
}
vagbrm() {
	if [ $# -eq 0 ]; then
      echo "Please add the name of the box to remove with 'vagbrm [BOX_NAME]'"
	  echo "=== Vagrant boxes catalog ==="
      vagrant box list
      return
  	fi
  	vagrant box remove $1
}

# ==================================================
# Vagrant install and usage
# ==================================================
vaginst_script() {
	INSTALL_SCRIPT="curl -fsSL https://raw.githubusercontent.com/frtu/bash-fwk/master/autoinstaller4curl.bash"
    echo "CALL : root@vagrant> $INSTALL_SCRIPT"
	vagssh "$($INSTALL_SCRIPT)"
}
vagenabledocker() {
	vagssh "echo 'import "lib-docker"' > ~/scr-local/service-docker.bash"
}

vagstart() {
	vagtemplate "up"
}
vagstop() {
	vagtemplate "halt"
}
vagssh() {
  if [ -z "$1" ]
    then
      vagtemplate "ssh"
    else
      echo "CALL : root@$IMAGE_NAME> $@"
      echo "$@" | vagtemplate "ssh"
  fi
}
vagrm() {
	vagtemplate "destroy"
}

vagtemplate() {
  if [ ! -f Vagrantfile ]; then
    echo "Please run this command in a folder containing Vagrantfile."
    echo "- Create one using cmd > vagbadd_xx"
    echo "- Go to an existing folder looking at the last column directory."
    vagrant global-status --prune
    return -1
  fi

  echo "vagrant $1"
  vagrant $1
}
# https://www.hashicorp.com/blog/feature-preview-vagrant-1-6-docker-dev-environments.html

import lib-download

VAGRANT_BOXES_FOLDER=~/.vagrant.d/boxes
VAGRANT_MACHINES_SUBFOLDER=./.vagrant/machines

VM_ROOT_FOLDER=~/VMs
VM_ARCHIVE_FOLDER=$VM_ROOT_FOLDER/_archives_

cdvm() {
	mkdir -p $VM_ROOT_FOLDER
	cd $VM_ROOT_FOLDER
}

# ==================================================
# Vagrant Box Administration
# ==================================================
# vagb : Vagrant box cmds https://www.vagrantup.com/docs/cli/box.html
# - vagbls : List all boxes in the catalog
# - vagbadd [_instance] : Add boxes
# - vagbrm [box catalog name] : Remove boxes from ls

# https://www.vagrantup.com/docs/boxes.html
# https://atlas.hashicorp.com/boxes/

vagbls() {
	# ls $VAGRANT_BOXES_FOLDER
	echo "=== Vagrant boxes catalog ==="
	vagrant box list
	echo ""
	echo "=> Remove any box from Catalog with 'vagbrm [box name]'"
	echo ""
	echo "=== Vagrant instances ==="
	vagrant global-status --prune

	if [[ -d $VAGRANT_MACHINES_SUBFOLDER ]]; then
		echo "== List local vagrant name =="
		ls $VAGRANT_MACHINES_SUBFOLDER
	fi
}

vagbadd_win8() {
	# vag_add Windows8 http://aka.ms/vagrant-win8-ie10 Win8.IE10.For.Vagrant.box
	vag_add Windows81 http://aka.ms/vagrant-win81-ie11 Win8.1.IE11.For.Vagrant.box
}

vagbadd_aerospike() {
	# http://www.aerospike.com/docs/operations/install/vagrant/mac/
	# https://s3-us-west-1.amazonaws.com/aerospike-vagrant/previous_version/virtualbox/as_centos-6.6-x86_64.box
	# vag_add aerospike/centos-6.5 https://atlas.hashicorp.com/aerospike/boxes/centos-6.5/versions/3.8.1/providers/virtualbox.box vagrant-aerospike-centos-6.5-3.8.1.box
	vag_add aerospike/centos-6.5 https://atlas.hashicorp.com/aerospike/boxes/centos-6.5/versions/3.8.2.3/providers/virtualbox.box vagrant-aerospike-centos-6.5-3.8.2.3.box
}

vagbadd_centos_puppet() {
	vag_add puppetlabs/centos-6.6-64-puppet https://atlas.hashicorp.com/puppetlabs/boxes/centos-6.6-64-puppet/versions/1.0.3/providers/virtualbox.box vagrant-puppetlabs-centos-6.6-64-1.0.3.box
}

vagbadd_docker() {
	vag_add boot2docker https://atlas.hashicorp.com/hashicorp/boxes/boot2docker/versions/1.7.8/virtualbox.box vagrant-boot2docker-1.7.8.box
	# vagrant plugin install vagrant-docker-compose
}
vagbadd_centos() {
	vag_add centos65 https://github.com/2creatives/vagrant-centos/releases/download/v6.5.3/centos65-x86_64-20140116.box vagrant-centos65-v6.5.3_64.box
}
vagbadd_ubuntu() {
	# vag_add precise64 http://files.vagrantup.com/precise64.box
	#vag_add precise64 https://atlas.hashicorp.com/hashicorp/boxes/precise64/versions/1.1.0/providers/virtualbox.box vagrant-ubuntu-precise64-1.1.0.box
	vag_add ubuntu/trusty64 https://atlas.hashicorp.com/ubuntu/boxes/trusty64/versions/20161205.0.0/providers/virtualbox.box vagrant-ubuntu-trusty64-20161205.box
}

vagbadd_docker_centos() {
	vag_add centos2docker https://atlas.hashicorp.com/blacklabelops/boxes/dockerdev/versions/1.0.5/providers/virtualbox.box vagrant-centos2docker-1.0.5.box
	# vagrant plugin install vagrant-docker-compose
}
vagbadd_docker_ubuntu() {
	BOX_FILENAME=$VM_ARCHIVE_FOLDER/docker-ubuntu-trusty64.box
	BOX_NAME=docker-ubuntu-trusty64

	echo "vagrant box add $BOX_NAME $BOX_FILENAME"
	vagrant box add $BOX_NAME $BOX_FILENAME

	echo "vagrant init $BOX_NAME"
	vagrant init $BOX_NAME
}

vagbadd() {
	echo $@
	if [ $# -eq 0 ]; then
      echo "vagbadd BOX_NAME [BOX_URL] [BOX_FILENAME]"
      return
  	fi

  	local BOX_NAME=$1
   	if [ -z "$3" ]
    	then
        	local BOX_FILENAME=$VM_ARCHIVE_FOLDER/$1.box
	    else
    	    local BOX_FILENAME=$VM_ARCHIVE_FOLDER/$3
  	fi

	# Download file ONLY if it doesn't exist
	if [ ! -f $BOX_FILENAME ];
		then
			mkdir -p $VM_ARCHIVE_FOLDER
			wgetsafe $BOX_FILENAME $2
	    else
    	    echo "Vagrant Box file exist, use this one $BOX_FILENAME"
	fi
	echo "vagrant box add $BOX_NAME $BOX_FILENAME --force"
	vagrant box add $BOX_NAME $BOX_FILENAME --force

	echo "vagrant init $BOX_NAME"
	vagrant init $BOX_NAME
}
vagbrm() {
	if [ $# -eq 0 ]; then
      echo "Please add the name of the box to remove with 'vagbrm [BOX_NAME]'"
	  echo "=== Vagrant boxes catalog ==="
      vagrant box list
      return
  	fi
  	vagrant box remove $1
}

# ==================================================
# Vagrant install and usage
# ==================================================
vaginst_script() {
	echo "$(curl -fsSL https://raw.githubusercontent.com/frtu/bash-fwk/master/autoinstaller4curl.bash)" | vagrant ssh
}

vagsync() {
	cp -R "$BACKUP_ROOT_FOLDER/Vagrant/" .
  	mkdir -p bash_lib/
  	cp -R "$BACKUP_ROOT_FOLDER/bash_lib/" bash_lib/
	# cp $BACKUP_ROOT_FOLDER/bash_lib/_bash_profile bash_lib/
}

vagstart() {
	vagrant up
}
vagstop() {
	vagrant halt
}
vagdestroy() {
	vagrant destroy
}
# https://www.hashicorp.com/blog/feature-preview-vagrant-1-6-docker-dev-environments.html


ci-config-helper: don't extract git snapshot over existing git trees

Signed-off-by: Koen Kooi <42e3d96910f922bdd7dd1805fe3f8aff634f391d@dominion.thruhere.net>

#!/bin/sh

SHARED_DL_DIR="$1"
SHARED_SSTATE_DIR="$2"

if [ -e /usr/bin/getconf ] ; then
	NUMCPU="$(getconf _NPROCESSORS_ONLN)"
else
	NUMCPU="4"
fi

# Use more parallelism
sed -i -e "s:-j2:-j${NUMCPU}:" -e 's:THREADS = "2":THREADS = "4":' conf/local.conf

# Point to shared download dir
sed -i -e s:'${OE_SOURCE_DIR}/downloads':${SHARED_DL_DIR}: oebb.sh

if ! [ -d sources/meta-angstrom ] ; then
	if [ -e ${SHARED_DL_DIR}/../v2013.12-gits.tar.xz ] ; then
		tar xf ${SHARED_DL_DIR}/../v2013.12-gits.tar.xz
	fi
fi

# Point to shared sstate-dir
sed -i -e s:'${OE_BUILD_DIR}/build/sstate-cache':${SHARED_SSTATE_DIR}: oebb.sh

# Freescale EULA
echo 'ACCEPT_FSL_EULA = "1"' >> conf/local.conf

# Intel EMGD
echo 'LICENSE_FLAGS_WHITELIST += "license_emgd-driver-bin commercial"' >> conf/local.conf

if [ -e /usr/bin/autogen ] ; then
	echo 'ASSUME_PROVIDED += "autogen-native"' >> conf/local.conf
fi

if [ -e /usr/bin/svn ] ; then
	echo 'ASSUME_PROVIDED += "subversion-native"' >> conf/local.conf
fi

# Work around guile-native build problems
if [ "$(lsb_release -si)" = "Angstrom" ] ; then
	if [ -e /usr/bin/guile ] ; then
		echo 'ASSUME_PROVIDED += "guile-native"' >> conf/local.conf
	fi
fi

#!/bin/sh

SHARED_DL_DIR="$1"
SHARED_SSTATE_DIR="$2"

if [ -e /usr/bin/getconf ] ; then
	NUMCPU="$(getconf _NPROCESSORS_ONLN)"
else
	NUMCPU="4"
fi

# Use more parallelism
sed -i -e "s:-j2:-j${NUMCPU}:" -e 's:THREADS = "2":THREADS = "4":' conf/local.conf

# Point to shared download dir
sed -i -e s:'${OE_SOURCE_DIR}/downloads':${SHARED_DL_DIR}: oebb.sh

if [ -e ${SHARED_DL_DIR}/../v2013.12-gits.tar.xz ] ; then
	tar xf ${SHARED_DL_DIR}/../v2013.12-gits.tar.xz
fi

# Point to shared sstate-dir
sed -i -e s:'${OE_BUILD_DIR}/build/sstate-cache':${SHARED_SSTATE_DIR}: oebb.sh

# Freescale EULA
echo 'ACCEPT_FSL_EULA = "1"' >> conf/local.conf

# Intel EMGD
echo 'LICENSE_FLAGS_WHITELIST += "license_emgd-driver-bin commercial"' >> conf/local.conf

if [ -e /usr/bin/autogen ] ; then
	echo 'ASSUME_PROVIDED += "autogen-native"' >> conf/local.conf
fi

if [ -e /usr/bin/svn ] ; then
	echo 'ASSUME_PROVIDED += "subversion-native"' >> conf/local.conf
fi

# Work around guile-native build problems
if [ "$(lsb_release -si)" = "Angstrom" ] ; then
	if [ -e /usr/bin/guile ] ; then
		echo 'ASSUME_PROVIDED += "guile-native"' >> conf/local.conf
	fi
fi


Added configureNetwork.sh to set up UST-20LX network.

/etc/init.d/network-manager stop
ifconfig eth0 192.168.0.11
sudo chmod 6666 /dev/ttyUSB0

# echo 16777215 > /proc/sys/net/core/rmem_max
# echo 16777215 > /proc/sys/net/core/wmem_max
# ifconfig eth0 mtu 7200

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


Move routine of auto deps before the one of strip

#!/bin/ash

# Hidden optional values
# - STRIP_SHLIB: strip command options for shared libraries
# - STRIP_BIN: strip command options for non shared libraries
# - ARCH: architecture value. "opkg-cl print-architecture" will show

source ~/.nnl-builder/settings

if [ "x$4" == "x" ]; then
        echo "Usage: packaging.sh [name] [ver-rel] [sourcedir] [installeddir] <opts>"
        exit 1
fi

TARGET_DIR=$OPKG_WORK_BUILD/$4

# REMOVE DOCS, use documents in internet.
rm -rf $TARGET_DIR/usr/share/info
rm -rf $TARGET_DIR/usr/info
rm -rf $TARGET_DIR/usr/share/man
rm -rf $TARGET_DIR/usr/man
rmdir $TARGET_DIR/usr/share 2>/dev/null
rm -f $TARGET_DIR/usr/lib/charset.alias
rm -f $TARGET_DIR/usr/share/locale/locale.alias

case "$OPKG_BUILD_MODE" in
"cross" )
	echo -n "Installing into cross-tools... "
	mkdir -p $OPKG_WORK_CROSS
	cd $TARGET_DIR
	tar cf - . | ( cd $OPKG_WORK_CROSS; tar xf -)
	ret=$?
	echo "done."
	exit $ret
	;;
"target" )
	echo -n "Installing into target-tree... "
	mkdir -p $OPKG_WORK_TARGET
	cd $TARGET_DIR
	tar cf - . | ( cd $OPKG_WORK_TARGET; tar xf -)
	ret=$?
	echo "done."
	exit $ret
	;;
"native" )
	echo "Packaging..."
	;;
* )
	echo "MODE is not set or invalid."
	exit 1
	;;
esac

echo "########################################"
# Name:
P_NAME=`echo $1 | tr [A-Z] [a-z] | tr _ -`
echo "Package:	$P_NAME"

# Version:
P_VER=$2
echo "Version:	$P_VER"

# Architecture: set P_ARCH to overwrite for "noarch"
if [ x"$P_ARCH" == "x" ]; then
	P_ARCH=$OPKG_CTRL_ARCH
fi
echo "Architecture:	$P_ARCH"

# Depends:
echo "...Find dependencies..."
# Library dependencies
TARGET_LIBS=`find $TARGET_DIR -type f | xargs file | grep " dynamically linked" | \
	cut -f1 -d:`
if [ "x$TARGET_LIBS" != "x" ]; then
	rm -f $TARGET_DIR/auto-depends.libs
	rm -f $TARGET_DIR/auto-depends
	for l in $TARGET_LIBS; do
		ldd $l | cut -f3 -d' ' >> $TARGET_DIR/auto-depends.libs
	done
	# "^/" removes followings from the list;
	# - "not": The package hasn't installed yet
	# - "ldd"
	for l in `sort -b -u $TARGET_DIR/auto-depends.libs | grep ^/`; do
		DEPPKG=`opkg-cl search $l | cut -f1 -d' '`
		#FOUND=""
		if [ "x$DEPPKG" == "x" ]; then
			# eliminate self-contained libs
			n=`basename $l`
			FOUND=`find $TARGET_DIR -name $n`
			if [ "x$FOUND" == "x" ]; then
				echo "WARNING: dependency file $l is not owned by any packages!"
			fi
		else
			# eliminate itself
			if [ $DEPPKG != $P_NAME ]; then
				echo $DEPPKG >> $TARGET_DIR/auto-depends
			fi
		fi
	done
fi

rm -rf $TARGET/CONTROL
mkdir -p $TARGET_DIR/CONTROL
if [ -d $3/CONTROL ]; then
	cp -a $3/CONTROL/* $TARGET_DIR/CONTROL
	rm -f $TARGET_DIR/depends.in
	for p in `grep ^Depends: $TARGET_DIR/CONTROL/control | cut -f2- -d: | tr , ' '`; do
		echo $p >> $TARGET_DIR/depends.in
	done
fi
# marge and remove duplicates
cat $TARGET_DIR/auto-depends $TARGET_DIR/depends.in 2>/dev/null | sort -u > $TARGET_DIR/depends 2>/dev/null

echo -n "Depends:	"
P_DEPS=""
for p in `cat $TARGET_DIR/depends`; do
	if [ "x$P_DEPS" == "x" ]; then
		P_DEPS=$p
		echo -n $p
	else
		P_DEPS="$P_DEPS,$p"
		echo -n ",$p"
	fi
done
echo ""
echo "########################################"
rm -f $TARGET_DIR/auto-depends* $TARGET_DIR/depends*

cat > $TARGET_DIR/CONTROL/control <<EOF
Package:	$P_NAME
Version:	$P_VER
Architecture:	$P_ARCH
Depends:	$P_DEPS
EOF

# STRIP
if [ "x$STRIP_SHLIB" == "x" ]; then
	STRIP_SHLIB="strip --strip-debug"
fi
if [ "x$STRIP_BIN" == "x" ]; then
	STRIP_BIN="strip --strip-unneeded"
fi
find $TARGET_DIR -type f | xargs file | grep " not stripped" | \
	grep " shared object" | cut -f1 -d: | xargs $STRIP_SHLIB \
	>/dev/null 2>&1
find $TARGET_DIR -type f | xargs file | grep " not stripped" | \
	grep -v " shared object" | cut -f1 -d: | xargs $STRIP_BIN \
	>/dev/null 2>&1

opkg-build -C -O $TARGET_DIR $5 $OPKG_WORK_PKGS

#!/bin/ash

# Hidden optional values
# - STRIP_SHLIB: strip command options for shared libraries
# - STRIP_BIN: strip command options for non shared libraries
# - ARCH: architecture value. "opkg-cl print-architecture" will show

source ~/.nnl-builder/settings

if [ "x$4" == "x" ]; then
        echo "Usage: packaging.sh [name] [ver-rel] [sourcedir] [installeddir] <opts>"
        exit 1
fi

TARGET_DIR=$OPKG_WORK_BUILD/$4

# STRIP
if [ "x$STRIP_SHLIB" == "x" ]; then
	STRIP_SHLIB="strip --strip-debug"
fi
if [ "x$STRIP_BIN" == "x" ]; then
	STRIP_BIN="strip --strip-unneeded"
fi
find $TARGET_DIR -type f | xargs file | grep " not stripped" | \
	grep " shared object" | cut -f1 -d: | xargs $STRIP_SHLIB \
	>/dev/null 2>&1
find $TARGET_DIR -type f | xargs file | grep " not stripped" | \
	grep -v " shared object" | cut -f1 -d: | xargs $STRIP_BIN \
	>/dev/null 2>&1

# REMOVE DOCS, use documents in internet.
rm -rf $TARGET_DIR/usr/share/info
rm -rf $TARGET_DIR/usr/info
rm -rf $TARGET_DIR/usr/share/man
rm -rf $TARGET_DIR/usr/man
rmdir $TARGET_DIR/usr/share 2>/dev/null
rm -f $TARGET_DIR/usr/lib/charset.alias
rm -f $TARGET_DIR/usr/share/locale/locale.alias

case "$OPKG_BUILD_MODE" in
"cross" )
	echo -n "Installing into cross-tools... "
	mkdir -p $OPKG_WORK_CROSS
	cd $TARGET_DIR
	tar cf - . | ( cd $OPKG_WORK_CROSS; tar xf -)
	ret=$?
	echo "done."
	exit $ret
	;;
"target" )
	echo -n "Installing into target-tree... "
	mkdir -p $OPKG_WORK_TARGET
	cd $TARGET_DIR
	tar cf - . | ( cd $OPKG_WORK_TARGET; tar xf -)
	ret=$?
	echo "done."
	exit $ret
	;;
"native" )
	echo "Packaging..."
	;;
* )
	echo "MODE is not set or invalid."
	exit 1
	;;
esac

echo "########################################"
# Name:
P_NAME=`echo $1 | tr [A-Z] [a-z] | tr _ -`
echo "Package:	$P_NAME"

# Version:
P_VER=$2
echo "Version:	$P_VER"

# Architecture: set P_ARCH to overwrite for "noarch"
if [ x"$P_ARCH" == "x" ]; then
	P_ARCH=$OPKG_CTRL_ARCH
fi
echo "Architecture:	$P_ARCH"

# Depends:
echo "...Find dependencies..."
# Library dependencies
TARGET_LIBS=`find $TARGET_DIR -type f | xargs file | grep " dynamically linked" | \
	cut -f1 -d:`
if [ "x$TARGET_LIBS" != "x" ]; then
	rm -f $TARGET_DIR/auto-depends.libs
	rm -f $TARGET_DIR/auto-depends
	for l in $TARGET_LIBS; do
		ldd $l | cut -f3 -d' ' >> $TARGET_DIR/auto-depends.libs
	done
	# "^/" removes followings from the list;
	# - "not": The package hasn't installed yet
	# - "ldd"
	for l in `sort -b -u $TARGET_DIR/auto-depends.libs | grep ^/`; do
		DEPPKG=`opkg-cl search $l | cut -f1 -d' '`
		#FOUND=""
		if [ "x$DEPPKG" == "x" ]; then
			# eliminate self-contained libs
			n=`basename $l`
			FOUND=`find $TARGET_DIR -name $n`
			if [ "x$FOUND" == "x" ]; then
				echo "WARNING: dependency file $l is not owned by any packages!"
			fi
		else
			# eliminate itself
			if [ $DEPPKG != $P_NAME ]; then
				echo $DEPPKG >> $TARGET_DIR/auto-depends
			fi
		fi
	done
fi

rm -rf $TARGET/CONTROL
mkdir -p $TARGET_DIR/CONTROL
if [ -d $3/CONTROL ]; then
	cp -a $3/CONTROL/* $TARGET_DIR/CONTROL
	rm -f $TARGET_DIR/depends.in
	for p in `grep ^Depends: $TARGET_DIR/CONTROL/control | cut -f2- -d: | tr , ' '`; do
		echo $p >> $TARGET_DIR/depends.in
	done
fi
# marge and remove duplicates
cat $TARGET_DIR/auto-depends $TARGET_DIR/depends.in 2>/dev/null | sort -u > $TARGET_DIR/depends 2>/dev/null

echo -n "Depends:	"
P_DEPS=""
for p in `cat $TARGET_DIR/depends`; do
	if [ "x$P_DEPS" == "x" ]; then
		P_DEPS=$p
		echo -n $p
	else
		P_DEPS="$P_DEPS,$p"
		echo -n ",$p"
	fi
done
echo ""
echo "########################################"
rm -f $TARGET_DIR/auto-depends* $TARGET_DIR/depends*

cat > $TARGET_DIR/CONTROL/control <<EOF
Package:	$P_NAME
Version:	$P_VER
Architecture:	$P_ARCH
Depends:	$P_DEPS
EOF

opkg-build -C -O $TARGET_DIR $5 $OPKG_WORK_PKGS


don't use tmp file for such a triviality

#!/bin/sh
# Copyright (C) 2002-2003 MySQL AB
# For a more info consult the file COPYRIGHT distributed with this file.

# This scripts creates the privilege tables db, host, user, tables_priv,
# columns_priv in the mysql database, as well as the func table.
#
# All unrecognized arguments to this script are passed to mysqld.

in_rpm=0
windows=0
defaults=""
user=""

case "$1" in
    --no-defaults|--defaults-file=*|--defaults-extra-file=*)
      defaults="$1"; shift
      ;;
esac

parse_arguments() {
  # We only need to pass arguments through to the server if we don't
  # handle them here.  So, we collect unrecognized options (passed on
  # the command line) into the args variable.
  pick_args=
  if test "$1" = PICK-ARGS-FROM-ARGV
  then
    pick_args=1
    shift
  fi

  for arg do
    case "$arg" in
      --force) force=1 ;;
      --basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
      --ldata=*|--datadir=*) ldata=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
      --user=*)
        # Note that the user will be passed to mysqld so that it runs
        # as 'user' (crucial e.g. if log-bin=/some_other_path/
        # where a chown of datadir won't help)
	 user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
      --skip-name-resolve) ip_only=1 ;;
      --verbose) verbose=1 ;;
      --rpm) in_rpm=1 ;;
      --windows) windows=1 ;;
      *)
        if test -n "$pick_args"
        then
          # This sed command makes sure that any special chars are quoted,
          # so the arg gets passed exactly to the server.
          args="$args "`echo "$arg" | sed -e 's,\([^a-zA-Z0-9_.-]\),\\\\\1,g'`
        fi
        ;;
    esac
  done
}

# Get first arguments from the my.cfg file, groups [mysqld] and
# [mysql_install_db], and then merge with the command line arguments
if test -x ./bin/my_print_defaults
then
  print_defaults="./bin/my_print_defaults"
elif test -x ./extra/my_print_defaults
then
  print_defaults="./extra/my_print_defaults"
elif test -x @bindir@/my_print_defaults
then
  print_defaults="@bindir@/my_print_defaults"
elif test -x @bindir@/mysql_print_defaults
then
  print_defaults="@bindir@/mysql_print_defaults"
else
  print_defaults="my_print_defaults"
fi

args=
ldata=
execdir=
bindir=
basedir=
force=0
verbose=0
fill_help_tables=""

parse_arguments `$print_defaults $defaults mysqld mysql_install_db`
parse_arguments PICK-ARGS-FROM-ARGV "$@"

test -z "$ldata" && ldata=@localstatedir@
if test -z "$basedir"
then
  basedir=@prefix@
  bindir=@bindir@
  execdir=@libexecdir@
  pkgdatadir=@pkgdatadir@
else
  bindir="$basedir/bin"
  if test -x "$basedir/libexec/mysqld"
  then
    execdir="$basedir/libexec"
  elif test -x "$basedir/sbin/mysqld"
  then
    execdir="$basedir/sbin"
  else
    execdir="$basedir/bin"
  fi
fi

# find fill_help_tables.sh
for i in $basedir/support-files $basedir/share $basedir/share/mysql $basedir/scripts `pwd` `pwd`/scripts @pkgdatadir@
do
  if test -f $i/fill_help_tables.sql
  then
    pkgdatadir=$i
  fi
done

if test -f $pkgdatadir/fill_help_tables.sql
then
  fill_help_tables=$pkgdatadir/fill_help_tables.sql
else
  echo "Could not find help file 'fill_help_tables.sql' in @pkgdatadir@ or inside $basedir".
  exit 1;
fi

mdata=$ldata/mysql
mysqld=$execdir/mysqld
mysqld_opt=""
scriptdir=$bindir

if test "$windows" = 1
then
  mysqld="./sql/mysqld"
  mysqld_opt="--language=./sql/share/english"
  scriptdir="./scripts"
fi

if test ! -x $mysqld
then
  if test "$in_rpm" = 1
  then
    echo "FATAL ERROR $mysqld not found!"
    exit 1
  else
    echo "Didn't find $mysqld"
    echo "You should do a 'make install' before executing this script"
    exit 1
  fi
fi

# Try to determine the hostname
hostname=`@HOSTNAME@`

# Check if hostname is valid
if test "$windows" = 0 -a "$in_rpm" = 0 -a $force = 0
then
  resolved=`$bindir/resolveip $hostname 2>&1`
  if [ $? -ne 0 ]
  then
    resolved=`$bindir/resolveip localhost 2>&1`
    if [ $? -ne 0 ]
    then
      echo "Neither host '$hostname' nor 'localhost' could be looked up with"
      echo "$bindir/resolveip"
      echo "Please configure the 'hostname' command to return a correct hostname."
      echo "If you want to solve this at a later stage, restart this script with"
      echo "the --force option"
      exit 1
    fi
    echo "WARNING: The host '$hostname' could not be looked up with resolveip."
    echo "This probably means that your libc libraries are not 100 % compatible"
    echo "with this binary MySQL version. The MySQL daemon, mysqld, should work"
    echo "normally with the exception that host name resolving will not work."
    echo "This means that you should use IP addresses instead of hostnames"
    echo "when specifying MySQL privileges !"
  fi
fi

if test "$ip_only" = "1"
then
  ip=`echo "$resolved" | awk '/ /{print $6}'`
  hostname=$ip
fi

# Create database directories mysql & test

  if test ! -d $ldata; then mkdir $ldata; chmod 700 $ldata ; fi
  if test ! -d $ldata/mysql; then mkdir $ldata/mysql;  chmod 700 $ldata/mysql ; fi
  if test ! -d $ldata/test; then mkdir $ldata/test;  chmod 700 $ldata/test ; fi
  if test -w / -a ! -z "$user"; then
    chown $user $ldata $ldata/mysql $ldata/test;
  fi

if test ! -f $mdata/db.frm
then
  c_d="yes"
fi

if test $verbose = 1
then
  create_option="verbose"
else
  create_option="real"
fi

if test -n "$user"; then
  args="$args --user=$user"
fi

if test "$in_rpm" -eq 0 -a "$windows" -eq 0
then
  echo "Installing all prepared tables"
fi
mysqld_install_cmd_line="$mysqld $defaults $mysqld_opt --bootstrap \
--skip-grant-tables --basedir=$basedir --datadir=$ldata --skip-innodb \
--skip-bdb --skip-ndbcluster $args --max_allowed_packet=8M --net_buffer_length=16K"
if $scriptdir/mysql_create_system_tables $create_option $mdata $hostname $windows \
   | eval "$mysqld_install_cmd_line"
then
  if test -n "$fill_help_tables"
  then
    if test "$in_rpm" -eq 0 -a "$windows" -eq 0
    then
      echo "Fill help tables"
    fi
    (echo "use mysql;"; cat $fill_help_tables) | eval "$mysqld_install_cmd_line"
    res=$?
    if test $res != 0
    then
      echo ""
      echo "WARNING: HELP FILES ARE NOT COMPLETELY INSTALLED!"
      echo "The \"HELP\" command might not work properly"
      echo ""
    fi
  fi
  if test "$in_rpm" = 0 -a "$windows" = 0
  then
    echo ""
    echo "To start mysqld at boot time you have to copy support-files/mysql.server"
    echo "to the right place for your system"
    echo
  fi
  if test "$windows" -eq 0
  then
  echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !"
  echo "To do so, start the server, then issue the following commands:"
  echo "$bindir/mysqladmin -u root password 'new-password'"
  echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'"
  echo "See the manual for more instructions."
  #
  # Print message about upgrading unless we have created a new db table.
  if test -z "$c_d"
  then
    echo
    echo "NOTE:  If you are upgrading from a MySQL <= 3.22.10 you should run"
    echo "the $bindir/mysql_fix_privilege_tables. Otherwise you will not be"
    echo "able to use the new GRANT command!"
  fi
  echo
  if test "$in_rpm" = "0"
  then
    echo "You can start the MySQL daemon with:"
    echo "cd @prefix@ ; $bindir/mysqld_safe &"
    echo
    echo "You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:"
    echo "cd sql-bench ; perl run-all-tests"
    echo
  fi
  echo "Please report any problems with the @scriptdir@/mysqlbug script!"
  echo
  echo "The latest information about MySQL is available on the web at"
  echo "http://www.mysql.com"
  echo "Support MySQL by buying support/licenses at https://order.mysql.com"
  fi
  exit 0
else
  echo "Installation of system tables failed!"
  echo
  echo "Examine the logs in $ldata for more information."
  echo "You can also try to start the mysqld daemon with:"
  echo "$mysqld --skip-grant &"
  echo "You can use the command line tool"
  echo "$bindir/mysql to connect to the mysql"
  echo "database and look at the grant tables:"
  echo
  echo "shell> $bindir/mysql -u root mysql"
  echo "mysql> show tables"
  echo
  echo "Try 'mysqld --help' if you have problems with paths. Using --log"
  echo "gives you a log in $ldata that may be helpful."
  echo
  echo "The latest information about MySQL is available on the web at"
  echo "http://www.mysql.com"
  echo "Please consult the MySQL manual section: 'Problems running mysql_install_db',"
  echo "and the manual section that describes problems on your OS."
  echo "Another information source is the MySQL email archive."
  echo "Please check all of the above before mailing us!"
  echo "And if you do mail us, you MUST use the @scriptdir@/mysqlbug script!"
  exit 1
fi

#!/bin/sh
# Copyright (C) 2002-2003 MySQL AB
# For a more info consult the file COPYRIGHT distributed with this file.

# This scripts creates the privilege tables db, host, user, tables_priv,
# columns_priv in the mysql database, as well as the func table.
#
# All unrecognized arguments to this script are passed to mysqld.

in_rpm=0
windows=0
defaults=""
user=""
tmp_file=/tmp/mysql_install_db.$$

case "$1" in
    --no-defaults|--defaults-file=*|--defaults-extra-file=*)
      defaults="$1"; shift
      ;;
esac

parse_arguments() {
  # We only need to pass arguments through to the server if we don't
  # handle them here.  So, we collect unrecognized options (passed on
  # the command line) into the args variable.
  pick_args=
  if test "$1" = PICK-ARGS-FROM-ARGV
  then
    pick_args=1
    shift
  fi

  for arg do
    case "$arg" in
      --force) force=1 ;;
      --basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
      --ldata=*|--datadir=*) ldata=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
      --user=*)
        # Note that the user will be passed to mysqld so that it runs
        # as 'user' (crucial e.g. if log-bin=/some_other_path/
        # where a chown of datadir won't help)
	 user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
      --skip-name-resolve) ip_only=1 ;;
      --verbose) verbose=1 ;;
      --rpm) in_rpm=1 ;;
      --windows) windows=1 ;;
      *)
        if test -n "$pick_args"
        then
          # This sed command makes sure that any special chars are quoted,
          # so the arg gets passed exactly to the server.
          args="$args "`echo "$arg" | sed -e 's,\([^a-zA-Z0-9_.-]\),\\\\\1,g'`
        fi
        ;;
    esac
  done
}

# Get first arguments from the my.cfg file, groups [mysqld] and
# [mysql_install_db], and then merge with the command line arguments
if test -x ./bin/my_print_defaults
then
  print_defaults="./bin/my_print_defaults"
elif test -x ./extra/my_print_defaults
then
  print_defaults="./extra/my_print_defaults"
elif test -x @bindir@/my_print_defaults
then
  print_defaults="@bindir@/my_print_defaults"
elif test -x @bindir@/mysql_print_defaults
then
  print_defaults="@bindir@/mysql_print_defaults"
else
  print_defaults="my_print_defaults"
fi

args=
ldata=
execdir=
bindir=
basedir=
force=0
verbose=0
fill_help_tables=""

parse_arguments `$print_defaults $defaults mysqld mysql_install_db`
parse_arguments PICK-ARGS-FROM-ARGV "$@"

test -z "$ldata" && ldata=@localstatedir@
if test -z "$basedir"
then
  basedir=@prefix@
  bindir=@bindir@
  execdir=@libexecdir@
  pkgdatadir=@pkgdatadir@
else
  bindir="$basedir/bin"
  if test -x "$basedir/libexec/mysqld"
  then
    execdir="$basedir/libexec"
  elif test -x "$basedir/sbin/mysqld"
  then
    execdir="$basedir/sbin"
  else
    execdir="$basedir/bin"
  fi
fi

# find fill_help_tables.sh
for i in $basedir/support-files $basedir/share $basedir/share/mysql $basedir/scripts `pwd` `pwd`/scripts @pkgdatadir@
do
  if test -f $i/fill_help_tables.sql
  then
    pkgdatadir=$i
  fi
done

if test -f $pkgdatadir/fill_help_tables.sql
then
  fill_help_tables=$pkgdatadir/fill_help_tables.sql
else
  echo "Could not find help file 'fill_help_tables.sql' in @pkgdatadir@ or inside $basedir".
  exit 1;
fi

mdata=$ldata/mysql
mysqld=$execdir/mysqld
mysqld_opt=""
scriptdir=$bindir

if test "$windows" = 1
then
  mysqld="./sql/mysqld"
  mysqld_opt="--language=./sql/share/english"
  scriptdir="./scripts"
fi

if test ! -x $mysqld
then
  if test "$in_rpm" = 1
  then
    echo "FATAL ERROR $mysqld not found!"
    exit 1
  else
    echo "Didn't find $mysqld"
    echo "You should do a 'make install' before executing this script"
    exit 1
  fi
fi

# Try to determine the hostname
hostname=`@HOSTNAME@`

# Check if hostname is valid
if test "$windows" = 0 -a "$in_rpm" = 0 -a $force = 0
then
  resolved=`$bindir/resolveip $hostname 2>&1`
  if [ $? -ne 0 ]
  then
    resolved=`$bindir/resolveip localhost 2>&1`
    if [ $? -ne 0 ]
    then
      echo "Neither host '$hostname' nor 'localhost' could be looked up with"
      echo "$bindir/resolveip"
      echo "Please configure the 'hostname' command to return a correct hostname."
      echo "If you want to solve this at a later stage, restart this script with"
      echo "the --force option"
      exit 1
    fi
    echo "WARNING: The host '$hostname' could not be looked up with resolveip."
    echo "This probably means that your libc libraries are not 100 % compatible"
    echo "with this binary MySQL version. The MySQL daemon, mysqld, should work"
    echo "normally with the exception that host name resolving will not work."
    echo "This means that you should use IP addresses instead of hostnames"
    echo "when specifying MySQL privileges !"
  fi
fi

if test "$ip_only" = "1"
then
  ip=`echo "$resolved" | awk '/ /{print $6}'`
  hostname=$ip
fi

# Create database directories mysql & test

  if test ! -d $ldata; then mkdir $ldata; chmod 700 $ldata ; fi
  if test ! -d $ldata/mysql; then mkdir $ldata/mysql;  chmod 700 $ldata/mysql ; fi
  if test ! -d $ldata/test; then mkdir $ldata/test;  chmod 700 $ldata/test ; fi
  if test -w / -a ! -z "$user"; then
    chown $user $ldata $ldata/mysql $ldata/test;
  fi

if test ! -f $mdata/db.frm
then
  c_d="yes"
fi

if test $verbose = 1
then
  create_option="verbose"
else
  create_option="real"
fi

if test -n "$user"; then
  args="$args --user=$user"
fi

if test "$in_rpm" -eq 0 -a "$windows" -eq 0
then
  echo "Installing all prepared tables"
fi
mysqld_install_cmd_line="$mysqld $defaults $mysqld_opt --bootstrap \
--skip-grant-tables --basedir=$basedir --datadir=$ldata --skip-innodb \
--skip-bdb --skip-ndbcluster $args --max_allowed_packet=8M --net_buffer_length=16K"
if $scriptdir/mysql_create_system_tables $create_option $mdata $hostname $windows \
   | eval "$mysqld_install_cmd_line"
then
  if test -n "$fill_help_tables"
  then
    if test "$in_rpm" -eq 0 -a "$windows" -eq 0
    then
      echo "Fill help tables"
    fi
    echo "use mysql;" > $tmp_file
    cat $tmp_file $fill_help_tables | eval "$mysqld_install_cmd_line"
    res=$?
    rm $tmp_file
    if test $res != 0
    then
      echo ""
      echo "WARNING: HELP FILES ARE NOT COMPLETELY INSTALLED!"
      echo "The \"HELP\" command might not work properly"
      echo ""
    fi
  fi
  if test "$in_rpm" = 0 -a "$windows" = 0
  then
    echo ""
    echo "To start mysqld at boot time you have to copy support-files/mysql.server"
    echo "to the right place for your system"
    echo
  fi
  if test "$windows" -eq 0
  then
  echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !"
  echo "To do so, start the server, then issue the following commands:"
  echo "$bindir/mysqladmin -u root password 'new-password'"
  echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'"
  echo "See the manual for more instructions."
  #
  # Print message about upgrading unless we have created a new db table.
  if test -z "$c_d"
  then
    echo
    echo "NOTE:  If you are upgrading from a MySQL <= 3.22.10 you should run"
    echo "the $bindir/mysql_fix_privilege_tables. Otherwise you will not be"
    echo "able to use the new GRANT command!"
  fi
  echo
  if test "$in_rpm" = "0"
  then
    echo "You can start the MySQL daemon with:"
    echo "cd @prefix@ ; $bindir/mysqld_safe &"
    echo
    echo "You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:"
    echo "cd sql-bench ; perl run-all-tests"
    echo
  fi
  echo "Please report any problems with the @scriptdir@/mysqlbug script!"
  echo
  echo "The latest information about MySQL is available on the web at"
  echo "http://www.mysql.com"
  echo "Support MySQL by buying support/licenses at https://order.mysql.com"
  fi
  exit 0
else
  echo "Installation of system tables failed!"
  echo
  echo "Examine the logs in $ldata for more information."
  echo "You can also try to start the mysqld daemon with:"
  echo "$mysqld --skip-grant &"
  echo "You can use the command line tool"
  echo "$bindir/mysql to connect to the mysql"
  echo "database and look at the grant tables:"
  echo
  echo "shell> $bindir/mysql -u root mysql"
  echo "mysql> show tables"
  echo
  echo "Try 'mysqld --help' if you have problems with paths. Using --log"
  echo "gives you a log in $ldata that may be helpful."
  echo
  echo "The latest information about MySQL is available on the web at"
  echo "http://www.mysql.com"
  echo "Please consult the MySQL manual section: 'Problems running mysql_install_db',"
  echo "and the manual section that describes problems on your OS."
  echo "Another information source is the MySQL email archive."
  echo "Please check all of the above before mailing us!"
  echo "And if you do mail us, you MUST use the @scriptdir@/mysqlbug script!"
  exit 1
fi


Do not remove destdir where system is going to be installed

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

export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin

scripts_path=$(dirname $(realpath $0))

if [ ! -f "${scripts_path}/common.subr" ]; then
	echo >&2 "ERROR: common.subr is missing"
	exit 1
fi

. ${scripts_path}/common.subr

usage() {
	cat >&2 <<END
Usage: $(basename $0) -s srcdir -d destdir [-o objdir] [-iWKDhz]

Options:
	-s srcdir  -- Path to src directory
	-d destdir -- Destination directory to install
	-o objdir  -- Obj directory used to build
	-i         -- Include BSDInstall
	-W         -- Skip installworld
	-K         -- Skip installkernel
	-D         -- Skip distribution
	-h         -- Show this help and exit
	-z         -- gzip kernel

Environment:
	__MAKE_CONF      -- Path to make.conf
	SRCCONF          -- Path to src.conf
	SRC_ENV_CONF     -- Path to src-env.conf
	KERNCONF         -- Kernel names
	MODULES_OVERRIDE -- List of kernel modules to install
	TARGET           -- Machine hardware name
	TARGET_ARCH      -- Machine processor arquitecture name
END
	exit 1
}

unset with_bsdinstall
unset skip_world
unset skip_kernel
unset skip_distribution
unset gzip_kernel
while getopts s:d:o:iWKDhz opt; do
	case "$opt" in
		s)
			srcdir=$OPTARG
			;;
		d)
			destdir=$OPTARG
			;;
		o)
			objdir=$OPTARG
			;;
		i)
			with_bsdinstall=1
			;;
		W)
			skip_world=1
			;;
		K)
			skip_kernel=1
			;;
		D)
			skip_distribution=1
			;;
		z)
			gzip_kernel=1
			;;
		*)
			usage
			;;
	esac
done

# Default obj dir to src/../obj
: ${objdir=$(realpath ${srcdir}/../obj)}

[ -z "$srcdir" ] \
	&& err "source directory is not defined"

[ -e $srcdir -a ! -d $srcdir ] \
	&& err "source path already exists and is not a directory"

[ -z "$destdir" ] \
	&& err "destination directory is not defined"

[ -e $destdir -a ! -d $destdir ] \
	&& err "destination path already exists and is not a directory"

[ -n "$objdir" -a -e $objdir -a ! -d $objdir ] \
	&& err "obj path already exists and is not a directory"

for env_var in __MAKE_CONF SRCCONF SRC_ENV_CONF; do
	eval "value=\${$env_var}"
	[ -n "${value}" -a ! -f "${value}" ] \
		&& err "${env_var} is pointing to a nonexistent file ${value}"
done

[ ! -f ${srcdir}/sys/sys/param.h ] \
	&& err "Source directory is missing sys/sys/param.h"

ncpu=$(sysctl -n hw.ncpu)
njobs=$((ncpu*2))
j="-j${njobs}"

[ -n "${objdir}" ] \
	&& export MAKEOBJDIRPREFIX=${objdir}

[ -z "${with_bsdinstall}" ] \
	&& export WITHOUT_BSDINSTALL=yes

export DESTDIR=${destdir}

make_cmd="make -C ${srcdir} -s ${j}"

[ -z "${skip_world}" ] \
	&& run "Installing world" \
		"${make_cmd} installworld"

if [ -z "${skip_kernel}" ]; then
	run "Installing kernel" \
		"${make_cmd} KERNCONF=${KERNCONF:-pfSense} installkernel"

	[ -n "${gzip_kernel}" ] \
		&& run "Compressing kernel" \
			"gzip -f9 ${destdir}/boot/kernel/kernel"
fi

[ -z "${skip_distribution}" ] \
	&& run "Installing distribution" \
		"${make_cmd} distribution"

[ -n "${with_bsdinstall}" ] \
	&& run "Copying /etc/rc.local to start bsdinstall" \
		"cp ${srcdir}/release/rc.local ${destdir}/etc"

exit 0

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

export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin

scripts_path=$(dirname $(realpath $0))

if [ ! -f "${scripts_path}/common.subr" ]; then
	echo >&2 "ERROR: common.subr is missing"
	exit 1
fi

. ${scripts_path}/common.subr

usage() {
	cat >&2 <<END
Usage: $(basename $0) -s srcdir -d destdir [-o objdir] [-iWKDhz]

Options:
	-s srcdir  -- Path to src directory
	-d destdir -- Destination directory to install
	-o objdir  -- Obj directory used to build
	-i         -- Include BSDInstall
	-W         -- Skip installworld
	-K         -- Skip installkernel
	-D         -- Skip distribution
	-h         -- Show this help and exit
	-z         -- gzip kernel

Environment:
	__MAKE_CONF      -- Path to make.conf
	SRCCONF          -- Path to src.conf
	SRC_ENV_CONF     -- Path to src-env.conf
	KERNCONF         -- Kernel names
	MODULES_OVERRIDE -- List of kernel modules to install
	TARGET           -- Machine hardware name
	TARGET_ARCH      -- Machine processor arquitecture name
END
	exit 1
}

unset with_bsdinstall
unset skip_world
unset skip_kernel
unset skip_distribution
unset gzip_kernel
while getopts s:d:o:iWKDhz opt; do
	case "$opt" in
		s)
			srcdir=$OPTARG
			;;
		d)
			destdir=$OPTARG
			;;
		o)
			objdir=$OPTARG
			;;
		i)
			with_bsdinstall=1
			;;
		W)
			skip_world=1
			;;
		K)
			skip_kernel=1
			;;
		D)
			skip_distribution=1
			;;
		z)
			gzip_kernel=1
			;;
		*)
			usage
			;;
	esac
done

# Default obj dir to src/../obj
: ${objdir=$(realpath ${srcdir}/../obj)}

[ -z "$srcdir" ] \
	&& err "source directory is not defined"

[ -e $srcdir -a ! -d $srcdir ] \
	&& err "source path already exists and is not a directory"

[ -z "$destdir" ] \
	&& err "destination directory is not defined"

[ -e $destdir -a ! -d $destdir ] \
	&& err "destination path already exists and is not a directory"

[ -n "$objdir" -a -e $objdir -a ! -d $objdir ] \
	&& err "obj path already exists and is not a directory"

for env_var in __MAKE_CONF SRCCONF SRC_ENV_CONF; do
	eval "value=\${$env_var}"
	[ -n "${value}" -a ! -f "${value}" ] \
		&& err "${env_var} is pointing to a nonexistent file ${value}"
done

[ ! -f ${srcdir}/sys/sys/param.h ] \
	&& err "Source directory is missing sys/sys/param.h"

ncpu=$(sysctl -n hw.ncpu)
njobs=$((ncpu*2))
j="-j${njobs}"

[ -n "${objdir}" ] \
	&& export MAKEOBJDIRPREFIX=${objdir}

[ -z "${with_bsdinstall}" ] \
	&& export WITHOUT_BSDINSTALL=yes

[ -d $destdir ] \
	&& force_rm ${destdir}

export DESTDIR=${destdir}

make_cmd="make -C ${srcdir} -s ${j}"

[ -z "${skip_world}" ] \
	&& run "Installing world" \
		"${make_cmd} installworld"

if [ -z "${skip_kernel}" ]; then
	run "Installing kernel" \
		"${make_cmd} KERNCONF=${KERNCONF:-pfSense} installkernel"

	[ -n "${gzip_kernel}" ] \
		&& run "Compressing kernel" \
			"gzip -f9 ${destdir}/boot/kernel/kernel"
fi

[ -z "${skip_distribution}" ] \
	&& run "Installing distribution" \
		"${make_cmd} distribution"

[ -n "${with_bsdinstall}" ] \
	&& run "Copying /etc/rc.local to start bsdinstall" \
		"cp ${srcdir}/release/rc.local ${destdir}/etc"

exit 0


Script for pulling and sending notification mails

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/bitmand/github-diff-notification.git/'


Added script to generate test .php files from .proto files

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

set +e
cd $(dirname $0)

cd ../tests/generated_code

protoc-gen-php -i . -o . ./math.proto

cd -

cd ../tests/interop

protoc-gen-php -i . -o . ./test.proto

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


Fix undefined app name

Fix undefined app name

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/cuongquay/citus-iot-ecosystem.git/'


First version of a script to install dotfiles

#!/bin/sh
set -e

# This setup.sh script requires:
#  * git
#  * sh

ROOT=$(cd $(dirname $0); git rev-parse --show-toplevel)

# To support dotfiles referencing other scripts and files
# without needing to copy them, we need a standard path
# they can reference. Let's standarize on "~/.dotfiles"
if [ "$ROOT" != "$HOME/.dotfiles" ]; then
	echo "ERROR: you must clone the repo as ~/.dotfiles/" >&2
	exit 1
fi

# Prepare backup directory
BACKUPS="$ROOT/backups/$(date +%s)/"
mkdir -p "$BACKUPS"

cd "$ROOT"
for module in *; do
	# not a module - skip
	if [ ! -d "$module" ]; then
		continue;
	fi

	# incomplete module - skip
	if [ ! -f "$module/dotfiles" ]; then
		continue;
	fi

	echo "Installing dotfiles for $module"

	# install dotfiles - back up existing ones
	for dotfile in $(cat "$module/dotfiles"); do
		MODULE="$ROOT/$module"
		ORIG="$MODULE/$(echo $dotfile | cut -f1 -d:)"
		DEST="$HOME/$(echo $dotfile | cut -f2 -d:)"

		# if destination is unset, use default
		if [ "$DEST" = "$HOME/" ]; then
			DEST="$HOME/$ORIG"
		fi

		# if dotfile already exists, back it up
		if [ -f "$DEST" ]; then
			mv "$DEST" "$BACKUPS/"
		fi

		# link the dotfile
		ln -vs "$ORIG" "$DEST"
	done
done

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


Add sudo warning to setup.sh

Add sudo warning to setup.sh

Signed-off-by: adf75c2c2ec965e68e8d4752c9742146f0b6495c@gmail.com <adf75c2c2ec965e68e8d4752c9742146f0b6495c@gmail.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/tombee/dotfiles.git/'


Create setup.sh

Create setup.sh


autoconf

autoconf

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


MDEV#6132: yum update for MGC-10.0 fails (10.0.7 -> 10.0.10)

Fixed the incorrect sed command.

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/flynn1973/mariadb-aix.git/'


update wizard

update wizard

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/inspire365/thrift_wizard.git/'


auditd: add missing build.sh file

auditd: add missing build.sh file

Whoops :)

Signed-off-by: Tycho Andersen <6b523322678240882acbb4da5312a12d8cd0082d@docker.com>

#!/bin/sh

AUDIT_HASH=59763dd8e587d1821f2d039b2bf446c3a31ea58e

set -e

cd /home/builder

git clone https://github.com/alpinelinux/aports && cd aports && git checkout $AUDIT_HASH
cd testing/audit

abuild-keygen -a
abuild -F -r

find ~/packages
cp ~/packages/testing/$(abuild -A)/*apk ~

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


add script to show installed kernels

add script to show installed kernels

#!/bin/sh -e

dpkg --list | grep linux-image

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


convert cache

convert cache

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/at7/work.git/'


Added deploy.sh

Added deploy.sh

#!/bin/sh

# Helper script to deploy cgi scripts and HTML file.

DEPLOYDIR=/www/pirover
SRCDIR=.
PYTHON=`which python`

mkdir -p $DEPLOYDIR/cgi-bin/archive
chmod -R a+x $DEPLOYDIR/

deploy_cgi() {
    SRCFILE=$1
    DSTFILE=$2
    sed -e "
    1c\\
#!$PYTHON
    " < $SRCFILE > $DSTFILE
    chmod a+x $DSTFILE
}

deploy_cgi $SRCDIR/webserver/cgi-bin/click.cgi  $DEPLOYDIR/cgi-bin/click.cgi
deploy_cgi $SRCDIR/webserver/cgi-bin/upload.cgi  $DEPLOYDIR/cgi-bin/upload.cgi
deploy_cgi $SRCDIR/webserver/cgi-bin/image.cgi  $DEPLOYDIR/cgi-bin/image.cgi
cp -p $SRCDIR/webserver/index.html $DEPLOYDIR/
cp -p $SRCDIR/webserver/server.py $DEPLOYDIR/
cp -p $SRCDIR/webserver/view.html $DEPLOYDIR/
cp -p $SRCDIR/webserver/cgi-bin/pymjpeg.py $DEPLOYDIR/cgi-bin/
cp -p $SRCDIR/webserver/cgi-bin/utils.py $DEPLOYDIR/cgi-bin/
chmod -R a+r $DEPLOYDIR/

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


Adding setup script to close #1

Adding setup script to close #1

#!/bin/bash
echo Starting UseOfForce project setup ...

password=$(cat password)

# Drop existing db and create new one
mysql -p$password -e "DROP DATABASE IF EXISTS policeshootings"
mysql -p$password -e "CREATE DATABASE policeshootings"

# Create table structure
mysql -p$password policeshootings < ./sql/createtables.sql

# import raw data into tables
filepath=$(pwd)'/data'

mysql -p$password policeshootings -e "LOAD DATA INFILE '$filepath/rawincidents.csv'
	INTO TABLE rawincidents
	FIELDS TERMINATED BY ','
	OPTIONALLY ENCLOSED BY '\"'
	IGNORE 1 LINES"
mysql -p$password policeshootings -e "LOAD DATA INFILE '$filepath/rawsubjects.csv'
	INTO TABLE rawsubjects
	FIELDS TERMINATED BY ','
	OPTIONALLY ENCLOSED BY '\"'
	IGNORE 1 LINES"
mysql -p$password policeshootings -e "LOAD DATA INFILE '$filepath/rawofficers.csv'
	INTO TABLE rawofficers
	FIELDS TERMINATED BY ','
	OPTIONALLY ENCLOSED BY '\"'
	IGNORE 1 LINES"

# normalize data into separate tables
mysql -p$password policeshootings < ./sql/normalize.sql

# import all stored procedures
for FILE in `ls ./sql/sprocs/*.sql`
do
	echo $FILE
	mysql -p$password policeshootings < $FILE
done

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


Added pptp-client setup script via pptpsetup command

#!/bin/bash

yum -y install pptp pptp-setup

echo -n "Tunnel: "
read tunnel
echo -n "Server: "
read server
echo -n "Username: "
read username

# This command will prompt for password
pptpsetup --create "$tunnel" --server "$server" --username "$username" \
    --encrypt
# Check out the tunnel file at /etc/ppp/peers directory

## To connect to the server using the tunnel created:
# pppd call tunnel_name

## Update routing table to allow all traffic through ppp0 interface:
# ip route add default dev ppp0

## To stop the connection:
# killall pppd

## To delete the tunnel:
# pptpsetup --delete tunnel_name

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


Adding in py2 to py3 conversion script from hackathon

# Prequisites
# 1) You must have devstack up and running
# 2) You must have hub installed (brew install hub)
# 3) You must have a publickey set up with github (so hub can make your PR)

# How To Run
# 1) Have devstack up and running (via `make dev.up` in your devstack repo)
# 2) On the command line, go into your edx-platform repo checkout
# 3) Make sure you are on the master branchof edx-platform with no changes
# 4) Run this script from the root of the repo, handing it your username, ticketname, and subdirectory to convert:
#     ./scripts/py2_to_py3_convert_and_create_pr.sh cpappas INCR-1234 common/lib/calc

help_text="\nUsage: ./scripts/py2_to_py3_convert_and_create_pr.sh <username> <ticket-name> <subdirectory>\n";
help_text+="Example: ./scripts/py2_to_py3_convert_and_create_pr.sh cpappas INCR-1234 common/lib/calc\n\n";

for i in "$@" ; do
    if [[ $i == "--help" ]] ; then
        printf "$help_text";
        exit 0;
    fi
done

if [[ $# -lt 3 ]]; then
	printf "$help_text";
	exit 0;
fi

myname="$1";
myticket="$2";
subdirectory="$3";

mybranch="$myname/$myticket";

git checkout -b $mybranch || { printf "\n\nERROR: could not check out branch with name: $mybranch\n\n"; exit 1; }
docker exec -t edx.devstack.lms bash -c "source /edx/app/edxapp/edxapp_env && cd /edx/app/edxapp/edx-platform/ && python-modernize -w $subdirectory && pytest $subdirectory" || { printf "\n\nERROR: Tests did not pass, or something went wrong trying to run tests.\n\n"; exit 1; }
git add $subdirectory || { printf "\n\nERROR: Could not 'git add' directory $subdirectory\n\n"; exit 1; }
git commit -m"$mybranch" || { printf "\n\nERROR: Could not commit files to $mybranch\n\n"; exit 1; }
git push origin "$mybranch" || { printf "\n\nERROR: Could not push branch to remote. If you are outside of the edX organization, you might consider first forking the repo, and then running this command to create a PR from within that checkout.\n\n"; exit 1; }
hub pull-request -m"$myticket" || { printf "\n\nERROR: Did not successfully create PR for this conversion\n\n"; }

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


update-templates-with-secrets.sh service account name change

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/simonsdave/cloudfeaster-services.git/'


skipping tz

skipping tz

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/nuodb/nuodb-django.git/'


Add cocos to path

Add cocos to path

# Add environment variable COCOS_CONSOLE_ROOT for cocos2d-x
export COCOS_CONSOLE_ROOT=/Users/james/code/opensource/cocos2d-js/tools/cocos2d-console/bin
export PATH=$COCOS_CONSOLE_ROOT:$PATH

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


Fix undefined app name

Fix undefined app name


Fix inline unicreds evaluation for docker env-file

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


Скрипт prepareProject.sh

Скрипт prepareProject.sh

#!/bin/sh

chmod -R 777 app/cache
chmod -R 777 app/logs

php app/console doctrine:schema:update --force
php app/console doctrine:fixtures:load
php app/console cache:clear
php app/console assets:install

chmod -R 777 app/cache
chmod -R 777 app/logs

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


the integrated/portal script to execute the whole GPX preprocessing workflow

#!/bin/bash

BBOX=$1
GPX_DATA_DIR=$2
# TODO step 1: download GPX from OSM
python osm_gpx_fetcher.py $GPX_DATA_DIR
# step 2: complement the downloaded GPX with elevations from SRTM dataset
./gpx_elev_enhancer.sh $GPX_DATA_DIR
# step 3: generate summary info for each GPX
./gpxinfo_collector.sh $GPX_DATA_DIR
# step 4: reduce summaries into well-structured CSV format
python gpx_summary_reducer.py -c ./reducer_conf.json $GPX_DATA_DIR/summary
# step 5: combine CSV files into one
./combine_gpx_csv_info.sh $GPX_DATA_DIR/summary/csv $GPX_DATA_DIR/summary/csv/munich_gpx_info.csv

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


Adding build env script

Adding build env script

virtualenv 2.7
. 2.7/bin/activate
mkdir src
cd src

for pro in atelier lino xl cosi noi book voga presto welfare avanti extjs6

do
    git clone git@github.com:lino-framework/$pro.git
done

for comm in https://github.com/lsaffre/commondata \
	    https://github.com/lsaffre/commondata-be \
	    https://github.com/lsaffre/commondata-ee \
	    https://github.com/lsaffre/commondata-eg \
            git@github.com:cylonoven/django-mailbox.git \
	    https://github.com/lsaffre/sphinx.git
do
    git clone $comm
done

for i in sphinx atelier lino xl noi django-mailbox extjs6 commondata commondata-be commondata-ee commondata-eg cosi voga presto welfare avanti book
do
    pip install -e $i
done

sudo apt-get install libreoffice python3-uno

sudo apt-get install build-essential libssl-dev libffi-dev python-dev mock

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


added ngrok

added ngrok

alias ngrok="ngrok -authtoken $(cat ~/.ngrok |cut -d' ' -f2-)"
alias localtunnel="ngrok -config ngrok.yaml start default"

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


Add shellscript for reloading the audio service on macOS

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


Add excuse for sloppiness :)

Add excuse for sloppiness :)

#!/bin/bash
set -e; set -o pipefail

# Displays parameteters with command name prepended, outputted to stderr.
# $@: message to display.
function error()
{
	echo $(basename $0): $@ >&2
}

# Displays parameteters with command name prepended, outputted to stderr, then
# exits with error status.
# $@: message to display.
function fatal()
{
	error $@
	exit 1
}

# Pushes directory onto pushd stack without outputting anything.
# $1: Directory to add to pushd stack.
function push()
{
	pushd $1 >/dev/null
}

# Pops directory off pushd stack without outputting anything.
function pop()
{
	popd >/dev/null
}

# Pushes into linux dev directory (at $LINUX_DEV_PATH), assumes this variable is
# available.
function push_linux()
{
	push $LINUX_DEV_PATH
}

# Pushes into kernel dev directory (at $KERNDEV_PATH), assumes this variable is
# available.
function push_kerndev()
{
	push $KERNDEV_PATH
}

# Replaces the current script with an elevated version of itself.
# If parameters are to be preserved, needs to be passed $@.
function elevate()
{
	if [ $EUID != 0 ]; then
		exec sudo -E $0 $@
		exit $?
	fi
}

# Checks whether the specified binaries are available on the $PATH.
# $@: Binaries to check.
function check_exists()
{
	for file in $@; do
		(which $file &>/dev/null) || \
			fatal "Can't find required binary '$file' on path."
	done
}

# Loop mount image file into /mnt.
# $1: Image file to mount, in $KERNDEV_PATH.
function mount_image()
{
	mount -o loop $KERNDEV_PATH/$1 /mnt
}

# Attempt to unmount /mnt, ignore any failures.
function unmount()
{
	# This _can_ be dangerous, theoretically, but this is usually shortly
	# followed by an attempt at a mount, which if the unmount fails, will
	# also fail and end the script with an error.
	umount /mnt &>/dev/null || true
}

# Give ownership of the specified directory to the user (assumes $SUDO_USER is
# available!)
# $1: Directory to 'give back' to user $SUDO_USER.
function give_back()
{
	[ -z "$SUDO_USER" ] && error "give_back: SUDO_USER not defined." || \
		chown -R $SUDO_USER:$SUDO_USER $1
}

# Run make with specified arguments and $make_opts. If $VERBOSE is set, output
# to controlling terminal, otherwise redirect to /dev/null.
# $@: make arguments.
function mak()
{
	[ -z $VERBOSE ] && out="null" || out="tty"

	make $make_opts $@ >/dev/$out
}

# Determines if the argument is an command-line option.
# $1: Argument.
function is_opt()
{
	[[ $1 == -* ]]
}

# Say we're done, if we're not configured to not do so.
function say_done()
{
	[ -z "$NO_DONE" ] && echo Done! || true
}

#!/bin/bash
set -e; set -o pipefail

# Displays parameteters with command name prepended, outputted to stderr.
# $@: message to display.
function error()
{
	echo $(basename $0): $@ >&2
}

# Displays parameteters with command name prepended, outputted to stderr, then
# exits with error status.
# $@: message to display.
function fatal()
{
	error $@
	exit 1
}

# Pushes directory onto pushd stack without outputting anything.
# $1: Directory to add to pushd stack.
function push()
{
	pushd $1 >/dev/null
}

# Pops directory off pushd stack without outputting anything.
function pop()
{
	popd >/dev/null
}

# Pushes into linux dev directory (at $LINUX_DEV_PATH), assumes this variable is
# available.
function push_linux()
{
	push $LINUX_DEV_PATH
}

# Pushes into kernel dev directory (at $KERNDEV_PATH), assumes this variable is
# available.
function push_kerndev()
{
	push $KERNDEV_PATH
}

# Replaces the current script with an elevated version of itself.
# If parameters are to be preserved, needs to be passed $@.
function elevate()
{
	if [ $EUID != 0 ]; then
		exec sudo -E $0 $@
		exit $?
	fi
}

# Checks whether the specified binaries are available on the $PATH.
# $@: Binaries to check.
function check_exists()
{
	for file in $@; do
		(which $file &>/dev/null) || \
			fatal "Can't find required binary '$file' on path."
	done
}

# Loop mount image file into /mnt.
# $1: Image file to mount, in $KERNDEV_PATH.
function mount_image()
{
	mount -o loop $KERNDEV_PATH/$1 /mnt
}

# Attempt to unmount /mnt, ignore any failures.
function unmount()
{
	umount /mnt &>/dev/null || true
}

# Give ownership of the specified directory to the user (assumes $SUDO_USER is
# available!)
# $1: Directory to 'give back' to user $SUDO_USER.
function give_back()
{
	[ -z "$SUDO_USER" ] && error "give_back: SUDO_USER not defined." || \
		chown -R $SUDO_USER:$SUDO_USER $1
}

# Run make with specified arguments and $make_opts. If $VERBOSE is set, output
# to controlling terminal, otherwise redirect to /dev/null.
# $@: make arguments.
function mak()
{
	[ -z $VERBOSE ] && out="null" || out="tty"

	make $make_opts $@ >/dev/$out
}

# Determines if the argument is an command-line option.
# $1: Argument.
function is_opt()
{
	[[ $1 == -* ]]
}

# Say we're done, if we're not configured to not do so.
function say_done()
{
	[ -z "$NO_DONE" ] && echo Done! || true
}


NO-JIRA: Handy script find_ports.sh to find all the listening ports used by a system test.

find_ports.sh [ dir ]

Find all the listening ports mentioned in *.log files under dir.
With no dir search under the current directory.

git-svn-id: 9a58b4ca7225a53aaf0b7b888bc8921347b27898@1617885 13f79535-47bb-0310-9956-ffa450edef68

#!/bin/bash
# Usage: $0 [ dir ]
# Find all the listening ports mentioned in *.log files under dir.
# With no dir search under current directory.

find "$@" -name '*.log' | xargs gawk 'match($0, /Listening on .* ([0-9]+)/, m) { print m[1] } match($0, /Configured Listener: .*:([0-9]+)/, m) { print m[1] }'

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


for reference added query and q typescript type definitions

Signed-off-by: Michele Ursino <0d7cbec952c33d7c21e19d50988899883a4c91e0@amilink.com>

tsd query underscore -s -a install
tsd query bootstrap -s -a install
tsd query moment -s -a install
tsd query jquery -s -a install
tsd query q -s -a install


I hate vpns

I hate vpns

#!/bin/bash
# PGP v0.0.1
# VPN DNS Automatorizer v0.0.2

RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
RESET=$(tput sgr0)

function startUp () {
    if [ -e /etc/resolv.conf ] && grep -vo danlaw /etc/resolv.conf; then
        echo "${GREEN}[+]${RESET} Moving /etc/resolv.conf to /etc/.resolv.conf"
        mv -f /etc/resolv.conf /etc/.resolv.conf
        echo "search example.com" > /etc/resolv.conf
        echo "nameserver x.x.x.x" >> /etc/resolv.conf
        echo "nameserver x.x.x.x" >> /etc/resolv.conf
    elif [ ! -e /etc/resolv.conf ] && [ -e /etc/.resolv.conf ] && [ grep -o danlaw /etc/resolv.conf ]; then
        echo "${GREEN}[+]${RESET} /etc/.resolv.conf was found, moving it to /etc/resolv.conf"
        mv /etc/.resolv.conf /etc/resolv.conf
        echo "${RED}[!]${RESET} The script has exited. You have a config that will not allow you to access DNS services. Please install your previous working config."
        exit 1
    else
        echo "${RED}[!]${RESET} No good /etc/resolv.conf or /etc/.resolv.conf exists"
        echo "${GREEN}[+]${RESET} Creating danlaw config"
        echo "search example.com" > /etc/resolv.conf
        echo "domain example.com" >> /etc/resolv.conf
        echo "nameserver 127.0.0.1" >> /etc/resolv.conf
        echo "nameserver x.x.x.x" >> /etc/resolv.conf
        echo "nameserver x.x.x.x" >> /etc/resolv.conf
    fi
}

function middleStuff () {
    echo "${GREEN}[+]${RESET} The current config in place is"
    cat /etc/resolv.conf
    echo
    echo "${GREEN}[+]${RESET} Starting VPN. Please have your credentials on hand and not written down on a sticky note. Every insecure password and password leak makes the admin cry."
}

function cleanUp () {
    echo "${GREEN}[+]${RESET} Cleaning up after the VPN connection"
    if [ -e /etc/.resolv.conf ]; then
        mv -f /etc/.resolv.conf /etc/resolv.conf
    else
        echo "${RED}[!]${RESET} You removed /etc/.resolv.conf didn't you? >:|"
        exit 1
    fi
}

# Upon detecting any EXIT signal during this script, it will start the cleanUp function.
# Step 4
trap cleanUp EXIT

# Step 1
startUp
# Step 2
middleStuff
# Step 3 to actually start the VPN
openvpn --config ~/.client.ovpn

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


Fixed shipit script for golint fix

Fixed shipit script for golint fix

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/thomasmmitchell/spruce.git/'


add a format helper script

add a format helper script

#!/bin/bash

BASEDIR=`dirname $0`
SRCDIR=$BASEDIR/src

find $SRCDIR -name "*.[chi]pp" | xargs clang-format -style=file -i

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


generate-img-fragment.sh

generate-img-fragment.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/cycourtot/Projet-SciLab-Unix.git/'


license is a comment, not an echo

license is a comment, not an echo

#!/bin/sh

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

echo Compile then run the Java test.

testdir=$(readlink -fn `dirname $0`)
thisdir=$(readlink -fn `pwd`)

if [[ "$testdir" != "$thisdir" ]]; then
	echo error: must be run from inside the ${testdir} directory
	echo you ran it from ${thisdir}
	exit 1
fi

javac -classpath ${testdir}/../java:${testdir} JavaTest.java
java -classpath ${testdir}/../java:${testdir} JavaTest

#!/bin/sh
cat <<-LICENSE
Copyright 2014 Google Inc. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
LICENSE

echo
echo Compile then run the Java test.

testdir=$(readlink -fn `dirname $0`)
thisdir=$(readlink -fn `pwd`)

if [[ "$testdir" != "$thisdir" ]]; then
	echo error: must be run from inside the ${testdir} directory
	echo you ran it from ${thisdir}
	exit 1
fi

javac -classpath ${testdir}/../java:${testdir} JavaTest.java
java -classpath ${testdir}/../java:${testdir} JavaTest


script

script

#!/usr/bin/env bash

# Create the bucket for blobs

BUCKET=bosh-ironic-cpi-release

# s3cmd mb "s3://${BUCKET}"
# s3cmd setacl "s3://${BUCKET}"  --acl-public --recursive

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


Added useful setscreen script

Added useful setscreen script

#!/bin/bash
: '
OriB ITH
set screen to creen resolution adjuster
'

xrandr --newmode "1920x1080" 173.00  1920 2048 2280 2576  1080 1083 1088 1120 -hsync +vsync
xrandr --addmode Virtual1 "1920x1080"
xrandr --output Virtual1 --mode "1920x1080"

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


helper run script

helper run script

SPARK_CMD="/Users/hoszowsk/dev/iqlab/git//spark-install/spark/bin/spark-submit --conf spark.eventLog.enabled=true "
CLASS="com.hoszu.spark.TrxAnalyzer"
MASTER="spark://tower:7077"
JAR="target/spark-trx-analyzer-*.jar"
OUTPUT_DIR="/tmp/suspiciousTransactions"

CORES=2
PARALLEL=1
FRAUDABILITYLIMIT=10

while (( "$#" )); do
case $1 in
    --cores|-c)
      CORES=$2;
      ;;
    --parallel|-p)
      PARALLEL=$2
      ;;
    --local|-l)
      MASTER="local"
      ;;
    --fraudability|-f)
      FRAUDABILITYLIMIT=$2
      ;;
    --help|-h)
      echo "$0 --cores <total-executor-cores> --parallel <number of parallel applications to run>"; exit 1
      ;;
  esac
shift
done

rm -rf $OUTPUT_DIR

for i in `seq 1 $PARALLEL`;
do
    $SPARK_CMD --total-executor-cores $CORES --class $CLASS --master $MASTER $JAR data/atm.txt data/trx.txt $OUTPUT_DIR$i $FRAUDABILITYLIMIT &
    sleep 1
done

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


Upgraded to 2.23

Upgraded to 2.23

#!/bin/sh

set +h		# disable hashall
shopt -s -o pipefail
set -e 		# Exit on error

PKG_NAME="grep"
PKG_VERSION="2.23"

TARBALL="${PKG_NAME}-${PKG_VERSION}.tar.xz"
SRC_DIR="${PKG_NAME}-${PKG_VERSION}"

function prepare() {
    ln -sv "/source/$TARBALL" "$TARBALL"
}

function unpack() {
    tar xf ${TARBALL}
}

function build() {
    ./configure --prefix=/usr --bindir=/bin
    make $MAKE_PARALLEL
}

function check() {
    make $MAKE_PARALLEL check
}

function instal() {
    make $MAKE_PARALLEL install
}

function clean() {
    rm -rf "${SRC_DIR}" "$TARBALL"
}

clean;prepare;unpack;pushd ${SRC_DIR};build;[[ $MAKE_CHECK = TRUE ]] && check;instal;popd;clean

#!/bin/sh

set +h		# disable hashall
shopt -s -o pipefail

PKG_NAME="grep"
PKG_VERSION="2.21"

TARBALL="${PKG_NAME}-${PKG_VERSION}.tar.xz"
SRC_DIR="${PKG_NAME}-${PKG_VERSION}"

function prepare() {
    ln -sv "/source/$TARBALL" "$TARBALL"
}

function unpack() {
    tar xf ${TARBALL}
}

function build() {
    sed -i -e '/tp++/a  if (ep <= tp) break;' src/kwset.c
    ./configure --prefix=/usr --bindir=/bin
    make $MAKE_PARALLEL
}

function check() {
    make $MAKE_PARALLEL check
}

function instal() {
    make $MAKE_PARALLEL install
}

function clean() {
    rm -rf "${SRC_DIR}" "$TARBALL"
}

clean;prepare;unpack;pushd ${SRC_DIR};build;[[ $MAKE_CHECK = TRUE ]] && check;instal;popd;clean


Add extr alias. Reorder aliases.

Add extr alias. Reorder aliases.

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


Make use of _install_repo for qfc.

Make use of _install_repo for qfc.


Move variables to top.

Move variables to top.

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/meyerlasse/Linux-Init.git/'


fixing a comment

fixing a comment

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/wenchenglai/firehose-ember-shared.git/'


added --assumeyes for dnf command

added --assumeyes for dnf command

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


Adding imovie/QT ffmpeg script

Adding imovie/QT ffmpeg script

#!/bin/bash

current_directory=$(pwd)

ffmpeg_check(){
	if [[ ! ( -f /usr/bin/ffmpeg || -f /usr/local/bin/ffmpeg ) ]] ; then
		echo "FFmpeg not installed!"
		echo "Please install it at: https://ffmpeg.org/download.html"
		exit 1
	fi
}

ffmpeg_single(){
	while read x ; do
		ffmpeg -i "${x}" -strict experimental -pix_fmt yuv420p \
		-c:v libx264 -c:a aac \
		-ab 160000 -preset slow \
		-crf 15 "${x/%.*/_imovie.mp4}"
	done
}

DEAL_WITH_IT(){
	echo -n "( •_•)"
	sleep .75
	echo -n -e "\r( •_•)>⌐■-■"
	sleep .75
	echo -n -e "\r               "
	echo  -e "\r(⌐■_■)"
	sleep .5
}

ffmpeg_check
echo "Drag and Drop your file HERE -->  "
ffmpeg_single && DEAL_WITH_IT

<<EOL
ffmpeg_batch(){
	for x in *.mp4; do
		ffmpeg -i "${x}" -strict experimental \
		-pix_fmt yuv420p -vcodec libx264 -acodec aac \
    -ab 160000 -preset slow \
    -crf 18 "${x/.mp4/_imovie.mp4}";
	done
	exit 0
}

ffmpeg_check
read -rp "Enter (1) to transcode a single file, or (2) to transcode a folder -->   " TRANSCODE_CHOICE
case "$TRANSCODE_CHOICE" in
	1)
			echo "Drag and drop file HERE -->  "
			ffmpeg_single
			;;

	2)
			ffmpeg_batch
			;;

	*)
			echo "Please enter (1) or (2)"
			;;
	esac
EOL

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


Sample early_chroot_script

Sample early_chroot_script

Signed-off-by: Vlad Ungureanu <ddaa4628090b870dcc5f131376dd66e9e673ad5d@vdev.ro>

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

export LC_ALL=C
tmp_dir=$1

error: pathspec 'target/chroot/early_chroot_script.sh' did not match any file(s) known to git


Updated ellipsis version dependency

Updated ellipsis version dependency

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/groggemans/dot-fonts.git/'


New temporary env file for grid installs.

#!/bin/bash
export PYTHONPATH=$PWD:$PWD/core:$PWD/packages:$PYTHONPATH
echo "snoing setup"

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


am cbb9c761: am 27c9f861: am 1703474f: am 365e4439: Merge "Add aosp_aarch64-eng to the default lunch menu."

* commit 'cbb9c76174f4da90d5311f75f808c9b570dc5bc8':
  Add aosp_aarch64-eng to the default lunch menu.

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/xorware/android_build.git/'


am 6492792d: Merge "Consult tput about color control sequence support"

* commit '6492792d8a30f218fff6d54765ba5502de0a9a2a':
  Consult tput about color control sequence support


Use java_home to determine jdk location.

Specifying the major version rather than hard coding
to a minor version.

Change-Id: Ieccec98c1b41e3eb7f512bcebc83f6034d634862


Updated fix_pyproto for mac

Updated fix_pyproto for mac

#!/bin/bash

SED=sed

if [[ "`uname`" == "Darwin" ]]; then
  SED=gsed
fi

# Rename modules to lowercase:
# import "mvp/Frontend/SessionDesc.proto";
# becomes
# import "mvp/frontend/SessionDesc.proto";
$SED -e 's/^\(\s*import\s*"\)\(.*\)\(\/.*\)/\1\L\2\E\3/' $1 > $2


Add produce_gzip_benchmark_table.sh

Add produce_gzip_benchmark_table.sh

#!/bin/bash

do_benchmark() {
	usize=$(stat -c %s "$file")
	"$HOME/proj/libdeflate/benchmark" -g -s $usize "$@" "$file" \
			| grep Compressed | cut -f 4 -d ' '
}

echo "File | zlib -6 | zlib -9 | libdeflate -6 | libdeflate -9 | libdeflate -12"
echo "-----|---------|---------|---------------|---------------|---------------"

for file in "$@"; do
	echo -n "$(basename "$file")"
	results=()
	results+=($(do_benchmark -Y -l 6))
	results+=($(do_benchmark -Y -l 9))
	results+=($(do_benchmark -l 6))
	results+=($(do_benchmark -l 9))
	results+=($(do_benchmark -l 12))
	best=2000000000
	for result in "${results[@]}"; do
		if (( result < best)); then
			best=$result
		fi
	done
	for result in "${results[@]}"; do
		if (( result == best )); then
			em="**"
		else
			em=""
		fi
		echo -n " | ${em}${result}${em}"
	done
	echo
done

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


Initial create.

Initial create.

#!/bin/sh
# originally created by https://gist.github.com/dkd903
# adapted here for Fedora 22 x64

SHORTCUT="[Desktop Entry]
Name=Sublime Text 3
Comment=Edit text files
Exec=/usr/local/sublime-text-3/sublime_text_3/sublime_text
Icon=/usr/local/sublime-text-3/sublime_text_3/Icon/128x128/sublime-text.png
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Utility;TextEditor;"
SCRIPT="#!/bin/sh
if [ \${1} == \"--help\" ]; then
    /usr/local/sublime-text-3/sublime_text_3/sublime_text --help
else
    /usr/local/sublime-text-3/sublime_text_3/sublime_text \$@ > /dev/null 2>&1 &
fi"

curl -L "http://c758482.r82.cf2.rackcdn.com/sublime_text_3_build_3088_x64.tar.bz2" -o "/usr/src/Sublime Text 3.tar.bz2"
cd /usr/src
tar -xvjf "Sublime Text 3.tar.bz2"
cd "Sublime Text 3"
mkdir -pv "/usr/local/sublime-text-3"
mv -fv * "/usr/local/sublime-text-3/"
echo "${SCRIPT}" > "/usr/local/bin/subl"
chmod +x "/usr/local/bin/subl"
echo "${SHORTCUT}" > "/usr/share/applications/sublime-text-3.desktop"

echo "Finish!"

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


#006# add shell script support unix LF

#006# add shell script support unix LF

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/xusida/sqa.git/'


Revert "Update raspberry.sh"

Revert "Update raspberry.sh"

This reverts commit c01db1f065da6ad3fdd10a2920d72fe0ee415ae1.

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/Milwee/shomi.git/'


Added more compiler test-cases (no implementation)

#!/usr/bin/env bats
##############################################################################

load _helper
load compiler

##############################################################################

@test "compiler.print_error prints error" {
    skip "No test implementation"
}

@test "compiler.get_keyword gets keyword" {
    skip "No test implementation"
}

@test "compiler.get_keyword gets keyword" {
    skip "No test implementation"
}

@test "compiler.get_line strips keyword" {
    skip "No test implementation"
}

@test "compiler.get_line strips keyword" {
    skip "No test implementation"
}

@test "compiler.compile compiles a file" {
    skip "No test implementation"
}

@test "compiler.parse_file parses a file" {
    skip "No test implementation"
}

@test "compiler.parse_file parses a raw file" {
    skip "No test implementation"
}

@test "compiler.get_condition gets if/elif condition" {
    skip "No test implementation"
}

@test "compiler.parse_if parses if/elif" {
    skip "No test implementation"
}

@test "compiler.parse_line parses a line" {
    skip "No test implementation"
}

##############################################################################

#!/usr/bin/env bats
##############################################################################

load _helper
load compiler

##############################################################################

@test "compiler.compile compiles a file" {
    skip "No test implementation"
}

@test "compiler.parse_file parses a file" {
    skip "No test implementation"
}

@test "compiler.include_raw includes a file without processing it" {
    skip "No test implementation"
}

@test "compiler.include_raw includes a file without processing it" {
    skip "No test implementation"
}

##############################################################################


First draft

First draft

#!/bin/bash
# Centos 7 Hardening

yum makecache fast
yum update -y
yum install -y epel-release
yum install -y yum-utils wget
yum install -y fail2ban-firewalld
yum update -y
yum clean all

systemctl stop NetworkManager.service
systemctl disable NetworkManager.service

echo "search mgmt.pdsint.net" > /etc/resolv.conf && \
echo "nameserver 199.60.252.136" >> /etc/resolv.conf && \
echo "nameserver 199.185.139.143" >> /etc/resolv.conf

echo "[sshd]" > /etc/fail2ban/jail.local
echo "enabled = true" >> /etc/fail2ban/jail.local

systemctl enable fail2ban
systemctl start fail2ban

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