Add the script to generate the testsuite

#!/bin/sh
WIKIPAGE=SVG-Test-suite.md
TESTSUITEURI=http://www.w3.org/Graphics/SVG/Test/20110816/svg
FILES="animate-dom-01-f.svg
animate-dom-02-f.svg
animate-elem-02-t.svg
animate-elem-03-t.svg
animate-elem-04-t.svg
animate-elem-05-t.svg
animate-elem-06-t.svg
animate-elem-07-t.svg
animate-elem-08-t.svg
animate-elem-09-t.svg
animate-elem-10-t.svg
animate-elem-11-t.svg
animate-elem-12-t.svg
animate-elem-13-t.svg
animate-elem-14-t.svg
animate-elem-15-t.svg
animate-elem-17-t.svg
animate-elem-19-t.svg
animate-elem-20-t.svg
animate-elem-21-t.svg
animate-elem-22-b.svg
animate-elem-23-t.svg
animate-elem-24-t.svg
animate-elem-25-t.svg
animate-elem-26-t.svg
animate-elem-27-t.svg
animate-elem-28-t.svg
animate-elem-29-b.svg
animate-elem-30-t.svg
animate-elem-31-t.svg
animate-elem-32-t.svg
animate-elem-33-t.svg
animate-elem-34-t.svg
animate-elem-35-t.svg
animate-elem-36-t.svg
animate-elem-37-t.svg
animate-elem-38-t.svg
animate-elem-39-t.svg
animate-elem-40-t.svg
animate-elem-41-t.svg
animate-elem-44-t.svg
animate-elem-46-t.svg
animate-elem-52-t.svg
animate-elem-53-t.svg
animate-elem-60-t.svg
animate-elem-61-t.svg
animate-elem-62-t.svg
animate-elem-63-t.svg
animate-elem-64-t.svg
animate-elem-65-t.svg
animate-elem-66-t.svg
animate-elem-67-t.svg
animate-elem-68-t.svg
animate-elem-69-t.svg
animate-elem-70-t.svg
animate-elem-77-t.svg
animate-elem-78-t.svg
animate-elem-80-t.svg
animate-elem-81-t.svg
animate-elem-82-t.svg
animate-elem-83-t.svg
animate-elem-84-t.svg
animate-elem-85-t.svg
animate-elem-86-t.svg
animate-elem-87-t.svg
animate-elem-88-t.svg
animate-elem-89-t.svg
animate-elem-90-b.svg
animate-elem-91-t.svg
animate-elem-92-t.svg
animate-interact-events-01-t.svg
animate-interact-pevents-01-t.svg
animate-interact-pevents-02-t.svg
animate-interact-pevents-03-t.svg
animate-interact-pevents-04-t.svg
animate-pservers-grad-01-b.svg
animate-script-elem-01-b.svg
animate-struct-dom-01-b.svg
color-prof-01-f.svg
color-prop-01-b.svg
color-prop-02-f.svg
color-prop-03-t.svg
color-prop-04-t.svg
color-prop-05-t.svg
conform-viewers-01-t.svgz
conform-viewers-02-f.svg
conform-viewers-03-f.svg
coords-coord-01-t.svg
coords-coord-02-t.svg
coords-dom-01-f.svg
coords-dom-02-f.svg
coords-dom-03-f.svg
coords-dom-04-f.svg
coords-trans-01-b.svg
coords-trans-02-t.svg
coords-trans-03-t.svg
coords-trans-04-t.svg
coords-trans-05-t.svg
coords-trans-06-t.svg
coords-trans-07-t.svg
coords-trans-08-t.svg
coords-trans-09-t.svg
coords-trans-10-f.svg
coords-trans-11-f.svg
coords-trans-12-f.svg
coords-trans-13-f.svg
coords-trans-14-f.svg
coords-transformattr-01-f.svg
coords-transformattr-02-f.svg
coords-transformattr-03-f.svg
coords-transformattr-04-f.svg
coords-transformattr-05-f.svg
coords-units-01-b.svg
coords-units-02-b.svg
coords-units-03-b.svg
coords-viewattr-01-b.svg
coords-viewattr-02-b.svg
coords-viewattr-03-b.svg
coords-viewattr-04-f.svg
extend-namespace-01-f.svg
filters-background-01-f.svg
filters-blend-01-b.svg
filters-color-01-b.svg
filters-color-02-b.svg
filters-composite-02-b.svg
filters-composite-03-f.svg
filters-composite-04-f.svg
filters-composite-05-f.svg
filters-comptran-01-b.svg
filters-conv-01-f.svg
filters-conv-02-f.svg
filters-conv-03-f.svg
filters-conv-04-f.svg
filters-conv-05-f.svg
filters-diffuse-01-f.svg
filters-displace-01-f.svg
filters-displace-02-f.svg
filters-example-01-b.svg
filters-felem-01-b.svg
filters-felem-02-f.svg
filters-gauss-01-b.svg
filters-gauss-02-f.svg
filters-gauss-03-f.svg
filters-image-01-b.svg
filters-image-02-b.svg
filters-image-03-f.svg
filters-image-04-f.svg
filters-image-05-f.svg
filters-light-01-f.svg
filters-light-02-f.svg
filters-light-03-f.svg
filters-light-04-f.svg
filters-light-05-f.svg
filters-morph-01-f.svg
filters-offset-01-b.svg
filters-offset-02-b.svg
filters-overview-01-b.svg
filters-overview-02-b.svg
filters-overview-03-b.svg
filters-specular-01-f.svg
filters-tile-01-b.svg
filters-turb-01-f.svg
filters-turb-02-f.svg
fonts-desc-01-t.svg
fonts-desc-02-t.svg
fonts-desc-03-t.svg
fonts-desc-04-t.svg
fonts-desc-05-t.svg
fonts-elem-01-t.svg
fonts-elem-02-t.svg
fonts-elem-03-b.svg
fonts-elem-04-b.svg
fonts-elem-05-t.svg
fonts-elem-06-t.svg
fonts-elem-07-b.svg
fonts-glyph-02-t.svg
fonts-glyph-03-t.svg
fonts-glyph-04-t.svg
fonts-kern-01-t.svg
fonts-overview-201-t.svg
imp-path-01-f.svg
interact-cursor-01-f.svg
interact-dom-01-b.svg
interact-events-01-b.svg
interact-events-02-b.svg
interact-events-202-f.svg
interact-events-203-t.svg
interact-order-01-b.svg
interact-order-02-b.svg
interact-order-03-b.svg
interact-pevents-01-b.svg
interact-pevents-03-b.svg
interact-pevents-04-t.svg
interact-pevents-05-b.svg
interact-pevents-07-t.svg
interact-pevents-08-f.svg
interact-pevents-09-f.svg
interact-pevents-10-f.svg
interact-pointer-01-t.svg
interact-pointer-02-t.svg
interact-pointer-03-t.svg
interact-pointer-04-f.svg
interact-zoom-01-t.svg
interact-zoom-02-t.svg
interact-zoom-03-t.svg
linking-a-01-b.svg
linking-a-03-b.svg
linking-a-04-t.svg
linking-a-05-t.svg
linking-a-07-t.svg
linking-a-08-t.svg
linking-a-09-b.svg
linking-a-10-f.svg
linking-frag-01-f.svg
linking-uri-01-b.svg
linking-uri-02-b.svg
linking-uri-03-t.svg
masking-filter-01-f.svg
masking-intro-01-f.svg
masking-mask-01-b.svg
masking-mask-02-f.svg
masking-opacity-01-b.svg
masking-path-01-b.svg
masking-path-02-b.svg
masking-path-03-b.svg
masking-path-04-b.svg
masking-path-05-f.svg
masking-path-06-b.svg
masking-path-07-b.svg
masking-path-08-b.svg
masking-path-09-b.svg
masking-path-10-b.svg
masking-path-11-b.svg
masking-path-12-f.svg
masking-path-13-f.svg
masking-path-14-f.svg
metadata-example-01-t.svg
painting-control-01-f.svg
painting-control-02-f.svg
painting-control-03-f.svg
painting-control-04-f.svg
painting-control-05-f.svg
painting-control-06-f.svg
painting-fill-01-t.svg
painting-fill-02-t.svg
painting-fill-03-t.svg
painting-fill-04-t.svg
painting-fill-05-b.svg
painting-marker-01-f.svg
painting-marker-02-f.svg
painting-marker-03-f.svg
painting-marker-04-f.svg
painting-marker-05-f.svg
painting-marker-06-f.svg
painting-marker-07-f.svg
painting-marker-properties-01-f.svg
painting-render-01-b.svg
painting-render-02-b.svg
painting-stroke-01-t.svg
painting-stroke-02-t.svg
painting-stroke-03-t.svg
painting-stroke-04-t.svg
painting-stroke-05-t.svg
painting-stroke-06-t.svg
painting-stroke-07-t.svg
painting-stroke-08-t.svg
painting-stroke-09-t.svg
painting-stroke-10-t.svg
paths-data-01-t.svg
paths-data-02-t.svg
paths-data-03-f.svg
paths-data-04-t.svg
paths-data-05-t.svg
paths-data-06-t.svg
paths-data-07-t.svg
paths-data-08-t.svg
paths-data-09-t.svg
paths-data-10-t.svg
paths-data-12-t.svg
paths-data-13-t.svg
paths-data-14-t.svg
paths-data-15-t.svg
paths-data-16-t.svg
paths-data-17-f.svg
paths-data-18-f.svg
paths-data-19-f.svg
paths-data-20-f.svg
paths-dom-01-f.svg
paths-dom-02-f.svg
pservers-grad-01-b.svg
pservers-grad-02-b.svg
pservers-grad-03-b.svg
pservers-grad-04-b.svg
pservers-grad-05-b.svg
pservers-grad-06-b.svg
pservers-grad-07-b.svg
pservers-grad-08-b.svg
pservers-grad-09-b.svg
pservers-grad-10-b.svg
pservers-grad-11-b.svg
pservers-grad-12-b.svg
pservers-grad-13-b.svg
pservers-grad-14-b.svg
pservers-grad-15-b.svg
pservers-grad-16-b.svg
pservers-grad-17-b.svg
pservers-grad-18-b.svg
pservers-grad-20-b.svg
pservers-grad-21-b.svg
pservers-grad-22-b.svg
pservers-grad-23-f.svg
pservers-grad-24-f.svg
pservers-grad-stops-01-f.svg
pservers-pattern-01-b.svg
pservers-pattern-02-f.svg
pservers-pattern-03-f.svg
pservers-pattern-04-f.svg
pservers-pattern-05-f.svg
pservers-pattern-06-f.svg
pservers-pattern-07-f.svg
pservers-pattern-08-f.svg
pservers-pattern-09-f.svg
render-elems-01-t.svg
render-elems-02-t.svg
render-elems-03-t.svg
render-elems-06-t.svg
render-elems-07-t.svg
render-elems-08-t.svg
render-groups-01-b.svg
render-groups-03-t.svg
script-handle-01-b.svg
script-handle-02-b.svg
script-handle-03-b.svg
script-handle-04-b.svg
script-specify-01-f.svg
script-specify-02-f.svg
shapes-circle-01-t.svg
shapes-circle-02-t.svg
shapes-ellipse-01-t.svg
shapes-ellipse-02-t.svg
shapes-ellipse-03-f.svg
shapes-grammar-01-f.svg
shapes-intro-01-t.svg
shapes-intro-02-f.svg
shapes-line-01-t.svg
shapes-line-02-f.svg
shapes-polygon-01-t.svg
shapes-polygon-02-t.svg
shapes-polygon-03-t.svg
shapes-polyline-01-t.svg
shapes-polyline-02-t.svg
shapes-rect-01-t.svg
shapes-rect-02-t.svg
shapes-rect-03-t.svg
shapes-rect-04-f.svg
shapes-rect-05-f.svg
shapes-rect-06-f.svg
shapes-rect-07-f.svg
struct-cond-01-t.svg
struct-cond-02-t.svg
struct-cond-03-t.svg
struct-cond-overview-02-f.svg
struct-cond-overview-03-f.svg
struct-cond-overview-04-f.svg
struct-cond-overview-05-f.svg
struct-defs-01-t.svg
struct-dom-01-b.svg
struct-dom-02-b.svg
struct-dom-03-b.svg
struct-dom-04-b.svg
struct-dom-05-b.svg
struct-dom-06-b.svg
struct-dom-07-f.svg
struct-dom-08-f.svg
struct-dom-11-f.svg
struct-dom-12-b.svg
struct-dom-13-f.svg
struct-dom-14-f.svg
struct-dom-15-f.svg
struct-dom-16-f.svg
struct-dom-17-f.svg
struct-dom-18-f.svg
struct-dom-19-f.svg
struct-dom-20-f.svg
struct-frag-01-t.svg
struct-frag-02-t.svg
struct-frag-03-t.svg
struct-frag-04-t.svg
struct-frag-05-t.svg
struct-frag-06-t.svg
struct-group-01-t.svg
struct-group-02-b.svg
struct-group-03-t.svg
struct-image-01-t.svg
struct-image-02-b.svg
struct-image-03-t.svg
struct-image-04-t.svg
struct-image-05-b.svg
struct-image-06-t.svg
struct-image-07-t.svg
struct-image-08-t.svg
struct-image-09-t.svg
struct-image-10-t.svg
struct-image-11-b.svg
struct-image-12-b.svg
struct-image-13-f.svg
struct-image-14-f.svg
struct-image-15-f.svg
struct-image-16-f.svg
struct-image-17-b.svg
struct-image-18-f.svg
struct-image-19-f.svg
struct-svg-01-f.svg
struct-svg-02-f.svg
struct-svg-03-f.svg
struct-symbol-01-b.svg
struct-use-01-t.svg
struct-use-03-t.svg
struct-use-04-b.svg
struct-use-05-b.svg
struct-use-06-b.svg
struct-use-07-b.svg
struct-use-08-b.svg
struct-use-09-b.svg
struct-use-10-f.svg
struct-use-11-f.svg
struct-use-12-f.svg
struct-use-13-f.svg
struct-use-14-f.svg
struct-use-15-f.svg
styling-class-01-f.svg
styling-css-01-b.svg
styling-css-02-b.svg
styling-css-03-b.svg
styling-css-04-f.svg
styling-css-05-b.svg
styling-css-06-b.svg
styling-css-07-f.svg
styling-css-08-f.svg
styling-css-09-f.svg
styling-css-10-f.svg
styling-elem-01-b.svg
styling-inherit-01-b.svg
styling-pres-01-t.svg
styling-pres-02-f.svg
styling-pres-03-f.svg
styling-pres-04-f.svg
styling-pres-05-f.svg
svgdom-over-01-f.svg
text-align-01-b.svg
text-align-02-b.svg
text-align-03-b.svg
text-align-04-b.svg
text-align-05-b.svg
text-align-06-b.svg
text-align-07-t.svg
text-align-08-b.svg
text-altglyph-01-b.svg
text-altglyph-02-b.svg
text-altglyph-03-b.svg
text-bidi-01-t.svg
text-deco-01-b.svg
text-dom-01-f.svg
text-dom-02-f.svg
text-dom-03-f.svg
text-dom-04-f.svg
text-dom-05-f.svg
text-fonts-01-t.svg
text-fonts-02-t.svg
text-fonts-03-t.svg
text-fonts-04-t.svg
text-fonts-05-f.svg
text-fonts-202-t.svg
text-fonts-203-t.svg
text-fonts-204-t.svg
text-intro-01-t.svg
text-intro-02-b.svg
text-intro-03-b.svg
text-intro-04-t.svg
text-intro-05-t.svg
text-intro-06-t.svg
text-intro-07-t.svg
text-intro-09-b.svg
text-intro-10-f.svg
text-intro-11-t.svg
text-intro-12-t.svg
text-path-01-b.svg
text-path-02-b.svg
text-spacing-01-b.svg
text-text-01-b.svg
text-text-03-b.svg
text-text-04-t.svg
text-text-05-t.svg
text-text-06-t.svg
text-text-07-t.svg
text-text-08-b.svg
text-text-09-t.svg
text-text-10-t.svg
text-text-11-t.svg
text-text-12-t.svg
text-tref-01-b.svg
text-tref-02-b.svg
text-tref-03-b.svg
text-tselect-01-b.svg
text-tselect-02-f.svg
text-tselect-03-f.svg
text-tspan-01-b.svg
text-tspan-02-b.svg
text-ws-01-t.svg
text-ws-02-t.svg
text-ws-03-t.svg
types-basic-01-f.svg
types-basic-02-f.svg
types-dom-01-b.svg
types-dom-02-f.svg
types-dom-03-b.svg
types-dom-04-b.svg
types-dom-05-b.svg
types-dom-06-f.svg
types-dom-07-f.svg
types-dom-08-f.svg
types-dom-svgfittoviewbox-01-f.svg
types-dom-svglengthlist-01-f.svg
types-dom-svgnumberlist-01-f.svg
types-dom-svgstringlist-01-f.svg
types-dom-svgtransformable-01-f.svg"

