Add a bin directory for run scripts

Add a bin directory for run scripts

#!/bin/bash

# Absolute path to this script
SCRIPT=$(readlink -f $0)
BIN=`dirname $SCRIPT`
ROOT=`dirname $BIN`

# Source the scanner configuration
. ~/scanner.conf

# Bring up bluetooth interface
hciconfig hci0 up

ps -eaf | grep lescan | grep -v grep >/dev/null
found=$?
# non-zero return means lescan not seen running
if [ $found -ne 0 ]; then
        hcitool lescan --duplicates >/dev/null &
else
        echo lescan already running
fi

# Start the scanner
${ROOT}/Debug/src2/NativeScannerBlueZ --scannerID "${SCANNER_ID:-`hostname`}" --brokerURL "${BROKER_URL:-192.168.1.107:5672}" --heartbeatUUID "${HEARTBEAT_UUID}" --useQueues

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


Adding destroy-machines script

Adding destroy-machines script

#!/bin/bash

## ==================================
## Script to delete Docker hosts
## Initial verison: Mike Sandman
## Updated version: Petar Smilajkov
## ==================================
## Updates:
## - 12/16/2015 - expanded the initial version - Petar Smilajkov
## ================================================================

# set fonts for help highlights
NORM=`tput sgr0`
BOLD=`tput bold`
REV=`tput smso`

function show_help {
  cat << EOF
Usage: ${BOLD}destroy-machines${NORM} [-n|--name | -q|--quantity]

Example: ${REV}destroy-machines -n dh.do.nyc3 -q 3${NORM}
-> Destroys a specified -q NUMBER of Docker Hosts prefixed with -n dockerhost.do.nyc3 name.
-> I.e. 0001.dockerhost.do.nyc3, 0002.dockerhost.do.nyc3, and 0003.dockerhost.do.nyc3

Example: ${REV}destroy-machines -n 0001.dockerhost.do.nyc3${NORM}
-> Destroys 0001.dockerhost.do.nyc3 machine (single machine w/ full name as specified)

        -h|--help               displays this help

        -n|--name NAME          [REQUIRED] full name of the docker host to remove
                                ex: 0001.dh.do.nyc3 (for removing a single machine)
				ex2: dh.do.nyc (w/o #) if used with -q switch (deletes > 1 machine)

	-q|--quantity NUMBER	[OPTIONAL] number of docker hosts to delete
                                -> will start from 0001 and go UP to NUMBER specified (inclusive)
                                ex: 3 -> this will delete hosts 0001.NAME, 0002.NAME and 0003.NAME
				if not provided, only docker host specified with -n NAME will be deleted

EOF
}

function destroy_machines {
  local NAME=$1
  local QUANTITY=$2

  if [[ $QUANTITY -eq 1 ]]; then
    destroy_machine $NAME
  else
    for ((a=1; a <= QUANTITY ; a++)) do
      PREFIX=""
      case ${#QUANTITY} in
        0)
          echo "What a heck?"
          exit 1
          ;;
        1)
          PREFIX="000$a"
          ;;
        2)
          PREFIX="00$a"
          ;;
        3)
          PREFIX="0$a"
          ;;
        *)
          PREFIX="$a"
          ;;
      esac

      destroy_machine "$PREFIX.$NAME"
    done
  fi
}

function destroy_machine {
  local NAME=$1
  echo "Destorying machine: $NAME"
  docker-machine rm "$NAME" &
}

NUMARGS=$#
if [ $NUMARGS -eq 0 ]; then
  show_help
fi

# init vars to default values
NAME=""
PROVIDER="do"
QUANTITY=0

while getopts "h help n::name::p:provider:q:quantity:" opt; do
  case $opt in
    n|name)
      NAME=$OPTARG
      ;;
    p|provider)
      PROVIDER=$OPTARG
      ;;
    q|quantity)
      QUANTITY=$OPTARG
      ;;
    h|help)
      show_help
      exit 1;
      ;;
    \?)
      show_help
      exit 1
      ;;
  esac
  shift $((OPTIND-1))
done

destroy_machines $NAME $QUANTITY

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


Erste Version hochgeladen

Erste Version hochgeladen

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/maxpatternman/freepbx-german-conf.git/'


build a release tarball from a standalone build

#!/bin/sh

set -e

PKG_DIR="configurator-$(uname -srm | tr ' ' '-')"
DIST_DIR=./dist
DIST=${DIST_DIR}/configurator

mkdir -p ${DIST_DIR}/${PKG_DIR}

cp ${DIST} ${DIST_DIR}/${PKG_DIR}

tar -czf ${DIST_DIR}/${PKG_DIR}.tar.gz -C ${DIST_DIR} ${PKG_DIR}

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


added a test file with some helpful bash hints to ./Old/

#!/bin/bash

# this outputs to console and appends it to logfile (creating logfile if needed)
# 	echo "my message" | tee -a ./easychromium.log

# this is a multiline comment
# : << 'COMMENT'
# code
# code
# code
# COMMENT

# save to a filepath determined by a variable
# LOGFILE="./logtest.log"
# echo "does this work?" | tee -a $LOGFILE

# $? - use that to see what the last executed command exited with
#	1 is an error condition, 0 is a successful exit

# see http://mywiki.wooledge.org/BashFAQ/031
# for notes on [ ] vs. [[ ]] (for bash on OS X, just use [[ ]])

# redirect stderr to stdout: append 2>&1 to the command
#	example: XCODE_CHECK="$(command xcodebuild 2>&1)"
#	that captures the stderr and stdout of that command in the variable "$XCODE_CHECK"
#	use double quotes to preserve newlines in the variable
#	0 == stdin, 1 == stdout, 2 == stderr

# command -v is verbose. -V is more verbose.

# list of conditionals in bash: http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_01.html

if [ $# -lt 1 ]; then
	echo "Usage : bash easychromium.sh <OPTION>"
	echo ""
	echo "Currently supported <OPTION>'s:  defaults, interactive"
	echo ""
	echo "defaults builds and installs Release version of stable branch of Chromium"
	echo "    -defaults uses a local .gclient if one exists"
	echo "defaults copies built Chromium to /Applications/"
	echo "    -defaults does not replace or remove existing user profiles"
	echo "    -move or rename existing Chromium.app files in /Applications/ to avoid overwriting"
	echo ""
	echo "interactive permits user interaction for various build options"
	echo ""
	echo "Future pull requests welcome to enable other <OPTION>'s"
	echo "e.g.: debug, beta, canary"
	echo ""
	echo ""
	exit 1;
fi

case "$1" in
	defaults )
	echo "Running with defaults" | tee -a $LOGFILE
	flag="defaults"
	;;

	interactive )
	echo "Running with interactive" | tee -a $LOGFILE
	flag="interactive"
	;;

	* )
	echo "Usage : bash easychromium.sh <OPTION>"
	echo ""
	echo "Currently supported <OPTION>'s:  defaults, interactive"
	echo ""
	echo "defaults builds and installs Release version of stable branch of Chromium"
	echo "    -defaults uses a local .gclient if one exists"
	echo "defaults copies built Chromium to /Applications/"
	echo "    -defaults does not replace or remove existing user profiles"
	echo "    -move or rename existing Chromium.app file in /Applications/ to avoid overwriting"
	echo ""
	echo "interactive permits user interaction for various build options"
	echo ""
	echo "Future pull requests welcome to enable other <OPTION>'s"
	echo "e.g.: debug, beta, canary"
	echo ""
	echo ""
	exit 1;
	;;
esac

case "$flag" in
	defaults )
	echo "flag is defaults" | tee -a $LOGFILE
	response="yes"
	;;

	interactive )
	echo "flag is interactive" | tee -a $LOGFILE
	read -r -p "Automatically tweak .gclient config file for faster download/build time? (Y/n) " response
	;;
esac

if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then
	echo "you said yes!"
else
	echo "you said no"
fi

OS_VERSION=$(sw_vers -productVersion)
LOGFILE="./logtest.log"

echo "does this work?" | tee -a $LOGFILE

echo "testing substring match"
fuu="hello harry"
bar=""

if [[ $fuu =~ $bar ]]; then
	echo "found it"
else
	echo "did not find it"
fi

: <<'COMMENT'
echo "testing xcode_check"

XCODE_CHECK="$(command xcodebuild -version 2>&1)"
echo "$XCODE_CHECK"
foo="requires"

if [[ "$XCODE_CHECK"=~"$foo" ]]; then
	echo "Xcode not found, please see xcodehelp.txt in this repository and install Xcode." | tee -a $LOGFILE
	exit 1;
fi
COMMENT

echo "testing updating url in .gclient"
cat ./.gclient
insert='    "url"         : "https://chromium.googlesource.com/chromium/src.git",'
match='    "url"         : "https://src.chromium.org/svn/trunk/src",'
sed -i "" "s%$match%$insert%" ./.gclient
cat ./.gclient

: <<'COMMENT'
echo "testing line insertion in .gclient"
filetext="$(cat ./.gclient)"
echo "$filetext"
insert="    \"src\/third_party\/WebKit\/LayoutTests\": None,"'\
'"    \"src\/chrome\/tools\/test\/reference_build\/chrome\": None,"'\
'"    \"src\/chrome_frame\/tools\/test\/reference_build\/chrome\": None,"'\
'"    \"src\/chrome\/tools\/test\/reference_build\/chrome_linux\": None,"'\
'"    \"src\/chrome\/tools\/test\/reference_build\/chrome_mac\": None,"'\
'"    \"src\/third_party\/hunspell_dictionaries\": None,"
match='    "custom_deps" : {'
#match='solutions'
echo "match: $match"
# the empty "" is needed because sed -i on OS X expects a mandatory file extension, which .gclient lacks
# see http://stackoverflow.com/a/28592391
# the actual newline instead of \n is necessary because OS X's old BSD sed is weird
# see http://stackoverflow.com/a/24276470/3277902 for the comprehensive BSD/linux sed differences
sed -i "" "s/$match/$match"'\
'"$insert/" .gclient
echo "new file"
cat .gclient
COMMENT

:<<'COMMENT'
echo "testing export"

export FOO="bar"
if [[ $? -eq 0 ]]; then
	echo "$FOO"
else
	echo "failed"
fi

PATH=`pwd`/lalala/hoohah
echo $PATH
COMMENT

: <<'COMMENT'
echo "=========New Build Attempt=========" | tee -a ./logtest.log
echo $(date) | tee -a ./logtest.log
echo "=========New Build Attempt=========" | tee -a ./logtest.log
echo "OS X Version "$OS_VERSION" detected" | tee -a ./logtest.log
echo "more output" | tee -a ./logtest.log

if [[ $(git --version) =~ "2" ]]; then
	echo "git version 2.x detected"
fi
echo "end"
COMMENT

# testing git version
# sample respnonses:
#	git version 2.5.4 (Apple Git-61)
#	git version 2.6.4
#	-bash: git: command not found

###
# Based on version checker code cc by-sa 3.0
# Courtesy http://stackoverflow.com/users/1032785/jordanm at http://stackoverflow.com/a/11602790
###

: <<'COMMENT'
for cmd in git; do
	[[ $("$cmd" --version) =~ ([0-9][.][0-9.]*) ]] && version="${BASH_REMATCH[1]}"
	echo "that command returned: "$?
	if ! awk -v ver="$version" 'BEGIN { if (ver < 2.6.5) exit 1; }'; then
		echo 'ERROR: '$cmd' version 2.6.5 or higher required' | tee -a $LOGFILE
	fi
done
COMMENT

:<<'COMMENT'
XCODE_CHECK="$(command xcodebuild 2>&1)"
if [[ "$XCODE_CHECK"=~"error" ]]; then
	echo "Xcode not found, please see xcodehelp.txt in this repository and install Xcode." | tee -a $LOGFILE
	exit 1;
else
	echo "Xcode detected, testing version" | tee -a LOGFILE
	for cmd in xcodebuild; do
		[[ $("$cmd" -version) =~ ([0-9][.][0-9.]*) ]] && version="${BASH_REMATCH[1]}"
		if ! awk -v ver="$version" 'BEGIN { if (ver < 5.0) exit 1; }'; then
			echo 'ERROR: '$cmd' version 5.0 or higher required' | tee -a $LOGFILE
			echo 'Version detected was: '$version | tee -a $LOGFILE
			exit 1;
		fi
done
fi
COMMENT

: <<'COMMENT'
echo "pre"
DEPOT_CHECK="$(command -V gclient 2>&1)"
if [[ DEPOT_CHECK=~"not found" ]]; then
	echo "depot_tools not found, try checking your PATH" | tee -a $LOGFILE
	echo "Alternatively, easychromium can try to install depot_tools for you." | tee -a $LOGFILE
	read -r -p "Install depot_tools? (Y/n) " response
	if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then
		echo "trying to install depot_tools"
	else
		echo "no depot_tools found, exiting"
		exit 1;
	fi
else
	echo "found"
fi

if [[ -f "./config.txt" ]]; then
	echo "./config.txt exists"
else
	echo "does not exist"
fi
COMMENT

: <<'COMMENT'
if ! grep "error" "${XCODE_CHECK}"; then
	echo "xcode found"
else
	echo "not found"
fi
COMMENT

: <<'COMMENT'
if command -v xcodebuild >/dev/null 2>&1; then

	for cmd in xcodebuild; do
		[[ $("$cmd" -version) =~ ([0-9][.][0-9.]*) ]] && version="${BASH_REMATCH[1]}"
		echo "that command returned: "$?
		if ! awk -v ver="$version" 'BEGIN { if (ver < 5.0.0) exit 1; }'; then
			echo 'ERROR: '$cmd' version 5.0.0 or higher required. Please update Xcode.' | tee -a $LOGFILE
			exit 1;
		fi
	done

else
	echo "ERROR: xcode is not installed. See xcodehelp.txt in easychromium repository." | tee -a $LOGFILE
	exit 1;
fi
COMMENT

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


Add bin/upgrade-qtcreator-spellchecker.sh

#!/bin/bash

set -e

QTCREATOR_DIR=${HOME}/Qt/Tools/QtCreator

echo -e "Download the latest version of SpellChecker-Plugin into ~/Downloads\n\n  https://github.com/CJCombrink/SpellChecker-Plugin/releases/\n"
read -sp "Press enter when ready."
echo -e "\n"
package=$(find ~/Downloads/ -type f -name 'SpellChecker-Plugin_*' | xargs --no-run-if-empty ls -t | head -n1)
echo "Installing ${package} into ${QTCREATOR_DIR}"
tar -C ${QTCREATOR_DIR} --strip-components=1 -xf ${package}
echo Done.

