#!/bin/bash

echo ""
echo "Applying migration CountryOfIncorporation"

echo "Adding routes to conf/app.routes"

echo "" >> ../conf/app.routes
echo "### CountryOfIncorporation Controller" >> ../conf/app.routes
echo "### ----------------------------------------" >> ../conf/app.routes

export kebabClassName=$(sed -e 's/\([^A-Z]\)\([A-Z0-9]\)/\1-\2/g' -e 's/\([A-Z0-9]\)\([A-Z0-9]\)\([^A-Z]\)/\1-\2\3/g' <<< "CountryOfIncorporation" | tr '[:upper:]' '[:lower:]')
echo "GET        /$kebabClassName                          controllers.ultimateParentCompany.CountryOfIncorporationController.onPageLoad(mode: Mode = NormalMode)" >> ../conf/app.routes
echo "POST       /$kebabClassName                          controllers.ultimateParentCompany.CountryOfIncorporationController.onSubmit(mode: Mode = NormalMode)" >> ../conf/app.routes
echo "GET        /$kebabClassName/change                   controllers.ultimateParentCompany.CountryOfIncorporationController.onPageLoad(mode: Mode = CheckMode)" >> ../conf/app.routes
echo "POST       /$kebabClassName/change                   controllers.ultimateParentCompany.CountryOfIncorporationController.onSubmit(mode: Mode = CheckMode)" >> ../conf/app.routes

echo "Adding messages to English conf.messages"
echo "" >> ../conf/messages.en
echo "# CountryOfIncorporationPage Messages" >> ../conf/messages.en
echo "# ----------------------------------------------------------" >> ../conf/messages.en
echo "countryOfIncorporation.title = countryOfIncorporation" >> ../conf/messages.en
echo "countryOfIncorporation.heading = countryOfIncorporation" >> ../conf/messages.en
echo "countryOfIncorporation.checkYourAnswersLabel = countryOfIncorporation" >> ../conf/messages.en
echo "countryOfIncorporation.label= CountryOfIncorporation" >> ../conf/messages.en
echo "countryOfIncorporation.error.required = Enter countryOfIncorporation" >> ../conf/messages.en
echo "countryOfIncorporation.error.length = CountryOfIncorporation must be 2 characters or less" >> ../conf/messages.en

echo "Adding messages to Welsh conf.messages"
echo "" >> ../conf/messages.cy
echo "# CountryOfIncorporationPage Messages" >> ../conf/messages.cy
echo "# ----------------------------------------------------------" >> ../conf/messages.cy
echo "countryOfIncorporation.title = countryOfIncorporation" >> ../conf/messages.cy
echo "countryOfIncorporation.heading = countryOfIncorporation" >> ../conf/messages.cy
echo "countryOfIncorporation.checkYourAnswersLabel = countryOfIncorporation" >> ../conf/messages.cy
echo "countryOfIncorporation.label = CountryOfIncorporation" >> ../conf/messages.cy
echo "countryOfIncorporation.error.required = Enter countryOfIncorporation" >> ../conf/messages.cy
echo "countryOfIncorporation.error.length = CountryOfIncorporation must be 2 characters or less" >> ../conf/messages.cy

echo "Adding to UserAnswersEntryGenerators"
awk '/trait UserAnswersEntryGenerators/ {\
    print;\
    print "";\
    print "  implicit lazy val arbitraryCountryOfIncorporationUserAnswersEntry: Arbitrary[(CountryOfIncorporationPage.type, JsValue)] =";\
    print "    Arbitrary {";\
    print "      for {";\
    print "        page  <- arbitrary[CountryOfIncorporationPage.type]";\
    print "        value <- arbitrary[String].suchThat(_.nonEmpty).map(Json.toJson(_))";\
    print "      } yield (page, value)";\
    print "    }";\
    next }1' ../test/generators/UserAnswersEntryGenerators.scala > tmp && mv tmp ../test/generators/UserAnswersEntryGenerators.scala

echo "Adding to PageGenerators"
awk '/trait PageGenerators/ {\
    print;\
    print "";\
    print "  implicit lazy val arbitraryCountryOfIncorporationPage: Arbitrary[CountryOfIncorporationPage.type] =";\
    print "    Arbitrary(CountryOfIncorporationPage)";\
    next }1' ../test/generators/PageGenerators.scala > tmp && mv tmp ../test/generators/PageGenerators.scala

echo "Adding to UserAnswersGenerator"
awk '/val generators/ {\
    print;\
    print "    arbitrary[(CountryOfIncorporationPage.type, JsValue)] ::";\
    next }1' ../test/generators/UserAnswersGenerator.scala > tmp && mv tmp ../test/generators/UserAnswersGenerator.scala

echo "Adding helper method to CheckYourAnswersHelper"
awk '/class/ {\
     print;\
     print "";\
     print "  def countryOfIncorporation: Option[SummaryListRow] = answer(CountryOfIncorporationPage, routes.CountryOfIncorporationController.onPageLoad(CheckMode))";\
     next }1' ../app/utils/CheckYourAnswersHelper.scala > tmp && mv tmp ../app/utils/CheckYourAnswersHelper.scala

echo "Adding to Pages map"
awk '/val pages/ {\
    print;\
    print "    CountryOfIncorporationPage.toString -> CountryOfIncorporationPage,";\
    next }1' ../app/pages/Page.scala > tmp && mv tmp ../app/pages/Page.scala

echo "Migration CountryOfIncorporation completed"


<gh_stars>0
#!/usr/bin/env bats
# shellcheck disable=SC2086

function setup() {
    cd "$BATS_TEST_DIRNAME/.." || exit 1 # project root
    if [ -z "${COMMAND+x}" ]; then exit 1; fi
    tmpdir="$(mktemp -d)"
    export tmpdir
}

function teardown() {
    rm -rf "$tmpdir"
}

@test 'Non existent file' {
    # when
    run $COMMAND "$tmpdir/style.css"

    # then
    [ "$status" -ne 0 ]
}

@test 'Error - when missing file argument' {
    # when
    run $COMMAND

    # then
    [ "$status" -ne 0 ]
}

@test 'Error - when the file does not exist' {
    # when
    run $COMMAND "$tmpdir/style.css"

    # then
    [ "$status" -ne 0 ]
}

@test 'Error - when a file does not exist' {
    # given
    cp 'data/style.css' "$tmpdir/style1.css"

    # when
    run $COMMAND "$tmpdir/style1.css" "$tmpdir/style2.css"

    # then
    [ "$status" -ne 0 ]
}

@test 'Optimize single file' {
    # given
    cp 'data/style.css' "$tmpdir/style.css"

    # when
    run $COMMAND "$tmpdir/style.css"

    # then
    [ "$status" -eq 0 ]
    [ "$(wc -c <"$tmpdir/style.css")" -gt 0 ]
    [ "$(wc -c <"$tmpdir/style.css")" -lt "$(wc -c <'data/style.css')" ]
}

@test 'Optimize multiple files' {
    # given
    cp 'data/style.css' "$tmpdir/style1.css"
    cp 'data/style.css' "$tmpdir/style2.css"
    cp 'data/style.css' "$tmpdir/style3.css"

    # when
    run $COMMAND "$tmpdir/style1.css" "$tmpdir/style2.css"

    # then
    [ "$status" -eq 0 ]
    [ "$(wc -c <"$tmpdir/style1.css")" -gt 0 ]
    [ "$(wc -c <"$tmpdir/style1.css")" -lt "$(wc -c <'data/style.css')" ]
    [ "$(wc -c <"$tmpdir/style2.css")" -gt 0 ]
    [ "$(wc -c <"$tmpdir/style2.css")" -lt "$(wc -c <'data/style.css')" ]
    [ "$(wc -c <"$tmpdir/style3.css")" -eq "$(wc -c <'data/style.css')" ]
}

@test 'Optimize directory' {
    # given
    cp 'data/style.css' "$tmpdir/style1.css"
    cp 'data/style.css' "$tmpdir/style2.css"

    # when
    run $COMMAND "$tmpdir"

    # then
    [ "$status" -eq 0 ]
    [ "$(wc -c <"$tmpdir/style1.css")" -gt 0 ]
    [ "$(wc -c <"$tmpdir/style1.css")" -lt "$(wc -c <'data/style.css')" ]
    [ "$(wc -c <"$tmpdir/style2.css")" -gt 0 ]
    [ "$(wc -c <"$tmpdir/style2.css")" -lt "$(wc -c <'data/style.css')" ]
}

@test 'Optimize directory (recursively)' {
    # given
    cp 'data/style.css' "$tmpdir/style1.css"
    mkdir -p "$tmpdir/nested"
    cp 'data/style.css' "$tmpdir/nested/style2.css"

    # when
    run $COMMAND "$tmpdir"

    # then
    [ "$status" -eq 0 ]
    [ "$(wc -c <"$tmpdir/style1.css")" -gt 0 ]
    [ "$(wc -c <"$tmpdir/style1.css")" -lt "$(wc -c <'data/style.css')" ]
    [ "$(wc -c <"$tmpdir/nested/style2.css")" -gt 0 ]
    [ "$(wc -c <"$tmpdir/nested/style2.css")" -lt "$(wc -c <'data/style.css')" ]
}


#!/bin/sh
######################################################################################
# If not stated otherwise in this file or this component's Licenses.txt file the
# following copyright and licenses apply:

#  Copyright 2018 RDK Management

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

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

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

if [ -f /etc/device.properties ]
then
    source /etc/device.properties
fi

uptime=`cat /proc/uptime | awk '{ print $1 }' | cut -d"." -f1`
while [ "$uptime" -lt 600 ] ; do
    sleep 60
    uptime=`cat /proc/uptime | awk '{ print $1 }' | cut -d"." -f1`
done

forever=1;
while [ "$forever" -eq "1" ]; do
	LogInterval=`psmcli get dmsb.device.deviceinfo.X_RDKCENTRAL-COM_WHIX.LogInterval`
	if [ "$LogInterval" == "" ] ; then
		LogInterval=3600
		psmcli set dmsb.device.deviceinfo.X_RDKCENTRAL-COM_WHIX.LogInterval 3600
	fi

	timeleft=$LogInterval
	while [ "$timeleft" -gt 0 ] ; do
		sleep 300
		LogInterval_old=$LogInterval;
		LogInterval=`psmcli get dmsb.device.deviceinfo.X_RDKCENTRAL-COM_WHIX.LogInterval`
	        if [ "$LogInterval" == "" ] ; then
        	        LogInterval=3600
        	fi
		timeleft=$(($timeleft-300+$LogInterval-$LogInterval_old))
	done;

	echo "before running stahealth.sh printing top output" >> $WIFI_CONSOLE_LOG_NAME
	top -n1 >> $WIFI_CONSOLE_LOG_NAME

	ru=0;
	if [ "$(pidof CcspWifiSsp)" != "" ] && [ "$(pidof aphealth.sh)" == "" ] && [ "$(pidof stahealth.sh)"  == "" ] && [ "$(pidof radiohealth.sh)" == "" ] && [ "$(pidof aphealth_log.sh)" == "" ] && [ "$(pidof radiohealth_log.sh)" == "" ] && [ "$(pidof bandsteering.sh)" == "" ] && [ "$(pidof bandsteering_log.sh)" == "" ] && [ "$(pidof log_mem_cpu_info_atom.sh)" == "" ] && [ "$(pidof dailystats.sh)" == "" ] && [ "$(pidof dailystats_log.sh)" == "" ] ; then
		if [ "$BOX_TYPE" == "XB3" ]; then
			if [ "$(pidof hostapd)" != "" ]  && [ "$(pidof apup)" == "" ] && [ "$(pidof fastdown)" == "" ] && [ "$(pidof apdown)" == "" ]; then
				ru=1;
			fi
		else
			ru=1;
		fi
	fi

	if [ "$ru" == "1" ]; then
		/usr/ccsp/wifi/stahealth.sh >> /rdklogs/logs/wifihealth.txt
		echo "after running stahealth.sh printing top output" >> $WIFI_CONSOLE_LOG_NAME
		top -n1 >> $WIFI_CONSOLE_LOG_NAME
	else
		echo "skipping staheath.sh run" >> $WIFI_CONSOLE_LOG_NAME
	fi
done


<gh_stars>0
#!/bin/bash
# Download latest node and install.
#bwklink=`https://github.com/telostia/mymn-guides/raw/master/wallet/linux64/mymn-linux.tar.gz`
#mkdir -p /tmp/mymn
cd
# /tmp/mymn
#wget $bwklink
wget https://github.com/telostia/mymn-guides/raw/master/wallet/linux64/mymn-linux.tar.gz
tar -xzf mymn-linux.tar.gz
sudo mv mymn* /usr/local/bin
cd
rm mymn*
mkdir ~/.mymn

# Setup configuration for node.
rpcuser=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13 ; echo '')
rpcpassword=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 32 ; echo '')
cat >~/.mymn/mymn.conf <<EOL
rpcuser=$rpcuser
rpcpassword=$rpcpassword
daemon=1
txindex=1
EOL

# Start node.
mymnd


<gh_stars>1000+
#!/bin/bash
source ../test_base

export DEV_GRAPHICS="-vga std"
make SERVICE=Test FILES=vga.cpp
start Test.img "VGA: Verify that the service starts test"
make SERVICE=Test FILES=vga.cpp clean


<filename>shell/del-current.sh
#!/bin/bash

set -x
dockerimages=(
    kube-apiserver-amd64:v1.11.6
    kube-controller-manager-amd64:v1.11.6
    kube-scheduler-amd64:v1.11.6
    kube-proxy-amd64:v1.11.6
    etcd-amd64:3.2.18
    pause-amd64:3.1
    coredns:1.1.3
    metrics-server-amd64:v0.3.1
    # k8s-dns-sidecar-amd64:1.14.10
    # k8s-dns-kube-dns-amd64:1.14.10
    # k8s-dns-dnsmasq-nanny-amd64:1.14.10
    cluster-autoscaler:v1.3.3
    defaultbackend:1.5
    coredns:1.2.2
    metrics-server-amd64:v0.3.1
    elasticsearch:v6.3.0
    fluentd-elasticsearch:v2.3.1
    kibana-oss:6.3.2
)

j=1
for i in ${dockerimages[@]}
do
    echo $i
    echo $j

    docker rmi arborhuang/$i
    docker rmi k8s.gcr.io/$i
    docker rmi gcr.io/google_containers/$i

    let j+=1
done

docker rmi coredns/coredns:1.2.2

