<reponame>Episodio1/warp-engine
#!/bin/bash

    # IMPORT HELP

    . "$PROJECTPATH/.warp/bin/volume_help.sh"

function volume_command()
{

    if [ "$1" = "-h" ] || [ "$1" = "--help" ]
    then
        volume_help_usage
        exit 1
    fi;

    if [ $(warp_check_is_running) = true ]; then
        warp_message_error "The containers are running"
        warp_message_error "please, first run warp stop --hard"

        exit 1;
    fi

    case "$1" in
        php)
            warp_message "stopping data from volume php"
            warp docker stop php
            warp docker kill php
            warp_message "removing data from volume php"
            docker volume rm ${PWD##*/}_${PWD##*/}-volume-sync
        ;;

        mysql)
            warp_message "stopping data from volume mysql"
            warp docker stop mysql
            warp docker kill mysql
            warp_message "removing data from volume mysql"
            docker volume rm ${PWD##*/}_${PWD##*/}-volume-db
        ;;

        *)
            warp_message_warn "Please specify either 'php', 'mysql' as an argument"
        ;;
    esac
}

function volume_main()
{
    case "$1" in
        --rm)
            shift 1
            volume_command $*
        ;;

        *)
            volume_help_usage
        ;;
    esac
}


# conventional-changelog -p angular -i CHANGELOG.md -w -r -s 0
conventional-changelog -p angular -i CHANGELOG.md -s


<filename>scripts/format.sh<gh_stars>1-10
cd "$BUILD_WORKING_DIRECTORY"
clang-format -i $(find engine/ -iname '*.cc')
clang-format -i $(find engine/ -iname '*.hh')


#!/bin/sh

xdg-icon-resource install --context mimetypes --size 48 jhipster.png x-application-jdlstudio


#!/usr/bin/env bash

apt-get update
apt-get install -y git \
                    nodejs npm nodejs-legacy
                    # zip \

# Install command line grunt globaly
npm install -g grunt-cli bower

# Install sass
# gem install sass

# echo "You've been provisioned"
# date > /etc/vagrant_provisioned_at


<reponame>alex-santiago/inforlube-template-framework-ui
#! /bin/bash

clear
if [ ! "$1" ]; then
  echo "Missing parameter: directory path to copy files."
  exit
fi

if [ ! -d "../$1" ]; then
  echo "Informed directory path does not exist."
  exit
fi

DESTINATION="../$1"

echo "Updating template files in destination directory: $DESTINATION"
echo
echo "Checking directory structure:"
if [ ! -d "$DESTINATION/css" ]; then
  echo " - Creating directory: /css"; mkdir "$DESTINATION/css"
fi
if [ ! -d "$DESTINATION/images" ]; then
  echo " - Creating directory: /images"; mkdir "$DESTINATION/images"
fi
if [ ! -d "$DESTINATION/js" ]; then
  echo " - Creating directory: /js"; mkdir "$DESTINATION/js"
fi
if [ ! -d "$DESTINATION/js/framework/configuration" ]; then
  echo " - Creating directory: /js/framework/configuration"; mkdir "$DESTINATION/js/framework/configuration"
fi
if [ ! -d "$DESTINATION/js/framework/language" ]; then
  echo " - Creating directory: /js/framework/language"; mkdir "$DESTINATION/js/framework/language"
fi
if [ ! -d "$DESTINATION/plugins" ]; then
  echo " - Creating directory: /plugins"; mkdir "$DESTINATION/plugins"
fi
# if [ ! -d "$DESTINATION/js/website-initialization" ]; then
#   echo " - Creating directory: /js/website-initialization"; mkdir "$DESTINATION/js/website-initialization"
# fi
if [ ! -d "$DESTINATION/scss" ]; then
  echo " - Creating directory: /scss"; mkdir "$DESTINATION/scss"
fi
if [ ! -d "$DESTINATION/scss/navbar" ]; then
  echo " - Creating directory: /scss/navbar"; mkdir "$DESTINATION/scss/navbar"
fi
if [ ! -d "$DESTINATION/support" ]; then
  echo " - Creating directory: /support"; mkdir "$DESTINATION/support"
fi
if [ ! -d "$DESTINATION/tags" ]; then
  echo " - Creating directory: /tags"; mkdir "$DESTINATION/tags"
fi
if [ ! -d "$DESTINATION/tags/wire-frame" ]; then
  echo " - Creating directory: /tags/wire-frame"; mkdir "$DESTINATION/tags/wire-frame"
fi
echo "Directory checking done."
echo
echo "Starting to copy files:"
echo "Copying Default CSS"
echo "./css/styles.css" "$DESTINATION/css/"
cp -a "./css/styles.css" "$DESTINATION/css/"
echo "./css/custom.css" "$DESTINATION/css/"
cp -np "./css/custom.css" "$DESTINATION/css/"
echo
echo "Copying Default images"
echo "./images" "$DESTINATION"
cp -a "./images" "$DESTINATION"
echo
echo "Copying Default js"
echo " - Configuration files"
echo "./js/framework/configuration/controllers.js" "$DESTINATION/js/framework/configuration/"
cp -np "./js/framework/configuration/controllers.js" "$DESTINATION/js/framework/configuration/"
echo "./js/framework/configuration/host.js" "$DESTINATION/js/framework/configuration/"
cp -np "./js/framework/configuration/host.js" "$DESTINATION/js/framework/configuration/"
echo "./js/framework/configuration/language-config.js" "$DESTINATION/js/framework/configuration/"
cp -np "./js/framework/configuration/language-config.js" "$DESTINATION/js/framework/configuration/"
echo "./js/framework/configuration/menu-items.js" "$DESTINATION/js/framework/configuration/"
cp -np "./js/framework/configuration/menu-items.js" "$DESTINATION/js/framework/configuration/"
echo "./js/framework/configuration/routes.js" "$DESTINATION/js/framework/configuration/"
cp -np "./js/framework/configuration/routes.js" "$DESTINATION/js/framework/configuration/"
echo "./js/framework/configuration/session-config.js" "$DESTINATION/js/framework/configuration/"
cp -np "./js/framework/configuration/session-config.js" "$DESTINATION/js/framework/configuration/"
echo "./js/framework/configuration/tables.js" "$DESTINATION/js/framework/configuration/"
cp -np "./js/framework/configuration/tables.js" "$DESTINATION/js/framework/configuration/"
echo "./js/framework/configuration/test-variables.js" "$DESTINATION/js/framework/configuration/"
cp -np "./js/framework/configuration/test-variables.js" "$DESTINATION/js/framework/configuration/"
echo " - Language files"
echo "./js/framework/language/dictionary.pt.br.js" "$DESTINATION/js/framework/language/"
cp -a "./js/framework/language/dictionary.pt.br.js" "$DESTINATION/js/framework/language/"
echo "./js/framework/language/language.pt.br.js" "$DESTINATION/js/framework/language/"
cp -a "./js/framework/language/language.pt.br.js" "$DESTINATION/js/framework/language/"
echo "./js/framework/language/language.en.us.js" "$DESTINATION/js/framework/language/"
cp -a "./js/framework/language/language.en.us.js" "$DESTINATION/js/framework/language/"
echo "./js/framework/language/language.es.es.js" "$DESTINATION/js/framework/language/"
cp -a "./js/framework/language/language.es.es.js" "$DESTINATION/js/framework/language/"
echo " - Framework base scripts"
echo "./js/framework/ajax.js" "$DESTINATION/js/framework/"
cp -a "./js/framework/ajax.js" "$DESTINATION/js/framework/"
echo "./js/framework/app.js" "$DESTINATION/js/framework/"
cp -a "./js/framework/app.js" "$DESTINATION/js/framework/"
echo "./js/framework/breadcrumb.js" "$DESTINATION/js/framework/"
cp -a "./js/framework/breadcrumb.js" "$DESTINATION/js/framework/"
echo "./js/framework/charts.js" "$DESTINATION/js/framework/"
cp -a "./js/framework/charts.js" "$DESTINATION/js/framework/"
echo "./js/framework/formvalidation.js" "$DESTINATION/js/framework/"
cp -a "./js/framework/formvalidation.js" "$DESTINATION/js/framework/"
echo "./js/framework/globals.js" "$DESTINATION/js/framework/"
cp -a "./js/framework/globals.js" "$DESTINATION/js/framework/"
echo "./js/framework/menu.js" "$DESTINATION/js/framework/"
cp -a "./js/framework/menu.js" "$DESTINATION/js/framework/"
echo "./js/framework/messages.js" "$DESTINATION/js/framework/"
cp -a "./js/framework/messages.js" "$DESTINATION/js/framework/"
echo "./js/framework/modal.js" "$DESTINATION/js/framework/"
cp -a "./js/framework/modal.js" "$DESTINATION/js/framework/"
echo "./js/framework/pagination.js" "$DESTINATION/js/framework/"
cp -a "./js/framework/pagination.js" "$DESTINATION/js/framework/"
echo "./js/framework/session.js" "$DESTINATION/js/framework/"
cp -a "./js/framework/session.js" "$DESTINATION/js/framework/"
echo " - Other scripts"
echo "./js/sb-admin-charts.js" "$DESTINATION/js/sb-admin-charts.js"
cp -a "./js/sb-admin-charts.js" "$DESTINATION/js/sb-admin-charts.js"
echo "./js/sb-admin-charts.min.js" "$DESTINATION/js/sb-admin-charts.min.js"
cp -a "./js/sb-admin-charts.min.js" "$DESTINATION/js/sb-admin-charts.min.js"
echo "./js/sb-admin-datatables.js" "$DESTINATION/js/sb-admin-datatables.js"
cp -a "./js/sb-admin-datatables.js" "$DESTINATION/js/sb-admin-datatables.js"
echo "./js/sb-admin-datatables.min.js" "$DESTINATION/js/sb-admin-datatables.min.js"
cp -a "./js/sb-admin-datatables.min.js" "$DESTINATION/js/sb-admin-datatables.min.js"
echo "./js/sb-admin.js" "$DESTINATION/js/sb-admin.js"
cp -a "./js/sb-admin.js" "$DESTINATION/js/sb-admin.js"
echo "./js/sb-admin.min.js" "$DESTINATION/js/sb-admin.min.js"
cp -a "./js/sb-admin.min.js" "$DESTINATION/js/sb-admin.min.js"
echo
echo "Copying Default plugins scripts"
echo "./plugins" "$DESTINATION"
cp -a "./plugins" "$DESTINATION"
echo
echo "Copying Default scss"
echo "./scss" "$DESTINATION"
cp -a "./scss" "$DESTINATION"
echo
echo "Copying Default tags wire-frames"
echo "./tags/wire-frame" "$DESTINATION/tags"
cp -a "./tags/wire-frame" "$DESTINATION/tags"
echo
echo "Copying Default index file"
echo "./index.html" "$DESTINATION"
cp -np "./index.html" "$DESTINATION"
echo "Site update finished"


<filename>dbn_train.sh
for net in ResNet18_dbn
do
		for eps in 0.03137
		do
			for beta in 6
			do
    python dbn_train.py --beta $beta --net $net --epsilon $eps | tee log/trades_training/beta_$beta\_$eps\_$net.txt
done
done
done


#!/bin/sh

set -e

go build

ls testdir/input* | while read input; do
  pattern=$(cat $(echo $input | sed -e 's/input/pattern/'))
  output=$(echo $input | sed -e 's/input/output/')
  want=$(echo $input | sed -e 's/input/want/')
  echo $input
  ./jvgrep $pattern $input > $output
  diff -u $output $want
done


#!/bin/bash

set +h
set -u
set -e

cd $(dirname $0)

TARGET_DIR=$PWD/target
CLASSES_DIR=$TARGET_DIR/classes
TEST_CLASSES_DIR=$TARGET_DIR/test-classes
LIB_DIR=$PWD/lib
EXT_LIB_DIR=${LIB_DIR}/ext
TOOL_LIB_DIR=${LIB_DIR}/tool
COMPILE_LIB_DIR=${LIB_DIR}/compile
TEST_LIB_DIR=${LIB_DIR}/test

KOTLIN_VERSION=1.0.4
SRC_DIR=$PWD/src/main/kotlin
TEST_DIR=$PWD/src/test/kotlin

rm -fr $CLASSES_DIR || true
rm -fr $TEST_CLASSES_DIR || true

mkdir -p $CLASSES_DIR
mkdir -p $TEST_CLASSES_DIR

CP=$COMPILE_LIB_DIR/kotlin-stdlib-$KOTLIN_VERSION.jar

java -jar $TOOL_LIB_DIR/kotlin-compiler-$KOTLIN_VERSION.jar -d $CLASSES_DIR -classpath $CP $SRC_DIR

