<filename>plex/plex.sh
#!/bin/sh

#  See https://github.com/filebot/plex-agents

cd /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/ || exit
wget https://github.com/filebot/plex-agents/archive/master.zip
unzip master.zip
cp -R plex-agents-master/Scanners/ ../Application\ Support/Plex\ Media\ Server/
cp -R /var/lib/plexmediaserver/Library/Application\ Support/plex-agents-master/Plug-ins/Xattr.bundle /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Plug-ins/
service plexmediaserver restart

# Next time will try this
# #!/bin/sh -xu
# curl -L -O https://github.com/filebot/plex-agents/archive/master.zip
# unzip -o master.zip
# cp -vru 'plex-agents-master/Plug-ins' '/path/to/PlexMediaServer/Library/Plex Media Server'
# cp -vru 'plex-agents-master/Scanners' '/path/to/PlexMediaServer/Library/Plex Media Server'


<reponame>bokunimowakaru/RaspberryPi<filename>startxbee.sh<gh_stars>1-10
#!/bin/bash
cd ~
git clone -b raspi https://github.com/bokunimowakaru/xbeeCoord.git
cd xbeeCoord/tools
make
~/xbeeCoord/cqpub_pi/practice10.sh


#!/bin/bash -euo

"${PREFIX}/bin/jupyter" kernelspec remove -fy scijava 2> /dev/null


#!/usr/bin/env bash

CUR_DIR="$(pwd)"

export AUTHOR_EMAIL=$(cat ${HOME}/.gitconfig | grep -i -o '[a-zA-Z0-9._%+-]\+@[a-zA-Z0-9.-]\+\.[a-zA-Z]\{2,4\}')
export AUTHOR="${USER}"
export COMPANY="$AUTHOR"

echo "$AUTHOR_EMAIL" | success

echo "Setting up $PROJECT project..." | status

echo "Initializing git..." | status
git init $CUR_DIR

echo "Adding gitignore..." | status
source ${SCRIPT_LIBS_DIR}/__gitignore.sh

echo "Setting up VSCode..." | status
source ${SCRIPT_LIBS_DIR}/__vscode_settings.sh

echo "Setting up direnv .envrc..." | status
source ${SCRIPT_LIBS_DIR}/__envrc.sh
source ${SCRIPT_LIBS_DIR}/__project_detect.sh

### Clean up
unset CUR_DIR
unset AUTHOR_EMAIL
unset AUTHOR
unset COMPANY

echo "*** Reminder: run 'direnv allow' to complete." | warning
sleep 2
echo "$PROJECT setup complete." | success


#!/usr/bin/env bash
# usage: bash tools/pre-commit.sh
# by default uses docker buildkit.
# to disable it:
# DOCKER_BUILDKIT=0 bash tools/pre-commit.sh

set -e

if [ "$DOCKER_BUILDKIT" == "" ]; then
  export DOCKER_BUILDKIT=1
fi

docker build -t tf_addons_formatting -f tools/docker/pre-commit.Dockerfile .

export MSYS_NO_PATHCONV=1
docker run --rm -t -v "$(pwd -P):/addons" tf_addons_formatting


#!/bin/bash

docker build -t nealhardesty/ffmpeg "$(dirname $0)"


#!/bin/bash
cd ./src/Server/;
make;
cd -;
cd ./src/Client/;
make;
cd -;
cd ./src/Hook;
gcc -c Hook.cpp;
ar -crv libHook.a Hook.o;
rm Hook.o;
cd -;


<gh_stars>1-10
@test "inittab set to 5" {
  grep 'id:5:initdefault:' /etc/inittab
}


<reponame>neilsambhu/carla-simulator3
#!/usr/bin/bash
# conda init bash
# source /home/nsambhu/anaconda3/bin/conda
# conda activate carla-simulator3

tmux new
ls
xdotool key ctrl+b+d
# sh /data/data1/GitHub/carla-simulator3/CARLA_0.9.13/CarlaUE4.sh


<reponame>GeoffMaciolek/zabbix-slack-prettyalertscript<filename>slack.sh
#!/bin/bash

# Slack incoming web-hook URL and user name
url='CHANGEME'             # example: https://hooks.slack.com/services/QW3R7Y/D34DC0D3/BCADFGabcDEF123
username='Zabbix'

## Values received by this script:
# To = $1 (Slack channel or user to send the message to, specified in the Zabbix web interface; "@username" or "#channel")
# Subject = $2 (usually either PROBLEM {HOST.NAME} or RECOVERY {HOST.NAME}
# Message = $3 (whatever message the Zabbix action sends, preferably something like "Zabbix server is unreachable for 5 minutes - Zabbix server (127.0.0.1)")

# Get the Slack channel or user ($1), Zabbix subject (hopefully either PROBLEM or RECOVERY), and the server in question
to="$1"
subject=$(echo $2|cut -d' ' -f1) # The alert type is before the space, server after, eg
server=$(echo $2|cut -d' ' -f2-) #      "Subject: PROBLEM SomeDatabaseServer01"

# Set up the alert type (future flexibility)
if [ "$subject" == 'RECOVERY' ]; then
        type="R"
elif [ "$subject" == 'PROBLEM' ]; then
        type="P"
else
        type="N"
fi

# Change message emoji, color, and (friendly) status depending on the subject
if [ $type == 'R' ]; then  # Triggered by 'RECOVERY' above
        emoji=':smile:'    # A smile,
        color="#20E020"    # and red text
        status="Recovered"
elif [ $type == 'P' ]; then  # Triggered by 'PROBLEM' above
        emoji=':frowning:'
        color="#E02020"
        status="Problem"
else
        emoji=':ghost:'
        color="#808080"
        status="N/A"
fi

# The message that we want to send to Slack is the "subject" value ($2 / $subject - that we got earlier)
#  followed by the message that Zabbix actually sent us ($3)
message="$3"

# Build our JSON payload and send it as a POST request to the Slack incoming web-hook URL
# See https://api.slack.com/docs/formatting for formatting details
payload="payload={
        \"channel\": \"${to}\",
        \"username\": \"${username}\",
        \"icon_emoji\": \"${emoji}\",
        \"attachments\": [
           {
                \"title\": \"${server}: ${status}\",
                \"fallback\": \"${message}\",
                \"text\": \"${message}\",
                \"color\": \"${color}\",
                \"mrkdwn_in\": [ \"text\" ]
           }
        ] }"

/usr/bin/curl -m 5 --data-urlencode "${payload}" $url


<gh_stars>1-10
#!/bin/bash
cd /home/nlpserver/zzilong/kaldi/egs/supermarket-product
. ./path.sh
( echo '#' Running on `hostname`
  echo '#' Started at `date`
  echo -n '# '; cat <<EOF
nnet-train-transitions exp/nnet4a/0.mdl "ark:gunzip -c exp/tri3c_ali/ali.*.gz|" exp/nnet4a/0.mdl
EOF
) >exp/nnet4a/log/train_trans.log
time1=`date +"%s"`
 ( nnet-train-transitions exp/nnet4a/0.mdl "ark:gunzip -c exp/tri3c_ali/ali.*.gz|" exp/nnet4a/0.mdl  ) 2>>exp/nnet4a/log/train_trans.log >>exp/nnet4a/log/train_trans.log
ret=$?
time2=`date +"%s"`
echo '#' Accounting: time=$(($time2-$time1)) threads=1 >>exp/nnet4a/log/train_trans.log
echo '#' Finished at `date` with status $ret >>exp/nnet4a/log/train_trans.log
[ $ret -eq 137 ] && exit 100;
touch exp/nnet4a/q/done.29874
exit $[$ret ? 1 : 0]
## submitted with:
# qsub -v PATH -cwd -S /bin/bash -j y -l arch=*64* -o exp/nnet4a/q/train_trans.log -l mem_free=10G,ram_free=2G,arch=*64    /home/nlpserver/zzilong/kaldi/egs/supermarket-product/exp/nnet4a/q/train_trans.sh >>exp/nnet4a/q/train_trans.log 2>&1


<filename>scripts/merge-jfr.sh
# Based on https://stackoverflow.com/a/60976616

jfrDirectory="$1"
targetFile="$2"

SCRIPT="$(basename "${0}")"
if [ "${#}" -lt 2 ]; then
  echo "Script to merge JFR files into one. Performs recursive lookup in given directory for .jfr files."
  echo "Then merges them into a single one, one by one, optionally deleting the source to save space."
  echo "Usage: ./${SCRIPT} <JFR directory> <target .jfr file>"
  exit 1
fi

# Transform paths into absolute paths
jfrDirectory=$(realpath "${jfrDirectory}")
targetFile="$(realpath "${targetFile}")"

# Check whether the provided location exists
if [ ! -d "$jfrDirectory" ]; then
  echo "JFR directory ${jfrDirectory} was not found"
  exit 1
fi

echo "Essentially, we will be duplicating space on the HDD otherwise."
while true; do
  read -r -p "To save space, do you wish to remove the old .jfr files? [Yn]" answer
  case $answer in
      y|Y ) deleteFile=true; break;;
      n|N ) deleteFile=false; break;;
      [''] ) deleteFile=true; break;;
      * ) echo "invalid answer $answer"
  esac
done

if [ ! -f "$targetFile" ]; then
  echo "$targetFile does not exist, creating it."
  touch "$targetFile"
fi

find "$jfrDirectory" -name '*.jfr' \
  | while read JFR_FILE; do
    cat "$JFR_FILE" >> "$targetFile"
    echo "Pushing $JFR_FILE to $targetFile"
    if [ "$deleteFile" ]; then
      echo "Deleted $JFR_FILE"
      rm "$JFR_FILE"
    fi
  done


<filename>frontAng/init.sh
/etc/init.d/apache2 restart && sleep infinity


<reponame>Sunnyfred/Atlantic_Hurricane_Simulations<gh_stars>0
#!/bin/bash
#SBATCH -J 8kmfixA
#BATCH -N 1 -n 2
#SBATCH -t 5:00:00
#SBATCH -A Momen

#SBATCH --mem=0

module add python/3.8
cd /project/momen/meng/COAWST/results/WRF_VS_WRFSWAN_2/postprocessing_WRFONLY/0_Paper_figures/section3_change_pars_for_weak_winds/source_code_change_Clz_isftcflx_1

###python3 1_Calculate_z0_time_series_at_eye.py
###python3 1_Calculate_z0_time_series_at_eyewall.py

###python3 1_Calculate_wind_intensity_time_series.py
###python3 1_Calculate_wind_track.py

###python3 1_Calculate_z0_time_series_at_eye_2km.py
###python3 1_Calculate_z0_time_series_at_eyewall_2km.py

###python3 1_Calculate_wind_intensity_time_series_2km.py
###python3 1_Calculate_wind_track_2km.py

python3 1_Calculate_avg_speed_vs_slp_multiple_height.py
python3 1_Calculate_avg_speed_vs_radius_multiple_height.py
python3 1_Calculate_ZNT_contour_8km.py
python3 1_Calculate_wind_profiles_8km.py


#!/bin/bash
docker run -v $(pwd):/home/jovyan/work -it --rm -p 8888:8888 dltfpt-stack


<reponame>aaronmboyd/sourcify<gh_stars>1-10
#!/bin/bash
./scripts/find_replace.sh

# Install E2E test
git clone https://github.com/cgewecke/metacoin-source-verify.git
cd metacoin-source-verify
yarn

# Publishes sources to IPFS (via Infura) and deploys contracts to Goerli
# Account key and Infura project ID are Circle CI env variable settings.
npm run deploy:goerli || exit 1

# Give monitor a chance to detect and save.
sleep 300

# Script which verifies repository write
cd ..
for i in `seq 1 10`
do
    # Give monitor a chance to detect and save.
    sleep 30
    # Script which verifies repository write
    result=$(./scripts/monitor_ci.js)
    if [[ $result != *"Error"* ]]; then
        echo $result
        break
    fi
done


#!/bin/sh

set -ex

docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
docker build -t $GITLAB_IMAGE_NAME .
docker push $GITLAB_IMAGE_NAME


#!/bin/sh
[ -z "$1" ] && APPDIR="/app/src/" || APPDIR="$1"
. /app/src/tests/system/common.sh
mkdir -p /opt/aerospike/sys/udf/lua
mkdir -p /opt/aerospike/usr/udf/lua
mkdir -p /opt/aerospike/smd

asd --config-file tests/system/aerospike/aerospike.conf

$APPDIR/bin/alligator $APPDIR/tests/system/aerospike/alligator.yaml&
sleep 25

TEXT=`curl -s localhost:1111`
METRICS=`cat $APPDIR/tests/system/aerospike/metrics.txt`
for NAME in $METRICS
do
	echo "$TEXT" | grep $NAME >/dev/null 2>&1 && success $NAME || error "$TEXT" $NAME
done

pkill alligator
pkill aerospike


#!/bin/sh

set -eu
umask u=rwx,og=

if command -v fzf >/dev/null; then
        RPTCMD=fzf_report
else
        RPTCMD=report
fi
RNGCMD=set_month_range