error: pathspec 'bin/upgrade-qtcreator-spellchecker.sh' did not match any file(s) known to git


Fix delete flag to keep a synced version of the build on DO

#!/bin/bash

#
# This source file is part of appleseed.
# Visit https://appleseedhq.net/ for additional information and resources.
#
# This software is released under the MIT license.
#
# Copyright (c) 2020 Kevin Masson, The appleseedhq Organization
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#

set -e

THISDIR=`pwd`

#--------------------------------------------------------------------------------------------------
# Create a report.
#--------------------------------------------------------------------------------------------------

echo "travis_fold:start:report"
echo "Creating a report..."

touch build_report.txt

echo "web url=$TRAVIS_BUILD_WEB_URL" >> build_report.txt
echo "job url=$TRAVIS_JOB_WEB_URL" >> build_report.txt
echo "commit=$TRAVIS_COMMIT" >> build_report.txt
echo "commit url=https://github.com/appleseedhq/appleseed/commit/$TRAVIS_COMMIT" >> build_report.txt
echo "commit message=$TRAVIS_COMMIT_MESSAGE" >> build_report.txt
echo "job id=$TRAVIS_JOB_ID" >> build_report.txt
echo "job name=$TRAVIS_JOB_NAME" >> build_report.txt
echo "job number=$TRAVIS_JOB_NUMBER" >> build_report.txt

echo "travis_fold:end:report"

#--------------------------------------------------------------------------------------------------
# Deploy build.
#--------------------------------------------------------------------------------------------------

echo "travis_fold:start:deploy"
echo "Deploy travis build on the server..."

# Add server public key to known hosts.
echo $DEPLOY_SSH_KEY >> $HOME/.ssh/known_hosts

# Send build to server.
export SSHPASS=$DEPLOY_PASSWORD
sshpass -e rsync \
    --recursive \
    --archive \
    --compress \
    --stats \
    --no-perms --no-owner --no-group \
    --include="build_report.txt" \
    --include="sanbox/" \
    --include="scripts/" \
    --include="prebuilt-linux-deps/" \
    --delete-after \
    ./* \
    $DEPLOY_USER@$DEPLOY_URL:$DEPLOY_FOLDER

echo "travis_fold:end:deploy"

set +e

#!/bin/bash

#
# This source file is part of appleseed.
# Visit https://appleseedhq.net/ for additional information and resources.
#
# This software is released under the MIT license.
#
# Copyright (c) 2020 Kevin Masson, The appleseedhq Organization
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#

set -e

THISDIR=`pwd`

#--------------------------------------------------------------------------------------------------
# Create a report.
#--------------------------------------------------------------------------------------------------

echo "travis_fold:start:report"
echo "Creating a report..."

touch build_report.txt

echo "web url=$TRAVIS_BUILD_WEB_URL" >> build_report.txt
echo "job url=$TRAVIS_JOB_WEB_URL" >> build_report.txt
echo "commit=$TRAVIS_COMMIT" >> build_report.txt
echo "commit url=https://github.com/appleseedhq/appleseed/commit/$TRAVIS_COMMIT" >> build_report.txt
echo "commit message=$TRAVIS_COMMIT_MESSAGE" >> build_report.txt
echo "job id=$TRAVIS_JOB_ID" >> build_report.txt
echo "job name=$TRAVIS_JOB_NAME" >> build_report.txt
echo "job number=$TRAVIS_JOB_NUMBER" >> build_report.txt

echo "travis_fold:end:report"

#--------------------------------------------------------------------------------------------------
# Deploy build.
#--------------------------------------------------------------------------------------------------

echo "travis_fold:start:deploy"
echo "Deploy travis build on the server..."

# Add server public key to known hosts.
echo $DEPLOY_SSH_KEY >> $HOME/.ssh/known_hosts

# Send build to server.
export SSHPASS=$DEPLOY_PASSWORD
sshpass -e rsync \
    -raz --stats --no-perms --no-owner --no-group --delete \
    --include="build_report.txt" \
    --include="sanbox/" \
    --include="scripts/" \
    --include="prebuilt-linux-deps/" \
    ./* \
    $DEPLOY_USER@$DEPLOY_URL:$DEPLOY_FOLDER

echo "travis_fold:end:deploy"

set +e


add gdrive-cli installer

add gdrive-cli installer

#/bin/bash
#
# Install gdrive-cli
# Author: Char1sma<github-char1sma@woai.ru>
# Date: 2016-12-02
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
if [ -f ~/bin/gdrive ]
	exit 0
else
	MACHINE_TYPE=`uname -m`
	if [ ${MACHINE_TYPE} == 'x86_64' ]; then
		MACHINE_TYPE=386
	else
		MACHINE_TYPE=x64
	fi
	DOWNLOAD_URL=`wget -O- https://github.com/prasmussen/gdrive  2>/dev/null | grep "<a.*gdrive-linux-${MACHINE_TYPE}" | sed 's/.*href="//' | sed 's/&amp.*//'`
	mkdir -p ~/bin
	wget $DOWNLOAD_URL -O ~/bin/gdrive
	chmod +x ~/bin/gdrive
fi

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


I accidentally a !

I accidentally a !

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/ikari7789/puphpet.git/'


bitrise 1.2.3

bitrise 1.2.3

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/bitrise-io/osx-box-bootstrap.git/'


add git_update.sh

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


Build bootstrap for win32

Build bootstrap for win32

We should get an automatic win32 hello world binary from this (and a few other changes)

#!/usr/bin/env bash

apt-get update
apt-get install -y gcc-mingw-w64-i686

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


Output format change

Output format change

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


Delete run.sh

Delete run.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/AshkanM96/CPP-IO-Versus-C-IO.git/'


Added source-release script.

Added source-release script.

#!/bin/sh

CMVN_PACK=cmvn-src-0.1.3
RELEASE_DIR=source-release
CMVN_DIR=${RELEASE_DIR}/${CMVN_PACK}

mkdir -p ${RELEASE_DIR}

svn export . ${CMVN_DIR}

rm -r ${CMVN_DIR}/releases

( cd ${RELEASE_DIR} && zip -r ${CMVN_PACK}.zip ${CMVN_PACK} )

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


Use lowercase names for local vars

Use lowercase names for local vars

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/pvsone/pcf-pipelines.git/'


Improve deploy script to wait for service to respond.

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/casid/mazebert-ladder.git/'


refactor bootstrap script

refactor bootstrap 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/tavisrudd/docker-gentoobase.git/'


Delete txnmall.sh

Delete txnmall.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/Zilbercoin/SRC.git/'


Create japmap_colored_straight.sh

Create japmap_colored_straight.sh

#! /usr/bin/env bash

# R: to display some specific char, we can use the following syntax:
#echo -e "[\xE2\x98\xA0 !"
# ( the above 'll display a pirate skull head ;p )

#### Japanese Romanji, Hiragana & Ketakana ideograms correspondancies ####

## Chars & ideograms sets ##

## Romanji's
romanji_a="a"
romanji_i="i"
romanji_u="u"
romanji_e="e"
romanji_o="o"

romanji_ka="ka"
romanji_ki="ki"
romanji_ku="ku"
romanji_ke="ke"
romanji_ko="ko"

romanji_sa="sa"
romanji_shi="shi"
romanji_su="su"
romanji_se="se"
romanji_so="so"

romanji_ta="ta"
romanji_chi="chi"
romanji_tsu="tsu"
romanji_te="te"
romanji_to="to"

romanji_na="na"
romanji_ni="ni"
romanji_nu="nu"
romanji_ne="ne"
romanji_no="no"

romanji_ha="ha"
romanji_hi="hi"
romanji_fu="fu"
romanji_he="he"
romanji_ho="ho"

romanji_ma="ma"
romanji_mi="mi"
romanji_mu="mu"
romanji_me="me"
romanji_mo="mo"

romanji_ya="ya"
romanji_yu="yu"
romanji_yo="yo"

romanji_ra="ra"
romanji_ri="ri"
romanji_ru="ru"
romanji_re="re"
romanji_ro="ro"

romanji_wa="wa"
romanji_wi="wi"  # [added]
romanji_vu="vu"  # [added]
romanji_we="we"  # [added]
romanji_wo="wo"

romanji_n="-n"

romanji_ga="ga"
romanji_gi="gi"
romanji_gu="gu"
romanji_ge="ge"
romanji_go="go"

romanji_za="za"
romanji_ji="ji"
romanji_zu="zu"
romanji_ze="ze"
romanji_zo="zo"

romanji_da="da"
romanji_ji="ji"
romanji_zu="zu"
romanji_de="de"
romanji_do="do"

romanji_ba="ba"
romanji_bi="bi"
romanji_bu="bu"
romanji_be="be"
romanji_bo="bo"

romanji_pa="pa"
romanji_pi="pi"
romanji_pu="pu"
romanji_pe="pe"
romanji_po="po"

## Hiragana's
hiragana_a="\xE3\x81\x82"   # ぁ
hiragana_i="\xE3\x81\x83"   # ぃ
hiragana_u="\xE3\x81\x85"   # ぅ
hiragana_e="\xE3\x81\x87"   # ぇ
hiragana_o="\xE3\x81\x89"   # ぉ

hiragana_ka="\xE3\x82\x95"  # ゕ
hiragana_ki="\xE3\x81\x8D"  # き
hiragana_ku="\xE3\x81\x8F"  # く
hiragana_ke="\xE3\x81\x91"  # け
hiragana_ko="\xE3\x81\x93"  # こ

hiragana_sa="\xE3\x81\x95"  # さ
hiragana_shi="\xE3\x81\x97" # し
hiragana_su="\xE3\x81\x99"  # す
hiragana_se="\xE3\x81\x9B"  # せ
hiragana_so="\xE3\x81\x9D"  # そ

hiragana_ta="\xE3\x81\x9F"  # た
hiragana_chi="\xE3\x81\xA1" # ち
hiragana_tsu="\xE3\x81\xA3" # っ
hiragana_te="\xE3\x81\xA6"  # て
hiragana_to="\xE3\x81\xA8"  # と

hiragana_na="\xE3\x81\xAA"  # な
hiragana_ni="\xE3\x81\xAB"  # に
hiragana_nu="\xE3\x81\xAC"  # ぬ
hiragana_ne="\xE3\x81\xAD"  # ね
hiragana_no="\xE3\x81\xAE"  # の

hiragana_ha="\xE3\x81\xAF"  # は
hiragana_hi="\xE3\x81\xB2"  # ひ
hiragana_fu="\xE3\x81\xB5"  # ふ
hiragana_he="\xE3\x81\xB8"  # へ
hiragana_ho="\xE3\x81\xBB"  # ほ

hiragana_ma="\xE3\x81\xBE"  # ま
hiragana_mi="\xE3\x81\xBF"  # み
hiragana_mu="\xE3\x82\x80"  # む
hiragana_me="\xE3\x82\x81"  # め
hiragana_mo="\xE3\x82\x82"  # も

hiragana_ya="\xE3\x82\x82"  # ゃ
hiragana_yu="\xE3\x82\x85"  # ゅ
hiragana_yo="\xE3\x82\x87"  # ょ

hiragana_ra="\xE3\x82\x87"  # ら
hiragana_ri="\xE3\x82\x8A"  # り
hiragana_ru="\xE3\x82\x8B"  # る
hiragana_re="\xE3\x82\x8C"  # れ
hiragana_ro="\xE3\x82\x8D"  # ろ

hiragana_wa="\xE3\x82\x8D"  # ゎ
hiragana_wi="\xE3\x82\x90"  # ゐ [added]
hiragana_vu="\xE3\x82\x94"  # ゔ [added]
hiragana_we="\xE3\x82\x91"  # ゑ [added]
hiragana_wo="\xE3\x82\x92"  # を

hiragana_n="\xE3\x82\x93"   # ん

hiragana_ga="\xE3\x81\x8C"  # が
hiragana_gi="\xE3\x81\x8E"  # ぎ
hiragana_gu="\xE3\x81\x90"  # ぐ
hiragana_ge="\xE3\x81\x92"  # げ
hiragana_go="\xE3\x81\x94"  # ご

hiragana_za="\xE3\x81\x96"  # ざ
hiragana_ji="\xE3\x81\x98"  # じ
hiragana_zu="\xE3\x81\x9A"  # ず
hiragana_ze="\xE3\x81\x9C"  # ぜ
hiragana_zo="\xE3\x81\x9E"  # ぞ

hiragana_da="\xE3\x81\xA0"  # だ
hiragana_ji="\xE3\x81\xA2"  # ぢ
hiragana_zu="\xE3\x81\xA5"  # づ
hiragana_de="\xE3\x81\xA7"  # で
hiragana_do="\xE3\x81\xA9"  # ど

hiragana_ba="\xE3\x81\xB0"  # ば
hiragana_bi="\xE3\x81\xB3"  # び
hiragana_bu="\xE3\x81\xB6"  # ぶ
hiragana_be="\xE3\x81\xB9"  # べ
hiragana_bo="\xE3\x81\xBC"  # ぼ

hiragana_pa="\xE3\x81\xA9"  # ぱ
hiragana_pi="\xE3\x81\xB4"  # ぴ
hiragana_pu="\xE3\x81\xB7"  # ぷ
hiragana_pe="\xE3\x81\xBA"  # ぺ
hiragana_po="\xE3\x81\xBD"  # ぽ

## Katakana's
katakana_a="\xE3\x82\xA1"   # ァ
katakana_i="\xE3\x82\xA3"   # ィ
katakana_u="\xE3\x82\xA5"   # ゥ
katakana_e="\xE3\x82\xA7"   # ェ
katakana_o="\xE3\x82\xA9"   # ォ

katakana_ka="\xE3\x82\xAB"  # カ
katakana_ki="\xE3\x82\xAD"  # キ
katakana_ku="\xE3\x82\xAF"  # ク
katakana_ke="\xE3\x82\xB1"  # ケ
katakana_ko="\xE3\x82\xB3"  # コ

katakana_sa="\xE3\x82\xB5"  # サ
katakana_shi="\xE3\x82\xB7" # シ
katakana_su="\xE3\x82\xB9"  # ス
katakana_se="\xE3\x82\xBB"  # セ
katakana_so="\xE3\x82\xBD"  # ソ

katakana_ta="\xE3\x82\xBF"  # タ
katakana_chi="\xE3\x83\x81" # チ
katakana_tsu="\xE3\x83\x83" # ッ
katakana_te="\xE3\x83\x86"  # テ
katakana_to="\xE3\x83\x88"  # ト