CP=$COMPILE_LIB_DIR/kotlin-runtime-$KOTLIN_VERSION.jar
for file in $TEST_LIB_DIR/*.jar ; do
  CP=$CP:$file
done

CP=$CP:$CLASSES_DIR

java -jar $TOOL_LIB_DIR/kotlin-compiler-$KOTLIN_VERSION.jar -d $TEST_CLASSES_DIR -classpath $CP $TEST_DIR


#
# Manages tmuxifier app
# https://github.com/jimeh/tmuxifier
#
# Authors:
#   <NAME> <pablo at glatelier dot org>
#

# If tmuxifier it's not found, exit
[[ -d ~/.tmuxifier ]] || return 1

path=(
  ${HOME}/.tmuxifier/bin
  $path
  )

eval "$(tmuxifier init -)"


#!/bin/bash

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

#$ -cwd
#$ -j y
#$ -S /bin/bash
#$ -V

PROG_NAME=`basename $0`
PROG_DIR=`dirname $0`
PROG_DIR=`cd "$PROG_DIR" && pwd`
VERSION=1.0.0

## Ensure that pipes report the exit status of the first failed job
set -o pipefail

################################################################################
##
##  Read options
##
################################################################################

while [ "$1" = "-h" ]
do
  if [ "$1" = "-h" ]
  then
    shift
    PRINT_HELP="TRUE"
  fi
done

################################################################################
##
##  Print help
##
################################################################################

if [ "$PRINT_HELP" = "TRUE" -o "$2" = "" ]
then
  echo "Usage: $PROG_NAME <GTF file> <data directory>"
  echo
  exit 0
fi

################################################################################
##
##  Read arguments
##
################################################################################

INPUT_GTF_FILE_PATH=$1
shift

if [ ! -f "$INPUT_GTF_FILE_PATH" ]
then
  echo "GTF file $INPUT_GTF_FILE_PATH not found ... exiting."
  exit 1
fi

INPUT_GTF_FILE=`basename $INPUT_GTF_FILE_PATH`
INPUT_GTF_FILE_BASE=`echo $INPUT_GTF_FILE | sed -e 's/.gz$//' | sed -e 's/.gtf$//'`
INPUT_GTF_FILE_EXT=`echo $INPUT_GTF_FILE | sed -e "s/$INPUT_GTF_FILE_BASE[.]//"`

if [ "$INPUT_GTF_FILE_EXT" = "gtf.gz" ]
then
  echo "Decompressing file $INPUT_GTF_FILE_PATH"
  gunzip $INPUT_GTF_FILE_PATH
  INPUT_GTF_FILE_PATH=`echo $INPUT_GTF_FILE_PATH | sed -e 's/[.]gz$//'`
  INPUT_GTF_FILE=`basename $INPUT_GTF_FILE_PATH`
elif [ "$INPUT_GTF_FILE_EXT" != "gtf" ]
then
  echo "Unknown extension for file $INPUT_GTF_FILE ... exiting."
  exit 1
fi

PROJECT_DATA_DIR=$1
shift

if [ ! -d $PROJECT_DATA_DIR ]
then
  echo "Creating directory $PROJECT_DATA_DIR"
  mkdir -p $PROJECT_DATA_DIR
fi

if [ ! -d $PROJECT_DATA_DIR/bin ]
then
  mkdir $PROJECT_DATA_DIR/bin
fi

GENE_MODEL_PREFIX="$INPUT_GTF_FILE_BASE"

echo "export FILE_BASE=$INPUT_GTF_FILE_BASE"  > $PROJECT_DATA_DIR/bin/setup.sh
echo "export READ_LENGTH=0"                  >> $PROJECT_DATA_DIR/bin/setup.sh
echo "export RADIUS=0"                       >> $PROJECT_DATA_DIR/bin/setup.sh
echo "export PAIRED_END=TRUE"                >> $PROJECT_DATA_DIR/bin/setup.sh
echo "export STRAND_SPECIFIC=FALSE"          >> $PROJECT_DATA_DIR/bin/setup.sh
echo "export STRAND_SPECIFIC_DIRECTION=none" >> $PROJECT_DATA_DIR/bin/setup.sh

chmod a+x $PROJECT_DATA_DIR/bin/setup.sh

R_EXE=`which R`
if [ ! -f "$R_EXE" ]
then
  echo
  echo 'R not found. Please make sure that R is available ... exiting'
  exit 1
fi

PYTHON_EXE=`which python`
if [ ! -f "$PYTHON_EXE" ]
then
  echo
  echo 'python not found. Please make sure that python is available ... exiting'
  exit 1
fi

################################################################################
##
##  Set directories
##
################################################################################

PROJECT_DIR=`dirname $PROG_DIR`

if [ ! -d $PROJECT_DATA_DIR ]
then
  echo "Creating directory $PROJECT_DATA_DIR"
  mkdir $PROJECT_DATA_DIR
fi

PROJECT_GTF_DIR=$PROJECT_DATA_DIR/gtf-files
if [ ! -d $PROJECT_GTF_DIR ]
then
  echo "Directory $PROJECT_GTF_DIR does not exist ... creating"
  mkdir $PROJECT_GTF_DIR
fi

PROJECT_BED_DIR=$PROJECT_DATA_DIR/bed-files
if [ ! -d $PROJECT_BED_DIR ]
then
  echo "Directory $PROJECT_BED_DIR does not exist ... creating"
  mkdir $PROJECT_BED_DIR
fi

PROJECT_MAP_DIR=$PROJECT_DATA_DIR/map-files
if [ ! -d $PROJECT_MAP_DIR ]
then
  echo "Directory $PROJECT_MAP_DIR does not exist ... creating"
  mkdir $PROJECT_MAP_DIR
fi

################################################################################
##
##
##  Create the reference files
##
##
################################################################################

SCRIPTS_DIR=$PROG_DIR/util-scripts

################################################################################
##
## Add exon_id field to GTF file
##
################################################################################

echo "Adding exon ids to GTF file"
GTF_FILE=$PROJECT_GTF_DIR/$GENE_MODEL_PREFIX.gtf
$SCRIPTS_DIR/addExonIdGtf.py -g $INPUT_GTF_FILE_PATH -o $GTF_FILE
if [ $? -ne 0 ]
then
  echo "Problem with addExonIdGtf.py -g $INPUT_GTF_FILE_PATH -o $GTF_FILE ... exiting"
  exit 1
fi

################################################################################
##
## Compute chromosome names
##
################################################################################

SORT_TEMP_DIR=$PROJECT_DATA_DIR/.temp
if [ ! -d $SORT_TEMP_DIR ]
then
  mkdir $SORT_TEMP_DIR
fi

cut -f 1 $GTF_FILE | sed -e 's/^/#/' | sed -e 's/$/#/' | sort -u -T $SORT_TEMP_DIR > $PROJECT_GTF_DIR/$GENE_MODEL_PREFIX-chromosomes.txt
if [ $? -ne 0 ]
then
  echo "Problem with cut -f 1 $GTF_FILE | sort -u > $PROJECT_GTF_DIR/$GENE_MODEL_PREFIX-chromosomes.txt ... exiting."
  rm -r $SORT_TEMP_DIR
  exit 1
fi

rm -r $SORT_TEMP_DIR

################################################################################
##
## Create file with mapping of junction ids to exons (junction ids are realized as the combination of two exons)
##
################################################################################

echo "Creating junction - exon mapping file - this can take a while"
export GZIPPED_JUNCTION_EXON_MAP_FILE=$PROJECT_MAP_DIR/${GENE_MODEL_PREFIX}_junction_exon.map.gz

if [ ! -f $GZIPPED_JUNCTION_EXON_MAP_FILE ]
then
  JUNCTION_EXON_MAP_FILE=$PROJECT_MAP_DIR/${GENE_MODEL_PREFIX}_junction_exon.map
  if [ ! -f $JUNCTION_EXON_MAP_FILE ]
  then
    export EXON_PIPELINE_DIR=$SCRIPTS_DIR
    export GTF_FILE
    export JUNCTION_EXON_MAP_FILE
    $R_EXE --vanilla --slave < $SCRIPTS_DIR/R/create-junction-exon-map-file.R
    if [ $? -ne 0 ]
    then
      if [ -f $JUNCTION_EXON_MAP_FILE ]
      then
        rm $JUNCTION_EXON_MAP_FILE
      fi
      echo "Problem with create-junction-exon-map-file.R ... exiting"
      exit 1
    fi
  fi

  echo "Compressing file junction - exon mapping file $JUNCTION_EXON_MAP_FILE"
  gzip -f $JUNCTION_EXON_MAP_FILE
fi

################################################################################
##
## Create the files with the mappings of GTF exon ids to EQP exon ids, the file with the mappings
## of EQP exon ids to gene ids, and the BED file with the genomic coordinates of the exons.
##
################################################################################

EXON_EXON_MAP_FILE=$PROJECT_MAP_DIR/${GENE_MODEL_PREFIX}_exon_exon.map
EXON_GENE_MAP_FILE=$PROJECT_MAP_DIR/${GENE_MODEL_PREFIX}_exon_gene.map
EXON_BED_FILE=$PROJECT_BED_DIR/${GENE_MODEL_PREFIX}_genome_exons.bed
echo "Creating exon - exon map file $EXON_EXON_MAP_FILE"
$SCRIPTS_DIR/createExonExonMapFile.py -g $EXON_GENE_MAP_FILE -b $EXON_BED_FILE $GTF_FILE $EXON_EXON_MAP_FILE
if [ $? -ne 0 ]
then
  echo "Problem with createExonExonMapFile.py -g $EXON_GENE_MAP_FILE -b $EXON_BED_FILE $GTF_FILE"
  echo " $EXON_EXON_MAP_FILE ... exiting"
  exit 1
fi

################################################################################
##
## Create file with mapping of EQP exon ids to junctions
##
################################################################################

GZIPPED_EXON_JUNCTION_MAP_FILE=$PROJECT_MAP_DIR/${GENE_MODEL_PREFIX}_exon_junction.map.gz
echo "Creating exon - junction map file $EXON_JUNCTION_MAP_FILE"
## The option -w switches on warning messages
$SCRIPTS_DIR/createExonJunctionMapFile.py -w -A -e $EXON_EXON_MAP_FILE -j $GZIPPED_JUNCTION_EXON_MAP_FILE -o $GZIPPED_EXON_JUNCTION_MAP_FILE
if [ $? -ne 0 ]
then
  echo "Problem with createExonJunctionMapFile.py -w -e $EXON_EXON_MAP_FILE -j $GZIPPED_JUNCTION_EXON_MAP_FILE -o $GZIPPED_EXON_JUNCTION_MAP_FILE"
  echo "   ... exiting"
  exit 1
fi

echo "EQP setup successfully completed."
exit 0


#!/bin/bash

set -e

VERSION=release-1.8.0

wget -O googletest-$VERSION.tar.gz https://github.com/google/googletest/archive/$VERSION.tar.gz
tar xf googletest-$VERSION.tar.gz
cd googletest-$VERSION
cmake -DCMAKE_INSTALL_PREFIX:PATH=$THIRDPARTY_BUILD \
  -DCMAKE_CXX_FLAGS:STRING="${CXXFLAGS} ${CPPFLAGS}" \
  -DCMAKE_C_FLAGS:STRING="${CFLAGS} ${CPPFLAGS}" \
  -DCMAKE_BUILD_TYPE=RelWithDebInfo .
make VERBOSE=1 install


#!/bin/bash
# Copyright   2017   Johns Hopkins University (Author: <NAME>)
#             2017   Johns Hopkins University (Author: <NAME>)
#        2017-2018   <NAME>
#             2018   <NAME>
# Apache 2.0.
#
# See ../README.txt for more info on data required.
# Results (mostly equal error-rates) are inline in comments below.

. ./cmd.sh
. ./path.sh
set -e
mfccdir=`pwd`/mfcc
vaddir=`pwd`/mfcc

nnet_dir=exp/0007_voxceleb_v2_1a/exp/xvector_nnet_1a # Pretrained model downloaded from Kaldi website

stage=4

libri_enroll=dev_clean_enroll
libri_trials=dev_clean_trial
librispeech_trials_file=data/$libri_trials/trials
libri_male=${librispeech_trials_file}_male
libri_female=${librispeech_trials_file}_female

if [ $stage -le 0 ]; then
  python local/make_librispeech_eval2.py proto/ASV_VoicePrivacy_v0 /home/bsrivast/asr_data/LibriSpeech || exit 1;
  for name in $libri_enroll $libri_trials; do
    for f in `ls data/${name}`; do
      mv data/${name}/$f data/${name}/${f}.u
      sort -u data/${name}/${f}.u > data/${name}/$f
      rm data/${name}/${f}.u
    done
    utils/utt2spk_to_spk2utt.pl data/${name}/utt2spk > data/${name}/spk2utt
  done
fi

# Evaluating LibriSpeech trials using VoXceleb pretrained model
# without adaptation

nj=29
if [ $stage -le 1 ]; then
  echo "Evaluating LibriSpeech trials using pretrained VoXceleb model."

  echo "Compute MFCC..."
  for name in $libri_enroll $libri_trials; do
    steps/make_mfcc.sh --write-utt2num-frames true --mfcc-config conf/mfcc.conf --nj $nj --cmd "$train_cmd" \
      data/${name} exp/make_mfcc $mfccdir

    utils/fix_data_dir.sh data/${name}

    sid/compute_vad_decision.sh --nj $nj --cmd "$train_cmd" \
      data/${name} exp/make_vad $vaddir
    utils/fix_data_dir.sh data/${name}
  done

fi

if [ $stage -le 2 ]; then
  echo "Extract xvectors..."
  for name in $libri_enroll $libri_trials; do
    sid/nnet3/xvector/extract_xvectors.sh --cmd "$train_cmd --mem 4G" --nj $nj \
      $nnet_dir data/${name} \
      $nnet_dir/xvectors_${name}
  done
fi

if [ $stage -le 3 ]; then
  echo "Scoring the trials..."
  $train_cmd exp/scores/log/librispeech_trial_scoring.log \
    ivector-plda-scoring --normalize-length=true \
    --num-utts=ark:${nnet_dir}/xvectors_${libri_enroll}/num_utts.ark \
    "ivector-copy-plda --smoothing=0.0 $nnet_dir/xvectors_train/plda - |" \
    "ark:ivector-mean ark:data/${libri_enroll}/spk2utt scp:${nnet_dir}/xvectors_${libri_enroll}/xvector.scp ark:- | ivector-subtract-global-mean $nnet_dir/xvectors_train/mean.vec ark:- ark:- | transform-vec $nnet_dir/xvectors_train/transform.mat ark:- ark:- | ivector-normalize-length ark:- ark:- |" \
    "ark:ivector-subtract-global-mean $nnet_dir/xvectors_train/mean.vec scp:$nnet_dir/xvectors_${libri_trials}/xvector.scp ark:- | transform-vec $nnet_dir/xvectors_train/transform.mat ark:- ark:- | ivector-normalize-length ark:- ark:- |" \
    "cat '$librispeech_trials_file' | cut -d\  --fields=1,2 |" exp/scores_libri_trials || exit 1;

  utils/filter_scp.pl $libri_male exp/scores_libri_trials > exp/scores_libri_male
  utils/filter_scp.pl $libri_female exp/scores_libri_trials > exp/scores_libri_female
  pooled_eer=$(paste $librispeech_trials_file exp/scores_libri_trials | awk '{print $6, $3}' | compute-eer - 2>/dev/null)
  male_eer=$(paste $libri_male exp/scores_libri_male | awk '{print $6, $3}' | compute-eer - 2>/dev/null)
  female_eer=$(paste $libri_female exp/scores_libri_female | awk '{print $6, $3}' | compute-eer - 2>/dev/null)
  echo "EER: Pooled ${pooled_eer}%, Male ${male_eer}%, Female ${female_eer}%"
fi

# Evaluating LibriSpeech trials using VoXceleb pretrained model
# WITH adaptation

adapt_data=dev_other
if [ $stage -le 4 ]; then
  # Prepare adaptation data
  echo "stage 16: extracting MFCC for adaptation data..."
  steps/make_mfcc.sh --write-utt2num-frames true --mfcc-config conf/mfcc.conf --nj $nj --cmd "$train_cmd" \
      data/${adapt_data} exp/make_mfcc $mfccdir

  utils/fix_data_dir.sh data/${adapt_data}

  sid/compute_vad_decision.sh --nj $nj --cmd "$train_cmd" \
      data/${adapt_data} exp/make_vad $vaddir
  utils/fix_data_dir.sh data/${adapt_data}
fi

if [ $stage -le 5 ]; then
  echo "Extract xvectors for adaptation data..."
  sid/nnet3/xvector/extract_xvectors.sh --cmd "$train_cmd --mem 4G" --nj $nj \
      $nnet_dir data/${adapt_data} \
      $nnet_dir/xvectors_${adapt_data}
fi

# DEV_OTHER ADAPTATION
if [ $stage -le 6 ]; then
  # Here we adapt the out-of-domain VoxCeleb PLDA model to LibriSpeech dev_other.  In the future, we will include a clustering
  # based approach for domain adaptation, which tends to work better.
  echo "Adapting the VoxCeleb model to dev_other..."
  $train_cmd $nnet_dir/xvectors_${adapt_data}/log/plda_adapt.log \
    ivector-adapt-plda --within-covar-scale=0.75 --between-covar-scale=0.25 \
    $nnet_dir/xvectors_train/plda \
    "ark:ivector-subtract-global-mean scp:${nnet_dir}/xvectors_${adapt_data}/xvector.scp ark:- | transform-vec ${nnet_dir}/xvectors_train/transform.mat ark:- ark:- | ivector-normalize-length ark:- ark:- |" \
    ${nnet_dir}/xvectors_${adapt_data}/plda_adapt || exit 1;
fi

if [ $stage -le 7 ]; then
  echo "Scoring the trials with dev_other adapted VoxCeleb model..."
  $train_cmd exp/scores/log/librispeech_${adapt_data}_adapt.log \
    ivector-plda-scoring --normalize-length=true \
    --num-utts=ark:${nnet_dir}/xvectors_${libri_enroll}/num_utts.ark \
    "ivector-copy-plda --smoothing=0.0 $nnet_dir/xvectors_${adapt_data}/plda_adapt - |" \
    "ark:ivector-mean ark:data/${libri_enroll}/spk2utt scp:${nnet_dir}/xvectors_${libri_enroll}/xvector.scp ark:- | ivector-subtract-global-mean $nnet_dir/xvectors_train/mean.vec ark:- ark:- | transform-vec $nnet_dir/xvectors_train/transform.mat ark:- ark:- | ivector-normalize-length ark:- ark:- |" \
    "ark:ivector-subtract-global-mean $nnet_dir/xvectors_train/mean.vec scp:$nnet_dir/xvectors_${libri_trials}/xvector.scp ark:- | transform-vec $nnet_dir/xvectors_train/transform.mat ark:- ark:- | ivector-normalize-length ark:- ark:- |" \
    "cat '$librispeech_trials_file' | cut -d\  --fields=1,2 |" exp/scores/libri_${adapt_data}_adapt || exit 1;

  utils/filter_scp.pl $libri_male exp/scores/libri_${adapt_data}_adapt > exp/scores/libri_${adapt_data}_male
  utils/filter_scp.pl $libri_female exp/scores/libri_${adapt_data}_adapt > exp/scores/libri_${adapt_data}_female
  pooled_eer=$(paste $librispeech_trials_file exp/scores/libri_${adapt_data}_adapt | awk '{print $6, $3}' | compute-eer - 2>/dev/null)
  male_eer=$(paste $libri_male exp/scores/libri_${adapt_data}_male | awk '{print $6, $3}' | compute-eer - 2>/dev/null)
  female_eer=$(paste $libri_female exp/scores/libri_${adapt_data}_female | awk '{print $6, $3}' | compute-eer - 2>/dev/null)
  echo "EER: Pooled ${pooled_eer}%, Male ${male_eer}%, Female ${female_eer}%"
fi


<gh_stars>1-10
apt update

apt install -y wget unzip
wget http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_91.0.4472.114-1_amd64.deb
mv google-chrome-stable_91.0.4472.114-1_amd64.deb google-chrome-stable_current_amd64.deb
dpkg -i google-chrome-stable_current_amd64.deb

apt --fix-broken install -y
dpkg -i google-chrome-stable_current_amd64.deb
wget https://chromedriver.storage.googleapis.com/91.0.4472.101/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
mv chromedriver /usr/bin/


<filename>update.sh
#!/bin/bash

if [[ $1 == "-all" ]]; then # re-make all html files

	find posts -type f -print0 | while read -d $'\0' file; do
		# blog_post files: ipynb and NOT Lecture and NOT checkpoint
		if [[ $file == *"ipynb"* ]] && [[ $file != *"Lecture"* ]] && [[ $file != *"checkpoint"* ]]; then
  			# convert to raw html
  			eval "jupyter nbconvert --to html" $file
  			# make it pretty!
  			eval "python html/prettify_post.py" ${file/.ipynb/.html}
  		fi
  		# lecture files: ipynb and Lecture and NOT checkpoint
  		if [[ $file == *"ipynb"* ]] && [[ $file == *"Lecture"* ]] && [[ $file != *"checkpoint"* ]]; then
  			# convert to html
  			eval "jupyter nbconvert --to slides --reveal-prefix=revealjs" $file
		fi
	done

else

	# get modified files
	unstaged_files=$(git diff --name-only 2>&1)
	# get new files
	untracked_files=$(git ls-files --other --exclude-standard 2>&1)

	for file in $unstaged_files $untracked_files; do
		# blog_post files: ipynb and NOT Lecture and NOT checkpoint
		if [[ $file == *"ipynb"* ]] && [[ $file != *"Lecture"* ]] && [[ $file != *"checkpoint"* ]]; then
  			# convert to raw html
  			eval "jupyter nbconvert --to html" $file
  			# make it pretty!
  			eval "python html/prettify_post.py" ${file/.ipynb/.html}
  		fi
  		# lecture files: ipynb and Lecture and NOT checkpoint
  		if [[ $file == *"ipynb"* ]] && [[ $file == *"Lecture"* ]] && [[ $file != *"checkpoint"* ]]; then
  			# convert to html
  			eval "jupyter nbconvert --to slides --reveal-prefix=revealjs" $file
		fi
	done
fi


#!/vendor/bin/sh
# $1 = "-d" to supply directory name
# $2 = directory name
# $3 = "-f" force collection of log regardless of previous panic
#
# Redirect stderr to null or to the related out-file in order
# not to spill errs on stdout when invoked as UMH or to collect
# error conditions on failure to dump in the related out-file.

dir=/data/vendor/log/wifi

[ $# -gt 1 -a x"$1" == "x-d" ] && dir=$2
[ $# -gt 2 ] && force=$3
[ $# -gt 0 -a x"$1" == "x-f" ] && force=$1

SAMLOG=/sys/kernel/debug/scsc/ring0/samlog
MXDECO=/vendor/bin/mxdecoder

build_type="`getprop ro.build.type`"
max_logs=50

# Error status from driver
if [ -e  /proc/driver/mxman_ctrl0/mx_status ]
then
	mx_status="`cat /proc/driver/mxman_ctrl0/mx_status`"
fi

mkdir -p $dir
sync

if [ "x${build_type}" == "xuser" ]
then
	if [ "x${mx_status}" == "xMXMAN_STATE_FAILED" -a "x${force}" != "x-f" ]
	then
		# Moredump already took the logs, don't overwrite
		exit 0
	fi

	# Only one set of logs allowed
	filename_mxdump=${dir}/mx.dump.last.log
	filename_logcat=${dir}/logcat.last.log
	filename_dmesg=${dir}/dmesg.last.log
	rm -f $filename_mxdump >/dev/null 2>&1
	rm -f $filename_logcat >/dev/null 2>&1
	rm -f $filename_dmesg >/dev/null 2>&1
	sync
else
	DATE_TAG="`date +%Y_%m_%d__%H_%M_%S`"
	filename_mxdump=${dir}/mx.dump.${DATE_TAG}.log
	filename_logcat=${dir}/logcat.${DATE_TAG}.log
	filename_dmesg=${dir}/dmesg.${DATE_TAG}.log

	## Getting rid of old logs
	nlogs="`ls ${dir}/dmesg* 2>/dev/null | wc -l`"
	while [ $nlogs -ge $max_logs ]
	do
		oldest_mxdump="`ls ${dir}/mx.dump* | head -n 1`"
		oldest_logcat="`ls ${dir}/logcat* | head -n 1`"
		oldest_dmesg="`ls ${dir}/dmesg* | head -n 1`"
		rm -f $oldest_mxdump >/dev/null 2>&1
		rm -f $oldest_logcat >/dev/null 2>&1
		rm -f $oldest_dmesg >/dev/null 2>&1
		nlogs="`ls ${dir}/dmesg* 2>/dev/null | wc -l`"
	done
	sync
fi

if [ -f $SAMLOG ]
then
	cat /proc/driver/mxman_info/mx_release > $filename_mxdump 2>&1
	if [ ! -e $MXDECO ]
	then
		echo "No mxdecoder found...dumping RAW logring." >> $filename_mxdump
		cat $SAMLOG >> $filename_mxdump 2>&1
	else
		cat $SAMLOG | $MXDECO >> $filename_mxdump 2>&1
	fi
fi

#Dump unconditionally other logs
#/system/bin/logcat -t 500 > $filename_logcat 2>&1
dmesg > $filename_dmesg 2>&1
#wlbt_ldos.sh >> $filename_dmesg 2>&1

# UT collector seems to ignore our dmesg, presumably because
# dmesg has been deemed to have been collected elsewhere.
# However, we grab dmesg at the point of wlbt failure, so need
# to keep it. So we append it to the mxdump in User builds.
#
if [ "x${build_type}" == "xuser" ]
then
	echo "----- dmesg at failure -----" >> $filename_mxdump
	cat $filename_dmesg >> $filename_mxdump 2>&1
fi

sync

exit 0


<reponame>hokieengr/WQ7Tpanadapter
#!/bin/sh
# launcher.sh
# navigate to  home directory, then to this directory, then execute python sript, then back home

cd /
cd home/pi/FreqShow_Large
sudo python freqshow.py
cd /


# Install swiftlint if necessary
if ! which swiftlint >/dev/null; then
    brew install swiftlint
fi

# Run Swiftlint
echo "Swiftlint output"
cd project_folder
swiftlint


<filename>applications/COL380/uploads/UploadDB.TarFile.9ee2d7861f57f56f.4465736b746f702e7461722e/run2.sh
cd /home/cse/dual/cs5120284/UploadDB.TarFile.9ee2d7861f57f56f.4465736b746f702e7461722e/
bash run.sh input2.txt output2.txt


#!/usr/bin/env bash

koopa_install_imagemagick() {
    koopa_install_app \
        --link-in-bin='bin/magick' \
        --name-fancy='ImageMagick' \
        --name='imagemagick' \
        "$@"
}


#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
go get github.com/mjibson/esc
pushd $DIR/../artifacts/builtinroles
  ansible-galaxy install geerlingguy.composer
  ansible-galaxy install geerlingguy.php
  ansible-galaxy install geerlingguy.glusterfs
  ansible-galaxy install geerlingguy.firewall
  ansible-galaxy install geerlingguy.git
  ansible-galaxy install geerlingguy.java
  ansible-galaxy install geerlingguy.mysql
  ansible-galaxy install geerlingguy.redis
  ansible-galaxy install geerlingguy.php-redis
  ansible-galaxy install geerlingguy.php-mysql
  ansible-galaxy install nginxinc.nginx
  ansible-galaxy install geerlingguy.docker
  ansible-galaxy install geerlingguy.kubernetes
  ansible-galaxy install geerlingguy.java
  ansible-galaxy install wikivoks.jmeter
  ansible-galaxy install idealista.tomcat-role
  ansible-galaxy install gantsign.maven
  ansible-galaxy install bjoernalbers.wildfly
popd

pushd $DIR/../artifacts/builtinroles
  go generate
popd

pushd $DIR/../artifacts/builtinmanifests
  go generate
popd

pushd $DIR/../artifacts/qgraph
  go generate
popd


#!/bin/sh
set -e

if [ -e /project/.netrc ]
then
  cp /project/.netrc $HOME/.netrc
fi
/bin/sh


#!/bin/bash

# root_dir=$1
# link_target_dir=$2
root_dir="$HOME/go/src/github.com/myokoyama0712/go-competitive/past_contests/AGC"
link_target_dir="$HOME/go/src/github.com/myokoyama0712/go-competitive/remark_link/AGC"

# 末尾のスラッシュ除去
# root_dir=$(echo $1 | tr -d '/')
# link_target_dir=$(echo $2 | tr -d '/')

# 最低限の引数チェック
if [[ !( -d $root_dir && -d $link_target_dir )  ]]; then
  echo 'arguments error!'
  exit 1
fi

files_array=$(find $root_dir -type f)
for file in $files_array; do
  path=$file
  declare -a a_dirs=()
  a_dirs=$(echo $path | tr '/' ' ') # /をスペースに置換

  for dir in ${a_dirs[0]}
  do
    if [ $dir = "README.md" ]; then
      # echo "SLINK FILE PATH: ${link_target_dir}/${before_dir}-${dir}"
      # echo "ORIGIN FULL PATH: $file"
      ln -fnsv "$file" "${link_target_dir}/${before_dir}-${dir}"
    fi

    before_dir=$dir
  done
done

exit 0


#
#-----------------------------------------------------------------------
#
# This file defines a function that, for an ensemble-enabled experiment
# (i.e. for an experiment for which the workflow configuration variable
# DO_ENSEMBLE has been set to "TRUE"), adds to a base FV3 namelist file
# a set of stochastic "seed" parameters that is unique to each ensemble
# member to generate a new namelist file for each member.  The namelist
# files of any two ensemble members differ only in their stochastic "seed"
# parameter values.  Each such member-specific namelist file is placed at
# the top level of the experiment directory.  (Then, during the RUN_FCST_TN
# step of the workflow, links are created from the run directories to these
# member-specific namelist files.)
#
#-----------------------------------------------------------------------
#
function set_FV3nml_stoch_params() {
#
#-----------------------------------------------------------------------
#
# Save current shell options (in a global array).  Then set new options
# for this script/function.
#
#-----------------------------------------------------------------------
#
  { save_shell_opts; set -u -x; } > /dev/null 2>&1
#
#-----------------------------------------------------------------------
#
# Get the full path to the file in which this script/function is located
# (scrfunc_fp), the name of that file (scrfunc_fn), and the directory in
# which the file is located (scrfunc_dir).
#
#-----------------------------------------------------------------------
#
  local scrfunc_fp=$( readlink -f "${BASH_SOURCE[0]}" )
  local scrfunc_fn=$( basename "${scrfunc_fp}" )
  local scrfunc_dir=$( dirname "${scrfunc_fp}" )
#
#-----------------------------------------------------------------------
#
# Get the name of this function.
#
#-----------------------------------------------------------------------
#
  local func_name="${FUNCNAME[0]}"
#
#-----------------------------------------------------------------------
#
# Specify the set of valid argument names for this script/function.  Then
# process the arguments provided to this script/function (which should
# consist of a set of name-value pairs of the form arg1="value1", etc).
#
#-----------------------------------------------------------------------
#
  local valid_args=()
  process_args valid_args "$@"
#
#-----------------------------------------------------------------------
#
# For debugging purposes, print out values of arguments passed to this
# script.  Note that these will be printed out only if VERBOSE is set to
# TRUE.
#
#-----------------------------------------------------------------------
#
  print_input_args valid_args
#
#-----------------------------------------------------------------------
#
# Declare local variables.
#
#-----------------------------------------------------------------------
#
  local cdate \
        i \
        ip1 \
        fv3_nml_ens_fp \
        iseed_shum \
        iseed_skeb \
        iseed_sppt \
        iseed_spp \
        settings
#
#-----------------------------------------------------------------------
#
# At this point, there should exist a namelist file with full path as
# specified in the workflow variable FV3_NML_FP.  This is the namelist
# file for a non-ensmble-enabled experiment.  This file will be used below
# as the base namelist file to which we will add the stochastic "seed"
# parameters to obtain the final namelist file for each ensemble member.
# To clarify that this namelist file is not the final namelist file that
# FV3 will read in, we now rename it to the name specified in FV3_NML_BASE_ENS_FP.
#
#-----------------------------------------------------------------------
#
mv_vrfy "${FV3_NML_FP}" "${FV3_NML_BASE_ENS_FP}"
#
#-----------------------------------------------------------------------
#
# Select a cdate (date and hour, in the 10-digit format YYYYMMDDHH) to
# use in the formula for generating the stochastic seed values below.
# Here, we form cdate the starting date and time of the first forecast.
#
#-----------------------------------------------------------------------
#
cdate="${DATE_FIRST_CYCL}${CYCL_HRS[0]}"
#
#-----------------------------------------------------------------------
#
# Now loop through the ensemble members and generate a namelist file for
# each one.
#
#-----------------------------------------------------------------------
#
for (( i=0; i<${NUM_ENS_MEMBERS}; i++ )); do

  fv3_nml_ensmem_fp="${FV3_NML_ENSMEM_FPS[$i]}"

  ip1=$(( i+1 ))
  iseed_shum=$(( cdate*1000 + ip1*10 + 2 ))
  iseed_skeb=$(( cdate*1000 + ip1*10 + 3 ))
  iseed_sppt=$(( cdate*1000 + ip1*10 + 1 ))
  iseed_spp=$(( cdate*1000 + ip1*10 + 4 ))

  settings="\
'nam_stochy': {
    'iseed_shum': ${iseed_shum},
    'iseed_skeb': ${iseed_skeb},
    'iseed_sppt': ${iseed_sppt},
  }
'nam_spperts': {
    'iseed_spp': ${iseed_spp},
  }"

  $USHDIR/set_namelist.py -q \
                          -n ${FV3_NML_BASE_ENS_FP} \
                          -u "$settings" \
                          -o ${fv3_nml_ensmem_fp} || \
    print_err_msg_exit "\
Call to python script set_namelist.py to set the variables in the FV3
namelist file that specify the paths to the surface climatology files
failed.  Parameters passed to this script are:
  Full path to base namelist file:
    FV3_NML_BASE_ENS_FP = \"${FV3_NML_BASE_ENS_FP}\"
  Full path to output namelist file:
    fv3_nml_ensmem_fp = \"${fv3_nml_ensmem_fp}\"
  Namelist settings specified on command line (these have highest precedence):
    settings =
$settings"

done
#
#-----------------------------------------------------------------------
#
# Restore the shell options saved at the beginning of this script/function.
#
#-----------------------------------------------------------------------
#
  { restore_shell_opts; } > /dev/null 2>&1

}


#!/bin/sh

# shortcuts
defaults write com.apple.iWork.Numbers NSUserKeyEquivalents -dict-add "Align Center" -string '@$\'
defaults write com.apple.iWork.Numbers NSUserKeyEquivalents -dict-add "Align Left" -string '@$['
defaults write com.apple.iWork.Numbers NSUserKeyEquivalents -dict-add "Align Right" -string '@$]'


<gh_stars>0
#!/bin/bash

DIR0=$(dirname $0)
echo "DIR0=$DIR0"

EXTERNAL_HOST=$(ifconfig | grep -E "([0-9]{1,3}\.){3}[0-9]{1,3}" | grep -v 127.0.0.1 | awk '{ print $2 }' | cut -f2 -d: | head -n1)

$(which python3.9) $DIR0/scripts/set_external_hosts.py $(pwd) $EXTERNAL_HOST

#docker-compose up -d
docker stack deploy -c docker-compose-stack.yml cloudns-refresher


#!/bin/bash
# create multiresolution windows icon
ICON_DST=../../src/qt/res/icons/raven.ico

convert ../../src/qt/res/icons/raven-16.png ../../src/qt/res/icons/raven-32.png ../../src/qt/res/icons/raven-48.png ${ICON_DST}


#!/bin/bash
neko-gcc -std=gnu++11 -fno-exceptions main.cpp -lpng  -o ../../sysroot/bin/imgview


<filename>infra/scripts/test_arm_nnpkg.sh
#!/bin/bash

set -eo pipefail
source "$(dirname "${BASH_SOURCE[0]}")/common.sh"

BACKENDS=("acl_cl" "acl_neon" "cpu")

for BACKEND in "${BACKENDS[@]}";
do
  NNPackageTest ${BACKEND} "tools/nnpackage_tool/nnpkg_test/list.armv7l-linux.${BACKEND}"
done

# Interpreter test
export DISABLE_COMPILE=1
NNPackageTest "interp" "tools/nnpackage_tool/nnpkg_test/list.noarch.interp"
unset DISABLE_COMPILE


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

version=$(python setup.py --version)

rm -rf build dist/*

python setup.py bdist_wheel
twine upload dist/iotawallet-${version}-py3-none-any.whl

git tag -f ${version}
git push
git push --tags


#!/bin/bash
# purpose: 	convert DICOMs to *.nii.gz files
#		generate json, bval, bvec files too
# creator:	<NAME>, December 2020
# assumptions:
#	the b-value is in the second last position '_'-delimited
# 	the word blip is checked for in the filename before proceeding
# additions:
# 	progress update on which participant is being processed?

echo "Where to put the outputs?"
read -p 'Path: ' outfolder

[ -d $outfolder ] || mkdir $outfolder

for d in */*dMRI*/ ; do
	PID=$(echo $d | cut -d "_" -f 1)				# grab PID
	if [[ ${d,,} =~ .*"blip".* ]]; then				# grab b-value or blip
		outname="blip"
	else
		outname=$(echo "${d::-1}" | awk -F'_' '{print $(NF-1)}')
	fi
								# check if nifti already exists
	if [ ! -f $outfolder/"$PID"_"$outname.nii.gz" ]; then 	# if not, then
		echo "Working on $PID, niftifying $outname."
		dcm2niix -b y \
			 -f "$PID"_"$outname" \
			 -o $outfolder \
			 -z y \
			 $d
	fi							# if *.nii.gz already exists, skip
