added avrdude as a dependency

added avrdude as a dependency

#!/usr/bin/env bash

TOP=$(cd $(dirname $0)/.. && pwd -L)

if [ "$1" = "-q" ]; then
  QUIET="echo"
fi

# clean
cd ${TOP}
rm -rf dist

function _run() {
  if [[ "$QUIET" ]]; then
    echo "$*"
  else
    eval "$@"
  fi
}

function python_package() {
  local SETUP_SCRIPT=$1
  cp ${SETUP_SCRIPT} ${TOP}/setup.py
  python ${TOP}/setup.py clean
  python ${TOP}/setup.py bdist_egg
  python ${TOP}/setup.py sdist
  _run python ${TOP}/setup.py sdist upload -r mycroft
  rm ${TOP}/setup.py
}

VERSION="$(basename $(git describe --abbrev=0 --tags) | sed -e 's/v//g')"

echo "version=\"${VERSION}\"" > ${TOP}/mycroft/__version__.py

# build and upload pypi distribution to internal pypi mirror
cd ${TOP}
python_package mycroft-base-setup.py
python_package skills-sdk-setup.py

# build distributable virtualenv
ARCH="$(dpkg --print-architecture)"
SYSTEM_TARGET="/usr/local/"
ARTIFACT_BASE="mycroft-core-${ARCH}-${VERSION}"
MYCROFT_ARTIFACT_DIR=${TOP}/build/${ARTIFACT_BASE}

virtualenv --always-copy --clear ${MYCROFT_ARTIFACT_DIR}
virtualenv --always-copy --clear --relocatable ${MYCROFT_ARTIFACT_DIR}
. ${MYCROFT_ARTIFACT_DIR}/bin/activate

pip install -r ${TOP}/requirements.txt
cd ${TOP}/pocketsphinx-python
python setup.py install
cd ${TOP}
python mycroft-base-setup.py install

${TOP}/install-pygtk.sh

virtualenv --always-copy --relocatable ${MYCROFT_ARTIFACT_DIR}

mkdir -p ${TOP}/dist
cd ${TOP}/build
tar -czf ${TOP}/dist/${ARTIFACT_BASE}.tar.gz ${ARTIFACT_BASE}

# package distributable virtualenv into deb
function replace() {
  local FILE=$1
  local PATTERN=$2
  local VALUE=$3
  local TMP_FILE="/tmp/$$.replace"
  cat ${FILE} | sed -e "s/${PATTERN}/${VALUE}/g" > ${TMP_FILE}
  mv ${TMP_FILE} ${FILE}
}

DEB_BASE="mycroft-core-${ARCH}_${VERSION}-1"
DEB_DIR=${TOP}/build/${DEB_BASE}
mkdir -p ${DEB_DIR}/DEBIAN

echo "Creating debian control file"
# setup control file
CONTROL_FILE=${DEB_DIR}/DEBIAN/control
cp ${TOP}/publish-core/deb_base/control.template ${CONTROL_FILE}
replace ${CONTROL_FILE} "%%PACKAGE%%" "mycroft-core"
replace ${CONTROL_FILE} "%%VERSION%%" "${VERSION}"
replace ${CONTROL_FILE} "%%ARCHITECTURE%%" "${ARCH}"
replace ${CONTROL_FILE} "%%DESCRIPTION%%" "mycroft-core"
replace ${CONTROL_FILE} "%%DEPENDS%%" "portaudio19-dev, libglib2.0-0, flac, espeak, mpg123, mimic, avrdude"
echo "Creating debian preinst file"
PREINST_FILE=${DEB_DIR}/DEBIAN/preinst
cp ${TOP}/publish-core/deb_base/preinst.template ${PREINST_FILE}
replace ${PREINST_FILE} "%%INSTALL_USER%%" "mycroft"
chmod 0755 ${PREINST_FILE}

echo "Creating debian postinst file"
POSTINST_FILE=${DEB_DIR}/DEBIAN/postinst
cp ${TOP}/publish-core/deb_base/postinst.template ${POSTINST_FILE}
replace ${POSTINST_FILE} "%%INSTALL_USER%%" "mycroft"
chmod 0755 ${POSTINST_FILE}

echo "Creating debian prerm file"
PRERM_FILE=${DEB_DIR}/DEBIAN/prerm
cp ${TOP}/publish-core/deb_base/prerm.template ${PRERM_FILE}
replace ${PRERM_FILE} "%%INSTALL_USER%%" "mycroft"
chmod 0755 ${PRERM_FILE}

echo "Creating debian postrm file"
POSTRM_FILE=${DEB_DIR}/DEBIAN/postrm
cp ${TOP}/publish-core/deb_base/postrm.template ${POSTRM_FILE}
replace ${POSTRM_FILE} "%%INSTALL_USER%%" "mycroft"
chmod 0755 ${POSTRM_FILE}

# setup init scripts
function setup_init_script() {
  local NAME=$1
  echo "Creating init script for ${NAME}"
  INIT_SCRIPT=${DEB_DIR}/etc/init.d/${NAME}
  mkdir -p $(dirname ${INIT_SCRIPT})
  cp ${TOP}/publish-core/deb_base/init.template ${INIT_SCRIPT}
  replace ${INIT_SCRIPT} "%%NAME%%" "${NAME}"
  replace ${INIT_SCRIPT} "%%DESCRIPTION%%" "${NAME}"
  replace ${INIT_SCRIPT} "%%COMMAND%%" "\/usr\/local\/bin\/${NAME}"
  replace ${INIT_SCRIPT} "%%USERNAME%%" "mycroft"
  chmod a+x ${INIT_SCRIPT}
}

setup_init_script "mycroft-messagebus"
setup_init_script "mycroft-skills"
setup_init_script "mycroft-speech-client"

if [ ${ARCH} = "armhf" ]; then
  setup_init_script "mycroft-enclosure-client"
fi