## clone the wiki if not already cloned
if [ ! -e egueb.wiki ]; then
	git clone git@github.com:turran/egueb.wiki.git
else
	cd egueb.wiki && git pull --rebase || cd ..
fi

cd egueb.wiki

err=`mktemp`
succeeded=0
failed=0
## Set the generic title
cat > $WIKIPAGE <<EOF
This test suite is based on [W3C SVG Test Suite](http://www.w3.org/Graphics/SVG/WG/wiki/Test_Suite_Overview)

Succeed: %SUCCEEDED%
Failed: %FAILED%

| Test | Result | Generated |
|------|--------|-----------|
EOF

## call gst-egueb-record on every uri
for i in $FILES; do
	echo "Processing $TESTSUITEURI/$i"
	EINA_LOG_LEVEL=0 GST_DEBUG=0 gst-egueb-record $TESTSUITEURI/$i testsuite/egueb-$i 2> $err
	out=`ls testsuite/egueb-$i*`
	## get the stderr and also put it on the wiki
	## if everything's fine on the return value put a green mark, otherwise a red one
	errstr=`cat $err`
	if [ -z $errstr ]; then
		errstr="*OK*"
	else
		errstr="FAILED"
	fi
	echo "|$i|$errstr|![Preview]($out)|" >> $WIKIPAGE
done

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


Adds oh-my-zsh plugin to load TaskWarrior completions

################################################################################
# Author: Pete Clark
# Email: pete[dot]clark[at]gmail[dot]com
# Version: 0.1 (05/24/2011)
# License: WTFPL<http://sam.zoy.org/wtfpl/>
#
# This oh-my-zsh plugin adds smart tab completion for
# TaskWarrior<http://taskwarrior.org/>. It uses the zsh tab completion
# script (_task) distributed with TaskWarrior for the completion definitions.
#
# Typing task[tabtab] will give you a list of current tasks, task 66[tabtab]
# gives a list of available modifications for that task, etc.
################################################################################

zstyle ':completion:*:*:task:*' verbose yes
zstyle ':completion:*:*:task:*:descriptions' format '%U%B%d%b%u'

zstyle ':completion:*:*:task:*' group-name ''

alias t=task
compdef _task t=task

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


Create pam_policy.sh

Create pam_policy.sh

1.	Enable password complexity

Make changes in the /etc/pam.d/system-auth-ac file as follows.

Take backup of original file:
cp /etc/pam.d/system-auth-ac / etc/pam.d/orig-system-auth-ac-(date)

Find the below line in the file.

password    requisite     pam_cracklib.so

And change as:

password    requisite     pam_cracklib.so try_first_pass retry=3 type= minlen=8 dcredit=-1 ucredit=-1 lcredit=-1 ocredit=-1

(This will make the password complexity as minimum 8 characters length, minimum 1 digit, 1 uppercase, one lowercase and one special character)

2.	Enable account lockout after failed login attempts

For RHEL 5 add the below lines in /etc/pam.d/system-auth-ac as mentioned below.

auth        required      pam_tally2.so deny=5 unlock_time=180(Add this line below : auth        required      pam_env.so)

account     required      pam_tally2.so(Add this line below: account     required      pam_unix.so)

For RHEL 6 add the lines in /etc/pam.d/system-auth-ac and /etc/pam.d/password-auth-ac file as mentioned below.

auth        required      pam_tally2.so deny=5 unlock_time=180(Add this line above : auth        required      pam_env.so)

account     required      pam_tally2.so(Add this line above: account     required      pam_unix.so)

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


add script to pull latest code

add script to pull latest code

#! /bin/bash
git checkout --force release
git pull
npm update
nwjs

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


Add github support to Dockerfile

Add github support to Dockerfile

This will enable user to pull notebooks from github after this
notebooks server will be started.

#!/bin/bash

echo "Fetching notebooks from" $GIT_REPO

git clone $GIT_REPO /home/notebooks

echo "Running Notebook"
/opt/conda/bin/jupyter notebook --ip='*' --notebook-dir=/home/notebooks --port=8888 --no-browser

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


decrease max memory size

decrease max memory size

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/TMS-v113/server.git/'


Create launch.sh

Create launch.sh


script for updating deps without git

script for updating deps without git

cp -R ../erlib/* deps/erlib
cp -R ../erlbuild/* deps/erlbuild

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


add git reset script

add git reset script

#!/bin/bash

gitreset="git reset HEAD --hard"
gitpull="git pull origin master"

eval $gitreset
eval $gitpull

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


Implement cluster_info.sh to enable devs get cluster information without logging in as clustermgr user.

#!/bin/bash

. ./textfileops.sh

list_clusters() {
	local files=$(ls -1 /home/clustermgr/storm-linode/)
	while read f
	do
		if [ ! -d "/home/clustermgr/storm-linode/$f" ]; then
			continue
		fi

		if [ ! -f "/home/clustermgr/storm-linode/$f/$f.conf" ]; then
			continue
		fi

		grep -q NIMBUS_NODE_PUBLIC_HOSTNAME "/home/clustermgr/storm-linode/$f/$f.conf"
		if [ $? -ne 0 ]; then
			continue
		fi

		echo "$f"
	done <<< "$files"

	return 0
}

# $1 : The directory basename of a storm cluster directory.
print_cluster_info() {
	if [ ! -d "/home/clustermgr/storm-linode/$1" ]; then
		echo "Error: $1 is not a Storm cluster directory"
		return 1
	fi

	if [ ! -f "/home/clustermgr/storm-linode/$1/$1.conf" ]; then
		echo "Error: $1 is not a Storm cluster directory"
		return 1
	fi

	grep -q NIMBUS_NODE_PUBLIC_HOSTNAME "/home/clustermgr/storm-linode/$1/$1.conf"
	if [ $? -ne 0 ]; then
		echo "Error: $1 is not a Storm cluster directory"
		return 1
	fi

	local stfile
	stfile=$(ls /home/clustermgr/storm-linode/$1/*.info)
	if [ $? -ne 0 ]; then
		echo "$1 is not yet created"
		return 1
	fi

	printf "\nStatus: $(get_section $stfile "status" | cut -d ':' -f2)\n\n"

	local nodes=$(get_section $stfile "nodes")
	local hostnames=$(get_section $stfile "hostnames")
	local ipaddrs=$(get_section $stfile "ipaddresses")

	local nimbus_linode_id=$(echo "$nodes"|grep 'nimbus'|cut -d ':' -f1)
	local nimbus_ipline=$(echo "$ipaddrs"|grep "$nimbus_linode_id")
	local nimbus_iparr=($nimbus_ipline)
	local nimbus_private_ip=${nimbus_iparr[1]}
	local nimbus_public_ip=${nimbus_iparr[2]}
	local nimbus_hostsline=$(echo "$hostnames"|grep "$nimbus_linode_id")
	local nimbus_hostsarr=($nimbus_hostsline)
	local nimbus_private_host=${nimbus_hostsarr[1]}
	local nimbus_public_host=${nimbus_hostsarr[2]}

	cat <<-ENDSTANZA
		Nimbus:
		  Linode ID:		$nimbus_linode_id
		  Private IP:		$nimbus_private_ip
		  Private hostname:	$nimbus_private_host
		  Public IP:		$nimbus_public_ip
		  Public hostname:	$nimbus_public_host

	ENDSTANZA

	local client_linode_id=$(echo "$nodes"|grep 'client'|cut -d ':' -f1)
	local client_ipline=$(echo "$ipaddrs"|grep "$client_linode_id")
	local client_iparr=($client_ipline)
	local client_private_ip=${client_iparr[1]}
	local client_public_ip=${client_iparr[2]}
	local client_hostsline=$(echo "$hostnames"|grep "$client_linode_id")
	local client_hostsarr=($client_hostsline)
	local client_private_host=${client_hostsarr[1]}
	local client_public_host=${client_hostsarr[2]}

	cat <<-ENDSTANZA
		Client:
		  Linode ID:		$client_linode_id
		  Private IP:		$client_private_ip
		  Private hostname:	$client_private_host
		  Public IP:		$client_public_ip
		  Public hostname:	$client_public_host

	ENDSTANZA

	echo 'Supervisors:'

	while read node;
	do
		local sup_linode_id=$(echo "$node"|cut -d ':' -f1)
		local sup_ipline=$(echo "$ipaddrs"|grep "$sup_linode_id")
		local sup_iparr=($sup_ipline)
		local sup_private_ip=${sup_iparr[1]}
		local sup_public_ip=${sup_iparr[2]}
		local sup_hostsline=$(echo "$hostnames"|grep "$sup_linode_id")
		local sup_hostsarr=($sup_hostsline)
		local sup_private_host=${sup_hostsarr[1]}
		local sup_public_host=${sup_hostsarr[2]}

		cat <<-ENDSTANZA
			  Linode ID:		$sup_linode_id
			  Private IP:		$sup_private_ip
			  Private hostname:	$sup_private_host
			  Public IP:		$sup_public_ip
			  Public hostname:	$sup_public_host

		ENDSTANZA

	done <<< "$(echo "$nodes" | grep 'supervisor')"

}

case $1 in
	list)
	list_clusters
	;;

	info)
	print_cluster_info $2
	;;
esac

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


Add linux alias script.

Add linux alias script.

shopt -s expand_aliases

alias py = python3
alias pytest = pytest3

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


List all branches and repositories

List all branches and repositories

find . -name .git -print0 | xargs -0 dirname | sort | cat > temp~
rm D:/GitHub/all-branches.txt
base_dir=$(pwd)
OIFS=$IFS
IFS=$(echo -en "\n\b")
while read -r line || [[ -n "$line" ]]; do
	cd $base_dir
	cd $line
	pwd
	pwd>>D:/GitHub/all-branches.txt
	(git branch --list --all)>>D:/GitHub/all-branches.txt
	# git fetch --all -v --dry-run
	# git pull --dry-run | grep -q -v 'Already up-to-date.' && changed=1
	echo ""
done < temp~
IFS=$OIFS
cd $base_dir
rm temp~

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


Klarna stuff

Klarna stuff

alias sbt='sbt -Dsbt.repository.config=./project/repositories $*'

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


orphan branch

orphan branch

# Create empty orphan branch for code review

git checkout --orphan code-review
git rm -rf .
git ci --allow-empty -m 'Code review - nuke all'
git push --set-upstream origin code-review

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


Added ssmtp script

Added ssmtp 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/rogierlommers/dotfiles.git/'


run orch server with 0 ays-retries

run orch server with 0 ays-retries

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/zero-os/0-orchestrator.git/'


Migration script update part III

Migration script update part III

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/robertkabat/story.git/'


Add search jarsgs

Add search jarsgs

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/eatcodenet/trainwatch.git/'


use /bin/echo

use /bin/echo

#!/bin/sh
set -e

if [ ! -f "$HOME/.gitconfig" -o "$1" = "--force" ]; then
  echo "configuring ~/.gitconfig"
  /bin/echo -n "your full name: "
  read user_name
  /bin/echo -n "your email: "
  read user_email
  /bin/echo -n "your github username: "
  read github_user
  /bin/echo -n "your github token: "
  read github_token

  cat > "$HOME/.gitconfig" <<GITCONFIG
[user]
  name = $user_name
  email = $user_email
[github]
  user = $github_user
  token = $github_token
[color]
  branch = auto
  diff = auto
  grep = auto
  interactive = auto
  pager = true
  showbranch = auto
  status = auto
  ui = auto
[core]
  excludesfile = $HOME/.gitignore
[instaweb]
  httpd = webrick
[push]
  default = tracking
GITCONFIG
else
  echo "existing ~/.gitconfig found, use --force to override"
fi

#!/bin/sh
set -e

if [ ! -f "$HOME/.gitconfig" -o "$1" = "--force" ]; then
  echo "configuring ~/.gitconfig"
  echo -n "your full name: "
  read user_name
  echo -n "your email: "
  read user_email
  echo -n "your github username: "
  read github_user
  echo -n "your github token: "
  read github_token

  cat > "$HOME/.gitconfig" <<GITCONFIG
[user]
  name = $user_name
  email = $user_email
[github]
  user = $github_user
  token = $github_token
[color]
  branch = auto
  diff = auto
  grep = auto
  interactive = auto
  pager = true
  showbranch = auto
  status = auto
  ui = auto
[core]
  excludesfile = $HOME/.gitignore
[instaweb]
  httpd = webrick
[push]
  default = tracking
GITCONFIG
else
  echo "existing ~/.gitconfig found, use --force to override"
fi


Create Extract-all-DFT.sh

Create Extract-all-DFT.sh

#!/bin/bash
# take out energy, dipole moment, polarizability and hyperpolarizability from DALTON DFT output file.
# run as loop over n files where for each n file  -2 to +2 additional files are available in the same folder.

# Will not work for CCSD output

echo "Enter the largest file index : "
read n # number of files
#read fname
fname="hyper_ccsd_c"

# ----- prepare folder to keep data ------
rm -rf property
mkdir -p  property

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

i=2 # file numbering starts from 0

while [ "$i" -le "$n" ]
do
k=-2
# echo $i
        mkdir  property/mode_$i
        while [ "$k" -le 2 ]
        do
        # echo "$fname"_"$i"_"$k".out
        ##############  Hyperpolarizability ##############
	grep -A 110  "DFT-QR computed in a linearly-scaling fashion." "$file" > temp
	tail -109 temp > temp2

	awk '{print $8 $9 $10}' temp2 > temp3

	sed -i 's/;/,/g' temp3
	sed -i 's/X/0/g' temp3
	sed -i 's/Y/1/g' temp3
	sed -i 's/Z/2/g' temp3

	# square brackets for python matrix assignment
	sed -i 's/(/[/g' temp3
	sed -i 's/)/]/g' temp3
	sed -i 's/,/][/g' temp3

	# post processing by python script to generate 3 matrices having the beta values.
	# the python script is generated dynamically to process the data.
	# three 3x3 matrices are extracted for Igor output.

	echo "# python script : generate hyperpolarizability tensor and also three matrices" > process_beta.py
	echo "import numpy as np" >> process_beta.py
	echo "beta=np.zeros((3,3,3))" >> process_beta.py
	cat temp3 >> process_beta.py
	cat rank3tensor_split.py >> process_beta.py
	python process_beta.py	# execute the script

        rm temp temp2 temp3
	# post processing to be done later to produce the itx file.
	exit 0

        echo ""
        # Polarizability
	# to be changed to new code for dft : get the written code , presently on varsh

	# present is for CCSD

        xx=$(grep "XDIPLEN  (unrel.) -0.0856   XDIPLEN  (unrel.)  0.0856" "$fname"_"$i"_"$k".out  | awk {'print $7'} )
        xy=$(grep "XDIPLEN  (unrel.) -0.0856   YDIPLEN  (unrel.)  0.0856" "$fname"_"$i"_"$k".out  | awk {'print $7'} )
        xz=$(grep "XDIPLEN  (unrel.) -0.0856   ZDIPLEN  (unrel.)  0.0856" "$fname"_"$i"_"$k".out  | awk {'print $7'} )
        yx=$(grep "YDIPLEN  (unrel.) -0.0856   XDIPLEN  (unrel.)  0.0856" "$fname"_"$i"_"$k".out  | awk {'print $7'} )
        yy=$(grep "YDIPLEN  (unrel.) -0.0856   YDIPLEN  (unrel.)  0.0856" "$fname"_"$i"_"$k".out  | awk {'print $7'} )
        yz=$(grep "YDIPLEN  (unrel.) -0.0856   ZDIPLEN  (unrel.)  0.0856" "$fname"_"$i"_"$k".out  | awk {'print $7'} )
        zx=$(grep "ZDIPLEN  (unrel.) -0.0856   XDIPLEN  (unrel.)  0.0856" "$fname"_"$i"_"$k".out  | awk {'print $7'} )
        zy=$(grep "ZDIPLEN  (unrel.) -0.0856   YDIPLEN  (unrel.)  0.0856" "$fname"_"$i"_"$k".out  | awk {'print $7'} )
        zz=$(grep "ZDIPLEN  (unrel.) -0.0856   ZDIPLEN  (unrel.)  0.0856" "$fname"_"$i"_"$k".out  | awk {'print $7'} )

        if [ -z  "$xx" ]; then xx=0 ; fi
        if [ -z  "$xy" ]; then xy=0 ; fi
        if [ -z  "$xz" ]; then xz=0 ; fi
        if [ -z  "$yx" ]; then yx=0 ; fi
        if [ -z  "$yy" ]; then yy=0 ; fi
        if [ -z  "$yz" ]; then yz=0 ; fi
        if [ -z  "$zx" ]; then zx=0 ; fi
        if [ -z  "$zy" ]; then zy=0 ; fi
        if [ -z  "$zz" ]; then zz=0 ; fi

        printf "Polarizability\n"
        echo "$xx,$xy,$xz"
#       echo "$yx,$yy,$yz"
#       echo "$zx,$zy,$zz"

        # Dipole moment part of output exported to a temp file (for DFT, same as CCSD)
	grep -A 10 "Dipole moment components" "$fname"_"$i"_"$k".out > muTemp
        mu_x=$(grep "      x     "  "muTemp" | awk {'print $2'} )
        mu_y=$(grep "      y     "  "muTemp" | awk {'print $2'} )
        mu_z=$(grep "      z     "  "muTemp" | awk {'print $2'} )

        if [ -z  "$mu_x" ]; then mu_x=0 ; fi
        if [ -z  "$mu_y" ]; then mu_y=0 ; fi
        if [ -z  "$mu_z" ]; then mu_z=0 ; fi

        echo " "
        printf "Dipole moment\n"
        echo "$mu_x,$mu_y,$mu_z"

        #Energy
        # new code updated for DFT
	en = $(grep -A 100 "End of optimization            :       T" dft_opt_freq_beta_benzene_TZ.out | grep "Total energy"| awk '{print $3}')
        #	en=$(grep "            Total CCSD  energy:         " "$fname"_"$i"_"$k".out   | awk {'print $4'} | xargs| awk {'print $1'}  )
        #	echo "energy:"."$en"

        echo " "
        printf "Energy\n"
        echo "$en"

        # FORMATTING AND SAVING OUTPUT FILES ------------------------------------------------
        # making temporary file for hyper-polarizability
        echo " "
        b0=("$xxx" "$xyx" "$xzx" "$xxy" "$xyy" "$xzy" "$xxz" "$xyz" "$xzz")
        printf '%s\n' "${b0[@]}" > tempb0.txt
        # rm tempb0.txt
        # printf '%s\n' "${b0[@]}" >> tempb0.txt

        b1=("$yxx" "$yyx" "$yzx" "$yxy" "$yyy" "$yzy" "$yxz" "$yyz" "$yzz")
        printf '%s\n' "${b1[@]}" > tempb1.txt
        #rm tempb1.txt
        #printf '%s\n' "${b1[@]}" >> tempb1.txt

        b2=("$zxx" "$zyx" "$zzx" "$zxy" "$zyy" "$zzy" "$zxz" "$zyz" "$zzz")
        printf '%s\n' "${b2[@]}" > tempb2.txt
        #rm tempb2.txt
        #printf '%s\n' "${b2[@]}" >> tempb2.txt

        # echo "----------------------------------------"

        # format to a 2D matrix and save as .itx
        # beta_x (b0)
#        pr -t -3  tempb0.txt > b0.txt
        sed -i '1s/^/IGOR\n/'  b0.txt
        sed -i '2s|^|WAVES /D /N=(3,3) b'"$i"0"$k"'\n|' "b0.txt"
        sed -i '3s/^/BEGIN\n/' b0.txt
        echo -e 'END' >> b0.txt
        sed -i "2 s/b/'b/;2 s/$/'/" b0.txt
        cat b0.txt > property/mode_$i/b"$i"0"$k".itx

        #sed "s|b'"$i"'0'"$k"'|\'b'"$i"'0'"$k"'\'|g" property/mode_$i/b"$i"0"$k".itx

        # beta_y (b1)
#        pr -t -3  tempb1.txt > b1.txt
        sed -i '1s/^/IGOR\n/' b1.txt
        sed -i '2s|^|WAVES /D /N=(3,3) b'"$i"1"$k"'\n|' "b1.txt"
        sed -i '3s/^/BEGIN\n/' b1.txt
        echo -e 'END' >> b1.txt
        sed -i "2 s/b/'b/;2 s/$/'/" b1.txt
        cat b1.txt > property/mode_$i/b"$i"1"$k".itx

        # beta_z (b2)
#        pr -t -3  tempb2.txt > b2.txt
        sed -i '1s/^/IGOR\n/' b2.txt
        sed -i '2s|^|WAVES /D /N=(3,3) b'"$i"2"$k"'\n|' "b2.txt"
        sed -i '3s/^/BEGIN\n/' b2.txt
        echo -e 'END' >> b2.txt
        sed -i "2 s/b/'b/;2 s/$/'/" b2.txt
        cat b2.txt > property/mode_$i/b"$i"2"$k".itx

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

        # making temporary file for polarizability

        a=("$xx" "$yx" "$zx"  "$xy" "$yy" "$zy"  "$xz" "$yz"  "$zz")
        printf '%s\n' "${a[@]}" > tempa.txt
        # format to a 2D matrix and save as .itx
        pr -t -3  tempa.txt > a.txt
        sed -i '1s/^/IGOR\n/' a.txt
        sed -i '2s|^|WAVES /D /N=(3,3) a'"$i""$k"'\n|' "a.txt"
        sed -i '3s/^/BEGIN\n/' a.txt
        echo -e 'END' >> a.txt
        sed -i "2 s/a/'a/;2 s/$/'/" a.txt
        cat a.txt > property/mode_$i/a$i$k.itx

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

        # making temporary file for  dipole moment
        dm=("$mu_x" "$mu_y" "$mu_z" )
        printf '%s\n' "${dm[@]}" > tempdm.txt
        # format to a 1D matrix and save as .itx
        sed -i '1s/^/IGOR\n/' tempdm.txt
        sed -i '2s|^|WAVES /D /N=(3,1) dm'"$i""$k"'\n|' "tempdm.txt"
        sed -i '3s/^/BEGIN\n/' tempdm.txt
        echo -e 'END' >> tempdm.txt
        sed -i "2 s/dm/'dm/;2 s/$/'/" tempdm.txt
        cat tempdm.txt > property/mode_$i/dm$i$k.itx
        # ----------------------------------------

        # making temporary file for  energy
        e=("$en")
        printf '%s\n' "${e[@]}" > tempen.txt
        sed -i '1s/^/IGOR\n/' tempen.txt
        sed -i '2s|^|WAVES /D en'"$i""$k"'\n|' "tempen.txt"
        sed -i '3s/^/BEGIN\n/' tempen.txt
        echo -e 'END' >> tempen.txt
        sed -i "2 s/en/'en/;2 s/$/'/" tempen.txt
        cat tempen.txt> property/mode_$i/e$i$k.itx
        # format to a 1D matrix and save as .itx

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

        echo "----------------------------------------"

        ((k++))
        done

((i++))
done
rm tempb0.txt tempb1.txt tempb2.txt  tempdm.txt tempa.txt tempen.txt
echo " data extracted"

error: pathspec 'DFT/Extract-all-DFT.sh' did not match any file(s) known to git


pcapdump script

pcapdump script

#!/bin/sh

# Capture packets on time-limited files

# For discussion of the choice of pcapdump, see the file doc/Capture.md

# binaries needed, change accordingly
# pcapdump is at https://packages.debian.org/sid/pcaputils
PCAPDUMP="/usr/local/bin/pcapdump"
IFCONFIG="/sbin/ifconfig"
NTPDATE="/usr/sbin/ntpdate"
BC="/bin/bc"

# Interfaces to capture packets
# if you want to specify more than one, separate by spaces
# EXAMPLE
# IFACES="em0 em1"
# **CHANGE THIS** accordingly
#IFACES="em0 em1"
IFACES=""

# ** Destinations **
# If you want to select traffic directed to a specific address
# add it here
DESTINATIONS=""

# Want queries only?
# if you only want queries *AND* responses, switch it to "no"
QUERIES_ONLY="yes"

# Want v6 traffic?
DO_V6="yes"

# Want TCP traffic?
DO_TCP="yes"

# Want IP fragments?
DO_FRAGS="yes"

# Exclude patterns
NO_PAT=""

# ** Interval **
# This value defines the amount of seconds each pcap file will contain.
# We suggest 10-minutes files (600 seconds), but you can change it if
# you receive a lot of traffic
INTERVAL=""

# Start and Stop time
# The collection process will work within this time-window.  If the
# start_time is in the future, will sleep until it's time to work.
# The collection won't go beyond STOP_T if it's given.

# NOTE: The start and stop times are interpreted as UTC.  Do not
# convert them to your local time zone.
#
#START_T='2010-04-13 13:00:00'
#STOP_T='2010-04-16 00:00:00'

# Program to run to handle a file
# Each time a INTERVAL is completed, will execute this code
#KICK_CMD="./pcap-submit-to-oarc.sh"
#KICK_CMD="sh data-commit.sh $SAVEDIR"

# Unique name of the node where data is being collected.
# Please make sure that no two instances of pcapdump use the
# same NODENAME!
#if [ `uname` = "Linux" ]; then
#    NODENAME=`hostname --fqdn`
#else
    NODENAME=`hostname`
#fi

# You can set SAVEDIR to a directory with lots of free space
# where the pcap files will be staged or stored
SAVEDIR=""

KICK_CMD=""
#
# End of configurable options
#

# Read local definitions if there is any
# You can use this file to set your own values without modifying this
# script
if [ -s settings.sh ]; then
    . ./settings.sh $SAVEDIR
fi

# Command line construction for pcapdump
set -- -t "${INTERVAL}" -w "${SAVEDIR}/${NODENAME}" -m qun
if [ ! -z "${START_T}" ]; then
    set -- "$@" -B "${START_T}"
fi
if [ ! -z "${STOP_T}" ]; then
    set -- "$@" -E "${STOP_T}"
fi
if [ ! -z "${KICK_CMD}" ]; then
    set -- "$@" -k "${KICK_CMD}"
fi

# Validate the programs I'm expecting to use
for prog in ${PCAPDUMP} ${IFCONFIG} ${NTPDATE} ${BC}; do
if [ ! -x ${prog} ] ; then
    echo "${prog} is not executable, aborting!"
    exit 1
fi
done

if [ ! -d ${SAVEDIR} ]; then
    mkdir -p ${SAVEDIR}
fi

# Check if this script is running as root
if test -z "$UID" ; then
	UID=`id -u`
fi
if [ "${UID}" != "0" ]; then
    echo "Must run as root!"
    exit 1
fi
echo "Passed running-as-root check"

# Check if the IFACES values are valid
for IFACE in ${IFACES}; do
    IFACE_CHECK=`${IFCONFIG} ${IFACE}`
    if [ $? != "0" ]; then
        echo "Interface ${IFACE} checking failed!"
        echo "${IFACE_CHECK}"
        exit 1
    fi
    set -- "$@" -i "${IFACE}"
done
echo "Passed interface checks"

# Check INTERVAL is a number
echo $INTERVAL | egrep '^[0-9]+$' >/dev/null 2>&1
if [ $? != "0" ]; then
    echo "The interval ${INTERVAL} given is not a number, aborting"
    exit 1
fi

# NTP Check
# Verifies if the clocks are properly synchronized
NTP_CHECK=`${NTPDATE} -q pool.ntp.org`
if [ $? != "0" ]; then
    echo "NTP check failed!"
    echo $NTP_CHECK
    exit 1
fi
# Now verify if offset is lower than certain threshold
NTP_OFFSET=`echo $NTP_CHECK | grep offset | head -1 | cut -d, -f3 | cut -d' ' -f3`
# Shell don't do float arithmetic, so we use bc for comparison
OFFSET_THRESHOLD="0.5"
if [ $(echo "${NTP_OFFSET} > ${OFFSET_THRESHOLD}" | bc) -eq 1 ]; then
    echo "Your clock is skewed by ${NTP_OFFSET} seconds!"
    echo "We suggest a clock sync, Aborting"
    exit 1
fi
echo "Passed NTP check"

# Build some of the command line options

BPF_filter="port 53"

# Check the list of destinations
if [ ! -z ${DESTINATIONS} ]; then
    echo "Capturing only for ${DESTINATIONS}"
    BPF_filter="${BPF_filter} and ("
    for DEST in ${DESTINATIONS}; do
        BFP_filter="${BPF_filter} or dst host ${DEST} "
    done
    BPF_filter="${BPF_filter})"
fi

if [ "${QUERIES_ONLY}" != "" ]; then
    echo "Ignoring option QUERIES_ONLY=${QUERIES_ONLY} (unsupported)"
fi

# Include v6 traffic?
if [ "${DO_V6}" = "yes" ]; then
    echo "Capturing IPv6"
    BPF_filter="${BPF_filter} and (ip or ip6)"
else
    echo "Not capturing IPv6"
    BPF_filter="${BPF_filter} and ip"
fi

# Include TCP traffic?
if [ "${DO_TCP}" = "yes" ]; then
    echo "Capturing TCP"
    BPF_filter="${BPF_filter} and (tcp or udp)"
else
    echo "Not capturing TCP"
    BPF_filter="${BPF_filter} and udp"
fi

# Include IP fragments?
if [ "${DO_FRAGS}" = "yes" ]; then
    echo "Ignoring option DO_FRAGS (unsupported)"
fi

# Exclude Patterns
if [ ! -z ${NO_PAT} ]; then
    echo "Ignoring option NO_PAT=${NO_PAT} (unsupported)"
fi

CMD="${PCAPDUMP} -f ${BPF_filter}"
echo "Executing '${CMD}'"
${PCAPDUMP} "$@" &

error: pathspec 'script/monitor-external/capture-pcapdump.sh' did not match any file(s) known to git


Remove unnecessary path assignment.

Remove unnecessary path assignment.

export PATH="/usr/local/bin:$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"


quickfix

quickfix

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/janschlotte/dot-zsh.git/'


Added startup script

Added startup script

NODE_ENV=production forever start -a -l ten20api.log ./index.js --port 4000 -dbname ten20stage

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


Create sample.sh

Create sample.sh

#!/usr/bin/env bash

dir=$(dirname "$0")

if [ ! -d "${dir}/data" ]; then
    echo 'downloading data'
    "${dir}/downloaddata.sh"
fi

echo 'plotting coordinates'
scatter --file "${dir}/data/texas.txt"

echo 'with x and y coords'
scatter -x "${dir}/data/x_test.txt" -y "${dir}/data/y_test.txt"

echo 'plotting a histogram'
hist --file "${dir}/data/exp.txt"

echo 'with colors'
hist --file "${dir}/data/exp.txt" --colour blue

echo 'changing the shape of the point'
hist --file "${dir}/data/exp.txt" --pch .

#echo 'using stdin'
#curl -sL https://dl.dropbox.com/u/49171662/example.txt | hist

#echo 'getting data from a webpage'
#curl -s 'http://www.baseball-reference.com' |
#grep  -o -E '[$][0-9]+' | grep -o -E '[0-9]+' |
#hist -b 20 -t 'Baseball Payrolls' --height 20 --pch '*'

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


Removing duplicated aliases

Removing duplicated aliases

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


#Centipede temporarily increase the limit in instrumentation_test.sh

PiperOrigin-RevId: 475432914

#!/bin/bash

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

# This sh_test checks the size of the pc table generated by a tiny fuzz target.
# If the pc table is not small, it means some redundant instrumentation
# is applied to the runner library.

set -eu

source "$(dirname "$0")/../test_util.sh"

# Max allowed PC table size. Set to the current de facto value.
ALLOWED_SIZE=1200

target="$(centipede::get_centipede_test_srcdir)/testing/empty_fuzz_target"
pc_table="${TEST_TMPDIR}/pc_table"

# Dump the pc table on disk.
CENTIPEDE_RUNNER_FLAGS=":dump_pc_table:arg1=${pc_table}:" "${target}"

# Check the pc table size.
size=$(stat -c %s "${pc_table}")
echo "pc table size: ${size}"
(( size < 1 )) && die "pc table is too small: ${size}"
(( size > ALLOWED_SIZE )) && die "pc table is too large: ${size}"

echo "PASS"

#!/bin/bash

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

# This sh_test checks the size of the pc table generated by a tiny fuzz target.
# If the pc table is not small, it means some redundant instrumentation
# is applied to the runner library.

set -eu

source "$(dirname "$0")/../test_util.sh"

# Max allowed PC table size. Set to the current de facto value.
ALLOWED_SIZE=1120

target="$(centipede::get_centipede_test_srcdir)/testing/empty_fuzz_target"
pc_table="${TEST_TMPDIR}/pc_table"

# Dump the pc table on disk.
CENTIPEDE_RUNNER_FLAGS=":dump_pc_table:arg1=${pc_table}:" "${target}"

# Check the pc table size.
size=$(stat -c %s "${pc_table}")
echo "pc table size: ${size}"
(( size < 1 )) && die "pc table is too small: ${size}"
(( size > ALLOWED_SIZE )) && die "pc table is too large: ${size}"

echo "PASS"


Symlinked .ssh

Symlinked .ssh

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/jedediahfrey/FreeNAS-Gogs.git/'


Add testcase for merging in a CRLF repo

Add testcase for merging in a CRLF repo

If you work on a repo with core.autocrlf == true, you would expect
every text file to have CRLF EOLs. However, if you by some operation,
get a conflict, then the conflicted file has LF EOLs.

Now, of course you'd go about resolving the files conflict, and then 'git
add <file>'. When you do that, you'll get the warning saying that LF will
be replaced by CRLF. Then you commit. The end result is that you have a
workingdir with a mix of LF and CRLF files, which after some more
operations may trigger a "whole file changed" diff, due to the workingdir
file now having LF EOLs.

An LF only conflict file results in the resolved file being in LF,
the commit is in LF and a warning saying that LF will be replaced
by CRLF, and the working dir ends up with a mix of CRLF and LF files.

Signed-off-by: Marius Storm-Olsen <38edb439dbcce85f0f597d90d338db16e5438073@trolltech.com>
Signed-off-by: Johannes Schindelin <53fb8db7833fca1e1746dd8592f61048d350f64c@gmx.de>
Signed-off-by: Junio C Hamano <a6723cc3f76163bf7adb636a73ac3b0ceb3e6b9b@pobox.com>

#!/bin/sh

append_cr () {
	sed -e 's/$/Q/' | tr Q '\015'
}

remove_cr () {
	tr '\015' Q | sed -e 's/Q$//'
}

test_description='merge conflict in crlf repo

		b---M
	       /   /
	initial---a

'

. ./test-lib.sh

test_expect_success setup '
	git config core.autocrlf true &&
	echo foo | append_cr >file &&
	git add file &&
	git commit -m "Initial" &&
	git tag initial &&
	git branch side &&
	echo line from a | append_cr >file &&
	git commit -m "add line from a" file &&
	git tag a &&
	git checkout side &&
	echo line from b | append_cr >file &&
	git commit -m "add line from b" file &&
	git tag b &&
	git checkout master
'

test_expect_success 'Check "ours" is CRLF' '
	git reset --hard initial &&
	git merge side -s ours &&
	cat file | remove_cr | append_cr >file.temp &&
	test_cmp file file.temp
'

test_expect_failure 'Check that conflict file is CRLF' '
	git reset --hard a &&
	test_must_fail git merge side &&
	cat file | remove_cr | append_cr >file.temp &&
	test_cmp file file.temp
'

test_done

error: pathspec 't/t6033-merge-crlf.sh' did not match any file(s) known to git


lib.bash: add missing info level

lib.bash: add missing info level

Screw texinfo.

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/grawity/hacks.git/'


add simple script to run test

add simple script to run test

#!/bin/sh

if [ $# == 5 ]; then
	../feeder/simple_feeder.py $1 | java -jar target/CsparqlShim-0.0.1.jar $2 $3 $4 $5
else
	echo "not enough parameters"
	echo "usage: run_test <streaming_data_file> <static_data_file> <query_file> <streaming_pause_period> <triple_pause_period>"
fi

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


atomic_atomic.sh: New bug.

atomic_atomic.sh: New bug.

git-svn-id: 3f5418f4deb1796ec361794c2e3ca0aec3c9c1fd@3005 0e562018-b8fb-0310-a933-ecf073c7c197

#! /bin/bash -e
# -----------------------------------------------------------------------------
# Bug when result of an atomic fucntion is used as argument to another
# atomic function (and the tape is optimized)
# -----------------------------------------------------------------------------
if [ ! -e build ]
then
	mkdir build
fi
cd build
echo "$0"
name=`echo $0 | sed -e 's|.*/||' -e 's|\..*||'`
cat << EOF > $name.cpp
# include <cppad/cppad.hpp>

namespace {
	using CppAD::vector;
	using CppAD::AD;

	class atomic_user : public CppAD::atomic_base<double> {
	public:
		atomic_user(const std::string& name) :
			CppAD::atomic_base<double>(name) {}
	private:
		virtual bool forward(
			size_t                     q , // lowest order Taylor coeff
			size_t                     p , // highest order Taylor coeff
			const vector<bool>&       vx , // which x elements are variables
			vector<bool>&             vy , // which y elements are variables
			const vector<double>&     tx , // input vector of x
			vector<double>&           ty ) // output vector of y
		{
			if( vx.size() > 0 )
				vy[0] = vx[0];

			if ((q <= 0) && (p == 0))
			{	ty[0] = tx[0];
				return true;
			}
			return false;
		}
	}; // end class
}
int main()  {
	atomic_user func("atomic_user");
	size_t n = 1;
	vector< AD<double> > ax(n), ay(1), au(1), av(1);
	vector<double> x(n), y_before(1), y_after(1);

	ax[0] = x[0] = 3.0;
	CppAD::Independent(ax);
	//
	au[0] = ax[0];
	func(au, av);
	//
	au[0] = av[0];
	func(au, av);
	//
	ay[0] = av[0];

	CppAD::ADFun<double> f;
	f.Dependent(ax,ay);

	y_before = f.Forward(0,x);
	f.optimize();
	y_after = f.Forward(0,x);

	if( fabs( y_before[0] - y_after[0] ) <= 1e-5 )
		std::cout << "opt_atomic: OK" << std::endl;
	else	std::cout << "opt_atomic: Error" << std::endl;
	return(0);
}
EOF
echo "g++ -I../.. --std=c++11 -g $name.cpp -o $name"
g++ -I../.. --std=c++11 -g $name.cpp -o $name
#
echo "./$name"
./$name
#
echo "rm $name $name.cpp"
rm $name $name.cpp

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


refs #100694 Note CCN_TEST_CPU_LIMIT in testdir/config.defaults

# Source file: util/ccntestloop.sh
#
# Part of the CCNx distribution.
#
# Copyright (C) 2010-2012 Palo Alto Research Center, Inc.
#
# This work is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License version 2 as published by the
# Free Software Foundation.
# This work is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.
#

#
# ccntestloop runs the ccnx unit tests repeatedly.
#
# This is intended to be run from the top level of the ccnx distribution.
# Results of the test runs are kept in the testdir subdirectory, which is
# created if necessary.  However, testdir may be a symlink to another
# directory (preferably on the same file system).  It is advisable to
# link to some location outside of the workspace to avoid loss of test
# results due to a "git clean" command.
#
# The testdir/config will be sourced as a sh script upon startup.  This allows
# the environment variables to be set up for the next round.  Creative use
# of this allows for such things as testing various combinations of parameters
# on each run.  Look in testdir/config.defaults for examples.
#
# There is provision for customization by means of executable hooks
# called at various stages:
# If testdir/hooks/update is present and executable, it will be executed
# to update sources befor each run.  If it returns non-zero status, the
# testing will be stopped.  The default behavior is to pull from a configurable
# git branch unless modifed files are present.
# If testdir/hooks/success is present and executable, it will be executed
# after every successful run.  It should return a status of 0 to continue
# on to the next run, or nonzero to stop.  The default is to continue.
# If testdir/hooks/failure is present and executable, it will be executed
# after every unsuccessful run.  The status checked in the same way, but
# the default is to stop.
# The run number is passed as a argument to these hooks.
#
# One recommended strategy is to set up testdir/hooks/failure to notify
# you of the failure and then stop.  Then set up a cron job to start the
# test loop several times per day (and do nothing if it is running).
# That way you end up with a bounded number of failures to look at each day,
# but when all is well you test continuously.
#

Usage () {
cat << EOM >&2
usage: ccntestloop [ start | stop | restart | status ]
With no argument test run in foreground
(Must be run from the top level of a ccnx source tree.)
EOM
exit 1
}

Defaults () {
CCN_TEST_GITCOMMAND=`command -v git || echo :`
test -d .git || CCN_TEST_GITCOMMAND=:

cat << EOF
# EDIT config, NOT config.defaults
# Control the overall log level of the java tests.
CCN_LOG_LEVEL_ALL=WARNING

# These may be used to contol which tests are run.
# Leave empty for the default set. Say NO for none.
CCN_CTESTS=
CCN_JAVATESTS=

# Occasionally a different make program is needed.
MAKE=make

# These are only used if hooks/update is not present
CCN_TEST_BRANCH=HEAD
CCN_TEST_GITCOMMAND=$CCN_TEST_GITCOMMAND

# Limit the CPU time used per process in tests, in seconds (no default)
CCN_TEST_CPU_LIMIT=""
EOF
}

GetConfiguration () {
	Defaults > testdir/config.defaults || Fail testdir/config.defaults
	# Export all variables set while reading config
	set -a
	rm -f testdir/config~
	. testdir/config.defaults
	test -f testdir/config && . testdir/config && \
		cp testdir/config testdir/config~
	set +a
}

Echo () {
	echo "$*" >&2
}

Fail () {
	Echo '***' Failed - "$*"
	exit 1;
}

CheckLogLevel () {
	case ${CCN_LOG_LEVEL_ALL} in
		OFF) ;;
		SEVERE) ;;
		WARNING) ;;
		INFO) ;;
		CONFIG) ;;
		FINE) ;;
		FINER) ;;
		FINEST) ;;
		ALL) ;;
		*) Fail CCN_LOG_LEVEL_ALL=$CCN_LOG_LEVEL_ALL is invalid.
	esac
}