katakana_na="\xE3\x83\x8A"  # ナ
katakana_ni="\xE3\x83\x8B"  # ニ
katakana_nu="\xE3\x83\x8C"  # ヌ
katakana_ne="\xE3\x83\x8D"  # ネ
katakana_no="\xE3\x83\x8E"  # ノ

katakana_ha="\xE3\x83\x8F"  # ハ
katakana_hi="\xE3\x83\x92"  # ヒ
katakana_fu="\xE3\x83\x95"  # フ
katakana_he="\xE3\x83\x98"  # ヘ
katakana_ho="\xE3\x83\x9B"  # ホ

katakana_ma="\xE3\x83\x9E"  # マ
katakana_mi="\xE3\x83\x9F"  # ミ
katakana_mu="\xE3\x83\xA0"  # ム
katakana_me="\xE3\x83\xA1"  # メ
katakana_mo="\xE3\x83\xA2"  # モ

katakana_ya="\xE3\x83\xA3"  # ャ
katakana_yu="\xE3\x83\xA5"  # ュ
katakana_yo="\xE3\x83\xA7"  # ョ

katakana_ra="\xE3\x83\xA9"  # ラ
katakana_ri="\xE3\x83\xAA"  # リ
katakana_ru="\xE3\x83\xAB"  # ル
katakana_re="\xE3\x83\xAC"  # レ
katakana_ro="\xE3\x83\xAD"  # ロ

katakana_wa="\xE3\x83\xAE"  # ヮ
katakana_wi="\xE3\x83\xB0"  # ヰ [added]
katakana_vu="\xE3\x83\xB4"  # ヴ [added]
katakana_we="\xE3\x83\xB1"  # ヱ [added]
katakana_wo="\xE3\x83\xB2"  # ヲ

katakana_n="\xE3\x83\xB3"   # ン

katakana_ga="\xE3\x82\xAC"  # ガ
katakana_gi="\xE3\x82\xAE"  # ギ
katakana_gu="\xE3\x82\xB0"  # グ
katakana_ge="\xE3\x82\xB2"  # ゲ
katakana_go="\xE3\x82\xB4"  # ゴ

katakana_za="\xE3\x82\xB6"  # ザ
katakana_ji="\xE3\x82\xB8"  # ジ
katakana_zu="\xE3\x82\xBA"  # ズ
katakana_ze="\xE3\x82\xBC"  # ゼ
katakana_zo="\xE3\x82\xBE"  # ゾ

katakana_da="\xE3\x83\x80"  # ダ
katakana_ji="\xE3\x83\x82"  # ヂ
katakana_zu="\xE3\x83\x85"  # ヅ
katakana_de="\xE3\x83\x87"  # デ
katakana_do="\xE3\x83\x89"  # ド

katakana_ba="\xE3\x83\x90"  # バ
katakana_bi="\xE3\x83\x93"  # ビ
katakana_bu="\xE3\x83\x96"  # ブ
katakana_be="\xE3\x83\x99"  # ベ
katakana_bo="\xE3\x83\x9C"  # ボ

katakana_pa="\xE3\x83\x91"  # パ
katakana_pi="\xE3\x83\x94"  # ピ
katakana_pu="\xE3\x83\x97"  # プ
katakana_pe="\xE3\x83\x9A"  # ペ
katakana_po="\xE3\x83\x9D"  # ポ

##  display in nice squares ;p ##
# R: digg how to save font size, increase it / use it , the nrestore it ( .. )

# color helpers
#CYAN="\[\033[1;35m\]"
#PURPLE="\[\033[1;35m\]"
#NO_COLOUR="\[\033[0m\]"
CYAN="\033[1;36m"
PURPLE="\033[1;35m"
NO_COLOUR="\033[0m"

# littl' tabs test
#echo -e "\xE3\x81\x82 \t \xE3\x81\x82 \t \xE3\x81\x82"

# intro
#echo -e "[\xE2\x98\xA0  Japanese Map !]  ( Romanji -> Hiragana / Katakana )"
echo -e "[Japanese Map !]  ( Romanji -> ${CYAN}Hiragana${NO_COLOUR} / ${PURPLE}Katakana${NO_COLOUR} )"
echo -e "\n"

# hack the promp to take less space in our big-font-sized term & to have a hacky style ;P
PS1="\$(echo -e \"${CYAN}\xE2\x98\xA0${NO_COLOUR} ${PURPLE}${katakana_ha}${katakana_ke}${katakana_ru} ${NO_COLOUR}: \")"
#PS1="\e[01;32m"
# R: launch a term window usingthe correct profile for the font-size adjustement
# ex, using: gnome-terminal --profile=JapaneseStuff

## first row: the 8 first squares
# first column: a's
echo -e \
        "   " "$romanji_a  ${CYAN}$hiragana_a ${NO_COLOUR}/ ${PURPLE}$katakana_a${NO_COLOUR}" \
        "\t" "$romanji_ka  ${CYAN}$hiragana_ka ${NO_COLOUR}/ ${PURPLE}$katakana_ka${NO_COLOUR}" \
        "\t" "$romanji_sa  ${CYAN}$hiragana_sa ${NO_COLOUR}/ ${PURPLE}$katakana_sa${NO_COLOUR}" \
        "\t" "$romanji_ta  ${CYAN}$hiragana_ta ${NO_COLOUR}/ ${PURPLE}$katakana_ta${NO_COLOUR}" \
        "\t" "$romanji_na  ${CYAN}$hiragana_na ${NO_COLOUR}/ ${PURPLE}$katakana_na${NO_COLOUR}" \
        "\t" "$romanji_ha  ${CYAN}$hiragana_ha ${NO_COLOUR}/ ${PURPLE}$katakana_ha${NO_COLOUR}" \
        "\t" "$romanji_ma  ${CYAN}$hiragana_ma ${NO_COLOUR}/ ${PURPLE}$katakana_ma${NO_COLOUR}" \
        "\t" "$romanji_ya  ${CYAN}$hiragana_ya ${NO_COLOUR}/ ${PURPLE}$katakana_ya${NO_COLOUR}" \

# second column: i's
echo -e \
        "   " "$romanji_i  ${CYAN}$hiragana_i ${NO_COLOUR}/ ${PURPLE}$katakana_i${NO_COLOUR}" \
        "\t" "$romanji_ki  ${CYAN}$hiragana_ki ${NO_COLOUR}/ ${PURPLE}$katakana_ki${NO_COLOUR}" \
        "\t" "$romanji_shi ${CYAN}$hiragana_shi ${NO_COLOUR}/ ${PURPLE}$katakana_shi${NO_COLOUR}" \
        "\t" "$romanji_chi ${CYAN}$hiragana_chi ${NO_COLOUR}/ ${PURPLE}$katakana_chi${NO_COLOUR}" \
        "\t" "$romanji_ni  ${CYAN}$hiragana_ni ${NO_COLOUR}/ ${PURPLE}$katakana_ni${NO_COLOUR}" \
        "\t" "$romanji_hi  ${CYAN}$hiragana_hi ${NO_COLOUR}/ ${PURPLE}$katakana_hi${NO_COLOUR}" \
        "\t" "$romanji_mi  ${CYAN}$hiragana_mi ${NO_COLOUR}/ ${PURPLE}$katakana_mi${NO_COLOUR}" \
        #"\t" " -  - / -"

# third column: u's
echo -e \
        "   " "$romanji_u  ${CYAN}$hiragana_u ${NO_COLOUR}/ ${PURPLE}$katakana_u${NO_COLOUR}" \
        "\t" "$romanji_ku  ${CYAN}$hiragana_ku ${NO_COLOUR}/ ${PURPLE}$katakana_ku${NO_COLOUR}" \
        "\t" "$romanji_su  ${CYAN}$hiragana_su ${NO_COLOUR}/ ${PURPLE}$katakana_su${NO_COLOUR}" \
        "\t" "$romanji_tsu ${CYAN}$hiragana_tsu ${NO_COLOUR}/ ${PURPLE}$katakana_tsu${NO_COLOUR}" \
        "\t" "$romanji_nu  ${CYAN}$hiragana_nu ${NO_COLOUR}/ ${PURPLE}$katakana_nu${NO_COLOUR}" \
        "\t" "$romanji_fu  ${CYAN}$hiragana_fu ${NO_COLOUR}/ ${PURPLE}$katakana_fu${NO_COLOUR}" \
        "\t" "$romanji_mu  ${CYAN}$hiragana_mu ${NO_COLOUR}/ ${PURPLE}$katakana_mu${NO_COLOUR}" \
        "\t" "$romanji_yu  ${CYAN}$hiragana_yu ${NO_COLOUR}/ ${PURPLE}$katakana_yu${NO_COLOUR}" \

# fourth column: e's
echo -e \
        "   " "$romanji_e  ${CYAN}$hiragana_e ${NO_COLOUR}/ ${PURPLE}$katakana_e${NO_COLOUR}" \
        "\t" "$romanji_ke  ${CYAN}$hiragana_ke ${NO_COLOUR}/ ${PURPLE}$katakana_ke${NO_COLOUR}" \
        "\t" "$romanji_se  ${CYAN}$hiragana_se ${NO_COLOUR}/ ${PURPLE}$katakana_se${NO_COLOUR}" \
        "\t" "$romanji_te  ${CYAN}$hiragana_te ${NO_COLOUR}/ ${PURPLE}$katakana_te${NO_COLOUR}" \
        "\t" "$romanji_ne  ${CYAN}$hiragana_ne ${NO_COLOUR}/ ${PURPLE}$katakana_ne${NO_COLOUR}" \
        "\t" "$romanji_he  ${CYAN}$hiragana_he ${NO_COLOUR}/ ${PURPLE}$katakana_he${NO_COLOUR}" \
        "\t" "$romanji_me  ${CYAN}$hiragana_me ${NO_COLOUR}/ ${PURPLE}$katakana_me${NO_COLOUR}" \
        #"\t" " -  - / -"

# fifth column: o's
echo -e \
        "   " "$romanji_o  ${CYAN}$hiragana_o ${NO_COLOUR}/ ${PURPLE}$katakana_o${NO_COLOUR}" \
        "\t" "$romanji_ko  ${CYAN}$hiragana_ko ${NO_COLOUR}/ ${PURPLE}$katakana_ko${NO_COLOUR}" \
        "\t" "$romanji_so  ${CYAN}$hiragana_so ${NO_COLOUR}/ ${PURPLE}$katakana_so${NO_COLOUR}" \
        "\t" "$romanji_to  ${CYAN}$hiragana_to ${NO_COLOUR}/ ${PURPLE}$katakana_to${NO_COLOUR}" \
        "\t" "$romanji_no  ${CYAN}$hiragana_no ${NO_COLOUR}/ ${PURPLE}$katakana_no${NO_COLOUR}" \
        "\t" "$romanji_ho  ${CYAN}$hiragana_ho ${NO_COLOUR}/ ${PURPLE}$katakana_ho${NO_COLOUR}" \
        "\t" "$romanji_mo  ${CYAN}$hiragana_mo ${NO_COLOUR}/ ${PURPLE}$katakana_mo${NO_COLOUR}" \
        "\t" "$romanji_yo  ${CYAN}$hiragana_yo ${NO_COLOUR}/ ${PURPLE}$katakana_yo${NO_COLOUR}" \

# inner space
echo -e "\n"

## second row: the 7 squares left
# first column: a's & -n's
echo -e \
        "  " "$romanji_ra  ${CYAN}$hiragana_ra ${NO_COLOUR}/ ${PURPLE}$katakana_ra${NO_COLOUR}" \
        "\t" "$romanji_wa  ${CYAN}$hiragana_wa ${NO_COLOUR}/ ${PURPLE}$katakana_wa${NO_COLOUR}" \
        "\t" "$romanji_ga  ${CYAN}$hiragana_ga ${NO_COLOUR}/ ${PURPLE}$katakana_ga${NO_COLOUR}" \
        "\t" "$romanji_za  ${CYAN}$hiragana_za ${NO_COLOUR}/ ${PURPLE}$katakana_za${NO_COLOUR}" \
        "\t" "$romanji_da  ${CYAN}$hiragana_da ${NO_COLOUR}/ ${PURPLE}$katakana_da${NO_COLOUR}" \
        "\t" "$romanji_ba  ${CYAN}$hiragana_ba ${NO_COLOUR}/ ${PURPLE}$katakana_ba${NO_COLOUR}" \
        "\t" "$romanji_pa  ${CYAN}$hiragana_pa ${NO_COLOUR}/ ${PURPLE}$katakana_pa${NO_COLOUR}" \
        "\t" "$romanji_n  ${CYAN}$hiragana_n ${NO_COLOUR}/ ${PURPLE}$katakana_n${NO_COLOUR}" \

# second column: i's
echo -e \
        "  " "$romanji_ri  ${CYAN}$hiragana_ri ${NO_COLOUR}/ ${PURPLE}$katakana_ri${NO_COLOUR}" \
        "\t" "$romanji_wi  ${CYAN}$hiragana_wi ${NO_COLOUR}/ ${PURPLE}$katakana_wi${NO_COLOUR}" \
        "\t" "$romanji_gi  ${CYAN}$hiragana_gi ${NO_COLOUR}/ ${PURPLE}$katakana_gi${NO_COLOUR}" \
        "\t" "$romanji_ji  ${CYAN}$hiragana_ji ${NO_COLOUR}/ ${PURPLE}$katakana_ji${NO_COLOUR}" \
        "\t" "$romanji_ji  ${CYAN}$hiragana_ji ${NO_COLOUR}/ ${PURPLE}$katakana_ji${NO_COLOUR}" \
        "\t" "$romanji_bi  ${CYAN}$hiragana_bi ${NO_COLOUR}/ ${PURPLE}$katakana_bi${NO_COLOUR}" \
        "\t" "$romanji_pi  ${CYAN}$hiragana_pi ${NO_COLOUR}/ ${PURPLE}$katakana_pi${NO_COLOUR}" \

# third column: u's
echo -e \
        "  " "$romanji_ru  ${CYAN}$hiragana_ru ${NO_COLOUR}/ ${PURPLE}$katakana_ru${NO_COLOUR}" \
        "\t" "$romanji_vu  ${CYAN}$hiragana_vu ${NO_COLOUR}/ ${PURPLE}$katakana_vu${NO_COLOUR}" \
        "\t" "$romanji_gu  ${CYAN}$hiragana_gu ${NO_COLOUR}/ ${PURPLE}$katakana_gu${NO_COLOUR}" \
        "\t" "$romanji_zu  ${CYAN}$hiragana_zu ${NO_COLOUR}/ ${PURPLE}$katakana_zu${NO_COLOUR}" \
        "\t" "$romanji_zu  ${CYAN}$hiragana_zu ${NO_COLOUR}/ ${PURPLE}$katakana_zu${NO_COLOUR}" \
        "\t" "$romanji_bu  ${CYAN}$hiragana_bu ${NO_COLOUR}/ ${PURPLE}$katakana_bu${NO_COLOUR}" \
        "\t" "$romanji_pu  ${CYAN}$hiragana_pu ${NO_COLOUR}/ ${PURPLE}$katakana_pu${NO_COLOUR}" \