# conduitimages=(
#     controller:v0.5.0
#     proxy:v0.5.0
#     proxy-init:v0.5.0
#     web:v0.5.0
#     grafana:v0.5.0
# )

# j=1
# for i in ${conduitimages[@]}
# do
#     echo $i
#     echo $j

#     docker rmi arborhuang/runconduit-$i
#     docker rmi gcr.io/runconduit/$i

#     let j+=1
# done

# spinnakerimages=(
#     clouddriver:2.0.0-20180221152902
#     echo:0.8.0-20180221133510
#     deck:2.1.0-20180221143146
#     igor:0.9.0-20180221133510
#     orca:0.10.0-20180221133510
#     gate:0.10.0-20180221133510
#     front50:0.9.0-20180221133510
#     rosco:0.5.0-20180221133510
# )

# j=1
# for i in ${spinnakerimages[@]}
# do
#     echo $i
#     echo $j

#     docker rmi arborhuang/spinnaker-$i
#     docker rmi gcr.io/spinnaker-marketplace/$i

#     let j+=1
# done

# jximages2=(
#     chartmuseum/chartmuseum:v0.2.8
#     jenkinsxio/jenkinsx:0.0.25
#     jenkinsci/jnlp-slave:3.14-1
#     jenkinsxio/builder-maven:0.0.280
#     jenkinsxio/builder-gradle:0.0.163
#     jenkinsxio/builder-scala:0.0.96
#     jenkinsxio/builder-go:0.0.275
#     jenkinsxio/builder-terraform:0.0.52
#     jenkinsxio/builder-rust:0.0.130
#     jenkinsxio/builder-nodejs:0.0.228
#     jenkinsxio/builder-base:0.0.312
#     jenkinsxio/builder-python2:0.0.45
#     jenkinsxio/builder-python:0.0.46
#     jenkinsxio/builder-ruby:0.0.312
#     jenkinsxio/builder-swift:0.0.312
# )

# j=1
# for i in ${jximages2[@]}
# do
#     echo $i
#     echo $j

#     docker rmi $i

#     let j+=1
# done

set +x


<filename>startup.sh
#!/bin/sh
set -e
set -x

if [ -f /opt/Geolite2-City.mmdb ]; then
    export GEOLITE2_DB=/opt/Geolite2-City.mmdb
fi

echo "Starting Sample JSON rules..."
ruller-sample-feature-flag \
    --log-level=$LOG_LEVEL \
    --city-state-db=/opt/city-state.csv \
    --geolite2-db="$GEOLITE2_DB"


<filename>docker_scripts/init.bash
#!/bin/bash
#export AN_PROJECT_DIR=/root/catkin_ws/src/darknet_ros

#echo "Copying bash aliases..." #{{{
#cp $AN_PROJECT_DIR/docker_scripts/sources/.bash_aliases /root
#}}}

#echo "Installing apt dependencies..." #{{{
#Packages for developing and testing
#apt-get -y install $(cat $AN_PROJECT_DIR/docker_scripts/sources/pkg_dev)
#Packages for deploy
# apt-get -y install $(cat $AN_PROJECT_DIR/docker_scripts/sources/pkg_deps)
#}}}

echo "Setting up ros environment..." #{{{
cd /root/
mkdir -p catkin_ws/src

# Build autonomous_navigation_project
source /opt/ros/melodic/setup.bash
cd /root/catkin_ws && catkin build
#}}}


#!/bin/bash -x

cmd="$(dirname "$0")/cli.js"

$cmd compute 1234
$cmd generate 1234
$cmd validate 12344
$cmd validate 12345

CDIGIT_CLI_DEFAULT_ALGO=damm $cmd compute 1234
CDIGIT_CLI_DEFAULT_ALGO=damm $cmd generate 1234
CDIGIT_CLI_DEFAULT_ALGO=damm $cmd validate 12340
CDIGIT_CLI_DEFAULT_ALGO=damm $cmd validate 12345

$cmd --algo luhn compute 1234
$cmd --algo luhn generate 1234
$cmd --algo luhn validate 12344
$cmd --algo luhn validate 12345
$cmd --algo verhoeff compute 1234
$cmd --algo verhoeff generate 1234
$cmd --algo verhoeff validate 12340
$cmd --algo verhoeff validate 12345
$cmd --algo damm compute 1234
$cmd --algo damm generate 1234
$cmd --algo damm validate 12340
$cmd --algo damm validate 12345
$cmd --algo mod11_2 compute 1234
$cmd --algo mod11_2 generate 1234
$cmd --algo mod11_2 validate 12344
$cmd --algo mod11_2 validate 12345
$cmd --algo mod37_2 compute 12CD
$cmd --algo mod37_2 generate 12CD
$cmd --algo mod37_2 validate 12CD6
$cmd --algo mod37_2 validate 12CD5
$cmd --algo mod97_10 compute 1234
$cmd --algo mod97_10 generate 1234
$cmd --algo mod97_10 validate 123482
$cmd --algo mod97_10 validate 123456
$cmd --algo mod661_26 compute ABCD
$cmd --algo mod661_26 generate ABCD
$cmd --algo mod661_26 validate ABCDKN
$cmd --algo mod661_26 validate ABCDEF
$cmd --algo mod1271_36 compute 12CD
$cmd --algo mod1271_36 generate 12CD
$cmd --algo mod1271_36 validate 12CDJU
$cmd --algo mod1271_36 validate 12CD56
$cmd --algo mod11_10 compute 1234
$cmd --algo mod11_10 generate 1234
$cmd --algo mod11_10 validate 12340
$cmd --algo mod11_10 validate 12345
$cmd --algo mod27_26 compute ABCD
$cmd --algo mod27_26 generate ABCD
$cmd --algo mod27_26 validate ABCDR
$cmd --algo mod27_26 validate ABCDE
$cmd --algo mod37_36 compute 12CD
$cmd --algo mod37_36 generate 12CD
$cmd --algo mod37_36 validate 12CD5
$cmd --algo mod37_36 validate 12CDE
$cmd --algo gtin compute 01234567890
$cmd --algo gtin generate 01234567890
$cmd --algo gtin validate 012345678905
$cmd --algo gtin validate 012345678901


#!/usr/bin/env bash

usage() {
    echo "Usage: $0 <OfficialBuildId> [extra build params]"
}

if [ -z "${1:-}" ]; then
    usage
    exit 1
fi

OfficialBuildId=$1
shift

buildParams="/p:OfficialBuildId=$OfficialBuildId"

source="${BASH_SOURCE[0]}"