done


#!/bin/bash
LOGS=/var/log/apache2/webapps*/*/*ssl-access.log
echo "Q&D access log analysis"
echo
echo "500s:"
echo
grep " 500 " $LOGS | grep -v -i bot | grep -v imageserver | perl -pe 's/^.*?://;s/\" \".*/"/' |\
 sort -t ' ' -k 4.9,4.12n -k 4.5,4.7M -k 4.2,4.3n -k 4.14,4.15n -k 4.17,4.18n -k 4.20,4.21n | tac | head -50
echo
echo "Dates:"
echo
cut -f3 -d"-" $LOGS | cut -f1 -d ":" | perl -pe 's/ \[//' | sort -t ' ' -k 1.8,1.11n -k 1.4,1.6M -k 1.1,1.2n | uniq -c | tac | perl -pe 's/^ *(\d+) /\1\t/' > webapps.log.counts.csv
head -100 webapps.log.counts.csv
echo
echo "HTTP Codes:"
echo
cat $LOGS | grep -v webapps | perl -pe 's/^.*? (\d\d\d) .*/\1/' | sort | uniq -c | sort -rn | head -100
echo
echo "HTTP Requests:"
echo
grep HTTP $LOGS | cut -f6 -d" " | sort | uniq -c | sort -rn | perl -pe 's/"//g' | head -100
echo