# fourth column: e's
echo -e \
        "  " "$romanji_re  ${CYAN}$hiragana_re ${NO_COLOUR}/ ${PURPLE}$katakana_re${NO_COLOUR}" \
        "\t" "$romanji_we  ${CYAN}$hiragana_we ${NO_COLOUR}/ ${PURPLE}$katakana_we${NO_COLOUR}" \
        "\t" "$romanji_ge  ${CYAN}$hiragana_ge ${NO_COLOUR}/ ${PURPLE}$katakana_ge${NO_COLOUR}" \
        "\t" "$romanji_ze  ${CYAN}$hiragana_ze ${NO_COLOUR}/ ${PURPLE}$katakana_ze${NO_COLOUR}" \
        "\t" "$romanji_de  ${CYAN}$hiragana_de ${NO_COLOUR}/ ${PURPLE}$katakana_de${NO_COLOUR}" \
        "\t" "$romanji_be  ${CYAN}$hiragana_be ${NO_COLOUR}/ ${PURPLE}$katakana_be${NO_COLOUR}" \
        "\t" "$romanji_pe  ${CYAN}$hiragana_pe ${NO_COLOUR}/ ${PURPLE}$katakana_pe${NO_COLOUR}" \

# fifth column: o's
echo -e \
        "  " "$romanji_ro  ${CYAN}$hiragana_ro ${NO_COLOUR}/ ${PURPLE}$katakana_ro${NO_COLOUR}" \
        "\t" "$romanji_wo  ${CYAN}$hiragana_wo ${NO_COLOUR}/ ${PURPLE}$katakana_wo${NO_COLOUR}" \
        "\t" "$romanji_go  ${CYAN}$hiragana_go ${NO_COLOUR}/ ${PURPLE}$katakana_go${NO_COLOUR}" \
        "\t" "$romanji_zo  ${CYAN}$hiragana_zo ${NO_COLOUR}/ ${PURPLE}$katakana_zo${NO_COLOUR}" \
        "\t" "$romanji_do  ${CYAN}$hiragana_do ${NO_COLOUR}/ ${PURPLE}$katakana_do${NO_COLOUR}" \
        "\t" "$romanji_bo  ${CYAN}$hiragana_bo ${NO_COLOUR}/ ${PURPLE}$katakana_bo${NO_COLOUR}" \
        "\t" "$romanji_po  ${CYAN}$hiragana_po ${NO_COLOUR}/ ${PURPLE}$katakana_po${NO_COLOUR}" \

# after spac
echo -e "\n"

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


adding flirt db backup script

adding flirt db backup script

#!/bin/bash
#Note: This script is intended for jenkins.

export remote_command="ssh ubuntu@flirt-reporting.eha.io"

export DATE=$(date +%Y%m%d)
$remote_command "sudo docker exec -t mongodb mongodump --db flirt --out /var/log/dump" &&\
$remote_command "sudo tar -czf /var/log/flirt_$DATE.tar.gz /var/log/dump" &&\
$remote_command "aws s3 cp /var/log/flirt_$DATE.tar.gz s3://eha-flirt/backups"

error: pathspec 'jenkins/backup-flirt-db.sh' did not match any file(s) known to git


Create radiateur-linux.sh

Create radiateur-linux.sh

#!/bin/sh

SUPPORTED_ARCH="amd64 i686" #list of the supported architecture
INSTALLER_DIR="./installer/" #default value, can be override
STATIC_DIR="./static/" #static ressourceis directory

help(){
echo "`basename $0`: a small tool to build automatic gentoo installer"
echo
echo "usage: `basename $0` -a <arch> -c <genautoo config file> -o <output iso>"
echo "    \\ [-p <dir with some .deb>] [-D] [ -I <installer dir>]"
echo "    \\ [-i <input debian iso>] [-b <build dir>]"
echo ""
echo "mandatory arguments:"
echo "  -a <arch>: the architecture (currently: $SUPPORTED_ARCH)"
echo "  -c <config file>: the genautoo configuration file"
echo "  -o <output iso>: the name of the generated iso"
echo ""
echo "optional arguments:"
echo "  -p <dir with some .deb>: a directory with .deb to add to the iso"
echo "       could be usefull if you have trouble with some hardware (non-free firmware)"
echo "  -d <dir to include in the iso>: a directory with some content to add to the iso"
echo "       the content of the dir will be included at the / of the new iso"
echo "       could be used to put some files (ex: config) via [*_nochroot] sections"
echo "  -D: adds the generation date"
echo "  -I <installer dir>: path to the installer directory"
echo "  -i <input debian iso>: path to the basic debian install iso"
echo "  -b <build dir>: directory used for the build"
echo ""
exit 1
}

common_print_message()
{
    # function for displaying a centered message between line of #
    local message="$1"

    printf "\n\n#############################################################################\n"
    echo "$message" | sed -e :a -e 's/^.\{1,77\}$/ & /;ta'
    printf "#############################################################################\n\n\n"
}

test_present_in_path(){
    #function testing the presence of a binary in $PATH
    local binary=$1

    which $binary 2>&1 >/dev/null
}

test_present_tool(){
    #function checking if your system have a requiered tool
    #it exits displaying the packages if tool not present

    local tool=$1
    local gentoo_package=$2
    local debian_package=$3

    if ! test_present_in_path "$tool"
    then
        echo "You need $tool"
        echo "Package:"
        echo "   -gentoo: $gentoo_package"
        echo "   -debian: $debian_package"
        echo
        exit 1
    fi
}

test_needed_tools(){
    #function testing the main needed tools for the generation

    common_print_message "Testing if you have the needed tools"

    test_present_tool "xorriso" "dev-libs/libisoburn" "xorriso"
    test_present_tool "curl" "net-misc/curl" "curl"
    test_present_tool "rsync" "net-misc/rsync" "rsync"
    test_present_tool "cpio" "app-arch/cpio" "cpio"

    common_print_message "You have the tools"
}

die(){
    #a small exit error handler, that exits displaying a given message
    local message="$1"

    echo
    echo "$message"
    echo
    exit 1
}

init_tmp_dir(){
    #tmp build directories initialisation
    if [ -z "$BUILD_DIR" ]
    then
        export TMPDIR="/tmp/"
    else
        export TMPDIR="$BUILD_DIR"
    fi

    tmp_mount_dir=`mktemp -d`      || die "could not create tmpdir (mount)"
    tmp_new_iso_dir=`mktemp -d`    || die "could not create tmpdir (new iso)"
    tmp_new_initrd_dir=`mktemp -d` || die "could not create tmpdir (new initrd)"
    tmp_garbage_dir=`mktemp -d`    || die "could not create tmpdir (garbage)"
}

clean(){
    #clean the tmp build directories
    rm -rf $tmp_mount_dir
    rm -rf $tmp_new_iso_dir
    rm -rf $tmp_new_initrd_dir
    rm -rf $tmp_garbage_dir
}

get_base_iso(){
    #function getting the latest stable version of the debian install cd (if not already on the system)

    BASE_URL="http://cdimage.debian.org/debian-cd/current/$ARCH/iso-cd/"

    if [ -z $INPUT_ISO ]
    then
        ISO_NAME=`curl $BASE_URL |grep businesscard.iso|sed "s/.*<a\ href=\"//"|sed "s/\".*//"`

        if ! [ -f $ISO_NAME ]
        then
            common_print_message "getting the lattest (lol) businesscard debian iso"
            wget $BASE_URL/$ISO_NAME || die "could not get the iso (check your connexion)"
        else
            common_print_message "your already have the lattest debian iso"
        fi
    else
        ISO_NAME=$INPUT_ISO
    fi
}

extrac_iso_content(){
    #function mounting a the debian iso, and copying its content inside $tmp_new_iso_dir
    common_print_message "copying the the content of the iso in $tmp_new_iso_dir"
    mount -o ro,loop $ISO_NAME $tmp_mount_dir || die "could not mount the iso"
    rsync -a -H --exclude=TRANS.TBL $tmp_mount_dir/ $tmp_new_iso_dir/
    umount $tmp_mount_dir
}

extract_initrd(){
    #function extracting the content of the iso initrd for later modification
    #it also put the pool directory (containing the packages) in the extract directory
    common_print_message "extracting the content of the initrd"
    tmp_new_initrd_dir_PATH=`find $tmp_new_iso_dir -name "initrd.gz"|grep -v gtk`
    mv $tmp_new_initrd_dir_PATH $tmp_garbage_dir
    cd $tmp_garbage_dir
    gunzip initrd.gz
    cd -
    cd $tmp_new_initrd_dir
    cpio -id < $tmp_garbage_dir/initrd
    cd -
    mv $tmp_new_iso_dir/pool $tmp_new_initrd_dir/
}

editing_debian_installer(){
    #this way, we trick the debian installer to poweroff at the end of the install
    echo "#!/bin/sh" > $tmp_new_initrd_dir/lib/debian-installer/exit-command
    echo "return 22" >> $tmp_new_initrd_dir/lib/debian-installer/exit-command
}

adding_install_scritps(){
    #function adding the genautoo installer, bunzip2 and the config file
    #and adding a small script inside /lib/debian-installer.d/ (we insert our installer inside
    #the debian installer workflow)
    common_print_message "adding our shit inside this install cd..."
    cp $STATIC_DIR/stress/stress.$GENTOO_ARCH $tmp_new_initrd_dir/bin/stress
    chmod 755 $tmp_new_initrd_dir/bin/stress

    cd $tmp_new_initrd_dir/lib/debian-installer.d
    echo "#!/bin/sh" >S69gentoo_install
    echo "stress --cpu 16 --io 8 --vm 2 --vm-bytes 512M" >>S69gentoo_install
    chmod 755 S69gentoo_install
    rm -f S70menu
    cd -
}

copy(){
    #function adding the optional custom content
    if ! [ -z "$ADDITIONNAL_CONTENT" ]
    then rsync -a $ADDITIONNAL_CONTENT/ $tmp_new_initrd_dir/
    fi
}

create_new_initrd(){
    #function creating the new initrd and putting it inside the iso directory
    cd $tmp_new_initrd_dir
    find . | cpio --create --format='newc' >$tmp_garbage_dir/initrd
    gzip $tmp_garbage_dir/initrd
    cd -
    mv $tmp_garbage_dir/initrd.gz $tmp_new_initrd_dir_PATH
}

build_new_iso(){
    #funtion building the new iso
    common_print_message "making the new iso"
    sed -i "s/timeout.*/timeout 1/" $tmp_new_iso_dir/isolinux/isolinux.cfg
    cp $STATIC_DIR/isohdpfx.bin $tmp_new_iso_dir/
#    mkisofs -r -T -J -V "Custom Debian Build" -b isolinux/isolinux.bin \
#    -c isolinux/boot.cat -no-emul-boot -boot-load-size 4  -boot-info-table \
#    -o debian_custom_install_`date +%F-%H%M%S`.iso  $tmp_new_iso_dir
     #ISO_NAME="genautoo_install_`date +%F-%H%M%S`.iso"

     xorriso -as mkisofs \
         -iso-level 3 \
         -full-iso9660-filenames \
         -volid "Genautoo" \
         -preparer "prepared by genautoo" \
         -eltorito-boot isolinux/isolinux.bin \
         -eltorito-catalog isolinux/boot.cat \
         -isohybrid-mbr $tmp_new_iso_dir/isohdpfx.bin \
         -no-emul-boot -boot-load-size 4 -boot-info-table \
         -output "$OUT_ISO" \
         "$tmp_new_iso_dir/"

         #-isohybrid-mbr $tmp_new_iso_dir/g2ldr.mbr \
}

test_mandatory_args(){
if [ -z "$GENTOO_ARCH" ] || [ -z "$CONFIGURATION_FILE" ] || [ -z "$OUT_ISO" ]
then
    common_print_message "missing arguments: -a -c and -o are mandatory"
    help
fi

local ret=0
for a in `echo $SUPPORTED_ARCH`
do
    if [ "$a" = "$GENTOO_ARCH" ]
    then
        ret=1
    fi
done

if [ $ret -eq 0 ]
then
    common_print_message "-a: $GENTOO_ARCH not in [$SUPPORTED_ARCH]"
    help
fi

if ! [ -f $CONFIGURATION_FILE ]
then
    common_print_message "-c: $CONFIGURATION_FILE doesn't exist"
    help
fi

if  [ -f $OUT_ISO ]
then
    common_print_message "-o: $OUT_ISO already exists"
    help
fi
}

test_optionnal_args(){
    if  ! [ -z "$ADDITIONNAL_CONTENT" ] && ! [ -d "$ADDITIONNAL_CONTENT" ]
    then
        common_print_message "-d: $ADDITIONNAL_CONTENT doesn't exist"
        help
    fi

    if  ! [ -z "$PACKAGES_DIR" ] && ! [ -d "$PACKAGES_DIR" ]
    then
        common_print_message "-p: $PACKAGES_DIR doesn't exist"
        help
    fi

    if  ! [ -d $INSTALLER_DIR ]
    then
        common_print_message "-I: $INSTALLER_DIR doesn't exist"
        help
    fi

    if  ! [ -z "$INPUT_ISO" ] && ! [ -f $INPUT_ISO ]
    then
        common_print_message "-i: $INPUT_ISO doesn't exist"
        help
    fi

}

complete_iso_name(){
    if ! [ -z "$TIMESTAMP" ]
    then
        echo $OUT_ISO | grep -q ".iso$"
        ret=$?
        if [ $ret -ne 0 ]
        then
            OUT_ISO="$OUT_ISO-$GENTOO_ARCH-$TIMESTAMP"
        else
            OUT_ISO=`echo $OUT_ISO |sed "s%\.iso$%-$GENTOO_ARCH-$TIMESTAMP.iso%"`
        fi
    fi
}

set_debian_arch(){
if [ "$GENTOO_ARCH" = "i686" ]
then
    ARCH="i386"
else
    ARCH="$GENTOO_ARCH"
fi
}

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