# resolve $SOURCE until the file is no longer a symlink
while [[ -h $source ]]; do
  scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
  source="$(readlink "$source")"

  # if $source was a relative symlink, we need to resolve it relative to the path where the
  # symlink file was located
  [[ $source != /* ]] && source="$scriptroot/$source"
done

scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"

"$scriptroot/eng/common/build.sh" --build --restore --pack -bl "$buildParams" /p:EnableSourceLink=false /p:DeterministicSourcePaths=false $@


<filename>dev/android-studio.sh<gh_stars>0
 echo "Installing Android Studio..."
brew cask install android-studio
echo "";


#!/usr/bin/env bash
nvidia-docker run -v $PWD:/tmp/working -w=/tmp/working -p 8889:8888 --rm -it \
    kaggle-python-gpu \
    jupyter notebook --no-browser --ip="0.0.0.0" \
    --notebook-dir=/tmp/working --allow-root


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

function require() {
    if [ -z "$2" ]; then
      echo "validation failed: $1 unset"
      exit 1
    fi
}

require WORKDIR "${WORKDIR}"
require DOCKERFILE "${DOCKERFILE}"

set -veuo pipefail

docker build -f ${DOCKERFILE} \
 --build-arg version=${CIRCLE_SHA1:0:7} \
 --build-arg KURL_UTIL_IMAGE \
 -t ${CIRCLE_PROJECT_REPONAME}:${CIRCLE_SHA1:0:7} \
 ${WORKDIR:-$HOME/repo}


#!/bin/bash

# Run the following block, only if skipping step evaluate_overlap.sh on purpose (all steps executed there). Remove lines 4 and 41.
: <<'END'
# create overlap directories
mkdir /mnt/data/gold_standard/overlap
mkdir /mnt/data/gold_standard/overlap/litbank
mkdir /mnt/data/gold_standard/overlap/dekker_et_al
mkdir /mnt/data/gold_standard/overlap/original_texts
mkdir /mnt/data/gold_standard/overlap/new_annotation

# copy manually created overlapping files to the data folder
cp /mnt/Git/data_overlap_manual_collection/dekker_et_al/* /mnt/data/gold_standard/overlap/dekker_et_al/
cp /mnt/Git/data_overlap_manual_collection/litbank/* /mnt/data/gold_standard/overlap/litbank/
cp /mnt/Git/data_overlap_manual_collection/original_texts/* /mnt/data/gold_standard/overlap/original_texts/
cp /mnt/Git/annotation/* /mnt/data/gold_standard/overlap/new_annotation/

####################################
#########     BookNLP      #########
####################################
echo -e "\e[30;48;5;45m INFO: Beginning with BookNLP \e[0m"
cd /mnt/book-nlp
mkdir data/output/overlap
mkdir data/tokens/overlap

echo -e "\e[30;48;5;45m INFO: Running BookNLP over overlapping text sections \e[0m"
total_count=$(ls /mnt/data/gold_standard/overlap/original_texts/ -1 | wc -l)
current_count=1
#iterate over original book texts and run BookNLP
for filename in /mnt/data/gold_standard/overlap/original_texts/*.txt; do
    bookname=$(basename -- "$filename")
    echo -e "\e[30;48;5;45m INFO: $current_count/ $total_count: ${bookname%.*} \e[0m"
    ./runjava novels/BookNLP -doc /mnt/data/gold_standard/overlap/original_texts/$bookname -p data/output/overlap/${bookname%.*} -tok data/tokens/overlap/${bookname%.*}.tokens -f
    ((current_count++))
done

echo -e "\e[30;48;5;45m INFO: Running Flair over overlapping text sections \e[0m"
python3 /mnt/Git/scripts/alt_evaluation/flair_tag_raw_texts.py ${bookname%.*}
END
# create a folder for results
mkdir /mnt/Git/results/overlap_conll

#todo remove those and just catch putput and pipe to correct folder
# create empty csv with header for the evaluation results
echo "book_title, precision_booknlp, recall_booknlp, f1_booknlp" >> /mnt/Git/results/overlap_conll/booknlp_dekkeretal_evaluation.csv
#echo "book_title, index_list, word_list" >> /mnt/Git/results/overlap_conll/booknlp_dekkeretal_false_positive.csv
#echo "book_title, index_list, word_list" >> /mnt/Git/results/overlap_conll/booknlp_dekkeretal_false_negative.csv

echo "book_title, precision_booknlp, recall_booknlp, f1_booknlp" >> /mnt/Git/results/overlap_conll/booknlp_litbank_evaluation.csv
#echo "book_title, index_list, word_list" >> /mnt/Git/results/overlap_conll/booknlp_litbank_false_positive.csv
#echo "book_title, index_list, word_list" >> /mnt/Git/results/overlap_conll/booknlp_litbank_false_negative.csv

# create an empty folders for data
mkdir /mnt/Git/scripts/conll_evaluation/data_conll_format
mkdir /mnt/Git/scripts/conll_evaluation/data_conll_format/booknlp_litbank
mkdir /mnt/Git/scripts/conll_evaluation/data_conll_format/booknlp_dekkeretal
mkdir /mnt/Git/scripts/conll_evaluation/data_conll_format/booknlp_new_person
mkdir /mnt/Git/scripts/conll_evaluation/data_conll_format/booknlp_new_perx
mkdir /mnt/Git/scripts/conll_evaluation/data_conll_format/flair_litbank
mkdir /mnt/Git/scripts/conll_evaluation/data_conll_format/flair_dekkeretal
mkdir /mnt/Git/scripts/conll_evaluation/data_conll_format/flair_new_person
mkdir /mnt/Git/scripts/conll_evaluation/data_conll_format/flair_new_perx

# add conll to path in order to add arguments
ln -s /mnt/Git/scripts/conll_evaluation/conlleval.pl /usr/bin/conlleval.pl

# CAUTION: We do not use the flag -r as we are comparing the entities tags of the prefix

echo -e "\e[30;48;5;45m INFO: Evaluating BookNLP using LitBank \e[0m"
python3 /mnt/Git/scripts/conll_evaluation/booknlp_vs_litbank_gs.py
for x in /mnt/Git/scripts/conll_evaluation/data_conll_format/booknlp_litbank/*tsv ; do echo $x ; conlleval.pl -l < $x ; done > /mnt/Git/results/overlap_conll/booknlp_litbank.txt

echo -e "\e[30;48;5;45m INFO: Evaluating BookNLP using Dekker et al. \e[0m"
python3 /mnt/Git/scripts/conll_evaluation/booknlp_vs_dekkeretal_gs.py
for x in /mnt/Git/scripts/conll_evaluation/data_conll_format/booknlp_dekkeretal/*tsv ; do echo $x ; conlleval.pl -l < $x ; done > /mnt/Git/results/overlap_conll/booknlp_dekkeretal.txt

echo -e "\e[30;48;5;45m INFO: Evaluating BookNLP using New gold standard \e[0m"
python3 /mnt/Git/scripts/conll_evaluation/booknlp_vs_new_gs.py
for x in /mnt/Git/scripts/conll_evaluation/data_conll_format/booknlp_new_person/*tsv ; do echo $x ; conlleval.pl -l < $x ; done > /mnt/Git/results/overlap_conll/booknlp_new_person.txt
for x in /mnt/Git/scripts/conll_evaluation/data_conll_format/booknlp_new_perx/*tsv ; do echo $x ; conlleval.pl -l < $x ; done > /mnt/Git/results/overlap_conll/booknlp_new_perx.txt

echo -e "\e[30;48;5;45m INFO: Evaluating Flair using LitBank \e[0m"
python3 /mnt/Git/scripts/conll_evaluation/flair_vs_litbank_gs.py
for x in /mnt/Git/scripts/conll_evaluation/data_conll_format/flair_litbank/*tsv ; do echo $x ; conlleval.pl -l < $x ; done > /mnt/Git/results/overlap_conll/flair_litbank.txt
# evaluation with prefixes
for x in /mnt/Git/scripts/conll_evaluation/data_conll_format/flair_litbank/*tsv ; do echo $x ; conlleval.pl -r -l < $x ; done > /mnt/Git/results/overlap_conll/flair_litbank_with_prefix.txt

echo -e "\e[30;48;5;45m INFO: Evaluating Flair using Dekker et al. \e[0m"
python3 /mnt/Git/scripts/conll_evaluation/flair_vs_dekkeretal_gs.py
for x in /mnt/Git/scripts/conll_evaluation/data_conll_format/flair_dekkeretal/*tsv ; do echo $x ; conlleval.pl -l < $x ; done > /mnt/Git/results/overlap_conll/flair_dekkeretal.txt

echo -e "\e[30;48;5;45m INFO: Evaluating Flair using New gold standard \e[0m"
python3 /mnt/Git/scripts/conll_evaluation/flair_vs_new_gs.py
for x in /mnt/Git/scripts/conll_evaluation/data_conll_format/flair_new_person/*tsv ; do echo $x ; conlleval.pl -l < $x ; done > /mnt/Git/results/overlap_conll/flair_new_person.txt
for x in /mnt/Git/scripts/conll_evaluation/data_conll_format/flair_new_perx/*tsv ; do echo $x ; conlleval.pl -l < $x ; done > /mnt/Git/results/overlap_conll/flair_new_perx.txt
# evaluation with prefixes
for x in /mnt/Git/scripts/conll_evaluation/data_conll_format/flair_new_person/*tsv ; do echo $x ; conlleval.pl -r -l < $x ; done > /mnt/Git/results/overlap_conll/flair_new_person_with_prefix.txt
for x in /mnt/Git/scripts/conll_evaluation/data_conll_format/flair_new_perx/*tsv ; do echo $x ; conlleval.pl -r -l < $x ; done > /mnt/Git/results/overlap_conll/flair_new_perx_with_prefix.txt


<filename>push.sh<gh_stars>0
#!/usr/bin/env sh

# 当发生错误时中止脚本
set -e

#推送到码云
git push gitee master
#推送到原仓库
git push origin master

cd -


<reponame>arjangupta/CPP_Diary<gh_stars>0
#!/bin/sh

if [ ! -z $1 ]; then
    if { [ "--full-build" = $1 ] || [ "--full-rebuild" = $1 ]; }; then
        rm -rf build/linux/
    fi
fi
cmake -H. -Bbuild/linux/
cd build/linux
make -j $(nproc)


<gh_stars>0
#!/bin/sh

#  find.sh
#  XToDo
#
#  Created by Travis on 13-11-28.
#  Copyright (c) 2013年 Plumn LLC. All rights reserved.

KEYWORDS="$1"

# New matching strategy handles colon noise more gracefully, supports keywords in multi-line comments, supports mid-line keywords, and generally leaves less clean-up work for Obj-C
xargs -0 egrep --with-filename --line-number --only-matching "^.*?[^\"]($KEYWORDS).*?\$" | perl -p -e "s/^\s*(.+?):(.+?):.*($KEYWORDS)[: \t]*(.*?)[: \t]*$/\$1:\$2:\$3:\$4/gm"


#!/bin/bash

#------------------变量--------------------------
# 变量名的命名须遵循如下规则：

# 命名只能使用英文字母，数字和下划线，首个字符不能以数字开头。
# 中间不能有空格，可以使用下划线（_）。
# 不能使用标点符号。
# 不能使用bash里的关键字（可用help命令查看保留关键字）。
#--------------------------------------------

#定义变量myname
myname="jianlong"

echo "此时输出：$myname"
# 使用readOnly 定义只读变量
readonly greeting="hello,${myname}"

#删除变量 变量被删除后不能再次使用。unset 命令不能删除只读变量。
unset myname

#2-variable.sh: line 20: unset: greeting: cannot unset: readonly variable

# unset greeting

# 以下实例执行将没有任何输出。
echo "此时输出：$myname"


<gh_stars>0
#!/bin/bash

set +e
export Q_SRC_ROOT="$HOME/WORK/Q"
cd $Q_SRC_ROOT

#cleaning up of data files in local/Q/data/ directory
rm -f ../../local/Q/data/_*
rm -f ../../local/Q/trace/qcore.log

#cleaning up files in git repo
git checkout .
git clean -fd
#pulling recent changes in git repo
git pull

echo $Q_SRC_ROOT
#setting environment variables
source $Q_SRC_ROOT/setup.sh -f

rm -f ../../local/Q/lib/lib*.so

#pointing L to lua
sudo ln -sf /usr/local/bin/lua /usr/local/bin/L
#TODO: temporary hack: by creating a link 'luajit' which points to lua
#our Q build(Makefiles) is using luajit as interpreter, so pointing luajit to lua. Need to discuss.
sudo ln -sf /usr/local/bin/lua /usr/local/bin/luajit

cd $Q_SRC_ROOT/UTILS/build
#running build
build_cleanup_heading="------------OUTPUT of build cleanup--------------------------------------"
build_cleanup_output=$(make clean)

#TODO: temporary hack ==> Lua-Luaffi combination requires ffi.so present in local/Q/lib directory,
# so building luaffi_installation for it.
cd ../../GUIDING_PRINCIPLES/
bash luaffi_installation.sh
cd ../UTILS/build

build_output_heading="------------OUTPUT of build scripts--------------------------------------"
build_output=$(make static )

cd ../../

#running runtest from Q_SRC_ROOT and dump output in temporary file
luajit $Q_SRC_ROOT/TEST_RUNNER/runtest.lua i $Q_SRC_ROOT > $HOME/runtest_output.txt

#cmd to get last line of output of runtest
q_test_runner_result=$(tail -n1 < $HOME/runtest_output.txt)

#cmd to mail the output of runtest
echo $q_test_runner_result | /usr/bin/mail -s "Q Unit Tests" <EMAIL> -A $HOME/runtest_output.txt


#!/bin/bash

if [ $# = 0 ]; then
    echo "Please input a name for the deployment."
    exit
fi

bosh deploy "ceph-objectstorage-broker.yml" -d "$1" \
--vars-file="vars-file.yml"


#!/usr/bin/env bash
rm -rf build/ dist/
python setup.py sdist bdist_wheel
twine check dist/*
twine upload dist/*


<filename>stage-3.sh
#!/bin/bash
sudo wifi-menu
ip link | sudo awk '/wl/{system("systemctl enable netctl-auto@"substr($2, 1, length($2)-1))}'
sudo systemctl start bluetooth
sudo systemctl enable bluetooth
if [ "$#" -eq 1 ]
    $DOTFILES=$1
    yadm clone --bootstrap "$DOTFILES"
fi


<gh_stars>100-1000
#!/bin/sh -x
set -x
sh -x ./clean.sh

function system {
# Run operating system command and if failure, report and abort
  "$@"
  if [ $? -ne 0 ]; then
    echo "make.sh: unsuccessful command $@"
    echo "abort!"
    exit 1
  fi
}

# Main document lives in test directory
cp ../../../test/math_test_slides.do.txt .

rm -f *.aux
name=math_test_slides

options="--no_abort"

# HTML5 Slides
html=${name}-reveal
system doconce format html $name --pygments_html_style=native --keep_pygments_html_bg --html_links_in_new_window --html_output=$html
system doconce slides_html $html reveal --html_slide_theme=darkgray --copyright=titlepage

# Remark slides
system doconce format pandoc ${name} --github_md --align2equations SLIDE_TYPE=remark SLIDE_THEME=dark
system doconce slides_markdown ${name} remark --slide_theme=dark
mv ${name}.html ${name}-remark.html

# LaTeX Beamer slides
theme=blue_shadow
system doconce format pdflatex ${name} SLIDE_TYPE="beamer" SLIDE_THEME="$theme" --latex_title_layout=beamer --latex_code_style=pyg
system doconce slides_beamer ${name} --beamer_slide_theme=$theme
mv ${name}.tex ${name}-beamer.tex
system pdflatex -shell-escape ${name}-beamer
system pdflatex -shell-escape ${name}-beamer

# Sphinx document
system doconce format sphinx ${name}
system doconce sphinx_dir theme=pyramid ${name}
system python automake_sphinx.py

# IPython notebook
system doconce format ipynb ${name} --encoding=utf-8
pygmentize -l json -o ${name}.ipynb.html ${name}.ipynb

# Create HTML view from DocOnce source
system doconce format html $name --html_output=${name}-html

doconce pygmentize ${name}.do.txt perldoc
doconce format html index_slides --html_style=bootstrap_FlatUI --html_links_in_new_window --html_bootstrap_navbar=off

dest=../../pub/mathjax
cp -r index_slides.html ${name}-beamer.pdf ${name}.do.txt.html ${name}-reveal.html ${name}-html.html reveal.js ${name}-remark.html ${name}.ipynb sphinx-rootdir/_build/html $dest


<filename>update_grpc_assistant_server.sh
#!/bin/bash
sh ./stop_grpc_assistant_server.sh
echo "GRPC assistant server updating..."
git pull
docker pull gkulasik/grpc_assistant_server:latest
echo "GRPC assistant server updated."


git pull
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data0/qilei_chen/opencv33_install_60/lib:/usr/local/cuda/lib64
python experiments/fpn/fpn_end2end_train_test.py --cfg experiments/fpn/cfgs/dr_4/resnet_v1_101_dr_trainval_sod_end2end_focal_3.yaml


#!/bin/sh

export GF_SERVER_HTTP_PORT="$PORT"
export GF_DATABASE_URL="$DATABASE_URL"

exec /run.sh


<gh_stars>0
tar -xf make-4.3.tar.gz
cd make-4.3
./configure --prefix=/usr
make
make install
rm -rf /sources/make-4.3


<filename>scripts/util/ccp_base.sh
#!/bin/bash

# Copyright (c) 2006-2013, 2016 Regents of the University of Minnesota.
# For licensing terms, see the file LICENSE.

# Usage: Call this script from another script.
#

# ============================================================================
# *** Setup

# SYNC_ME: This setup code is shared btw.: bash_base.sh and ccp_base.sh.

# Make it easy to reference the script name and relative or absolute path.

# NOTE: The parent `source`d us, so $0 is _its_ name.
#       Unless the parent was also sourced.

if [[ `echo "$0" | grep "bash$" -` ]]; then
  # User sourcing us (via parent) from terminal.
  script_name=$BASH_SOURCE
  script_relbase=$(pwd -P)
else
  script_name=$(basename $0)
  script_relbase=$(dirname $0)
fi
#echo "script_name: $script_name"
#echo "script_relbase: $script_relbase"

# From our good friends at http://stackoverflow.com
#   /questions/7126580/expand-a-possible-relative-path-in-bash

dir_resolve () {
  # Change to the desired directory. Squash error msgs. but return error
  # status, maybe.
  cd "$1" 2>/dev/null || return $?
  # Use pwd's -P to return the full, link-resolved path.
  echo "`pwd -P`"
}

script_path=$(dir_resolve $script_relbase)

# ============================================================================
# *** Find bash_base.sh

# Pyserver home leads us to the installation folder, unless not specified.

# C.f. from pyserver_glue.py. Kinda. There's similar code that walks up the
# directory tree until we find a pyserver uncle or until we root out.
#
find_pyserver_uncle () {

  HERE_WE_ARE=$(dir_resolve ${script_relbase})

  while [[ ${HERE_WE_ARE} != '/' ]]; do
    if [[ -e "${HERE_WE_ARE}/pyserver/CONFIG" ]]; then
      # MAYBE: Really export? We were sourced, so maybe don't do this,
      #        so we don't clobber the user's working environment?
      export CCP_WORKING=${HERE_WE_ARE}
      export PYSERVER_HOME=${CCP_WORKING}/pyserver
      break
    else
      # Keep looping:
      HERE_WE_ARE=$(dir_resolve ${HERE_WE_ARE}/..)
    fi
  done

  if [[ ${HERE_WE_ARE} == '/' ]]; then
    echo "ERROR: Cannot suss out PYSERVER_HOME. Failing!"
    exit 1
  fi
}

if [[ "${PYSERVER_HOME}" == "/dev/null" ]]; then
  : # Nada. This is just ccp_install calling us, before Ccp is installed.
elif [[ -z "${PYSERVER_HOME}" ]]; then
  find_pyserver_uncle
else
  CCP_WORKING=$(dir_resolve ${PYSERVER_HOME}/..)
  export CCP_WORKING=${CCP_WORKING}
fi

# If the dev dir is symbolic link, be sure to use the qualified (hard path)
# instance name. E.g., on the production server, /ccp/dev/cycloplan_sib1 and
# /ccp/dev/cycloplan_sib2 both point to /ccp/dev/cycloplan_live.
# Note that we could do this earlier, for CCP_WORKING, but we just need it
# for CCP_INSTANCE to work, e.g., /ccp/var/tilecache/* uses instance name,
# so we could make symbolic links there, but then what other places use
# CCP_INSTANCE?

test_opts=$(echo $SHELLOPTS)
set +e
`echo $test_opts | grep errexit` >/dev/null 2>&1
if [[ $? -eq 0 ]]; then
  USING_ERREXIT=true
else
  USING_ERREXIT=false
fi
#
hard_path=`readlink $CCP_WORKING`
#
if $USING_ERREXIT; then
  set -e
fi

if [[ -z $hard_path ]]; then
  CCP_INSTANCE=$(basename $CCP_WORKING)
else
  CCP_INSTANCE=$(basename $hard_path)
fi

# This script needs some utility functions that we have defined next door.

BASH_BASE_PATH=${CCP_WORKING}/scripts/util/bash_base.sh
if [[ ! -e "${BASH_BASE_PATH}" ]]; then
  echo "ERROR: Where is bash_base.sh?"
fi
. ${BASH_BASE_PATH}

# ============================================================================
# *** Cyclopath's Well-known paths

# *** Cyclopath developer repository

# The ccpdev directory is used interally in cron jobs. If you're a community
# developer, you can ignore this setting (you won't find it used in the
# source).
CCPDEV_ROOT=/ccp/bin/ccpdev

# The typical CcpV2 source code installation folder.

CCP_DEV=/ccp/dev

# *** Cyclopath variable files storage

CCP_VAR=/ccp/var

# Where to store database dumps on the machine.
CCP_DBDUMPS=/ccp/var/dbdumps
CCP_DBDAILY=${CCP_VAR}/.dbdumps.daily

# Where the branch manager's and www-data's cron record their nightly
# activities (for, e.g., daily.runic.sh and check_cache_now.sh).
# Also where CcpV1->V2's upgrade_ccpv1-v2 and publish_ccpv1-v2 blather.
CCP_LOG=/ccp/var/log
CCP_LOG_DAILY=/ccp/var/log/daily

# TileCache Cache dir.
TILECACHE_BASE=/ccp/var/tilecache-cache

# ============================================================================
# *** Cyclopath's installation-specifics

# Get the name of the Cyclopath database used by this installation.

if [[ -e "${PYSERVER_HOME}/CONFIG" ]]; then
  #
  # FIXME: THIS DOESN'T RESPEK INSTANCE.
  #        E.g., [instance_minnesota]
  #        MAYBE: Deprecate $INSTANCE and go w/ one instance per
  #        CCP_INSTALLATION -- which is 100% more natural, except
  #        you can't share the user database... oh, dur, instead
  #        of instance, you should use a different branch...
  #
  CCP_DB_NAME=`/bin/egrep "^database: +[_a-zA-Z0-9]+$" \
               ${PYSERVER_HOME}/CONFIG \
               | /bin/sed -r 's/^database: +//'`
  CCP_DB_PORT=`/bin/egrep "^port: +[0-9]+$" \
               ${PYSERVER_HOME}/CONFIG \
               | /bin/sed -r 's/^port: +//'`
fi

# Well-known psql wrapper. Sets up search_path for us.
PSQL_WRAP=${CCP_WORKING}/scripts/util/psql_wrap.sh

# This instance's tilecache cache folder.
TILECACHE_CACHE=${TILECACHE_BASE}/${CCP_INSTANCE}

# ============================================================================
# *** Cyclopath's Python path

# Oddly, if we don't include the GDAL path, 'from osgeo import osr' fails under
# Ubuntu 11.04 (Python 2.7). Works fine without under Ubuntu 10.04 (Python 2.6)
# This is usually used when sudo'ing a command, to supply the path to root or
# to httpd_user.
# No: /export/scratch/ccp/opt/gdal/lib/$PYTHONVERS2/site-packages/GDAL-1.10.1-${PYVERSABBR2}-linux-x86_64.egg:\
# No: /ccp/opt/usr/lib/python2.6/site-packages/networkx-1.8.1-py2.6.egg
#      (networkx is installed for users, but not for www-data...
#       you have to point the httpd.conf at the location).
ccp_python_path="\
/export/scratch/ccp/opt/usr/lib/python:\
/export/scratch/ccp/opt/usr/lib/$PYTHONVERS2/site-packages:\
/export/scratch/ccp/opt/gdal/lib/$PYTHONVERS2/site-packages:\
/export/scratch/ccp/opt/usr/lib64/$PYTHONVERS2/site-packages"

# ============================================================================
# *** Crude miscellany

# FIXME: This fcn. is crude. It hardcodes instance names and branch names...
#        two things that don't belong in code.

ccp_base_branch_name_from_instance () {

  db_instance=$1

  if [[ -z "${db_instance}" ]]; then
    echo "Please specify the instance."
    exit 1
  fi

  # MAYBE: Make this a shell utility function.
  if [[ ${db_instance} == 'minnesota' ]]; then
    branch_name='Minnesota'
  elif [[ ${db_instance} == 'colorado' ]]; then
    branch_name='Denver-Boulder'
  else
    echo "Unknown instance: ${db_instance}."
    exit 1
  fi

  # You can only return error values in Bash, so print to stdin.
  # The caller runs, e.g., br_name=`ccp_base_branch_name_from_instance $instnc`
  echo ${branch_name}
}

# ============================================================================
# *** More Installation Specifics

ccp_latest_rev_id () {
  SETPATH="SET search_path TO ${INSTANCE}, public;"
  and_branch_id=""
  if [[ -n ${1} ]]; then
    # FIXME: This is fragile, and it's a weird place for complicated SQL.
    #        This select doesn't care about duplicates but uses an ORDER BY
    #        so if there are duplicates, the same one will always be returned.
    select_brid="\
      SELECT branch.stack_id FROM branch
        JOIN item_versioned USING (system_id)
        WHERE item_versioned.name = '${1}'
        ORDER BY stack_id DESC LIMIT 1"
     and_branch_id="AND branch_id = (${select_brid})"
  fi
  latest_rev_id=`
     PAGER=more \
     psql -U cycling ${CCP_DB_NAME} \
     --no-psqlrc \
     -c "${SETPATH}; \
         SELECT id \
         FROM ${INSTANCE}.revision \
         WHERE id != cp_rid_inf() \
         ${and_branch_id} \
         ORDER BY id DESC \
         LIMIT 1;" \
       -A -t`
   echo ${latest_rev_id}
}

ccp_latest_rev_ts () {
  SETPATH="SET search_path TO ${INSTANCE}, public;"
  # NOTE: Don't use $@, but $*.
  latest_rev_id=$(ccp_latest_rev_id "$*")
  latest_rev_ts=`
     PAGER=more \
     psql -U cycling ${CCP_DB_NAME} \
     --no-psqlrc \
     -c "${SETPATH}; \
         SELECT timestamp \
         FROM ${INSTANCE}.revision \
         WHERE id = ${latest_rev_id};" \
       -A -t`
  echo ${latest_rev_ts}
}

# ============================================================================
# *** Waiting for RouteGuffmanfinder

ccp_routed_ports_where () {

  rf_instance=$1
  if [[ $2 -ne 0 ]]; then
    rf_branch_id=$2
  else
    rf_branch_id="(SELECT cp_branch_baseline_id())"
  fi
  rf_routed_pers=$3
  if [[ -n $4 ]]; then
    rf_purpose=$4
  else
    rf_purpose='general'
  fi

  rf_where_clause="
        instance = '${rf_instance}'
    AND branch_id = ${rf_branch_id}
    AND routed_pers = '${rf_routed_pers}'
    AND purpose = '${rf_purpose}'"

    echo ${rf_where_clause}
}

ccp_routed_ports_ready () {

  # MAYBE: Is there a way to not have to poll?
  #        I.e., how does route analysis wait for its finders to start?

  # NOTE: Most callers will have been the one that started the route finder
  #       service, but there's not an easy way to get its PID, is there.

  rf_where_clause=`ccp_routed_ports_where $1 $2 $3 $4`

  SETPATH="SET search_path TO ${INSTANCE}, public;"
  rf_ready=`
     PAGER=more \
       psql -U cycling ${CCP_DB_NAME} \
     --no-psqlrc \
     -c "${SETPATH}; \
          SELECT ready FROM public.routed_ports \
          WHERE ${rf_where_clause}
          ORDER BY port DESC
          LIMIT 1
          ;" -A -t`

  echo ${rf_ready}
}

ccp_routed_ports_reset () {

  rf_where_clause=`ccp_routed_ports_where $1 $2 $3 $4`

  SETPATH="SET search_path TO ${INSTANCE}, public;"
  rf_deleted=`
     PAGER=more \
       psql -U cycling ${CCP_DB_NAME} \
     --no-psqlrc \
     -c "${SETPATH}; \
          DELETE FROM public.routed_ports \
          WHERE ${rf_where_clause}
          ;" -A -t
          `
  # rf_deleted is, e.g., "DELETE 1".
  # echo ${rf_deleted}
}

ccp_routed_ports_wait () {
  # From man echo
  # -n  do not output the trailing newline
  # -e  enable interpretation of backslash escapes
  #
  # E.g., try
  #  seq 1 1000000 | while read i; do echo -en "\r$i"; done
  time_0=$(date +%s.%N)
  #echo -n "Waiting for route daemon to have loaded... "
  still_waiting=1
  while [[ $still_waiting -ne 0 ]]; do
    time_1=$(date +%s.%N)
    time_e=$(echo "($time_1 - $time_0) / 1.0" | bc -l)
    rf_ready=`ccp_routed_ports_ready $1 $2 $3 $4`
    if [[ $rf_ready == 'f' ]]; then
      echo -en "\rRoute daemon still loading or dead... ${time_e} secs."
      sleep 1
    elif [[ $rf_ready == 't' ]]; then
      still_waiting=0
      # Clear to end of line. See:
      #   http://ascii-table.com/ansi-escape-sequences.php
      echo -en "\rRoute daemon ready after ${time_e} secs.\033[K"
      echo
    else
      still_waiting=0
      echo "WARNING: Route daemon not found in routed_ports."
    fi
  done
}

# ***


################################ CMD PROMPT #############################

export glypharrow=$'\ue0b0'
export glyphflames=$'\ue0c0'
export glyphrounded=$'\ue0b4'
export glyphbits=$'\ue0c6'
export glyphhex=$'\ue0cc'

export PS1w=$'\033[38;5;33m'
export PS1u=$'\033[38;2;0;165;0m'
export PS1a=$'\033[38;2;100;100;100m'
export PS1c=$'\033[38;2;110;110;110m'
export PS1h=$'\033[38;2;169;112;255m'
export PS1p=$'\033[38;2;218;165;32m'
export PS1P=$'\033[38;2;255;0;0m'
export PS1U=$PS1P

export gruv_orange=$'\033[38;2;214;93;13m'

if [[ $EUID == 0 ]]; then
  export PS1='\[$PS1U\]\u\[$PS1a\]@\[$PS1h\]\h\[$PS1c\]:\[$PS1w\]\w\[$PS1P\]#\[\033[00m\] '
else
  export PS1='\[$PS1u\]\u\[$PS1a\]@\[$PS1h\]\h\[$PS1c\]:\[$PS1w\]\w\[$PS1p\]$\[\033[00m\] '
fi

ps1min () {
  export PS1='\[$gruv_orange\]$\[\033[00m\] '
}


ganache-cli -m "outside frog empty glue slim eternal dune behind limit jewel plate cloud"


<filename>run.sh
#!/usr/bin/env bash
# Author: wxnacy(<EMAIL>)
# Description:

name=$1

if [[ -f ${name}/run.sh ]]
then
    `${name}/run.sh`
else
    docker run -it --rm wxnacy/$name /bin/bash
fi


<filename>CoMem_AXPY/test.sh
nvprof ./axpy_cuda 1024000
nvprof ./axpy_cuda 4096000
nvprof ./axpy_cuda 10240000
nvprof ./axpy_cuda 20480000


<reponame>t12g/terraform-validator<filename>vendor/github.com/rcrowley/go-metrics/validate.sh
#!/bin/bash

set -e

# check there are no formatting issues
GOFMT_LINES=`gofmt -l . | wc -l | xargs`
test $GOFMT_LINES -eq 0 || echo "gofmt needs to be run, ${GOFMT_LINES} files have issues"

# run the tests for the root package
go test -race .


# This shell script executes Slurm jobs for running predictions
# with NTT-like convolutional neural network
# on BirdVox-70k with PCEN input.
# Trial ID: 0.
# Augmentation kind: all.

sbatch 048_aug-all_test-unit01_trial-0_predict-unit07.sbatch
sbatch 048_aug-all_test-unit01_trial-0_predict-unit10.sbatch
sbatch 048_aug-all_test-unit01_trial-0_predict-unit01.sbatch

sbatch 048_aug-all_test-unit02_trial-0_predict-unit10.sbatch
sbatch 048_aug-all_test-unit02_trial-0_predict-unit01.sbatch
sbatch 048_aug-all_test-unit02_trial-0_predict-unit02.sbatch

sbatch 048_aug-all_test-unit03_trial-0_predict-unit01.sbatch
sbatch 048_aug-all_test-unit03_trial-0_predict-unit02.sbatch
sbatch 048_aug-all_test-unit03_trial-0_predict-unit03.sbatch

sbatch 048_aug-all_test-unit05_trial-0_predict-unit02.sbatch
sbatch 048_aug-all_test-unit05_trial-0_predict-unit03.sbatch
sbatch 048_aug-all_test-unit05_trial-0_predict-unit05.sbatch

sbatch 048_aug-all_test-unit07_trial-0_predict-unit03.sbatch
sbatch 048_aug-all_test-unit07_trial-0_predict-unit05.sbatch
sbatch 048_aug-all_test-unit07_trial-0_predict-unit07.sbatch

sbatch 048_aug-all_test-unit10_trial-0_predict-unit05.sbatch
sbatch 048_aug-all_test-unit10_trial-0_predict-unit07.sbatch
sbatch 048_aug-all_test-unit10_trial-0_predict-unit10.sbatch


<gh_stars>10-100
#!/bin/sh

sudo echo -n q > /tmp/cmd
exit


#!/usr/bin/env sh
if [ "$#" -ne 2 ] ;then
  echo "Input illegal number of parameters " $#
  echo "Need 2 parameters for the network architecture name and the dataset name"
  exit 1
fi
if [ "$TORCH_HOME" = "" ]; then
  echo "Must set TORCH_HOME envoriment variable for data dir saving"
  exit 1
else
  echo "TORCH_HOME : $TORCH_HOME"
fi

model=$1
dataset=$2
epochs=164

$PYTHON main.py $TORCH_HOME/cifar.python \
	--dataset ${dataset} --arch ${model} --save_path ./snapshots/${dataset}_${model}_${epochs} --epochs ${epochs} \
	--schedule 82 123 --gammas 0.1 0.1 --learning_rate 0.1 --decay 0.0001 --batch_size 128 --workers 16 --ngpu 4


<filename>terraform/test/validate/test.sh<gh_stars>10-100
#!/usr/bin/env bash

set -e

mkdir -p .circleci

sed -e "s|ovotech/terraform@1|ovotech/terraform@dev:${USER}_test|" config.yml | circleci config process - >.circleci/config.yml

function expect_success() {
    local JOB=$1

    circleci local execute --job $JOB >/tmp/output # | tee /tmp/output

    if [[ "$(tail -n 1 /tmp/output)" != *"Success"* ]]; then
        echo "Test $JOB Failed"
        exit 1
    fi

    echo "Test $JOB Passed"
}

function expect_fail() {
    local JOB=$1
    local ERROR=$2

    circleci local execute --job $JOB >/tmp/output # | tee /tmp/output

    if [[ "$(tail -n 1 /tmp/output)" == *"Success"* ]]; then
        echo "Test $JOB Failed"
        exit 1
    fi

    if ! cat /tmp/output | grep -e "$ERROR" >/dev/null; then
        echo "Validate didn't have expected error"
        exit 1
    fi

    echo "Test $JOB Passed"
}

expect_success default_valid
expect_success terraform_11_valid
expect_success terraform_12_valid
expect_fail default_invalid "null_resource.hello: resource repeated multiple times"
expect_fail terraform_11_invalid "null_resource.hello: resource repeated multiple times"
expect_fail terraform_12_invalid "Error: Duplicate resource \"null_resource\" configuration"

echo "All tests passed"


# run tensorflow docker to train and eval
# For MSCOCO #############################################################
CODE_DIR=<absolute path to code repo>/ipr-imagecaptioning/addition_bi
CNN_DIR=<absolute path to pretrained cnn weight folder>/cnn-weight
DATA_DIR=<absolute path to mscoco dataset folder>/mscoco
COCO_EVAL_DIR=<absolute path to the pycocoevalcap>/pycocoevalcap

sudo docker run -it --rm --runtime=nvidia \
-v $CODE_DIR:/image_captioning_IPR \
-v $CNN_DIR:/image_captioning_IPR/cnn_models \
-v $DATA_DIR/train2014:/image_captioning_IPR/train/images \
-v $DATA_DIR/val2014:/image_captioning_IPR/val/images \
-v $DATA_DIR/annotations/karpathy_train.json:/image_captioning_IPR/train/karpathy_train.json \
-v $DATA_DIR/annotations/karpathy_test.json:/image_captioning_IPR/val/karpathy_test.json \
-v $COCO_EVAL_DIR:/image_captioning_IPR/utils/coco/pycocoevalcap \
-w /image_captioning_IPR \
limjianhan/tensorflow:1.13.1-gpu /bin/bash

# For Flickr30k ############################################################
CODE_DIR=<absolute path to code repo>/ipr-imagecaptioning/addition_bi
CNN_DIR=<absolute path to pretrained cnn weight folder>/cnn-weight
DATA_DIR=<absolute path to flickr30k dataset folder>/flickr30k
COCO_EVAL_DIR=<absolute path to the pycocoevalcap>/pycocoevalcap

sudo docker run -it --rm --runtime=nvidia \
-v $CODE_DIR:/image_captioning_IPR \
-v $CNN_DIR:/image_captioning_IPR/cnn_models \
-v $DATA_DIR/images_flickr30k:/image_captioning_IPR/train/images_flickr30k \
-v $DATA_DIR/annotations/karpathy_train_flickr30k.json:/image_captioning_IPR/train/karpathy_train_flickr30k.json \
-v $DATA_DIR/annotations/karpathy_test_flickr30k.json:/image_captioning_IPR/val/karpathy_test_flickr30k.json \
-v $COCO_EVAL_DIR:/image_captioning_IPR/utils/coco/pycocoevalcap \
-w /image_captioning_IPR \
limjianhan/tensorflow:1.13.1-gpu /bin/bash

# For Flickr8k ############################################################
CODE_DIR=<absolute path to code repo>/ipr-imagecaptioning/addition_bi
CNN_DIR=<absolute path to pretrained cnn weight folder>/cnn-weight
DATA_DIR=<absolute path to flickr8k dataset folder>/flickr8k
COCO_EVAL_DIR=<absolute path to the pycocoevalcap>/pycocoevalcap

sudo docker run -it --rm --runtime=nvidia \
-v $CODE_DIR:/image_captioning_IPR \
-v $CNN_DIR:/image_captioning_IPR/cnn_models \
-v $DATA_DIR/images_flickr8k:/image_captioning_IPR/train/images_flickr8k \
-v $DATA_DIR/annotations/karpathy_train_flickr8k.json:/image_captioning_IPR/train/karpathy_train_flickr8k.json \
-v $DATA_DIR/annotations/karpathy_test_flickr8k.json:/image_captioning_IPR/val/karpathy_test_flickr8k.json \
-v $COCO_EVAL_DIR:/image_captioning_IPR/utils/coco/pycocoevalcap \
-w /image_captioning_IPR \
limjianhan/tensorflow:1.13.1-gpu /bin/bash


<reponame>onearmbandit/MTAV

sudo apt install zip unzip curl

curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar

curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar

chmod +x phpcs.phar

chmod +x phpcbf.phar

sudo mv phpcs.phar /usr/local/bin/phpcs

sudo mv phpcbf.phar /usr/local/bin/phpcbf

cd sniffs

wget https://github.com/WordPress/WordPress-Coding-Standards/archive/2.3.0.zip
unzip -o 2.3.0.zip
rm 2.3.0.zip

wget https://github.com/Automattic/VIP-Coding-Standards/archive/2.0.0.zip
unzip -o 2.0.0.zip
rm 2.0.0.zip

sudo phpcs --config-set installed_paths $(pwd)/WordPress-Coding-Standards-2.3.0/,$(pwd)/VIP-Coding-Standards-2.0.0/

cd ..


#!/bin/sh
here=$(cd "$(dirname "$0")"; pwd)
base=$here/..

# This is where all build products will be installed.
destdir=$base/build/built
mkdir -p $destdir

# Build LLVM "out-of-source" in a scratch directory.
builddir=$base/build/llvm
mkdir -p $builddir
cd $builddir
cmake -G Ninja -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_INSTALL_PREFIX:PATH=$destdir ../../llvm
ninja install


<gh_stars>0
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!    BEFORE: The nodes are expected to have a STATUS of NotReady at this point !!!!!!!!!!!!!!!!!!!!!!!!!!!!"
kubectl get nodes
echo "  "
echo "  "
echo "  "
echo "  "
echo "net.bridge.bridge-nf-call-iptables=1" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p


#!/bin/bash

## atail
##      Description:  runs [tail -f] for /var/log/supervisor files
##      Usage:        atail [FILENAME]
##
exec tail -f "/var/log/supervisor/${1}"*


<filename>Forensics/The_Boring_Company/ZIPArchiveMatryoshka_Solver_with_fcrackzip.sh
#!/bin/bash

cd tmp/
filename=$(ls)
#rm -r tmp2/
mkdir tmp2/
cp $filename tmp2/
cd tmp2/
filename=$(ls)
while [ 1 ]
do
	file $filename
	file $filename | grep "bzip2"
	if [ "$?" -eq 0 ]
	then
		mv $filename $filename.bz2
		bunzip2 $filename.bz2 > /dev/null
		filename=$(ls)
	fi

	file $filename | grep "Zip"
	if [ "$?" -eq 0 ]
	then
		mv $filename $filename.zip
		password="$(<PASSWORD> -D -u -p ../../rockyou.txt $filename.zip | tr -d '\n' | cut -d "=" -f3 | tr -d ' ')"
		echo "Found password: \`${password}\`"
		unzip -q -P "${password}" $filename.zip
		rm $filename.zip > /dev/null 2>&1
		filename=$(ls)
	fi

	file $filename | grep "gzip"
	if [ "$?" -eq 0 ]
	then
		mv $filename $filename.gz
		gunzip $filename.gz > /dev/null
		filename=$(ls)
	fi

	file $filename | grep "ASCII"
	if [ "$?" -eq 0 ]
	then
		echo
		echo
		echo "Flag Found!"
		echo
		cat $filename
		echo
		echo
		break
	fi
done


<gh_stars>0
#!/usr/bin/env bash

# source
. ${phala_scripts_dir}/scripts/utils.sh
. ${phala_scripts_dir}/scripts/log.sh
. ${phala_scripts_dir}/scripts/config.sh
. ${phala_scripts_dir}/scripts/check.sh
. ${phala_scripts_dir}/scripts/install.sh
. ${phala_scripts_dir}/scripts/status.sh
. ${phala_scripts_dir}/scripts/update.sh

function phala_scripts_help(){
phala_scripts_utils_gettext "Usage:\n"\
"	phala [OPTION]...\n"\
"\n"\
"Options:\n"\
"	help					display help information\n"\
"	install					install your phala node\n"\
"	uninstall				uninstall your phala scripts\n"\
"	start					start mining\n"\
"		<node | pruntime | pherry>\n"\
"	stop					stop mining\n"\
"		<node | pruntime | pherry>\n"\
"	config\n"\
"		<show>				display all configuration of your node\n"\
"		<testnet | locale>\n"\
"	status					display the running status of all components\n"\
"	update					update all containers without cleaning up the data\n"\
"		<clean>				update all containers, and clean up the data\n"\
"		<script>			update the script\n"\
"	logs					print all container logs information\n"\
"		<node | pruntime | pherry>\n"\
"		<clean>				clean log\n"\
"	sgx-test				start the mining test program\n"\
"	version					display script version\n"
}

function phala_scripts_start() {
  phala_scripts_check_envf
  phala_scripts_config_dockeryml
  phala_scripts_utils_docker up -d
}

function phala_scripts_ps_container() {
  phala_scripts_check_envf
  phala_scripts_check_ymlf
  local _container_name=$(awk -F':' '/container_name/ {print $NF}' ${phala_scripts_docker_ymlf}|grep "\-${1}$")
  if [ -z "$1" ];then
    phala_scripts_utils_docker ps
  elif [ ! -z "${_container_name}" ];then
    phala_scripts_utils_docker ps ${_container_name}
  else
    phala_scripts_help
  fi
}

function phala_scripts_stop_container() {
  local _container_name=$(awk -F':' '/container_name/ {print $NF}' ${phala_scripts_docker_ymlf} 2>/dev/null|grep "\-${1}$")
  if [ -z "$1" ];then
    phala_scripts_utils_docker stop
    phala_scripts_utils_docker rm -f
  elif [ ! -z "${_container_name}" ];then
    phala_scripts_utils_docker stop ${_container_name}
    phala_scripts_utils_docker rm -f ${_container_name}
  else
    phala_scripts_help
  fi
}

function phala_scripts_remove_dockerimage() {
  local _container_name=$(awk -F':' '/container_name/ {print $NF}' ${phala_scripts_docker_ymlf} 2>/dev/null)
  for _dockerimage in ${_container_name};do
    docker image rm ${_dockerimage}
  done
}

function phala_scripts_logs_container() {
  set +e
  phala_scripts_check_envf
  phala_scripts_check_ymlf
  local _container_name=$(awk -F':' '/container_name/ {print $NF}' ${phala_scripts_docker_ymlf}|grep "\-${1}$")
  if [ -z "$1" ];then
    phala_scripts_utils_docker logs -f --tail 50
  elif [ ! -z "${_container_name}" ];then
    phala_scripts_utils_docker logs -f --tail 50 ${_container_name}
  else
    phala_scripts_help
  fi
}

function phala_scripts_uninstall() {
  phala_scripts_install_aptdependencies uninstall "${phala_scripts_dependencies_default_soft[@]}"
  phala_scripts_install_otherdependencies uninstall "${phala_scripts_dependencies_other_soft[@]}"
  phala_scripts_install_sgx uninstall
  [ -L "/usr/local/bin/phala" ] && unlink /usr/local/bin/phala
  chattr -i -R ${phala_scripts_conf_dir} ${phala_scripts_temp_dir} >/dev/null 2>&1
  phala_scripts_log info "Delete Phala Scripts: ${phala_scripts_dir}" cut
  rm -rf ${phala_scripts_dir}
  if [ "$1" == "clean" ];then
    phala_scripts_log info "Delete Phala Data: ${khala_data_path_default}" cut
    rm -rf ${khala_data_path_default} ${khala_data_path_default}_dev
    phala_scripts_log info "Uninstall phala node sucess" cut
  elif [ -z "$1" ];then
    phala_scripts_log info "Uninstall phala node sucess" cut
    phala_scripts_log info "\t\t\t\t\t Delete(rm -rf) \n \t\t\t\t\t Phala Data Dir: [ ${khala_data_path_default} ]" cut
  fi
}

function phala_scripts_clean_logs() {
  local _container_name=$(awk -F':' '/container_name/ {print $NF}' ${phala_scripts_docker_ymlf}|grep "\-${1}$")
  if [ -z "$1" ];then
    _container_name=$(awk -F':' '/container_name/ {print $NF}' ${phala_scripts_docker_ymlf})
  elif [ ! -z "${_container_name}" ];then
    :
  else
    phala_scripts_help
    return 1
  fi

  for _cname in ${_container_name[@]};do
    _phala_scripts_utils_printf_value="${_cname}"
    phala_scripts_log info "clean [ %s ] log." cut
    truncate -s 0 $(docker inspect --format='{{.LogPath}}' ${_cname});
  done
}

function phala_scripts_case() {
  local _check_link=$(readlink /usr/local/bin/phala)
  if [ ! -L "/usr/local/bin/phala" ];then
    ln -s ${phala_scripts_dir}/phala.sh /usr/local/bin/phala
  elif [ ! -f "/usr/local/bin/phala" ] && [ -L "/usr/local/bin/phala" ];then
    unlink /usr/local/bin/phala
    ln -s ${phala_scripts_dir}/phala.sh /usr/local/bin/phala
  elif [ -L "/usr/local/bin/phala" ] && [ "${_check_link%/*}" != "${phala_scripts_dir}" ];then
    unlink /usr/local/bin/phala
    ln -s ${phala_scripts_dir}/phala.sh /usr/local/bin/phala
  fi
  [ -x ${phala_scripts_dir}/phala.sh ] || chmod +x ${phala_scripts_dir}/phala.sh

  [ $(echo $1|grep -E "^start$|^presync$|^stop$|^status$|^logs$|^ps$|^sgx-test$"|wc -l) -eq 1 ] && phala_scripts_check_dependencies
  case "$1" in
    install|config)
      shift
      phala_scripts_config_set $*
    ;;
    version)
      printf "Phala Scripts Version: %s\n" ${phala_scripts_version}
    ;;
    start)
      phala_scripts_start
    ;;
    presync)
      if [ -f ${phala_scripts_docker_envf} ];then
        local phala_scripts_config_input_nodename=$(phala_scripts_config_set_nodename)
        sed -i "s#NODE_NAME=.*#NODE_NAME=${phala_scripts_config_input_nodename}#g" ${phala_scripts_docker_envf}
        phala_scripts_utils_docker up -d
      else
        phala_scripts_start
      fi
    ;;
    stop)
      shift
      phala_scripts_stop_container $*
    ;;
    status)
      set +e
      phala_scripts_status
    ;;
    update)
      shift
      phala_scripts_update $*
    ;;
    logs)
      export _phala_scripts_error_trap=false
      shift
      if [ "$1" == "clean" ];then
        shift
        phala_scripts_clean_logs $*
      else
        phala_scripts_logs_container $*
      fi
    ;;
    ps)
      shift
      phala_scripts_ps_container
    ;;
    uninstall)
      set +e
      phala_scripts_stop_container
      phala_scripts_remove_dockerimage
      shift
      phala_scripts_uninstall $*
    ;;
    sgx-test)
      phala_scripts_check_sgxtest
    ;;
    *)
      phala_scripts_help
    ;;
  esac
}

function phala_scripts_main() {
  # Error Quit
  set -e
  trap "phala_scripts_trap" EXIT INT
  export _phala_scripts_error_trap=true

  # Cannot run driectly
  if [ -z "${phala_scripts_dir}" ];then
  printf "\033[0;31m Cannot run driectly \033[0m\n"
    exit 1
  fi

  # run main case
  [ "$1" == "debug" ] && {
    # open shell debug
    set -x
    # shift OPTION
    shift
  }

  # default config [ first run ]
  phala_scripts_config

  # set locale lange
  phala_scripts_utils_setlocale

  # check
  phala_scripts_check

  phala_scripts_case $*

}


<filename>Xtensions/TTS/espeak-ng-mbrola/install.sh
#!/bin/bash
set -e
echo "This script will download and install MBROLA for espeak-ng and download a few selected voices."
echo "If you need more voices feel free to edit this script ;-)."
echo "MBROLA and the included voices can be used freely for private, non-commercial SEPIA projects."
echo ""
echo "If you are planning to use MBROLA in a public or commercial project please read the following"
echo "LICENSE files carefully:"
echo ""
echo "MBROLA AGPL 3.0 license: https://github.com/numediart/MBROLA/blob/master/LICENSE"
echo "MBROLA voices terms of use: https://github.com/numediart/MBROLA-voices/blob/master/LICENSE.md"
echo ""
read -p "Enter 'agree' to continue: " agreeornot
echo ""
if [ -n "$agreeornot" ] && [ $agreeornot = "agree" ]; then
	echo "Ty, let's go!"
else
	echo "Ok. See you :-)"
	exit
fi
# Install MBROLA
echo "Downloading and building MBROLA..."
sudo apt update
sudo apt-get install git make gcc
if [ -d "MBROLA" ]; then
	echo "Cleaning up old MBROLA folder..."
	rm -rf MBROLA
fi
git clone https://github.com/numediart/MBROLA.git
cd MBROLA
make
sudo cp Bin/mbrola /usr/bin/mbrola
echo ""
echo "Downloading voices..."
mkdir -p "voices/de2"
wget -O voices/de2/de2 "https://github.com/numediart/MBROLA-voices/blob/master/data/de2/de2?raw=true"
mkdir -p "voices/de3"
wget -O voices/de3/de3 "https://github.com/numediart/MBROLA-voices/blob/master/data/de3/de3?raw=true"
mkdir -p "voices/de4"
wget -O voices/de4/de4 "https://github.com/numediart/MBROLA-voices/blob/master/data/de4/de4?raw=true"
mkdir -p "voices/de5"
wget -O voices/de5/de5 "https://github.com/numediart/MBROLA-voices/blob/master/data/de5/de5?raw=true"
mkdir -p "voices/de6"
wget -O voices/de6/de6 "https://github.com/numediart/MBROLA-voices/blob/master/data/de6/de6?raw=true"
mkdir -p "voices/de7"
wget -O voices/de7/de7 "https://github.com/numediart/MBROLA-voices/blob/master/data/de7/de7?raw=true"
mkdir -p "voices/en1"
wget -O voices/en1/en1 "https://github.com/numediart/MBROLA-voices/blob/master/data/en1/en1?raw=true"
echo "Copying voices to '/usr/share/mbrola/'..."
sudo mkdir -p "/usr/share/mbrola/"
sudo cp -r voices/* /usr/share/mbrola/
cd ..
#echo "Cleaning up ..."
#rm -rf "MBROLA"
echo "DONE."


#!/bin/sh
#SBATCH --job-name=py21cm
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --cpus-per-task=4
#SBATCH --ntasks-per-core=1

#SBATCH --account=Pra17_4382
#SBATCH --partition=gll_usr_prod
#SBATCH --time=2:00:00

#SBATCH --output=msg/data21cm-out.%j
#SBATCH --error=msg/data21cm-err.%j
#SBATCH --mail-type=ALL
#SBATCH --mail-user=<EMAIL>

#SBATCH --array=0-29
#SBATCH --error=msg/data21cm-err%A.%j

module load intel intelmpi
module load profile/base autoload python/3.6.4
module load profile/base autoload fftw
module load profile/base autoload gsl

export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}
export OMP_PLACES=cores  # pinning threads correctly

echo $SLURM_ARRAY_TASK_MAX
#DIR='./new_start'
DIR='/gpfs/scratch/userexternal/mbianco0/data3D_128_030920/'

if [ -d "$DIR" ]; then
    echo " Resume 21cmFast data..."
else
    echo " Create new 21cmFast data..."
    mkdir $DIR
    mkdir $DIR/data
    mkdir $DIR/images
    mkdir $DIR/parameters
fi

srun python create_data_21cmfast.py $DIR


<gh_stars>0
#!/bin/sh
# Copyright (c) 2019 Huawei Technologies Co., Ltd.
# A-Tune is licensed under the Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan PSL v2.
# You may obtain a copy of Mulan PSL v2 at:
#     http://license.coscl.org.cn/MulanPSL2
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
# PURPOSE.
# See the Mulan PSL v2 for more details.
# Create: 2019-10-29

lsmod | grep prefetch_tuning &> /dev/null
[ $? != 0 ] && echo "reset" && exit 0

policy=$(cat /sys/class/misc/prefetch/policy | awk '{print $2}'| sort -u)
case "$policy" in
	"15")
		echo "on"
		;;
	"0")
		echo "off"
		;;
	*)
		echo "reset"
		;;
esac

exit 0


<filename>loop/bash/tasks/observe.bash
#!/usr/bin/env bash

function process_observe() {
	local i update
    local updates=$(curl -s "${tele_url}/getUpdates")
    local count_update=$(echo $updates | jq -r ".result | length")

    for ((i=0; i<$count_update; i++)); do
        update=$(echo $updates | jq -r ".result[$i]")
        echo "$update\n"
    done
}


<gh_stars>1-10
#!/bin/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.
#

# source me

source $(cd -P -- "$(dirname -- "$0")" && pwd -P)/set-kylin-home.sh $@
verbose=${verbose:-""}

while getopts ":v" opt; do
    case $opt in
        v)
            echo "Turn on verbose mode." >&2
            verbose=true
            ;;
        \?)
            echo "Invalid option: -$OPTARG" >&2
            ;;
    esac
done

if [[ "$dir" == "" ]]
then
	dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P)

	# set KYLIN_HOME with consideration for multiple instances that are on the same node
	KYLIN_HOME=${KYLIN_HOME:-"${dir}/../"}
	export KYLIN_HOME=`cd "$KYLIN_HOME"; pwd`
	dir="$KYLIN_HOME/bin"

	function quit {
		echo "$@"
		exit 1
	}

	function verbose {
		if [[ -n "$verbose" ]]; then
			echo "$@"
		fi
	}

	function setColor() {
        echo -e "\033[$1m$2\033[0m"
    }
fi


export HUDSON_TRANSLATOR="/home/matzke/GS-CAD/ROSE/sources/lanlpop/_build/tests/testTranslator"
export HUDSON_NUM_JOBS=20
export HUDSON_FC="gfortran"
export HUDSON_FFLAGS="-ffree-line-length-0"
export HUDSON_LD="gfortran"
export HUDSON_CC="gcc"
export HUDSON_CXX="g++"
export HUDSON_Cp="cp"
export HUDSON_Cpp="cpp -P"
export HUDSON_AWK="awk"
export HUDSON_LDLIBS="\$(LIBS) -lcurl"
export HUDSON_DIFF=diff
export HUDSON_MAKE=make
export HUDSON_SED=sed


#!/bin/bash
#created :

# initialisasi var
export DEBIAN_FRONTEND=noninteractive
OS=`uname -m`;
MYIP=`ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0'`;
MYIP2="s/xxxxxxxxx/$MYIP/g";

# detail nama perusahaan
country=ID
state=Takengon
locality=Aceh Tengah
organization=hzrossh
organizationalunit=HzroSSH
commonname=hzrossh.site
email=<EMAIL>

# go to root
cd

# disable ipv6
echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6
sed -i '$ i\echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6' /etc/rc.local

# set time GMT +7 jakarta
ln -fs /usr/share/zoneinfo/Asia/Jakarta /etc/localtime

# set locale
sed -i 's/AcceptEnv/#AcceptEnv/g' /etc/ssh/sshd_config
/etc/init.d/ssh restart

# Edit file /etc/systemd/system/rc-local.service
cat > /etc/systemd/system/rc-local.service <<-END
[Unit]
Description=/etc/rc.local
ConditionPathExists=/etc/rc.local
[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99
[Install]
WantedBy=multi-user.target
END

# nano /etc/rc.local
cat > /etc/rc.local <<-END
#!/bin/sh -e
# rc.local
# By default this script does nothing.
exit 0
END

# Ubah izin akses
chmod +x /etc/rc.local

# enable rc local
systemctl enable rc-local
systemctl start rc-local.service

echo "=================  install neofetch  ===================="
echo "========================================================="
# install neofetch
apt-get update -y
apt-get -y install gcc
apt-get -y install make
apt-get -y install cmake
apt-get -y install git
apt-get -y install screen
apt-get -y install unzip
apt-get -y install curl
git clone https://github.com/dylanaraps/neofetch
cd neofetch
make install
make PREFIX=/usr/local install
make PREFIX=/boot/home/config/non-packaged install
make -i install
apt-get -y install neofetch
cd
echo "clear" >> .bashrc
echo "neofetch" >> .bashrc

# instal php5.6 ubuntu 16.04 64bit
apt-get -y update

# set repo webmin
#sh -c 'echo "deb http://download.webmin.com/download/repository sarge contrib" > /etc/apt/sources.list.d/webmin.list'
#wget -qO - http://www.webmin.com/jcameron-key.asc | apt-key add -

# setting port ssh
cd
sed -i '/Port 22/a Port 143' /etc/ssh/sshd_config
sed -i 's/#Port 22/Port 22/g' /etc/ssh/sshd_config
/etc/init.d/ssh restart

echo "================  install Dropbear ======================"
echo "========================================================="

# install dropbear
apt-get -y install dropbear
sed -i 's/NO_START=1/NO_START=0/g' /etc/default/dropbear
sed -i 's/DROPBEAR_PORT=22/DROPBEAR_PORT=180/g' /etc/default/dropbear
sed -i 's/DROPBEAR_EXTRA_ARGS=/DROPBEAR_EXTRA_ARGS="-p 110 "/g' /etc/default/dropbear
echo "/bin/false" >> /etc/shells
echo "/usr/sbin/nologin" >> /etc/shells
/etc/init.d/ssh restart
/etc/init.d/dropbear restart

echo "=================  install Squid3  ======================"
echo "========================================================="

# setting dan install vnstat debian 9 64bit
apt-get -y install vnstat
systemctl start vnstat
systemctl enable vnstat
chkconfig vnstat on
chown -R vnstat:vnstat /var/lib/vnstat

# install squid3
cd
apt-get -y install squid3
wget -O /etc/squid/squid.conf "https://auto.hzrossh.com/squid3.conf"
sed -i $MYIP2 /etc/squid/squid.conf;
/etc/init.d/squid restart

echo "=================  install Webmin  ======================"
echo "========================================================="

# install webmin
cd
wget http://prdownloads.sourceforge.net/webadmin/webmin_1.910_all.deb
dpkg --install webmin_1.910_all.deb;
apt-get -y -f install;
sed -i 's/ssl=1/ssl=0/g' /etc/webmin/miniserv.conf
rm -f webmin_1.910_all.deb
/etc/init.d/webmin restart

echo "=================  install Lolcat  ======================"
echo "========================================================="

apt-get -y install ruby
gem install lolcat

echo "=================  install stunnel  ====================="
echo "========================================================="

# install stunnel
apt-get install stunnel4 -y
cat > /etc/stunnel/stunnel.conf <<-END
cert = /etc/stunnel/stunnel.pem
client = no
socket = a:SO_REUSEADDR=1
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
[dropbear]
accept = 222
connect = 127.0.0.1:22
[dropbear]
accept = 442
connect = 127.0.0.1:180
[dropbear]
accept = 777
connect = 127.0.0.1:110

END

echo "=================  membuat Sertifikat OpenSSL ======================"
echo "========================================================="
#membuat sertifikat
openssl genrsa -out key.pem 2048
openssl req -new -x509 -key key.pem -out cert.pem -days 1095 \
-subj "/C=$country/ST=$state/L=$locality/O=$organization/OU=$organizationalunit/CN=$commonname/emailAddress=$email"
cat key.pem cert.pem >> /etc/stunnel/stunnel.pem

# konfigurasi stunnel
sed -i 's/ENABLED=0/ENABLED=1/g' /etc/default/stunnel4
/etc/init.d/stunnel4 restart

# common password debian
wget -O /etc/pam.d/common-password "https://auto.hzrossh.com/common-password-deb9"
chmod +x /etc/pam.d/common-password

#instal sslh
cd
apt-get -y install sslh

#configurasi sslh
wget -O /etc/default/sslh "https://auto.hzrossh.com/sslh-conf"
service sslh restart

echo "================= Install PPTP  ======================"
apt-get -y install pptpd
cat > /etc/ppp/pptpd-options <<END
name pptpd
refuse-pap
refuse-chap
refuse-mschap
require-mschap-v2
require-mppe-128
ms-dns 8.8.8.8
ms-dns 8.8.4.4
proxyarp
nodefaultroute
lock
nobsdcomp
END
echo "option /etc/ppp/pptpd-options" > /etc/pptpd.conf
echo "logwtmp" >> /etc/pptpd.conf
echo "localip 10.1.0.1" >> /etc/pptpd.conf
echo "remoteip 10.1.0.5-100" >> /etc/pptpd.conf
cat >> /etc/ppp/ip-up <<END
ifconfig ppp0 mtu 1400
END
mkdir /var/lib/queenssh
/etc/init.d/pptpd restart

echo "=================  Install badVPn (VC and Game) ======================"
echo "========================================================="

# buat directory badvpn

echo "================= Disable badVPN V 1  ======================"
#cd /usr/bin
#mkdir build
#cd /usr/bin/build
#wget https://github.com/idtunnel/sshtunnel/raw/main/debian9/badvpn/badvpn-update.zip
#unzip badvpn-update
#cmake -DBUILD_NOTHING_BY_DEFAULT=1 -DBUILD_TUN2SOCKS=1 -DBUILD_UDPGW=1
#make install
#make -i install

# aut start badvpn
#sed -i '$ i\screen -AmdS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7300 > /dev/null &' /etc/rc.local
#screen -AmdS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7300 > /dev/null &
cd
#cd /usr/bin/build

#sed -i '$ i\screen -AmdS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7200 > /dev/null &' /etc/rc.local#
#screen -AmdS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7200 > /dev/null &
#auto badvpn

# set permition rc.local badvpn
#chmod +x /usr/local/bin/badvpn-udpgw
#chmod +x /usr/local/share/man/man7/badvpn.7
#chmod +x /usr/local/bin/badvpn-tun2socks
#chmod +x /usr/local/share/man/man8/badvpn-tun2socks.8
#chmod +x /etc/rc.local
#chmod +x /usr/bin/build

echo "================= Auto Installer Disable badVPN V 2  ======================"
#wget https://raw.githubusercontent.com/idtunnel/UDPGW-SSH/main/badudp2.sh
#chmod +x badudp2.sh
#bash badudp2.sh

echo "================= Auto Installer Disable badVPN V 3  ======================"
# buat directory badvpn
cd /usr/bin
mkdir build
cd build
wget https://github.com/ambrop72/badvpn/archive/1.999.130.tar.gz
tar xvzf 1.999.130.tar.gz
cd badvpn-1.999.130
cmake -DBUILD_NOTHING_BY_DEFAULT=1 -DBUILD_TUN2SOCKS=1 -DBUILD_UDPGW=1
make install
make -i install

# auto start badvpn single port
sed -i '$ i\screen -AmdS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7200 --max-clients 1000 --max-connections-for-client 10' /etc/rc.local
screen -AmdS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7200 --max-clients 500 --max-connections-for-client 20 &
cd

# auto start badvpn second port
#cd /usr/bin/build/badvpn-1.999.130
sed -i '$ i\screen -AmdS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7300 --max-clients 1000 --max-connections-for-client 10' /etc/rc.local
screen -AmdS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7300 --max-clients 500 --max-connections-for-client 20 &
cd

# auto start badvpn second port
sed -i '$ i\screen -AmdS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7400 --max-clients 1000 --max-connections-for-client 10' /etc/rc.local
screen -AmdS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7400 --max-clients 500 --max-connections-for-client 20 &
cd

# permition
chmod +x /usr/local/bin/badvpn-udpgw
chmod +x /usr/local/share/man/man7/badvpn.7
chmod +x /usr/local/bin/badvpn-tun2socks
chmod +x /usr/local/share/man/man8/badvpn-tun2socks.8
chmod +x /usr/bin/build
chmod +x /etc/rc.local

# Custom Banner SSH
wget -O /etc/issue.net "https://auto.hzrossh.com/issue.net"
chmod +x /etc/issue.net

echo "Banner /etc/issue.net" >> /etc/ssh/sshd_config
echo "DROPBEAR_BANNER="/etc/issue.net"" >> /etc/default/dropbear

# install fail2ban
apt-get -y install fail2ban
service fail2ban restart

# Instal DDOS Flate
if [ -d '/usr/local/ddos' ]; then
	echo; echo; echo "Please un-install the previous version first"
	exit 0
else
	mkdir /usr/local/ddos
fi
clear
echo; echo 'Installing DOS-Deflate 0.6'; echo
echo; echo -n 'Downloading source files...'
wget -q -O /usr/local/ddos/ddos.conf http://www.inetbase.com/scripts/ddos/ddos.conf
echo -n '.'
wget -q -O /usr/local/ddos/LICENSE http://www.inetbase.com/scripts/ddos/LICENSE
echo -n '.'
wget -q -O /usr/local/ddos/ignore.ip.list http://www.inetbase.com/scripts/ddos/ignore.ip.list
echo -n '.'
wget -q -O /usr/local/ddos/ddos.sh http://www.inetbase.com/scripts/ddos/ddos.sh
chmod 0755 /usr/local/ddos/ddos.sh
cp -s /usr/local/ddos/ddos.sh /usr/local/sbin/ddos
echo '...done'
echo; echo -n 'Creating cron to run script every minute.....(Default setting)'
/usr/local/ddos/ddos.sh --cron > /dev/null 2>&1
echo '.....done'
echo; echo 'Installation has completed.'
echo 'Config file is at /usr/local/ddos/ddos.conf'
echo 'Please send in your comments and/or suggestions to <EMAIL>'

# download script
cd /usr/bin
wget -O menu "https://auto.hzrossh.com/menu.sh"
wget -O usernew "https://auto.hzrossh.com/usernew.sh"
wget -O trial "https://auto.hzrossh.com/trial.sh"
wget -O hapus "https://auto.hzrossh.com/hapus.sh"
wget -O cek "https://auto.hzrossh.com/user-login.sh"
wget -O member "https://auto.hzrossh.com/user-list.sh"
wget -O jurus69 "https://auto.hzrossh.com/restart.sh"
wget -O speedtest "https://auto.hzrossh.com/speedtest_cli.py"
wget -O info "https://auto.hzrossh.com/info.sh"
wget -O about "https://auto.hzrossh.com/about.sh"
wget -O delete "https://auto.hzrossh.com/delete.sh"
wget -O renew "https://auto.hzrossh.com/renew"
wget -O pass "https://auto.hzrossh.com/cekpass"

wget -O pptp "https://auto.hzrossh.com/add-pptp.sh"
wget -O delete-pptp "https://auto.hzrossh.com/delete-pptp.sh"
wget -O alluser-pptp "https://auto.hzrossh.com/alluser-pptp.py"
wget -O login-pptp "https://auto.hzrossh.com/login-pptp.sh"
wget -O expire-pptp "https://auto.hzrossh.com/expire-pptp.sh"
wget -O detail-pptp "https://auto.hzrossh.com/detail-pptp.sh"

echo "0 0 * * * root /usr/bin/expire-pptp" > /etc/cron.d/expire-pptp
echo "0 0 * * * root /sbin/reboot" > /etc/cron.d/reboot

chmod +x menu
chmod +x usernew
chmod +x pptp
chmod +x delete-pptp
chmod +x alluser-pptp
chmod +x login-pptp
chmod +x expire-pptp
chmod +x detail-pptp
chmod +x trial
chmod +x hapus
chmod +x cek
chmod +x member
chmod +x jurus69
chmod +x speedtest
chmod +x info
chmod +x about
chmod +x delete
chmod +x renew
chmod +x pass

cd
echo "================  install OPENVPN ======================"
echo "========================================================="
#install openvpn debian 9 ( openvpn port 1194 dan 443 )
#wget https://auto.hzrossh.com/openvpn.sh && chmod +x openvpn.sh && bash openvpn.sh

# finishing
cd
chown -R www-data:www-data /home/vps/public_html
/etc/init.d/ssh restart
/etc/init.d/dropbear restart
/etc/init.d/stunnel4 restart
service squid restart
service pptpd restart
/etc/init.d/nginx restart
/etc/init.d/openvpn restart
cd
# auto Delete Acount SSH Expired
#wget -O /usr/local/bin/userdelexpired "https://www.dropbox.com/s/cwe64ztqk8w622u/userdelexpired?dl=1" && chmod +x /usr/local/bin/userdelexpired

rm -rf ~/.bash_history && history -c
echo "unset HISTFILE" >> /etc/profile

# info
clear
echo "Autoscript Include:" | tee log-install.txt
echo "===========================================" | tee -a log-install.txt
echo ""  | tee -a log-install.txt
echo "Service"  | tee -a log-install.txt
echo "-------"  | tee -a log-install.txt
echo "OpenSSH   : 22,143"  | tee -a log-install.txt
echo "Dropbear  : 180,110"  | tee -a log-install.txt
echo "SSL       : 442,443"  | tee -a log-install.txt
echo "Squid3    : 80,8080,3128 (limit to IP SSH)"  | tee -a log-install.txt
echo "badvpn    : badvpn-udpgw port 7300"  | tee -a log-install.txt
echo "nginx     : 81"  | tee -a log-install.txt
echo ""  | tee -a log-install.txt
echo "Script"  | tee -a log-install.txt
echo "------"  | tee -a log-install.txt
echo "menu      : Menampilkan daftar perintah yang tersedia"  | tee -a log-install.txt
echo "usernew   : Membuat Akun SSH"  | tee -a log-install.txt
echo "trial     : Membuat Akun Trial"  | tee -a log-install.txt
echo "hapus     : Menghapus Akun SSH"  | tee -a log-install.txt
echo "cek       : Cek User Login"  | tee -a log-install.txt
echo "member    : Cek Member SSH"  | tee -a log-install.txt
echo "jurus69   : Restart Service dropbear, squid3, stunnel4, vpn, ssh)"  | tee -a log-install.txt
echo "reboot    : Reboot VPS"  | tee -a log-install.txt
echo "speedtest : Speedtest VPS"  | tee -a log-install.txt
echo "info      : Menampilkan Informasi Sistem"  | tee -a log-install.txt
echo "delete    : auto Delete user expired"  | tee -a log-install.txt
echo "about     : Informasi tentang script auto install"  | tee -a log-install.txt
echo ""  | tee -a log-install.txt

echo "Fitur lain"  | tee -a log-install.txt
echo "----------"  | tee -a log-install.txt
echo "Timezone  : Asia/Jakarta (GMT +7)"  | tee -a log-install.txt
echo "IPv6      : [off]"  | tee -a log-install.txt
echo ""  | tee -a log-install.txt
echo "Modified by hidessh"  | tee -a log-install.txt
echo ""  | tee -a log-install.txt
echo "Log Instalasi --> /root/log-install.txt"  | tee -a log-install.txt
echo ""  | tee -a log-install.txt
echo "VPS AUTO REBOOT TIAP JAM 12 MALAM"  | tee -a log-install.txt
echo ""  | tee -a log-install.txt
echo "==========================================="  | tee -a log-install.txt

rm -f /root/openssh.sh

#echo "==================== Restart Service ===================="
#echo "========================================================="
#/etc/init.d/ssh restart
#/etc/init.d/dropbear restart
#/etc/init.d/stunnel4 restart
#/etc/init.d/squid restart
#/etc/init.d/nginx restart
#/etc/init.d/php5.6-fpm restart
#/etc/init.d/openvpn restart

# Delete script
#rm -f /root/openvpn.sh


#!/bin/bash

cd buildkit

sudo buildctl build  \
    --frontend=dockerfile.v0 --local context=. --local dockerfile=. \
    --opt filename=./frontend/dockerfile/cmd/dockerfile-frontend/Dockerfile \
    --opt platform=linux/amd64 --opt build-arg:CHANNEL=experimental \
    --opt "build-arg:BUILDTAGS=`cat frontend/dockerfile/release/experimental/tags`" \
    --output type=docker,name=mydf/mydockerfile:1 | docker load


<reponame>brendonmatheson/piups_exporter
#!/bin/bash

# piups_exporter
# Copyright (c) 2021, <NAME>
#
# http://brendonmatheson.com/
#
# This work is offered under the terms of the MIT license.  See the LICENSE file for details.

sudo docker-compose up -d


<gh_stars>10-100
#!/usr/bin/env bash

echo "Starting slave"
sh $1/jmeter-server > /slave_output &
touch /master_logs /result
tail -f /slave_output /master_logs /result


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

maxMAP=0.8
minTruePos=5
GPU=3
LR=1e-3

for step in 1 2
do
    for LRDNI in 1e-4 2e-4 5e-4
    do
        for NEIGH in 100 200 300 400 500
        do

        python train_ssr.py --gpu $GPU --lr $LR --lr-dni $LRDNI --nNeigh $NEIGH --maxMAP $maxMAP --minTruePos $minTruePos --nStep $step

        done
    done
done


<gh_stars>0
#! /bin/bash

# this script is supposed to be run by crontab
#4 */3 * * * /home/root/backup.sh &

# set pipefail
set -o pipefail

# check if backup job is already running
BK_PROC=`ps -u root | grep 'usb_backup -a mycloud2easyshar -c jobrun' | grep -v 'grep'`

EXIT_CODE=$?

# check if backup process is running
if [ $EXIT_CODE -eq 0 ]
then
	unset EXIT_CODE

	# it  was running, now report and quit

	# get the pid
	BK_PROC=`printf "%s" "${BK_PROC}" | sed -r 's/ +/ /g' | sed -r 's/^ //' | cut -d ' ' -f 1`

	# display a message
	printf "%s\t%s\n" `date '+%Y%m%d-%H:%M:%S'` "Backup was already running (pid: ${BK_PROC})." >> "/home/root/backups.log"

else
	unset EXIT_CODE

	# It wasn't running, now report and run
	printf "%s\t%s\n" `date '+%Y%m%d-%H:%M:%S'` "Backup started." >> "/home/root/backups.log"

	# run the backup
	(usb_backup -a mycloud2easyshar -c jobrun &)

fi

# set pipefail back to normal
set +o pipefail

# make sure the job is still on cron
CRON_FILE="/var/spool/cron/crontabs/root"
cat /var/spool/cron/crontabs/root | grep '/home/root/backup.sh' &> /dev/null
if [ $? -ne 0 ]
then
	TMP=/tmp/$$
	cat /var/spool/cron/crontabs/root > "${TMP}"
	printf "%s\n" '4 */3 * * * /home/root/backup.sh &' >> "${TMP}"
	crontab "${TMP}"
	rm -f "${TMP}"
fi

# exit
exit 0


#!/bin/bash
set -e

echo "Commit generated documentation"
git config --global user.email "<EMAIL>"
git config --global user.name "<NAME>"
git config --global push.default simple
echo "Checkout current branch $TRAVIS_BRANCH"
git checkout $TRAVIS_BRANCH
echo "Configure remote"
git remote set-url origin https://${CONNECT_GITHUB_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git > /dev/null 2>&1
echo "Fetching tags from remote"
git fetch --tags
echo "Get version from package.json"
export GIT_TAG=v$(node -p "require('./package.json').version")
echo "Stage generated docs"
git add .
echo "Commit docs"
git commit -m "[ci skip] Documentation generated for release $GIT_TAG"
echo "Push docs commit"
git push origin $TRAVIS_BRANCH
CHECK_TAG=$(git tag -l "$GIT_TAG")
if [ "$CHECK_TAG" != "$GIT_TAG" ]; then
    echo "Create tag $GIT_TAG"
    git tag -a $GIT_TAG -m "Generated tag from build"
    echo "Tag $GIT_TAG added"
    git push origin $TRAVIS_BRANCH --tags
else
    echo "Tag $GIT_TAG already exists!"
fi
echo "Done for version $GIT_TAG!"


#!/bin/bash

cd

if [ -f ~/stackrc ]; then
   source ~/stackrc
else
   echo "File ~/stackrc not found"
   exit
fi

if [ -f ~/instackenv.json ]; then
   echo Using ~/instackenv.json
else
   echo "File ~/instackenv.json not found"
   exit
fi

# cleanup old nodes
for i in $(openstack baremetal node list -f value -c UUID) ; do
  openstack baremetal node delete $i || true
done

# import overcloud configuration
openstack overcloud node import ~/instackenv.json
openstack baremetal node list
for i in {1..3} ; do
   openstack overcloud node introspect --all-manageable --provide
   if ! openstack baremetal node list 2>&1 | grep -q 'manageable' ; then
      break
   fi
   sleep 5
done

openstack baremetal node list


#!/bin/bash

echo "alias clisaurus='python `pwd`/clisaurus.py'" >> $HOME/.bash_aliases
. $HOME/.bash_aliases


<gh_stars>100-1000
#!/bin/bash -e

./libtool --mode=execute --  \
    gdb -ex 'handle SIGALRM noprint nostop nopass' --args $*


<filename>certs/scripts/decrypt-cassandra-server-key.sh
#!/bin/sh
echo Generating decrypted version of the cassandra client/server key
openssl rsa -passin <PASSWORD>:<PASSWORD> -in cassandraserverkey.pem -out cassandraserverkey_dec.pem


#!/bin/sh
PROG_PATH=/usr/share/adbyby
err=0
until [ $err -ge 5 ]; do
	if [ -n "$(pgrep $PROG_PATH/adbyby)" ]; then
		iptables-save | grep ADBYBY >/dev/null || \
		/etc/init.d/adbyby add_rule
		sleep 10
		err=0
	else
		$PROG_PATH/adbyby --no-daemon &>/dev/null &
		sleep 1
		err=$((err+1))
	fi
done
/etc/init.d/adbyby del_rule


<reponame>masual/docker-zeek<gh_stars>10-100
#!/bin/bash

# clean up
rm /tmp/kafka.out || true

echo "===> Starting kafka..."
docker run -d --name kafka \
           -p 9092:9092 \
           -e KAFKA_ADVERTISED_HOST_NAME=localhost \
           -e KAFKA_CREATE_TOPICS=zeek:1:1 \
           blacktop/kafka:1.1

sleep 10
echo "===> Starting kafka consumer..."
kafka-console-consumer --brokers=localhost:9092 --topic=zeek | tee -a /tmp/kafka.out &

echo "===> Starting zeek..."
docker run --rm \
           --link kafka:localhost \
           -v `pwd`/pcap:/pcap \
           blacktop/zeek:kafka -F -r heartbleed.pcap local "Site::local_nets += { 192.168.11.0/24 }"

# sleep 10
# echo "===> Starting kafka consumer..."
# docker run --rm --link kafka:localhost ktools

cat /tmp/kafka.out | grep 'Value:' | cut -d ':' -f 2- | jq 'select(.notice != null) | .notice.note'


#!/usr/bin/env bash

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

cd "$DIR/.."

license-checker --production  --failOn "GPL" > licenses.txt


#!/bin/sh
export WINEPREFIX=$HOME/.wine
GAMEPATH=$WINEPREFIX/drive_c/Program\ Files\ \(x86\)/Sony/EverQuest
P99FILE=P99Files55.zip

# Renaming files
mv -v "${GAMEPATH}/Resources/loadscreen.JPG" "${GAMEPATH}/Resources/loadscreen.jpg"
mv -v "${GAMEPATH}/DSETUP.dll" "${GAMEPATH}/dsetup.dll"

# Move post Velious musics in a new folder
cd "${GAMEPATH}"
mkdir -v post-velious-musics
mv -v eqtheme.mp3 combattheme1.mp3 combattheme2.mp3 deaththeme.mp3 -t post-velious-musics

# Patching the game for Project1999
wget https://www.project1999.com/files/${P99FILE}
unzip -fov ${P99FILE} -d "${GAMEPATH}"
rm -vf ${P99FILE}

# compiling p99-login-middlemand and rewriting eqhost.txt to use it
git submodule init
git submodule update
make -C ./p99-login-middlemand
echo -e "[LoginServer]\nHost=localhost:5998" > ${GAMEPATH}/eqhost.txt

# Cool ascii-art because why not ?
echo -e "\n\033[0;36m _____           _         _   ___   ___ ___ ___ \033[0m"
echo -e   "\033[0;36m|  _  |___ ___  |_|___ ___| |_|_  | | . | . | . |\033[0m"
echo -e   "\033[0;36m|   __|  _| . | | | -_|  _|  _|_| |_|_  |_  |_  |\033[0m"
echo -e   "\033[0;36m|__|  |_| |___|_| |___|___|_| |_____|___|___|___|\033[0m"
echo -e   "\033[0;36m              |___|\033[0m"
echo -e "\n\033[0;32mDONE !\033[0m"


#!/bin/bash

set -o nounset
set -o errexit
set -o pipefail

cat >> "${SHARED_DIR}/install-config.yaml" << EOF
networking:
  networkType: None
EOF


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

(/bin/busybox kill -STOP $$; /bin/busybox kill -CONT $$)
# Include File check
if [ -f /etc/device.properties ];then
    . /etc/device.properties
fi

if [ -f /lib/rdk/t2Shared_api.sh ]; then
    source /lib/rdk/t2Shared_api.sh
fi

LOG_INPUT=ipSetupLogs.txt
if [ ! "$LOG_PATH" ];then LOG_PATH=/opt/logs/; fi
LOG_FILE=$LOG_PATH/$LOG_INPUT

# Input Arguments - $1 event - $2 ipaddress type - $3 interface name - $4 ipaddress - $5 ipaddress scope
cmd=$1
flags=$5
printf "`/bin/timestamp` $0: Input Parameters : $* \n" >> $LOG_FILE
if [ "x$cmd" == "xadd" ] && [ "x$flags" == "xglobal" ]; then
    # Debug Logs regarding the Network Informations
    printf "`/bin/timestamp` $0: IP Informations\n `ifconfig` \n" >> $LOG_FILE
    wifiMac=`grep 'wifi_mac=' /tmp/.deviceDetails.cache | sed -e "s/wifi_mac=//g"`
    t2ValNotify "Xi_wifiMAC_split" "$wifiMac"
    printf "`/bin/timestamp` $0: Route Informations\n `route -n` \n" >> $LOG_FILE
    printf "`/bin/timestamp` $0: DNS Servers Informations" >> $LOG_FILE
    printf "`/bin/timestamp` $0: DNS Masq File: /etc/resolv.dnsmasq\n `cat /etc/resolv.dnsmasq`\n" >> $LOG_FILE
    printf "`/bin/timestamp` $0: DNS Resolve: /etc/resolv.conf\n `cat /etc/resolv.conf`\n" >> $LOG_FILE
fi
exit 0


#!/bin/bash
# This script is for the distribution of AEBL framework channel content
#
# Copyright (C) 2016 - 2017 <NAME>., <NAME>
#
# Useage, from master control:
# mosquitto_pub -d -t aebl/aebltst0/add -m "winnipeg%20food%20video.mp4" -h "ihdn.ca"
#
# For certain functions, use case:
#
#
# mosquitto_sub -h fd00:c2b6:b24b:be67:2827:688d:e6a1:6a3b -t "hello/+" -t "aebl/+" -t "ihdn/+" -t "uvea/+" |
# while IFS= read -r line
#     do
#           if [[ $line = "sixxs alive" ]]; then
#               echo "$(date +"%T") - sixxs ACK"
#               echo " "
#           fi
#           if [[ $line == *"ihdnsrvr IPv6"* ]]; then
#               echo "$(date +"%T") - ihdnsrvr ACK"
#               echo "$line"
#               echo " "
#           fi
#           if [[ $line == *"played"* ]]; then
#               echo "$(date +"%T") - play log"
#               echo "$line"
#               echo " "
#           fi
#
# done
#
# And use AEBL playlist.sh and process_playlist.sh for example code
#  to process files
# For determining what content, should eventually be able to parse
#  a upload directory for playlists as well as files and then move
#  those files to download dir and notify specific client(s) of
#  availability.
# This can also be used in order to send URL for streamed content
#
# This could also use the current vpn that exists for the noo-ebs functionality

# This will require that mkchan.sh works

# i="0"

# while [ $i -lt 1 ]
# do
#     mosquitto_sub -h uveais.ca -t -t "aebl/#" -t "uvea/#" |
#     while IFS= read -r line
#         do
#           if [[ $line = "sixxs alive" ]]; then
#               echo "$(date +"%T") - sixxs ACK"
#               echo " "
#           fi
#           if [[ $line == *"ihdnsrvr IPv6"* ]]; then
#               echo "$(date +"%T") - ihdnsrvr ACK"
#               echo "$line"
#               echo " "
#           fi
#           if [[ $line == *"played"* ]]; then
#               echo "$(date +"%T") - play log"
#               echo "$line"
#               echo " "
#           fi
#
#         done

# ext_ip4=$(dig +short myip.opendns.com @resolver1.opendns.com)
# ext_ip6=$(curl icanhazip.com)
# mosquitto_pub -d -t hello/world -m "$(date) : irot LdB, online. IP is $ext_ip" -h "uveais.ca"
# mosquitto_pub -d -t uvea/alive -m "$(date) : $hostn server IP $ext_ip is online." -h "fc00:db20:35b:7399::5"
# mosquitto_pub -d -t uvea/alive -m "$(date) : $hostn IPv4 $ext_ip4 is online." -h "fd00:c2b6:b24b:be67:2827:688d:e6a1:6a3b"
# mosquitto_pub -d -t aebl/alive -m "$(date) : $hostn IPv6 $ext_ip6 is online." -h "fd00:c2b6:b24b:be67:2827:688d:e6a1:6a3b"
# mosquitto_pub -d -t uvea/alive -m "$(date) : $hostn IPv4 $ext_ip4 is online." -h "ihdn.ca"
# mosquitto_pub -d -t aebl/alive -m "$(date) : $hostn IPv6 $ext_ip6 is online." -h "uveais.ca"
# i=$[$i+1]
# sleep 300
# done

hostn=$(cat /etc/hostname)

# Use $hostn to watch for new content
mosquitto_sub -h "ihdn.ca" -t "aebl/$hostn/add" |
while IFS= read -r line
    do
#           if [[ $line = "sixxs alive" ]]; then
#               echo "$(date +"%T") - sixxs ACK"
#               echo " "
#           fi
#           if [[ $line == *"ihdnsrvr IPv6"* ]]; then
#               echo "$(date +"%T") - ihdnsrvr ACK"
#               echo "$line"
#               echo " "
#           fi
#

            # Append file to playlist
#             echo "$line #am2p" >> "${CONTENT}"

#           if [[ $line = "sixxs alive" ]]; then
#               echo "$(date +"%T") - sixxs ACK"
#               echo " "
#           fi

            # grab file
#             echo "$line #am2p" >> "${CONTENT}"

#           could test by putting content into ctrl directory
#           could also pass/receive full URI rather than just file, specifically for AEBL
#             wget -N -nd -w 3 -P /home/pi/ad --limit-rate=50k "http://ihdn.ca/ads/${line}"
            mosquitto_pub -d -t aebl/$hostn -m "$(date) : $(cat /etc/hostname) getting $line." -h "ihdn.ca" &
            wget -N -nd -w 3 -P /home/pi/ctrl --limit-rate=50k "http://ihdn.ca/ads/${line}"
            mosquitto_pub -d -t aebl/$hostn -m "$(date) : $(cat /etc/hostname) received $line." -h "ihdn.ca" &
#           should also update pl after new file add
#           oh, and should also create script for removing content

done

exit 0


#!/bin/bash -e
export DISPLAY=:20
Xvfb :20 -screen 0 1366x768x16 &
x11vnc -passwd TestVNC -display :20 -N -forever &
echo "Executing command $@"
exec "$@"


#!/bin/sh

mkdir -p ~/.config/sxhkd
ln -sf skhdrc_mac ~/.config/sxhkd/sxhkdrc


#!/bin/bash
#
# script which is run by the CI build (after `yarn test`).
#
# clones element-web develop and runs the tests against our version of react-sdk.

set -ev

handle_error() {
    EXIT_CODE=$?
    exit $EXIT_CODE
}

trap 'handle_error' ERR

echo "--- Building Element"
scripts/ci/layered.sh
cd element-web
element_web_dir=`pwd`
CI_PACKAGE=true yarn build
cd ..
# run end to end tests
pushd test/end-to-end-tests
ln -s $element_web_dir element/element-web
# PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true ./install.sh
# CHROME_PATH=$(which google-chrome-stable) ./run.sh
echo "--- Install synapse & other dependencies"
./install.sh
# install static webserver to server symlinked local copy of element
./element/install-webserver.sh
rm -r logs || true
mkdir logs
echo "+++ Running end-to-end tests"
TESTS_STARTED=1
./run.sh --no-sandbox --log-directory logs/
popd


# The options here are meant to be changed for minimizing latency issues. The
# only preset we have is wifi_mode, which works more or less, but will need
# tuning for other networks. All other master and slave netjack2 related
# options are hard-coded in the functions used in the main script.
set_opts(){
    local wifi_mode=$1
    if $wifi_mode; then
        remote_opts="-r"
        local_opts="-r"
        remote_driver_opts="--nperiods 2 --period 1024"
        local_driver_opts="-l1"
    else
        remote_opts="-R"
        local_opts="-S -R"
        remote_driver_opts="--nperiods 2 --period 512"
        local_driver_opts="-l1"
    fi
}

log_fn=/tmp/jack.log
# send stderr and stdout into the wild blue yonder, will be replaced with
# $log_fn when debug=true
log=/dev/null

# Hard-code the remote (master) hostname and our soundcard over there. If
# needed, add CLI flags for that or a config file, but .. really just hack
# these two lines.
remote=raspi
remote_device="hw:sndrpihifiberry"

# To avoid awkward gymnastics in checkopt ($# changes if any of the input args
# is an empty string), we define a None/null/nil value here that is not the
# empty string. Yes this tool should be written in another language.
none="::"

# B/c of quoting foo, use
#   eval $ssh_cmd [rest of ssh cmd line]
ssh_cmd="ssh -o ConnectTimeout=2 -T $remote"