CheckDirectory () {
	test -d javasrc || Fail ccntestloop is intended to be run at the top level of ccnx
	test -d testdir/. || mkdir testdir
	mkdir -p testdir/hooks
}

BackgroundPID () {
	if [ -f testdir/ccntestloop.pid ]; then
		PID=`cat testdir/ccntestloop.pid`
		kill -0 "$PID" 2>/dev/null || return 1
		echo ${1:-''}$PID
		return 0
	fi
	return 1
}

SetPIDFile () {
	if [ -f testdir/ccntestloop.pid ]; then
		PID=`cat testdir/ccntestloop.pid`
		test "$PID" = $$ && return 0
		kill -0 "$PID" 2>/dev/null && Fail ccntestloop already running as pid $PID
		rm testdir/ccntestloop.pid || Fail could not remove old pid file
	fi
	echo $$ > testdir/ccntestloop.pid || Fail could not write pid file
}

RemovePIDFile () {
	test "`cat testdir/ccntestloop.pid`" = $$ && rm -f testdir/ccntestloop.pid
}

CheckTestout () {
	test -d javasrc/testout               && \
	  rm -rf javasrc/testout~             && \
	  mv javasrc/testout javasrc/testout~ && \
	  Echo WARNING: existing javasrc/testout renamed to javasrc/testout~
}