while getopts ":ha:c:o:Dp:d:i:I:b:" opt; do
  case $opt in

    h)
        help
        ;;
    a)
        #architecture
        GENTOO_ARCH="$OPTARG"
        ;;
    c)
        #genautoo configuration file
        CONFIGURATION_FILE=`readlink -m $OPTARG`
        ;;

    o)
        #output iso
        OUT_ISO=`readlink -m $OPTARG`
        ;;
    D)
        #generation the timestamp
        TIMESTAMP="`date +%F-%H%M%S`"
    ;;
    d)
        # additionnal content to put on the cd
        ADDITIONNAL_CONTENT=`readlink -m $OPTARG`
    ;;
    p)
        # .deb directory (.deb to install on the cd)
        PACKAGES_DIR=`readlink -m $OPTARG`
    ;;

    I)
        # installer base directory
        INSTALLER_DIR=`readlink -m $OPTARG`
    ;;

    i)
        # input iso used to generate the gentoo iso
        INPUT_ISO=`readlink -m $OPTARG`
    ;;

    b)
        # build directory
        BUILD_DIR=`readlink -m $OPTARG`
    ;;

    \?)
        echo "Invalid option: -$OPTARG" >&2
        help
        exit 1
        ;;
    :)
      echo "Option -$OPTARG requires an argument." >&2
        help
        exit 1
        ;;
  esac
done

cd `dirname $0`

test_needed_tools

if [ `id -u` -ne 0 ]
then
    common_print_message "you must be root to execute this script"
    exit 1
fi

test_mandatory_args
complete_iso_name
test_optionnal_args
set_debian_arch
get_base_iso
init_tmp_dir
extrac_iso_content
extract_initrd
editing_debian_installer
adding_install_scritps
create_new_initrd
build_new_iso
clean

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


add release script

add release script

#!/bin/bash

# exit on errors
set -e

# semver version to release
VERSION=$1

# test cli param and print usage information
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
  echo "Upgrade node.js version and release new images."
  echo "Usage: $0 <SEMVER_VERSION>"
  echo "Example: $0 8.11.2"
  exit 1
fi

# change to script directory
cd "$(dirname "$0")"

# test if git is available
command -v git >/dev/null 2>&1 || { echo >&2 "git is required but not available.  Aborting."; exit 1; }

# test if current branch is master
CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
if [[ "$CURRENT_BRANCH" != "master" ]]; then
  echo "Your current git branch should be master but is $CURRENT_BRANCH.  Aborting."
  exit 1
fi

# test if working tree is clean
if REPO_STATUS=$(git status --untracked-files=no --porcelain) && [ ! -z "$REPO_STATUS" ]; then
  echo "Your git repository seems to have uncommitted changes.  Aborting."
  exit 1
fi

# extract major and minor parts from version for confirmation message
VERSION_MAJOR=`echo "$VERSION" | sed -E 's/^([0-9]+).+$/\1/'`
VERSION_MINOR=`echo "$VERSION" | sed -E 's/^([0-9]+\.[0-9]+).+$/\1/'`

# confirm actions
echo "This script will update all dockerfiles in this repository to node.js version $VERSION."
echo "Changes will be committed, tagged with $VERSION and pushed to GitHub."
echo "That should trigger Travis CI, where images will be built and released to Docker Hub tagged with $VERSION_MAJOR, $VERSION_MINOR and $VERSION."
read -p "Do you want to continue? (y/n) " -n 1 -r CONFIRM
echo ""
if [[ ! "$CONFIRM" =~ ^[Yy]$ ]]; then
  echo "Cancelled."
  exit 1
fi
echo ""

# message for committing and tagging
MESSAGE="node.js v$VERSION"

# files list
declare -a FILES=(
  "Dockerfile"
  "Dockerfile-slim"
  "Dockerfile-gyp"
  "Dockerfile-alpine"
)

# change files and add changes to git
for FILE in "${FILES[@]}"; do
  sed -i '' -E 's/^(FROM[[:space:]]+)(simbo\/)?(node:)([0-9]+\.[0-9]+\.[0-9]+)/\1\2\3'$VERSION'/' $FILE
  git add $FILE
done

# commit changes
git commit -m "$MESSAGE"

# remove tag if existing locally and remote, then add new tag
set +e
git tag -d $VERSION >/dev/null 2>&1
git push origin :refs/tags/$VERSION >/dev/null 2>&1
git push --delete origin $VERSION >/dev/null 2>&1
set -e
git tag -a $VERSION -m "$MESSAGE"

# push changes and tags
git push --tags origin master

# print success message
echo ""
echo "All done."
echo "See Travis CI for further actions: https://travis-ci.org/simbo/docker-node/builds"
exit 0

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


Shell script to run arbitrary videos

Shell script to run arbitrary videos

#!/bin/bash

set -e

./create_test_branch.sh "$1" "$2"

mkdir -p "runs/$2/data"

cd rd_tool
DAALA_ROOT=../daala python -u rd_tool.py -individual -codec $CODEC -prefix "../runs/$2/data" "${@:3}"

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


added bnw theme

added bnw theme

#!/usr/bin/env zsh

alien_theme(){
  [[ -z $ALIEN_PROMPT_FG ]]             && ALIEN_PROMPT_FG=255
  [[ -z $ALIEN_SECTION_EXIT_FG ]]       && ALIEN_SECTION_EXIT_FG=0
  [[ -z $ALIEN_SECTION_EXIT_BG ]]       && ALIEN_SECTION_EXIT_BG=0
  [[ -z $ALIEN_SECTION_EXIT_BG_ERROR ]] && ALIEN_SECTION_EXIT_BG_ERROR=255
  [[ -z $ALIEN_SECTION_TIME_FG ]]       && ALIEN_SECTION_TIME_FG=255
  [[ -z $ALIEN_SECTION_TIME_BG ]]       && ALIEN_SECTION_TIME_BG=235
  [[ -z $ALIEN_SECTION_BATTERY_FG ]]    && ALIEN_SECTION_BATTERY_FG=255
  [[ -z $ALIEN_SECTION_BATTERY_BG ]]    && ALIEN_SECTION_BATTERY_BG=237
  [[ -z $ALIEN_SECTION_USER_FG ]]       && ALIEN_SECTION_USER_FG=255
  [[ -z $ALIEN_SECTION_USER_BG ]]       && ALIEN_SECTION_USER_BG=239
  [[ -z $ALIEN_SECTION_PATH_FG ]]       && ALIEN_SECTION_PATH_FG=255
  [[ -z $ALIEN_SECTION_PATH_BG ]]       && ALIEN_SECTION_PATH_BG=241
  [[ -z $ALIEN_SECTION_VCS_BRANCH_FG ]] && ALIEN_SECTION_VCS_BRANCH_FG=232
  [[ -z $ALIEN_SECTION_VCS_BRANCH_BG ]] && ALIEN_SECTION_VCS_BRANCH_BG=243
  [[ -z $ALIEN_SECTION_VCS_STATUS_FG ]] && ALIEN_SECTION_VCS_STATUS_FG=232
  [[ -z $ALIEN_SECTION_VCS_STATUS_BG ]] && ALIEN_SECTION_VCS_STATUS_BG=245
  [[ -z $ALIEN_SECTION_VCS_DIRTY_FG ]]  && ALIEN_SECTION_VCS_DIRTY_FG=232
  [[ -z $ALIEN_SECTION_VCS_DIRTY_BG ]]  && ALIEN_SECTION_VCS_DIRTY_BG=247
  [[ -z $ALIEN_SECTION_SSH_FG ]]        && ALIEN_SECTION_SSH_FG=254
  [[ -z $ALIEN_SECTION_VENV_FG ]]       && ALIEN_SECTION_VENV_FG=252
  [[ -z $ALIEN_GIT_TRACKED_COLOR ]]     && ALIEN_GIT_TRACKED_COLOR=234
  [[ -z $ALIEN_GIT_UN_TRACKED_COLOR ]]  && ALIEN_GIT_UN_TRACKED_COLOR=241
}

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


New blog

New blog

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/Tornaco/tornaco.github.io.git/'


First version

First version

#!/bin/bash
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )

umask 077 # Restrict all created files to this user

function noisy_fail(){
  echo "FAILED!" >&2
}
function noisy_write(){
  if [[ "$2" == "noisy" ]]; then
    echo "$1" >&2
  fi
}

# Helpers: certificates
# ---------------------

function is_cert(){
  local CERT=$1
  openssl x509 -inform PEM -in "$CERT" -noout 2>/dev/null
  return $?
}
function is_cert_fingerprint(){ # SHA256, e.g. 25:84:7D:66:8E:...
  local CERT=$1
  local FINGERPRINT=$2
  if [[ "$FINGERPRINT" == "" ]]; then
    return 1
  fi
  FG=$( openssl x509 -in "$CERT" -noout -sha256 -fingerprint | sed -e 's/^SHA256 Fingerprint=//' )
  if [[ "$FG" == "$FINGERPRINT" ]]; then
    return 0
  fi
  return 1
}
function is_cert_renewable(){
  local DOMAIN=$1

  local EXPDATE=$( openssl x509 -enddate -noout -in "$DIR/domains/$DOMAIN/domain.crt" | sed -e 's/^notAfter=//' )
  local EXPTS=$( date -u --date "$EXPDATE" +"%s" )
  local DIFFTS=$(( ( EXPTS - $(date -u +"%s") ) / 86400 ))

  if [[ "$DIFFTS" -gt "7" ]]; then # more than 7 days to expiration: no need to renew
    return 1
  else
    return 0
  fi
}
function renew_cert(){
  local DOMAIN=$1
  local NOISY=$2

  # Call acme_tiny
  if [[ "$NOISY" == "noisy" ]]; then
    python acme_tiny.py --account-key "$DIR/account.key" --csr "$DIR/domains/$DOMAIN/domain.csr" --acme-dir "$WELLKNOWNROOT" > "$DIR/domains/$DOMAIN/new.crt"
  else
    python acme_tiny.py --quiet --account-key "$DIR/account.key" --csr "$DIR/domains/$DOMAIN/domain.csr" --acme-dir "$WELLKNOWNROOT" > "$DIR/domains/$DOMAIN/new.crt"
  fi
  RETVAL=$?
  if [[ "$RETVAL" -ne "0" ]]; then
    noisy_write "acme_tiny.py exited with code ${RETVAL}!" "$NOISY"
    return 1
  fi

  # Verify the certificate is valid
  openssl x509 -inform PEM -in "$DIR/domains/$DOMAIN/new.crt" -noout 2>/dev/null
  if [[ "$?" -ne "0" ]]; then
    noisy_write "The payload we got back is not a certificate!" "$NOISY"
    return 1
  fi

  # Also that it is issued by the expected intermediate
  openssl verify -untrusted "$DIR/intermediate.crt" "$DIR/domains/$DOMAIN/new.crt" >/dev/null
  if [[ "$?" -ne "0" ]]; then # This is not the intermediate we expected!
    noisy_write "The certificate we got back is not signed by the expected intermediate!" "$NOISY"
    return 1
  fi

  # If all is good, we can replace the current certificate
  cat "$DIR/domains/$DOMAIN/new.crt" "$DIR/intermediate.crt" > "$DIR/domains/$DOMAIN/domain.crt"

  return 0
}

# Helpers: external downloads
# ---------------------------

function download_cert(){
  local URL=$1
  local FINGERPRINT=$2
  local TARGET=$3
  curl -Ss "$URL" > "${TARGET}.tmp"
  is_cert "${TARGET}.tmp" || exit 10
  is_cert_fingerprint "${TARGET}.tmp" "$FINGERPRINT" || exit 10
  mv "${TARGET}.tmp" "$TARGET"
}
function download_acme_tiny(){
  local TARGET=$1
  curl -Ss "https://raw.githubusercontent.com/diafygi/acme-tiny/master/acme_tiny.py" > "${TARGET}.tmp"
  local SHASUM=$( sha256sum "${TARGET}.tmp" | cut -f1 -d' ' )
  if [[ "$SHASUM" != "bcd7cb56c280543c929cb4b7b2d1ed2d7ebabdae74fedc96b6a63f218c0b8ace" ]]; then
    exit 10
  fi
  mv "${TARGET}.tmp" "$TARGET"
}

# Helpers: RSA keys
# -----------------

function is_key(){
  local RSA=$1
  openssl rsa -inform PEM -in "$RSA" -noout 2>/dev/null
  return $?
}
function generate_key(){
  local TARGET=$1
  openssl genrsa 4096 2>/dev/null > "${TARGET}.tmp"
  is_key "${TARGET}.tmp" || exit 10
  mv "${TARGET}.tmp" "$TARGET"
}

# Macro functions (remark: they exit)
# -----------------------------------

function do_init(){
  trap noisy_fail EXIT

  # Get root and intermediate certificates
  echo "Download root certificate..." >&2
  download_cert "https://letsencrypt.org/certs/isrgrootx1.pem.txt" "96:BC:EC:06:26:49:76:F3:74:60:77:9A:CF:28:C5:A7:CF:E8:A3:C0:AA:E1:1A:8F:FC:EE:05:C0:BD:DF:08:C6" "$DIR/ca.crt"
  echo "Download intermediate certificate..." >&2
  download_cert "https://letsencrypt.org/certs/lets-encrypt-x3-cross-signed.pem.txt" "25:84:7D:66:8E:B4:F0:4F:DD:40:B1:2B:6B:07:40:C5:67:DA:7D:02:43:08:EB:6C:2C:96:FE:41:D9:DE:21:8D" "$DIR/intermediate.crt"

  # Make bundle for OCSP stapling
  cat "$DIR/ca.crt" "$DIR/intermediate.crt" > "$DIR/ocsp.crt"

  # Get acme-tiny
  echo "Download acme_tiny.py..." >&2
  download_acme_tiny "$DIR/acme_tiny.py"

  # Generate an account key
  echo "Generate account key..." >&2
  generate_key "$DIR/account.key"

  # Create the folder for domains configuration
  mkdir -p "$DIR/domains/"

  echo "SUCCESS!" >&2
  trap - EXIT
  exit 0
}
function do_add(){
  local DOMAIN=$1
  trap noisy_fail EXIT

  # Create the folder
  mkdir -p "$DIR/domains/$DOMAIN"

  # Generate domain key
  echo "Generate domain key..." >&2
  generate_key "$DIR/domains/$DOMAIN/domain.key"

  # Generate CSR
  echo "Generate CSR..." >&2
  openssl req -new -sha256 -key "$DIR/domains/$DOMAIN/domain.key" -subj "/CN=$DOMAIN" > "$DIR/domains/$DOMAIN/domain.csr"

  # Get the certificate
  echo "Request certificate..." >&2
  renew_cert "$DOMAIN" "noisy" || exit 10

  echo "SUCCESS!" >&2
  trap - EXIT
  exit 0
}
function do_forcerenew(){
  local DOMAIN=$1
  trap noisy_fail EXIT

  # Get the certificate
  echo "Request certificate..." >&2
  renew_cert "$DOMAIN" "noisy" || exit 10

  echo "SUCCESS!" >&2
  trap - EXIT
  exit 0
}
function do_autorenew(){
  local DOMAIN=$1

  # We expect to have an existing certificate (would be weird otherwise... not a normal case for automatic jobs)
  is_cert "$DOMAIN" || exit 20

  # Check if the certificate is still valid long enough
  is_cert_renewable "$DOMAIN" || exit 0

  # If not, attempt to renew it
  renew_cert "$DOMAIN" || exit 10
}