mkdir -p ${DEB_DIR}/${SYSTEM_TARGET}
cp -rf ${TOP}/build/${ARTIFACT_BASE}/* ${DEB_DIR}/${SYSTEM_TARGET}

mkdir -p ${DEB_DIR}/etc/mycroft
# write installed config file
cat > ${DEB_DIR}/etc/mycroft/mycroft.ini << EOM
[tts]
module = "mimic"
mimic.path = "/usr/local/bin/mimic"
mimic.voice = "ap"

[metrics_client]
enabled = True

EOM

#if [ ${ARCH} = "armhf" ]; then
  # ensures enclosure version
ENCLOSURE_DIR=${DEB_DIR}/opt
mkdir -p ${ENCLOSURE_DIR}
cp ${TOP}/mycroft/client/enclosure/version.txt ${ENCLOSURE_DIR}/enclosure-version.txt
#fi

cd $(dirname ${DEB_DIR})
dpkg-deb --build ${DEB_BASE}
mv *.deb ${TOP}/dist

cd ${TOP}/dist
_run s3cmd -c ${HOME}/.s3cfg.mycroft-artifact-writer sync --acl-public . s3://bootstrap.mycroft.ai/artifacts/apt/${ARCH}/${VERSION}/
echo ${VERSION} > latest
_run s3cmd -c ${HOME}/.s3cfg.mycroft-artifact-writer put --acl-public ${TOP}/dist/latest s3://bootstrap.mycroft.ai/artifacts/apt/${ARCH}/latest #cd ${TOP}/dist

#_run s3cmd -c ${HOME}/.s3cfg.mycroft-artifact-writer sync --acl-public . s3://bootstrap.mycroft.ai/artifacts/${ARCH}/${VERSION}/
#echo ${VERSION} > ${TOP}/dist/latest
#_run s3cmd -c ${HOME}/.s3cfg.mycroft-artifact-writer put --acl-public ${TOP}/dist/latest s3://bootstrap.mycroft.ai/artifacts/${ARCH}/latest

#!/usr/bin/env bash

TOP=$(cd $(dirname $0)/.. && pwd -L)

if [ "$1" = "-q" ]; then
  QUIET="echo"
fi

# clean
cd ${TOP}
rm -rf dist

function _run() {
  if [[ "$QUIET" ]]; then
    echo "$*"
  else
    eval "$@"
  fi
}

function python_package() {
  local SETUP_SCRIPT=$1
  cp ${SETUP_SCRIPT} ${TOP}/setup.py
  python ${TOP}/setup.py clean
  python ${TOP}/setup.py bdist_egg
  python ${TOP}/setup.py sdist
  _run python ${TOP}/setup.py sdist upload -r mycroft
  rm ${TOP}/setup.py
}

VERSION="$(basename $(git describe --abbrev=0 --tags) | sed -e 's/v//g')"

echo "version=\"${VERSION}\"" > ${TOP}/mycroft/__version__.py

# build and upload pypi distribution to internal pypi mirror
cd ${TOP}
python_package mycroft-base-setup.py
python_package skills-sdk-setup.py

# build distributable virtualenv
ARCH="$(dpkg --print-architecture)"
SYSTEM_TARGET="/usr/local/"
ARTIFACT_BASE="mycroft-core-${ARCH}-${VERSION}"
MYCROFT_ARTIFACT_DIR=${TOP}/build/${ARTIFACT_BASE}

virtualenv --always-copy --clear ${MYCROFT_ARTIFACT_DIR}
virtualenv --always-copy --clear --relocatable ${MYCROFT_ARTIFACT_DIR}
. ${MYCROFT_ARTIFACT_DIR}/bin/activate

pip install -r ${TOP}/requirements.txt
cd ${TOP}/pocketsphinx-python
python setup.py install
cd ${TOP}
python mycroft-base-setup.py install

${TOP}/install-pygtk.sh

virtualenv --always-copy --relocatable ${MYCROFT_ARTIFACT_DIR}

mkdir -p ${TOP}/dist
cd ${TOP}/build
tar -czf ${TOP}/dist/${ARTIFACT_BASE}.tar.gz ${ARTIFACT_BASE}

# package distributable virtualenv into deb
function replace() {
  local FILE=$1
  local PATTERN=$2
  local VALUE=$3
  local TMP_FILE="/tmp/$$.replace"
  cat ${FILE} | sed -e "s/${PATTERN}/${VALUE}/g" > ${TMP_FILE}
  mv ${TMP_FILE} ${FILE}
}

DEB_BASE="mycroft-core-${ARCH}_${VERSION}-1"
DEB_DIR=${TOP}/build/${DEB_BASE}
mkdir -p ${DEB_DIR}/DEBIAN

echo "Creating debian control file"
# setup control file
CONTROL_FILE=${DEB_DIR}/DEBIAN/control
cp ${TOP}/publish-core/deb_base/control.template ${CONTROL_FILE}
replace ${CONTROL_FILE} "%%PACKAGE%%" "mycroft-core"
replace ${CONTROL_FILE} "%%VERSION%%" "${VERSION}"
replace ${CONTROL_FILE} "%%ARCHITECTURE%%" "${ARCH}"
replace ${CONTROL_FILE} "%%DESCRIPTION%%" "mycroft-core"
replace ${CONTROL_FILE} "%%DEPENDS%%" "portaudio19-dev, libglib2.0-0, flac, espeak, mpg123, mimic"
echo "Creating debian preinst file"
PREINST_FILE=${DEB_DIR}/DEBIAN/preinst
cp ${TOP}/publish-core/deb_base/preinst.template ${PREINST_FILE}
replace ${PREINST_FILE} "%%INSTALL_USER%%" "mycroft"
chmod 0755 ${PREINST_FILE}

echo "Creating debian postinst file"
POSTINST_FILE=${DEB_DIR}/DEBIAN/postinst
cp ${TOP}/publish-core/deb_base/postinst.template ${POSTINST_FILE}
replace ${POSTINST_FILE} "%%INSTALL_USER%%" "mycroft"
chmod 0755 ${POSTINST_FILE}

echo "Creating debian prerm file"
PRERM_FILE=${DEB_DIR}/DEBIAN/prerm
cp ${TOP}/publish-core/deb_base/prerm.template ${PRERM_FILE}
replace ${PRERM_FILE} "%%INSTALL_USER%%" "mycroft"
chmod 0755 ${PRERM_FILE}

echo "Creating debian postrm file"
POSTRM_FILE=${DEB_DIR}/DEBIAN/postrm
cp ${TOP}/publish-core/deb_base/postrm.template ${POSTRM_FILE}
replace ${POSTRM_FILE} "%%INSTALL_USER%%" "mycroft"
chmod 0755 ${POSTRM_FILE}

# setup init scripts
function setup_init_script() {
  local NAME=$1
  echo "Creating init script for ${NAME}"
  INIT_SCRIPT=${DEB_DIR}/etc/init.d/${NAME}
  mkdir -p $(dirname ${INIT_SCRIPT})
  cp ${TOP}/publish-core/deb_base/init.template ${INIT_SCRIPT}
  replace ${INIT_SCRIPT} "%%NAME%%" "${NAME}"
  replace ${INIT_SCRIPT} "%%DESCRIPTION%%" "${NAME}"
  replace ${INIT_SCRIPT} "%%COMMAND%%" "\/usr\/local\/bin\/${NAME}"
  replace ${INIT_SCRIPT} "%%USERNAME%%" "mycroft"
  chmod a+x ${INIT_SCRIPT}
}

setup_init_script "mycroft-messagebus"
setup_init_script "mycroft-skills"
setup_init_script "mycroft-speech-client"

if [ ${ARCH} = "armhf" ]; then
  setup_init_script "mycroft-enclosure-client"
fi

mkdir -p ${DEB_DIR}/${SYSTEM_TARGET}
cp -rf ${TOP}/build/${ARTIFACT_BASE}/* ${DEB_DIR}/${SYSTEM_TARGET}

mkdir -p ${DEB_DIR}/etc/mycroft
# write installed config file
cat > ${DEB_DIR}/etc/mycroft/mycroft.ini << EOM
[tts]
module = "mimic"
mimic.path = "/usr/local/bin/mimic"
mimic.voice = "ap"

[metrics_client]
enabled = True

EOM

#if [ ${ARCH} = "armhf" ]; then
  # ensures enclosure version
ENCLOSURE_DIR=${DEB_DIR}/opt
mkdir -p ${ENCLOSURE_DIR}
cp ${TOP}/mycroft/client/enclosure/version.txt ${ENCLOSURE_DIR}/enclosure-version.txt
#fi

cd $(dirname ${DEB_DIR})
dpkg-deb --build ${DEB_BASE}
mv *.deb ${TOP}/dist

cd ${TOP}/dist
_run s3cmd -c ${HOME}/.s3cfg.mycroft-artifact-writer sync --acl-public . s3://bootstrap.mycroft.ai/artifacts/apt/${ARCH}/${VERSION}/
echo ${VERSION} > latest
_run s3cmd -c ${HOME}/.s3cfg.mycroft-artifact-writer put --acl-public ${TOP}/dist/latest s3://bootstrap.mycroft.ai/artifacts/apt/${ARCH}/latest #cd ${TOP}/dist

#_run s3cmd -c ${HOME}/.s3cfg.mycroft-artifact-writer sync --acl-public . s3://bootstrap.mycroft.ai/artifacts/${ARCH}/${VERSION}/
#echo ${VERSION} > ${TOP}/dist/latest
#_run s3cmd -c ${HOME}/.s3cfg.mycroft-artifact-writer put --acl-public ${TOP}/dist/latest s3://bootstrap.mycroft.ai/artifacts/${ARCH}/latest


Silence commands

Silence commands

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/nhoag/vcl-dev.git/'


add ghq.root settings

add ghq.root settings

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


fix bsroot won't download version.txt

fix bsroot won't download version.txt

#!/bin/bash

# bsroot.sh creates the $PWD/bsroot directory, which is supposed to be
# scp-ed to the bootstrapper server as /bsroot.

if [[ "$#" -ne 1 ]]; then
    echo "Usage: bsroot.sh <cluster-desc.yml>"
    exit 1
fi

# Remember fullpaths, so that it is not required to run bsroot.sh from its local Git repo.
realpath() {
    [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
}
CLOUD_CONFIG_TEMPLATE=$(realpath $(dirname $0)/cloud-config-server/template/cloud-config.template)
CLUSTER_DESC=$(realpath $1)

BS_IP=`grep "bootstrapper:" $CLUSTER_DESC | awk '{print $2}' | sed 's/ //g'`
if [[ "$?" -ne 0 ||  "$BS_IP" == "" ]]; then
    echo "Failed parsing cluster-desc file $CLUSTER_DESC for bootstrapper IP".
    exit 1
fi
echo "Using bootstrapper server IP $BS_IP"

BSROOT=$PWD/bsroot
if [[ -d $BSROOT ]]; then
    echo "$BSROOT already exists.  Overwrite without removing it."
fi

check_prerequisites() {
    printf "Checking prerequisites ... "
    err=0
    for tool in wget tar gpg docker; do
        command -v $tool >/dev/null 2>&1 || { echo "Install $tool before run this script"; err=1; }
    done
    if [[ $err -ne 0 ]]; then
        exit 1
    fi
    echo "Done"
}

download_pxe_images() {
    mkdir -p $BSROOT/tftpboot

    printf "Downloading syslinux ... "
    wget --quiet -c -P $BSROOT/tftpboot https://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.03.tar.gz || { echo "Failed"; exit 1; }
    cd $BSROOT/tftpboot
    tar xzf syslinux-6.03.tar.gz || { echo "Failed"; exit 1; }
    cp syslinux-6.03/bios/core/pxelinux.0 $BSROOT/tftpboot || { echo "Failed"; exit 1; }
    cp syslinux-6.03/bios/com32/menu/vesamenu.c32 $BSROOT/tftpboot || { echo "Failed"; exit 1; }
    cp syslinux-6.03/bios/com32/elflink/ldlinux/ldlinux.c32 $BSROOT/tftpboot || { echo "Failed"; exit 1; }
    rm -rf syslinux-6.03 || { echo "Failed"; exit 1; } # Clean the untarred.
    echo "Done"

    printf "Importing CoreOS signing key ... "
    wget --quiet -c -P $BSROOT/tftpboot https://coreos.com/security/image-signing-key/CoreOS_Image_Signing_Key.asc || { echo "Failed"; exit 1; }
    gpg --import --keyid-format LONG $BSROOT/tftpboot/CoreOS_Image_Signing_Key.asc > /dev/null 2>&1 || { echo "Failed"; exit 1; }
    echo "Done"

    printf "Downloading CoreOS PXE vmlinuz image ... "
    wget --quiet -c -P $BSROOT/tftpboot https://stable.release.core-os.net/amd64-usr/current/coreos_production_pxe.vmlinuz || { echo "Failed"; exit 1; }
    wget --quiet -c -P $BSROOT/tftpboot https://stable.release.core-os.net/amd64-usr/current/coreos_production_pxe.vmlinuz.sig || { echo "Failed"; exit 1; }
    cd $BSROOT/tftpboot
    gpg --verify coreos_production_pxe.vmlinuz.sig > /dev/null 2>&1 || { echo "Failed"; exit 1; }
    echo "Done"

    printf "Downloading CoreOS PXE CPIO image ... "
    wget --quiet -c -P $BSROOT/tftpboot https://stable.release.core-os.net/amd64-usr/current/coreos_production_pxe_image.cpio.gz || { echo "Failed"; exit 1; }
    wget --quiet -c -P $BSROOT/tftpboot https://stable.release.core-os.net/amd64-usr/current/coreos_production_pxe_image.cpio.gz.sig || { echo "Failed"; exit 1; }
    gpg --verify coreos_production_pxe_image.cpio.gz.sig > /dev/null 2>&1 || { echo "Failed"; exit 1; }
    echo "Done"
}

generate_pxe_config() {
    printf "Generating pxelinux.cfg ... "
    mkdir -p $BSROOT/tftpboot/pxelinux.cfg
    cat > $BSROOT/tftpboot/pxelinux.cfg/default <<EOF
default coreos

label coreos
  kernel coreos_production_pxe.vmlinuz
  append initrd=coreos_production_pxe_image.cpio.gz cloud-config-url=http://$BS_IP/static/cloud-config/install.sh coreos.autologin
EOF
    echo "Done"
}

generate_dnsmasq_config() {
    printf "Generating dnsmasq.conf ... "
    mkdir -p $BSROOT/config
    # TODO(yi): Ad-hoc domain name k8s.baifendian.com here.  Try parsing it from cluster-desc.yml.
    # TODO(yi): Ad-hoc DHCP IP range. Try parsing it from cluster-desc.yml.
    cat > $BSROOT/config/dnsmasq.conf <<EOF
  interface=eth0
  bind-interfaces
  domain=k8s.baifendian.com
  user=root
  dhcp-range=192.168.8.102,192.168.8.200,255.255.255.0,12h
  log-dhcp

  dhcp-boot=pxelinux.0

  dhcp-option=3,192.168.8.101

  dhcp-option=6,192.168.8.101,8.8.8.8
  no-hosts
  expand-hosts
  no-resolv

  local=/k8s.baifendian.com/
  domain-needed

  dhcp-option=28,192.168.8.255

  #dhcp-option=42,0.0.0.0
  pxe-prompt="Press F8 for menu.", 60
  pxe-service=x86PC, "Install CoreOS from network server", pxelinux
  enable-tftp
  tftp-root=/bsroot/tftpboot
EOF
    echo "Done"
}

generate_registry_config() {
    printf "Generating Docker registry config file ... "
    mkdir -p $BSROOT/registry_data
    cat > $BSROOT/config/registry.yml <<EOF
version: 0.1
log:
  fields:
    service: registry
storage:
  cache:
    blobdescriptor: inmemory
  filesystem:
    rootdirectory: /bsroot/registry_data
http:
  addr: :5000
  headers:
    X-Content-Type-Options: [nosniff]
  tls:
    certificate: /bsroot/tls/bootstrapper.crt
    key: /bsroot/tls/bootstrapper.key
health:
  storagedriver:
    enabled: true
    interval: 10s
    threshold: 3
EOF
    echo "Done"
}

prepare_cc_server_contents() {
    mkdir -p $BSROOT/html/static/cloud-config

    # Fetch release binary tarball from github accroding to the versions
    # defined in "cluster-desc.yml"
    hyperkube_version=`grep "hyperkube_version:" $CLUSTER_DESC | awk '{print $2}' | sed 's/ //g' | sed -e 's/^"//' -e 's/"$//'`
    printf "Downloading and extracting kubernetes release ${hyperkube_version} ... "
    wget --quiet -c -O $BSROOT/kubernetes.tar.gz https://github.com/kubernetes/kubernetes/releases/download/$hyperkube_version/kubernetes.tar.gz
    cd $BSROOT/
    tar xzf kubernetes.tar.gz || { echo "Failed"; exit 1; }
    cd $BSROOT/kubernetes/server
    tar xzf kubernetes-server-linux-amd64.tar.gz || { echo "Failed"; exit 1; }
    cp $BSROOT/kubernetes/server/kubernetes/server/bin/kubelet $BSROOT/html/static
    cp $BSROOT/kubernetes/server/kubernetes/server/bin/kubectl $BSROOT
    rm -rf $BSROOT/kubernetes
    chmod +x $BSROOT/html/static/kubelet
    echo "Done"

    # setup-network-environment will fetch the default system IP infomation
    # when using cloud-config file to initiate a kubernetes cluster node
    printf "Downloading setup-network-environment file ... "
    wget --quiet -c -O $BSROOT/html/static/setup-network-environment-1.0.1 https://github.com/kelseyhightower/setup-network-environment/releases/download/1.0.1/setup-network-environment || { echo "Failed"; exit 1; }
    echo "Done"

    printf "Copying cloud-config template and cluster-desc.yml ... "
    cp $CLOUD_CONFIG_TEMPLATE $BSROOT/config/ || { echo "Failed"; exit 1; }
    cp $CLUSTER_DESC $BSROOT/config/cluster-desc.yml || { echo "Failed"; exit 1; }
    echo "Done"

    printf "Generating install.sh ... "
    cat > $BSROOT/html/static/cloud-config/install.sh <<EOF
#!/bin/bash
# FIXME: default to install coreos on /dev/sda
default_iface=\$(awk '\$2 == 00000000 { print \$1  }' /proc/net/route | uniq)

printf "Default interface: \${default_iface}\n"
default_iface=\`echo \${default_iface} | awk '{ print \$1 }'\`

mac_addr=\`ip addr show dev \${default_iface} | awk '\$1 ~ /^link\// { print \$2 }'\`
printf "Interface: \${default_iface} MAC address: \${mac_addr}\n"

wget -O \${mac_addr}.yml http://$BS_IP/cloud-config/\${mac_addr}
sudo coreos-install -d /dev/sda -c \${mac_addr}.yml -b http://$BS_IP/static -V current && sudo reboot
EOF
    echo "Done"

    printf "Checking new CoreOS version and update version.txt ... "
    # NOTE: make "current" to store version.txt
    mkdir -p $BSROOT/html/static/current
    cd $BSROOT/html/static/current
    wget --quiet -P $BSROOT/html/static/current https://stable.release.core-os.net/amd64-usr/current/version.txt
    VERSION=$(curl -s https://stable.release.core-os.net/amd64-usr/current/version.txt | grep 'COREOS_VERSION=' | cut -f 2 -d '=')
    if [[ $VERSION == "" ]]; then
      echo "Failed"; exit 1;
    fi
      echo "Done"

    printf "Updating CoreOS images ... "
    if [[ ! -d $BSROOT/html/static/$VERSION ]]; then
        mkdir -p $BSROOT/html/static/$VERSION
    fi

    wget --quiet -c -P $BSROOT/html/static/$VERSION https://stable.release.core-os.net/amd64-usr/current/coreos_production_image.bin.bz2 || { echo "Failed"; exit 1; }
    wget --quiet -c -P $BSROOT/html/static/$VERSION https://stable.release.core-os.net/amd64-usr/current/coreos_production_image.bin.bz2.sig || { echo "Failed"; exit 1; }
    cd $BSROOT/html/static/$VERSION
    gpg --verify coreos_production_image.bin.bz2.sig > /dev/null 2>&1 || { echo "Failed"; exit 1; }

    echo "Done"
}

download_k8s_images () {
    printf "Downloading hyperkube image ... "
    hyperkube_version=`grep "hyperkube_version:" $CLUSTER_DESC | awk '{print $2}' | sed 's/ //g' | sed -e 's/^"//' -e 's/"$//'`
    docker pull typhoon1986/hyperkube-amd64:$hyperkube_version > /dev/null 2>&1 || { echo "Failed"; exit 1; }
    docker save typhoon1986/hyperkube-amd64:$hyperkube_version > $BSROOT/hyperkube-amd64.tar || { echo "Failed"; exit 1; }
    echo "Done"

    printf "Downloading pause image ... "
    pause_version=`grep "pause_version:" $CLUSTER_DESC | awk '{print $2}' | sed 's/ //g' | sed -e 's/^"//' -e 's/"$//'`
    docker pull typhoon1986/pause-amd64:$pause_version > /dev/null 2>&1 || { echo "Failed"; exit 1; }
    docker save typhoon1986/pause-amd64:$pause_version > $BSROOT/pause.tar || { echo "Failed"; exit 1; }
    echo "Done"

    printf "Downloading flannel image ... "
    flannel_version=`grep "flannel_version:" $CLUSTER_DESC | awk '{print $2}' | sed 's/ //g' | sed -e 's/^"//' -e 's/"$//'`
    docker pull typhoon1986/flannel:$flannel_version > /dev/null 2>&1 || { echo "Failed"; exit 1; }
    docker save typhoon1986/flannel:$flannel_version > $BSROOT/flannel.tar || { echo "Failed"; exit 1; }
    echo "Done"

    # NOTE: we need to run docker load on the bootstrapper server
    # to load these saved images.
}

generate_tls_assets() {
    mkdir -p $BSROOT/tls
    cd $BSROOT/tls
    rm -rf $BSROOT/tls/*

    printf "Generating CA TLS assets ... "
    openssl genrsa -out ca-key.pem 2048 > /dev/null 2>&1 || { echo "Failed"; exit 1; }
    openssl req -x509 -new -nodes -key ca-key.pem -days 10000 -out ca.pem -subj "/CN=kube-ca"  > /dev/null 2>&1 || { echo "Failed"; exit 1; }
    echo "Done"

    printf "Generating bootstrapper TLS assets ... "
    openssl genrsa -out bootstrapper.key 2048 > /dev/null 2>&1 || { echo "Failed"; exit 1; }
    openssl req -new -key bootstrapper.key -out bootstrapper.csr -subj "/CN=bootstrapper" > /dev/null 2>&1 || { echo "Failed"; exit 1; }
    openssl x509 -req -in bootstrapper.csr -CA ca.pem -CAkey ca-key.pem -CAcreateserial -out bootstrapper.crt -days 365 > /dev/null 2>&1 || { echo "Failed"; exit 1; }
    echo "Done"

    # Note: we need to run the following commands on the bootstrapper server to import ca.crt.
    #
    #  mkdir -p /etc/docker/certs.d/$BS_IP:5000
    #  rm -rf /etc/docker/certs.d/$BS_IP:5000/*
    #  cp ca.pem /etc/docker/certs.d/$BS_IP:5000/ca.crt
}

check_prerequisites
download_pxe_images
generate_pxe_config
generate_dnsmasq_config
generate_registry_config
prepare_cc_server_contents
download_k8s_images
generate_tls_assets

#!/bin/bash

# bsroot.sh creates the $PWD/bsroot directory, which is supposed to be
# scp-ed to the bootstrapper server as /bsroot.

if [[ "$#" -ne 1 ]]; then
    echo "Usage: bsroot.sh <cluster-desc.yml>"
    exit 1
fi

# Remember fullpaths, so that it is not required to run bsroot.sh from its local Git repo.
realpath() {
    [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
}
CLOUD_CONFIG_TEMPLATE=$(realpath $(dirname $0)/cloud-config-server/template/cloud-config.template)
CLUSTER_DESC=$(realpath $1)

BS_IP=`grep "bootstrapper:" $CLUSTER_DESC | awk '{print $2}' | sed 's/ //g'`
if [[ "$?" -ne 0 ||  "$BS_IP" == "" ]]; then
    echo "Failed parsing cluster-desc file $CLUSTER_DESC for bootstrapper IP".
    exit 1
fi
echo "Using bootstrapper server IP $BS_IP"

BSROOT=$PWD/bsroot
if [[ -d $BSROOT ]]; then
    echo "$BSROOT already exists.  Overwrite without removing it."
fi

check_prerequisites() {
    printf "Checking prerequisites ... "
    err=0
    for tool in wget tar gpg docker; do
        command -v $tool >/dev/null 2>&1 || { echo "Install $tool before run this script"; err=1; }
    done
    if [[ $err -ne 0 ]]; then
        exit 1
    fi
    echo "Done"
}

download_pxe_images() {
    mkdir -p $BSROOT/tftpboot

    printf "Downloading syslinux ... "
    wget --quiet -c -P $BSROOT/tftpboot https://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.03.tar.gz || { echo "Failed"; exit 1; }
    cd $BSROOT/tftpboot
    tar xzf syslinux-6.03.tar.gz || { echo "Failed"; exit 1; }
    cp syslinux-6.03/bios/core/pxelinux.0 $BSROOT/tftpboot || { echo "Failed"; exit 1; }
    cp syslinux-6.03/bios/com32/menu/vesamenu.c32 $BSROOT/tftpboot || { echo "Failed"; exit 1; }
    cp syslinux-6.03/bios/com32/elflink/ldlinux/ldlinux.c32 $BSROOT/tftpboot || { echo "Failed"; exit 1; }
    rm -rf syslinux-6.03 || { echo "Failed"; exit 1; } # Clean the untarred.
    echo "Done"

    printf "Importing CoreOS signing key ... "
    wget --quiet -c -P $BSROOT/tftpboot https://coreos.com/security/image-signing-key/CoreOS_Image_Signing_Key.asc || { echo "Failed"; exit 1; }
    gpg --import --keyid-format LONG $BSROOT/tftpboot/CoreOS_Image_Signing_Key.asc > /dev/null 2>&1 || { echo "Failed"; exit 1; }
    echo "Done"

    printf "Downloading CoreOS PXE vmlinuz image ... "
    wget --quiet -c -P $BSROOT/tftpboot https://stable.release.core-os.net/amd64-usr/current/coreos_production_pxe.vmlinuz || { echo "Failed"; exit 1; }
    wget --quiet -c -P $BSROOT/tftpboot https://stable.release.core-os.net/amd64-usr/current/coreos_production_pxe.vmlinuz.sig || { echo "Failed"; exit 1; }
    cd $BSROOT/tftpboot
    gpg --verify coreos_production_pxe.vmlinuz.sig > /dev/null 2>&1 || { echo "Failed"; exit 1; }
    echo "Done"

    printf "Downloading CoreOS PXE CPIO image ... "
    wget --quiet -c -P $BSROOT/tftpboot https://stable.release.core-os.net/amd64-usr/current/coreos_production_pxe_image.cpio.gz || { echo "Failed"; exit 1; }
    wget --quiet -c -P $BSROOT/tftpboot https://stable.release.core-os.net/amd64-usr/current/coreos_production_pxe_image.cpio.gz.sig || { echo "Failed"; exit 1; }
    gpg --verify coreos_production_pxe_image.cpio.gz.sig > /dev/null 2>&1 || { echo "Failed"; exit 1; }
    echo "Done"
}

generate_pxe_config() {
    printf "Generating pxelinux.cfg ... "
    mkdir -p $BSROOT/tftpboot/pxelinux.cfg
    cat > $BSROOT/tftpboot/pxelinux.cfg/default <<EOF
default coreos

label coreos
  kernel coreos_production_pxe.vmlinuz
  append initrd=coreos_production_pxe_image.cpio.gz cloud-config-url=http://$BS_IP/static/cloud-config/install.sh coreos.autologin
EOF
    echo "Done"
}

generate_dnsmasq_config() {
    printf "Generating dnsmasq.conf ... "
    mkdir -p $BSROOT/config
    # TODO(yi): Ad-hoc domain name k8s.baifendian.com here.  Try parsing it from cluster-desc.yml.
    # TODO(yi): Ad-hoc DHCP IP range. Try parsing it from cluster-desc.yml.
    cat > $BSROOT/config/dnsmasq.conf <<EOF
  interface=eth0
  bind-interfaces
  domain=k8s.baifendian.com
  user=root
  dhcp-range=192.168.8.102,192.168.8.200,255.255.255.0,12h
  log-dhcp

  dhcp-boot=pxelinux.0

  dhcp-option=3,192.168.8.101

  dhcp-option=6,192.168.8.101,8.8.8.8
  no-hosts
  expand-hosts
  no-resolv

  local=/k8s.baifendian.com/
  domain-needed

  dhcp-option=28,192.168.8.255

  #dhcp-option=42,0.0.0.0
  pxe-prompt="Press F8 for menu.", 60
  pxe-service=x86PC, "Install CoreOS from network server", pxelinux
  enable-tftp
  tftp-root=/bsroot/tftpboot
EOF
    echo "Done"
}

generate_registry_config() {
    printf "Generating Docker registry config file ... "
    mkdir -p $BSROOT/registry_data
    cat > $BSROOT/config/registry.yml <<EOF
version: 0.1
log:
  fields:
    service: registry
storage:
  cache:
    blobdescriptor: inmemory
  filesystem:
    rootdirectory: /bsroot/registry_data
http:
  addr: :5000
  headers:
    X-Content-Type-Options: [nosniff]
  tls:
    certificate: /bsroot/tls/bootstrapper.crt
    key: /bsroot/tls/bootstrapper.key
health:
  storagedriver:
    enabled: true
    interval: 10s
    threshold: 3
EOF
    echo "Done"
}

prepare_cc_server_contents() {
    mkdir -p $BSROOT/html/static/cloud-config

    # Fetch release binary tarball from github accroding to the versions
    # defined in "cluster-desc.yml"
    hyperkube_version=`grep "hyperkube_version:" $CLUSTER_DESC | awk '{print $2}' | sed 's/ //g' | sed -e 's/^"//' -e 's/"$//'`
    printf "Downloading and extracting kubernetes release ${hyperkube_version} ... "
    wget --quiet -c -O $BSROOT/kubernetes.tar.gz https://github.com/kubernetes/kubernetes/releases/download/$hyperkube_version/kubernetes.tar.gz
    cd $BSROOT/
    tar xzf kubernetes.tar.gz || { echo "Failed"; exit 1; }
    cd $BSROOT/kubernetes/server
    tar xzf kubernetes-server-linux-amd64.tar.gz || { echo "Failed"; exit 1; }
    cp $BSROOT/kubernetes/server/kubernetes/server/bin/kubelet $BSROOT/html/static
    cp $BSROOT/kubernetes/server/kubernetes/server/bin/kubectl $BSROOT
    rm -rf $BSROOT/kubernetes
    chmod +x $BSROOT/html/static/kubelet
    echo "Done"

    # setup-network-environment will fetch the default system IP infomation
    # when using cloud-config file to initiate a kubernetes cluster node
    printf "Downloading setup-network-environment file ... "
    wget --quiet -c -O $BSROOT/html/static/setup-network-environment-1.0.1 https://github.com/kelseyhightower/setup-network-environment/releases/download/1.0.1/setup-network-environment || { echo "Failed"; exit 1; }
    echo "Done"

    printf "Copying cloud-config template and cluster-desc.yml ... "
    cp $CLOUD_CONFIG_TEMPLATE $BSROOT/config/ || { echo "Failed"; exit 1; }
    cp $CLUSTER_DESC $BSROOT/config/cluster-desc.yml || { echo "Failed"; exit 1; }
    echo "Done"

    printf "Generating install.sh ... "
    cat > $BSROOT/html/static/cloud-config/install.sh <<EOF
#!/bin/bash
# FIXME: default to install coreos on /dev/sda
default_iface=\$(awk '\$2 == 00000000 { print \$1  }' /proc/net/route | uniq)

printf "Default interface: \${default_iface}\n"
default_iface=\`echo \${default_iface} | awk '{ print \$1 }'\`

mac_addr=\`ip addr show dev \${default_iface} | awk '\$1 ~ /^link\// { print \$2 }'\`
printf "Interface: \${default_iface} MAC address: \${mac_addr}\n"

wget -O \${mac_addr}.yml http://$BS_IP/cloud-config/\${mac_addr}
sudo coreos-install -d /dev/sda -c \${mac_addr}.yml -b http://$BS_IP/static -V current && sudo reboot
EOF
    echo "Done"

    printf "Checking new CoreOS version ... "
    VERSION=$(curl -s https://stable.release.core-os.net/amd64-usr/current/version.txt | grep 'COREOS_VERSION=' | cut -f 2 -d '=')
    if [[ $VERSION == "" ]]; then
      echo "Failed"; exit 1;
    fi
      echo "Done"

    printf "Updating CoreOS images ... "
    if [[ ! -d $BSROOT/html/static/$VERSION ]]; then
        mkdir -p $BSROOT/html/static/$VERSION
    fi

    wget --quiet -c -P $BSROOT/html/static/$VERSION https://stable.release.core-os.net/amd64-usr/current/coreos_production_image.bin.bz2 || { echo "Failed"; exit 1; }
    wget --quiet -c -P $BSROOT/html/static/$VERSION https://stable.release.core-os.net/amd64-usr/current/coreos_production_image.bin.bz2.sig || { echo "Failed"; exit 1; }
    cd $BSROOT/html/static/$VERSION
    gpg --verify coreos_production_image.bin.bz2.sig > /dev/null 2>&1 || { echo "Failed"; exit 1; }

    ln -sf $BSROOT/html/static/$VERSION $BSROOT/html/static/current || { echo "Failed"; exit 1; }
    echo "Done"
}

download_k8s_images () {
    printf "Downloading hyperkube image ... "
    hyperkube_version=`grep "hyperkube_version:" $CLUSTER_DESC | awk '{print $2}' | sed 's/ //g' | sed -e 's/^"//' -e 's/"$//'`
    docker pull typhoon1986/hyperkube-amd64:$hyperkube_version > /dev/null 2>&1 || { echo "Failed"; exit 1; }
    docker save typhoon1986/hyperkube-amd64:$hyperkube_version > $BSROOT/hyperkube-amd64.tar || { echo "Failed"; exit 1; }
    echo "Done"

    printf "Downloading pause image ... "
    pause_version=`grep "pause_version:" $CLUSTER_DESC | awk '{print $2}' | sed 's/ //g' | sed -e 's/^"//' -e 's/"$//'`
    docker pull typhoon1986/pause-amd64:$pause_version > /dev/null 2>&1 || { echo "Failed"; exit 1; }
    docker save typhoon1986/pause-amd64:$pause_version > $BSROOT/pause.tar || { echo "Failed"; exit 1; }
    echo "Done"

    printf "Downloading flannel image ... "
    flannel_version=`grep "flannel_version:" $CLUSTER_DESC | awk '{print $2}' | sed 's/ //g' | sed -e 's/^"//' -e 's/"$//'`
    docker pull typhoon1986/flannel:$flannel_version > /dev/null 2>&1 || { echo "Failed"; exit 1; }
    docker save typhoon1986/flannel:$flannel_version > $BSROOT/flannel.tar || { echo "Failed"; exit 1; }
    echo "Done"

    # NOTE: we need to run docker load on the bootstrapper server
    # to load these saved images.
}

generate_tls_assets() {
    mkdir -p $BSROOT/tls
    cd $BSROOT/tls
    rm -rf $BSROOT/tls/*

    printf "Generating CA TLS assets ... "
    openssl genrsa -out ca-key.pem 2048 > /dev/null 2>&1 || { echo "Failed"; exit 1; }
    openssl req -x509 -new -nodes -key ca-key.pem -days 10000 -out ca.pem -subj "/CN=kube-ca"  > /dev/null 2>&1 || { echo "Failed"; exit 1; }
    echo "Done"

    printf "Generating bootstrapper TLS assets ... "
    openssl genrsa -out bootstrapper.key 2048 > /dev/null 2>&1 || { echo "Failed"; exit 1; }
    openssl req -new -key bootstrapper.key -out bootstrapper.csr -subj "/CN=bootstrapper" > /dev/null 2>&1 || { echo "Failed"; exit 1; }
    openssl x509 -req -in bootstrapper.csr -CA ca.pem -CAkey ca-key.pem -CAcreateserial -out bootstrapper.crt -days 365 > /dev/null 2>&1 || { echo "Failed"; exit 1; }
    echo "Done"

    # Note: we need to run the following commands on the bootstrapper server to import ca.crt.
    #
    #  mkdir -p /etc/docker/certs.d/$BS_IP:5000
    #  rm -rf /etc/docker/certs.d/$BS_IP:5000/*
    #  cp ca.pem /etc/docker/certs.d/$BS_IP:5000/ca.crt
}

check_prerequisites
download_pxe_images
generate_pxe_config
generate_dnsmasq_config
generate_registry_config
prepare_cc_server_contents
download_k8s_images
generate_tls_assets


Update build script to match changes in libprotobuf-mutator repo. (#399)

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

cp -f $SRC/*.dict $SRC/*.options $OUT/

mkdir -p build
pushd build
rm -rf *
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release \
    -DLIB_PROTO_MUTATOR_WITH_ASAN=OFF \
    -DLIB_PROTO_MUTATOR_FUZZER_LIBRARIES=FuzzingEngine
ninja libxml2_example expat_example
cp -f examples/libxml2/libxml2_example $OUT/
cp -f examples/libxml2/libxml2_example $OUT/libxml2_small
cp -f examples/libxml2/libxml2_example $OUT/libxml2_dict
cp -f examples/expat/expat_example $OUT/
cp -f examples/expat/expat_example $OUT/expat_dict
popd

# Experimental fuzzer to compare coverage with default one.
CXXFLAGS="$CXXFLAGS -DLIB_PROTO_MUTATOR_XML2_NO_FLATTENING=1"
mkdir -p build_exp
pushd build_exp
rm -rf *
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release \
    -DLIB_PROTO_MUTATOR_WITH_ASAN=OFF \
    -DLIB_PROTO_MUTATOR_FUZZER_LIBRARIES=FuzzingEngine
ninja libxml2_example
cp -f examples/libxml2/libxml2_example $OUT/libxml2_experiment
popd

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

cp -f $SRC/*.dict $SRC/*.options $OUT/

mkdir -p build
pushd build
rm -rf *
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release \
    -DLIB_PROTO_MUTATOR_WITH_ASAN=OFF \
    -DLIB_PROTO_MUTATOR_FUZZER_LIBRARIES=FuzzingEngine
ninja libxml2_example expat_example
cp -f libxml2_example $OUT/
cp -f libxml2_example $OUT/libxml2_small
cp -f libxml2_example $OUT/libxml2_dict
cp -f expat_example $OUT/
cp -f expat_example $OUT/expat_dict
popd

# Experimental fuzzer to compare coverage with default one.
CXXFLAGS="$CXXFLAGS -DLIB_PROTO_MUTATOR_XML2_NO_FLATTENING=1"
mkdir -p build_exp
pushd build_exp
rm -rf *
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release \
    -DLIB_PROTO_MUTATOR_WITH_ASAN=OFF \
    -DLIB_PROTO_MUTATOR_FUZZER_LIBRARIES=FuzzingEngine
ninja libxml2_example
cp -f libxml2_example $OUT/libxml2_experiment
popd


delay between 1* scripts and uploading

delay between 1* scripts and uploading

To allow for change-over from legacy-code to demonised scripts.
Legacy-code will oversee uploading for a short while and needs to wait
for the daemons to complete.

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


add --with-computed-gotos for Python 3 - it should helps to improve performance

#!/bin/bash

RETCODE=$(fw_exists ${IROOT}/py3.installed)
[ ! "$RETCODE" == 0 ] || { return 0; }

fw_get http://www.python.org/ftp/python/3.4.2/Python-3.4.2.tar.xz
fw_untar Python-3.4.2.tar.xz
cd Python-3.4.2
./configure --prefix=${IROOT}/py3 --disable-shared --with-computed-gotos --quiet
make -j4 --quiet
make install --quiet

ln -s ${IROOT}/py3/bin/python3.4m ${IROOT}/py3/bin/python3.4
${IROOT}/py3/bin/python3 -m ensurepip -U
${IROOT}/py3/bin/pip3 install -U setuptools pip

touch ${IROOT}/py3.installed

#!/bin/bash

RETCODE=$(fw_exists ${IROOT}/py3.installed)
[ ! "$RETCODE" == 0 ] || { return 0; }

fw_get http://www.python.org/ftp/python/3.4.2/Python-3.4.2.tar.xz
fw_untar Python-3.4.2.tar.xz
cd Python-3.4.2
./configure --prefix=${IROOT}/py3 --disable-shared --quiet
make -j4 --quiet
make install --quiet

ln -s ${IROOT}/py3/bin/python3.4m ${IROOT}/py3/bin/python3.4
${IROOT}/py3/bin/python3 -m ensurepip -U
${IROOT}/py3/bin/pip3 install -U setuptools pip

touch ${IROOT}/py3.installed


Fix missing mkdir call

Fix missing mkdir call

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


Create genbuild.sh

Create genbuild.sh

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


replace ack with ripgrep

replace ack with ripgrep

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


use vim-gtk that has enabled clipboard access


Experimental server bash script

Experimental server bash script

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


Add cron script to merge indexes

Add cron script to merge indexes

Refs #943.

#!/bin/bash
set -e

/var/www-prod/cake/console/cake -app /var/www-prod/app sphinx_indexes merge >/dev/null 2>&1

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


Add script for quick build.

Add script for quick build.

#!/bin/bash

BUILD_NUMBER=$1
VERSION_STRING=$2

rm -rf DerivedData
xcodebuild clean build -project ACShell.xcodeproj -scheme ACShell -configuration release -derivedDataPath ./DerivedData APPLICATION_BUILD_NUMBER=$BUILD_NUMBER
cd package_dmg && ./package.sh "ACShell-Release-$VERSION_STRING" "../DerivedData/Build/Products/Release/ACShell.app"

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


fixed check logic to not test of running coordinators, but remove SUSPENDED coordinators

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/alexanderfahlke/oozie-tool.git/'


#5 Added example configuration file

#5 Added example configuration file

#!/bin/bash

# send email if failures occur. Set to 1 for yes, 0 for no
SENDMAIL=1

# email address that notification should be sent to
EMAILTO="test@example.com"

# path to mailx or other email program
MAILXBIN=/usr/bin/mailx

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


Script to shutdown cdh image

Script to shutdown cdh image

Change-Id: Ic44a421911e597a172068b25a1853bf247f5a1e1

#!/usr/bin/env bash

CDH_DOCKER_ID=`cat cdh.docker.id`

docker kill $CDH_DOCKER_ID

error: pathspec 'src/test/scripts/stop-cdh-docker.sh' did not match any file(s) known to git


secret conf

secret conf

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/VirusTotal/content.git/'


macos: Keep System Preferences from Interfering

Keep System Preferences from Interfering with macos/set-defaults.sh

See https://github.com/mathiasbynens/dotfiles/pull/706

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


new manual builder

new manual builder

Former-commit-id: a3740c8af2817dcd6abb6f36ff437df6b133c7b4

#!/bin/bash
pdflatex -shell-escape -interaction=nonstopmode oq-manual.tex
bibtex oq-manual
pdflatex -shell-escape -interaction=nonstopmode oq-manual.tex
makeindex oq-manual.idx
makeglossaries oq-manual
pdflatex -shell-escape -interaction=nonstopmode oq-manual.tex

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


Create chruby module

Create chruby module

if [ -f /usr/share/chruby/chruby.sh ] && [[ "$dotfiles_shell" =~ (zsh|bash) ]]; then
  source /usr/share/chruby/chruby.sh
  source /usr/share/chruby/auto.sh
fi

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


macos: Make Safari config more robust/secure


更改Logo图片及link信息;

更改Logo图片及link信息;

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/gnoRnehC/Blog.git/'


add NewRelic deploy notification

add NewRelic deploy notification

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/hipages/travis-tools.git/'


Add a script for pulling down just the source

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

if [ "$1" = "-A" ]; then
  shift
fi
pkg="$1"

# Setup the temporary storage area
TMPDIR=""
cleanup() {
  CODE="$?"
  echo "Cleaning up..." >&2
  if [ -n "$TMPDIR" ]; then
    rm -rf "$TMPDIR"
  fi
  exit "$?"
}
trap cleanup EXIT ERR INT QUIT PIPE TERM
TMPDIR="$(mktemp -d)"

# Find the top level of nixpkgs
cd "$(readlink -f "$0" | xargs dirname)"
while ! [ -d "pkgs/top-level" ]; do
  cd ..
done
TOP_LEVEL="$(pwd)"

echo "Instantiating: $pkg" >&2
nix-instantiate --add-root "$TMPDIR/instance" --indirect './.' -A "$pkg" >/dev/null

echo "Finding all of the needed srcs: $pkg" >&2
declare -A processed
process=("$(readlink -f "$TMPDIR/instance")")
srcs=()

while [ "${#process[@]}" -gt "0" ]; do
  new=()
  if [ "${processed["${process[0]}"]}" != "1" ]; then
    contents="$(cat "${process[0]}")"
    new=($(echo "$contents" | tr '"' '\n' | grep '^/[^ ]*.drv$' || true))
    if echo "$contents" | grep -q 'outputHashAlgo'; then
      srcs+=("${process[0]}")
    fi
  fi
  processed["${process[0]}"]=1
  process=("${process[@]:1}" "${new[@]}")
done

echo "Realizing the srcs: $pkg" >&2
nix-store -k -r "${srcs[@]}"

error: pathspec 'maintainers/scripts/nix-build-src.sh' did not match any file(s) known to git


remove bash_profile.sh from play2

remove bash_profile.sh from play2


Whoops; removed test data.

Whoops; removed test data.

#!/bin/sh
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.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.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is the Bugzilla Bug Tracking System.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are Copyright (C) 1998
# Netscape Communications Corporation. All Rights Reserved.
#
# Contributor(s): Terry Weissman <terry@mozilla.org>

mysql > /dev/null 2>/dev/null << OK_ALL_DONE

use bugs;

drop table components
OK_ALL_DONE

mysql << OK_ALL_DONE
use bugs;
create table components (
value tinytext,
program tinytext,
initialowner tinytext not null,	# Should arguably be a mediumint!
initialqacontact tinytext not null # Should arguably be a mediumint!
);

insert into components (value, program, initialowner, initialqacontact) values ("XPFC", "Calendar", "spider@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("config", "Calendar", "spider@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Core", "Calendar", "sman@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("NLS", "Calendar", "jusn@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("UI", "Calendar", "eyork@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Test", "Calendar", "sman@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Install", "Calendar", "sman@netscape.com", "");

insert into components (value, program, initialowner, initialqacontact) values ("CCK-Wizard", "CCK", "selmer@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("CCK-Installation", "CCK", "selmer@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("CCK-Shell", "CCK", "selmer@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("CCK-Whitebox", "CCK", "selmer@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Dialup-Install", "CCK", "selmer@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Dialup-Account Setup", "CCK", "selmer@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Dialup-Mup/Muc", "CCK", "selmer@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Dialup-Upgrade", "CCK", "selmer@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("AS-Whitebox", "CCK", "selmer@netscape.com", "");

insert into components (value, program, initialowner, initialqacontact) values ("LDAP C SDK", "Directory", "chuckb@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("LDAP Java SDK", "Directory", "chuckb@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("PerLDAP", "Directory", "leif@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("LDAP Tools", "Directory", "chuckb@netscape.com", "");

insert into components (value, program, initialowner, initialqacontact) values ("Networking", "MailNews", "mscott@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Database", "MailNews", "davidmc@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("MIME", "MailNews", "rhp@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Security", "MailNews", "jefft@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Composition", "MailNews", "ducarroz@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Address Book", "MailNews", "putterman@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Front End", "MailNews", "warren@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Back End", "MailNews", "phil@netscape.com", "");

insert into components (value, program, initialowner, initialqacontact) values ("Macintosh FE", "Mozilla", "sdagley@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Windows FE", "Mozilla", "blythe@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("XFE", "Mozilla", "ramiro@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("StubFE", "Mozilla", "rickg@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Aurora/RDF FE", "Mozilla", "don@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Aurora/RDF BE", "Mozilla", "guha@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Berkeley DB", "Mozilla", "montulli@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Browser Hooks", "Mozilla", "ebina@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Build Config", "Mozilla", "briano@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Composer", "Mozilla", "akkana@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Compositor Library", "Mozilla", "vidur@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Dialup", "Mozilla", "selmer@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("FontLib", "Mozilla", "dp@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("HTML Dialogs", "Mozilla", "nisheeth@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("HTML to Text/PostScript Translation", "Mozilla", "brendan@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("ImageLib", "Mozilla", "pnunn@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("JPEG Image Handling", "Mozilla", "tgl@sss.pgh.pa.us", "");
insert into components (value, program, initialowner, initialqacontact) values ("PNG Image Handling", "Mozilla", "png@wco.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Image Conversion Library", "Mozilla", "mjudge@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("I18N Library", "Mozilla", "bobj@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Java Stubs", "Mozilla", "warren@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("JavaScript", "Mozilla", "mccabe@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("JavaScript Debugger", "Mozilla", "jband@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("JavaScript/Java Reflection", "Mozilla", "fur@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Layout", "Mozilla", "rickg@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("LibMocha", "Mozilla", "mlm@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("MIMELib", "Mozilla", "terry@mozilla.org", "");
insert into components (value, program, initialowner, initialqacontact) values ("NetLib", "Mozilla", "gagan@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("NSPR", "Mozilla", "srinivas@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Password Cache", "Mozilla", "montulli@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("PICS", "Mozilla", "montulli@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Plugins", "Mozilla", "amusil@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Preferences", "Mozilla", "aoki@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Progress Window", "Mozilla", "atotic@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Registry", "Mozilla", "dveditz@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Scheduler", "Mozilla", "aoki@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Security Stubs", "Mozilla", "jsw@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("SmartUpdate", "Mozilla", "dveditz@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("XML", "Mozilla", "guha@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("XP-COM", "Mozilla", "scullin@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("XP File Handling", "Mozilla", "atotic@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("XP Miscellany", "Mozilla", "brendan@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("XP Utilities", "Mozilla", "rickg@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Zlib", "Mozilla", "pnunn@netscape.com", "");

insert into components (value, program, initialowner, initialqacontact) values ("Platform: Lesstif on Linux", "Mozilla", "ramiro@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Platform: OS/2", "Mozilla", "law@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Platform: MacOS/PPC", "Mozilla", "sdagley@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Platform: Rhapsody", "Mozilla", "mcafee@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Platform: MFC/Win32 on Windows", "Mozilla", "blythe@netscape.com", "");

insert into components (value, program, initialowner, initialqacontact) values ("ActiveX Wrapper", "NGLayout", "locka@iol.ie", "");
insert into components (value, program, initialowner, initialqacontact) values ("Content Model", "NGLayout", "kipp@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Cookies", "NGLayout", "scullin@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("DOM", "NGLayout", "vidur@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("DOM", "NGLayout", "vidur@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Editor", "NGLayout", "kostello@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Embedding APIs", "NGLayout", "jevering@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Event Handling", "NGLayout", "joki@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Event Handling", "NGLayout", "joki@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Form Submission", "NGLayout", "pollmann@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("HTMLFrames", "NGLayout", "karnaze@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("HTMLTables", "NGLayout", "karnaze@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Layout", "NGLayout", "troy@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Networking Library", "NGLayout", "gagan@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Parser", "NGLayout", "rickg@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Plug-ins", "NGLayout", "amusil@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Rendering", "NGLayout", "michaelp@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Selection and Search", "NGLayout", "kostello@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Style System", "NGLayout", "peterl@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Threading", "NGLayout", "rpotts@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Viewer App", "NGLayout", "rickg@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Widget Set", "NGLayout", "kmcclusk@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("XPCOM", "NGLayout", "scullin@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("xpidl", "NGLayout", "shaver@netscape.com", "");

insert into components (value, program, initialowner, initialqacontact) values ("Bonsai", "Webtools", "terry@mozilla.org", "");
insert into components (value, program, initialowner, initialqacontact) values ("Bugzilla", "Webtools", "terry@mozilla.org", "");
insert into components (value, program, initialowner, initialqacontact) values ("Despot", "Webtools", "terry@mozilla.org", "");
insert into components (value, program, initialowner, initialqacontact) values ("LXR", "Webtools", "endico@mozilla.org", "");
insert into components (value, program, initialowner, initialqacontact) values ("Mozbot", "Webtools", "terry@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Tinderbox", "Webtools", "terry@mozilla.org", "");

select * from components;

show columns from components;
show index from components;

OK_ALL_DONE

#!/bin/sh
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.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.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is the Bugzilla Bug Tracking System.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are Copyright (C) 1998
# Netscape Communications Corporation. All Rights Reserved.
#
# Contributor(s): Terry Weissman <terry@mozilla.org>

mysql > /dev/null 2>/dev/null << OK_ALL_DONE

use bugs;

drop table components
OK_ALL_DONE

mysql << OK_ALL_DONE
use bugs;
create table components (
value tinytext,
program tinytext,
initialowner tinytext not null,	# Should arguably be a mediumint!
initialqacontact tinytext not null # Should arguably be a mediumint!
);

insert into components (value, program, initialowner, initialqacontact) values ("XPFC", "Calendar", "spider@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("config", "Calendar", "spider@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Core", "Calendar", "sman@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("NLS", "Calendar", "jusn@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("UI", "Calendar", "eyork@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Test", "Calendar", "sman@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Install", "Calendar", "sman@netscape.com", "");

insert into components (value, program, initialowner, initialqacontact) values ("CCK-Wizard", "CCK", "selmer@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("CCK-Installation", "CCK", "selmer@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("CCK-Shell", "CCK", "selmer@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("CCK-Whitebox", "CCK", "selmer@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Dialup-Install", "CCK", "selmer@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Dialup-Account Setup", "CCK", "selmer@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Dialup-Mup/Muc", "CCK", "selmer@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Dialup-Upgrade", "CCK", "selmer@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("AS-Whitebox", "CCK", "selmer@netscape.com", "");

insert into components (value, program, initialowner, initialqacontact) values ("LDAP C SDK", "Directory", "chuckb@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("LDAP Java SDK", "Directory", "chuckb@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("PerLDAP", "Directory", "leif@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("LDAP Tools", "Directory", "chuckb@netscape.com", "");

insert into components (value, program, initialowner, initialqacontact) values ("Networking", "MailNews", "mscott@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Database", "MailNews", "davidmc@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("MIME", "MailNews", "rhp@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Security", "MailNews", "jefft@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Composition", "MailNews", "ducarroz@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Address Book", "MailNews", "putterman@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Front End", "MailNews", "warren@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Back End", "MailNews", "phil@netscape.com", "");

insert into components (value, program, initialowner, initialqacontact) values ("Macintosh FE", "Mozilla", "sdagley@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Windows FE", "Mozilla", "blythe@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("XFE", "Mozilla", "ramiro@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("StubFE", "Mozilla", "rickg@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Aurora/RDF FE", "Mozilla", "don@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Aurora/RDF BE", "Mozilla", "guha@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Berkeley DB", "Mozilla", "montulli@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Browser Hooks", "Mozilla", "ebina@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Build Config", "Mozilla", "briano@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Composer", "Mozilla", "akkana@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Compositor Library", "Mozilla", "vidur@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Dialup", "Mozilla", "selmer@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("FontLib", "Mozilla", "dp@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("HTML Dialogs", "Mozilla", "nisheeth@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("HTML to Text/PostScript Translation", "Mozilla", "brendan@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("ImageLib", "Mozilla", "pnunn@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("JPEG Image Handling", "Mozilla", "tgl@sss.pgh.pa.us", "");
insert into components (value, program, initialowner, initialqacontact) values ("PNG Image Handling", "Mozilla", "png@wco.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Image Conversion Library", "Mozilla", "mjudge@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("I18N Library", "Mozilla", "bobj@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Java Stubs", "Mozilla", "warren@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("JavaScript", "Mozilla", "mccabe@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("JavaScript Debugger", "Mozilla", "jband@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("JavaScript/Java Reflection", "Mozilla", "fur@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Layout", "Mozilla", "rickg@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("LibMocha", "Mozilla", "mlm@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("MIMELib", "Mozilla", "terry@mozilla.org", "");
insert into components (value, program, initialowner, initialqacontact) values ("NetLib", "Mozilla", "gagan@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("NSPR", "Mozilla", "srinivas@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Password Cache", "Mozilla", "montulli@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("PICS", "Mozilla", "montulli@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Plugins", "Mozilla", "amusil@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Preferences", "Mozilla", "aoki@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Progress Window", "Mozilla", "atotic@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Registry", "Mozilla", "dveditz@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Scheduler", "Mozilla", "aoki@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Security Stubs", "Mozilla", "jsw@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("SmartUpdate", "Mozilla", "dveditz@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("XML", "Mozilla", "guha@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("XP-COM", "Mozilla", "scullin@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("XP File Handling", "Mozilla", "atotic@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("XP Miscellany", "Mozilla", "brendan@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("XP Utilities", "Mozilla", "rickg@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Zlib", "Mozilla", "pnunn@netscape.com", "");

insert into components (value, program, initialowner, initialqacontact) values ("Platform: Lesstif on Linux", "Mozilla", "ramiro@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Platform: OS/2", "Mozilla", "law@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Platform: MacOS/PPC", "Mozilla", "sdagley@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Platform: Rhapsody", "Mozilla", "mcafee@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Platform: MFC/Win32 on Windows", "Mozilla", "blythe@netscape.com", "");

insert into components (value, program, initialowner, initialqacontact) values ("ActiveX Wrapper", "NGLayout", "locka@iol.ie", "");
insert into components (value, program, initialowner, initialqacontact) values ("Content Model", "NGLayout", "kipp@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Cookies", "NGLayout", "scullin@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("DOM", "NGLayout", "vidur@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("DOM", "NGLayout", "vidur@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Editor", "NGLayout", "kostello@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Embedding APIs", "NGLayout", "jevering@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Event Handling", "NGLayout", "joki@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Event Handling", "NGLayout", "joki@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Form Submission", "NGLayout", "pollmann@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("HTMLFrames", "NGLayout", "karnaze@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("HTMLTables", "NGLayout", "karnaze@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Layout", "NGLayout", "troy@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Networking Library", "NGLayout", "gagan@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Parser", "NGLayout", "rickg@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Plug-ins", "NGLayout", "amusil@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Rendering", "NGLayout", "michaelp@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Selection and Search", "NGLayout", "kostello@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Style System", "NGLayout", "peterl@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Threading", "NGLayout", "rpotts@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Viewer App", "NGLayout", "rickg@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Widget Set", "NGLayout", "kmcclusk@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("XPCOM", "NGLayout", "scullin@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("xpidl", "NGLayout", "shaver@netscape.com", "");

insert into components (value, program, initialowner, initialqacontact) values ("Bonsai", "Webtools", "terry@mozilla.org", "");
insert into components (value, program, initialowner, initialqacontact) values ("Bugzilla", "Webtools", "terry@mozilla.org", "terry@mozilla.org");
insert into components (value, program, initialowner, initialqacontact) values ("Despot", "Webtools", "terry@mozilla.org", "");
insert into components (value, program, initialowner, initialqacontact) values ("LXR", "Webtools", "endico@mozilla.org", "");
insert into components (value, program, initialowner, initialqacontact) values ("Mozbot", "Webtools", "terry@netscape.com", "");
insert into components (value, program, initialowner, initialqacontact) values ("Tinderbox", "Webtools", "terry@mozilla.org", "");

select * from components;

show columns from components;
show index from components;

OK_ALL_DONE


Added additional choices to tech when dealing with account conflicts

Now when presented with account conflicts, the tech can continue, or override. Continuing will then exlude those accounts when running the package function. If the tech chooses
to override, then the package function will package up all accounts, and then the restore function will attempt to restore them.

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/jerius/cpmigrator.git/'


just a script for switching for release

just a script for switching for release

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/dbussink/rxtx.git/'


Use different sed delimiter around M D5 hash; '/' can appear in base64 encoding

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/tectronics/admiral-jiscmrd.git/'


Modified the script to alert on  the absence of /mnt/data symlink.


Added script to clean the Movies directory based on FS Free percentage

Still working on the TV Show cleanup part..

#!/bin/sh

mount_point="/dev/sda2"
use_pcent=`df -k --output=pcent $mount_point | sed 's/%//g' | tail -1`
min_free_pcent=90

dir_movies="/multimedia/Movies"
dir_tv_shows="/multimedia/Movies"

while [ $use_pcent -gt $min_free_pcent ]; do
	 file_to_delete=`find $dir_movies -type d -printf '%T+;%p\n' | sort | head -n 1 | cut -d ";" -f 2`
	 rm -rf $file_to_delete
done

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


Update s3wipe.sh

Update s3wipe.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/kalantal/s3-tests.git/'


change order of lines

change order of lines

#!/bin/bash
set -e
set -x
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )

if [[ $TRAVIS_OS_NAME = "linux" ]]
then
    tag=Linux
else
    tag=MacOSX
fi

# install conda
curl -O https://repo.continuum.io/miniconda/Miniconda3-latest-$tag-x86_64.sh
sudo bash Miniconda3-latest-$tag-x86_64.sh -b -p /anaconda
sudo chown -R $USER /anaconda
export PATH=/anaconda/bin:$PATH
conda update -y conda
conda index /anaconda/conda-bld/linux-64 /anaconda/conda-bld/osx-64

# setup bioconda channel
conda config --add channels anaconda
conda config --add channels r
conda config --add channels conda-forge
conda config --add channels bioconda
conda config --add channels file://anaconda/conda-bld

conda install -y --file https://raw.githubusercontent.com/bioconda/bioconda-utils/$BIOCONDA_UTILS_TAG/conda-requirements.txt

# setup bioconda-utils
pip install git+https://github.com/bioconda/bioconda-utils.git@$BIOCONDA_UTILS_TAG

#!/bin/bash
set -e
set -x
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )

if [[ $TRAVIS_OS_NAME = "linux" ]]
then
    tag=Linux
else
    tag=MacOSX
fi

# install conda
curl -O https://repo.continuum.io/miniconda/Miniconda3-latest-$tag-x86_64.sh
sudo bash Miniconda3-latest-$tag-x86_64.sh -b -p /anaconda
sudo chown -R $USER /anaconda
export PATH=/anaconda/bin:$PATH

# setup bioconda channel
conda config --add channels anaconda
conda config --add channels r
conda config --add channels conda-forge
conda config --add channels bioconda
conda config --add channels file://anaconda/conda-bld

conda update -y conda
conda install -y --file https://raw.githubusercontent.com/bioconda/bioconda-utils/$BIOCONDA_UTILS_TAG/conda-requirements.txt
conda index /anaconda/conda-bld/linux-64 /anaconda/conda-bld/osx-64

# setup bioconda-utils
pip install git+https://github.com/galaxyproject/galaxy-lib.git@871c090
pip install git+https://github.com/bioconda/bioconda-utils.git@$BIOCONDA_UTILS_TAG


e/sh Final fix to install HHVM on the fly

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/dereknutile/vlemp.git/'


update scripts

update scripts

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


Removed +1 that created an addition blank 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/ENIGMA-git/ENIGMA.git/'


Script for configuring the security policy in EC

#!/bin/bash

THISHOSTIP=$(nslookup $HOSTNAME | grep Address | tail -n 1 | cut -d' ' -f2)
echo Host: ${HOSTNAME} / ${THISHOSTIP}

#!/bin/bash

USR=ubuntu
rm -f servers_public
rm -f servers_public_private

echo
echo Note: configure your AWS_ACCESS_KEY and AWS_SECRET_KEY environment variables first!
echo

echo
echo Reading list of EC2 regions for ec2_regions
echo

echo Creating security policies:
for REGION in `cat ec2_regions`
do
    echo Region: $REGION
    export EC2_URL=https://ec2.${REGION}.amazonaws.com
    ec2-describe-instances | grep 'running' | cut -d$'\t' -f 17 > servers_public_tmp
    echo Found `cat servers_public_tmp`
    aws ec2 --region $REGION authorize-security-group-ingress --group-name default --protocol all --cidr ${THISHOSTIP}/32
    for PUBIP in `cat servers_public_tmp`
    do
	aws ec2 --region $REGION authorize-security-group-ingress --group-name default --protocol all --cidr ${PUBIP}/32
    done
done

rm servers_public_tmp

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


whitespace in soapdenovo-trans to trigger rebuild

cc @acaprez

#!/bin/bash
export C_INCLUDE_PATH=${PREFIX}/include
export LD_LIBRARY_PATH=${PREFIX}/lib

mkdir -p ${PREFIX}/bin
sh make.sh
cp ${SRC_DIR}/{SOAPdenovo-Trans-127mer,SOAPdenovo-Trans-31mer} ${PREFIX}/bin


remove spurious message

remove spurious 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/pordoqui/dcs-insar-diapason-s1.git/'


Update installer.sh

Update installer.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/SigPloiter/SigPloit.git/'


added

added

#!/usr/bin/ksh
# or bash or ...
# csv.sh
# dump Oracle table to the csv
# csv.sh -t TABLE
# csv.sh -t TABLE -d "|"
# Ver: Jukka Inkeri 2021-09-02
#

CONNECT='username/password@"(DESCRIPTION =(ADDRESS= (PROTOCOL = TCP)(HOST=xx.xx.xx.xx)(PORT = 1521)) (CONNECT_DATA=(SID = dbname)))"'

########################################################################
# - setup sqlplus for csv output
init_oracsv()
{
echo "
TITLE OFF
BTITLE OFF
REPHEADER OFF
SET NEWPAGE 0
SET SPACE 0
SET PAGESIZE 99999999
SET PAGESIZE 0
SET MARKUP HTML OFF
SET ECHO OFF
SET NEWPAGE 0
SET SPACE 0
SET FEEDBACK OFF
SET TRIMSPOOL ON
SET TAB OFF
SET LINESIZE 32000
SET HEADSEP OFF
----SET MARKUP HTML PREFORMAT ON
SET WRAP OFF
----SET MARKUP HTML PREFORMAT ON SPOOL ON
SET MARKUP HTML OFF
SET VERIFY OFF ;
SET SQLPROMPT ''
ALTER SESSION SET NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH:MI:SS.FF';
ALTER SESSION SET NLS_DATE_FORMAT = "YYYY-MM-DD";
SET HEADING ON
"
}

########################################################################
usage()
{
	echo "usage:$PRG -t tablename [ -d delimiter ]" >&2 && exit 1
}

########################################################################
# MAIN
########################################################################
tablename=""
deli="|"
while [ $# -gt 0 ]
do
	arg="$1"
	case "$arg" in
		-t|--table) tablename="$2" ; shift ;;
		-d|--delimiter) deli="$2" ; shift ;;
		-*) usage ; exit 2 ;;
		--) shift; break ;;
		*) break ;;
	esac
	shift

done

[ "$tablename" = "" ] && usage && exit 1

# csvout include csv and some other output
mkdir -p csvout
# remove previous output
rm -f csvout/$tablename.* 2>/dev/null

# set values ...
init_oracsv > csvout/$tablename.sql

# create sql set
cat <<EOF >> csvout/$tablename.sql

-- build to file dynamic SELECT, fld same order as in the headerline
spool on
spool csvout/$tablename.sel
SET COLSEP ' '
SELECT 'SELECT','' FROM dual
UNION ALL
SELECT
	CASE WHEN ROWNUM>1 THEN ',' END,
	column_name
FROM all_tab_columns WHERE table_name = '$tablename'
UNION ALL
SELECT 'FROM $tablename',';' FROM dual ;
spool off;

spool on
SET COLSEP '$deli'
spool csvout/$tablename.tmp
-- columnnames
SELECT LISTAGG(column_name,'$deli') WITHIN GROUP (ORDER BY ROWNUM) FROM
(SELECT ROWNUM,column_name FROM all_tab_columns WHERE table_name= upper('$tablename')
)
;
-- datalines
--SELECT * FROM $tablename
@csvout/$tablename.sel

spool off;
/
exit;

EOF

# execute
sqlplus  "$CONNECT" @csvout/$tablename.sql > /dev/null

# trim cols
cat csvout/$tablename.tmp | sed -e "s/ *$deli/$deli/g" -e "s/$deli */$deli/g" -e "s/^ *//g" | sed -n -e "1p" -e '3,$p' > csvout/$tablename.csv