if [ ! -d "venv" ]
then
    python3 -m venv venv
    . venv/bin/activate
    pip install -r requirements.txt
else
    . venv/bin/activate
fi
open http://127.0.0.1:5000/
export FLASK_APP=bunshi
export FLASK_ENV=development
flask run


#!/usr/bin/env sh
docker build -f src/main/docker/Dockerfile.jvm -t api:latest .


<reponame>akolotov/qadwallet-testenv<gh_stars>1-10
#!/bin/bash

GETH_BIN='/opt/ethereum-go/bin/geth'

${GETH_BIN} --datadir data init qadwallet_testbed.json


<reponame>bpmcdevitt/intrigue-core
# simplify getting nvd feeds
NVD_YEARS="2018 2017 2016 2015 2014 2013 2012 2011"

# nvd download function
function get_nvd_json() {
  echo "[+] Getting latest NVD JSON Feed: $YEAR"
  wget -N -q https://nvd.nist.gov/feeds/json/cve/1.0/nvdcve-1.0-$YEAR.json.gz -O nvdcve-1.0-$YEAR.json.gz
  gunzip nvdcve-1.0-$YEAR.json.gz
}

if [ -d "nvd" ]; then
  echo "[ ] Cleaning NVD directory"
  rm -rf nvd
fi

# check and download
for YEAR in $NVD_YEARS; do

  mkdir -p nvd
  cd nvd
    get_nvd_json $YEAR
  cd ..

done


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

# ######################################################
# ## Copyright (c) 2021, <NAME>         ##
# ## Licensed under the Apache License, Version 2.0   ##
# ######################################################

# Ask YES or NO

#####################
##  ## YES / NO ## ##
#####################
## Usage
##
## askYN <command>
##
## <command> to run when yes
## Default is No N
askYN_ANS=''
askYN(){
    askYN_defaultN $@
}

askYN_defaultN(){
    local REPLY=""

    read -p " [y/N] " REPLY

    case $REPLY in
        [yY])
            askYN_ANS='y'
            # echo "OK!"
            $@
            # echo "$cGREEN{SUCCESS}$cNC"
        ;;

        *)
            askYN_ANS='n'
            echo "Action Cancelled"
        ;;
    esac
}

askYN_defaultY(){
    local REPLY=""

    read -p " [Y/n] " REPLY

    case $REPLY in
        [nN])
            askYN_ANS='n'
            echo "Action Cancelled"
        ;;

        *)
            askYN_ANS='y'
            # echo "OK!"
            $@
            # echo "$cGREEN{SUCCESS}$cNC"
        ;;

    esac
}


. /opt/conda/etc/profile.d/conda.sh