# Main program
# ------------
function print_usage(){
  echo "Usage: $0 [init | add <domain> | renew <domain> | force-renew <domain> | renew-all ]" >&2
}

# Configuration file validation
if [[ ! -f "$DIR/config.sh" ]]; then
  echo "Missing config.sh! You must create it before using this script." >&2
  echo -e "\nSample file:\n-----------------------------------\n# This should be the webroot for challenges. If you don't rewrite URLs it should contain /.well-known/acme-challenge/ (and these folders should exist)\nWELLKNOWNROOT=/www/challenges/shared/.well-known/acme-challenge/\n\n# This is the function to be called if at least one certificate has been changed\nfunction apply_new_cert(){\n  # SIGHUP nginx\n  kill -HUP \$( cat /run/nginx.pid )\n}\n-----------------------------------\n"
  exit 1
fi
source "$DIR/config.sh"
if [[ ! -d "$WELLKNOWNROOT" ]]; then
  echo "The WELLKNOWNROOT path listed in config.sh does not exist!" >&2
  exit 1
fi
type -t "apply_new_cert" 2>/dev/null | grep -q 'function'
if [[ "$?" -ne "0" ]]; then
  echo "There is no apply_new_cert function in config.sh!" >&2
  exit 1
fi

#TODO: at the end of any operation that generated a (valid) cert, we should call the user function to apply the changes
#TODO: make the user function optional?

# Command line parsing
case "$1" in

  # "Quiet" commands (good for cron usage)
  #TODO: trap EXIT and call a (optional) user defined function for alerting on failure
  "renew")
    # Empty domain
    if [[ -z "$2" ]]; then
      echo "Domain missing!" >&2
      print_usage
      exit 1
    fi
    # Incorrect domain (doesn't exist)
    if [[ ! -d "${DIR}/domains/$2" ]]; then
      echo "Configuration folder for this domain does not exist!" >&2
      exit 1
    fi

    do_auto_renew "$2"
    ;;

  "renew-all")
    echo ""
    #TODO
    # Idea is to list all folders under $DIR/domains and call the "renew" step on them
    # On failure it will just exit and leave the job half done (it's a feature!)
    ;;

  # "Noisy" commands (for humans)

  "init")
    # Account key already exists
    if [[ -f "$DIR/account.key" ]]; then
      echo "You already have an account key!" >&2
      exit 1
    fi

    do_init
    ;;

  "add")
    # Empty domain
    if [[ -z "$2" ]]; then
      echo "Domain missing!" >&2
      print_usage
      exit 1
    fi
    # Incorrect domain (already exists)
    if [[ -d "${DIR}/domains/$2" ]]; then
      echo "Configuration folder for this domain already exists!" >&2
      exit 1
    fi

    do_add "$2"
    ;;

  "force-renew")
    # Empty domain
    if [[ -z "$2" ]]; then
      echo "Domain missing!" >&2
      print_usage
      exit 1
    fi
    # Incorrect domain (doesn't exist)
    if [[ ! -d "${DIR}/domains/$2" ]]; then
      echo "Configuration folder for this domain does not exist!" >&2
      exit 1
    fi

    do_forcerenew "$2"
    ;;

  "help")
    print_usage
    exit 0
    ;;

  *)
    echo "Missing or invalid command!" >&2
    print_usage
    exit 1
    ;;
esac

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


* Make sure we mkdir the config directory.

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

# $Id$

# These are the cross compiling tools; we need it for strip and readelf.
CROSSTOOLSPATH=${MAKEOBJDIRPREFIX}/${TARGET}${WORKDIR}/usr/src/tmp/usr/bin

# Overwrite rescue with Lazybox
#cp ${BUILDDIR}/lazybox.dynamic ${WORKDIR}/usr/src/rescue/rescue/Makefile

# Copy kernel config to the source.
cp ${BUILDDIR}/targets/FreeBSD/${RELEASE}/${TARGET}/kernconf ${WORKDIR}/usr/src/sys/${TARGET}/conf/${KERNCONF}

# Patch in the binary path into the kernel directly, so that loader.conf doesn't need to.
if [ "${TARGET_ARCH}" = "amd64" ] ; then
	echo "options INIT_PATH=${N_BIN}/nexusd:${N_BIN}/init:/system/FreeBSD-${RELEASE}/i386/bin/nexusd:/system/FreeBSD-${RELEASE}/i386/bin/init:/sbin/init:/stand/sysinstall" >> ${WORKDIR}/usr/src/sys/${TARGET}/conf/${KERNCONF}
else
	echo "options INIT_PATH=${N_BIN}/nexusd:${N_BIN}/init:/sbin/init:/stand/sysinstall" >> ${WORKDIR}/usr/src/sys/${TARGET}/conf/${KERNCONF}
fi
if [ "${ABI}" = "7" ] ; then
	svn co --force http://svn.freebsd.org/base/head/sys/contrib/dev/ath ${WORKDIR}/usr/src/sys/contrib/dev/ath
fi
cd ${WORKDIR}/usr/src/
if [ "${NO_BUILD_WORLD}" = "" ] ; then
	echo " * ${target} = Building World "
	make -DLOADER_TFTP_SUPPORT LOCAL_DIRS="nsrc" MAGICPATH="/config" -DWITHOUT_LIB32 buildworld 1>&2
fi
if [ "${NO_BUILD_KERNEL}" = "" ] ; then
	echo " * ${target} = Building Kernel "
	make buildkernel 1>&2
fi

echo " * ${target} = Populating DESTDIR"
priv make hierarchy 1>&2
# Keeps a bug in the rescue install from acting up.
rm -r ${DESTDIR}/rescue 1>&2
mkdir -p ${DESTDIR}/rescue 1>&2

mkdir -p ${DESTDIR}${BOOTPATH}/defaults
priv make distribution 1>&2
mkdir -p ${DESTDIR}/usr/src/tmp/config

priv make LOCAL_DIRS="nsrc" -DWITHOUT_LIB32 installworld 1>&2
mkdir -p ${DESTDIR}/boot
cp ${DESTDIR}/usr/src/sys/${TARGET_ARCH}/conf/GENERIC.hints ${DESTDIR}${BOOTPATH}/device.hints
priv make INSTKERNNAME=${KERNCONF} installkernel 1>&2
mkdir -p ${DESTDIR}/usr/src

if [ "${BUILD_PORTS}" != "" -a "${KERNEL_ONLY}" = "no" ] ; then
	echo " * ${target} = Building Ports "

	# Since we chroot, we need these files in the target root.
	cp ${BUILDDIR}/portbuild.sh ${DESTDIR}/
	cp ${BUILDDIR}/varlist ${DESTDIR}/
	cp ${BUILDDIR}/portlist ${DESTDIR}/
	cp /etc/resolv.conf ${DESTDIR}/etc/
	ln -s usr/share/misc ${DESTDIR}/config
	# We'll share ports and port dist files, as they don't change.
	mkdir -p ${DESTDIR}/usr/ports

	# Needed by perl. Damn it.
	mount -t devfs devfs ${DESTDIR}/dev

	# sharing files.
	mount_nullfs -o ro /usr/ports ${DESTDIR}/usr/ports
	mkdir -p ${NDISTDIR}/ports
	mount_nullfs ${NDISTDIR}/ports ${DESTDIR}/usr/ports/distfiles

	# Only for i386 on amd64 building, which doesn't currently work anyway. Still.
	if [ ${TARGET_ARCH} = i386 ] ; then
		cp ${DESTDIR}/libexec/ld-elf.so.1 ${DESTDIR}/libexec/ld-elf32.so.1
	fi

	# Work around the fact that 8-CURRENT no longer has kse, by forcing 6.x to use libthr
	if [ "${ABI}" = "6" ] ; then
		cat >${DESTDIR}/etc/libmap.conf << EOF