echo "Done: $tablename => csvout/$tablename.csv" >&2

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


Added nginx install script

Added nginx install script

#!/bin/bash

apt-get install -y nginx nginx-extras
wget -P /usr/local/bin/ https://raw.githubusercontent.com/butterfly-project/ls/master/nginx/ngx && chmod +x /usr/local/bin/ngx

echo -e "deb http://packages.dotdeb.org jessie all\ndeb-src http://packages.dotdeb.org jessie all" > /etc/apt/sources.list.d/dotdeb.list
wget https://www.dotdeb.org/dotdeb.gpg && apt-key add dotdeb.gpg
apt-get update
apt-get install -y php7.0-cli php7.0-common php7.0-mysql php7.0-pgsql php7.0-gd php7.0-fpm php7.0-cgi php7.0-fpm php-pear php7.0-mcrypt php7.0-curl php7.0-json php7.0-readline php7.0-redis php7.0-mbstring php7.0-zip

cp /etc/php/7.0/fpm/php.ini /etc/php/7.0/fpm/php.ini.bak
sed "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g" /etc/php/7.0/fpm/php.ini.bak > /etc/php/7.0/fpm/php.ini

cp /etc/php/7.0/fpm/pool.d/www.conf /etc/php/7.0/fpm/pool.d/www.conf.bak
sed "s/;security.limit_extensions/security.limit_extensions/g" /etc/php/7.0/fpm/pool.d/www.conf.bak > /etc/php/7.0/fpm/pool.d/www.conf