cd ~
mkdir regression
cd regression
# git config core.filemode false
git clone --recursive https://github.com/dmlc/dgl.git
cd dgl
mkdir asv
cp -r ~/asv_data/* asv/

conda activate base
pip install --upgrade pip
pip install asv numpy

source /root/regression/dgl/tests/scripts/build_dgl.sh gpu

conda activate base
asv machine --yes
asv run
asv publish


<reponame>tomMoral/loky
#!/bin/bash

set -e

pip install codecov

coverage combine --append
codecov || echo "codecov upload failed"


<reponame>epfl-idevelop/ressenti<filename>ressenti-1.sh
#Petit script pour lancer une mesure de temps sur une liste de site
#ATTENTION: faire tourner ce script DANS le container docker-ressenti!

#zf190320.1134

time_page() {
    label=$1
    url=$2
    img=$3

    ztime=`date +%Y%m%d.%H%M%S`
    zduree=`/root/work/screenshot.sh $url $img`
    echo -e $ztime" "$zduree
    t=${zduree::-1}				                        #supprime le dernier car
    /root/work/send_prometheus.sh ressenti_epfl_firefox_siipc6 $label $t 1
}

echo -e "z.zufferey.com"
time_page "z.zufferey.com" "http://z.zufferey.com" "z.zufferey.com"

echo -e "www.epfl.ch"
time_page "www.epfl.ch" "https://www.epfl.ch" "www.epfl.ch"

echo -e "www.epfl.ch/wp-admin"
time_page "www.epfl.ch-wp-admin" "https://www.epfl.ch/wp-admin" "www.epfl.ch-wp-admin"

echo -e "dcsl.epfl.ch"
time_page "dcsl.epfl.ch" "https://dcsl.epfl.ch" "dcsl.epfl.ch"

echo -e "actu.epfl.ch"
time_page "actu.epfl.ch" "https://actu.epfl.ch" "actu.epfl.ch"

echo -e "memento.epfl.ch"
time_page "memento.epfl.ch" "https://memento.epfl.ch" "memento.epfl.ch"

echo -e "people.epfl.ch"
time_page "people.epfl.ch" "https://people.epfl.ch/christian.zufferey" "people.epfl.ch"

echo -e "gel.epfl.ch"
time_page "gel.epfl.ch" "https://gel.epfl.ch" "gel.epfl.ch"

echo -e "jahia.epfl.ch"
time_page "jahia.epfl.ch" "https://jahia.epfl.ch" "jahia.epfl.ch"

#echo -e "www.abcm.ch"
#time_page "www.abcm.ch" "https://www.abcm.ch" "www.abcm.ch"

#echo -e "www.abcm.ch_wp"
#time_page "www.abcm.ch-wp" "http://www.abcm.ch/wp" "www.abcm.ch-wp"

echo -e "www.makerspace-lausanne.ch"
time_page "www.makerspace-lausanne.ch" "http://www.makerspace-lausanne.ch" "www.makerspace-lausanne.ch"

echo -e "hivebrite.com"
time_page "hivebrite.com" "https://hivebrite.com" "hivebrite.com"

echo -e "epfl-test.hivebrite.com"
time_page "epfl-test.hivebrite.com" "https://epfl-test.hivebrite.com" "epfl-test.hivebrite.com"

echo -e "epfl.hivebrite.ch"
time_page "epfl.hivebrite.ch" "https://epfl.hivebrite.ch" "epfl.hivebrite.ch"


#!/usr/bin/env bash
rootCaKey="../docker/local/etc/nginx/ssl/rootCA.key"
rootCaPem="../docker/local/etc/nginx/ssl/rootCA.pem"

openssl genrsa -des3 -out ${rootCaKey} 2048
openssl req -x509 -new -nodes -key ${rootCaKey} -sha256 -days 3650 -out ${rootCaPem}


<gh_stars>0
#!/usr/bin/env bash
set -eu
echo "---- START: cleanup.sh -------"

SSH_USER=${SSH_USERNAME:-vagrant}
DISK_USAGE_BEFORE_CLEANUP=$(df -h)

# Disable the release upgrader
echo "==> Disabling the release upgrader"
sed -i.bak 's/^Prompt=.*$/Prompt=never/' /etc/update-manager/release-upgrades

# Disable periodic upgrades
echo "==> Disabling periodic apt upgrades"
echo 'APT::Periodic::Enable "0";' >> /etc/apt/apt.conf.d/10periodic

# Make sure udev does not block our network - http://6.ptmc.org/?p=164
echo "==> Cleaning up udev rules"
rm -rf /dev/.udev/

echo "==> Cleaning up leftover dhcp leases"

if [ -d "/var/lib/dhcp3" ]; then
    rm /var/lib/dhcp3/*
fi

UBUNTU_VERSION=$(lsb_release -sr)
# Add delay to prevent "vagrant reload" from failing
echo "pre-up sleep 2" >> /etc/network/interfaces

echo "==> Cleaning up tmp"
rm -rf /tmp/*

echo "==> Installed packages"
dpkg --get-selections | grep -v deinstall

# Remove Bash history
unset HISTFILE
rm -f /root/.bash_history
rm -f /home/${SSH_USER}/.bash_history

# Clean up log files
find /var/log -type f | while read f; do echo -ne '' > "${f}"; done;

echo "==> Clearing last login information"
>/var/log/lastlog
>/var/log/wtmp
>/var/log/btmp

echo "---- END: cleanup.sh -------"


<reponame>opsresearch/ops-provision<filename>scripts/terraform/install.sh
#!/usr/bin/env bash
# Copyright (c) 2020-Present OpsResearch LLC
# Licensed under the MIT License, see the LICENSE file.
set -euo pipefail
IFS=$'\n\t'
export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$HERE/.."
source "config.sh"
source "funct.sh"
######

echo "Script: $0"
cd "$HOME"

echo "Terraform version: $OPS_TERRAFORM_VERSION"

if command -v terraform > /dev/null; then
    echo "Skipping Terraform install because the command 'terraform' is defined."
    exit 0
fi

install_terraform_linux_x86_64(){
    if ! command -v terraform > /dev/null; then
        sudo wget "https://releases.hashicorp.com/terraform/$OPS_TERRAFORM_VERSION/terraform_${OPS_TERRAFORM_VERSION}_linux_amd64.zip"
        sudo unzip "terraform_${OPS_TERRAFORM_VERSION}_linux_amd64.zip"
        sudo mv -f terraform /usr/local/bin/
        rm -f "./terraform_${OPS_TERRAFORM_VERSION}_linux_amd64.zip"
    fi
}

if is_macos; then
    brew update
    brew install -f terraform
elif is_linux && is_x86_64; then
    install_terraform_linux_x86_64
else
    echo "This OS isn't suitable for: $0"
    uname -a
    exit 1
fi


<reponame>ww8912188/blogs
#!/bin/bash
export GOPATH=/root/go
export PATH=$PATH:$GOPATH/bin

COSMOS_PATH=/data1/validator
CHAIN_ID=testing
NUM=1
PW=<PASSWORD>

cd $COSMOS_PATH
rm -rf node*
for((i=0;i<=$NUM;i++));
do
  pm2 delete node$i
  mkdir -p $COSMOS_PATH/node$i
  mkdir -p $COSMOS_PATH/node$i/gentxs
done
pm2 delete cosmos-rest-server

# initialize node0
gaiad init --chain-id=$CHAIN_ID node0 --home=$COSMOS_PATH/node0

for((i=0;i<=$NUM;i++));
do
  gaiad init --chain-id=$CHAIN_ID node$i --home=$COSMOS_PATH/node$i
  rm -rf node$i/config/genesis.json
done

cp genesis.json node0/config/

for((i=0;i<=$NUM;i++));
do
  gaiad add-genesis-account $(gaiacli keys show validator$i -a) 1000000000stake,1000000000validator${i}token --home=$COSMOS_PATH/node0
done

echo $PW | gaiad gentx --name validator0 --home=$COSMOS_PATH/node0 --output-document=$COSMOS_PATH/node0/gentxs/node0.json

gaiad collect-gentxs --home=$COSMOS_PATH/node0 --gentx-dir=$COSMOS_PATH/node0/gentxs

cp node0/config/genesis.json node1/config

pm2 start runnode0.sh --name=node0

sleep 5

rm -rf node1/config/config.toml
cp backup/config1.toml node1/config/config.toml

ID=`gaiacli status | jq -r ".node_info.id"`
SEEDS="$ID@172.16.144.84:26656"
VALACC=`gaiad tendermint show-validator --home=$COSMOS_PATH/node1`

sed -i "/seeds = ""/c seeds = \"$SEEDS\"" node1/config/config.toml

# node1
gaiacli tx staking create-validator \
  --amount=1000000stake \
  --pubkey=$VALACC \
  --moniker=node1 \
  --chain-id=testing \
  --commission-rate="0.10" \
  --commission-max-rate="0.20" \
  --commission-max-change-rate="0.01" \
  --min-self-delegation="100000" \
  --gas=200000 \
  --gas-prices="0.025stake" \
  --from=cosmos1wpw2nrq850mwgrhteh3jwc2g7w9led2huhck90

sleep 5
pm2 start runnode1.sh --name=node1

sleep 5
pm2 start start-rest-server.sh --name=cosmos-rest-server


<reponame>Pick1a1username/gitweb_dockerfile
#!/bin/bash

# Configure gitweb.conf
## Set base URL
## If BASE_URL isn't set, 'localhost' will be used.
echo "Setting base URL..."

if [[ -z ${BASE_URL} ]]
then
  echo "BASE URL is not specified. 'localhost' will be used."
else
  echo "'${BASE_URL}' is specified as GitWeb's base url."
  sed -i 's/localhost/${BASE_URL}/g' /etc/gitweb.conf
fi

echo "Done."

# Execute lighttpd
echo "Executing lighttpd..."

lighttpd -D -f /etc/lighttpd/lighttpd.conf


<filename>migrations/applied_migrations/AuthorityStartDate.sh
#!/bin/bash

echo ""
echo "Applying migration AuthorityStartDate"

echo "Adding routes to conf/app.routes"

echo "" >> ../conf/app.routes
echo "GET        /authorityStartDate                  controllers.AuthorityStartDateController.onPageLoad(mode: Mode = NormalMode)" >> ../conf/app.routes
echo "POST       /authorityStartDate                  controllers.AuthorityStartDateController.onSubmit(mode: Mode = NormalMode)" >> ../conf/app.routes

echo "GET        /changeAuthorityStartDate                        controllers.AuthorityStartDateController.onPageLoad(mode: Mode = CheckMode)" >> ../conf/app.routes
echo "POST       /changeAuthorityStartDate                        controllers.AuthorityStartDateController.onSubmit(mode: Mode = CheckMode)" >> ../conf/app.routes

echo "Adding messages to conf.messages"
echo "" >> ../conf/messages.en
echo "authorityStartDate.title = AuthorityStartDate" >> ../conf/messages.en
echo "authorityStartDate.heading = AuthorityStartDate" >> ../conf/messages.en
echo "authorityStartDate.checkYourAnswersLabel = AuthorityStartDate" >> ../conf/messages.en
echo "authorityStartDate.error.required.all = Enter the authorityStartDate" >> ../conf/messages.en
echo "authorityStartDate.error.required.two = The authorityStartDate" must include {0} and {1} >> ../conf/messages.en
echo "authorityStartDate.error.required = The authorityStartDate must include {0}" >> ../conf/messages.en
echo "authorityStartDate.error.invalid = Enter a real AuthorityStartDate" >> ../conf/messages.en

echo "Adding to UserAnswersEntryGenerators"
awk '/  self: Generators =>/ {\
    print;\
    print "";\
    print "  implicit lazy val arbitraryAuthorityStartDateUserAnswersEntry: Arbitrary[(AuthorityStartDatePage.type, JsValue)] =";\
    print "    Arbitrary {";\
    print "      for {";\
    print "        page  <- arbitrary[AuthorityStartDatePage.type]";\
    print "        value <- arbitrary[Int].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 arbitraryAuthorityStartDatePage: Arbitrary[AuthorityStartDatePage.type] =";\
    print "    Arbitrary(AuthorityStartDatePage)";\
    next }1' ../test/generators/PageGenerators.scala > tmp && mv tmp ../test/generators/PageGenerators.scala

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

echo "Migration AuthorityStartDate completed"


#PBS -N test_sidecar
#PBS -l mppwidth=24
#PBS -q debug
#PBS -l walltime=00:29:59
#PBS -j oe

cd $PBS_O_WORKDIR

WORKDIR=$SCRATCH/$PBS_JOBNAME.$PBS_JOBID

mkdir -p $WORKDIR

EXE=gridmovetest3d.Linux.g++.gfortran.MPI.ex
INPUTS=inputs_3d

cp $EXE $INPUTS $WORKDIR

cd $WORKDIR

aprun -n 24 ./$EXE $INPUTS


#!/usr/bin/bash

set -eo pipefail
#set -x

# clear the/all luks header slots with clevis config
# should be run before chroot while executing initrd
# also, clear tang server entries or let them timeout in few minutes

exit 1


# Create build dirs
mkdir build
mkdir out
cd build
# Build
cmake -DCMAKE_BUILD_TYPE=$BUILD_CONF ..
make -j$(nproc) all
# Copy binaries
cp ./programs/fiberchaind/fiberchaind ../out
cp ./programs/cli_wallet/cli_wallet ../out
cp ./programs/js_operation_serializer/js_operation_serializer ../out


#!/bin/sh
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# This script generates the sources for moby-containerd package.
# Git clone is a standard practice of producing source files for moby-* packages.

CONTAINERD_REPO=https://github.com/containerd/containerd.git
CONTAINERD_COMMIT=<PASSWORD>
VERSION=1.5.9+azure

mkdir -p /build/containerd-src
cd /build/containerd-src
git clone ${CONTAINERD_REPO} .
git fetch --tags origin ${CONTAINERD_COMMIT}
git checkout ${CONTAINERD_COMMIT}
cd /build/

tar --sort=name \
    --mtime="2021-04-26 00:00Z" \
    --owner=0 --group=0 --numeric-owner \
    --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime \
    -C /build/containerd-src -czf ./moby-containerd-${VERSION}.tar.gz .
rm -rf /build/containerd-src

echo "sources generated successfully @ /build/moby-containerd-${VERSION}.tar.gz"


while true;do
echo Making..
./make
echo brute
./brute
echo code
./code
if diff code.out brute.out;then
echo AC
else
echo WA
read p
fi
done


#!/bin/sh
# hem-* scripts source this file to bring in some useful helper
# functions.

# setup some common variables.
progname=$(basename $0)                       # hem-foo-bar
commname=$(echo "$progname" | sed 's/-/ /')   # hem foo-bar
workdir=$(pwd)
PS4=${PS4:-"+ "}

# die [<message>]
#
# Exit with a status of 1. If <message> is provided, write it to stderr before
# exiting.
die() {
	test $# -gt 0 && {
		echo >&2 "$commname:" "$@"
		log "$@"
	}
	exit 1
}

# usage
#
# Write program usage to stdout. This function does not exit.
usage() {
	echo "Usage: $commname $USAGE"
}

# see_usage [<message>]
#
# Show basic program usage and exit with status 1. If <message> is provided,
# write that message to stderr before anything else.
see_usage() {
	test $# -gt 0 &&
	echo >&2 "$commname:" "$@"
	echo "Usage: $commname $USAGE" | head -1
	echo "See: $commname --help"
	exit 1
}

if [ $# -gt 0 ] && [ "$1" = '--help' ] ; then
	usage
	exit 0
fi

# log <message>
#
# Log a message to the configured log destination. When log_to is empty,
# messages are logged using logger(1); otherwise, messages are written to the
# file specified.
#
# If verbose is set, the message is also written to stderr with a PS4 prefix.
log() {
	[ $verbose ] &&
	echo >&2 "${PS4}$progname:" "$@"
	if [ -n "$log_to" ] ; then
		echo "$(date +'%Y-%m-%d %H:%M:%S') $progname[$$]" "$@" >> "$log_to"
	else
		logger "$@"
	fi
}

# info <message>
#
# Write non-critical informational message to stdout unless the
# quiet environment variable is set. The message is also written to
# the log.
info() {
	[ $quiet ]   || echo "$@"
	[ $verbose ] || log "$@"
	return 0
}

# editor [<args>] <file>
#
# Open an editor with the arguments provided. Use VISUAL, EDITOR, and then vi;
# in that order.
editor() {
	VISUAL=${VISUAL:-}
	if [ -n "$VISUAL" ]; then
		$VISUAL "$@"
	else
		${EDITOR:-'vi'} "$@"
	fi
}

# tildize <path>
#
# Convert $HOMEs to tildes ("~") at the beginning of <path>.
tildize() {
	echo "${1:-}" | sed "s@^$HOME@~@"
	return 0
}

# remote_part [<user>@]<host>[:<port>]
#
# Convert a <remote> spec like '<EMAIL>:75' into its parts,
# setting the following variables:
#
#   remote_user     the user portion of the remote spec (or $USER)
#   remote_host     the host portion of the remote spec
#   remote_port     the port portion of the remote spec (or 22)
#
# TODO: this is pretty much insane. there's gotta be a better way of
# pulling these pieces apart.
remote_part() {
	if [ $(expr -- "$1" : '.*@') -gt 0 ]; then
		remote_user=$(echo "$1" | sed 's/\(.*\)@.*/\1/')
		remote_host=$(echo "$1" | sed 's/.*@\(.*\)/\1/')
	else
		remote_user="$USER"
		remote_host="$1"
	fi
	if [ $(expr -- "$remote_host" : '.*:') -gt 0 ]; then
		remote_port=$(echo "$remote_host" | sed 's/.*:\(.*\)/\1/')
		remote_host=$(echo "$remote_host" | sed 's/\(.*\):.*/\1/')
	else
		remote_port=22
	fi
	return 0
}

# ---------------------------------------------------------------------
# Profile Related Functions
# ---------------------------------------------------------------------

# profile_path <name>|<path>
#
# Outputs the path to a profile file given a profile name or profile
# path. No attempt is made to check that the profile exists or is
# syntactally valid.
#
# Most profile_XXX functions call this when they indicate a <profile>
# argument.
profile_path() {
	if [ "$(expr -- "$1" : '\/')" = 1 ] ; then
		echo "$1"
	else
		echo "$profile_dir"/"$1"
	fi
	return 0
}

# profile_check <profile>
#
# Check that a profile exists.
profile_exist() {
	test -f "$(profile_path $1)" &&
	return 0 ||
	return 1
}

# profile_load <profile>
#
# load the profile specified and set up some intelligent variable
# defaults.
profile_load() {
	profile_file=$(profile_path $1)
	profile_name=$(basename "$profile_file")

	# unset all profile variables
	for i in host port user remote pidfile statefile monitor_port tunnels \
		extra_args disabled
	do eval "$i=" ; done

	# source the profile
	import $profile_name

	# setup remote variables
	remote=${remote:-$profile_name}
	remote_part "$remote"
	host=${host:-$remote_host}
	port=${port:-$remote_port}
	user=${user:-$remote_user}

	# set misc/other variables
	pidfile=${pidfile:-$run_dir/$profile_name.pid}
	statefile=${statefile:-$state_dir/$profile_name}
	monitor_port=${monitor_port:-0}
	return 0
}

# profile_required <profile>
#
# Useful for scripts that take a number of arguments followed by
# a single <profile>.
profile_required() {
	test $# -gt 0 ||
	see_usage "no <profile> specified."
	profile_name="$1" ; shift
	profile_load "$profile_name"
}

# ---------------------------------------------------------------------
# Profile Helper Function Library
# ---------------------------------------------------------------------
# The following functions are designed to be used within hem profiles
# themselves.

# import <profile>
#
# Loads the configuration from the profile specified into the current
# profile. The <profile> argument may be a name relative to
# <profile_dir> or the full path to some other file.
import() {
	_p=$(profile_path "$1")
	if test -r "$_p" ; then
		. "$_p"
		return 0
	else
		die "profile not found: $(tildize $_p)"
	fi
}