usage() {
	cat 1>&2 <<-EOF
	${1:+Error: ${1}}
	USAGE:  ${0##*/} [-fhy] FILES

	Display an agenda based on [YYYY-MM-DD] formated dates in FILES.

	Syntax:
	[YYYY-MM-DD]-	is a sinking reminder,
	[YYYY-MM-DD]+	is a floating task, and
	[YYYY-MM-DD]!	is a looming deadline.

	Flags:
	-f	Suppress fzf on systems where it is present.
	-h	Show this message.
	-y	Output a yearlong agenda, centered on today.

	Some day, you will look to txt-agenda(1) for surehanded guidance in all things.

	EOF
	exit ${1:+1}
}

set_date_sentinels() {
	YEAR=$(strip_leading_zeroes "$(date "+%Y")")
	MONTH=$(strip_leading_zeroes "$(date "+%m")")
	DAY=$(strip_leading_zeroes "$(date "+%d")")
        ${RNGCMD}
}

strip_leading_zeroes() {
	n=$1
	while [ "$n" != "${n#0}" ] ;do n=${n#0};done
	echo "$n"
}

format_date() {
	y=$1
	m=$2
	d=$3
	printf "%04d-%02d-%02d" "$y" "$m" "$d"
}

set_month_range() {
        BYEAR=${YEAR}
        FYEAR=${YEAR}
	BMONTH=$((MONTH - 1))
	FMONTH=$((MONTH + 1))
        # Account for January and December.
        if [ "${MONTH}" -eq 1 ]; then
                BMONTH=12
                BYEAR=$((YEAR - 1))
        elif [ "${MONTH}" -eq 12 ]; then
                FMONTH=01
                FYEAR=$((YEAR + 1))
        fi
        PAST_SENTINEL="$(format_date "${BYEAR}" "${BMONTH}" "${DAY}")"
	PRESENT_SENTINEL="$(format_date "${YEAR}" "${MONTH}" "$((DAY + 1))")"
	FUTURE_SENTINEL="$(format_date "${FYEAR}" "${FMONTH}" "${DAY}")"
}

set_year_range() {
        BYEAR=$((YEAR - 1))
        FYEAR=$((YEAR + 1))
        PAST_SENTINEL="$(format_date "${BYEAR}" "${MONTH}" "${DAY}")"
	PRESENT_SENTINEL="$(format_date "${YEAR}" "${MONTH}" "$((DAY + 1))")"
	FUTURE_SENTINEL="$(format_date "${FYEAR}" "${MONTH}" "${DAY}")"
}

get_sort_lines() {
	DATE_LINES=$(grep -nH '\[[0-9]\{4\}-[0-9][0-9]-[0-9][0-9]\][\+\!\-]' "$@" || true)
	DATE_LINES=$(echo "${DATE_LINES}" | \
	# Split lines with Awk such that every date on a line is output as a
	# new instance of that line headed by that date in [YYYY-MM-DD] format.
		awk '
			BEGIN {
				FS=":"
			}
			{
				line_text=substr($0, index($0,$3))
				sub(/^\s*/, "", line_text)
				line_dates=line_text
				sub(/^[^\[]*\[/,"[", line_dates)
				gsub(/\]\-[^\[]*/, "]-:", line_dates)
				gsub(/\]\+[^\[]*/, "]+:", line_dates)
				gsub(/\]![^\[]*/, "]!:", line_dates)
				gsub(/\][^\[\-\+!]*\[/, "]:[", line_dates)
				split(line_dates, line_date_ary)
				for (date_str in line_date_ary) {
					if (line_date_ary[date_str] ~ \
						/\[[0-9]{4}-[0-9][0-9]-[0-9][0-9]\][\-\+!]/) {
						gsub(/ /, "", line_date_ary[date_str])
						print line_date_ary[date_str] ":" $1 ":" $2 ":" line_text
					}
				}
		}')
        DATE_LINES="${DATE_LINES}"$(echo; echo "[${PAST_SENTINEL}]";
                echo "[${PRESENT_SENTINEL}]";
                echo "[${FUTURE_SENTINEL}]");
        SORT_LINES=$(echo "$DATE_LINES" | sort -d);
}

get_sink_lines() {
        beg=$(echo "${SORT_LINES}" | grep -m 1 -n "^\\[${PAST_SENTINEL}\\]" | \
                sed 's/:\[[0-9]\{4\}-[0-9][0-9]-[0-9][0-9]\].*$//')
        end=$(echo "${SORT_LINES}" | grep -m 1 -n "^\\[${PRESENT_SENTINEL}\\]" | \
                sed 's/:\[[0-9]\{4\}-[0-9][0-9]-[0-9][0-9]\].*$//')
        SINK_LINES=$(echo "${SORT_LINES}" | sed -n "${beg},${end}p" | \
                (grep '^\[[0-9]\{4\}-[0-9][0-9]-[0-9][0-9]\][\-]' || true))
}

get_task_lines() {
        TASK_LINES=$(echo "${SORT_LINES}" | sed -n "1,${end}p" | \
                (grep '^\[[0-9]\{4\}-[0-9][0-9]-[0-9][0-9]\][\+]' || true))
 }

get_dead_lines() {
        end=$(echo "${SORT_LINES}" | grep -m 1 -n "^\\[${FUTURE_SENTINEL}\\]" | \
                sed 's/:\[[0-9]\{4\}-[0-9][0-9]-[0-9][0-9]\].*$//')
        DEAD_LINES=$(echo "${SORT_LINES}" | sed -n "1,${end}p" | \
                (grep '^\[[0-9]\{4\}-[0-9][0-9]-[0-9][0-9]\][\!]' || true))
}

report() {
        { echo "${SINK_LINES}";
                echo "${TASK_LINES}";
                echo "${DEAD_LINES}"; } | sed '/^ *$/d'
        exit
}

fzf_preview() {
	beg=$(echo "$1" | cut -d':' -f3)
	date=$(echo "$1" | cut -d':' -f1 | sed "s/^\\[\\([0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9]\\)\\]./\\1/")
	file=$(echo "$1" | cut -d':' -f2)
	marker=$(echo "$1" | cut -d':' -f1 | sed "s/^\\[[0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9]\\]\\(.\\)/\\1/")
	if [ "$beg" -lt 4 ]; then
		hln=$beg
		beg=1
	else
		hln=4
		beg=$((beg-3))
	fi
	sed -n -e "$beg,+20p" "$file" | \
		sed -e ${hln}s/[[]"$date"[]]"$marker"/"$(printf "\\e[7m")"\["$date"\]"$marker""$(printf "\\e[0m")"/g
	exit
}

fzf_report() {
	selected=$(report | fzf --tac --no-sort +s --preview-window=up:wrap --preview="$0 -p {}")
        selected_file_name=$(echo "${selected}" | cut -d':' -f2)
        selected_line_num=$(echo "${selected}" | cut -d':' -f3)
        exec "echo" "$selected_line_num" "$selected_file_name"
}

[ ${#} -eq 0 ] &&
        usage 'too few arguments'
while getopts "fhpy" OPTION; do
        case ${OPTION} in
        f)
                RPTCMD=report
                ;;
        h)
                usage
                ;;
	p)
		fzf_preview "$2"
		;;
        y)
                RNGCMD=set_year_range
                ;;
        *)
                usage 'invalid option'
                ;;
        esac
done
shift $((OPTIND - 1))

set_date_sentinels
get_sort_lines "$@"
get_sink_lines
get_task_lines
get_dead_lines
${RPTCMD}


#!/bin/bash

#Filename: meaninstall
#Author: <NAME> - Further Work by <NAME>

#Update files
sudo apt update -y
sudo apt upgrade -y

# Grab mongodb & start servcies
sudo apt install -y dirmngr gnupg apt-transport-https ca-certificates software-properties-common
wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
sudo add-apt-repository 'deb [arch=amd64] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse'
sudo apt install -y mongodb-org
sudo systemctl enable --now mongod

#install node & others
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs gcc g++ make git
sudo git clone https://github.com/meanjs/mean

#Install yarn gulp and sass
cd mean
sudo npm install -gs yarn
sudo npm install -gs --unsafe-perm node-sass
sudo npm install -gs gulp
sudo npm update -s
sudo npm install -s

#Fix all the errors
sudo npm audit fix -s

#Remove the old server file grab Dai's server file
sudo rm -f server.js
sudo wget -O server.js https://raw.githubusercontent.com/ngocdai94/meanStack/main/server.js

#Pull the front end & run everything
cd public
sudo git clone https://github.com/Titane73/it115-a5-g2-app.git
cd ..
sudo gulp


<reponame>colinsung/system-integration<filename>AIO/setup_keystore.sh<gh_stars>1-10
#!/bin/bash
# ===============LICENSE_START=======================================================
# Acumos Apache-2.0
# ===================================================================================
# Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
# ===================================================================================
# This Acumos software file is distributed by AT&T
# 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
#
# This file is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ===============LICENSE_END=========================================================
#
# What this is: script that enables use of pre-configured CA and server
# certificates for an Acumos platform, or creation of new self-signed
# certificates.
#
# Prerequisites:
# - acumos_env.sh script prepared through oneclick_deploy.sh or manually, to
#   set install options (e.g. docker/k8s)
# - host folder /mnt/$ACUMOS_NAMESPACE/certs created through setup_pv.sh
#
# Usage:
#   For docker-based deployments, run this script on the AIO host.
#   For k8s-based deployment, run this script on the AIO host or a workstation
#   connected to the k8s cluster via kubectl (e.g. via tools/setup_kubectl.sh)
#   $ bash setup_keystore.sh
#

function update_cert_env() {
  trap 'fail' ERR
  log "Updating acumos_env.sh with \"export $1=$2\""
  sedi "s/$1=.*/$1=$2/" $AIO_ROOT/acumos_env.sh
  export $1=$2
}

function setup_keystore() {
  trap 'fail' ERR
  if [[ -e certs/$ACUMOS_CERT ]]; then
    log "Using existing user-prepared files in certs subfolder"
  else
    log "Creating new certs in certs subfolder"
    cd certs
    if [[ "$ACUMOS_DOMAIN_IP" == "$ACUMOS_HOST_IP" ]]; then
      extra_ips="$ACUMOS_DOMAIN_IP"
    else
      extra_ips="$ACUMOS_DOMAIN_IP $ACUMOS_HOST_IP"
    fi
    bash setup_certs.sh $ACUMOS_CERT_PREFIX $ACUMOS_CERT_SUBJECT_NAME \
      "$ACUMOS_HOST $ACUMOS_FEDERATION_DOMAIN" "$extra_ips"
    cd ..
  fi

  if [[ ! -e certs/cert_env.sh ]]; then
    log "Please ensure that cert_env.sh is in the certs folder"
    fail "cert_env.sh not found"
  fi
  source certs/cert_env.sh
  update_cert_env ACUMOS_CERT_KEY_PASSWORD $CERT_KEY_PASSWORD
  update_cert_env ACUMOS_KEYSTORE_PASSWORD $KEYSTORE_PASSWORD
  update_cert_env ACUMOS_TRUSTSTORE_PASSWORD $TRUSTSTORE_PASSWORD

  if [[ "$DEPLOYED_UNDER" == "docker" ]]; then
    if [[ ! -e /mnt/$ACUMOS_NAMESPACE/certs ]]; then
      log "Folder /mnt/$ACUMOS_NAMESPACE/certs was not found"
      fail "Please have a host Admin run setup_prereqs.sh before this script"
    fi
    cp $(ls certs/* | grep -v '\.sh') /mnt/$ACUMOS_NAMESPACE/certs/.
  else
    log "Create kubernetes configmap to hold the keystore and truststore"
    # See use in deployment templates for portal-be and federation
    if [[ $(kubectl get configmap -n $ACUMOS_NAMESPACE acumos-certs) ]]; then
      log "Delete existing acumos-certs configmap in case cert changes were made"
      kubectl delete configmap -n $ACUMOS_NAMESPACE acumos-certs
    fi
    kubectl create configmap -n $ACUMOS_NAMESPACE acumos-certs \
      --from-file=certs/$ACUMOS_KEYSTORE_P12,certs/$ACUMOS_TRUSTSTORE,certs/$ACUMOS_CA_CERT,certs/$ACUMOS_CERT
  fi
}

set -x
trap 'fail' ERR
WORK_DIR=$(pwd)
cd $(dirname "$0")
source utils.sh
source acumos_env.sh
setup_keystore
cd $WORK_DIR


<filename>4.install_vim_plugin.sh
#!/bin/bash

# 安装vim插件
function install_vim_plugin()
{
    #vim -c "PlugInstall" -c "q" -c "q"
	if [ -f "plugged.tar.bz2" ];then
		echo "文件存在"
		rm -r ~/.vim/plugged
		tar -xjf plugged.tar.bz2
		mv plugged ~/.vim/
	else
		echo "文件不存在"
		vim -c "PlugInstall" -c "q" -c "q"
	fi
}

install_vim_plugin


#!/bin/bash
set -e
cd /root

# locale
echo -e "export LC_ALL=C\nexport LANG=C" > /etc/profile.d/lang.sh
source /etc/profile.d/lang.sh

# move ec2-user home to /tmp
unshare --user --map-root-user usermod -d /tmp/ec2-user ec2-user
mv /home/ec2-user /tmp

# remove stuff
yum -y remove postfix mariadb-libs selinux-policy cronie audit update-motd amazon-linux-extras gdisk libicu man-db less glibc-locale-source glibc-all-langpacks

# install conda
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -o conda.sh
bash conda.sh -bfp /opt/conda
rm -f conda.sh
ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh
source /etc/profile.d/conda.sh
conda update --all --yes -c conda-forge -c bioconda
conda clean --all --yes
conda install --yes -c conda-forge -c bioconda awscli snakemake inotify_simple
conda clean --all --yes

# install packages
yum -y install git gcc libuuid-devel openssl-devel libseccomp-devel squashfs-tools cryptsetup glibc-minimal-langpack mdadm
yum -y update

# install singularity
curl https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz -o go.tar.gz
tar xf go.tar.gz
rm -f go.tar.gz
export GOCACHE=/media/ephemeral0/tmp
export HOME=/root
export VERSION=v3.5.2
export GOPATH=/media/ephemeral0/gopath
export PATH=/root/go/bin:$PATH
go get -d github.com/sylabs/singularity || true
cd $GOPATH/src/github.com/sylabs/singularity
git fetch
git checkout $VERSION
go version
bash mconfig
make -C builddir
make -C builddir install
cd /root

# disable stuff
systemctl mask serial-getty@ttyS0.service
systemctl mask systemd-tmpfiles-clean.timer
systemctl disable getty@tty1
systemctl disable rsyslog

# dont use PrivateTmp
sed -i 's/PrivateTmp=yes/PrivateTmp=no/' /usr/lib/systemd/system/chronyd.service

# raid0 params
echo 'options raid0 default_layout=2' > /etc/modprobe.d/raid0.conf

# disable auto upgrade
sed -i 's/^repo_upgrade:.*/repo_upgrade: none/' /etc/cloud/cloud.cfg

# singularity
sed -i 's/^mount home =.*/mount home = no/' /usr/local/etc/singularity/singularity.conf
sed -i 's/^mount tmp =.*/mount tmp = no/' /usr/local/etc/singularity/singularity.conf
sed -i 's/^mount hostfs =.*/mount hostfs = yes/' /usr/local/etc/singularity/singularity.conf

# clean up
yum -y remove gcc git
yum -y autoremove
yum clean all
rm -rf /usr/share/doc
rm -rf $GOPATH
rm -rf /root/go
rm -rf /root/.cache
rm -rf /var/cache/yum/

# reset log file
cp /var/log/cloud-init-output.log /root/ami.log
df -h
echo -n > /var/log/cloud-init-output.log


<reponame>judiba/Main<gh_stars>1-10
#BY: @judiba
#R3V1V3R VPS
#Data de criação: 30/04/2017
#Nome: ConfVPS02 - PackVPS 2.0"
clear
echo -e "\033[01;34mConfVPS02"
echo ""
echo -e "\033[01;36m       BY: @judiba
       R3V1V3R VPS
       Data de criação: 26/04/2017
       TCPTWEAKER
       Nome: PackVPS 2.0           \033[1;37m"
echo ""
read -p "De enter para continuar..."
clear
tput setaf 8 ; tput setab 5 ; tput bold ; printf '%30s%s%-15s\n' "TCP Tweaker 1.0" ; tput sgr0
if [[ `grep -c "^#R3V1V3R" /etc/sysctl.conf` -eq 1 ]]
then
	echo ""
	echo "As configurações de rede TCP Tweaker já foram adicionadas no sistema!"
	echo ""
	read -p "Deseja remover as configurações do TCP Tweaker? [s/n]: " -e -i n resposta0
	if [[ "$resposta0" = 's' ]]; then
		grep -v "^#R3V1V3R
net.ipv4.tcp_window_scaling = 1
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 16384 16777216
net.ipv4.tcp_low_latency = 1
net.ipv4.tcp_slow_start_after_idle = 0" /etc/sysctl.conf > /tmp/syscl && mv /tmp/syscl /etc/sysctl.conf
/sbin/sysctl -p /etc/sysctl.conf > /dev/null
		echo ""
		echo "As configurações de rede do TCP Tweaker foram removidas com sucesso."
		echo ""
	exit
	else
		echo ""
		exit
	fi
else
	echo ""
	echo "Este é um script experimental. Use por sua conta e risco!"
	echo "Este script irá alterar algumas configurações de rede"
	echo "do sistema para reduzir a latência e melhorar a velocidade."
	echo ""
	read -p "Continuar com a instalação? [s/n]: " -e -i n resposta
	if [[ "$resposta" = 's' ]]; then
	echo ""
	echo "Modificando as seguintes configurações:"
	echo " " >> /etc/sysctl.conf
	echo "#R3V1V3R" >> /etc/sysctl.conf
echo "net.ipv4.tcp_window_scaling = 1
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 16384 16777216
net.ipv4.tcp_low_latency = 1
net.ipv4.tcp_slow_start_after_idle = 0" >> /etc/sysctl.conf
echo ""
/sbin/sysctl -p /etc/sysctl.conf
		echo ""
		echo "As configurações de rede do TCP Tweaker foram adicionadas com sucesso."
		echo ""
	else
		echo ""
		echo "A instalação foi cancelada pelo usuário!"
		echo ""
	fi
fi
exit


# Create a training directory and unzip master training tar file there
mkdir Training
mv ILSVRC2012_img_train.tar Training
cd Training
tar -xvf ILSVRC2012_img_train.tar

# Loop through outputed training class tars (n*.tar), unzip, and put into their own folders
for file in n*.tar
do
  echo Creating directory ${file%.*}...
  mkdir ${file%.*}
  echo Moving $file into ${file%.*}...
  mv $file ${file%.*}
  echo Entering directory ${file%.*}...
  cd ${file%.*}
  echo Unziping tar file
  tar -xvf *.tar
  echo Exiting directory ${file%.*} and back to parent directory...
  cd ..
done


<filename>config/hc-backoffice/demo/bootstrap.sh
#!/bin/bash

set -e

# Lets setup the human connection backend for development

# setup docker-compose
if [ ! -x /usr/local/bin/docker-compose ]; then
  sudo curl -L "https://github.com/docker/compose/releases/download/1.26.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
  sudo chmod +x /usr/local/bin/docker-compose
fi

# setup ngrok https://dashboard.ngrok.com/get-started/setup
if [ ! -x /usr/local/bin/ngrok ]; then
    curl -L https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip > /tmp/ngrok.zip
    sudo unzip /tmp/ngrok.zip -d /usr/local/bin
    rm -f /tmp/ngrok.zip
    ngrok --version
fi

function get_username() {
  curl -X POST \
    -s -H "Content-Type: application/json" \
    --data '{ "query": "{User(role:admin){name}}"}' \
    http://localhost:4000/graphql | \
    jq '.data.User[0].name' 2>/dev/null
}

function is_backend_up() {
  [ ! -z "$(get_username)" ] && return 0
  return 1
}

docker-compose up -d

for i in $(seq 1 30); do
  is_backend_up && docker-compose exec backend yarn run db:seed && \
    break || sleep 5 && echo 'waiting for backend to start';
done

ngrok start -config ./ngrok.yml webapp


<filename>containers/analytics/query-engine/entrypoint.sh<gh_stars>0
#!/bin/bash

source /common.sh

pre_start_init

hostip=$(get_listen_ip_for_node ANALYTICS)

cat > /etc/contrail/contrail-query-engine.conf << EOM
[DEFAULT]
analytics_data_ttl=${ANALYTICS_DATA_TTL:-48}
hostip=${hostip}
hostname=${DEFAULT_HOSTNAME}
http_server_port=${QUERYENGINE_INTROSPECT_LISTEN_PORT:-$QUERYENGINE_INTROSPECT_PORT}
log_file=$LOG_DIR/contrail-query-engine.log
log_level=$LOG_LEVEL
log_local=$LOG_LOCAL
max_slice=${QUERYENGINE_MAX_SLICE:-100}
max_tasks=${QUERYENGINE_MAX_TASKS:-16}
start_time=${QUERYENGINE_START_TIME:-0}
# Sandesh send rate limit can be used to throttle system logs transmitted per
# second. System logs are dropped if the sending rate is exceeded
# sandesh_send_rate_limit=
cassandra_server_list=$ANALYTICSDB_CQL_SERVERS
collectors=$COLLECTOR_SERVERS

[REDIS]
port=$REDIS_SERVER_PORT
server=127.0.0.1
password=$<PASSWORD>

$sandesh_client_config
EOM

add_ini_params_from_env QUERY_ENGINE /etc/contrail/contrail-query-engine.conf

set_third_party_auth_config
set_vnc_api_lib_ini

exec "$@"


#!/bin/bash
set -evx

mkdir ~/.celercore

# safety check
if [ ! -f ~/.celercore/.celer.conf ]; then
  cp share/celer.conf.example ~/.celercore/celer.conf
fi


#!/bin/bash
set -e

echo "Getting the complete Build EAR source code"
tmp_dir=`mktemp -d "Bear.XXXXXXXX" --tmpdir`
git clone https://github.com/rizsotto/Bear.git ${tmp_dir}
mkdir -p ${tmp_dir}/build
cd ${tmp_dir}/build
cmake ..
make install
make check
make package
rm -rf ${tmp_dir}


<reponame>cvondratek/bxx-linux
#!/bin/sh

#############################################################
# bxx Wifi client helper script
#   -> Interactive script for connecting to WiFi network from
#      on bXX platforms like BeagleClone or BeagleBone
#
#   Notes:
#   * Tested with rt2500 USB Wifi 802.11n devices
#
#############################################################

#config file location
CFG_FILE="/tmp/wpa_supplicant.conf"

# Wifi interface definition
IF_WIFI='wlan0'

#udhcpc cmd
UDHCPC_CMD="/sbin/udhcpc -i ${IF_WIFI}&"
echo $UDHCPC_CMD

# Clean-up after any previous runs of this script
ifconfig ${IF_WIFI} down
killall -q wpa_supplicant
killall -q wpa_cli
killall -q udhcpc

#dust->settle
sleep 1

# Step 1: See if we have a valid wifi.conf & if not create it
if [ ! -f "$CFG_FILE" ]; then
	echo "Enter SSID of the wifi network you want to connect to:"
	read ssid
	echo "Enter the passphrase. It will be stored plain-text at $CFG_FILE."
	read pass
	echo "Creating wifi.conf..."
	echo "ctrl_interface=/var/run/wpa_supplicant"
	echo "update_config=1" > $CFG_FILE
	echo "fast_reauth=1" >> $CFG_FILE
	echo "ap_scan=1" >> $CFG_FILE
	echo "network={" >> $CFG_FILE
	echo "	ssid=\"${ssid}\"" >> $CFG_FILE
	echo "	psk=\"${pass}\"" >> $CFG_FILE
	echo "}" >> $CFG_FILE
fi

# Step 2: Start wpa_supplicant & wpa_cli monitor
wpa_supplicant -i ${IF_WIFI} -B -c ${CFG_FILE}

# Step 3: Make a callback file to run udhcpc when we're connected...
CLIENT_CB='/tmp/wifi_client-cb.sh'
echo "#!/bin/sh" > $CLIENT_CB
echo "${UDHCPC_CMD}" >> $CLIENT_CB
chmod +x $CLIENT_CB
wpa_cli -Ba $CLIENT_CB


#!/bin/bash

set -e

dotnet restore

dotnet build -c Release src/BetaLixT.Logger/BetaLixT.Logger.csproj


<gh_stars>0
make run_harness RUN_ARGS="--benchmarks=ssd-large,gnmt --scenarios=SingleStream --test-mode=PerformanceOnly"
make update_results


#!/bin/sh
#
#	@(#)updatedb.csh	4.6.1	(2.11BSD)	1996/10/23
#
SRCHPATHS="/"			# directories to be put in the database
LIBDIR=/libexec			# for subprograms
FINDHONCHO=root			# for error messages
FCODES=/var/db/find.codes	# the database

PATH=$LIBDIR:/bin
bigrams=/tmp/f.bigrams$$
filelist=/tmp/f.list$$
errs=/tmp/f.errs$$

# Make a file list and compute common bigrams.
# Alphabetize '/' before any other char with 'tr'.
# If the system is very short of sort space, 'bigram' can be made
# smarter to accumulate common bigrams directly without sorting
# ('awk', with its associative memory capacity, can do this in several
# lines, but is too slow, and runs out of string space on small machines).

nice +10
find ${SRCHPATHS} -print | tr '/' '\001' | \
   (sort -f; echo $status > $errs) | \
   tr '\001' '/' > $filelist
$LIBDIR/bigram < $filelist | \
   (sort; echo $status >> $errs) | uniq -c | sort -nr | \
   awk '{ if (NR <= 128) print $2 }' | tr -d '\012' > $bigrams

# code the file list

if grep -s -v 0 $errs
then
	echo 'squeeze error: out of sort space' | mail $FINDHONCHO
else
	$LIBDIR/code $bigrams < $filelist > $FCODES
	chmod 644 $FCODES
	rm $bigrams $filelist $errs
fi


#!/usr/bin/env bash

########

RED="\e[31m"
GREEN="\e[32m"
YELLOW="\e[33m"
BLUE="\e[34m"
MAGENTA="\e[35m"
CYAN="\e[36m"

RESET="\e[0m"

########

MSG_DEBUG="${MAGENTA}[DEBUG] 👾"
MSG_DOCS="${CYAN}[DOCS] 📝"
MSG_ERROR="${RED}[ERROR] 💥"
MSG_INFO="${BLUE}[INFO] ℹ "
MSG_OK="${GREEN}[OK] ✅"
MSG_WARN="${YELLOW}[WARN] ⚠ "

MSG_END="${RESET}"

########

function logger-debug {
  printf '%b\n' "${MSG_DEBUG} ${1} ${MSG_END}"
}
export -f logger-debug

function logger-docs {
  printf '%b\n' "${MSG_DOCS} ${1} ${MSG_END}"
}
export -f logger-docs

function logger-error {
  printf '%b\n' "${MSG_ERROR} ${1} ${MSG_END}"
}
export -f logger-error

function logger-info {
  printf '%b\n' "${MSG_INFO} ${1} ${MSG_END}"
}
export -f logger-info

function logger-ok {
  printf '%b\n' "${MSG_OK} ${1} ${MSG_END}"
}
export -f logger-ok

function logger-warn {
  printf '%b\n' "${MSG_WARN} ${1} ${MSG_END}"
}
export -f logger-warn


<filename>scripts/build.sh
#!/usr/bin/env bash
set -e

cd "$(dirname "$0")/../"

docker-compose exec -T workspace go build -v -o bin/sms github.com/itsalex/sentry-mattermost-sidecar/cmd/sms


<filename>input/qsub.l.sh
#!/bin/sh
#PBS -q L
#PBS -b 16
#PBS -l memsz_job=3gb
#PBS -l elapstim_req=00:10:00
#PBS -l filecap_job=100gb
#PBS -v OMP_NUM_THREADS=4
#PBS -m bea
#PBS -M <EMAIL>
#PBS -w SHOME="/S/data06/G6140/e0564/baba/JAGURS_SAMPLE"

#PBS -v MPIPROGINF=ALL_DETAIL

#PBS -I "${SHOME}/JAGURS-D_V0197/jagurs,ALL:./"
#PBS -I "${SHOME}/tsun.par,ALL:./"
#PBS -I "${SHOME}/gridfile.dat,ALL:./"
#PBS -I "${SHOME}/test_tgs.txt,ALL:./"
#PBS -I "${SHOME}/bathy.SD01.grd.%06j,%j:./"
#PBS -I "${SHOME}/bathy.SD02.grd.%06j,%j:./"
#PBS -I "${SHOME}/bathy.SD03.grd.%06j,%j:./"
#PBS -I "${SHOME}/bathy.SD04.grd.%06j,%j:./"
#PBS -I "${SHOME}/bathy.SD05.grd.%06j,%j:./"
#PBS -I "${SHOME}/disp.SD01.grd.%06j,%j:./"
#PBS -I "${SHOME}/disp.SD02.grd.%06j,%j:./"
#PBS -I "${SHOME}/disp.SD03.grd.%06j,%j:./"
#PBS -I "${SHOME}/disp.SD04.grd.%06j,%j:./"
#PBS -I "${SHOME}/disp.SD05.grd.%06j,%j:./"

#PBS -O "${SHOME}/output.%r/,ALL:./"

mpirun -nnp 1 ./jagurs par=tsun.par


<filename>files/wireshark_handler.sh

##Aquisição do PATH do arquivo
[ "$UID" -eq 0 ] || exec sudo bash "$0" "$@"
file=$(which eve-ng-integration)

sudo echo "#!/usr/bin/env python
# See https://github.com/SmartFinn/eve-ng-integration

from __future__ import print_function
from subprocess import Popen, PIPE

import os
import sys

class Terminal(object):
    def __init__(self):
        self.current_desktop = os.getenv('XDG_CURRENT_DESKTOP')
        self.override_terminal = os.getenv('OVERRIDE_TERMINAL_CMD')

    def _is_command(self, command):
        for path in os.getenv('PATH', '').split(':'):
            if os.path.exists(os.path.join(path, command)) and \
                    os.access(os.path.join(path, command), os.X_OK):
                return True
        return False

    def _current_desktop(self, *desktops):
        if self.current_desktop is not None:
            current = self.current_desktop.lower()
            for desktop in desktops:
                if desktop in current:
                    return True
        return False

    def _terminal_emulator_cmd(self):
        if self.override_terminal:
            return self.override_terminal.split()
        elif self._is_command('x-terminal-emulator'):
            return ['x-terminal-emulator', '-e']
        elif self._current_desktop('cinnamon', 'gnome', 'unity'):
            return ['gnome-terminal', '-e']
        elif self._current_desktop('kde'):
            return ['konsole', '-e']
        elif self._current_desktop('lxde', 'lxqt'):
            return ['lxterminal', '-e']
        elif self._current_desktop('mate'):
            return ['mate-terminal', '-e']
        elif self._current_desktop('pantheon'):
            return ['pantheon-terminal', '-e']
        elif self._current_desktop('xfce'):
            return ['xfce4-terminal', '-e']
        elif self._is_command('urxvt'):
            return ['urxvt', '-e']
        else:
            return ['xterm', '-e']

    def execute(self, command):
        if isinstance(command, (str)):
            command = command.split('\n')

        term = self._terminal_emulator_cmd()

        Popen(term + command)

def main(argv):
    try:
        from urllib.parse import urlparse
    except ImportError:
        from urlparse import urlparse

    url = urlparse(argv)
    term = Terminal()

    data = {
        'host': url.hostname or 'localhost',
        'port': url.port or '',
        'path': url.path.lstrip('/') or '',
    }

    if url.scheme == 'capture':
        cmd = 'ssh -p 2266 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no \
              -l eve {host} sudo tcpdump -i {path} -n -s 0 -U -w -'.format(**data)
        wireshark_cmd = 'wireshark -k -i -'

        tcpdump = Popen(cmd.split(), stdout=PIPE, preexec_fn=os.setsid)
        wireshark = Popen(wireshark_cmd.split(), stdin=tcpdump.stdout)
        wireshark.communicate()
    elif url.scheme == 'docker':
        cmd = 'docker -H {host}:{port} attach {path}'.format(**data)

        term.execute(cmd)
    elif url.scheme == 'telnet':
        cmd = 'telnet {host} {port}'.format(**data)

        term.execute(cmd)
    else:
        return '{}: The protocol {} is not supported.'.format(url.geturl(),
                                                              url.scheme)

if __name__ == '__main__':
    try:
        sys.exit(main(sys.argv[1]))
    except IndexError:
        print('usage:', __file__, '<url>', file=sys.stderr)
        sys.exit(1)
" > $file


#!/bin/bash
set -e

nohup etcd > test_etcd_client_etcd.log 2>&1 &
pid=$!

unset https_proxy http_proxy
python -u ./etcd_client_test.py

kill -9 $pid


#!/bin/bash

rm -rf *.o *.lo *.so
gcc -c -w -fPIC lpm.c log.c hmappriv.c memcached_client.c
gcc -shared -o liblpm.so lpm.o log.o hmappriv.o memcached_client.o -lmemcached -lm -ldl
LD_PRELOAD=./liblpm.so /usr/bin/touch file
#LD_PRELOAD=./liblpm.so /bin/ln -s file file_ln
#LD_PRELOAD=./liblpm.so /bin/mv file file.log
#LD_PRELOAD=./liblpm.so /bin/rm file_ln
#LD_PRELOAD=./liblpm.so /bin/rm file.log
#LD_PRELOAD=./liblpm.so /bin/mkdir a
#LD_PRELOAD=./liblpm.so /bin/rmdir a


<filename>lang/shell/bash/functions/common/i/install-bat.sh<gh_stars>1-10
#!/usr/bin/env bash

koopa_install_bat() {
    koopa_install_app \
        --link-in-bin='bin/bat' \
        --name='bat' \
        --installer='rust-package' \
        "$@"
}


#!/bin/bash

set -x

: ${PARCEL_REPO:=/opt/cloudera/parcel-repo}

parcels=("$PARCEL_REPO"/*.parcel)

for parcel in "${parcels[@]}"; do
	if [[ -f "${parcel}.torrent" ]]; then
		echo "$parcel torrent already exists, skip"
	else
		mktorrent -l 19 -v -p -a "" -o "${parcel}.torrent" "${parcel}"
		touch "${parcel}".skiphash
		rm -f "${parcel}"
		touch "${parcel}"
	fi
done

chown -R cloudera-scm:cloudera-scm ${PARCEL_REPO}

echo "Torrent creation successful" >> /tmp/create_torrent.status


#!/bin/bash

which dotnet > /dev/null

if [ $? -ne 0 ]; then
	echo "dotnet not available."
	exit
fi;


<gh_stars>0
#!/bin/sh

COPYFILE_DISABLE=1 tar -cf sample.tar _manifest.json _index.json chapters images


<filename>llvm-libcxxabi-2017-01-27/build.sh
#!/bin/bash
# Copyright 2016 Google Inc. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
. $(dirname $0)/../custom-build.sh $1 $2
. $(dirname $0)/../common.sh

get_svn_revision http://llvm.org/svn/llvm-project/libcxxabi/trunk 293329 SRC
build_fuzzer

if [[ $FUZZING_ENGINE == "hooks" ]]; then
  # Link ASan runtime so we can hook memcmp et al.
  LIB_FUZZING_ENGINE="$LIB_FUZZING_ENGINE -fsanitize=address"
fi
$CXX $CXXFLAGS -std=c++11 SRC/fuzz/cxa_demangle_fuzzer.cpp SRC/src/cxa_demangle.cpp -I SRC/include \
   $LIB_FUZZING_ENGINE -o $EXECUTABLE_NAME_BASE


# Cannot build with PIE as symbols (e.g. `__libc_csu_fini`) cannot be used.
if [ "$(uname)" == "Linux" ] && [ "${c_compiler}" == "gcc" ]
then
    export CFLAGS="${CFLAGS} -fno-pie -no-pie"
    export CXXFLAGS="${CFLAGS} -fno-pie -no-pie"
fi

./configure --prefix="${PREFIX}" \
            --enable-pic
make
make install


<filename>uninstallApk.sh
adb uninstall com.blockeq.stellarwallet
adb uninstall com.blockeq.stellarwallet.test


<reponame>deflax/steinvord
#!/bin/bash

until /home/steinvord/steinvord/steinvord.py; do
     echo "Steinvord crashed with exit code $?.  Respawning.." >&2
     sleep 1
done


<reponame>JozeFe/open-sandbox<filename>sandbox-scripts/nginx/nginx-docker-testing.sh
#!/usr/bin/env bash

# nginx docker bash testing start
docker run --rm -it -p 80:80 nginx-static-example bash

# preparation - volume copy
docker run --rm -it -v /c/tmp/etc_nginx:/tmp -p 80:80 nginx-static-example cp -a /etc/nginx/. /tmp/
docker run --rm -it -v /tmp/tmp/etc_nginx:/tmp -p 80:80 nginx-static-example cp -a /etc/nginx/. /tmp/

# local config test with minimal-rest api
docker network create test
docker run --name nginx --network test --rm -it -v /c/tmp/etc_nginx:/etc/nginx -p 80:80 nginx-static-example bash
docker run --name rest1 -d --network test minimal-rest
docker run --name rest2 -d --network test minimal-rest


<filename>config/zsh/zshenv.d/vagrant.zsh
export VAGRANT_HOME="${XDG_DATA_HOME}/vagrant"
export VAGRANT_ALIAS_FILE="${XDG_DATA_HOME}/vagrant/aliases"


pip install dash==0.21.0  # The core dash backend
pip install dash-renderer==0.12.1  # The dash front-end
pip install dash-html-components==0.10.0  # HTML components
pip install dash-core-components==0.22.1  # Supercharged components
pip install plotly --upgrade  # Latest Plotly graphing library


#!/bin/sh

source _venv/bin/activate
python -m api


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

SCRIPT_DIR=$(dirname "${BASH_SOURCE}")
CONFIGURE_SCRIPT=$1
shift 1
set -e

"${SCRIPT_DIR}/patch_configure.py" "${CONFIGURE_SCRIPT}"

if [ -z "${NACL_CROSS_PREFIX}" ]; then
  WEBPORTS_ENV_IMPORT=1
  . "${SCRIPT_DIR}/webports-env.sh"
fi

# TODO(sbc): this code is currently duplicated in common.sh.
PatchConfigSub() {
  # Replace the package's config.sub one with an up-do-date copy
  # that includes nacl support.  We only do this if the string
  # 'nacl)' is not already contained in the file.
  local DEFAULT_CONFIG_SUB="$(dirname ${CONFIGURE_SCRIPT})/config.sub"
  local CONFIG_SUB=${CONFIG_SUB:-${DEFAULT_CONFIG_SUB}}
  if [ ! -f ${CONFIG_SUB} ]; then
    if [ -n "${CONFIG_SUB_MISSING}" ]; then
      return
    fi
    echo "Failed to find config.sub (${CONFIG_SUB})."
    echo "Please specify using \$CONFIG_SUB."
    exit 1
  fi
  if grep -q 'nacl)' ${CONFIG_SUB} /dev/null; then
    echo "${CONFIG_SUB} supports NaCl"
  else
    echo "Patching config.sub"
    /bin/cp -f ${SCRIPT_DIR}/config.sub ${CONFIG_SUB}
  fi
}

PatchConfigSub

CONF_HOST=${NACL_CROSS_PREFIX}
if [ "${NACL_ARCH}" = "pnacl" -o "${NACL_ARCH}" = "emscripten" ]; then
  # The PNaCl tools use "pnacl-" as the prefix, but config.sub
  # does not know about "pnacl".  It only knows about "le32-nacl".
  # Unfortunately, most of the config.subs here are so old that
  # it doesn't know about that "le32" either.  So we just say "nacl".
  CONF_HOST="nacl"
fi

NaClEnvExport
echo "${CONFIGURE_SCRIPT}" --host=${CONF_HOST} --prefix=${NACL_PREFIX} "$@"
exec "${CONFIGURE_SCRIPT}" --host=${CONF_HOST} --prefix=${NACL_PREFIX} "$@"


#!/bin/zsh

script_dir=$(dirname ${0:A})
projectfolder=$(dirname $script_dir)

source ${projectfolder}/Header.sh

CISLevel="1"
audit="5.1.5 Ensure Sealed System Volume (SSV) Is Enabled (Automated)"
orgScore="OrgScore5_1_5"
emptyVariables
# Verify organizational score
runAudit
# If organizational score is 1 or true, check status of client
if [[ "${auditResult}" == "1" ]]; then
	method="Script"
	remediate='Script > sudo /usr/bin/csrutil authenticated-root enable'

	authenticatedRoot="$(csrutil authenticated-root | /usr/bin/grep -c 'enabled')"
	if [[ "${authenticatedRoot}" == "1" ]]; then
		result="Passed"
		comment="Authenticated Root: Enabled"
	else
		result="Failed"
		comment="Authenticated Root: Disabled"
		# Remediation
		if [[ "${remediateResult}" == "enabled" ]]; then
			csrutil authenticated-root enable
			# re-check
			authenticatedRoot="$(csrutil authenticated-root | /usr/bin/grep -c 'enabled')"
			if [[ "${authenticatedRoot}" == "1" ]]; then
				result="Passed After Remediation"
				comment="Authenticated Root: Enabled"
			else
				result="Failed After Remediation"
			fi
		fi
	fi
fi
printReport


#!/bin/bash

sudo docker rmi loadtestingAPI
sudo docker build . -t loadtesting

read


<reponame>keyongyu/models
#!/usr/bin/env bash

if [ "$1" == '' ] || [ "$2" == '' ]  || [ "$3" == '' ]
then
   echo "Usage: $0 train_dir seq_no dest_pb_file"
   exit
fi

#TRAIN_DIR="/home/keyong/Documents/ssd/train_dir"
#SEQ_NO="120341"
TRAIN_DIR=$1
SEQ_NO=$2
OPT_PB_FILE=$3
echo python ~/Documents/gits/models/research/object_detection/export_inference_graph.py --input_type \
image_tensor --pipeline_config_path "$TRAIN_DIR/pipeline.config"  --trained_checkpoint_prefix \
"$TRAIN_DIR/model.ckpt-$SEQ_NO" --output_dir /tmp/my.pb

python ~/Documents/gits/models/research/object_detection/export_inference_graph.py \
--pipeline_config_path "$TRAIN_DIR/pipeline.config" --trained_checkpoint_prefix    \
"$TRAIN_DIR/model.ckpt-$SEQ_NO" --input_type image_tensor --output_dir /tmp/my.pb  \

transform_graph --in_graph=/tmp/my.pb/frozen_inference_graph.pb  --out_graph="$OPT_PB_FILE" --inputs='image_tensor' --outputs='detection_boxes,detection_scores,detection_classes,num_detections' --transforms='fold_constants(ignore_errors=true) fold_batch_norms fold_old_batch_norms strip_unused_nodes'

rm -fr /tmp/my.pb


<filename>docker-bench/run.sh<gh_stars>10-100
#!/bin/sh

docker run -it --net host --pid host --userns host --cap-add audit_control \
     -e DOCKER_CONTENT_TRUST=$DOCKER_CONTENT_TRUST \
     -v /var/lib:/var/lib \
     -v /var/run/docker.sock:/var/run/docker.sock \
     -v /etc:/etc --label docker_bench_security \
     docker/docker-bench-security


#!/usr/local/bin/bash

battery() {
  charge=$(acpiconf -i 0 | grep % | awk '{print $3}' | sed 's/%//')
  chargeicon=""
  chargeiconcolor="^fg(#ffffff)"
  chargestate=$(acpiconf -i 0 | grep State: | awk '{print $2}' | sed 's/%//')
  if [[ ${chargestate} != "discharging" ]]
  then
    chargeiconcolor="^fg(#00cc00)"
  elif [[ ${chargestate} = "discharging" ]] && [[ ${charge} -lt 25 ]]
  then
    chargeiconcolor="^fg(#cc0000)"
  fi

  if [[ ${charge} -lt 100 ]] && [[ ${charge} -gt 74 ]]
  then
    chargeicon=""
  elif [[ ${charge} -lt 75 ]] && [[ ${charge} -gt 49 ]]
  then
    chargeicon=""
  elif [[ ${charge} -lt 50 ]] && [[ ${charge} -gt 24 ]]
  then
    chargeicon=""
  elif [[ ${charge} -lt 25 ]] && [[ ${charge} -gt 0 ]]
  then
    chargeicon=""
  elif [[ ${charge} = 100 ]]
  then
    chargeicon=""
  elif [[ ${charge} = 0 ]]
  then
    chargeicon=""
  else
    chargeicon="N/A"
  fi

  echo "$charge% ^fn(DroidSansMonoForPowerline Nerd Font:size=22)^p(;-1)$chargeiconcolor$chargeicon ^fg($fgcolor)"
  return
}

while :; do
  buf=""
  buf="${buf} ^pa(1840)$(battery)"

  echo $buf
  sleep 1
done |  dzen2 -h 28 -w 1920 -fn 'Roboto Medium:size=13' -ta l -e "button7=exit"


<reponame>johnkeeping/chpersroot
#!/bin/sh

cd "$(dirname "$0")"

n_passed=0
n_failed=0

_run_success_test() {
	echo "$2" >"test.$$.ini" &&
	echo "$5" >"test.$$.expected" &&
	./initest "test.$$.ini" "$3" "$4" >"test.$$.actual" &&
	diff -u "test.$$.expected" "test.$$.actual" &&
	rm -f "test.$$."*
}

test_expect_success() {
	if _run_success_test "$@"
	then
		echo "test passed: $1"
		n_passed=$((n_passed + 1))
	else
		echo "test failed: $1"
		n_failed=$((n_failed + 1))
	fi
}

test_expect_success 'simple ini file' '
[gentoo32]
	rootdir = foo bar' gentoo32 rootdir 'foo bar'

test_expect_success 'initial comment' '
; This is a comment!
[gentoo32]
	rootdir = foo bar' gentoo32 rootdir 'foo bar'

test_expect_success 'comment after section' '
[gentoo32] ; comment
	rootdir = foo bar' gentoo32 rootdir 'foo bar'

test_expect_success 'comment after value' '
[gentoo32]
	rootdir = foo bar ; comment' gentoo32 rootdir 'foo bar'

test_expect_success 'comment on line' '
[gentoo32]
	; This is a comment
	rootdir = foo bar' gentoo32 rootdir 'foo bar'

test_expect_success 'sq value' "
[gentoo32]
	rootdir = 'foo bar ; comment'" gentoo32 rootdir 'foo bar ; comment'

test_expect_success 'dq value' '
[gentoo32]
	rootdir = "foo bar ; comment"' gentoo32 rootdir 'foo bar ; comment'

test_expect_success 'continued value' '
[gentoo32]
	rootdir = foo \
bar' gentoo32 rootdir 'foo bar'

test_expect_success 'second section' '
[gentoo32]
	rootdir = "foo bar"
; Comment preceding section 2
[section two]
	rootdir = /jail' 'section two' rootdir '/jail'

printf '%d/%d passed\n' $n_passed $((n_passed + n_failed))
test $n_failed = 0


#!/bin/zsh

echo "Updating package and repository references..."

OLD_PACKAGE_SCOPE="@themer/"
NEW_PACKAGE_SCOPE="@themerdev/"

OLD_REPO_PATH="mjswensen/themer"
NEW_REPO_PATH="themerdev/themer"

PACKAGES_DIR="$(realpath "$(dirname $0:A)/../packages")"
PACKAGE="$PACKAGES_DIR/$1"

find \
  $PACKAGE \
  -type f \
  | xargs \
    --replace=__FILE__ \
    sed \
      --in-place \
      --expression="s|$OLD_PACKAGE_SCOPE|$NEW_PACKAGE_SCOPE|g" \
      --expression="s|$OLD_REPO_PATH|$NEW_REPO_PATH|g" \
      __FILE__

jq ".repository = .repository + {directory:\"cli/packages/$1\"}" \
  < $PACKAGE/package.json \
  > $PACKAGE/new.package.json
mv $PACKAGE/new.package.json $PACKAGE/package.json

echo "Staging changed files..."
git add -- $PACKAGE

echo "TODO: review staged diffs"
read "READY?Ready ('y' to proceed)? "
[[ $READY != 'y' ]] && exit 1

echo "Comitting..."
git commit -m "Move $1 to @themerdev"

read "OTP?npm OTP: "

echo "Publishing to npm..."
npm publish $PACKAGE --access public --otp $OTP

echo "Tagging commit..."
VERSION="$(jq --raw-output '.version' < $PACKAGE/package.json)"
git tag "$NEW_PACKAGE_SCOPE$1-v$VERSION"

echo "Deprecating old package..."
npm deprecate "$OLD_PACKAGE_SCOPE$1" "Moved to $NEW_PACKAGE_SCOPE$1" --otp $OTP


#!/bin/bash

. /etc/xensource-inventory
iso_name=/opt/xensource/packages/iso/xs-tools-${PRODUCT_VERSION}.iso

skip_vm()
{
    local vm=$1

    #
    # skip if the vm is not started
    #
    local powerstate=`xe vm-param-get uuid=$vm param-name=power-state`
    if [ "$powerstate" != "running" ] ; then
        echo "  skipping since vm is not running."
        return 1
    fi

    #
    # Skip if there is a PV boot loader meaning this is not an HVM domain
    #
    local pvbootloader=`xe vm-param-get uuid=$vm param-name=PV-bootloader 2> /dev/null`
    if [ "$pvbootloader" != "" ] ; then
        echo "  skipping since this is a para-virtualized domain (not windows)."
        return 1
    fi

    #
    # Skip if the windows pv tools are already up to date.
    #
    local uptodate=`xe vm-param-get uuid=$vm param-name=PV-drivers-up-to-date`
    if [ "$uptodate" == "true" ] ; then
        echo "  skipping since windows pv tools are already up to date."
        return 1
    fi

    local pvmajor=`xe vm-param-get uuid=$vm param-name=PV-drivers-version param-key=major 2> /dev/null`
    local pvminor=`xe vm-param-get uuid=$vm param-name=PV-drivers-version param-key=minor 2> /dev/null`
    if [[ "$pvmajor" == "" && "$pvminor" == "" ]] ; then
        echo "  skipping since no windows pv tools are installed."
        return 1
    fi

    if [[ "$pvmajor" < 4 ]] ; then
        echo "  skipping since the windows tools installed are too old to be auto-upgraded."
        return 1
    fi

    return 0
}

main()
{
    local vms=`xe vm-list --minimal`

    mkdir -p /root/xensetup 2> /dev/null
    mount -o loop $iso_name /root/xensetup 2> /dev/null

    for vm in `echo $vms | sed 's/,/ /g'` ; do
        local name=`xe vm-param-get uuid=$vm param-name=name-label`
        echo ""
        echo "Processing $name..."

        skip_vm $vm
        if [ $? == 0 ] ; then
            local domid=`xe vm-param-get uuid=$vm param-name=dom-id`
            echo "  updating windows pv tools for $domid"
            /opt/xensource/libexec/rexec_client $domid "xensetup.exe /S" < /root/xensetup/xensetup.exe
        fi

    done

    umount /root/xensetup 2> /dev/null
    rmdir -p /root/xensetup 2> /dev/null
}

if [ "$1" != "-q" ] ; then
    echo "Driver auto-upgrade is experimental and unsupported in this version of XenServer"
fi

main


<gh_stars>1-10
#!/bin/bash

# This script:
# 1. Start TA2 in server mode
# 2. Runs dummy_ta3 client to connect to TA2
# 3. Generate prediction for each TA2 pipeline
# 4. Generate score for each prediction

# 1. Start TA2 in server mode
/user_opt/d3mStart.sh &> /output/out.txt &
ta2_pid=$!

echo TA2 PID is $ta2_pid

# Wait for TA2 server to start
sleep 30

mkdir -p /output/predictions
mkdir -p /output/pipeline_runs

# 2. Runs dummy_ta3 client to connect to TA2
python3 -m dummy_ta3.dummy_ta3 -p /input/TRAIN/problem_TRAIN/problemDoc.json -d /input -e 127.0.0.1 -t $D3MTIMEOUT

# 2.5 Stop TA2 system
kill $(ps aux | grep ta2-server.py | grep python | awk '{print $2}')

# 3. Generate prediction for each TA2 pipeline
echo "Generating predictions"
cd /output/pipelines_ranked
for f in *.json; do
    output_file_name=${f%.*}
    echo " -m d3m.runtime fit-produce -p $f -r /input/TRAIN/problem_TRAIN/problemDoc.json -i /input/TRAIN/dataset_TRAIN/datasetDoc.json  -t /input/TEST/dataset_TEST/datasetDoc.json  -o /output/predictions/${output_file_name}.csv"
done | xargs -l1 -P5 python3 &> /dev/null

# 4. Generate score for each prediction
echo "Generating scores"
# bash /user_opt/dsbox/src/nist_eval_output_validation_scoring/scripts/score_output.sh
bash /user_opt/dsbox/src/d3m-outputs/scripts/score_output.sh
chmod -R go+rwX /output/*

echo "Cleaning up"
/bin/rm -R /output/pipelines_fitted/*/*.pkl

echo "Exiting"
kill $ta2_pid
kill -9 $ta2_pid

exit 0


<reponame>ubuntu-openstack/bigdata-novalxd
#!/bin/bash -e
# Run very small terasort job
juju action do resourcemanager/0 terasort size=10000


<gh_stars>0
ruby .git/AWSDevTools/aws.elasticbeanstalk.push --environment lincolndouglasdebate


<reponame>tucan9389/mobile-pose-estimation-for-TF2
# python train.py \
# --dataset_config config/dataset/receipt5982-gpu.cfg \
# --experiment_config config/training/receipt-experiment04-cpm-sg5-gpu.cfg; \
# python train.py \
# --dataset_config config/dataset/receipt5982-gpu.cfg \
# --experiment_config config/training/receipt-experiment04-cpm-sg3-gpu.cfg; \
# python train.py \
# --dataset_config config/dataset/receipt5982-gpu.cfg \
# --experiment_config config/training/receipt-experiment04-cpm-sg2-gpu.cfg; \
# python train.py \
# --dataset_config config/dataset/receipt5982-gpu.cfg \
# --experiment_config config/training/receipt-experiment04-cpm-sg1-gpu.cfg; \
# python train.py \
# --dataset_config config/dataset/receipt5982-gpu.cfg \
# --experiment_config config/training/receipt-experiment04-hg-gpu.cfg;
python train.py \
--dataset_config config/dataset/receipt5982-gpu.cfg \
--experiment_config config/training/receipt-experiment05-cpm-sg4-onlyupsampling_1-gpu.cfg; \
python train.py \
--dataset_config config/dataset/receipt5982-gpu.cfg \
--experiment_config config/training/receipt-experiment05-cpm-sg4-onlyupsampling_2-gpu.cfg; \
python train.py \
--dataset_config config/dataset/receipt5982-gpu.cfg \
--experiment_config config/training/receipt-experiment05-cpm-sg4-onlyupsampling_3-gpu.cfg; \
python train.py \
--dataset_config config/dataset/receipt5982-gpu.cfg \
--experiment_config config/training/receipt-experiment05-cpm-sg4-onlyupsampling_4-gpu.cfg; \
python train.py \
--dataset_config config/dataset/receipt5982-gpu.cfg \
--experiment_config config/training/receipt-experiment05-cpm-sg4-onlyupsampling_5-gpu.cfg; \
python train.py \
--dataset_config config/dataset/receipt5982-gpu.cfg \
--experiment_config config/training/receipt-experiment05-cpm-sg4-onlyupsampling_6-gpu.cfg;


<filename>src/main/resources/git/list-all-gh-projects.sh
#!/bin/zsh
# export all public remote git repositories from the given user to given file path with file name
echo 'Insert your github username:'
read USER
echo 'Insert the file name to export the remote git repositories from the given user:'
read TO_FILE
curl -s "https://api.github.com/users/$USER/repos?per_page=1000" | grep -o 'git@[^"]*'| cut -d'/' -f2 > $TO_FILE


if [ "$(uname)" == "Darwin" ]; then
    PRE_RELEASE_DOWNLOAD_URL="https://github.com/redxiiikk/butler-cli/releases/download/prerelease/butler-darwin"
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
    PRE_RELEASE_DOWNLOAD_URL="https://github.com/redxiiikk/butler-cli/releases/download/prerelease/butler-linux"
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then
    echo "not support windows!!!"
    exit 1
fi

if [ ! -d "$HOME/.butler/bin" ]; then
    mkdir -p "$HOME/.butler/bin"
fi

curl -L "$PRE_RELEASE_DOWNLOAD_URL" -o "$HOME/.butler/bin/butler"
chmod u+x "$HOME/.butler/bin/butler"

if [ -f "$HOME/.zshrc" ]; then
    SHELL_CONFIG_FILE="$HOME/.zshrc"
elif [ -f "$HOME/.bashrc" ]; then
    SHELL_CONFIG_FILE="$HOME/.bashrc"
else
    ehco "can't find shell config file!!!"
    exit 1
fi

if [ "$(cat $SHELL_CONFIG_FILE | grep 'PATH="$HOME/.butler/bin:$PATH"' | wc -l)" -lt 1 ]; then
    echo 'PATH="$HOME/.butler/bin:$PATH"' >> "$SHELL_CONFIG_FILE"
    echo
    echo "添加 shell 配置"
fi

echo
echo "Installation is complete, Please run:"
echo "    source $SHELL_CONFIG_FILE"


#!/bin/bash

# Variables
os_system=$(uname -o)
kernel=$(uname -r)
uptime=$(uptime | tr -s " " | cut -d "," -f 1)
uptime=$(echo ${uptime})
#shell="5.8" # Run zsh --version
shell=$(zsh --version | cut -d " " -f 2)
resolution=$(xrandr 2> /dev/null | grep "*" | head -1  | tr -s " " | cut -d " " -f 2)
user_loaded=$(whoami)
home_user="${HOME}"
cpu_model=$(lscpu | grep "Model name:" | tr -s " " | cut -d ":" -f 2)
cpu_model=$(echo ${cpu_model})
mem_total=$(lsmem | grep "Total online memory:" | tr -s " " | cut -d ":" -f 2)
mem_total=$(echo ${mem_total})
arch_system=$(uname -m)
hostname=$(hostname)
session_type="${XDG_SESSION_TYPE}"

echo -e "                                       "
echo -e "\e[31m         :.         .:      \e[0m"
echo -e "\e[31m      .=:             :=.   \e[0m"
echo -e "\e[31m     -+                 =-  \e[0m   \e[33mOS: \e[0m\e[35m${os_system}\e[0m"
echo -e "\e[31m    :#                   *- \e[0m   \e[33mHost: \e[0m\e[35m${hostname}\e[0m"
echo -e "\e[31m    @=                   :@ \e[0m   \e[33mKernel: \e[0m\e[35m${kernel}\e[0m"
echo -e "\e[31m   .@-                   :@:\e[0m   \e[33mUptime: \e[0m\e[35m${uptime}\e[0m"
echo -e "\e[31m    @*                   *@.\e[0m   \e[33mShell: \e[0m\e[35mzsh ${shell}\e[0m"
echo -e "\e[31m    #@*      :=++:      =@# \e[0m   \e[33mResolution: \e[0m\e[35m${resolution}\e[0m"
echo -e "\e[31m     #@#:     *@#     .#@%  \e[0m   \e[33mUser: \e[0m\e[35m${user_loaded}\e[0m"
echo -e "\e[31m      =%@%=:  *@*  :=%@@+   \e[0m   \e[33mHome: \e[0m\e[35m${home_user}\e[0m"
echo -e "\e[31m        -#@@@@@@@@@@@%+     \e[0m   \e[33mSession: \e[0m\e[35m${session_type}\e[0m"
echo -e "\e[31m           .=+%@@+=-.       \e[0m   \e[33mArch: \e[0m\e[35m${arch_system}\e[0m"
echo -e "\e[31m              *@#           \e[0m   \e[33mCPU: \e[0m\e[35m${cpu_model}\e[0m"
echo -e "\e[31m              +@*           \e[0m   \e[33mMemory: \e[0m\e[35m${mem_total}\e[0m"
echo -e "\e[31m              :@:           \e[0m"
echo -e "\e[31m               %            \e[0m"
echo -e "\e[31m                            \e[0m"
echo -e "\e[32m # Welcome to terminal of ${user_loaded}\e[0m"
echo -e -n "\e[35m # Loading terminal / \e[0m"
echo ""


#!/bin/bash

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

RELATIVE_DIR="$(dirname "$0")"

# INSTALL IPTABLES SCRIPTS ####################################################

cp ${RELATIVE_DIR}/iptables-scripts/iptables-*.sh /etc/
chown root:root /etc/iptables-*.sh
chmod 700 /etc/iptables-*.sh

# INSTALL LAUNCH FILES (SYSV) #################################################

cp ${RELATIVE_DIR}/init-scripts/systemd/iptables-rules.service /etc/systemd/system/
chown root:root /etc/systemd/system/iptables-rules.service
chmod 644 /etc/systemd/system/iptables-rules.service

# LAUNCH IPTABLES SCRIPTS (SYSTEMD) ###########################################

systemctl enable iptables-rules.service
systemctl start iptables-rules.service
systemctl status iptables-rules.service


#!/bin/bash

# download and install conda
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh # install in /nfs/code/miniconda3
rm Miniconda3-latest-Linux-x86_64.sh
conda update -n base -c defaults conda -y # update conda

# create virtual environment and install required dependencies
conda create -n 'torch_example' -y
conda activate torch_example
conda install pytorch torchvision -c pytorch -y
pip install --upgrade wandb
# pip install --upgrade git+git://github.com/wandb/client.git # install latest development version of wandb

# log in to W&B
wandb login


<gh_stars>0
#!/bin/bash
set -e

#if [ "$#" -eq 0 ]; then
#    exec python manage.py --help
#fi

if [ "$1" = 'dj' ]; then
    shift
    exec python manage.py "$@"
fi

exec "$@"


#!/bin/sh
# Purpose: geoid of Rwanda
# GMT modules: gmtset, gmtdefaults, grdcut, makecpt, grdimage, psscale, grdcontour, psbasemap, gmtlogo, psconvert

# GMT set up
gmt set FORMAT_GEO_MAP=dddF \
    MAP_FRAME_PEN=dimgray \
    MAP_FRAME_WIDTH=0.1c \
    MAP_TITLE_OFFSET=1c \
    MAP_ANNOT_OFFSET=0.1c \
    MAP_TICK_PEN_PRIMARY=thinner,dimgray \
    MAP_GRID_PEN_PRIMARY=thin,white \
    MAP_GRID_PEN_SECONDARY=thinnest,white \
    FONT_TITLE=12p,Palatino-Roman,black \
    FONT_ANNOT_PRIMARY=7p,Helvetica,dimgray \
    FONT_LABEL=7p,Helvetica,dimgray
# Overwrite defaults of GMT
gmtdefaults -D > .gmtdefaults

gmt grdconvert s45e00/w001001.adf geoid_TZ.grd
gdalinfo geoid_TZ.grd -stats
# Minimum=-43.794, Maximum=47.399

# Generate a color palette table from grid
gmt makecpt -Cwysiwyg -T-20/0/1 > colors.cpt

# Generate a file
ps=Geoid_RW.ps
gmt grdimage geoid_TZ.grd -Cwysiwyg -R28.5/31/-3/-1 -JM6.5i -P -Xc -I+a15+ne0.75 -K > $ps

# Add shorelines
gmt grdcontour geoid_TZ.grd -R -J -C0.25 -A1+f9p,25,black -Wthinner,dimgray -O -K >> $ps

# Add grid
gmt psbasemap -R -J \
    --MAP_FRAME_AXES=WEsN \
    --FORMAT_GEO_MAP=ddd:mm:ssF \
    -Bpxg1f0.5a0.25 -Bpyg1f0.5a0.25 -Bsxg1 -Bsyg1 \
    --MAP_TITLE_OFFSET=0.8c \
    --FONT_ANNOT_PRIMARY=7p,0,black \
    --FONT_LABEL=7p,25,black \
    --FONT_TITLE=13p,13,black \
    -B+t"Geoid gravitational model of Rwanda" -O -K >> $ps

# Add legend
gmt psscale -Dg28.5/-3.2+w16.5c/0.15i+h+o0.3/0i+ml+e -R -J -Ccolors.cpt \
    --FONT_LABEL=7p,Helvetica,black \
    --FONT_ANNOT_PRIMARY=7p,Helvetica,black \
    --FONT_TITLE=8p,Helvetica,black \
    -Bg2f0.2a2+l"Color scale wysiwyg: 20 well-separated RGB colors [C=RGB, -T0/40/1]" \
    -I0.2 -By+lm -O -K >> $ps

# Add scale, directional rose
gmt psbasemap -R -J \
    --FONT=7p,0,black \
    --FONT_ANNOT_PRIMARY=6p,0,black \
    --MAP_TITLE_OFFSET=0.1c \
    --MAP_ANNOT_OFFSET=0.1c \
    -Lx14.5c/-2.4c+c50+w50k+l"Mercator projection. Scale (km)"+f \
    -UBL/-10p/-70p -O -K >> $ps

# Add coastlines, borders, rivers
gmt pscoast -R -J -P -Ia/thinnest,blue -Na -N1/thickest,white -Wthinner -Df -O -K >> $ps

# Texts
# Lakes
gmt pstext -R -J -N -O -K \
-F+jTL+f10p,26,blue2+jLB >> $ps << EOF
29.2 -1.95 Lake
29.2 -2.05 Kivu
EOF
gmt pstext -R -J -N -O -K \
-F+jTL+f10p,26,blue2+jLB >> $ps << EOF
30.32 -2.32 Lake
30.32 -2.37 Rweru
EOF
gmt pstext -R -J -N -O -K \
-F+jTL+f10p,26,blue2+jLB >> $ps << EOF
30.75 -1.81 Lake
30.75 -1.86 Ihema
EOF
gmt pstext -R -J -N -O -K \
-F+jTL+f10p,26,blue2+jLB >> $ps << EOF
30.31 -2.05 Lake
30.31 -2.10 Mugesera
EOF
gmt pstext -R -J -N -O -K \
-F+jTL+f10p,26,blue2+jLB >> $ps << EOF
30.4 -1.85 Lake Muhazi
EOF
gmt pstext -R -J -N -O -K \
-F+jTL+f10p,26,blue2+jLB >> $ps << EOF
29.78 -1.45 Lake Burera
EOF
gmt pstext -R -J -N -O -K \
-F+jTL+f10p,26,blue2+jLB >> $ps << EOF
29.74 -1.51 Lake Ruhondo
EOF
gmt pstext -R -J -N -O -K \
-F+jTL+f10p,26,blue2+jLB >> $ps << EOF
30.0 -2.25 Lake
29.9 -2.3 Cyohoha South
EOF

# countries
gmt pstext -R -J -N -O -K \
-F+jTL+f12p,0,black+jLB -Gwhite@60 >> $ps << EOF
29.4 -1.1 U  G  A  N  D  A
EOF
gmt pstext -R -J -N -O -K \
-F+jTL+f12p,0,black+jLB -Gwhite@60 >> $ps << EOF
29.4 -2.9 B U R U N D I
EOF
gmt pstext -R -J -N -O -K \
-F+jTL+f12p,0,black+jLB -Gwhite@60 >> $ps << EOF
30.55 -2.65 T A N Z A N I A
EOF
gmt pstext -R -J -N -O -K \
-F+jTL+f12p,0,black+jLB -Gwhite@60 >> $ps << EOF
28.6 -1.6 C O N G O
28.6 -1.7 (D.R.C.)
EOF
gmt pstext -R -J -N -O -K \
-F+jTL+f14p,26,black+jLB >> $ps << EOF
29.6 -2.2 R    W    A    N    D    A
EOF
# Cities
gmt pstext -R -J -N -O -K \
-F+f13p,0,black+jLB -Gwhite@60 >> $ps << EOF
30.08 -1.90 Kigali
EOF
gmt psxy -R -J -Ss -W0.5p -Gred -O -K << EOF >> $ps
30.06 -1.94 0.40c
EOF
gmt pstext -R -J -N -O -K \
-F+f10p,0,black+jLB -Gwhite@60 >> $ps << EOF
30.00 -1.5 Byumba
EOF
gmt psxy -R -J -Sc -W0.5p -Gyellow -O -K << EOF >> $ps
30.06 -1.57 0.20c
EOF
gmt pstext -R -J -N -O -K \
-F+f10p,0,black+jLB -Gwhite@60 >> $ps << EOF
29.70 -2.30 Nyanza
EOF
gmt psxy -R -J -Sc -W0.5p -Gyellow -O -K << EOF >> $ps
29.73 -2.35 0.20c
EOF
gmt pstext -R -J -N -O -K \
-F+f10p,0,black+jLB -Gwhite@60 >> $ps << EOF
30.44 -1.97 Rwamagana
EOF
gmt psxy -R -J -Sc -W0.5p -Gyellow -O -K << EOF >> $ps
30.43 -1.95 0.20c
EOF
gmt pstext -R -J -N -O -K \
-F+f10p,0,black+jLB -Gwhite@60 >> $ps << EOF
29.70 -2.04 Muhanga
EOF
gmt psxy -R -J -Sc -W0.5p -Gyellow -O -K << EOF >> $ps
29.75 -2.08 0.20c
EOF
gmt pstext -R -J -N -O -K \
-F+f10p,0,black+jLB -Gwhite@60 >> $ps << EOF
29.36 -2.03 Kibuye
EOF
gmt psxy -R -J -Sc -W0.5p -Gyellow -O -K << EOF >> $ps
29.35 -2.06 0.20c
EOF
gmt pstext -R -J -N -O -K \
-F+f10p,0,black+jLB -Gwhite@60 >> $ps << EOF
29.70 -2.55 Butare
EOF
gmt psxy -R -J -Sc -W0.5p -Gyellow -O -K << EOF >> $ps
29.75 -2.6 0.20c
EOF
gmt pstext -R -J -N -O -K \
-F+f10p,0,black+jLB -Gwhite@60 >> $ps << EOF
28.90 -2.46 Cyangugu
EOF
gmt psxy -R -J -Sc -W0.5p -Gyellow -O -K << EOF >> $ps
28.89 -2.48 0.20c
EOF
gmt pstext -R -J -N -O -K \
-F+f10p,0,black+jLB -Gwhite@60 >> $ps << EOF
30.56 -2.10 Kibungo
EOF
gmt psxy -R -J -Sc -W0.5p -Gyellow -O -K << EOF >> $ps
30.54 -2.15 0.20c
EOF
gmt pstext -R -J -N -O -K \
-F+f10p,0,black+jLB -Gwhite@60 >> $ps << EOF
30.33 -1.31 Nyagatare
EOF
gmt psxy -R -J -Sc -W0.5p -Gyellow -O -K << EOF >> $ps
30.32 -1.29 0.20c
EOF

# Add GMT logo
gmt logo -Dx7.0/-3.0+o0.1i/0.1i+w2c -O -K >> $ps

# Add subtitle
gmt pstext -R0/10/0/15 -JX10/10 -X0.1c -Y8.0c -N -O \
    -F+f10p,13,black+jLB >> $ps << EOF
3.0 9.0 World geoid image EGM2008 vertical datum 2.5 min resolution
EOF

# Convert to image file using GhostScript
gmt psconvert Geoid_RW.ps -A0.5c -E720 -Tj -Z


<gh_stars>10-100
ls src/components | while read line; do
    ls src/components/$line | xargs -I% yarn generate $line % 'y'
done


# Inspired by: https://github.com/nicknisi/dotfiles/blob/master/tmux/tmux.conf.symlink

# unbind default prefix and set it to Ctrl+a
unbind C-b
set -g prefix C-a
bind C-a send-prefix

# for nested tmux sessions
bind-key a send-prefix

# reload config file
bind r source-file ~/.tmux.conf \; display "Config Reloaded!"

# quickly open a new window
bind N new-window

# split window and fix path for tmux 1.9
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"

# synchronize all panes in a window
bind y setw synchronize-panes on

# stop synchronizing all panes in a window
bind Y setw synchronize-panes off

# pane movement shortcuts
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

bind -r C-h select-window -t :-
bind -r C-l select-window -t :+

# resize pane shortcuts
bind -r H resize-pane -L 10
bind -r J resize-pane -D 10
bind -r K resize-pane -U 10
bind -r L resize-pane -R 10

# more settings to make copy-mode more vim-like
bind Escape copy-mode
unbind p
bind p paste-buffer
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "pbcopy"
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "pbcopy"

# make copy-mode more mouse-friendly
bind-key -t vi-copy WheelUpPane scroll-up
bind-key -t vi-copy WheelDownPane scroll-down
bind-key -t vi-copy MouseDragEnd1Pane copy-pipe "pbcopy"


#!/bin/sh
# Localy used variables
export RACK_HOME="/app"
export RACK_ENV="development"
# Prerequisites
apk -U add alpine-sdk openssl-dev ruby-dev openssl-dev
apk -U add ruby ruby-bundler ruby-io-console bash
echo 'gem: --no-document' > ~/.gemrc #http://stackoverflow.com/questions/1381725
cd ${RACK_HOME} && \
bundle install --clean --jobs=4 && \
gem clean
# # Mission completed
apk -U --purge del alpine-sdk openssl-dev ruby-dev openssl-dev
rm -vrf /var/cache/apk/*
rm -v $0


<gh_stars>1-10
#!/bin/bash

#PBS -A OPEN-12-63
#PBS -q qprod
#PBS -N BTMZ_rdd
#PBS -o BTMZ_rdd.out
#PBS -e BTMZ_rdd.err
#PBS -l select=1:ncpus=24:mpiprocs=2:ompthreads=12:accelerator=true
#PBS -l x86_adapt=true
#PBS -l walltime=01:00:00
###############################################################################

if [ "$PBS_ENVIRONMENT" == "PBS_BATCH" ]; then
  LOC=$PBS_O_WORKDIR
else
  LOC=$(pwd)
fi

cd $LOC/..

TMPFILE=btmz_rdd.tmp
rm -f $TMPFILE

module  purge
source readex_env/set_env_rdd.source

working_dir=$(pwd)
export LC_ALL=C

RDD_t=0.0001 #1 ms
#RDD_t=0.01 #10 ms
#RDD_t=0.03 #30 ms
#RDD_t=0.1 #100 ms
#RDD_t=0.5 #500 ms
RDD_p=phase
RDD_c=0
RDD_v=0
RDD_w=0

export SCOREP_PROFILING_FORMAT=cube_tuple
#export SCOREP_METRIC_PAPI=PAPI_TOT_INS,PAPI_L3_TCM
export SCOREP_EXPERIMENT_DIRECTORY="readex_dyn_detect"

app=bt-mz.C.2_rdd
rm -rf readex_dyn_detect-*
rm -f readex_config.xml

mpirun $BIND_TO_SOCKETS ./bin/$app

readex-dyn-detect -t $RDD_t -p $RDD_p -c $RDD_c -v $RDD_v -w $RDD_w "$SCOREP_EXPERIMENT_DIRECTORY/profile.cubex"

echo "RDD result = $?"

echo "run RDD done."


<filename>doc/allwpilib_ni-libraries_tarball.sh
#!/bin/bash

# A script to generate a allwpilib_ni-libraries_bla.tar.gz file from a given
# revision of allwpilib.

# Example: ./doc/allwpilib_ni-libraries_tarball.sh \
#   https://usfirst.collab.net/gerrit/allwpilib master

set -e
set -u
set -o pipefail

if [ $# -ne 2 ]; then
  echo "Usage: $0 remote ref" >&2
  exit 1
fi

REMOTE="$1"
REF="$2"

git fetch "${REMOTE}" "${REF}"

git archive \
  -o allwpilib_ni-libraries_$(git rev-parse --short FETCH_HEAD).tar.gz \
  FETCH_HEAD ni-libraries


# variables
BACKUPS_USER_PASSWORD=<PASSWORD>
AWS_CREDENTIALS_PROFILE=abc

# need to know where home is in order to find ~/.aws/credentials
export HOME=/root

HOST=localhost

# DB name
DBNAME=stats

# S3 bucket name
BUCKET_WITH_PREFIX=stats.cool/backups

# Current time
TIME=`/bin/date +%Y-%m-%d-%T`

# Backup directory
DEST=/root/stats.cool-mongodb-backups/

# Tar file of backup directory
TAR=$DEST/$TIME.tgz

# Create backup dir (-p to avoid warning if already exists)
mkdir -p $DEST

# Log
echo "Backing up $HOST/$DBNAME to s3://$BUCKET_WITH_PREFIX/ at $TIME";

# Dump from mongodb host into backup directory
mongodump -h $HOST -d $DBNAME -o $DEST --authenticationDatabase admin -u backups -p $BACKUPS_USER_PASSWORD

# Create tar of backup directory
tar czfv $TAR -C $DEST .

# Upload tar to s3
/usr/local/bin/aws --profile $AWS_CREDENTIALS_PROFILE s3 cp $TAR s3://$BUCKET_WITH_PREFIX/

# Track the backup size in stats.cool
#TAR_FILESIZE=$(stat -c%s "$TAR")
#curl -d "name=admin.backup&val=$TAR_FILESIZE" https://stats.cool/api/v1/project/hrya18eqam/dataPoint

# Remove tar file locally
rm -f $TAR

# Remove backup directory
rm -rf $DEST

# All done
echo "Backup available at https://s3.amazonaws.com/$BUCKET_WITH_PREFIX/$TIME.tgz"


#!/usr/bin/env bash
#
#/**
# * Licensed to the Apache Software Foundation (ASF) under one
# * or more contributor license agreements.  See the NOTICE file
# * distributed with this work for additional information
# * regarding copyright ownership.  The ASF licenses this file
# * to you 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.
# */

usage() {
    cat <<EOF
Usage: bookkeeper-daemon.sh (start|stop) <command> <args...>
where command is one of:
    bookie           Run the bookie server
    autorecovery     Run the AutoRecovery service daemon
    zookeeper        Run the zookeeper server

where argument is one of:
    -force (accepted only with stop command): Decides whether to stop the Bookie Server forcefully if not stopped by normal shutdown
EOF
}

BINDIR=$(dirname "$0")
BK_HOME=$(cd $BINDIR/..;pwd)

if [ -f $BK_HOME/conf/bkenv.sh ]
then
 . $BK_HOME/conf/bkenv.sh
fi

BOOKIE_LOG_DIR=${BOOKIE_LOG_DIR:-"$BK_HOME/logs"}

BOOKIE_ROOT_LOG_LEVEL=${BOOKIE_ROOT_LOG_LEVEL:-'INFO'}
BOOKIE_ROOT_LOG_APPENDER=${BOOKIE_ROOT_LOG_APPENDER:-'ROLLINGFILE'}

BOOKIE_STOP_TIMEOUT=${BOOKIE_STOP_TIMEOUT:-30}

BOOKIE_PID_DIR=${BOOKIE_PID_DIR:-$BK_HOME/bin}

if [ $# -lt 2 ]
then
  echo "Error: no enough arguments provided."
  usage
  exit 1
fi

startStop=$1
shift
command=$1
shift

case $command in
  (zookeeper)
    echo "doing $startStop $command ..."
    ;;
  (bookie)
    echo "doing $startStop $command ..."
    ;;
  (autorecovery)
    echo "doing $startStop $command ..."
    ;;
  (standalone)
    echo "doing $startStop $command ..."
    ;;
  (*)
    echo "Error: unknown service name $command"
    usage
    exit 1
    ;;
esac

export BOOKIE_LOG_DIR=$BOOKIE_LOG_DIR
export BOOKIE_ROOT_LOG_LEVEL=$BOOKIE_ROOT_LOG_LEVEL
export BOOKIE_ROOT_LOG_APPENDER=$BOOKIE_ROOT_LOG_APPENDER
export BOOKIE_LOG_FILE=bookkeeper-$command-$HOSTNAME.log

pid_file="${BOOKIE_PID_DIR}/bookkeeper-${command}.pid"
out=$BOOKIE_LOG_DIR/bookkeeper-$command-$HOSTNAME.out
logfile=$BOOKIE_LOG_DIR/$BOOKIE_LOG_FILE

rotate_out_log ()
{
  log=$1;
  num=5;
  if [ -n "$2" ]; then
    num=$2
  fi
  if [ -f "$log" ]; then # rotate logs
    while [ $num -gt 1 ]; do
      prev=$(expr $num - 1)
      [ -f "$log.$prev" ] && mv "$log.$prev" "$log.$num"
      num=$prev
    done
    mv "$log" "$log.$num";
  fi
}

mkdir -p "$BOOKIE_LOG_DIR"

case $startStop in
  (start)
    if [ -f $pid_file ]; then
      PREVIOUS_PID=$(cat $pid_file)
      if kill -0 $PREVIOUS_PID > /dev/null 2>&1; then
        echo $command running as process $PREVIOUS_PID.  Stop it first.
        exit 1
      fi
    fi

    rotate_out_log $out
    echo starting $command, logging to $logfile
    bookkeeper=$BK_HOME/bin/bookkeeper
    nohup $bookkeeper $command "$@" > "$out" 2>&1 < /dev/null &
    echo $! > $pid_file
    sleep 1; head $out
    sleep 2;
    if ! kill -0 $! > /dev/null ; then
      exit 1
    fi
    ;;

  (stop)
    if [ -f $pid_file ]; then
      TARGET_PID=$(cat $pid_file)
      if kill -0 $TARGET_PID > /dev/null 2>&1; then
        echo stopping $command
        kill $TARGET_PID

        count=0
        location=$BOOKIE_LOG_DIR
        while kill -0 $TARGET_PID > /dev/null 2>&1;
        do
          echo "Shutdown is in progress... Please wait..."
          sleep 1
          count=$(expr $count + 1)

          if [ "$count" = "$BOOKIE_STOP_TIMEOUT" ]; then
            break
          fi
         done

        if [ "$count" != "$BOOKIE_STOP_TIMEOUT" ]; then
          echo "Shutdown completed."
        fi

        if kill -0 $TARGET_PID > /dev/null 2>&1; then
          fileName=$location/$command.out
          $JAVA_HOME/bin/jstack $TARGET_PID > $fileName
          echo Thread dumps are taken for analysis at $fileName
          if [ "$1" == "-force" ]
          then
            echo forcefully stopping $command
            kill -9 $TARGET_PID >/dev/null 2>&1
            echo Successfully stopped the process
          else
            echo "WARNNING :  Bookie Server is not stopped completely."
            exit 1
          fi
        fi
      else
        echo no $command to stop
      fi
      rm $pid_file
    else
      echo no $command to stop
    fi
    ;;

  (*)
    usage
    echo $supportedargs
    exit 1
    ;;
esac


cmake ../../ -DPROJ=sensor -DTOOLCHAIN=/opt/kendryte-toolchain/bin && make -j


#!/usr/bin/env bash

set -uo pipefail;

####################################
# Ensure we can execute standalone #
####################################

function early_death() {
  echo "[FATAL] ${0}: ${1}" >&2;
  exit 1;
};

if [ -z "${GMENV_ROOT:-""}" ]; then
  # http://stackoverflow.com/questions/1055671/how-can-i-get-the-behavior-of-gnus-readlink-f-on-a-mac
  readlink_f() {
    local target_file="${1}";
    local file_name;

    while [ "${target_file}" != "" ]; do
      cd "$(dirname ${target_file})" || early_death "Failed to 'cd \$(dirname ${target_file})' while trying to determine GMENV_ROOT";
      file_name="$(basename "${target_file}")" || early_death "Failed to 'basename \"${target_file}\"' while trying to determine GMENV_ROOT";
      target_file="$(readlink "${file_name}")";
    done;

    echo "$(pwd -P)/${file_name}";
  };

  GMENV_ROOT="$(cd "$(dirname "$(readlink_f "${0}")")/.." && pwd)";
  [ -n ${GMENV_ROOT} ] || early_death "Failed to 'cd \"\$(dirname \"\$(readlink_f \"${0}\")\")/..\" && pwd' while trying to determine GMENV_ROOT";
else
  GMENV_ROOT="${GMENV_ROOT%/}";
fi;
export GMENV_ROOT;

if [ -n "${GMENV_HELPERS:-""}" ]; then
  log 'debug' 'GMENV_HELPERS is set, not sourcing helpers again';
else
  [ "${GMENV_DEBUG:-0}" -gt 0 ] && echo "[DEBUG] Sourcing helpers from ${GMENV_ROOT}/lib/helpers.sh";
  if source "${GMENV_ROOT}/lib/helpers.sh"; then
    log 'debug' 'Helpers sourced successfully';
  else
    early_death "Failed to source helpers from ${GMENV_ROOT}/lib/helpers.sh";
  fi;
fi;

#####################
# Begin Script Body #
#####################

declare -a errors=();

log 'info' '### List local versions';
cleanup || log 'error' "Cleanup failed?!";

for v in 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1; do
  log 'info' "## Installing version ${v} to construct list";
  gmenv install "${v}" \
    && log 'debug' "Install of version ${v} succeeded" \
    || error_and_proceed "Install of version ${v} failed";
done;

gmenv use 1.4.1

log 'info' '## Comparing "gmenv list" to expectations';
result="$(gmenv list)";
expected="$(cat << EOS
* 1.4.1 (set by $(gmenv version-file))
  1.4.0
  1.3.0
  1.2.1
  1.2.0
EOS
)";

if [ "${expected}" != "${result}" ]; then
  error_and_proceed "List mismatch.\nExpected:\n${expected}\nGot:\n${result}";
fi;

if [ "${#errors[@]}" -gt 0 ]; then
  log 'warn' "===== The following list tests failed =====";
  for error in "${errors[@]}"; do
    log 'warn' "\t${error}";
  done;
  log 'error' 'List test failure(s)';
else
  log 'info' 'All list tests passed.';
fi;

cleanup || log 'error' 'Cleanup failed?!';

exit 0;


<reponame>ufoderek/dotfiles
if [ -z "$2" ]; then
    echo "`basename $0` lk.bin update.zip"
else
    cp "$2" "lk_$2"
    unzip -p "lk_$2" META-INF/com/google/android/updater-script > updater-script
    echo "assert(package_extract_file("lk.bin", "/tmp/uboot.img")," >> updater-script
    echo "write_raw_image("/tmp/uboot.img", "uboot")," >> updater-script
    echo "delete("/tmp/uboot.img"));" >> updater-script
    mkdir -p _tmp/META-INF/com/google/android
    mv updater-script _tmp/META-INF/com/google/android
    cd _tmp
    zip -g "../lk_$2" META-INF/com/google/android/updater-script
    cd ..
    zip -g -j "lk_$2" "$1"
    rm -rf _tmp
fi


<filename>pictures/convert-full.sh
#!/bin/bash
# example run: ./convert.sh mape
convert $1.png eps2:$1.eps
convert $1.png $1.pnm
potrace $1.pnm -s -o $1.svg
convert $1.png $1.pdf
rm $1.pnm


<gh_stars>1-10
sudo docker run --rm -v "$PWD":/usr/src/app -w /usr/src/app ruby:2.6 bundle install
sudo docker-compose -f ./docker/docker-compose.build-image.yml build


<reponame>hamidpro/rdwan<filename>serveur/sevensquare-master/contributes/pressue-test.sh
#!/bin/sh

while [ true ]; do
  echo -n "."

  # home
  adb shell input keyevent 3
  sleep 1

  # phone key
  adb shell input keyevent 5

  # start launcher
  #adb shell input tap 240 780
  sleep 1
done


#!/bin/bash
######
## thin-lvm.sh "warning parameter" "critical parameter"
## Both parameterss are % of usage thin-lvm
## thin-lvm.sh 80 95
## 80 mean warning when thin-lvm is used over 80% and critical when thin-lvm is used over 95%
######

warn=$1
crit=$2
usage=`/sbin/lvs|grep "^  data"|awk '{print$5}'`

isOK=`echo "$usage < $warn"|bc`
isWARN=`echo "$usage >= $warn"|bc`
isCRIT=`echo "$usage >= $crit"|bc`

status=""
if [[ $isOK -eq 1 ]]; then status="OK"
fi
if [[ $isWARN -eq 1 ]]; then status="WARN"
fi
if [[ $isCRIT -eq 1 ]]; then status="CRIT"
fi

case "$status" in
        OK)     echo "OK - thin-lvm used for $usage%"
                exit 0
        ;;
        WARN)   echo "WARNING - thin-lvm used for $usage%"
                exit 1
        ;;
        CRIT)   echo "CRITICAL - thin-lvm used for $usage%"
                exit 2
        ;;
esac


#!/usr/bin/env bash

PASSWORD='<PASSWORD>'
PROJECT_FOLDER='Deep-Skies-Symfony'

# update / upgrade
sudo apt-get update
sudo apt-get -y upgrade

# install apache 2.5 and php 5.5
sudo apt-get install -y apache2
sudo apt-get install -y php5

# install mysql and give password to installer
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password password $PASSWORD"
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $PASSWORD"
sudo apt-get -y install mysql-server
sudo apt-get install php5-mysql

# setup hosts file
VHOST=$(cat <<EOF
<VirtualHost *:80>
    DocumentRoot "/var/www/html/${PROJECT_FOLDER}"
    <Directory "/var/www/html/${PROJECT_FOLDER}">
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>
EOF
)
echo "${VHOST}" > /etc/apache2/sites-available/000-default.conf

# enable mod_rewrite
sudo a2enmod rewrite

echo 'date.timezone = "UTC"' >> /etc/php5/cli/php.ini
echo 'date.timezone = "UTC"' >> /etc/php5/apache2/php.ini

# restart apache
service apache2 restart

# install git
sudo apt-get -y install git

# install node and npm
curl -sL https://deb.nodesource.com/setup_5.x | bash -
apt-get install nodejs --yes
npm install -g less

# install Composer
curl -s https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer

# get zsh tar file and uncompress its Doc folder to /usr/share/man/man1
wget -qO- "http://downloads.sourceforge.net/project/zsh/zsh/5.0.2/zsh-5.0.2.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fzsh%2Ffiles%2Fzsh%2F5.0.2%2F&ts=1407408881&use_mirror=superb-dca3" | sudo tar xvz -C /usr/share/man/man1/ --wildcards "zsh-5.0.2/Doc/*.1" --strip-components=2

# fix permissions
sudo chown root:root /usr/share/man/man1/zsh*.1
sudo chmod 0644 /usr/share/man/man1/zsh*.1

# gzip the new zsh man pages (all others are gzipped as well)
sudo gzip /usr/share/man/man1/zsh*.1

# renew the man database (so that man -k or apropos finds the newly installed man pages)
sudo mandb

# show installed zsh man pages
man -k zsh

# install zsh and change the default shell.
sudo apt-get install zsh --yes
sudo curl -L http://install.ohmyz.sh > install.sh
sudo sh install.sh

# update the mlocate database.
sudo updatedb


<reponame>alexrudy/dotfiles
pathadd $DOTFILES/git/bin


#!/bin/bash

docker pull metorikku/metorikku:k8s
docker pull metorikku/metorikku:standalone
docker pull metorikku/metorikku:spark2_k8s
docker pull metorikku/metorikku:spark2_standalone
docker pull metorikku/hive

set -e

# Latest spark
wget -q https://archive.apache.org/dist/spark/spark-$SPARK_VERSION/spark-$SPARK_VERSION-bin-hadoop$HADOOP_MAJOR_VERSION.tgz
tar -xzf spark-$SPARK_VERSION-bin-hadoop$HADOOP_MAJOR_VERSION.tgz
(cd spark-$SPARK_VERSION-bin-hadoop$HADOOP_MAJOR_VERSION && bin/docker-image-tool.sh -r metorikku -t base-$SPARK_VERSION build)
rm -rf spark-$SPARK_VERSION-bin-hadoop$HADOOP_MAJOR_VERSION*

docker build -t metorikku/spark:k8s --cache-from metorikku/metorikku:k8s --build-arg SCALA_MAJOR_VERSION=$SCALA_MAJOR_VERSION --build-arg SPARK_VERSION=$SPARK_VERSION -f docker/spark/k8s/Dockerfile docker/spark/k8s
docker build -t metorikku/spark:standalone --cache-from metorikku/metorikku:standalone --build-arg IMAGE_NAME=metorikku/spark:k8s -f docker/spark/standalone/Dockerfile docker/spark/standalone
# Adding metorikku jar
docker build -t metorikku/metorikku:k8s --cache-from metorikku/metorikku:k8s --build-arg IMAGE_NAME=metorikku/spark:k8s -f docker/metorikku/Dockerfile .
docker build -t metorikku/metorikku:standalone --cache-from metorikku/metorikku:standalone --build-arg IMAGE_NAME=metorikku/spark:standalone -f docker/metorikku/Dockerfile .

# Spark 2
wget -q https://archive.apache.org/dist/spark/spark-$SPARK2_VERSION/spark-$SPARK2_VERSION-bin-hadoop$SPARK2_HADOOP_MAJOR_VERSION.tgz
tar -xzf spark-$SPARK2_VERSION-bin-hadoop$SPARK2_HADOOP_MAJOR_VERSION.tgz
(cd spark-$SPARK2_VERSION-bin-hadoop$SPARK2_HADOOP_MAJOR_VERSION && bin/docker-image-tool.sh -r metorikku -t base-$SPARK2_VERSION build)
rm -rf spark-$SPARK2_VERSION-bin-hadoop$SPARK2_HADOOP_MAJOR_VERSION

docker build -t metorikku/spark:spark2_k8s --cache-from metorikku/metorikku:spark2_k8s --build-arg SCALA_MAJOR_VERSION=$SPARK2_SCALA_MAJOR_VERSION --build-arg SPARK_VERSION=$SPARK2_VERSION --build-arg HADOOP_VERSION=${SPARK2_HADOOP_VERSION} --build-arg METRICS_FILE=metrics_spark2.properties -f docker/spark/k8s/Dockerfile docker/spark/k8s
docker build -t metorikku/spark:spark2_hadoop --cache-from metorikku/metorikku:spark2_standalone --build-arg IMAGE_NAME=metorikku/spark:spark2_k8s --build-arg HIVE_VERSION=${SPARK2_HIVE_VERSION} --build-arg HADOOP_VERSION=${SPARK2_HADOOP_VERSION} -f docker/spark/custom-hadoop/Dockerfile docker/spark/custom-hadoop
docker build -t metorikku/spark:spark2_standalone --cache-from metorikku/metorikku:spark2_standalone --build-arg IMAGE_NAME=metorikku/spark:spark2_hadoop -f docker/spark/standalone/Dockerfile docker/spark/standalone
# Adding metorikku jar
docker build -t metorikku/metorikku:spark2_standalone --cache-from metorikku/metorikku:spark2_standalone --build-arg IMAGE_NAME=metorikku/spark:spark2_standalone --build-arg SCALA_MAJOR_VERSION=${SPARK2_SCALA_MAJOR_VERSION} -f docker/metorikku/Dockerfile .
docker build -t metorikku/metorikku:spark2_k8s --cache-from metorikku/metorikku:spark2_k8s --build-arg IMAGE_NAME=metorikku/spark:spark2_hadoop --build-arg SCALA_MAJOR_VERSION=${SPARK2_SCALA_MAJOR_VERSION} -f docker/metorikku/Dockerfile .

# Hive
docker build -t metorikku/hive --cache-from metorikku/hive --build-arg HIVE_VERSION=$HIVE_VERSION --build-arg HUDI_VERSION=$HUDI_VERSION -f docker/hive/Dockerfile docker/hive


<filename>helm/opendistro-es/certs.sh
#!/bin/bash
mkdir certs
echo "******creating root CA **************\n"
openssl genrsa -out certs/root-ca-key.pem 2048
openssl req -new -x509 -sha256 -key certs/root-ca-key.pem -out certs/root-ca.pem -subj "/C=US/ST=Arizona/L=Phoenix/O=Amex/OU=AppSec/CN=opendistro*"

#admin cert

echo "******creating admin CA **************\n"
openssl genrsa -out certs/admin-key-temp.pem 2048
openssl pkcs8 -inform PEM -outform PEM -in certs/admin-key-temp.pem -topk8 -nocrypt -v1 PBE-SHA1-3DES -out certs/admin-key.pem
openssl req -new -key certs/admin-key.pem -out certs/admin.csr -subj "/C=US/ST=Arizona/L=Phoenix/O=Amex/OU=AppSec/CN=admin"
openssl x509 -req -in certs/admin.csr -CA certs/root-ca.pem -CAkey certs/root-ca-key.pem -CAcreateserial -sha256 -out certs/admin-crt.pem -days 720

echo "******creating NODE CA **************\n"
openssl genrsa -out certs/node-key-temp.pem 2048
openssl pkcs8 -inform PEM -outform PEM -in certs/node-key-temp.pem -topk8 -nocrypt -v1 PBE-SHA1-3DES -out certs/node-key.pem
openssl req -new -key certs/node-key.pem -out certs/node.csr -subj "/C=US/ST=Arizona/L=Phoenix/O=Amex/OU=AppSec/CN=opendistro*"
openssl x509 -req -in certs/node.csr -CA certs/root-ca.pem -CAkey certs/root-ca-key.pem -CAcreateserial -sha256 -out certs/node.pem -days 720

#Cleanup
echo "cleaning"
rm certs/admin-key-temp.pem
rm certs/admin.csr
rm certs/node-key-temp.pem
rm certs/node.csr

cp certs/root-ca.pem certs/elk-transport-root-ca.pem
cp certs/node.pem  certs/elk-transport-crt.pem
cp certs/node-key.pem certs/elk-transport-key.pem

kubectl create secret generic -n default trans1-secret --from-file=certs/elk-transport-root-ca.pem --from-file=certs/elk-transport-crt.pem --from-file=certs/elk-transport-key.pem

cp certs/root-ca.pem certs/elk-rest-root-ca.pem
cp certs/node.pem  certs/elk-rest-crt.pem
cp certs/node-key.pem certs/elk-rest-key.pem

kubectl create secret generic -n default rest1-secret --from-file=certs/elk-rest-root-ca.pem --from-file=certs/elk-rest-crt.pem --from-file=certs/elk-rest-key.pem

cp certs/root-ca.pem certs/admin-root-ca.pem

kubectl create secret generic -n default admin1-secret --from-file=certs/admin-crt.pem --from-file=certs/admin-key.pem --from-file=certs/admin-root-ca.pem

cp certs/root-ca.pem certs/kibana-root-ca.pem
cp certs/node.pem  certs/kibana-crt.pem
cp certs/node-key.pem certs/kibana-key.pem

kubectl create secret generic -n default kibana1-secret --from-file=certs/kibana-crt.pem --from-file=certs/kibana-key.pem --from-file=certs/kibana-root-ca.pem

kubectl create secret generic -n default kibanarest1-secret --from-file=certs/elk-rest-root-ca.pem --from-file=certs/elk-rest-crt.pem --from-file=certs/elk-rest-key.pem


#!/bin/sh
ICON="🔋"
read -r capacity </sys/class/power_supply/BAT1/capacity
printf "$ICON%s%%" "$capacity"


<filename>dist/snippets/maps_http_streetview_metadata/maps_http_streetview_metadata.sh
# [START maps_http_streetview_metadata]
curl -L -X GET 'https://maps.googleapis.com/maps/api/streetview/metadata?heading=151.78&pitch=-0.76&location=46.414382%2C10.013988&size=600x300&key=YOUR_API_KEY'
# [END maps_http_streetview_metadata]


if [ `kubectl get pvc | grep www-web | grep Bound | wc -l` -eq 2 ]
then
	echo "done"
fi


<reponame>reikdas/pash
#!/bin/bash
file1=1.out
file2=2.out
file3=3.out
file4=4.out
file5=5.out
file6=6.out
file7=7.out
file8=8.out

rm -f *.out

batchSize=10000000
testFile="$PASH_TOP/evaluation/scripts/input/1G.txt"
if [ "$#" -gt "0" ]
 then
    testFile=$1
fi
if [ "$#" -gt "1" ]; then
    batchSize=$2
fi

mkfifo $file1
mkfifo $file2
mkfifo $file3
mkfifo $file4
mkfifo $file5
mkfifo $file6
mkfifo $file7
mkfifo $file8

$PASH_TOP/runtime/r_split -r $testFile $batchSize $file1 $file2 &

$PASH_TOP/runtime/eager.sh $file1 $file5 "/tmp/pash_eager_intermediate_#file1" &
$PASH_TOP/runtime/eager.sh $file2 $file6 "/tmp/pash_eager_intermediate_#file2" &

sort < $file5 > $file7 &
sort < $file6 > $file8 &

sort -m $file7 $file8

# cat $testFile | sort > $file8
# if cmp -s "$file7" "$file8"; then
#     printf 'The file "%s" is the same as "%s"\n' "$file7" "$file8"
# else
#     printf 'The file "%s" is different from "%s"\n' "$file7" "$file8"
# fi

rm -rf *out


<gh_stars>0
MAINNET_TOKENLIST=`cat dist/mainnet.tokenlist.json`
GOERLI_TOKENLIST=`cat dist/goerli.tokenlist.json`

echo "
/**
 * 🚨🚨🚨 THIS FILE IS AUTO-GENERATED. DO NOT EDIT MANUALLY. 🚨🚨🚨
 * 🚨🚨🚨 THIS FILE IS AUTO-GENERATED. DO NOT EDIT MANUALLY. 🚨🚨🚨
 * 🚨🚨🚨 THIS FILE IS AUTO-GENERATED. DO NOT EDIT MANUALLY. 🚨🚨🚨
 *
 * This is the index.ts file that will be compiled to JS and set as the 'main'
 * property in package.json. This makes it possible to use elf-tokenlist as a
 * normal package, ie: import { mainnetTokenList } from 'elf-tokenlist'
 *
 * See scripts/build-index.sh for details.
 *
 * 🚨🚨🚨 THIS FILE IS AUTO-GENERATED. DO NOT EDIT MANUALLY. 🚨🚨🚨
 * 🚨🚨🚨 THIS FILE IS AUTO-GENERATED. DO NOT EDIT MANUALLY. 🚨🚨🚨
 * 🚨🚨🚨 THIS FILE IS AUTO-GENERATED. DO NOT EDIT MANUALLY. 🚨🚨🚨
 */

import { TokenList } from '@uniswap/token-lists/src';

export * from './tags';

export const mainnetTokenList: TokenList = $MAINNET_TOKENLIST;
export const goerliTokenList: TokenList = $GOERLI_TOKENLIST;
" > src/index.ts

tsc --project tsconfig.json


#!/bin/bash
#SBATCH -n 1
#SBATCH -N 1
#SBATCH -o demultiplexAndBarcodeCount-%A_%a.out
#SBATCH -e demultiplexAndBarcodeCount-%A_%a.err
#SBATCH --mem-per-cpu=8G
#SBATCH --mail-type=END,FAIL

ml anaconda3/4.1.1
unset PYTHONPATH
source activate bclab

# Given FASTQ files, demultiplexes samples by P1 adapters and then count barcodes in each file
if [ "$#" -ne 4 ]
then
    echo "Usage: demultiplexAndBarcodeCount.sh fastqToSample.txt spacerSeq bcSize path/to/this/script/"
    echo "\t- fastqToSample.txt is formatted as [fastq file name] [batch name (e.g. library1)] [p1ToSample.txt] [barcodeToSequence.txt]
    \tWhere p1ToSample.txt is formatted as [p1 sequence] [sample name (e.g. Rna1)]
    \t and barcodeToSequence.txt is a file that contains barcodes in the first field and CRS identifiers in the second field."
    echo "\t- spacerSeq is the sequence that is between the p1 adapter and cBC."
    echo "\t- bcSize is the expected size of the cBC"
    exit 1
fi

fastqToSample=$1
spacerSeq=$2
bcSize=$3
scriptPath=$4

# If SLURM_ARRAY_TASK_ID is not set, that means either (1) this script is being run locally or (2) there is no job array. In this case, it is assumed that there is only one FASTQ file to demultiplex
if [ -z "${SLURM_ARRAY_TASK_ID}" ]
then
    SLURM_ARRAY_TASK_ID=1
fi

line=$(sed "${SLURM_ARRAY_TASK_ID}q;d" "${fastqToSample}")
fastq=$(echo "${line}" | cut -f1)
name=$(echo "${line}" | cut -f2)
p1ToSample=$(echo "${line}" | cut -f3)
bcToCrsFile=$(echo "${line}" | cut -f4)

sh "${scriptPath}"/demultiplexFastq.sh "${fastq}" "${p1ToSample}" "${spacerSeq}" "${bcSize}" "${name}" "${scriptPath}"

# For each sample in the original FASTQ file, count barcodes.
while read p1Line
do
    p1=$(echo "${p1Line}" | cut -f1)
    sample=$(echo "${p1Line}" | cut -f2)
    prefix="${name}${sample}"
    p1AndSpacer="${p1}${spacerSeq}"

    sh "${scriptPath}"/fastqCountBarcodes.sh "${prefix}" "${p1AndSpacer}" "${bcSize}" "${bcToCrsFile}" "${scriptPath}"

done < "${p1ToSample}"


<gh_stars>1-10
./set-config.sh
for TEST in ./tests/*
	do
		if [ -f $TEST -a -x $TEST ]
		then
			$TEST || exit 1
		fi
done


#!/bin/bash

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source $DIR/incl_init-vars.sh
source $DIR/incl_az-login.sh
source $DIR/incl_get-credentials.sh

existingVnet=`(az network vnet show -g $resourceGroupName --name $vnetName --query "name" --output tsv 2> /dev/null) || echo "not found"`
echo $existingVnet
if [[ "$existingVnet" == "not found" ]]
then
    echo "VNet $vnetName in resource group $resourceGroupName must exist before running this script"
    echo "please run a script like setupDevVm.sh to create them"
    exit 1
fi

subnetExists=`az network vnet subnet list -g $resourceGroupName --vnet-name $vnetName --output table | grep hdinsight | wc -l`
if [[ "$subnetExists" == "0" ]]
then
    echo "creating hdinsight subnet"
    az network vnet subnet create -g $resourceGroupName \
        --vnet-name $vnetName --name "hdinsight" \
        --address-prefixes 192.168.1.0/24
fi

# create storage account if it does not exist yet
if [[ "$storageKey" == "" ]]
then
    az storage account create -g $resourceGroupName \
        --name $storageName \
        --location $location \
        --kind StorageV2 \
        --hierarchical-namespace false \
        --https-only true \
        --sku Standard_LRS
    storageKey="`az storage account keys list -g $resourceGroupName --account-name $storageName --output tsv --query '[0].value' 2> /dev/null`"
fi

subnetId=`az network vnet subnet list -g $resourceGroupName --vnet-name $vnetName --output jsonc --query "[?name=='hdinsight'].id" --output tsv`
pubkey="`cat $sshPublicKeyPath`"

az hdinsight create -t hadoop -g $resourceGroupName --name $hdiName \
    --storage-container $hdiName \
    --version "4.0" \
    --http-user "$username" \
    --http-password "$password" \
    --ssh-user "$username" \
    --ssh-public-key "$pubkey" \
    --storage-account "$storageName" \
    --storage-account-key "$storageKey" \
    --subnet $subnetId \
    --workernode-count 3 \
    --workernode-size Standard_D12_v2 \
    --headnode-size Standard_D12_v2 \
    --zookeepernode-size Standard_D12_v2

copySshKeysToVm $hdiSshEndpoint


#!/bin/bash -e

if [ "$1" == "" ]; then
  docker-compose run laravel /root/become.sh
else
  docker-compose run laravel $@
fi


<reponame>sayar/tedxhec
#! /bin/sh

mkdir -p logs/
touch logs/input.log logs/server.log

sudo ./twinput.py > logs/input.log &
sudo ./serve.py -P 80 > logs/server.log &