service nginx restart
service php7.0-fpm restart

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


Uploading shell script

Uploading shell script

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


Move coreutils wrappers

Move coreutils wrappers

#!/usr/bin/env bash

koopa::cp() { # {{{1
    # """
    # Hardened version of coreutils copy.
    # @note Updated 2020-07-20.
    #
    # getopts info:
    # - http://mywiki.wooledge.org/BashFAQ/035#getopts
    # - https://wiki.bash-hackers.org/howto/getopts_tutorial
    # """
    local OPTIND cp cp_flags mkdir rm sudo symlink target_dir target_parent
    unalias -a
    koopa::assert_is_installed cp
    sudo=0
    symlink=0
    target_dir=
    OPTIND=1
    while getopts 'Sst:' opt
    do
        case "$opt" in
            S)
                sudo=1
                ;;
            s)
                symlink=1
                ;;
            t)
                target_dir="$OPTARG"
                ;;
            \?)
                koopa::invalid_arg
                ;;
        esac
    done
    shift "$((OPTIND-1))"
    koopa::assert_has_args "$#"
    if [[ "$sudo" -eq 1 ]]
    then
        cp=('sudo' 'cp')
        mkdir=('koopa::mkdir' '-S')
        rm=('koopa::rm' '-S')
    else
        cp=('cp')
        mkdir=('koopa::mkdir')
        rm=('koopa::rm')
    fi
    cp_flags=('-af')
    [[ "$symlink" -eq 1 ]] && cp_flags+=('-s')
    if [[ -n "$target_dir" ]]
    then
        koopa::assert_is_existing "$@"
        target_dir="$(koopa::strip_trailing_slash "$target_dir")"
        cp_flags+=('-t' "$target_dir")
        [[ -d "$target_dir" ]] || "${mkdir[@]}" "$target_dir"
    else
        koopa::assert_has_args_eq "$#" 2
        source_file="${1:?}"
        koopa::assert_is_existing "$source_file"
        target_file="${2:?}"
        [[ -e "$target_file" ]] && "${rm[@]}" "$target_file"
        target_parent="$(dirname "$target_file")"
        [[ -d "$target_parent" ]] || "${mkdir[@]}" "$target_parent"
    fi
    "${cp[@]}" "${cp_flags[@]}" "$@" &>/dev/null
    return 0
}