# forward [<bind>:]<listen-port> [to] [<host>:]<forward-port> [<name>]
#
# Add a local port forward. SSH will listen on port <listen-port> on the
# interface <bind>. If no <bind> part is specified, the loopback interface
# is assumed. Connections made to the port are forwarded to <host> on
# <forward-port> on the remote side of the connection. If the <host> part
# is omitted, localhost is assumed.
forward() {
	tunnels="$tunnels -L$1"
	shift
	[ "$1" = "to" ] && shift
	[ $(expr -- "$1" : '.*:') -gt 0 ] &&
	tunnels="$tunnels:$1" ||
	tunnels="$tunnels:localhost:$1"
	return 0
}

# backward [<bind>:]<listen-port> [to] [<host>:]<forward-port> [<name>]
#
# Add a remote port forward. SSH will listen on port <listen-port> on the
# interface <bind> on the remote side of the connection. If no <bind> part
# is specified, the remote loopback interface is assumed. Connections made
# to the port will be forward to <host> on <forward-port> on the local side
# of the connection. If the <host> part is omitted, localhost is assumed.
backward() {
	tunnels="$tunnels -R$1"
	shift
	[ "$1" = "to" ] && shift
	[ $(expr -- "$1" : '.*:') -gt 0 ] &&
	tunnels="$tunnels:$1" ||
	tunnels="$tunnels:localhost:$1"
	return 0
}


<reponame>aclapes/breakfast-cnn-lstm<filename>dataset/download_videos.sh
USER=$1
PASSWORD=$2

OUTPUT_DIR=${3:-'../data/activitynet'}

mkdir -p OUTPUT_DIR

youtube-dl -i -a videos_ids.lst \
-o $OUTPUT_DIR'/%(id)s.%(ext)s' \
-f bestvideo[ext=mp4] \
-u $USER \
-p $PASSWORD


<filename>asset/gen/archcraft-openbox-style-select/Section/Model/_fzf_preview_area/Core.sh

################################################################################
### Head: Model mod_style_select__fzf_preview_area
##

mod_style_select__fzf_preview_area () {
	#echo "mod_style_select__fzf_preview_area"
	#echo "$@"

	# archcraft-openbox-style-select _fzf_preview_area

	sys_fzf_style_preview_main "$@"

}

##
### Tail: Model mod_style_select__fzf_preview_area
################################################################################


<filename>bedes-db/docker-entrypoint-initdb.d/initialize-db-and-user.sh
#!/bin/bash
set -e

psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL
    CREATE USER ${DB_USER} with encrypted password '${<PASSWORD>}';
    CREATE DATABASE ${DB_NAME};
    GRANT ALL PRIVILEGES ON DATABASE ${DB_NAME} TO ${DB_USER};
    ALTER DATABASE ${DB_NAME} OWNER TO ${DB_USER};
EOSQL

echo "build the tables..."

echo " build db-common"
psql -U ${DB_USER} \
     --single-transaction \
    --echo-all \
    --set ON_ERROR_STOP=on \
    -f /create-epb-db/db-common.sql \
    ${DB_NAME}

echo "done = $?"

echo "build eb-auth..."
psql -U ${DB_USER} \
     --single-transaction \
    --echo-all \
    --set ON_ERROR_STOP=on \
    -f /create-epb-db/db-auth.sql \
    ${DB_NAME}

echo "done = $?"

echo "build db-build..."
psql -U ${DB_USER} \
     --single-transaction \
    --echo-all \
    --set ON_ERROR_STOP=on \
    -f /create-epb-db/db-build.sql \
    ${DB_NAME}

echo "done = $?"


<filename>docker/build/dsp.sh<gh_stars>0
#!/bin/bash

docker build --tag default_apache .


#!/bin/bash

RESTORE='\033[0m'
ERROR='\033[00;31m'
PASS='\033[00;32m'
EM='\033[01;37m'
WARNING='\033[00;33m'

CURRENT_BASE="49.0.2623.75"
TARGET_BASE="50.0.2661.102"
SVN_SOURCE="/Users/zhaorui/49_svn/chromium49.0.2623.75/src/"

#
function isOnTrunk {
	return false
}

echo -e "${EM}reset branch 115 to 49.0.2623.75 checkout...${RESTORE}"
cd /Users/zhaorui/Chromium/src

git checkout -q $CURRENT_BASE
git branch -q -D 115 2> /dev/null
git checkout -b 115
#git reset --hard $CURRENT_BASE

#FIXME now we remove below repository manually
#If we are not at 49.0.2623.75, there must be different repo to remove
git clean -f -d
rm -rf third_party/flatbuffers
rm -rf third_party/libphonenumber/dist
rm -rf third_party/libvpx
rm -rf third_party/shaderc/

#gclient sync, not necessary
# gclient sync > /dev/null
# if [ "$?" -ne 0 ]; then
# 	echo -e "${WARNING}gclient sync failed, but let's go on...${RESTORE}"
# fi

echo -e "${EM}Merging 115 code to chromium ${RESTORE}"
rsync -a --delete --exclude-from="${SVN_SOURCE}/.gitignore" \
	  --exclude=".git" --exclude=".gitignore" 				\
	  --exclude="/third_party/WebKit/LayoutTests" 			\
	  --exclude="/third_party/android_platform"				\
	  --exclude="/third_party/libvpx"						\
	  --exclude="/third_party/libphonenumber/dist"			\
	  --exclude="/third_party/crashpad"						\
	  --exclude="/third_party/crashpad copy"				\
	  $SVN_SOURCE /Users/zhaorui/Chromium/src/

if [[ $? -ne 0 ]]; then
	echo -e "${ERROR} rsync failed to copy 115 source code to Chromium. errno: $? ${RESTORE}"
	exit 1
fi

git add -A .
git commit -m "Add 115 Patch"
PATCH_COMMIT=`git rev-list -n1 HEAD`
echo -e "Patch commit is ${PASS} ${PATCH_COMMIT} ${RESTORE}"
git clone --bare ../src ../src.git

# BACK_TO_MASTER_BASE=`echo $CURRENT_BASE | sed -e "s/^\(.*\)\..*$/\1.0/"`
# echo -e "${EM}Moving to ${BACK_TO_MASTER_BASE} ${RESTORE}"
# git branch -q -d 115onMaster
# git checkout -b 115onMaster ${BACK_TO_MASTER_BASE}^
# git cherry-pick $PATCH_COMMIT

# #FIXME should be a do-while loop here
# if [[ $? -ne 0 ]]; then
# 	echo -e "${WARNING}git cherry-pick failed to patch 115 to ${BACK_TO_MASTER_BASE} ${RESTORE}"
# 	echo -e "${WARNING}Run git mergetool to continue... ${RESTORE}"
# 	# git diff --name-only --diff-filter=U
# 	while :
# 	do
# 		git mergetool
# 		git cherry-pick --continue
# 		if [[ $? -eq 0 ]]; then
# 			break
# 		fi
# 	done
# fi

# git rebase 50.0.2625.0^

cd - > /dev/null


#!/usr/bin/env bash
#pandoc -f markdown -t rst README.md > README.rst
#python3 setup.py sdist upload -r pypitest

pandoc -f markdown -t rst README.md > README.rst
python3 setup.py sdist upload


<reponame>purrfectgrape/wmt2021
#! /bin/bash
# Author: <NAME>
# Bash script to apply processing steps to datasets.
# This processing step doesn't include adding voice tags to the data. The resulting data from this processing file serve as the baseline for our expeirments.
# This file needs to be refactored later.

DIR=`dirname "$0"`
BASE=$DIR/..
SRC=ja
TRG=en

BPE_NUM_OPS=25000
BPE_VOCAB_THRES=50

while getopts ":c:" opt; do
  case $opt in
    c)
      # Based on SOCKEYE's processing steps:
      echo "Processing $OPTARG data for English" >&2
      echo "Normalizing punctuation"
      cat $BASE/data/$OPTARG-en-raw.txt | $BASE/libraries/moses/scripts/tokenizer/normalize-punctuation.perl -l en > $BASE/data/$OPTARG-en-punc-normalized.txt

      echo "Removing non printing char"
      cat $BASE/data/$OPTARG-en-punc-normalized.txt | $BASE/libraries/moses/scripts/tokenizer/remove-non-printing-char.perl -l en > $BASE/data/$OPTARG-en-punc-normalized1.txt

      echo "Tokenizing English data"
      cat $BASE/data/$OPTARG-en-punc-normalized1.txt | $BASE/libraries/moses/scripts/tokenizer/tokenizer.perl -no-escape -l en -protected=$BASE/libraries/moses/scripts/tokenizer/basic-protected-patterns > $BASE/data/$OPTARG-en-tok.txt

      echo "Learn byte pair encoding for English"
      # Not sure if I can use the same input file for learn-bpe and apply-bpe?
      subword-nmt learn-bpe -s $BPE_NUM_OPS < $BASE/data/$OPTARG-en-tok.txt > $BASE/data/$OPTARG-en-bpe.txt
      subword-nmt apply-bpe -c $BASE/data/$OPTARG-en-bpe.txt < $BASE/data/$OPTARG-en-tok.txt > $BASE/data/$OPTARG-tok-bpe.en

#      echo "Building vocab"
#      mkdir $BASE/shared_models
#      python3 $BASE/libraries/joeynmt/scripts/build_vocab.py $BASE/data/train-tok-bpe-clean.ja $BASE/data/train-tok-bpe-clean.en --output_path $BASE/shared_models/vocab.txt
       ;;
    \?)
      echo "Usage: cmd [-c]"
      echo "Options for data processing are train, dev, test, train-para, dev-para, and test-para"
      ;;
  esac
done

# Checking parallel files
echo "WORD COUNT:"
for c in train dev test train-para dev-para test-para; do
    echo "corpus: " $c
    wc -l $BASE/data/$c-tok-bpe.en
    echo "hiragana: " $c
    wc -l $BASE/data/$c-tok-bpe-hiragana.en
    echo "romaji: " $c
    wc -l $BASE/data/$c-tok-bpe-romaji.en
done

#wc -l $BASE/shared_models/*


function split_feature_scenarios() {
  local split_feature_scenarios_FEATURE
  local split_feature_scenarios_FEATURE_FILES=()
  local split_feature_scenarios_FEATURE_FILE
  local split_feature_scenarios_SPLITTED_FILE
  local split_feature_scenarios_SPLITTED_DIR

  for split_feature_scenarios_FEATURE in $@
  do
    if [ -d $split_feature_scenarios_FEATURE ]; then
      for split_feature_scenarios_FEATURE_FILE in `find $split_feature_scenarios_FEATURE -type f -name "*.feature"`
      do
        split_feature_scenarios $split_feature_scenarios_FEATURE_FILE || return $?
      done
    fi
  done

  local split_feature_scenarios_LINES
  local split_feature_scenarios_FIRST_SCENARIO_LINE
  local split_feature_scenarios_CONTENT_BEFORE_FIRST_SCENARIO
  local split_feature_scenarios_LINE
  local split_feature_scenarios_ENDING_LINE
  local split_feature_scenarios_DIRECTORY
  local split_feature_scenarios_SPLITTED_FILE_LINES
  local split_feature_scenarios_EXAMPLES_LINE
  local split_feature_scenarios_SPLITTED_EXAMPLES_DIRECTORY
  local split_feature_scenarios_SPLITTED_EXAMPLES_FILE
  local split_feature_scenarios_SPLITTED_EXAMPLES_FILE_COUNTER
  local split_feature_scenarios_TOTAL_LINES
  for split_feature_scenarios_FEATURE in $@
  do
    if [ -f $split_feature_scenarios_FEATURE ]; then
      split_feature_scenarios_TOTAL_LINES=`echo $(cat $split_feature_scenarios_FEATURE | wc -l)`
      split_feature_scenarios_LINES_REMAINING=`cucumber_scenarios_or_tags_at_lines $split_feature_scenarios_FEATURE`
      split_feature_scenarios_FIRST_SCENARIO_LINE=`echo $split_feature_scenarios_LINES_REMAINING | head -n 1`
      split_feature_scenarios_CONTENT_BEFORE_FIRST_SCENARIO=`cat $split_feature_scenarios_FEATURE | head -n \`expr $split_feature_scenarios_FIRST_SCENARIO_LINE - 1\``
      split_feature_scenarios_DIRECTORY="${split_feature_scenarios_FEATURE}_splitted"
      if [ ! -d $split_feature_scenarios_DIRECTORY ]; then
        mkdir $split_feature_scenarios_DIRECTORY
      fi
      for split_feature_scenarios_LINE in `cucumber_scenarios_or_tags_at_lines $split_feature_scenarios_FEATURE`
      do
        split_feature_scenarios_LINES_REMAINING=`echo $split_feature_scenarios_LINES_REMAINING | grep -v "^$split_feature_scenarios_LINE$"`
        split_feature_scenarios_ENDING_LINE=`expr \`echo $split_feature_scenarios_LINES_REMAINING | head -n 1\` - 1 2>/dev/null`
        if [ $? -gt 0 ]; then
          split_feature_scenarios_ENDING_LINE=$split_feature_scenarios_TOTAL_LINES
        fi

        split_feature_scenarios_SPLITTED_FILE="$split_feature_scenarios_DIRECTORY/$split_feature_scenarios_LINE.feature"
        echo $split_feature_scenarios_CONTENT_BEFORE_FIRST_SCENARIO > $split_feature_scenarios_SPLITTED_FILE
        sed -n $split_feature_scenarios_LINE,${split_feature_scenarios_ENDING_LINE}p $split_feature_scenarios_FEATURE >> $split_feature_scenarios_SPLITTED_FILE
        cat $split_feature_scenarios_SPLITTED_FILE | grep -q "Scenario Outline: "
        if [ $? -eq 0 ]; then
          split_feature_scenarios_SPLITTED_FILE_LINES=`echo $(cat $split_feature_scenarios_SPLITTED_FILE | wc -l)`
          split_feature_scenarios_SPLITTED_EXAMPLES_DIRECTORY="${split_feature_scenarios_SPLITTED_FILE}_examples"
          if [ ! -d $split_feature_scenarios_SPLITTED_EXAMPLES_DIRECTORY ]; then
            mkdir -p $split_feature_scenarios_SPLITTED_EXAMPLES_DIRECTORY
          fi
          for split_feature_scenarios_EXAMPLES_LINE in `grep -n "Examples:" $split_feature_scenarios_SPLITTED_FILE | cut -f 1 -d :`
          do
            split_feature_scenarios_EXAMPLES_LINE=`expr $split_feature_scenarios_EXAMPLES_LINE + 1`
            split_feature_scenarios_SPLITTED_EXAMPLES_FILE_COUNTER=`expr $split_feature_scenarios_EXAMPLES_LINE + 1`
            while [ $split_feature_scenarios_SPLITTED_EXAMPLES_FILE_COUNTER -lt $split_feature_scenarios_SPLITTED_FILE_LINES ]; do
              split_feature_scenarios_SPLITTED_EXAMPLES_FILE="$split_feature_scenarios_SPLITTED_EXAMPLES_DIRECTORY/$split_feature_scenarios_SPLITTED_EXAMPLES_FILE_COUNTER.feature"
              sed -n 1,${split_feature_scenarios_EXAMPLES_LINE}p $split_feature_scenarios_SPLITTED_FILE > $split_feature_scenarios_SPLITTED_EXAMPLES_FILE
              sed -n ${split_feature_scenarios_SPLITTED_EXAMPLES_FILE_COUNTER}p $split_feature_scenarios_SPLITTED_FILE >> $split_feature_scenarios_SPLITTED_EXAMPLES_FILE
              split_feature_scenarios_SPLITTED_EXAMPLES_FILE_COUNTER=`expr $split_feature_scenarios_SPLITTED_EXAMPLES_FILE_COUNTER + 1`
            done
            rm -f $split_feature_scenarios_SPLITTED_FILE
          done
        fi
      done
      echo $split_feature_scenarios_DIRECTORY
    fi
  done
}