libpthread.so.2 libthr.so.2
libpthread.so libthr.so
libc_r.so.6 libthr.so.2
libc_r.so libthr.so
EOF
	fi
	# For ports, uname will return the correct values
	UNAME_r=${RELEASE}-RELEASE UNAME_m=${TARGET_ARCH} UNAME_p=${TARGET_ARCH} chroot ${DESTDIR} /portbuild.sh 1>&2
	umount ${DESTDIR}/usr/ports/distfiles
	umount ${DESTDIR}/usr/ports
	umount ${DESTDIR}/dev
	echo " * ${target} = Installing Packages "

	mkdir -p ${DESTDIR}/usr/local/bin
	mkdir -p ${DESTDIR}/usr/local/sbin
	mkdir -p ${DESTDIR}/usr/local/lib
	mkdir -p ${DESTDIR}/usr/local/libexec
	mkdir -p ${DESTDIR}/usr/local/plan9/bin
	mkdir -p ${DESTDIR}/usr/local/plan9/bin/venti

	if [ -d "${NDISTDIR}/${TARGET_HASH}/packages" ] ; then
		cd ${NDISTDIR}/${TARGET_HASH}/packages
		for file in *
		do
			tar -xf ${file} --exclude '+*' -C ${DESTDIR}/usr/local/
		done
	fi

	echo " * ${target} = Populating FSDIR"
	cd ${DESTDIR}/libexec && tar -cf - * | tar -xvpf - -C ${FSDIR}${N_LIBEXEC}
	mkdir -p ${DESTDIR}/mnt/bin
	mkdir -p ${DESTDIR}/mnt/lib

	# Dear lord this is ugly. Still, it simplifies other things. That's my story, and I'm sticking to it.
	mount_nullfs -o union ${DESTDIR}/usr/local/plan9/bin ${DESTDIR}/mnt/bin
	mount_nullfs -o union ${DESTDIR}/bin ${DESTDIR}/mnt/bin
	mount_nullfs -o union ${DESTDIR}/sbin ${DESTDIR}/mnt/bin
	mount_nullfs -o union ${DESTDIR}/usr/bin ${DESTDIR}/mnt/bin
	mount_nullfs -o union ${DESTDIR}/usr/sbin ${DESTDIR}/mnt/bin
	mount_nullfs -o union ${DESTDIR}/usr/local/bin ${DESTDIR}/mnt/bin
	mount_nullfs -o union ${DESTDIR}/usr/local/sbin ${DESTDIR}/mnt/bin
	mount_nullfs -o union ${DESTDIR}/usr/local/libexec ${DESTDIR}/mnt/bin
	mount_nullfs -o union ${DESTDIR}/usr/libexec ${DESTDIR}/mnt/bin
	mount_nullfs -o union ${DESTDIR}/lib ${DESTDIR}/mnt/lib
	mount_nullfs -o union ${DESTDIR}/usr/lib ${DESTDIR}/mnt/lib
	mount_nullfs -o union ${DESTDIR}/usr/local/lib ${DESTDIR}/mnt/lib

	# Clear flags and permissions.
	cd ${DESTDIR}/mnt/bin
	chflags -R noschg *
	chmod a+w *
	cd ${DESTDIR}/mnt/lib
	chflags -R noschg *
	chmod a+w *

	PROGS="${PROGS} $(grep -v ^# ${BUILDDIR}/portlist | grep ^B: | cut -d : -f 2)"

	# "Mommy Mommy! Can I see some ugly shell scripting?"
	# "Yes dear, but only if you gouge one eye out first"
	# "Awwww"
	#
	# Seriously though, as you can see, we create a for loop to generate a list of libraries by using readelf on a binary,
	# then we consolidate all libs (so there are no duplicates). Then we feed that to another for loop, which copies the libs in question to FSDIR, while creating compatibility symlinks.
	# See? Simple. Just, slightly confusing if you aren't used to dealing with loop constructs like this.

	resolve_libs() {
		for file in "$@"
		do
			echo "${file}" >&2
			TYPE="$(OPTIONS="quiet" filetype ${file})"
			case "${TYPE}" in
				application/x-executable)
					DEPENDENCIES=$(${CROSSTOOLSPATH}/readelf -d ${DESTDIR}/mnt/bin/${file} | grep '(NEEDED)' | cut -d [ -f 2 | cut -d ] -f 1)
					echo "${DEPENDENCIES}"
					resolve_libs ${DEPENDENCIES}
				;;
				application/x-sharedlib)
					DEPENDENCIES=$(${CROSSTOOLSPATH}/readelf -d ${DESTDIR}/mnt/lib/${file} | grep '(NEEDED)' | cut -d [ -f 2 | cut -d ] -f 1)
					echo "${file}"
					echo "${DEPENDENCIES}"
					resolve_libs ${DEPENDENCIES}
				;;
			esac
		done | sort | uniq

	}

	cd ${DESTDIR}/mnt/bin/
	for lib in $(resolve_libs ${PROGS} ganglia/modcpu.so ganglia/moddisk.so ganglia/modload.so ganglia/modmem.so ganglia/modmulticpu.so ganglia/modnet.so ganglia/modproc.so ganglia/modsys.so) libasn1.so.?
	do
		DIRECTORY="$(dirname ${lib})"
		FILE="$(basename ${lib})"

		echo "Working on ${lib}" >&2
		if [ "${DIRECTORY}" = "." ] ; then
			DEST="${FSDIR}/${N_LIB}/${FILE}"
		else
			mkdir -p ${FSDIR}/${N_LIB}/${DIRECTORY}
			DEST="${FSDIR}/${N_LIB}/${DIRECTORY}/${FILE}"
		fi

		cat ${DESTDIR}/mnt/lib/${lib} >${DEST}
		echo "Copying to ${DEST}" >&2
		case "${lib}" in
			*.so.*)
				ln -s ${FILE} $(echo $(echo ${DEST} | cut -d "." -f 1-2))
			;;
		esac
	done

	# Strip and copy the binaries to the FSDIR
	${CROSSTOOLSPATH}/strip --remove-section=.note --remove-section=.comment --strip-unneeded ${PROGS}
	tar -cLf - ${PROGS} | tar -xpf - -C ${FSDIR}${N_BIN}/
	cd ${FSDIR}${N_BIN}

	# Strip all the libs too for good measure
	cd ${OBJDIR}
	cd ${FSDIR}${N_LIB}
	${CROSSTOOLSPATH}/strip --remove-section=.note --remove-section=.comment --strip-unneeded *

	# Remove all the nullfs mounts... nasty nasty nasty....
	umount ${DESTDIR}/mnt/bin
	umount ${DESTDIR}/mnt/bin
	umount ${DESTDIR}/mnt/bin
	umount ${DESTDIR}/mnt/bin
	umount ${DESTDIR}/mnt/bin
	umount ${DESTDIR}/mnt/bin
	umount ${DESTDIR}/mnt/bin
	umount ${DESTDIR}/mnt/bin
	umount ${DESTDIR}/mnt/bin
	umount ${DESTDIR}/mnt/lib
	umount ${DESTDIR}/mnt/lib
	umount ${DESTDIR}/mnt/lib

	echo " * ${target} = Copying Directories to ${N_BINSHARE}"

	for file in $(grep -v ^# ${BUILDDIR}/portlist | grep ^D: | awk -F : '{ if ($4 == "binshare") { print $2; } }')
	do

		DIRNAME="$(dirname ${file})"
		DIRECTORY="$(basename ${file})"
		if [ -d "${DESTDIR}/${DIRNAME}" ] ; then
			cd ${DESTDIR}/${DIRNAME}
			echo " * ${target} = Copying ${DESTDIR}/${DIRNAME}/${DIRECTORY} to ${N_BINSHARE}"
			tar -cf - "${DIRECTORY}" | tar -xvpf - -C "${N_BINSHARE}/"
		fi
	done

	# Copy geom libs to FSDIR too
	cp -r ${DESTDIR}/lib/geom ${FSDIR}${N_LIB}

	# run through the geom list. We use geli because it is the only binary we explicitly need.

	IFS="${FORFS}"
	for geom in $(grep -v ^# ${BUILDDIR}/targets/FreeBSD/${RELEASE}/share/geomlist | grep -v ^$)
	do
		ln ${FSDIR}${N_BIN}/geli ${FSDIR}${N_BIN}/${geom}
	done
	IFS="${OLDFS}"

	# Grab the bootloader files, and place them in ${FSDIR}${N_BOOT}/

	cd ${DESTDIR}/boot && tar -cf - boot mbr gptboot pmbr boot0 boot2 | tar -xvpf - -C ${FSDIR}${N_BOOT}/ 1>&2
fi

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

# $Id$

# These are the cross compiling tools; we need it for strip and readelf.
CROSSTOOLSPATH=${MAKEOBJDIRPREFIX}/${TARGET}${WORKDIR}/usr/src/tmp/usr/bin

# Overwrite rescue with Lazybox
#cp ${BUILDDIR}/lazybox.dynamic ${WORKDIR}/usr/src/rescue/rescue/Makefile

# Copy kernel config to the source.
cp ${BUILDDIR}/targets/FreeBSD/${RELEASE}/${TARGET}/kernconf ${WORKDIR}/usr/src/sys/${TARGET}/conf/${KERNCONF}

# Patch in the binary path into the kernel directly, so that loader.conf doesn't need to.
if [ "${TARGET_ARCH}" = "amd64" ] ; then
	echo "options INIT_PATH=${N_BIN}/nexusd:${N_BIN}/init:/system/FreeBSD-${RELEASE}/i386/bin/nexusd:/system/FreeBSD-${RELEASE}/i386/bin/init:/sbin/init:/stand/sysinstall" >> ${WORKDIR}/usr/src/sys/${TARGET}/conf/${KERNCONF}
else
	echo "options INIT_PATH=${N_BIN}/nexusd:${N_BIN}/init:/sbin/init:/stand/sysinstall" >> ${WORKDIR}/usr/src/sys/${TARGET}/conf/${KERNCONF}
fi
if [ "${ABI}" = "7" ] ; then
	svn co --force http://svn.freebsd.org/base/head/sys/contrib/dev/ath ${WORKDIR}/usr/src/sys/contrib/dev/ath
fi
cd ${WORKDIR}/usr/src/
if [ "${NO_BUILD_WORLD}" = "" ] ; then
	echo " * ${target} = Building World "
	make -DLOADER_TFTP_SUPPORT LOCAL_DIRS="nsrc" MAGICPATH="/config" -DWITHOUT_LIB32 buildworld 1>&2
fi
if [ "${NO_BUILD_KERNEL}" = "" ] ; then
	echo " * ${target} = Building Kernel "
	make buildkernel 1>&2
fi

echo " * ${target} = Populating DESTDIR"
priv make hierarchy 1>&2
# Keeps a bug in the rescue install from acting up.
rm -r ${DESTDIR}/rescue 1>&2
mkdir -p ${DESTDIR}/rescue 1>&2

mkdir -p ${DESTDIR}${BOOTPATH}/defaults
priv make distribution 1>&2
priv make LOCAL_DIRS="nsrc" -DWITHOUT_LIB32 installworld 1>&2
mkdir -p ${DESTDIR}/boot
cp ${DESTDIR}/usr/src/sys/${TARGET_ARCH}/conf/GENERIC.hints ${DESTDIR}${BOOTPATH}/device.hints
priv make INSTKERNNAME=${KERNCONF} installkernel 1>&2
mkdir -p ${DESTDIR}/usr/src

if [ "${BUILD_PORTS}" != "" -a "${KERNEL_ONLY}" = "no" ] ; then
	echo " * ${target} = Building Ports "

	# Since we chroot, we need these files in the target root.
	cp ${BUILDDIR}/portbuild.sh ${DESTDIR}/
	cp ${BUILDDIR}/varlist ${DESTDIR}/
	cp ${BUILDDIR}/portlist ${DESTDIR}/
	cp /etc/resolv.conf ${DESTDIR}/etc/
	ln -s usr/share/misc ${DESTDIR}/config
	# We'll share ports and port dist files, as they don't change.
	mkdir -p ${DESTDIR}/usr/ports

	# Needed by perl. Damn it.
	mount -t devfs devfs ${DESTDIR}/dev

	# sharing files.
	mount_nullfs -o ro /usr/ports ${DESTDIR}/usr/ports
	mkdir -p ${NDISTDIR}/ports
	mount_nullfs ${NDISTDIR}/ports ${DESTDIR}/usr/ports/distfiles

	# Only for i386 on amd64 building, which doesn't currently work anyway. Still.
	if [ ${TARGET_ARCH} = i386 ] ; then
		cp ${DESTDIR}/libexec/ld-elf.so.1 ${DESTDIR}/libexec/ld-elf32.so.1
	fi

	# Work around the fact that 8-CURRENT no longer has kse, by forcing 6.x to use libthr
	if [ "${ABI}" = "6" ] ; then
		cat >${DESTDIR}/etc/libmap.conf << EOF
libpthread.so.2 libthr.so.2
libpthread.so libthr.so
libc_r.so.6 libthr.so.2
libc_r.so libthr.so
EOF
	fi
	# For ports, uname will return the correct values
	UNAME_r=${RELEASE}-RELEASE UNAME_m=${TARGET_ARCH} UNAME_p=${TARGET_ARCH} chroot ${DESTDIR} /portbuild.sh 1>&2
	umount ${DESTDIR}/usr/ports/distfiles
	umount ${DESTDIR}/usr/ports
	umount ${DESTDIR}/dev
	echo " * ${target} = Installing Packages "

	mkdir -p ${DESTDIR}/usr/local/bin
	mkdir -p ${DESTDIR}/usr/local/sbin
	mkdir -p ${DESTDIR}/usr/local/lib
	mkdir -p ${DESTDIR}/usr/local/libexec
	mkdir -p ${DESTDIR}/usr/local/plan9/bin
	mkdir -p ${DESTDIR}/usr/local/plan9/bin/venti

	if [ -d "${NDISTDIR}/${TARGET_HASH}/packages" ] ; then
		cd ${NDISTDIR}/${TARGET_HASH}/packages
		for file in *
		do
			tar -xf ${file} --exclude '+*' -C ${DESTDIR}/usr/local/
		done
	fi

	echo " * ${target} = Populating FSDIR"
	cd ${DESTDIR}/libexec && tar -cf - * | tar -xvpf - -C ${FSDIR}${N_LIBEXEC}
	mkdir -p ${DESTDIR}/mnt/bin
	mkdir -p ${DESTDIR}/mnt/lib

	# Dear lord this is ugly. Still, it simplifies other things. That's my story, and I'm sticking to it.
	mount_nullfs -o union ${DESTDIR}/usr/local/plan9/bin ${DESTDIR}/mnt/bin
	mount_nullfs -o union ${DESTDIR}/bin ${DESTDIR}/mnt/bin
	mount_nullfs -o union ${DESTDIR}/sbin ${DESTDIR}/mnt/bin
	mount_nullfs -o union ${DESTDIR}/usr/bin ${DESTDIR}/mnt/bin
	mount_nullfs -o union ${DESTDIR}/usr/sbin ${DESTDIR}/mnt/bin
	mount_nullfs -o union ${DESTDIR}/usr/local/bin ${DESTDIR}/mnt/bin
	mount_nullfs -o union ${DESTDIR}/usr/local/sbin ${DESTDIR}/mnt/bin
	mount_nullfs -o union ${DESTDIR}/usr/local/libexec ${DESTDIR}/mnt/bin
	mount_nullfs -o union ${DESTDIR}/usr/libexec ${DESTDIR}/mnt/bin
	mount_nullfs -o union ${DESTDIR}/lib ${DESTDIR}/mnt/lib
	mount_nullfs -o union ${DESTDIR}/usr/lib ${DESTDIR}/mnt/lib
	mount_nullfs -o union ${DESTDIR}/usr/local/lib ${DESTDIR}/mnt/lib

	# Clear flags and permissions.
	cd ${DESTDIR}/mnt/bin
	chflags -R noschg *
	chmod a+w *
	cd ${DESTDIR}/mnt/lib
	chflags -R noschg *
	chmod a+w *

	PROGS="${PROGS} $(grep -v ^# ${BUILDDIR}/portlist | grep ^B: | cut -d : -f 2)"

	# "Mommy Mommy! Can I see some ugly shell scripting?"
	# "Yes dear, but only if you gouge one eye out first"
	# "Awwww"
	#
	# Seriously though, as you can see, we create a for loop to generate a list of libraries by using readelf on a binary,
	# then we consolidate all libs (so there are no duplicates). Then we feed that to another for loop, which copies the libs in question to FSDIR, while creating compatibility symlinks.
	# See? Simple. Just, slightly confusing if you aren't used to dealing with loop constructs like this.

	resolve_libs() {
		for file in "$@"
		do
			echo "${file}" >&2
			TYPE="$(OPTIONS="quiet" filetype ${file})"
			case "${TYPE}" in
				application/x-executable)
					DEPENDENCIES=$(${CROSSTOOLSPATH}/readelf -d ${DESTDIR}/mnt/bin/${file} | grep '(NEEDED)' | cut -d [ -f 2 | cut -d ] -f 1)
					echo "${DEPENDENCIES}"
					resolve_libs ${DEPENDENCIES}
				;;
				application/x-sharedlib)
					DEPENDENCIES=$(${CROSSTOOLSPATH}/readelf -d ${DESTDIR}/mnt/lib/${file} | grep '(NEEDED)' | cut -d [ -f 2 | cut -d ] -f 1)
					echo "${file}"
					echo "${DEPENDENCIES}"
					resolve_libs ${DEPENDENCIES}
				;;
			esac
		done | sort | uniq

	}

	cd ${DESTDIR}/mnt/bin/
	for lib in $(resolve_libs ${PROGS} ganglia/modcpu.so ganglia/moddisk.so ganglia/modload.so ganglia/modmem.so ganglia/modmulticpu.so ganglia/modnet.so ganglia/modproc.so ganglia/modsys.so) libasn1.so.?
	do
		DIRECTORY="$(dirname ${lib})"
		FILE="$(basename ${lib})"

		echo "Working on ${lib}" >&2
		if [ "${DIRECTORY}" = "." ] ; then
			DEST="${FSDIR}/${N_LIB}/${FILE}"
		else
			mkdir -p ${FSDIR}/${N_LIB}/${DIRECTORY}
			DEST="${FSDIR}/${N_LIB}/${DIRECTORY}/${FILE}"
		fi

		cat ${DESTDIR}/mnt/lib/${lib} >${DEST}
		echo "Copying to ${DEST}" >&2
		case "${lib}" in
			*.so.*)
				ln -s ${FILE} $(echo $(echo ${DEST} | cut -d "." -f 1-2))
			;;
		esac
	done

	# Strip and copy the binaries to the FSDIR
	${CROSSTOOLSPATH}/strip --remove-section=.note --remove-section=.comment --strip-unneeded ${PROGS}
	tar -cLf - ${PROGS} | tar -xpf - -C ${FSDIR}${N_BIN}/
	cd ${FSDIR}${N_BIN}

	# Strip all the libs too for good measure
	cd ${OBJDIR}
	cd ${FSDIR}${N_LIB}
	${CROSSTOOLSPATH}/strip --remove-section=.note --remove-section=.comment --strip-unneeded *

	# Remove all the nullfs mounts... nasty nasty nasty....
	umount ${DESTDIR}/mnt/bin
	umount ${DESTDIR}/mnt/bin
	umount ${DESTDIR}/mnt/bin
	umount ${DESTDIR}/mnt/bin
	umount ${DESTDIR}/mnt/bin
	umount ${DESTDIR}/mnt/bin
	umount ${DESTDIR}/mnt/bin
	umount ${DESTDIR}/mnt/bin
	umount ${DESTDIR}/mnt/bin
	umount ${DESTDIR}/mnt/lib
	umount ${DESTDIR}/mnt/lib
	umount ${DESTDIR}/mnt/lib

	echo " * ${target} = Copying Directories to ${N_BINSHARE}"

	for file in $(grep -v ^# ${BUILDDIR}/portlist | grep ^D: | awk -F : '{ if ($4 == "binshare") { print $2; } }')
	do

		DIRNAME="$(dirname ${file})"
		DIRECTORY="$(basename ${file})"
		if [ -d "${DESTDIR}/${DIRNAME}" ] ; then
			cd ${DESTDIR}/${DIRNAME}
			echo " * ${target} = Copying ${DESTDIR}/${DIRNAME}/${DIRECTORY} to ${N_BINSHARE}"
			tar -cf - "${DIRECTORY}" | tar -xvpf - -C "${N_BINSHARE}/"
		fi
	done

	# Copy geom libs to FSDIR too
	cp -r ${DESTDIR}/lib/geom ${FSDIR}${N_LIB}

	# run through the geom list. We use geli because it is the only binary we explicitly need.

	IFS="${FORFS}"
	for geom in $(grep -v ^# ${BUILDDIR}/targets/FreeBSD/${RELEASE}/share/geomlist | grep -v ^$)
	do
		ln ${FSDIR}${N_BIN}/geli ${FSDIR}${N_BIN}/${geom}
	done
	IFS="${OLDFS}"

	# Grab the bootloader files, and place them in ${FSDIR}${N_BOOT}/

	cd ${DESTDIR}/boot && tar -cf - boot mbr gptboot pmbr boot0 boot2 | tar -xvpf - -C ${FSDIR}${N_BOOT}/ 1>&2
fi


80点

80点

https://paiza.jp/poh/hatsukoi/share/c1de0664

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


Add a test for ivy cache write permission

When scala apps run, properties files in the ivy cache may be
updated. Run one of the tutorial apps and scan for "permission
denied".

#!/bin/bash

# Define a bunch of functions and set a bunch of variables
TEST_DIR=$(readlink -f `dirname "${BASH_SOURCE[0]}"` | grep -o '.*/oshinko-s2i/test/e2e')
source $TEST_DIR/common

SCRIPT_DIR=$(readlink -f `dirname "${BASH_SOURCE[0]}"`)
source $SCRIPT_DIR/../../builddc

RESOURCE_DIR=$TEST_DIR/resources
set_template $RESOURCE_DIR/oshinko-scala-spark-build-dc.json
set_git_uri https://github.com/radanalyticsio/tutorial-sparkpi-scala-akka
set_worker_count $S2I_TEST_WORKERS
set_fixed_app_name scala-build
set_app_main_class io.radanalytics.examples.akka.sparkpi.WebServerHttpApp

# Need a little preamble here to read the resources.yaml, create the scala template, and save
# it to the resources directory
set +e
if [ -f "$RESOURCE_DIR"/resources.yaml ]; then
    echo Using local resources.yaml
    oc create -f $RESOURCE_DIR/resources.yaml &> /dev/null
else
    echo Using https://radanalytics.io/resources.yaml
    oc create -f https://radanalytics.io/resources.yaml &> /dev/null
fi

oc export template oshinko-scala-spark-build-dc -o json > $RESOURCE_DIR/oshinko-scala-spark-build-dc.json
fix_template $RESOURCE_DIR/oshinko-scala-spark-build-dc.json radanalyticsio/radanalytics-scala-spark:stable $S2I_TEST_IMAGE_SCALA
set -e

function test_ivy_perms {
    set_defaults
    set_app_file scala-spark-webapp_2.11-0.1.jar
    SPARK_OPTIONS=" --packages com.typesafe.akka:akka-http_2.11:10.0.9,com.typesafe.akka:akka-http-xml_2.11:10.0.9,com.typesafe.akka:akka-stream_2.11:2.5.3 --conf spark.jars.ivy=/tmp/.ivy2"
    run_app
    os::cmd::try_until_text "oc log dc/$APP_NAME" "Press RETURN to stop"
    os::cmd::expect_success_and_not_text "oc log dc $APP_NAME" "Permission denied"
    cleanup_app
}

os::test::junit::declare_suite_start "$MY_SCRIPT"

echo "++ test_ivy_perms"
test_ivy_perms

os::test::junit::declare_suite_end

error: pathspec 'test/e2e/templates/scala/radio/radio_ivy.sh' did not match any file(s) known to git


Test script for test if within

Test script for test if within

#!/bin/bash
outdir="out"
tmc_path="../Heather/solidity/Tmc4.sol"
DF_path="../Heather/solidity/DataFeedBool0.sol"
TC_path="../Heather/examples/TestIfWithinContract.bahr"
con_exe_path="./test/contract_execution/con_exec_DataFeedBool0_with_WithinDC.js"

rm -rf $outdir
./compile_and_deploy $outdir $tmc_path 1000 "'EUR'" 0 "'EUR'"
./compile_and_deploy $outdir $DF_path
./compile_and_deploy $outdir $TC_path
./run_code $outdir $con_exe_path

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


Create restart_vector_contam.sh

Create restart_vector_contam.sh

#What happens if my job dies?
#Find the last sequence to be written out to the scrubbed_genome.fasta, and make a note of its name. Just in case this sequence is incomplete, we are going to remove it from the scrubbed_genome.fasta file and restart the code at this point. If just the sequence name is written out:

tail -n -1 scrubbed_genome.fasta > test
less test #To make sure everything looks good before you over-write scrubbed_genome.fasta
mv test scrubbed_genome.fasta

#If the sequene name AND some associated sequence has been written out:
tail -n -2 scrubbed_genome.fasta > test
less test #To make sure everything looks good before you over-write scrubbed_genome.fasta
mv test scrubbed_genome.fasta

#If this last sequence is also present in the name_lengths_Ns.txt file:
tail -n -1 name_lengths_Ns.txt > test
less test #To make sure everything looks good before you over-write name_lengths_Ns.txt
mv test name_lengths_Ns.txt

#We then need to modify our input genome file. Search for the name of the last sequence (that we have now deleted from the scrubbed_genome.fasta file), and find the line number of this in the original genome assembly file e.g. 49976687
head -n -49976687 trunk_anole_19Jun2016_xkeD9.fasta > test
less test #To make sure everything looks good before you move to mod.fasta
mv test mod.fasta

#Define the name of your modified final scaffolded genome assembly
genome=mod.fasta
echo $genome > temp

#Rscript for removing portions of scaffolds
Rscript restart_scrub_genome.R

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


Add script to generate image from DOT source code.

#/bin/env bash
# Generate image from DOT source code

PWD=`pwd`

pushd ${PWD}
cd "`dirname $0`/../img_src"
for dot_file in `ls *.dot`; do
    file_name=`echo ${dot_file} | awk -F'.' '{print $(NF-1)}'`
    img_file="../img/${file_name}.png"
    dot -Tpng ${dot_file} -o ${img_file}
done
popd

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


fixed typo

fixed typo

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/epam/DLab.git/'


Adding keywords to South Park

Adding keywords to South Park

error: pathspec 'catscripts/Entertainment/Cartoons/South' did not match any file(s) known to git
error: pathspec 'Park/SouthPark.sh' did not match any file(s) known to git


Create debian-factom-install.sh

Create debian-factom-install.sh

#!/usr/bin/env bash
cd $HOME
apt update
apt upgrade
wget https://github.com/FactomProject/distribution/releases/download/v0.4.2.4/factom-amd64.deb
dpkg -i --force-architecture factom-amd64.deb
rm -f factom-amd64.deb
apt install unzip
wget https://www.factom.com/assets/site/factom_bootstrap.zip
unzip factom_bootstrap.zip
rm -f factom_bootstrap.zip
# boots factomd, wallet won't start by default
factomd &
sleep 5
# fctwallet

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


Add release script.

Add release script.

#!/usr/bin/env bash

# You have to set $bintrayUser and $bintrayKey before run this script.
set -eu

../gradlew clean build generatePomFileForMavenPublication bintrayUpload -PbintrayUser=$bintrayUser -PbintrayKey=$bintrayKey -PdryRun=true

../gradlew clean build generatePomFileForMavenPublication bintrayUpload -PbintrayUser=$bintrayUser -PbintrayKey=$bintrayKey

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


add container-xpm-install-test.sh

add container-xpm-install-test.sh

#!/usr/bin/env bash
# -----------------------------------------------------------------------------
# This file is part of the xPack distribution.
#   (https://xpack.github.io)
# Copyright (c) 2020 Liviu Ionescu.
#
# Permission to use, copy, modify, and/or distribute this software
# for any purpose is hereby granted, under the terms of the MIT license.
# -----------------------------------------------------------------------------

# -----------------------------------------------------------------------------
# Safety settings (see https://gist.github.com/ilg-ul/383869cbb01f61a51c4d).

if [[ ! -z ${DEBUG} ]]
then
  set ${DEBUG} # Activate the expand mode if DEBUG is anything but empty.
else
  DEBUG=""
fi

set -o errexit # Exit if command failed.
set -o pipefail # Exit if pipe failed.
set -o nounset # Exit if variable not set.

# Remove the initial space and instead use '\n'.
IFS=$'\n\t'

# -----------------------------------------------------------------------------
# Identify the script location, to reach, for example, the helper scripts.

script_path="$0"
if [[ "${script_path}" != /* ]]
then
  # Make relative path absolute.
  script_path="$(pwd)/$0"
fi

script_name="$(basename "${script_path}")"

script_folder_path="$(dirname "${script_path}")"
script_folder_name="$(basename "${script_folder_path}")"

# =============================================================================

source "${script_folder_path}/app-defs.sh"

helper_folder_path="$(dirname $(dirname "${script_folder_path}"))/scripts/helper"

source "${helper_folder_path}/test-functions-source.sh"
source "${script_folder_path}/common-functions-source.sh"

# -----------------------------------------------------------------------------

# This runs inside a Docker container.

image_name="$1"
echo "${image_name}"
shift

while [ $# -gt 0 ]
do
  case "$1" in

    -*)
      echo "Unsupported option $1."
      exit 1
      ;;

  esac
done

# -----------------------------------------------------------------------------

# Make sure that the minimum prerequisites are met.
if [[ ${image_name} == *ubuntu* ]] || [[ ${image_name} == *debian* ]] || [[ ${image_name} == *raspbian* ]]
then
  run_verbose apt-get -qq update
  run_verbose apt-get -qq install -y git-core curl tar gzip lsb-release binutils
elif [[ ${image_name} == *centos* ]] || [[ ${image_name} == *fedora* ]]
then
  run_verbose yum install -y -q git curl tar gzip redhat-lsb-core binutils
  run_verbose yum install -y -q python || true
elif [[ ${image_name} == *opensuse* ]]
then
  run_verbose zypper -q in -y git-core curl tar gzip lsb-release binutils
  run_verbose zypper -q in -y python || true
elif [[ ${image_name} == *manjaro* ]]
then
  run_verbose pacman-mirrors -g
  run_verbose pacman -S -y -q --noconfirm

  # Update even if up to date (-yy) & upgrade (-u).
  # pacman -S -yy -u -q --noconfirm
  run_verbose pacman -S -q --noconfirm --noprogressbar git curl tar gzip lsb-release binutils file
elif [[ ${image_name} == *archlinux* ]]
then
  pacman -S -y -q --noconfirm

  # Update even if up to date (-yy) & upgrade (-u).
  # pacman -S -yy -u -q --noconfirm
  run_verbose pacman -S -q --noconfirm --noprogressbar git curl tar gzip lsb-release binutils file
fi

# -----------------------------------------------------------------------------

detect_architecture

prepare_env

install_xpm

env | sort
pwd

xpm install --global ${npm_package}

good_bye

# Completed successfully.
exit 0

# -----------------------------------------------------------------------------

error: pathspec 'tests/scripts/container-xpm-install-test.sh' did not match any file(s) known to git


run script

run script

#!/usr/bin/env bash

adb logcat -c

react-native run-android

pidcat com.radiostream \
-l D \
-i ViewRootImpl \
-i DisplayListCanvas \
-i Timeline \
-i mali_winsys \
-i art \
-i libGLESv1 \
-i unknown:ViewManagerPropertyUpdater \
-i ApkSoSource \
-i TimaKeyStoreProvider \
-i ActivityThread \
-i ResourcesManager \
-i InjectionManager \
-i SensorManager \
-i Activity \
-i OpenGLRenderer \
-i SecWifiDisplayUtil \
-i libEGL \
-i Zygote \
-i SELinux

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


Create eclipse.sh

Create eclipse.sh

#!/bin/bash

cd /tmp
wget http://ftp.snt.utwente.nl/pub/software/eclipse//technology/epp/downloads/release/photon/R/eclipse-jee-photon-R-linux-gtk-x86_64.tar.gz
mv eclipse-jee-photon-R-linux-gtk-x86_64.tar.gz /opt/
cd /opt
tar xzf eclipse-jee-photon-R-linux-gtk-x86_64.tar.gz
chown centos:centos eclipse -R
ln -s /opt/eclipse/eclipse /usr/bin/eclipse

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


WIP bash script for assembling

WIP bash script for assembling

#!/bin/bash

file=$1

if [ "$file" ]; then
    python assembler.py "$file"
    echo "Machine code successfully saved to file 'machine_code'"
    cat machine_code | xclip -selection clipboard
else
    echo "No file specified"
fi

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


increased script robustness

increased script robustness

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/minhpqn/mlpack.git/'


Release the pretrained model

Release the pretrained model

url=http://deep-asr-data.gz.bcebos.com/aishell_pretrained_model.tar.gz
md5=7b51bde64e884f43901b7a3461ccbfa3

wget -c $url

echo "Checking md5 sum ..."
md5sum_tmp=`md5sum aishell_pretrained_model.tar.gz | cut -d ' ' -f1`

if [ $md5sum_tmp !=  $md5 ]; then
    echo "Md5sum check failed, please remove and redownload "
          "aishell_pretrained_model.tar.gz."
    exit 1
fi

tar xvf aishell_pretrained_model.tar.gz

error: pathspec 'fluid/DeepASR/examples/aishell/download_pretrained_model.sh' did not match any file(s) known to git


add aws variables

add aws variables

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


minor stability bug fix

minor stability bug fix

hardcoded ioreg + grep paths to fix a rare command not found issue

error: pathspec 'Continuity' did not match any file(s) known to git
error: pathspec 'Activation' did not match any file(s) known to git
error: pathspec 'Tool.app/Contents/MacOS/contitool.sh' did not match any file(s) known to git


Add download script.

Add download script.

curl http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz | gunzip -c > t10k-images-idx3-ubyte
curl http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz | gunzip -c > t10k-labels-idx1-ubyte
curl http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz | gunzip -c > train-images-idx3-ubyte
curl http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz | gunzip -c > train-labels-idx1-ubyte

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


Added suse plugins

Added suse plugins

alias zi='sudo zypper install'
alias zrf='sudo zypper refresh'
alias zs='zypper search'
alias zup='sudo zypper dist-upgrade'
alias zrm='sudo zypper remove'

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


Fixing window creation

Fixing window creation

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/klaxalk/tmux.git/'