koopa::df() { # {{{1
    # """
    # Human friendlier version of df.
    # @note Updated 2020-07-01.
    # """
    unalias -a
    koopa::assert_is_installed df
    df \
        --portability \
        --print-type \
        --si \
        "$@" \
        | sort
    return 0
}

koopa::ln() { # {{{1
    # """
    # Create a symlink quietly.
    # @note Updated 2020-07-20.
    # """
    local OPTIND ln ln_flags mkdir rm source_file target_file target_dir \
        target_parent
    unalias -a
    koopa::assert_is_installed ln
    sudo=0
    target_dir=
    OPTIND=1
    while getopts 'St:' opt
    do
        case "$opt" in
            S)
                sudo=1
                ;;
            t)
                target_dir="$OPTARG"
                ;;
            \?)
                koopa::invalid_arg
                ;;
        esac
    done
    shift "$((OPTIND-1))"
    koopa::assert_has_args "$#"
    if [[ "$sudo" -eq 1 ]]
    then
        ln=('sudo' 'ln')
        mkdir=('koopa::mkdir' '-S')
        rm=('koopa::rm' '-S')
    else
        ln=('ln')
        mkdir=('koopa::mkdir')
        rm=('koopa::rm')
    fi
    ln_flags=('-fns')
    if [[ -n "$target_dir" ]]
    then
        koopa::assert_is_existing "$@"
        target_dir="$(koopa::strip_trailing_slash "$target_dir")"
        ln_flags+=('-t' "$target_dir")
        [[ -d "$target_dir" ]] || "${mkdir[@]}" "$target_dir"
    else
        koopa::assert_has_args_eq "$#" 2
        source_file="${1:?}"
        koopa::assert_is_existing "$source_file"
        target_file="${2:?}"
        [[ -e "$target_file" ]] && "${rm[@]}" "$target_file"
        target_parent="$(dirname "$target_file")"
        [[ -d "$target_parent" ]] || "${mkdir[@]}" "$target_parent"
    fi
    "${ln[@]}" "${ln_flags[@]}" "$@" &>/dev/null
    return 0
}