#!/bin/bash
# author : <NAME>
# email : <EMAIL>
#
# required :
# - bash
# - wget

# download files from ftp
function download_ftp() {

    release="2019_09"

    out_dir=""
    if [ -z $1 ]
    then
        outdir=ebi_mgnify_uhgp90_$release
    else
        outdir=$1/ebi_mgnify_uhgp90_$release
    fi
    mkdir -p $outdir && cd $outdir

    echo "Downloading EBI Mgnify Protein Catalogue $release [$outdir].."
    wget http://ftp.ebi.ac.uk/pub/databases/metagenomics/mgnify_genomes/human-gut/v1.0/uhgp_catalogue/uhgp-90.tar.gz

}

# organize files into sub-directories
function organize_files () {

    echo -e "\n\nMerging Mgnify Data.."
    dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
    tar -zxvf uhgp-90.tar.gz uhgp-90/uhgp-90_hq.faa uhgp-90/uhgp-90_eggNOG.tsv
    python $dir/ebi_mgnify_uhgp.py uhgp-90/uhgp-90_hq.faa uhgp-90/uhgp-90_eggNOG.tsv > uhgp-90.tsv
    rm -fr uhgp-90.tar.gz uhgp-90/

}

download_ftp $1
organize_files


#!/bin/sh

cwd=`dirname "$0"`
expr "$0" : "/.*" > /dev/null || cwd=`(cd "$cwd" && pwd)`

MYSQL_USER="<mysql user>"
MYSQL_PASSWORD="<<PASSWORD>>"
MYSQL_DATABASE="azurevote"  # fixed
MYSQL_HOST="<mysql host>"
FLASK_CONFIG_FILE_PATH="/app/config_file.cfg" # default

version=`cat $cwd/../azure-vote/VERSION`
tag="$version"
echo "tag=$tag"

docker run --rm \
    -e MYSQL_USER=$MYSQL_USER \
    -e MYSQL_PASSWORD=$<PASSWORD> \
    -e MYSQL_DATABASE=$MYSQL_DATABASE \
    -e MYSQL_HOST=$MYSQL_HOST \
    -e FLASK_CONFIG_FILE_PATH="$FLASK_CONFIG_FILE_PATH" \
    -p 8080:80 -it azure-vote-front:$tag


<gh_stars>1-10
#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

## @description  download nvidia docker bin
## @audience     public
## @stability    stable
function download_nvidia_docker_bin()
{
  # download http server
  if [[ -n "$DOWNLOAD_HTTP" ]]; then
    MY_NVIDIA_DOCKER_RPM_URL="${DOWNLOAD_HTTP}/downloads/nvidia-docker/${NVIDIA_DOCKER_RPM}"
  else
    MY_NVIDIA_DOCKER_RPM_URL=${NVIDIA_DOCKER_RPM_URL}
  fi

  if [[ -f "${DOWNLOAD_DIR}/nvidia-docker/${NVIDIA_DOCKER_RPM}" ]]; then
    echo "${DOWNLOAD_DIR}/nvidia-docker/${NVIDIA_DOCKER_RPM} is exist."
  else
    echo "download ${MY_NVIDIA_DOCKER_RPM_URL} ..."
    wget -P ${DOWNLOAD_DIR}/nvidia-docker/ ${MY_NVIDIA_DOCKER_RPM_URL}
  fi
}

## @description  install nvidia docker
## @audience     public
## @stability    stable
function install_nvidia_docker()
{
  download_nvidia_docker_bin

  sudo rpm -i ${DOWNLOAD_DIR}/nvidia-docker/${NVIDIA_DOCKER_RPM}

  echo -e "\033[32m===== Start nvidia-docker =====\033[0m"
  sudo systemctl start nvidia-docker

  echo -e "\033[32m===== Check nvidia-docker status =====\033[0m"
  systemctl status nvidia-docker

  echo -e "\033[32m===== Check nvidia-docker log =====\033[0m"
  journalctl -u nvidia-docker

  echo -e "\033[32m===== Test nvidia-docker-plugin =====\033[0m"
  curl http://localhost:3476/v1.0/docker/cli

  # create nvidia driver library path
  if [ ! -d "/var/lib/nvidia-docker/volumes/nvidia_driver" ]; then
    echo "WARN: /var/lib/nvidia-docker/volumes/nvidia_driver folder path is not exist!"
    mkdir -p /var/lib/nvidia-docker/volumes/nvidia_driver
  fi

  local nvidiaVersion=`get_nvidia_version`
  echo -e "\033[31m nvidia detect version is ${nvidiaVersion}\033[0m"

  mkdir /var/lib/nvidia-docker/volumes/nvidia_driver/${nvidiaVersion}
  mkdir /var/lib/nvidia-docker/volumes/nvidia_driver/${nvidiaVersion}/bin
  mkdir /var/lib/nvidia-docker/volumes/nvidia_driver/${nvidiaVersion}/lib64

  cp /usr/bin/nvidia* /var/lib/nvidia-docker/volumes/nvidia_driver/${nvidiaVersion}/bin
  cp /usr/lib64/libcuda* /var/lib/nvidia-docker/volumes/nvidia_driver/${nvidiaVersion}/lib64
  cp /usr/lib64/libnvidia* /var/lib/nvidia-docker/volumes/nvidia_driver/${nvidiaVersion}/lib64

  echo -e "\033[32m===== Please manually execute the following command =====\033[0m"
  echo -e "\033[32mshell:> nvidia-docker run --rm ${DOCKER_REGISTRY}/nvidia/cuda:9.0-devel nvidia-smi
# If you don't see the list of graphics cards above, the NVIDIA driver installation failed. =====
\033[0m"

  echo -e "\033[32m===== Please manually execute the following command =====\033[0m"
  echo -e "\033[32m# Test with tf.test.is_gpu_available()
shell:> nvidia-docker run -it ${DOCKER_REGISTRY}/tensorflow/tensorflow:1.9.0-gpu bash
# In docker container
container:> python
python:> import tensorflow as tf
python:> tf.test.is_gpu_available()
python:> exit()
\033[0m"
}

## @description  uninstall nvidia docker
## @audience     public
## @stability    stable
function uninstall_nvidia_docker()
{
  echo "This method is not implemented."
}


<filename>cmd/example/client.sh
#! /bin/bash

go run client/main.go


<reponame>deshpandeamith/poker
#!/bin/bash

start() {
   #update DNS
   curl -X POST https://$USER:$PASSWD@domains.google.com/nic/update?hostname=poker.goli.dev
   echo

   #renew certs
   /usr/local/bin/certbot-auto renew

   #start server
   cd /home/ec2-user/Poker
   PORT=443 /usr/bin/npm run start
}

stop() {
   kill $(pidof npm)
}

case $1 in
  start|stop) "$1" ;;
esac


#!/usr/bin/env bash

gem install dashing
dashing new sweet_dashboard_project
cd sweet_dashboard_project
bundle


<reponame>ibloe/drive-opcua-docker<gh_stars>0
#!/bin/bash +e
# catch signals as PID 1 in a container

# SIGNAL-handler
term_handler() {

  echo "terminating ssh ..."
  /etc/init.d/ssh stop

  exit 143; # 128 + 15 -- SIGTERM
}

# on callback, stop all started processes in term_handler
trap 'kill ${!}; term_handler' INT KILL TERM QUIT TSTP STOP HUP

# run applications in the background
echo "starting ssh ..."
/etc/init.d/ssh start

echo "start python drive application"
sudo nohup python /home/pi/opc-ua-server/drive.py &
#sudo python /home/pi/opc-ua-server/drive.py
echo "starting opc-ua-server"
/home/pi/opc-ua-server/StepMotorOpcServer

# wait forever not to exit the container
while true
do
  tail -f /dev/null & wait ${!}
done

exit 0


<reponame>sseefried/angular-2.0.0-rc4-shallow
#!/usr/bin/env bash

set -ex -o pipefail

if [[ ${TRAVIS} && ${CI_MODE} != "browserstack_required" && ${CI_MODE} != "browserstack_optional" ]]; then
  exit 0;
fi

echo 'travis_fold:start:test_browserstack'

# Setup environment
cd `dirname $0`
source ./env.sh
cd ../..

./scripts/browserstack/waitfor_tunnel.sh
export BROWSER_STACK_ACCESS_KEY=`echo $BROWSER_STACK_ACCESS_KEY | rev`
$(npm bin)/karma start ./karma-js.conf.js --single-run --browsers=${KARMA_JS_BROWSERS}

echo 'travis_fold:end:test_browserstack'


# run to extract tars needed:
# extracts:
#   GMM input data
#   ASR pretrained model
#   Stemmer larger input
#   Regex inputs

find . -name '*.tar.gz' -exec sh -c 'tar -xzvf {} -C $(dirname {})' \;


<gh_stars>0
#
# key bindings
#

# set emacs mode
bindkey -e

# create a zkbd compatible hash;
# to add other keys to this hash, see: man 5 terminfo
typeset -g -A key

#key[Home]="${terminfo[khome]}"
#key[End]="${terminfo[kend]}"
#key[Insert]="${terminfo[kich1]}"
key[Backspace]="${terminfo[kbs]}"
key[Delete]="${terminfo[kdch1]}"
key[Up]="${terminfo[kcuu1]}"
key[Down]="${terminfo[kcud1]}"
key[Left]="${terminfo[kcub1]}"
key[Right]="${terminfo[kcuf1]}"
key[PageUp]="${terminfo[kpp]}"
key[PageDown]="${terminfo[knp]}"
key[ShiftTab]="${terminfo[kcbt]}"

# setup history search
autoload -Uz up-line-or-beginning-search down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search

# key bindings
[[ -n "${key[Backspace]}" ]] && bindkey -- "${key[Backspace]}" backward-delete-char
[[ -n "${key[Delete]}"    ]] && bindkey -- "${key[Delete]}"    delete-char
[[ -n "${key[Up]}"        ]] && bindkey -- "${key[Up]}"        up-line-or-beginning-search
[[ -n "${key[Down]}"      ]] && bindkey -- "${key[Down]}"      down-line-or-beginning-search
[[ -n "${key[PageUp]}"    ]] && bindkey -- "${key[PageUp]}"    up-line-or-history
[[ -n "${key[PageDown]}"  ]] && bindkey -- "${key[PageDown]}"  down-line-or-history
[[ -n "${key[ShiftTab]}"  ]] && bindkey -- "${key[ShiftTab]}"  reverse-menu-complete
bindkey '^[[1;5C' forward-word  # [Ctrl-RightArrow] - move forward one word
bindkey '^[[1;5D' backward-word # [Ctrl-LeftArrow]  - move backward one word

# Finally, make sure the terminal is in application mode, when zle is
# active. Only then are the values from $terminfo valid.
if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )); then
  autoload -Uz add-zle-hook-widget
  zle_application_mode_start() {
    echoti smkx
  }
  zle_application_mode_stop() {
    echoti rmkx
  }
  add-zle-hook-widget -Uz zle-line-init zle_application_mode_start
  add-zle-hook-widget -Uz zle-line-finish zle_application_mode_stop
fi

# vim: ft=zsh expandtab tabstop=2 shiftwidth=2


#!/bin/bash

set -euo pipefail

# "script-and-regex.regex": "/^(?P<severity>.*?)\n(?P<message>.*?)\n(?P<line>\\d),(?P<char>\\d)(\n(?P<original>.*?)>>>>\n(?P<replacement>.*?)<<<<?)$/s",

# Arcanist linter that invokes clang-format via clang/tools/clang-format/clang-format-diff.py
# stdout from this script is parsed into a regex and used by Arcanist.
# https://secure.phabricator.com/book/phabricator/article/arcanist_lint_script_and_regex/

# To skip running all linters when creating/updating a diff, use `arc diff --nolint`.

# advice severity level is completely non-disruptive.
# switch to warning or error if you want to prompt the user.
if ! hash clang-format >/dev/null; then
  echo "advice"
  echo "clang-format not found in user’s local PATH; not linting file."
  echo "===="
  exit 0
fi
if ! git rev-parse --git-dir >/dev/null; then
  echo "advice"
  echo "not in git repostitory; not linting file."
  echo "===="
  exit 0
fi

src_file="${1}"
original_file="$(mktemp)"
formatted_file="$(mktemp)"
readonly src_file
readonly original_file
readonly formatted_file
cp -p "${src_file}" "${original_file}"
cp -p "${src_file}" "${formatted_file}"

cleanup() {
  rc=$?
  rm "${formatted_file}" "${original_file}"
  exit ${rc}
}
trap 'cleanup' INT HUP QUIT TERM EXIT

# Arcanist can filter out lint messages for unchanged lines, but for that, we
# need to generate line by line lint messages. Instead, we generate one lint
# message on line 1, char 1 with file content edited using clang-format-diff.py
#
# We do not use git-clang-format because it wants to modify the index,
# and arc is already holding the lock.
#
# We do not look for clang-format-diff or clang-format-diff.py in the PATH
# because whether/how these are installed differs between distributions,
# and we have an executable copy in the tree anyway.
arc_base_commit=$(arc which --show-base)
git diff-index -U0 "${arc_base_commit}" "${src_file}" \
  | clang/tools/clang-format/clang-format-diff.py -style file -i -p1

cp -p "${src_file}" "${formatted_file}"
cp -p "${original_file}" "${src_file}"
if ! diff -q "${src_file}" "${formatted_file}" > /dev/null ; then
  echo "autofix"
  echo "clang-format suggested style edits found:"
  echo "1,1"  # line,char of start of replacement.
  cat "${src_file}"
  echo ">>>>"
  cat "${formatted_file}"
  echo "<<<<"
fi


#!/bin/bash

bin=`dirname "$0"`
bin=`cd "$bin"; pwd`

actual="$bin"/../actual
expected="$bin"/../expected