PrintDetails () {
	uname -a
	env | grep ^CCN
	$CCN_TEST_GITCOMMAND rev-list --max-count=1 HEAD
	$CCN_TEST_GITCOMMAND status
	$CCN_TEST_GITCOMMAND diff | cat
	head -999 csrc/conf.mk testdir/config~ 2>/dev/null
}

SaveLogs () {
	test -d javasrc/testout || return 1
	if [ -f javasrc/testout/KILLED ]; then
		rm -rf javasrc/testout
		exit
	fi
	PrintDetails > javasrc/testout/TEST-details.txt
	mv javasrc/testout testdir/testout.$1 || return 1
	PrintTimesForRun $1
	true
}

PruneOldLogs () {
	# Leave 20 most recent successes
	(cd testdir; rm -rf `ls -dt testout.*[0123456789] | tail -n +20`; )
	true
}

UpdateSources () {
	Echo Updating for run $1
	cp csrc/util/ccntestloop.sh testdir/.~ctloop~
	if [ -x testdir/hooks/update ]; then
		testdir/hooks/update $1 || Fail testdir/hooks/update
		return 0
	fi
	$CCN_TEST_GITCOMMAND status | grep modified:        && \
	  Echo Modifications present - skipping update      && \
	  sleep 3 && return
	$CCN_TEST_GITCOMMAND checkout $CCN_TEST_BRANCH      && \
	  $CCN_TEST_GITCOMMAND pull origin $CCN_TEST_BRANCH
}