koopa::mkdir() { # {{{1
    # """
    # Create directories with parents automatically.
    # @note Updated 2020-07-08.
    local OPTIND mkdir sudo
    unalias -a
    sudo=0
    OPTIND=1
    while getopts 'S' opt
    do
        case "$opt" in
            S)
                sudo=1
                ;;
            \?)
                koopa::invalid_arg
                ;;
        esac
    done
    shift "$((OPTIND-1))"
    koopa::assert_has_args "$#"
    if [[ "$sudo" -eq 1 ]]
    then
        mkdir=('sudo' 'mkdir')
    else
        mkdir=('mkdir')
    fi
    "${mkdir[@]}" -p "$@" &>/dev/null
    return 0
}

koopa::mv() { # {{{1
    # """
    # Move a file or directory.
    # @note Updated 2020-07-08.
    #
    # This function works on 1 file or directory at a time.
    # It ensures that the target parent directory exists automatically.
    #
    # Useful GNU cp flags, for reference (non-POSIX):
    # - -T: no-target-directory
    # - --strip-trailing-slashes
    # """
    local OPTIND mkdir mv mv_flags rm source_file sudo target_file target_parent
    unalias -a
    sudo=0
    target_dir=
    OPTIND=1
    while getopts 'St:' opt
    do
        case "$opt" in
            S)
                sudo=1
                ;;
            t)
                target_dir="$OPTARG"
                ;;
            \?)
                koopa::invalid_arg
                ;;
        esac
    done
    shift "$((OPTIND-1))"
    koopa::assert_has_args "$#"
    if [[ "$sudo" -eq 1 ]]
    then
        mkdir=('koopa::mkdir' '-S')
        mv=('sudo' 'mv')
        rm=('koopa::rm' '-S')
    else
        mkdir=('koopa::mkdir')
        mv=('mv')
        rm=('koopa::rm')
    fi
    mv_flags=('-f')
    if [[ -n "$target_dir" ]]
    then
        koopa::assert_is_existing "$@"
        target_dir="$(koopa::strip_trailing_slash "$target_dir")"
        mv_flags+=('-t' "$target_dir")
        [[ -d "$target_dir" ]] || "${mkdir[@]}" "$target_dir"
    else
        koopa::assert_has_args_eq "$#" 2
        source_file="$(koopa::strip_trailing_slash "${1:?}")"
        koopa::assert_is_existing "$source_file"
        target_file="$(koopa::strip_trailing_slash "${2:?}")"
        [[ -e "$target_file" ]] && "${rm[@]}" "$target_file"
        target_parent="$(dirname "$target_file")"
        [[ -d "$target_parent" ]] || "${mkdir[@]}" "$target_parent"
    fi
    "${mv[@]}" "${mv_flags[@]}" "$@" &>/dev/null
    return 0
}