for f in $expected/ch11/grunt/*.xml; do
  echo $f
  f_actual=$actual/ch11/grunt/`basename $f`
  diff $f $f_actual > /dev/null
  if [ $? != 0 ]; then
    echo "Expected file $f different to actual $f_actual:"
    diff $f $f_actual
    exit 1
  fi
done


<gh_stars>1-10
function wrkbench {
    ssh -p "$WRKPORT" -i "$WRKSSH" "$WRKUSER@$WRKREMOTE" wrk -d "$WRKTIME" -t "$WRKTHREAD" -c "$WRKCONNS" "$WRKURL/$WRKFILE"
}


<filename>pyopengl/post-link.sh
#!/bin/bash

cat <<EOF >> ${PREFIX}/.messages.txt
This is an install message from the pyopengl package.
EOF


<filename>scripts/os_configure.sh
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
shopt -s nullglob nocaseglob

# /usr/local/bin
if ! [[ -d /usr/local/bin ]]; then
  sudo mkdir -p /usr/local/bin
fi

# install cliclick
/usr/bin/sudo mv ~/cliclick /usr/local/bin/cliclick

# install tccutil.py
sudo mv ~/tccutil.py /usr/local/bin/

# get rid of notifications
launchctl unload /System/Library/LaunchAgents/com.apple.notificationcenterui.plist

# Let's try and get rid of a few security warnings and needed approvals

if [[ $(csrutil status) =~ "disabled" ]]; then

  sudo sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db "INSERT OR REPLACE INTO access(service, client, client_type, auth_value, auth_reason, auth_version, csreq, policy_id, indirect_object_identifier_type, indirect_object_identifier, indirect_object_code_identity, flags, last_modified) VALUES('kTCCServiceAccessibility', '/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/Support/AEServer', 1, 1, 4, 1, x'fade0c000000003000000001000000060000000200000012636f6d2e6170706c652e4145536572766572000000000003', NULL, 0, 'UNUSED', NULL, 0, 1646855925);"
  sudo sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db "INSERT OR REPLACE INTO access(service, client, client_type, auth_value, auth_reason, auth_version, csreq, policy_id, indirect_object_identifier_type, indirect_object_identifier, indirect_object_code_identity, flags, last_modified) VALUES('kTCCServiceAccessibility', '/Library/Application Support/VMware Tools/vmware-tools-daemon', 1, 2, 4, 1, NULL, NULL, 0, 'UNUSED', NULL, 0, 0);"
  sudo sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db "INSERT OR REPLACE INTO access(service, client, client_type, auth_value, auth_reason, auth_version, csreq, policy_id, indirect_object_identifier_type, indirect_object_identifier, indirect_object_code_identity, flags, last_modified) VALUES('kTCCServiceAccessibility', '/usr/local/bin/cliclick', 1, 2, 4, 1, NULL, NULL, 0, 'UNUSED', NULL, 0, 0);"
  sudo sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db "INSERT OR REPLACE INTO access(service, client, client_type, auth_value, auth_reason, auth_version, csreq, policy_id, indirect_object_identifier_type, indirect_object_identifier, indirect_object_code_identity, flags, last_modified) VALUES('kTCCServiceAccessibility', '/usr/libexec/sshd-keygen-wrapper', 1, 2, 4, 1, NULL, NULL, 0, 'UNUSED', NULL, 0, 0);"
  sudo sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db "INSERT OR REPLACE INTO access(service, client, client_type, auth_value, auth_reason, auth_version, csreq, policy_id, indirect_object_identifier_type, indirect_object_identifier, indirect_object_code_identity, flags, last_modified) VALUES('kTCCServiceDeveloperTool', 'com.apple.Terminal', 0, 0, 4, 1, NULL, NULL, 0, 'UNUSED', NULL, 0, 1646856644);"
  sudo sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db "INSERT OR REPLACE INTO access(service, client, client_type, auth_value, auth_reason, auth_version, csreq, policy_id, indirect_object_identifier_type, indirect_object_identifier, indirect_object_code_identity, flags, last_modified) VALUES('kTCCServiceSystemPolicyAllFiles', 'com.apple.Terminal', 0, 0, 5, 1, x'fade0c000000003000000001000000060000000200000012636f6d2e6170706c652e5465726d696e616c000000000003', NULL, NULL, 'UNUSED', NULL, 0, 1647143564);"
  sudo sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db "INSERT OR REPLACE INTO access(service, client, client_type, auth_value, auth_reason, auth_version, csreq, policy_id, indirect_object_identifier_type, indirect_object_identifier, indirect_object_code_identity, flags, last_modified) VALUES('kTCCServiceSystemPolicyAllFiles', '/bin/bash', 0, 0, 5, 1, x'fade0c000000003000000001000000060000000200000012636f6d2e6170706c652e5465726d696e616c000000000003', NULL, NULL, 'UNUSED', NULL, 0, 1647143564);"

  defaults write NSGlobalDomain AppleKeyboardUIMode -int 3

  ## use UI automation to approve VMware Kernel Extensions
  # dismiss kernel ext dialog
  /usr/local/bin/cliclick -m verbose c:515,360
  # Open System Preferences to security
  open "x-apple.systempreferences:com.apple.preference.security?General"
  sleep 5
  # click lock icon
  /usr/local/bin/cliclick -m verbose c:220,632 w:2000
  # input password
  /usr/local/bin/cliclick -m verbose "t:${USER_PASSWORD}" w:2000
  # submit password
  /usr/local/bin/cliclick -m verbose kp:enter w:3000
  # click allow button for kext
  /usr/local/bin/cliclick -m verbose c:750,545 w:2000
  # confirm reboot
  /usr/local/bin/cliclick -m verbose kp:space
  echo "rebooting"
  sleep 1
  pkill "System Preferences" || true
  # Wait for ssh to stop responding
  sleep 30
else
  echo "sip is enabled skipping some config changes"
fi

exit 0


#!/bin/sh
#apt-get install <package name> -y

#add repository that contains older version of NodeJS
add-apt-repository ppa:chris-lea/node.js

apt-get update  # To get the latest package lists

#install specific version of NodeJS
apt-get install nodejs=0.10.37-1chl1~trusty1 -y

#install MeteorJS vesion 1.0
curl "https://install.meteor.com/?release=1.0" | sh

#install NGINX
apt-get install nginx


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

function printUsage() {
    echo -e "Usage: Run command with related environment variable set"
    echo
    echo -e 'Environment Variable "$FLUID_FUSE_MOUNTPOINT" is set:'
    echo -e " PATH1:PATH2:PATH3..."

}

function main() {
    if [[ -z "$FLUID_FUSE_MOUNTPOINT" ]]; then
        printUsage
        exit 1
    fi
    chmod -R 0777 $FLUID_FUSE_MOUNTPOINT
}

main "$@"


# Simple scaling study using polyethylene chain of 1024 atoms and 12,288 atoms
# using MPI + OpenmP
export OMPI_MCA_opal_paffinity_alone=0
export OMP_NUM_THREADS=16
mpirun -np 1 -bynode -x OMP_NUM_THREADS ../bin/CoSP2Parallel --hmatName data/hmatrix.1024.mtx -N 12288 -M 256
mpirun -np 2 -bynode -x OMP_NUM_THREADS ../bin/CoSP2Parallel --hmatName data/hmatrix.1024.mtx -N 12288 -M 256
mpirun -np 4 -bynode -x OMP_NUM_THREADS ../bin/CoSP2Parallel --hmatName data/hmatrix.1024.mtx -N 12288 -M 256
mpirun -np 8 -bynode -x OMP_NUM_THREADS ../bin/CoSP2Parallel --hmatName data/hmatrix.1024.mtx -N 12288 -M 256
mpirun -np 16 -bynode -x OMP_NUM_THREADS ../bin/CoSP2Parallel --hmatName data/hmatrix.1024.mtx -N 12288 -M 256


#!/usr/bin/env bash

if [ -z `which sed` ]; then
  echo "Missing sed"
  exit 1
fi

if [ -z "$1" ]; then
  echo "Missing short type (e.g. prismarine_brick)"
  exit 1
fi

if [ -z "$2" ]; then
  LONGTYPE=$1
else
  LONGTYPE=$2
fi

TYPE=$1
THISMOD="charm"
DATA="../src/main/resources/data/${THISMOD}"
ASSETS="../src/main/resources/assets/${THISMOD}"
SOURCE="./slabs_stairs_walls"

copy_replace() {
  SRC=$1
  DEST=$2
  IT=$3

  cp "${SRC}" "${DEST}"
  sed -i "s/LONGTYPE/${LONGTYPE}/g" "${DEST}"
  sed -i "s/TYPE/${TYPE}/g" "${DEST}"
  sed -i "s/NAMESPACE/${NAMESPACE}/g" "${DEST}"
  sed -i "s/THISMOD/${THISMOD}/g" "${DEST}"

  if [ -n "${IT}" ]; then
    sed -i "s/?/${IT}/g" "${DEST}"
  fi
}

add_tags() {
  # walls
  for f in "${DATA}/minecraft/tags/blocks/walls.json"
  do
    if [ -e "$f" ]; then
      remove_last_entry "${f}" "]" "}"

      {
        echo "    \"${THISMOD}:${TYPE}_wall\"";
        echo "  ]"
        echo "}"
      } >> $f
      strip_empty_lines $f
    fi
  done
}

add_lang_strings() {
  NAME="$(tr '[:lower:]' '[:upper:]' <<< ${TYPE:0:1})${TYPE:1}"
  LANGFILE="${ASSETS}/lang/en_us.json"
  remove_last_entry "${LANGFILE}" "}"

  # add new lang entries
  {
    echo "  \"block.${THISMOD}.${TYPE}_slab\": \"${NAME} Slab\",";
    echo "  \"block.${THISMOD}.${TYPE}_stairs\": \"${NAME} Stairs\","
    echo "  \"block.${THISMOD}.${TYPE}_wall\": \"${NAME} Wall\"";
    echo "}"
  } >> $LANGFILE
}

remove_last_entry() {
  sed -i ':a;N;$!ba;s/"\n/",\n/g' "${1}" # add a comma after the last entry
  sed -i "s/${2}//g" "${1}" # remove bracket
  if [ -n "$3" ]; then
    sed -i "s/${3}//g" "${1}" # remove bracket
  fi
}

strip_empty_lines() {
  sed -i '/^ *$/d' "${1}"
}

# blockstates
copy_replace "${SOURCE}/blockstates/slab.json" "${ASSETS}/blockstates/${TYPE}_slab.json"
copy_replace "${SOURCE}/blockstates/stairs.json" "${ASSETS}/blockstates/${TYPE}_stairs.json"
copy_replace "${SOURCE}/blockstates/wall.json" "${ASSETS}/blockstates/${TYPE}_wall.json"

# models/block
copy_replace "${SOURCE}/models/block/slab.json" "${ASSETS}/models/block/${TYPE}_slab.json"
copy_replace "${SOURCE}/models/block/slab_top.json" "${ASSETS}/models/block/${TYPE}_slab_top.json"
copy_replace "${SOURCE}/models/block/stairs.json" "${ASSETS}/models/block/${TYPE}_stairs.json"
copy_replace "${SOURCE}/models/block/stairs_inner.json" "${ASSETS}/models/block/${TYPE}_stairs_inner.json"
copy_replace "${SOURCE}/models/block/stairs_outer.json" "${ASSETS}/models/block/${TYPE}_stairs_outer.json"
copy_replace "${SOURCE}/models/block/wall_inventory.json" "${ASSETS}/models/block/${TYPE}_wall_inventory.json"
copy_replace "${SOURCE}/models/block/wall_post.json" "${ASSETS}/models/block/${TYPE}_wall_post.json"
copy_replace "${SOURCE}/models/block/wall_side.json" "${ASSETS}/models/block/${TYPE}_wall_side.json"
copy_replace "${SOURCE}/models/block/wall_side_tall.json" "${ASSETS}/models/block/${TYPE}_wall_side_tall.json"

# models/item
copy_replace "${SOURCE}/models/item/slab.json" "${ASSETS}/models/item/${TYPE}_slab.json"
copy_replace "${SOURCE}/models/item/stairs.json" "${ASSETS}/models/item/${TYPE}_stairs.json"
copy_replace "${SOURCE}/models/item/wall.json" "${ASSETS}/models/item/${TYPE}_wall.json"

# loot_tables/blocks
copy_replace "${SOURCE}/loot_tables/blocks/slab.json" "${DATA}/loot_tables/blocks/${TYPE}_slab.json"
copy_replace "${SOURCE}/loot_tables/blocks/stairs.json" "${DATA}/loot_tables/blocks/${TYPE}_stairs.json"
copy_replace "${SOURCE}/loot_tables/blocks/wall.json" "${DATA}/loot_tables/blocks/${TYPE}_wall.json"

# recipes
mkdir -p "${DATA}/recipes/${TYPE}"
copy_replace "${SOURCE}/recipes/slab.json" "${DATA}/recipes/${TYPE}/${TYPE}_slab.json"
copy_replace "${SOURCE}/recipes/stairs.json" "${DATA}/recipes/${TYPE}/${TYPE}_stairs.json"
copy_replace "${SOURCE}/recipes/wall.json" "${DATA}/recipes/${TYPE}/${TYPE}_wall.json"
copy_replace "${SOURCE}/recipes/slab_stonecutter.json" "${DATA}/recipes/${TYPE}/${TYPE}_slab_stonecutter.json"
copy_replace "${SOURCE}/recipes/stairs_stonecutter.json" "${DATA}/recipes/${TYPE}/${TYPE}_stairs_stonecutter.json"
copy_replace "${SOURCE}/recipes/wall_stonecutter.json" "${DATA}/recipes/${TYPE}/${TYPE}_wall_stonecutter.json"

add_tags
add_lang_strings


<filename>deploy/server.sh
#!/bin/sh

sudo cp -r ./k3s /usr/local/bin/
# chmod a+x ./k3s-install-script.sh
sudo snap install helm --classic
sudo snap install go --classic
curl -sfL https://get.k3s.io | INSTALL_K3S_SKIP_DOWNLOAD=true K3S_KUBECONFIG_MODE=666 INSTALL_K3S_VERSION=v1.19.13+k3s1 INSTALL_K3S_EXEC="server --flannel-backend=host-gw --node-name=k3s-master --docker --cluster-init --write-kubeconfig-mode  777 --kube-apiserver-arg=feature-gates=InPlacePodVerticalScaling=true"  sh -
mkdir /home/ubuntu/.kube
sudo mv /etc/rancher/k3s/k3s.yaml /home/ubuntu/.kube/config
sudo chmod u+rwx /home/ubuntu/.kube/config
sudo chmod go-rwx /home/ubuntu/.kube/config
sudo chown ubuntu /home/ubuntu/.kube/config


<gh_stars>0
#!/bin/bash
#set -x
set -e
set -u
make clean
make

for exec_file in `ls test_*`;
do
    echo "running $exec_file"
    ./$exec_file | tee $exec_file.result
    perf stat -e cache-misses ./$exec_file 2>&1 | tee -a $exec_file.result
done