SourcesChanged () {
	: For now, always rebuild
	true
}

ScriptChanged () {
	diff testdir/.~ctloop~ csrc/util/ccntestloop.sh && return 1
	return 0 # Yes, it changed.
}

NoteTimes () {
	LC_ALL=C times > javasrc/testout/$1.times
}

# Use saved before-and-after outputs of times(1) to compute cpu times used
DiffTimes () {
	test -f $1 || return
	test -f $2 || return
	paste $2 $1  | \
		tr 'ms' '  ' | \
		while read A B C D  a b c d  etc; do
			echo 3 k
			echo $A 60 '*' $B + $a 60 '*' $b + - p
			echo $C 60 '*' $D + $c 60 '*' $d + - p
			echo + p
		done | dc | xargs echo $3
}

PrintTimesForRun () { (
	cd testdir/testout.$1 || return
	DiffTimes postb.times postc.times "RUN $1 CTSTTIMES"
	DiffTimes postc.times postj.times "RUN $1 JAVATIMES"
) }

Rebuild () {
	Echo Building for run $1
	LOG=javasrc/testout/TEST-buildlog.txt
	mkdir -p javasrc/testout
	(./configure && $MAKE; ) > $LOG 2>&1
	if [ $? -eq 0 ]; then
		NoteTimes postb
		return 0
	fi
	tail $LOG
	Echo build failed
	return 1
}

LimitCPU () {
	test -z "$CCN_TEST_CPU_LIMIT" && return
	ulimit -t $CCN_TEST_CPU_LIMIT
}