koopa::relink() { # {{{1
    # """
    # Re-create a symbolic link dynamically, if broken.
    # @note Updated 2020-07-07.
    # """
    local OPTIND dest_file ln rm source_file sudo
    unalias -a
    sudo=0
    OPTIND=1
    while getopts 'S' opt
    do
        case "$opt" in
            S)
                sudo=1
                ;;
            \?)
                koopa::invalid_arg
                ;;
        esac
    done
    shift "$((OPTIND-1))"
    koopa::assert_has_args_eq "$#" 2
    if [[ "$sudo" -eq 1 ]]
    then
        ln=('koopa::ln' '-S')
        rm=('koopa::rm' '-S')
    else
        ln=('koopa::ln')
        rm=('koopa::rm')
    fi
    source_file="${1:?}"
    dest_file="${2:?}"
    # Keep this check relaxed, in case dotfiles haven't been cloned.
    [[ -e "$source_file" ]] || return 0
    [[ -L "$dest_file" ]] && return 0
    "${rm[@]}" "$dest_file"
    "${ln[@]}" "$source_file" "$dest_file"
    return 0
}

koopa::rm() { # {{{1
    # """
    # Remove files/directories quietly.
    # @note Updated 2020-07-06.
    # """
    local OPTIND rm sudo
    unalias -a
    sudo=0
    OPTIND=1
    while getopts 'S' opt
    do
        case "$opt" in
            S)
                sudo=1
                ;;
            \?)
                koopa::invalid_arg
                ;;
        esac
    done
    shift "$((OPTIND-1))"
    koopa::assert_has_args "$#"
    if [[ "$sudo" -eq 1 ]]
    then
        rm=('sudo' 'rm')
    else
        rm=('rm')
    fi
    "${rm[@]}" -fr "$@" &>/dev/null
    return 0
}

error: pathspec 'shell/bash/functions/app/coreutils.sh' did not match any file(s) known to git


mkbizu 追加

mkbizu 追加

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/tonkachi/aws-monitors.git/'


copy calc_rdf_gromacs.sh to still_dirty

copy calc_rdf_gromacs.sh to still_dirty

#! /bin/bash
#
# Copyright 2009-2011 The VOTCA Development Team (http://www.votca.org)
#
# 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 applicale 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.
#

if [[ $1 = "--help" ]]; then
cat <<EOF
${0##*/}, version %version%
This script calcs the rdf for gromacs using g_rdf

Usage: ${0##*/}

Used external packages: gromacs
EOF
   exit 0
fi

index="$(csg_get_property cg.inverse.gromacs.g_rdf.index "index.ndx")"
[ -f "$index" ] || die "${0##*/}: grompp index file '$index' not found"
tpr="$(csg_get_property cg.inverse.gromacs.g_rdf.topol "topol.tpr")"
[ -f "$tpr" ] || die "${0##*/}: Gromacs tpr file '$tpr' not found"

ext=$(csg_get_property cg.inverse.gromacs.traj_type "xtc")
traj="traj.${ext}"
[ -f "$traj" ] || die "${0##*/}: gromacs traj file '$traj' not found"

g_rdf="$(csg_get_property cg.inverse.gromacs.g_rdf.bin "g_rdf")"
[ -n "$(type -p $g_rdf)" ] || die "${0##*/}: g_rdf binary '$g_rdf' not found"

opts="$(csg_get_property --allow-empty cg.inverse.gromacs.g_rdf.opts)"

grp1=$(csg_get_interaction_property --allow-empty gromacs.grp1)
if [[ -z $grp1 ]]; then
  grp1=$(csg_get_interaction_property type1)
  msg --color blue --to-stderr "WARNING (in ${0##*/}): could not find energy group of type1 (interaction property gromacs.grp1) using bead type1 ($grp1) as failback !"
fi
grp2=$(csg_get_interaction_property --allow-empty gromacs.grp2)
if [[ -z $grp2 ]]; then
  grp2=$(csg_get_interaction_property type2)
  msg --color blue --to-stderr "WARNING (in ${0##*/}): could not find energy group of type2 (interaction property gromacs.grp2) using bead type2 ($grp2) as failback !"
fi
name=$(csg_get_interaction_property name)
binsize=$(csg_get_interaction_property step)
min=$(csg_get_interaction_property min)
max=$(csg_get_interaction_property max)

begin="$(calc_begin_time)"
end="$(calc_end_time)"

tasks=$(get_number_tasks)
if is_done "rdf-$name"; then
  echo "g_rdf for ${grp1}-${grp2} is already done"
else
  msg "Running g_rdf for ${grp1}-${grp2} using $tasks tasks"
  if [ $tasks -gt 1 ]; then
    echo -e "${grp1}\n${grp2}" | critical multi_g_rdf --cmd ${g_rdf} -${tasks} -b ${begin} -e ${end} -n "$index" -o ${name}.dist.new.xvg --soutput ${name}.dist.new.NP.xvg -- -bin ${binsize}  -s "$tpr" -f "${traj}" ${opts}
  else
    echo -e "${grp1}\n${grp2}" | critical ${g_rdf} -b ${begin} -n "$index" -bin ${binsize} -o ${name}.dist.new.xvg -s "$tpr" -f "${traj}" ${opts}
  fi
  #gromacs always append xvg
  comment="$(get_table_comment)"
  critical csg_resample --in ${name}.dist.new.xvg --out ${name}.dist.new --grid ${min}:${binsize}:${max} --comment "$comment"
  mark_done "rdf-$name"
fi

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