RunCTest () {
	test "${CCN_CTESTS:=}" = "NO" && return 0
	Echo Running csrc tests...
	LOG=javasrc/testout/TEST-csrc-testlog.txt
	mkdir -p javasrc/testout
	(LimitCPU; cd csrc && $MAKE test TESTS="$CCN_CTESTS" 2>&1 ) > $LOG
	STATUS=$?
	NoteTimes postc
	test $STATUS -eq 0 && return 0
	tar cf javasrc/testout/csrc-tests.tar csrc/tests csrc/exttests/*.???
	gzip javasrc/testout/csrc-tests.tar
	grep ^FAILING: $LOG | tee -a javasrc/testout/TEST-failures.txt
	Echo csrc tests failed
	return 1
}

RunJavaTest () {
	test "${CCN_JAVATESTS:-}" = "NO" && return 0
	Echo Running javasrc tests...
	LOG=javasrc/testout/TEST-javasrc-testlog.txt
	(LimitCPU; cd javasrc && \
	  ant -DCHATTY=${CCN_LOG_LEVEL_ALL}             \
	      -DTEST_PORT=${CCN_LOCAL_PORT_BASE:-63000} \
	      ${CCN_JAVATESTS:-test}; ) > $LOG
	STATUS=$?
	NoteTimes postj
	test $STATUS -eq 0 && return 0
	grep -B1 -e 'junit. Tests .*Failures: [^0]' \
	         -e 'junit. Tests .*Errors: [^0]'   \
	     $LOG 2>/dev/null | tee -a javasrc/testout/TEST-failures.txt
	Echo javasrc tests failed
	return 1
}

RunTest () {
	Echo Starting run $1 at `date`
	RunCTest && RunJavaTest && SaveLogs $1 && PruneOldLogs && return 0
	SaveLogs $1.FAILED
	return 1
}

LastRunNumber () {
	ls -td testdir/testout.* 2>/dev/null | head -n 1 | cut -d . -f 2
}

ThisRunNumber () {
	echo $((`LastRunNumber` + 1))
}

ExecSelf () {
	exec sh csrc/util/ccntestloop.sh || Fail exec
}

StartBackground () {
	BackgroundPID 'ccntestloop already running as pid ' && return 1
	sh -c "sh csrc/util/ccntestloop.sh &" < /dev/null >> testdir/log 2>&1
}

# Gather up the list of descendants
Descendants () { (
	export LANG=C
	ps -U `id -u` -o ppid,pid | \
	  while read ppid pid; do echo =$ppid= $pid; done > mypids
	echo $1 > killpids
	while true; do
		PATS=`while read i; do echo " -e =$i="; done < killpids`
		grep $PATS mypids | cut -d ' ' -f 2 > morepids
		cat killpids morepids | sort -u > newkillpids
		cmp killpids newkillpids >/dev/null 2>/dev/null && break
		mv newkillpids killpids
	done
	echo `grep -v "^$1" killpids`
	rm killpids newkillpids morepids mypids
) }

StopBackground () {
	PID=`BackgroundPID`
	test -z "$PID" && return 1
	VICTIMS=`Descendants $PID`
	sh -c "echo $PID $VICTIMS >> javasrc/testout/KILLED" 2>/dev/null
	kill -HUP $PID
	kill $VICTIMS 2>/dev/null
	echo STOPPED >> testdir/log
	sleep 1
	kill -9 $VICTIMS 2>/dev/null
}

Status () {
	test -f testdir/log && tail -n 9 testdir/log
	BackgroundPID 'ccntestloop running as pid '
	STATUS=$?
	test $STATUS = 0 || echo ccntestloop not running
	return $STATUS
}

FailHook () {
	if [ -x testdir/hooks/failure ]; then
		testdir/hooks/failure $1 && sleep 10 && ExecSelf
	fi
	Fail run $1 failed - stopping
}

# Finally, here's what we actually want to do
CheckDirectory

GetConfiguration

CheckLogLevel

if [ $# -gt 1 ]; then
	Usage
fi

case "${1:---}" in
	--)      ;;
	-*)      Usage;;
	start)   StartBackground; exit $?;;
	stop)    StopBackground; exit 0;;
	restart) StopBackground; StartBackground; exit $?;;
	status)  Status; exit $?;;
	*)       Usage;;
esac

SetPIDFile
trap RemovePIDFile EXIT

CheckTestout

RUN=`ThisRunNumber`

UpdateSources $RUN

if ScriptChanged; then
	Echo "*** Script changed - will clean and restart"
	$MAKE clean >.make.clean.log 2>&1|| Fail make clean - see .make.clean.log
	rm -f .make.clean.log
	echo Pausing for 10 seconds before restart...
	sleep 10
	ExecSelf
fi

if SourcesChanged; then
	Rebuild $RUN || Fail make
fi

RunTest $RUN || FailHook $RUN
Echo Run number $RUN was successful
Echo BUILD Failure rate is `ls -d testdir/testout*FAILED 2>/dev/null | wc -l` / $RUN
if [ -x testdir/hooks/success ]; then
	testdir/hooks/success $RUN || exit 0
fi
sleep 2
ExecSelf

# Source file: util/ccntestloop.sh
#
# Part of the CCNx distribution.
#
# Copyright (C) 2010-2012 Palo Alto Research Center, Inc.
#
# This work is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License version 2 as published by the
# Free Software Foundation.
# This work is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.
#

#
# ccntestloop runs the ccnx unit tests repeatedly.
#
# This is intended to be run from the top level of the ccnx distribution.
# Results of the test runs are kept in the testdir subdirectory, which is
# created if necessary.  However, testdir may be a symlink to another
# directory (preferably on the same file system).  It is advisable to
# link to some location outside of the workspace to avoid loss of test
# results due to a "git clean" command.
#
# The testdir/config will be sourced as a sh script upon startup.  This allows
# the environment variables to be set up for the next round.  Creative use
# of this allows for such things as testing various combinations of parameters
# on each run.  Look in testdir/config.defaults for examples.
#
# There is provision for customization by means of executable hooks
# called at various stages:
# If testdir/hooks/update is present and executable, it will be executed
# to update sources befor each run.  If it returns non-zero status, the
# testing will be stopped.  The default behavior is to pull from a configurable
# git branch unless modifed files are present.
# If testdir/hooks/success is present and executable, it will be executed
# after every successful run.  It should return a status of 0 to continue
# on to the next run, or nonzero to stop.  The default is to continue.
# If testdir/hooks/failure is present and executable, it will be executed
# after every unsuccessful run.  The status checked in the same way, but
# the default is to stop.
# The run number is passed as a argument to these hooks.
#
# One recommended strategy is to set up testdir/hooks/failure to notify
# you of the failure and then stop.  Then set up a cron job to start the
# test loop several times per day (and do nothing if it is running).
# That way you end up with a bounded number of failures to look at each day,
# but when all is well you test continuously.
#

Usage () {
cat << EOM >&2
usage: ccntestloop [ start | stop | restart | status ]
With no argument test run in foreground
(Must be run from the top level of a ccnx source tree.)
EOM
exit 1
}

Defaults () {
CCN_TEST_GITCOMMAND=`command -v git || echo :`
test -d .git || CCN_TEST_GITCOMMAND=:

cat << EOF
# EDIT config, NOT config.defaults
# Control the overall log level of the java tests.
CCN_LOG_LEVEL_ALL=WARNING

# These may be used to contol which tests are run.
# Leave empty for the default set. Say NO for none.
CCN_CTESTS=
CCN_JAVATESTS=

# Occasionally a different make program is needed.
MAKE=make

# These are only used if hooks/update is not present
CCN_TEST_BRANCH=HEAD
CCN_TEST_GITCOMMAND=$CCN_TEST_GITCOMMAND
EOF
}

GetConfiguration () {
	Defaults > testdir/config.defaults || Fail testdir/config.defaults
	# Export all variables set while reading config
	set -a
	rm -f testdir/config~
	. testdir/config.defaults
	test -f testdir/config && . testdir/config && \
		cp testdir/config testdir/config~
	set +a
}

Echo () {
	echo "$*" >&2
}

Fail () {
	Echo '***' Failed - "$*"
	exit 1;
}

CheckLogLevel () {
	case ${CCN_LOG_LEVEL_ALL} in
		OFF) ;;
		SEVERE) ;;
		WARNING) ;;
		INFO) ;;
		CONFIG) ;;
		FINE) ;;
		FINER) ;;
		FINEST) ;;
		ALL) ;;
		*) Fail CCN_LOG_LEVEL_ALL=$CCN_LOG_LEVEL_ALL is invalid.
	esac
}

CheckDirectory () {
	test -d javasrc || Fail ccntestloop is intended to be run at the top level of ccnx
	test -d testdir/. || mkdir testdir
	mkdir -p testdir/hooks
}

BackgroundPID () {
	if [ -f testdir/ccntestloop.pid ]; then
		PID=`cat testdir/ccntestloop.pid`
		kill -0 "$PID" 2>/dev/null || return 1
		echo ${1:-''}$PID
		return 0
	fi
	return 1
}

SetPIDFile () {
	if [ -f testdir/ccntestloop.pid ]; then
		PID=`cat testdir/ccntestloop.pid`
		test "$PID" = $$ && return 0
		kill -0 "$PID" 2>/dev/null && Fail ccntestloop already running as pid $PID
		rm testdir/ccntestloop.pid || Fail could not remove old pid file
	fi
	echo $$ > testdir/ccntestloop.pid || Fail could not write pid file
}

RemovePIDFile () {
	test "`cat testdir/ccntestloop.pid`" = $$ && rm -f testdir/ccntestloop.pid
}

CheckTestout () {
	test -d javasrc/testout               && \
	  rm -rf javasrc/testout~             && \
	  mv javasrc/testout javasrc/testout~ && \
	  Echo WARNING: existing javasrc/testout renamed to javasrc/testout~
}

PrintDetails () {
	uname -a
	env | grep ^CCN
	$CCN_TEST_GITCOMMAND rev-list --max-count=1 HEAD
	$CCN_TEST_GITCOMMAND status
	$CCN_TEST_GITCOMMAND diff | cat
	head -999 csrc/conf.mk testdir/config~ 2>/dev/null
}

SaveLogs () {
	test -d javasrc/testout || return 1
	if [ -f javasrc/testout/KILLED ]; then
		rm -rf javasrc/testout
		exit
	fi
	PrintDetails > javasrc/testout/TEST-details.txt
	mv javasrc/testout testdir/testout.$1 || return 1
	PrintTimesForRun $1
	true
}

PruneOldLogs () {
	# Leave 20 most recent successes
	(cd testdir; rm -rf `ls -dt testout.*[0123456789] | tail -n +20`; )
	true
}

UpdateSources () {
	Echo Updating for run $1
	cp csrc/util/ccntestloop.sh testdir/.~ctloop~
	if [ -x testdir/hooks/update ]; then
		testdir/hooks/update $1 || Fail testdir/hooks/update
		return 0
	fi
	$CCN_TEST_GITCOMMAND status | grep modified:        && \
	  Echo Modifications present - skipping update      && \
	  sleep 3 && return
	$CCN_TEST_GITCOMMAND checkout $CCN_TEST_BRANCH      && \
	  $CCN_TEST_GITCOMMAND pull origin $CCN_TEST_BRANCH
}

SourcesChanged () {
	: For now, always rebuild
	true
}

ScriptChanged () {
	diff testdir/.~ctloop~ csrc/util/ccntestloop.sh && return 1
	return 0 # Yes, it changed.
}

NoteTimes () {
	LC_ALL=C times > javasrc/testout/$1.times
}

# Use saved before-and-after outputs of times(1) to compute cpu times used
DiffTimes () {
	test -f $1 || return
	test -f $2 || return
	paste $2 $1  | \
		tr 'ms' '  ' | \
		while read A B C D  a b c d  etc; do
			echo 3 k
			echo $A 60 '*' $B + $a 60 '*' $b + - p
			echo $C 60 '*' $D + $c 60 '*' $d + - p
			echo + p
		done | dc | xargs echo $3
}

PrintTimesForRun () { (
	cd testdir/testout.$1 || return
	DiffTimes postb.times postc.times "RUN $1 CTSTTIMES"
	DiffTimes postc.times postj.times "RUN $1 JAVATIMES"
) }

Rebuild () {
	Echo Building for run $1
	LOG=javasrc/testout/TEST-buildlog.txt
	mkdir -p javasrc/testout
	(./configure && $MAKE; ) > $LOG 2>&1
	if [ $? -eq 0 ]; then
		NoteTimes postb
		return 0
	fi
	tail $LOG
	Echo build failed
	return 1
}

LimitCPU () {
	test -z "$CCN_TEST_CPU_LIMIT" && return
	ulimit -t $CCN_TEST_CPU_LIMIT
}

RunCTest () {
	test "${CCN_CTESTS:=}" = "NO" && return 0
	Echo Running csrc tests...
	LOG=javasrc/testout/TEST-csrc-testlog.txt
	mkdir -p javasrc/testout
	(LimitCPU; cd csrc && $MAKE test TESTS="$CCN_CTESTS" 2>&1 ) > $LOG
	STATUS=$?
	NoteTimes postc
	test $STATUS -eq 0 && return 0
	tar cf javasrc/testout/csrc-tests.tar csrc/tests csrc/exttests/*.???
	gzip javasrc/testout/csrc-tests.tar
	grep ^FAILING: $LOG | tee -a javasrc/testout/TEST-failures.txt
	Echo csrc tests failed
	return 1
}

RunJavaTest () {
	test "${CCN_JAVATESTS:-}" = "NO" && return 0
	Echo Running javasrc tests...
	LOG=javasrc/testout/TEST-javasrc-testlog.txt
	(LimitCPU; cd javasrc && \
	  ant -DCHATTY=${CCN_LOG_LEVEL_ALL}             \
	      -DTEST_PORT=${CCN_LOCAL_PORT_BASE:-63000} \
	      ${CCN_JAVATESTS:-test}; ) > $LOG
	STATUS=$?
	NoteTimes postj
	test $STATUS -eq 0 && return 0
	grep -B1 -e 'junit. Tests .*Failures: [^0]' \
	         -e 'junit. Tests .*Errors: [^0]'   \
	     $LOG 2>/dev/null | tee -a javasrc/testout/TEST-failures.txt
	Echo javasrc tests failed
	return 1
}

RunTest () {
	Echo Starting run $1 at `date`
	RunCTest && RunJavaTest && SaveLogs $1 && PruneOldLogs && return 0
	SaveLogs $1.FAILED
	return 1
}

LastRunNumber () {
	ls -td testdir/testout.* 2>/dev/null | head -n 1 | cut -d . -f 2
}

ThisRunNumber () {
	echo $((`LastRunNumber` + 1))
}

ExecSelf () {
	exec sh csrc/util/ccntestloop.sh || Fail exec
}

StartBackground () {
	BackgroundPID 'ccntestloop already running as pid ' && return 1
	sh -c "sh csrc/util/ccntestloop.sh &" < /dev/null >> testdir/log 2>&1
}

# Gather up the list of descendants
Descendants () { (
	export LANG=C
	ps -U `id -u` -o ppid,pid | \
	  while read ppid pid; do echo =$ppid= $pid; done > mypids
	echo $1 > killpids
	while true; do
		PATS=`while read i; do echo " -e =$i="; done < killpids`
		grep $PATS mypids | cut -d ' ' -f 2 > morepids
		cat killpids morepids | sort -u > newkillpids
		cmp killpids newkillpids >/dev/null 2>/dev/null && break
		mv newkillpids killpids
	done
	echo `grep -v "^$1" killpids`
	rm killpids newkillpids morepids mypids
) }

StopBackground () {
	PID=`BackgroundPID`
	test -z "$PID" && return 1
	VICTIMS=`Descendants $PID`
	sh -c "echo $PID $VICTIMS >> javasrc/testout/KILLED" 2>/dev/null
	kill -HUP $PID
	kill $VICTIMS 2>/dev/null
	echo STOPPED >> testdir/log
	sleep 1
	kill -9 $VICTIMS 2>/dev/null
}

Status () {
	test -f testdir/log && tail -n 9 testdir/log
	BackgroundPID 'ccntestloop running as pid '
	STATUS=$?
	test $STATUS = 0 || echo ccntestloop not running
	return $STATUS
}

FailHook () {
	if [ -x testdir/hooks/failure ]; then
		testdir/hooks/failure $1 && sleep 10 && ExecSelf
	fi
	Fail run $1 failed - stopping
}

# Finally, here's what we actually want to do
CheckDirectory

GetConfiguration

CheckLogLevel

if [ $# -gt 1 ]; then
	Usage
fi

case "${1:---}" in
	--)      ;;
	-*)      Usage;;
	start)   StartBackground; exit $?;;
	stop)    StopBackground; exit 0;;
	restart) StopBackground; StartBackground; exit $?;;
	status)  Status; exit $?;;
	*)       Usage;;
esac

SetPIDFile
trap RemovePIDFile EXIT

CheckTestout

RUN=`ThisRunNumber`

UpdateSources $RUN

if ScriptChanged; then
	Echo "*** Script changed - will clean and restart"
	$MAKE clean >.make.clean.log 2>&1|| Fail make clean - see .make.clean.log
	rm -f .make.clean.log
	echo Pausing for 10 seconds before restart...
	sleep 10
	ExecSelf
fi

if SourcesChanged; then
	Rebuild $RUN || Fail make
fi

RunTest $RUN || FailHook $RUN
Echo Run number $RUN was successful
Echo BUILD Failure rate is `ls -d testdir/testout*FAILED 2>/dev/null | wc -l` / $RUN
if [ -x testdir/hooks/success ]; then
	testdir/hooks/success $RUN || exit 0
fi
sleep 2
ExecSelf


New file.

New file.

#!/bin/sh
#
# Replace all the global var names in lex.conf.c with ones that don't
# conflict with our Minc parser.  The bison-generated source (conf.tab.cpp)
# uses the macros defined at the top of lex.conf.c to access these
# variables, so this substitution should not matter to it.   -JGG, 7/7/04

sed \
-e 's/yyin/__yyin/g' \
-e 's/yyleng/__yyleng/g' \
-e 's/yyout/__yyout/g' \
-e 's/yytext/__yytext/g' \
-e 's/yylineno/__yylineno/g' \
$1 > $1.tmp

mv $1.tmp $1

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


Add INSTALL script with right OPAM packages needed to build the examples

#!/bin/sh

opam install --yes \
  core \
  core_extended \
  cryptokit \
  core_bench \
  atdgen \
  async \
  yojson \
  textwrap \
  cohttp \
  async_graphics \
  menhir

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


Script for uploading to sonatype

Script for uploading to sonatype

#!/bin/bash

VERSION=1.1

rm -rf checkout
mkdir -p checkout
cd checkout
git clone git@github.com:relops/snowflake.git
cd snowflake
git checkout $VERSION
mvn clean javadoc:jar source:jar install

URL="https://oss.sonatype.org/service/local/staging/deploy/maven2/"
REPO="sonatype-nexus-staging"

mvn gpg:sign-and-deploy-file -Dgpg.passphrase=xxxxxxx -Durl=$URL -DrepositoryId=$REPO -DpomFile=pom.xml -Dfile=target/snowflake-$VERSION.jar
mvn gpg:sign-and-deploy-file -Dgpg.passphrase=xxxxxxx -Durl=$URL -DrepositoryId=$REPO -DpomFile=pom.xml -Dfile=target/snowflake-$VERSION-sources.jar -Dclassifier=sources
mvn gpg:sign-and-deploy-file -Dgpg.passphrase=xxxxxxx -Durl=$URL -DrepositoryId=$REPO -DpomFile=pom.xml -Dfile=target/snowflake-$VERSION-javadoc.jar -Dclassifier=javadoc

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


Add swap2ram script

Add swap2ram script

#!/bin/sh

mem=$(free  | awk '/Mem:/ {print $4}')
swap=$(free | awk '/Swap:/ {print $3}')

if [ $mem -lt $swap ]; then
    echo "ERROR: not enough RAM to write swap back, nothing done" >&2
    exit 1
fi

swapoff -a &&
swapon -a

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


[tool.global] added script that automates deployment over https

if [ -z "$1" ]
then
	echo "usage examples:"
	echo "    ./tool/tool.global/upload_and_run.sh http://dev.pocketcampus.ch/"
	echo "    ./tool/tool.global/upload_and_run.sh https://test-pocketcampus.epfl.ch/dev/"
	exit
fi

server=$1

echo "Access token for $server :"
read token

echo "UPLOADING JAR"

uploadstatus=`curl -F file=@server/PocketCampusServer/PocketCampusServer.jar $server/upload_jar.php?t=$token`

if [[ "$uploadstatus" != "Uploaded"* ]]
then
	echo "Upload failed:" $uploadstatus
	exit 1
fi

echo "STARTING NEW SERVER"

restartstatus=`curl -F field=value $server/restart_server.php?t=$token`

if [[ "$restartstatus" != *"started with pid"* ]]
then
	echo "Could not start new server:" $restartstatus
	exit 1
fi

echo "DONE"

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


publish only png files and properties

publish only png files and properties

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


Added nginx and ssl

Added nginx and ssl

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/atomney/guacamole.git/'


Adding overlays for elpi and QuickChick.

overlay elpi https://github.com/herbelin/coq-elpi coq-master+adapt-coq-pr14598-adding-proj-syntax-constructor 14598
overlay quickchick https://github.com/herbelin/QuickChick master+adapt-coq-pr14598-adding-proj-syntax-constructor 14598

error: pathspec 'dev/ci/user-overlays/14598-herbelin-master+proj-nodes-in-concrete-syntax.sh' did not match any file(s) known to git


Add Expertiza setup script

Add Expertiza setup script

#!/bin/bash
cd expertiza
cp config/database.yml.example config/database.yml
cp config/secrets.yml.example config/secrets.yml

if [ "$(uname)" == "Darwin" ]
then
  echo 'Install Third-party Javascript Libraries for Mac OS X platform'
  brew update && brew install node && node -v && npm -v
  sudo npm install -g bower && bower install
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]
then
  echo 'Install Third-party Javascript Libraries for Linux Platform'
  sudo apt-get update
  sudo apt-get install -y nodejs && sudo apt-get install -y npm && sudo ln -s /usr/bin/nodejs /usr/bin/node
  node -v && npm -v
  sudo npm install -g bower && bower install
elif [ -n "$COMSPEC" -a -x "$COMSPEC" ]
then
  echo $0: this script does not support Windows \:\(
fi

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


Correct build-ami name

Correct build-ami name

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


Desc: Modify for tmp folder BUG: None Reviewer: None

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/GdZ/init_android_env.git/'


initial commit with the initial code

initial commit with the initial code

#!/bin/bash
# Program: happysync.sh
# Writed by JA Nache <nache.nache@gmail.com>
# Description: Keep two dirs (local or remote) synced
# Dependences: rsync inotify-tools
# License: Public Domain

#############################
# CONFIG:
# Set events to watch
EVENTS="modify,attrib,close_write,move,move_self,create,delete,delete_self"

# Set extra arguments to rsync, for example, differente ssh port
#RSYNC_EXTRA_ARGS="-e 'ssh -p 2222'"
#############################

#####################
# COREVARS, NO EDIT
SYNCPID="none"
#####################

waittosync(){
	for i in 1 2 3 4 5
	do
		sleep 1s
	done
}

dosync(){
	echo "Wait to sync..."
	waittosync
	echo "syncing..."
	rsync -rlptz --delete --exclude '*.git*' $RSYNC_EXTRA_ARGS $1/ $2/
	if [ "$?" -eq "0" ];then
		echo "DONE"
	else
		echo "Error in sync"
	fi
}

showhelp(){
	echo -e "\n    HappySync v0.1"
	echo    "    Script Writed by J.A. Nache <nache.nache@gmail.com>"
	echo -e "\n      Usage:"
	echo    "               $0 <source dir> <destination dir>"
        echo -e "\n\n"
        exit 1
}

if [ -z $2 ];then
        showhelp
fi

inotifywait -r -m -e $EVENTS $1 | while read THEFILE
do
	echo "Changes detected on $THEFILE"
	ps --pid $SYNCPID >/dev/null 2>&1
	if [ "$?" -eq "1" ];then
		echo "Starting rsync..."
		(dosync $1 $2) &
		SYNCPID=$!
	fi
done

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


Fix a2js testsuite on Mac OS

Fix a2js testsuite on Mac OS

git-svn-id: 84a7e9580ef41fb6fdf7e69fc6952b9cdfe895dd@5538 661adc5f-87f8-0310-85d6-9a7b5f58d823

fatal: remote error: upload-pack: not our ref 42d4dab0c607fea8990f28e743fef2a073f9f831
fatal: the remote end hung up unexpectedly


[osx] Disable over-the-top focus ring animation

 * before: https://cloud.githubusercontent.com/assets/1223565/11673065/7c7abc6c-9e1e-11e5-95a9-a635d0ce642f.gif
 * after: https://cloud.githubusercontent.com/assets/1223565/11673066/7f1d84e0-9e1e-11e5-9c27-d93340318850.gif

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Thanks @oa-!

#!/bin/bash

cd "$(dirname "$BASH_SOURCE")" \
    && source '../../utils.sh'

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

set_preferences() {

    execute 'defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true' \
        'Avoid creating ".DS_Store" files on network volumes'

    execute 'defaults write com.apple.menuextra.battery ShowPercent -string "NO"' \
        'Hide battery percentage from the menu bar'

    execute 'defaults write com.apple.LaunchServices LSQuarantine -bool false' \
        'Disable "Are you sure you want to open this application?" dialog'

    # execute 'defaults write com.apple.loginwindow TALLogoutSavesState 0' \
    #     'Disable "Reopen windows when logging back in"'

    execute 'defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true' \
        'Automatically quit the printer app once the print jobs are completed'

    execute 'defaults write com.apple.screencapture disable-shadow -bool true' \
        'Disable shadow in screenshots'

    execute 'defaults write com.apple.screencapture location -string "$HOME/Desktop"' \
        'Save screenshots to the Desktop'

    execute 'defaults write com.apple.screencapture type -string "png"' \
        'Save screenshots as PNGs'

    execute 'defaults write com.apple.screensaver askForPassword -int 1 &&
             defaults write com.apple.screensaver askForPasswordDelay -int 0'\
        'Require password immediately after into sleep or screen saver mode'

    execute 'defaults write NSGlobalDomain AppleFontSmoothing -int 2' \
        'Enable subpixel font rendering on non-Apple LCDs'

    execute 'defaults write NSGlobalDomain AppleShowScrollBars -string "Always"' \
        'Always show scrollbars'

    execute 'defaults write NSGlobalDomain NSDisableAutomaticTermination -bool true' \
        'Disable automatic termination of inactive apps'

    execute 'defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true' \
        'Expand save panel by default'

    execute 'defaults write NSGlobalDomain NSTableViewDefaultSizeMode -int 2' \
        'Set sidebar icon size to medium'

    execute 'defaults write NSGlobalDomain NSUseAnimatedFocusRing -bool false' \
        'Disable the over-the-top focus ring animation'

    execute 'defaults write com.apple.systempreferences NSQuitAlwaysKeepsWindows -bool false' \
        'Disable resume system-wide'

    execute 'defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true' \
        'Expand print panel by default'

    execute 'sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "Laptop" &&
             sudo scutil --set ComputerName "Laptop" &&
             sudo scutil --set HostName "Laptop" &&
             sudo scutil --set LocalHostName "Laptop"' \
        'Set computer name'

    execute 'sudo systemsetup -setrestartfreeze on' \
        'Restart automatically if the computer freezes'

    execute 'sudo defaults write /Library/Preferences/com.apple.Bluetooth.plist ControllerPowerState 0 &&
             sudo launchctl unload /System/Library/LaunchDaemons/com.apple.blued.plist &&
             sudo launchctl load /System/Library/LaunchDaemons/com.apple.blued.plist' \
        'Turn Bluetooth off'

    execute '   for domain in ~/Library/Preferences/ByHost/com.apple.systemuiserver.*; do
                    sudo defaults write "${domain}" dontAutoLoad -array \
                        "/System/Library/CoreServices/Menu Extras/TimeMachine.menu" \
                        "/System/Library/CoreServices/Menu Extras/Volume.menu"
                done && \

                sudo defaults write com.apple.systemuiserver menuExtras -array \
                    "/System/Library/CoreServices/Menu Extras/Bluetooth.menu" \
                    "/System/Library/CoreServices/Menu Extras/AirPort.menu" \
                    "/System/Library/CoreServices/Menu Extras/Battery.menu" \
                    "/System/Library/CoreServices/Menu Extras/Clock.menu"
            ' \
        'Hide Time Machine and Volume icons from the menu bar'

}

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

main() {

    print_in_purple '\n  UI & UX\n\n'
    set_preferences

}

main

#!/bin/bash

cd "$(dirname "$BASH_SOURCE")" \
    && source '../../utils.sh'

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

set_preferences() {

    execute 'defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true' \
        'Avoid creating ".DS_Store" files on network volumes'

    execute 'defaults write com.apple.menuextra.battery ShowPercent -string "NO"' \
        'Hide battery percentage from the menu bar'

    execute 'defaults write com.apple.LaunchServices LSQuarantine -bool false' \
        'Disable "Are you sure you want to open this application?" dialog'

    # execute 'defaults write com.apple.loginwindow TALLogoutSavesState 0' \
    #     'Disable "Reopen windows when logging back in"'

    execute 'defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true' \
        'Automatically quit the printer app once the print jobs are completed'

    execute 'defaults write com.apple.screencapture disable-shadow -bool true' \
        'Disable shadow in screenshots'

    execute 'defaults write com.apple.screencapture location -string "$HOME/Desktop"' \
        'Save screenshots to the Desktop'

    execute 'defaults write com.apple.screencapture type -string "png"' \
        'Save screenshots as PNGs'

    execute 'defaults write com.apple.screensaver askForPassword -int 1 &&
             defaults write com.apple.screensaver askForPasswordDelay -int 0'\
        'Require password immediately after into sleep or screen saver mode'

    execute 'defaults write NSGlobalDomain AppleFontSmoothing -int 2' \
        'Enable subpixel font rendering on non-Apple LCDs'

    execute 'defaults write NSGlobalDomain AppleShowScrollBars -string "Always"' \
        'Always show scrollbars'

    execute 'defaults write NSGlobalDomain NSDisableAutomaticTermination -bool true' \
        'Disable automatic termination of inactive apps'

    execute 'defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true' \
        'Expand save panel by default'

    execute 'defaults write NSGlobalDomain NSTableViewDefaultSizeMode -int 2' \
        'Set sidebar icon size to medium'

    execute 'defaults write com.apple.systempreferences NSQuitAlwaysKeepsWindows -bool false' \
        'Disable resume system-wide'

    execute 'defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true' \
        'Expand print panel by default'

    execute 'sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "Laptop" &&
             sudo scutil --set ComputerName "Laptop" &&
             sudo scutil --set HostName "Laptop" &&
             sudo scutil --set LocalHostName "Laptop"' \
        'Set computer name'

    execute 'sudo systemsetup -setrestartfreeze on' \
        'Restart automatically if the computer freezes'

    execute 'sudo defaults write /Library/Preferences/com.apple.Bluetooth.plist ControllerPowerState 0 &&
             sudo launchctl unload /System/Library/LaunchDaemons/com.apple.blued.plist &&
             sudo launchctl load /System/Library/LaunchDaemons/com.apple.blued.plist' \
        'Turn Bluetooth off'

    execute '   for domain in ~/Library/Preferences/ByHost/com.apple.systemuiserver.*; do
                    sudo defaults write "${domain}" dontAutoLoad -array \
                        "/System/Library/CoreServices/Menu Extras/TimeMachine.menu" \
                        "/System/Library/CoreServices/Menu Extras/Volume.menu"
                done && \

                sudo defaults write com.apple.systemuiserver menuExtras -array \
                    "/System/Library/CoreServices/Menu Extras/Bluetooth.menu" \
                    "/System/Library/CoreServices/Menu Extras/AirPort.menu" \
                    "/System/Library/CoreServices/Menu Extras/Battery.menu" \
                    "/System/Library/CoreServices/Menu Extras/Clock.menu"
            ' \
        'Hide Time Machine and Volume icons from the menu bar'

}

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

main() {

    print_in_purple '\n  UI & UX\n\n'
    set_preferences

}

main


Add simple script to fix brisk-menu

Add simple script to fix brisk-menu

#!/bin/bash

set -xe

gsettings set com.solus-project.brisk-menu hot-key Menu

error: pathspec 'package/root/usr/local/bin/fix-brisk-menu-key.sh' did not match any file(s) known to git


Add varz zsh for env vars, duh

Add varz zsh for env vars, duh

# git duet
export GIT_DUET_ROTATE_AUTHOR=1

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


New helper script to build the .dvi for a Python manual; usable for the api, ext, ref, and tut manuals.  The Library Reference requires too much special index processing to make it beneficial to extend this to support it.

#! /bin/sh
#
#  Build one of the simple documents.

WORKDIR=`pwd`
cd `dirname $0`/..
srcdir=`pwd`
cd $WORKDIR

PART=$1

TEXINPUTS=$srcdir/$PART:$TEXINPUTS
export TEXINPUTS

set -x
$srcdir/tools/newind.py >$PART.ind || exit $?
latex $PART || exit $?
if [ -f $PART.idx ] ; then
    # using the index
    $srcdir/tools/fix_hack $*.idx || exit $?
    makeindex -s $srcdir/texinputs/myindex.ist $*.idx || exit $?
else
    # skipping the index; clean up the unused file
    rm -f $PART.ind
fi
latex $PART || exit $?

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


[DEVOPS-373] Edgenode for connecting to mainnet

#!/usr/bin/env bash
set -eo pipefail

readonly CLUSTER=mainnet

if [[ "$1" == "-c" ]]; then
  shift
  rm -Rf \
    db-${CLUSTER}                                 \
    wdb-${CLUSTER}                         \
    secret-$CLUSTER.key \
    logs/$CLUSTER
fi

echo "Launch a single node and connect it to '${CLUSTER}' cluster..."

readonly TMP_TOPOLOGY_YAML=/tmp/topology.yaml
printf "wallet:
    relays: [[{ host: relays.cardano-mainnet.iohk.io }]]
    valency: 1
    fallbacks: 7" > "${TMP_TOPOLOGY_YAML}"

stack exec -- cardano-node                                  \
    --tlscert ./scripts/tls-files/server.crt                \
    --tlskey ./scripts/tls-files/server.key                 \
    --tlsca ./scripts/tls-files/ca.crt                      \
    --no-ntp                                                \
    --topology "${TMP_TOPOLOGY_YAML}"                       \
    --log-config scripts/log-templates/log-config-qa.yaml   \
    --logs-prefix "logs/${CLUSTER}"                         \
    --db-path db-${CLUSTER}                                 \
    --wallet-db-path wdb-${CLUSTER}                         \
    --keyfile secret-$CLUSTER.key                           \
    --configuration-file node/configuration.yaml            \
    --configuration-key mainnet_wallet_macos64

error: pathspec 'scripts/launch/connect-to-cluster/mainnet.sh' did not match any file(s) known to git


add convert 2 cb

add convert 2 cb

install4cbfromvs()
{

project_vs="$1.vcxproj"
project_cbp="$1.cbp"
project_cbp_temp="$1"
project_cbp_temp_file=""
cbp_begin=0
cbp_end=0
#"" ".cbp.temp"
#cat NFComm/NFCore/NFCore.cbp | awk 'BEGIN{ print "Start" } {for(i=0;i<NF;i++) {printf $0; printf "\n"  }} END{print cbp_begin}'
#cat NFComm/NFCore/NFCore.cbp | awk 'BEGIN{} {cbp_begin=NR; printf $1; printf "\n" } END{print cbp_begin}'
cat $project_cbp | awk 'BEGIN{}
{
    project_cbp_temp_file= "'$project_cbp_temp'" ""  ".cbp.temp";

    if($1=="<Unit")
    {
        if (cbp_begin<=0)
        {
            cbp_begin=NR;
        }
    }
    else
    {
        if (cbp_begin>0 && cbp_end<=0)
        {
            cbp_end=NR;
        }
    }

    if (cbp_begin<=0)
    {
        print $0 > project_cbp_temp_file
    }
}
END{
}'

#var_line=“<Unit filename=” + substr($0, 19, length($0) - 19);
#cat NFComm/NFCore/NFCore.vcxproj | awk 'BEGIN{} { print $0 >> "1.log"} END{}'
cat $project_vs | awk 'BEGIN{}
{
    project_cbp_temp_file= "'$project_cbp_temp'" ""  ".cbp.temp";
    if($1=="<ClInclude" || $1=="<ClCompile")
    {
        info=$0;
        if (index(info, "/>") > 0)
        {
            start=index(info, "=");
            data="<Unit filename" "" substr(info, start, length($0) - start + 1);
        }
        else
        {
            start=index(info, "=");
            data="<Unit filename" "" substr(info, start, length($0) - start - 1) "" "/>";
        }

        print data >> project_cbp_temp_file
    }
} END{}'

cat $project_cbp | awk 'BEGIN{}
{
    project_cbp_temp_file= "'$project_cbp_temp'" ""  ".cbp.temp";
    if($1=="<Unit")
    {
        if (cbp_begin<=0)
        {
            cbp_begin=NR;
        }
    }
    else
    {
        if (cbp_begin>0 && cbp_end<=0)
        {
            cbp_end=NR;
        }
    }

    if (cbp_end>0 && NR>=cbp_end)
    {
        print $0 >> project_cbp_temp_file
    }
}
END{
}'

project_cbp_old="$1.cbp.old"
project_cbp_temp_file="$1.cbp.temp"

rm -f $project_cbp_old
mv $project_cbp $project_cbp_old
mv $project_cbp_temp_file $project_cbp

echo "Converted file: $project_vs to $project_cbp !!"

}

array_name=(
NFTools/NFFileProcess/NFFileProcess
NFComm/NFCore/NFCore
NFComm/NFMessageDefine/NFMessageDefine
NFComm/NFNet/NFNet
NFComm/NFKernelPlugin/NFKernelPlugin
NFComm/NFConfigPlugin/NFConfigPlugin
NFComm/NFLogPlugin/NFLogPlugin
NFComm/NFPluginLoader/NFPluginLoader
NFComm/NFActorPlugin/NFActorPlugin
NFComm/NFMysqlPlugin/NFMysqlPlugin
NFComm/NFNoSqlPlugin/NFNoSqlPlugin
NFComm/NFUrlPlugin/NFUrlPlugin
NFServer/NFGameServerNet_ClientPlugin/NFGameServerNet_ClientPlugin
NFServer/NFGameServerNet_ServerPlugin/NFGameServerNet_ServerPlugin
NFServer/NFGameLogicPlugin/NFGameLogicPlugin
NFServer/NFGameServerPlugin/NFGameServerPlugin
NFServer/NFDataAgent_NosqlPlugin/NFDataAgent_NosqlPlugin
NFServer/NFLoginNet_ClientPlugin/NFLoginNet_ClientPlugin
NFServer/NFLoginNet_ServerPlugin/NFLoginNet_ServerPlugin
NFServer/NFLoginLogicPlugin/NFLoginLogicPlugin
NFServer/NFMasterNet_ServerPlugin/NFMasterNet_ServerPlugin
NFServer/NFMasterServerPlugin/NFMasterServerPlugin
NFServer/NFProxyLogicPlugin/NFProxyLogicPlugin
NFServer/NFProxyServerNet_ClientPlugin/NFProxyServerNet_ClientPlugin
NFServer/NFProxyServerNet_ServerPlugin/NFProxyServerNet_ServerPlugin
NFServer/NFWorldLogicPlugin/NFWorldLogicPlugin
NFServer/NFWorldNet_ClientPlugin/NFWorldNet_ClientPlugin
NFServer/NFWorldNet_ServerPlugin/NFWorldNet_ServerPlugin
)

array_index=0
array_step=1
for data in ${array_name[@]}
do
    #echo ${array_name[$array_index]}

    install4cbfromvs ${array_name[$array_index]}

    array_index=`expr $array_index + $array_step`

done

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


decode_to_md5: update md5

decode_to_md5: update md5

this changed after the final rebase in:
45dfb799f [NORMATIVE-SYNTAX] Disable filter_intra in >32x32 sb_type

Change-Id: I4daa123d2fa8b9b9ed14029a124daa6951c2ef32

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/GrokImageCompression/aom.git/'


Added a test to verify that our code, tests, and data have no tabs.

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

if grep '\t' *.{py,sh} testdata/*.{json,py,yaml} ../*.py; then
  echo "ERROR: tabs found." >&2
  exit 1
fi

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


New plugin 'common-aliases' for optional cutting edge zsh aliases

Signed-off-by: Gaetan Semet <8ccd13098305f7fadd4fdccc2da60bfdfa8d8d20@xeberon.net>

# Advanced Aliases.
# Use with caution
#

# ls, the common ones I use a lot shortened for rapid fire usage
alias ls='ls --color' #I like color
alias l='ls -lFh'     #size,show type,human readable
alias la='ls -lAFh'   #long list,show almost all,show type,human readable
alias lr='ls -tRFh'   #sorted by date,recursive,show type,human readable
alias lt='ls -ltFh'   #long list,sorted by date,show type,human readable
alias ll='ls -l'      #long list
alias ldot='ls -ld .*'
alias lS='ls -1FSsh'
alias lart='ls -1Fcart'
alias lrt='ls -1Fcrt'

alias zshrc='vim ~/.zshrc' # Quick access to the ~/.zshrc file

alias grep='grep --color'
alias sgrep='grep -R -n -H -C 5'

alias t='tail -f'

# because typing 'cd' is A LOT of work!!
alias ..='cd ../'
alias ...='cd ../../'
alias ....='cd ../../../'
alias .....='cd ../../../../'

# Command line head / tail shortcuts
alias -g H='| head'
alias -g T='| tail'
alias -g G='| grep'
alias -g L="| less"
alias -g M="| most"
alias -g LL="2>&1 | less"
alias -g CA="2>&1 | cat -A"
alias -g NE="2> /dev/null"
alias -g NUL="> /dev/null 2>&1"
alias -g P="2>&1| pygmentize -l pytb"

alias dud='du --max-depth=1 -h'
alias duf='du -sh *'
alias fd='find . -type d -name'
alias ff='find . -type f -name'

alias h='history'
alias hgrep="fc -El 0 | grep"
alias help='man'
alias j='jobs'
alias p='ps -f'
alias sortnr='sort -n -r'
alias unexport='unset'

alias whereami=display_info

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# zsh is able to auto-do some kungfoo
# depends on the SUFFIX :)
if [ ${ZSH_VERSION//\./} -ge 420 ]; then
  # open browser on urls
  _browser_fts=(htm html de org net com at cx nl se dk dk php)
  for ft in $_browser_fts ; do alias -s $ft=$BROWSER ; done

  _editor_fts=(cpp cxx cc c hh h inl asc txt TXT tex)
  for ft in $_editor_fts ; do alias -s $ft=$EDITOR ; done

  _image_fts=(jpg jpeg png gif mng tiff tif xpm)
  for ft in $_image_fts ; do alias -s $ft=$XIVIEWER; done

  _media_fts=(avi mpg mpeg ogm mp3 wav ogg ape rm mov mkv)
  for ft in $_media_fts ; do alias -s $ft=mplayer ; done

  #read documents
  alias -s pdf=acroread
  alias -s ps=gv
  alias -s dvi=xdvi
  alias -s chm=xchm
  alias -s djvu=djview

  #list whats inside packed file
  alias -s zip="unzip -l"
  alias -s rar="unrar l"
  alias -s tar="tar tf"
  alias -s tar.gz="echo "
  alias -s ace="unace l"
fi

# Make zsh know about hosts already accessed by SSH
zstyle -e ':completion:*:(ssh|scp|sftp|rsh|rsync):hosts' hosts 'reply=(${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) /dev/null)"}%%[# ]*}//,/ })'

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


fix git user

fix git user

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/gammasoft71/Switch.git/'