<reponame>midonet/kaizen
#!/bin/bash
#./check.sh
#
# Copyright (c) 2015 Midokura SARL, All Rights Reserved.
#
# - check an OpenStack cloud for typical user mistakes when setting up the MidoNet plugin
#
# This script will try to autodetect your server based on:
# - operating system type
# - installed packages

#
# check Ubuntu installation
#
check_ubuntu () {
    echo "002: checking Ubuntu"

    return
}

#
# check RedHat installation
#
check_redhat () {
    echo "003: checking RedHat"

    #
    # check if this is a neutron controller
    #
    if [[ ! "" == "$(yum list installed openstack-neutron 2>/dev/null | grep -v '^Loaded plugins:')" ]]; then
        echo "this server has openstack-neutron package installed, assuming its a neutron controller"

        echo "checking for midonet packages on this controller."
        echo "if this fails then one or more packages or services is missing from this machine."

        for PACKAGE in midolman python-midonetclient python-neutron-plugin-midonet; do
            echo "checking for package ${PACKAGE}"
            yum list installed "${PACKAGE}" 2>/dev/null | grep "^${PACKAGE}" || exit 1
        done

        #
        # check core plugin
        #
        if [[ "" == "$(grep ^core_plugin /etc/neutron/neutron.conf 2>/dev/null | grep 'midonet.neutron.plugin.MidonetPluginV2')" ]]; then
            echo "your neutron.conf does not have the correct core_plugin defined."
            exit 1
        fi

        #
        # check the softlink
        #
        if [[ "" == "$(readlink /etc/neutron/plugin.ini 2>/dev/null | grep /etc/neutron/plugins/midonet/midonet.ini)" ]]; then
            echo "your /etc/neutron/plugin.ini either does not exist or does not point to the midonet.ini."
            exit 1
        fi

        #
        # check if the plugin file exists
        #
        if [[ ! -f /etc/neutron/plugins/midonet/midonet.ini ]]; then
            echo "your /etc/neutron/plugins/midonet/midonet.ini plugin file does not exist."
            exit 1
        fi

        #
        # check if the api defined in the midonet.ini is reachable and if the user and password works
        #
        URI="$(grep ^midonet_uri /etc/neutron/plugins/midonet/midonet.ini  | awk -F= '{print $2;}' | xargs -n1 echo)"

    fi

    return
}

#
# main
#

echo "Welcome to Kaizen, the Midokura system checker"

# find out if we are in Redhat or an Ubuntu system
echo "001: checking for LSB release"
test -f /etc/lsb-release && source /etc/lsb-release

if [[ -f /etc/lsb-release ]]; then

    eval $(grep ^DISTRIB_ID /etc/lsb-release | xargs -n1 echo export)

    if [[ "Ubuntu" == "${DISTRIB_ID}" ]]; then
        THIS_IS_UBUNTU="1"
    fi
else
    if [[ -f "/etc/redhat-release" ]]; then
        THIS_IS_REDHAT="1"
    fi
fi

if [[ "1" == "${THIS_IS_UBUNTU}" || "1" == "${THIS_IS_REDHAT}" ]]; then

    if [[ "1" == "${THIS_IS_UBUNTU}" && "1" == "${THIS_IS_REDHAT}" ]]; then
        echo "your box is saying it runs Ubuntu and Redhat. this is wrong."
        exit 1
    fi

    if [[ "1" == "${THIS_IS_UBUNTU}" ]]; then
        check_ubuntu
    fi

    if [[ "1" == "${THIS_IS_REDHAT}" ]]; then
        check_redhat
    fi

else
    echo "unsupported operating system"
    exit 1
fi

exit 0


<gh_stars>0
#!/bin/bash

INSTALL_LOG=`mktemp /tmp/install_wavefront_XXXXXXXXXX.log`

function check_if_root_or_die() {
    echo "Checking installation privileges"
    echo -e "\nid -u" >>${INSTALL_LOG}
    SCRIPT_UID=$(id -u)
    if [ "$SCRIPT_UID" != 0 ]; then
        echo  "Installer should be run as root"
        exit 1
    fi
}

function exit_with_message() {
    echo
    echo $1
    echo -e "\n$1" >>  ${INSTALL_LOG}
    if [[ $INSTALL_LOG && "$2" -eq 1 ]]; then
        echo "For additional information, check the Wavefront install log: $INSTALL_LOG"
    fi
    echo
    exit 1
}

function echo_right() {
    TEXT=$1
    echo
    tput cuu1
    tput cuf $(tput cols)
    tput cub ${#TEXT}
    echo $TEXT
}

function echo_failure() {
    tput setaf 1  # 1 = red
    echo_right "[ FAILED ]"
    tput sgr0  # reset terminal
}

function exit_with_failure() {
    echo_failure
    exit_with_message "FAILURE: $1" 1
}

function detect_operating_system() {

    echo "Detecting operating system:"
    if [ -f /etc/debian_version ]; then
        echo -e "\ntest -f /etc/debian_version" >> ${INSTALL_LOG}
        echo "Debian/Ubuntu"
        OPERATING_SYSTEM="DEBIAN"
    elif [ -f /etc/redhat-release ] || [ -f /etc/system-release-cpe ]; then
        echo -e "\ntest -f /etc/redhat-release || test -f /etc/system-release-cpe" >> ${INSTALL_LOG}
        echo "RedHat/CentOS"
        OPERATING_SYSTEM="REDHAT"
    elif [ "$(uname)" == "Darwin" ]; then
        OPERATING_SYSTEM="MAC"
        echo "Mac is not yet supported!"
        exit 1
    elif [ -f /etc/SUSE-brand ]; then
        echo -e "\ntest -f /etc/SUSE-brand" >> ${INSTALL_LOG}
        echo "OpenSUSE/SLE"
        OPERATING_SYSTEM=`head -1 /etc/SUSE-brand`
    else
        echo -e "\ntest -f /etc/debian_version" >> "/tmp/wavefront_install.log"
        echo -e "\ntest -f /etc/redhat-release || test -f /etc/system-release-cpe" >> ${INSTALL_LOG}
        echo "Unsupported operating system"
        exit 1
    fi
    export OPERATING_SYSTEM
}

function install_python() {

    if [ $OPERATING_SYSTEM == "DEBIAN" ]; then
        echo "Installing Python using apt-get"
        apt-get update >> ${INSTALL_LOG} 2>&1
        apt-get install python -y >> ${INSTALL_LOG} 2>&1
    elif [ $OPERATING_SYSTEM == "REDHAT" ]; then
        echo "Installing Python using yum"
        yum install python -y >> ${INSTALL_LOG} 2>&1
    elif [ $OPERATING_SYSTEM == "openSUSE" ] || [ $OPERATING_SYSTEM == "SLE" ]; then
        echo "Installing Python using zypper"
        zypper install python >> ${INSTALL_LOG} 2>&1
    fi

    if [ $? -ne 0 ]; then
            exit_with_failure "Failed to install Python"
    fi

}

function remove_python() {

    # wavefront cli
    pip uninstall wavefront-cli -y
    # pip
    pip uninstall pip -y

    # python
    if [ $OPERATING_SYSTEM == "DEBIAN" ]; then
        echo "Uninstalling Python using apt-get"
        apt-get remove python -y &> ${INSTALL_LOG}
        apt-get autoremove -y &> ${INSTALL_LOG}
    elif [ $OPERATING_SYSTEM == "REDHAT" ]; then
        echo "Uninstalling Python using yum"
        yum remove python -y &> ${INSTALL_LOG}
    elif [ $OPERATING_SYSTEM == "openSUSE" ] || [ $OPERATING_SYSTEM == "SLE" ]; then
        echo "Uninstalling Python using zypper"
        zypper remove python &> ${INSTALL_LOG}
    fi

}

function install_pip() {
    $PYTHON_PATH=$(which python) 2> /dev/null
    if [ $OPERATING_SYSTEM == "openSUSE" ]; then
       $PYTHON_PATH=$(which python2.7) 2>/dev/null
    fi
    curl -o /tmp/get-pip.py https://bootstrap.pypa.io/get-pip.py >> ${INSTALL_LOG} 2>&1
    if [ $? -ne 0 ]; then
            exit_with_failure "Failed to download Pip"
    fi
    $PYTHON_PATH /tmp/get-pip.py >> ${INSTALL_LOG} 2>&1
    if [ $? -ne 0 ]; then
            exit_with_failure "Failed to install Pip"
    fi

    rm -f /tmp/get-pip.py 2> /dev/null
}

function install_wavecli() {
    PIP_PATH=$(which pip)
    $PIP_PATH uninstall wavefront-cli -y >> ${INSTALL_LOG} 2>&1
    $PIP_PATH install wavefront-cli >> ${INSTALL_LOG} 2>&1
    if [ $? -ne 0 ]; then
            exit_with_failure "Failed to install Wavefront CLI"
    fi

    # Find where it was installed
    WAVE_PATH="/usr/local/bin/wave"
    if [ -f "$WAVE_PATH" ]; then
        echo "Wavefront CLI detected in $WAVE_PATH"
    elif [ -f "/usr/bin/wave" ]; then
        echo "Wavefront CLI detected in /usr/bin/wave"
        WAVE_PATH="/usr/bin/wave"
    else
        exit_with_failure "Wavefront CLI not found."
    fi
    export WAVE_PATH

}

# main()

detect_operating_system
check_if_root_or_die

# Detect python
PYTHON_PATH=$(which python)
# If python was not installed before this script runs, uninstall it at the end.
PYTHON_INSTALLED=false

if [ -z "$PYTHON_PATH" ]; then
    echo "Python is not installed. Installing Python."
    echo "Python will be uninstalled automatically after installation finishes."
    PYTHON_INSTALLED=false
    install_python
    PYTHON_PATH=$(which python)
else
    PYTHON_INSTALLED=true
    echo "Python detected in ${PYTHON_PATH}"
fi

# Detect pip
PIP_PATH=$(which pip)
if [ -z "$PIP_PATH" ]; then
    echo "Pip is not installed, installing Pip."
    install_pip
fi

if [ $OPERATING_SYSTEM == "openSUSE" ]; then
    echo "Checking pip version"
    pip_version=`pip --version`
    pip_python_version="python 3"

    if [[ $pip_version == *$pip_python_version* ]]; then
       install_pip
    fi
fi
# Make sure Wavefront CLI is installed. This function will export WAVE_PATH - holds the location of the wavefront cli binary
install_wavecli

# Capture command line args passed to shell script in a string
cli_args=""
for arg in "$@"
do
   cli_args="$cli_args $arg"
done

# Run Cli installation process
$WAVE_PATH $cli_args

# Python was not installed before running this script, so remove it.
if [ $PYTHON_INSTALLED == false ]; then
    remove_python
fi


<reponame>ArtiomL/docker-hello-world<filename>test/run.sh<gh_stars>0
#!/bin/bash

set -xeo pipefail

REPO="artioml/hello-world"

docker run -dit -p 80:8080 $REPO
sleep 3
docker ps -a
curl -s http://127.0.0.1/ | grep 'hello, world'


<filename>db/01-init.sh
#!/bin/bash
set -e
export PGPASSWORD=$<PASSWORD>;
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
  CREATE DATABASE $APP_DB_NAME;
  GRANT ALL PRIVILEGES ON DATABASE $APP_DB_NAME TO $POSTGRES_USER;
  \connect $APP_DB_NAME $POSTGRES_USER
  ALTER ROLE $POSTGRES_USER SUPERUSER;
  BEGIN;

    CREATE EXTENSION IF NOT EXISTS "uuid-ossp";

CREATE TABLE IF NOT EXISTS course (
    "id" uuid not null default uuid_generate_v4(),
    "course_name" text,
    "course_description" text,
    "author_fullname" text,
    "author_firstname" text ,
    "author_lastname" text ,
    "course_no" serial,
    "uts" timestamp default current_timestamp,
    PRIMARY KEY ("id")
);

  COMMIT;
EOSQL


<gh_stars>1-10
#!/bin/bash -e
source $commons/commons.sh

# install packages if need
install_dependencies "unzip"

sudo mkdir -p /etc/consul_template/ssl
sudo mkdir -p /var/lib/consul_template/
sudo mkdir -p /var/log/consul_template/

download "consul-template" "${APPLICATION_URL}" /tmp/consul-template.zip
sudo unzip /tmp/consul-template.zip -d /var/lib/consul_template/
sudo rm /tmp/consul-template.zip


#
# build config
#
PACKAGES="sys-kernel/linux-headers sys-devel/make sys-devel/binutils sys-devel/gcc"
KEEP_HEADERS=true
KEEP_STATIC_LIBS=true
# include glibc headers and static files from busybox image
HEADERS_FROM=guruvan/glibc
STATIC_LIBS_FROM=guruvan/glibc

#
# this method runs in the bb builder container just before starting the build of the rootfs
#
configure_rootfs_build()
{
    :
}

#
# this method runs in the bb builder container just before tar'ing the rootfs
#
finish_rootfs_build()
{
    :
}


#!/bin/sh
# Openshift JBoss KIE - Controller launch script and helpers
set -e

SCRIPT_DIR=$(dirname $0)
ADDED_DIR=${SCRIPT_DIR}/added

# Add custom launch script and dependent scripts/libraries/snippets
cp -p ${ADDED_DIR}/openshift-launch.sh ${JBOSS_HOME}/bin/
mkdir -p ${JBOSS_HOME}/bin/launch
cp -r ${ADDED_DIR}/launch/* ${JBOSS_HOME}/bin/launch
chmod ug+x ${JBOSS_HOME}/bin/openshift-launch.sh

mkdir -p /opt/kie/dashbuilder/{imports,components}
chown -R jboss:root /opt/kie

# Necessary to permit running with a randomised UID
for dir in $JBOSS_HOME/bin /opt/kie; do
    chown -R jboss:root $dir
    chmod -R g+rwX $dir
done


#! /bin/sh

PATH=$PATH:/opt/local/bin:/opt/local/sbin:/opt/local/share/man:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin

DIR=$(cd "$(dirname "$0")"; pwd)
DIR=$(dirname "$DIR")
DIR=$(dirname "$DIR")
DIR=$(dirname "$DIR")
MDIR=$(dirname "$DIR")

mkdir -p $MDIR/source/cmd

echo 'pcre start'

if [ ! -f $MDIR/source/cmd/pcre-8.38.tar.gz ];then
	wget -O $MDIR/source/cmd/pcre-8.38.tar.gz https://ftp.pcre.org/pub/pcre/pcre-8.38.tar.gz
fi

if [ ! -d $MDIR/source/cmd/pcre-8.38 ];then
	cd $MDIR/source/cmd &&  tar -zxvf pcre-8.38.tar.gz
fi

if [ ! -d $DIR/cmd/pcre ];then

cd $MDIR/source/cmd/pcre-8.38
./configure --prefix=$DIR/cmd/pcre --enable-utf8 && \
make && make install && make clean
fi

echo 'pcre end'


# utility command
export EDITOR='vim' # nanoからvimに変更
export VISUAL='vim' # nanoからvimに変更
export PAGER='less'


#!/bin/bash
#Usage below
#    1. make sure that environment Path variable must contain C:\NXP\bstudio_nxp\msys\bin in the beginning!
#    2. ./BuildAllLights.sh <JN5168 or JN5169>
echo "Building Lights from JN-AN-1171"

start=$(date +"%T")
echo "Start Time : $start"

if [ "$1" == "JN5168" ] || [ "$1" == "JN5169" ]; then
    make JENNIC_SDK=JN-SW-4168 JENNIC_CHIP=$1 LIGHT=Light_ColorLight            clean >> BuildLog_Light_ColorLight_$1.txt &
    make JENNIC_SDK=JN-SW-4168 JENNIC_CHIP=$1 LIGHT=Light_ColorTemperatureLight clean >> BuildLog_Light_ColorTemperatureLight_$1.txt &
    make JENNIC_SDK=JN-SW-4168 JENNIC_CHIP=$1 LIGHT=Light_DimmableLight         clean >> BuildLog_Light_DimmableLight_$1.txt &
    make JENNIC_SDK=JN-SW-4168 JENNIC_CHIP=$1 LIGHT=Light_DimmablePlug          clean >> BuildLog_Light_DimmablePlug_$1.txt &
    make JENNIC_SDK=JN-SW-4168 JENNIC_CHIP=$1 LIGHT=Light_ExtendedColorLight    clean >> BuildLog_Light_ExtendedColorLight_$1.txt &
    make JENNIC_SDK=JN-SW-4168 JENNIC_CHIP=$1 LIGHT=Light_OnOffLight            clean >> BuildLog_Light_OnOffLight_$1.txt &
    make JENNIC_SDK=JN-SW-4168 JENNIC_CHIP=$1 LIGHT=Light_OnOffPlug             clean >> BuildLog_Light_OnOffPlug_$1.txt &
    echo "Cleaning; Please wait"
    wait

    make JENNIC_SDK=JN-SW-4168 JENNIC_CHIP=$1 LIGHT=Light_ColorLight            >> BuildLog_Light_ColorLight_$1.txt &
    make JENNIC_SDK=JN-SW-4168 JENNIC_CHIP=$1 LIGHT=Light_ColorTemperatureLight >> BuildLog_Light_ColorTemperatureLight_$1.txt &
    make JENNIC_SDK=JN-SW-4168 JENNIC_CHIP=$1 LIGHT=Light_DimmableLight         >> BuildLog_Light_DimmableLight_$1.txt &
    make JENNIC_SDK=JN-SW-4168 JENNIC_CHIP=$1 LIGHT=Light_DimmablePlug          >> BuildLog_Light_DimmablePlug_$1.txt &
    make JENNIC_SDK=JN-SW-4168 JENNIC_CHIP=$1 LIGHT=Light_ExtendedColorLight    >> BuildLog_Light_ExtendedColorLight_$1.txt &
    make JENNIC_SDK=JN-SW-4168 JENNIC_CHIP=$1 LIGHT=Light_OnOffLight            >> BuildLog_Light_OnOffLight_$1.txt &
    make JENNIC_SDK=JN-SW-4168 JENNIC_CHIP=$1 LIGHT=Light_OnOffPlug             >> BuildLog_Light_OnOffPlug_$1.txt &
    echo "Building; Please wait"
    wait
else
    echo "Usage ./BuildAllLights.sh <JN5168 or JN5169>"
fi

end=$(date +"%T")
echo "End Time : $end"

echo "Done !!!"


<filename>config/filter.sh
# Configuration for heuristic CoNLL-U text filter

FILTER_DATA_ROOT="/wrk/pyysalos/puhti-DeepFin"

FILTER_INDIR="$FILTER_DATA_ROOT/mtgen_out/nongenerated"

FILTER_OUT_FILTERED="$FILTER_DATA_ROOT/filter_out/filtered"

FILTER_OUT_NONFILTERED="$FILTER_DATA_ROOT/filter_out/nonfiltered"

FILTER_OPTIONS='
--min-sents 3
--max-sents 1000
--avg-len 5
--upper-ratio 0.1
--no-word-ratio 0.2
--punct-ratio 0.05
--digit-ratio 0.05
--min-toks 20
--max-toks 10000
--min-words 30
--frequent-ratio 0.02
--foreign-ratio 0.01
--langdetect
'


<filename>bin/install.sh<gh_stars>0
#!/bin/bash

###############################################################################
# Set variables                                                               #
###############################################################################

BIN=~/Clean-macOS/bin                # shell scripts
CONFIG=~/Clean-macOS/config          # configuration files directory
SETUP=~/Clean-macOS                  # root folder of Clean-macOS

###############################################################################
# Install                                                                     #
###############################################################################

# Entering as Root
printf "Enter root password...\n"
sudo -v

# Keep alive Root
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &

# Install Brew
printf "⚙ Check Brew...\n"
if test ! $(which brew); then
  # Install Homebrew
    printf "📦 Installing XCode CL tools...\n"
    xcode-select --install
    printf "📦 Installing Homebrew...\n"
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  # Change permissions
    brew -v
    sudo chown -R $USER /usr/local/Cellar
  # Install MAS
    printf "📦 Installing MAS...\n"
    brew install mas
  # Check Brews
    brew -v update && brew -v upgrade && mas upgrade && brew -v cleanup --prune=2 && brew doctor
  # Install Homebrew apps
    printf "📦 Installing Apps...\n"
    brew bundle --file=$SETUP/Brewfile
  # Install Wayback script
    printf "📦 Installing Wayback Machine Downloader Ruby script...\n"
    gem install wayback_machine_downloader
  # Cleanup
    printf "⚙ Cleanup and final touches...\n"
    brew -v update && brew -v upgrade && mas upgrade && brew -v cleanup --prune=2 && brew doctor && brew -v upgrade --casks --greedy
else
    printf "📦 Homebrew is already installed...\n"
    exit

fi

# Exit script
exit


<reponame>uk-gov-mirror/hmrc.feedback-frontend
#!/bin/bash

echo "Applying migration ThankYou"

echo "Adding routes to conf/app.routes"
echo "" >> ../conf/app.routes
echo "GET        /thankYou                       controllers.ThankYouController.onPageLoad()" >> ../conf/app.routes

echo "Adding messages to conf.messages"
echo "" >> ../conf/messages.en
echo "thankYou.title = thankYou" >> ../conf/messages.en
echo "thankYou.heading = thankYou" >> ../conf/messages.en

echo "Migration ThankYou completed"


./populate.sh manifests/${dataName}.manifest /tmp/folio-conf/pg.json ${tenant}


<filename>lib/brew.sh<gh_stars>0
#!/usr/bin/env bash
#———————————————————————————————————————————————————————————————————————————————
# © 2016-2020 <NAME>, All rights reserved. MIT License.
# Ported from the licensed under the MIT license Project Pullulant, at
# https://github.com/kigster/pullulant
#———————————————————————————————————————————————————————————————————————————————
export LibBrew__PackageCacheList="/tmp/.lib_brew_packages.txt"
export LibBrew__CaskCacheList="/tmp/.lib_brew_casks.txt"

# This function returns the sorted list of versions that are specified
# for a given package in Brew using @<version>, for instance: "mysql@5.5" or
# postgres@9.4 etc.
brew.package.available-versions() {
  local package="$1"
  brew search "${package}@" | tr -d 'a-z@A-Z =>-+' | sed '/^$/d' | sort -nr | tr '\n' ' '
}

brew.cache-reset() {
  rm -f ${LibBrew__PackageCacheList} ${LibBrew__CaskCacheList}
}

brew.cache-reset.delayed() {
  ((${BASH_IN_SUBSHELL})) || brew.cache-reset
  ((${BASH_IN_SUBSHELL})) && trap "rm -f ${LibBrew__PackageCacheList} ${LibBrew__CaskCacheList}" EXIT
}

brew.upgrade.packages() {
  [[ -z "$(which brew)" ]] || brew.install
  [[ -z  $1 ]] && {
    error "usage: brew.upgrade.packages package1 package2 ..."
    return 1
  }

  run "brew upgrade $@"
}

brew.upgrade() {
  brew.install
  if [[ -z "$(which brew)" ]]; then
    warn "brew is not installed...."
    return 1
  fi
  run "brew update --force"
  run "brew upgrade"
  run "brew cleanup -s"
}

brew.install() {
  local brew=$(which brew 2>/dev/null)
  if [[ -z "${brew}" ]]; then
    info "Installing Homebrew, please wait..."
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  else
    info "Detected Homebrew Version: ${bldylw}$(brew --version 2>/dev/null | head -1)"
  fi
}

brew.setup() {
  brew.upgrade
}

brew.package.link() {
  local package="${1}"
  shift
  [[ -n ${opts_verbose} ]] && verbose="--verbose"
  run "brew link ${verbose} ${package} $*"
}

brew.relink() {
  local package=${1}
  local verbose=
  [[ -n ${opts_verbose} ]] && verbose="--verbose"
  run "brew link ${verbose} ${package} --overwrite"
}

brew.package.list() {
  cache-or-command "${LibBrew__PackageCacheList}" 30 "brew ls -1"
}

brew.cask.list() {
  cache-or-command "${LibBrew__CaskCacheList}" 30 "brew cask ls -1"
}

brew.cask.tap() {
  run "brew tap homebrew/cask-cask"
}

cache-or-command() {
  local file="$1"
  shift
  local stale_minutes="$1"
  shift
  local command="$*"

  file.exists-and-newer-than "${file}" ${stale_minutes} && {
    cat "${file}"
    return 0
  }

  cp /dev/null ${file} >/dev/null
  eval "${command}" | tee -a "${file}"
}

brew.package.is-installed() {
  local package="${1}"
  local -a installed_packages=($(brew.package.list))
  array.has-element $(basename "${package}") "${installed_packages[@]}"
}

brew.cask.is-installed() {
  local cask="${1}"
  local -a installed_casks=($(brew.cask.list))
  array.has-element $(basename "${cask}") "${installed_casks[@]}"
}

brew.reinstall.package() {
  local package="${1}"
  local force=
  local verbose=
  [[ -n ${opts_force} ]] && force="--force"
  [[ -n ${opts_verbose} ]] && verbose="--verbose"

  run "brew unlink ${package} ${force} ${verbose}; true"
  run "brew uninstall ${package}  ${force} ${verbose}; true"
  run "brew install ${package} ${force} ${verbose}"
  run "brew link ${package} --overwrite ${force} ${verbose}"
  brew.cache-reset.delayed
}

brew.install.package() {
  local package=$1
  local force=
  local verbose=
  [[ -n ${opts_force} ]] && force="--force"
  [[ -n ${opts_verbose} ]] && verbose="--verbose"

  [[ -z ${opt_terse} ]] && inf "checking for 🍻  ${bldylw}${package}..."

  if [[ $(brew.package.is-installed ${package}) == "true" ]]; then
    [[ -z ${opt_terse} ]] && ok:
    [[ -z ${opt_terse} ]] || printf "${bldgrn}○ "
    export LibRun__LastExitCode=0
  else
    if [[ -z ${opt_terse} ]]; then
      printf " ${bldpur}${package}${txtylw} must pour.\n${clr}"
      run "brew install ${package} ${force} ${verbose}"
    else
      (brew install ${package} ${force} ${verbose}) 2>&1 | cat >/dev/null
      local code=$?
    fi

    [[ ${code} -eq 0 || ${LibRun__LastExitCode} -eq 0 ]] || {
      brew.reinstall.package "${package}"
    }

    brew.cache-reset.delayed
    export LibRun__LastExitCode=0

    if [[ $(brew.package.is-installed ${package}) == "true" ]]; then
      [[ -n ${opt_terse} ]] && printf "\n🟢 "
    else
      [[ -n ${opt_terse} ]] && printf "\n🔴 "
      export LibRun__LastExitCode=1
    fi
  fi

  return ${LibRun__LastExitCode}
}

brew.install.cask() {
  local cask=$1
  local force=
  local verbose=

  [[ -n ${opts_force} ]] && force="--force"
  [[ -n ${opts_verbose} ]] && verbose="--verbose"

  inf "verifying brew cask ${bldylw}${cask}"
  if [[ -n $(ls -al /Applications/*.app | grep -i ${cask}) && -z ${opts_force} ]]; then
    ui.closer.ok:
  elif [[ $(brew.cask.is-installed ${cask}) == "true" ]]; then
    ui.closer.ok:
    return 0
  else
    ui.closer.kind-of-ok:
    run "brew cask install ${cask} ${force} ${verbose}"
  fi

  brew.cache-reset.delayed
}

brew.uninstall.package() {
  local package=$1
  local force=
  local verbose=

  [[ -n ${opts_force} ]] && force="--force"
  [[ -n ${opts_verbose} ]] && verbose="--verbose"

  export LibRun__AbortOnError=${False}
  run "brew unlink ${package} ${force} ${verbose}"

  export LibRun__AbortOnError=${False}
  run "brew uninstall ${package} ${force} ${verbose}"

  brew.cache-reset.delayed
}

# set $opts_verbose to see more output
# set $opts_force to true to force it

brew.install.packages() {
  local force=
  [[ -n ${opts_force} ]] && force="--force"

  for package in "$@"; do
    brew.install.package "${package}"
  done
}

brew.reinstall.packages() {
  local force=
  [[ -n ${opts_force} ]] && force="--force"

  for package in "$@"; do
    brew.uninstall.package "${package}"
    brew.install.package "${package}"
  done
}

brew.uninstall.packages() {
  local force=
  [[ -n ${opts_force} ]] && force="--force"

  for package in $@; do
    brew.uninstall.package ${package}
  done
}

brew.service.up() {
  local svc="$1"
  run "brew services start ${svc}"
}

brew.service.down() {
  local svc="$1"
  run "brew services stop ${svc}"
}

brew.service.restart() {
  local svc="$1"
  run "brew services restart ${svc}"
}


<filename>update-1.2.sh
#!/bin/bash
if [ "${EUID}" -ne 0 ]; then
		echo "You need to run this script as root"
		exit 1
fi
if [ "$(systemd-detect-virt)" == "openvz" ]; then
		echo "OpenVZ is not supported"
		exit 1
fi
red='\e[1;31m'
green='\e[0;32m'
NC='\e[0m'
MYIP=$(wget -qO- ifconfig.co);

# Validate Version Script
versi=$(cat /home/ver)
if [[ $versi == 1.2 ]]; then
echo "Automatical Update In 3s"
sleep 3
else
exit 0
fi
echo "Start Update"
cd /usr/bin
wget -O menu "https://raw.githubusercontent.com/angahpadu/angahshop786/main/menu.sh"
wget -O add-host "https://raw.githubusercontent.com/angahpadu/angahshop786/main/add-host.sh"
wget -O addd-ssh "https://raw.githubusercontent.com/angahpadu/angahshop786/main/add-ssh.sh"
wget -O trial-ssh "https://raw.githubusercontent.com/angahpadu/angahshop786/main/trial-ssh.sh"
wget -O change-port "https://raw.githubusercontent.com/angahpadu/angahshop786/main/change.sh"
wget -O port-ovpn "https://raw.githubusercontent.com/angahpadu/angahshop786/main/port-ovpn.sh"
wget -O port-ssl "https://raw.githubusercontent.com/angahpadu/angahshop786/main/port-ssl.sh"
wget -O port-wg "https://raw.githubusercontent.com/angahpadu/angahshop786/main/port-wg.sh"
wget -O port-tr "https://raw.githubusercontent.com/angahpadu/angahshop786/main/port-tr.sh"
wget -O port-squid "https://raw.githubusercontent.com/angahpadu/angahshop786/main/port-squid.sh"
wget -O port-ws "https://raw.githubusercontent.com/angahpadu/angahshop786/main/port-ws.sh"
wget -O port-vless "https://raw.githubusercontent.com/angahpadu/angahshop786/main/port-vless.sh"
wget -O webmin "https://raw.githubusercontent.com/angahpadu/angahshop786/main/webmin.sh"
wget -O xp "https://raw.githubusercontent.com/angahpadu/angahshop786/main/xp.sh"
wget -O speed-limiter "https://raw.githubusercontent.com/angahpadu/angahshop786/main/speed-limiter.sh"
wget -O add-ws "https://raw.githubusercontent.com/angahpadu/angahshop786/main/add-ws.sh"
wget -O add-vless "https://raw.githubusercontent.com/angahpadu/angahshop786/main/add-vless.sh"
wget -O add-tr "https://raw.githubusercontent.com/angahpadu/angahshop786/main/add-tr.sh"
wget -O update "https://raw.githubusercontent.com/angahpadu/angahshop786/main/update-1.2.sh"
chmod +x change-port
chmod +x add-host
chmod +x port-ovpn
chmod +x port-ssl
chmod +x port-wg
chmod +x port-tr
chmod +x port-squid
chmod +x port-ws
chmod +x port-vless
chmod +x webmin
chmod +x xp
chmod +x speed-limiter
chmod +x update
echo "0 5 * * * root clear-log && reboot" > /etc/crontab
echo "0 0 * * * root xp" > /etc/crontab
cd
echo "1.3" > /home/ver
clear
echo " Fix minor Bugs"
echo " Now You Can Change Port Of Some Services"
echo " Reboot 3 Sec"
sleep 3
rm -f update.sh
reboot


#!/bin/bash
# Attention, there is no "-x" to avoid problems on Wercker
set -e

function checkout_from {
  CLONE_URL=$1
  PROJECT=$(echo "$CLONE_URL" | sed -nE 's/.*\/(.*).git/\1/p')
  mkdir -p .ci-temp
  cd .ci-temp
  if [ -d "$PROJECT" ]; then
    echo "Target project $PROJECT is already cloned, latest changes will be fetched"
    cd $PROJECT
    git fetch
    cd ../
  else
    for i in 1 2 3 4 5; do git clone $CLONE_URL && break || sleep 15; done
  fi
  cd ../
}

case $1 in

no-error-pgjdbc)
  CS_POM_VERSION=$(mvn -e -q -Dexec.executable='echo' -Dexec.args='${project.version}' \
                     --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
  echo CS_version: ${CS_POM_VERSION}
  checkout_from https://github.com/pgjdbc/pgjdbc.git
  cd .ci-temp/pgjdbc/pgjdbc
  mvn -e checkstyle:check -Dcheckstyle.version=${CS_POM_VERSION}
  cd ../../
  rm -rf pgjdbc
  ;;

no-error-orekit)
  CS_POM_VERSION=$(mvn -e -q -Dexec.executable='echo' -Dexec.args='${project.version}' \
                     --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
  echo CS_version: ${CS_POM_VERSION}
  checkout_from https://github.com/CS-SI/Orekit.git
  cd .ci-temp/Orekit
  # no CI is enforced in project, so to make our build stable we should
  # checkout to latest release (annotated tag)
  #git checkout $(git describe --abbrev=0 --tags)
  # Orekit use 'develop' branch as target for PullRequest merges, where all our breaking changes
  # of 8.2 and above are applied
  #git checkout develop
  # due to temporal compilation problems(20180522) we use latest commit where compilation pass
  git checkout 9862be9
  mvn -e compile checkstyle:check -Dorekit.checkstyle.version=${CS_POM_VERSION}
  cd ../
  rm -rf Orekit
  ;;

no-error-xwiki)
  CS_POM_VERSION=$(mvn -e -q -Dexec.executable='echo' -Dexec.args='${project.version}' \
                     --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
  echo CS_version: ${CS_POM_VERSION}
  # till https://github.com/xwiki/xwiki-commons/pull/39
  checkout_from https://github.com/checkstyle/xwiki-commons.git
  cd .ci-temp/xwiki-commons
  # till https://github.com/xwiki/xwiki-commons/pull/39
  git checkout i5812-rename-util
  mvn -f xwiki-commons-tools/xwiki-commons-tool-verification-resources/pom.xml \
    install -DskipTests -Dcheckstyle.version=${CS_POM_VERSION}
  mvn -e test-compile checkstyle:check -Dcheckstyle.version=${CS_POM_VERSION}
  cd ../../
  rm -rf xwiki-commons
  ;;

no-error-apex-core)
  CS_POM_VERSION=$(mvn -e -q -Dexec.executable='echo' -Dexec.args='${project.version}' \
                     --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
  echo CS_version: ${CS_POM_VERSION}
  checkout_from https://github.com/apache/incubator-apex-core.git
  cd .ci-temp/incubator-apex-core
  mvn -e compile checkstyle:check -Dcheckstyle.version=${CS_POM_VERSION}
  cd ../
  rm -rf incubator-apex-core
  ;;

no-error-hibernate-search)
  CS_POM_VERSION=$(mvn -e -q -Dexec.executable='echo' -Dexec.args='${project.version}' \
                     --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
  echo CS_version: ${CS_POM_VERSION}
  checkout_from https://github.com/hibernate/hibernate-search.git
  cd .ci-temp/hibernate-search
  mvn -e clean install -DskipTests=true -Dtest.elasticsearch.host.provided=true \
     -Dcheckstyle.skip=true -Dforbiddenapis.skip=true \
     -Dpuppycrawl.checkstyle.version=${CS_POM_VERSION}
  mvn -e checkstyle:check  -Dpuppycrawl.checkstyle.version=${CS_POM_VERSION}
  cd ../
  rm -rf hibernate-search
  ;;

no-error-htmlunit)
  CS_POM_VERSION=$(mvn -e -q -Dexec.executable='echo' -Dexec.args='${project.version}' \
                     --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
  echo CS_version: ${CS_POM_VERSION}
  echo "checkouting project sources ..."
  svn -q export https://svn.code.sf.net/p/htmlunit/code/trunk/htmlunit@r14923 htmlunit
  cd htmlunit
 sed -i "s/            <version>2.28-SNAPSHOT/            <version>2.28-20171106.080245-12/" pom.xml
  echo "Running checkstyle validation ..."
  mvn -e compile checkstyle:check -Dcheckstyle.version=${CS_POM_VERSION}
  cd ../
  rm -rf htmlunit
  ;;

no-error-checkstyles-sevntu)
  set -e
  CS_POM_VERSION=$(mvn -e -q -Dexec.executable='echo' -Dexec.args='${project.version}' \
                     --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
  echo CS_version: ${CS_POM_VERSION}
  mvn -e compile verify -Dmaven.sevntu-checkstyle-check.checkstyle.version=${CS_POM_VERSION} \
    -Dmaven.test.skip=true -Dcheckstyle.ant.skip=true -Dpmd.skip=true -Dspotbugs.skip=true \
    -Djacoco.skip=true -Dforbiddenapis.skip=true -Dxml.skip=true
  ;;

no-error-sevntu-checks)
  set -e
  CS_POM_VERSION=$(mvn -e -q -Dexec.executable='echo' -Dexec.args='${project.version}' \
                     --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
  echo CS_version: ${CS_POM_VERSION}
  checkout_from https://github.com/sevntu-checkstyle/sevntu.checkstyle.git
  cd .ci-temp/sevntu.checkstyle/sevntu-checks
  mvn -e -Pno-validations verify  -Dcheckstyle.skip=false -Dcheckstyle.version=${CS_POM_VERSION} \
     -Dcheckstyle.configLocation=../../config/checkstyle_checks.xml
  cd ../../
  rm -rf sevntu.checkstyle
  ;;

no-error-strata)
  set -e
  CS_POM_VERSION=$(mvn -e -q -Dexec.executable='echo' -Dexec.args='${project.version}' \
                     --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
  echo CS_version: ${CS_POM_VERSION}
  checkout_from https://github.com/OpenGamma/Strata.git
  cd .ci-temp/Strata
  mvn install -e -B -Dstrict -DskipTests \
     -Dforbiddenapis.skip=true -Dcheckstyle.version=${CS_POM_VERSION}
  cd ../
  rm -rf Strata
  ;;

no-exception-struts)
  CS_POM_VERSION=$(mvn -e -q -Dexec.executable='echo' -Dexec.args='${project.version}' \
                     --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
  echo CS_version: ${CS_POM_VERSION}
  checkout_from https://github.com/checkstyle/contribution.git
  cd .ci-temp/contribution/checkstyle-tester
  sed -i'' 's/^guava/#guava/' projects-for-wercker.properties
  sed -i'' 's/#apache-struts/apache-struts/' projects-for-wercker.properties
  groovy ./launch.groovy --listOfProjects projects-for-wercker.properties \
      --config checks-nonjavadoc-error.xml --checkstyleVersion ${CS_POM_VERSION}
  cd ../../
  rm -rf contribution
  ;;

no-exception-checkstyle-sevntu)
  set -e
  CS_POM_VERSION=$(mvn -e -q -Dexec.executable='echo' -Dexec.args='${project.version}' \
                     --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
  echo CS_version: ${CS_POM_VERSION}
  checkout_from https://github.com/checkstyle/contribution.git
  cd .ci-temp/contribution/checkstyle-tester
  sed -i'' 's/^guava/#guava/' projects-for-wercker.properties
  sed -i'' 's/#checkstyle/checkstyle/' projects-for-wercker.properties
  sed -i'' 's/#sevntu-checkstyle/sevntu-checkstyle/' projects-for-wercker.properties
  groovy ./launch.groovy --listOfProjects projects-for-wercker.properties \
      --config checks-nonjavadoc-error.xml --checkstyleVersion ${CS_POM_VERSION}
  cd ../../
  rm -rf contribution
  ;;

no-exception-guava)
  CS_POM_VERSION=$(mvn -e -q -Dexec.executable='echo' -Dexec.args='${project.version}' \
                     --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
  echo CS_version: ${CS_POM_VERSION}
  checkout_from https://github.com/checkstyle/contribution.git
  cd .ci-temp/contribution/checkstyle-tester
  sed -i'' 's/^guava/#guava/' projects-for-wercker.properties
  sed -i'' 's/#guava/guava/' projects-for-wercker.properties
  groovy ./launch.groovy --listOfProjects projects-for-wercker.properties \
      --config checks-nonjavadoc-error.xml --checkstyleVersion ${CS_POM_VERSION}
  cd ../../
  rm -rf contribution
  ;;

no-exception-hibernate-orm)
  CS_POM_VERSION=$(mvn -e -q -Dexec.executable='echo' -Dexec.args='${project.version}' \
                     --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
  echo CS_version: ${CS_POM_VERSION}
  checkout_from https://github.com/checkstyle/contribution.git
  cd .ci-temp/contribution/checkstyle-tester
  sed -i.'' 's/^guava/#guava/' projects-to-test-on.properties
  sed -i.'' 's/#hibernate-orm/hibernate-orm/' projects-to-test-on.properties
  groovy ./launch.groovy --listOfProjects projects-for-wercker.properties \
      --config checks-nonjavadoc-error.xml --checkstyleVersion ${CS_POM_VERSION}
  cd ../../
  rm -rf contribution
  ;;

no-exception-spotbugs)
  CS_POM_VERSION=$(mvn -e -q -Dexec.executable='echo' -Dexec.args='${project.version}' \
                     --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
  echo CS_version: ${CS_POM_VERSION}
  checkout_from https://github.com/checkstyle/contribution.git
  cd .ci-temp/contribution/checkstyle-tester
  sed -i.'' 's/^guava/#guava/' projects-to-test-on.properties
  sed -i.'' 's/#spotbugs/spotbugs/' projects-to-test-on.properties
  groovy ./launch.groovy --listOfProjects projects-to-test-on.properties \
      --config checks-nonjavadoc-error.xml --checkstyleVersion ${CS_POM_VERSION}
  cd ../../
  rm -rf contribution
  ;;

no-exception-spring-framework)
  CS_POM_VERSION=$(mvn -e -q -Dexec.executable='echo' -Dexec.args='${project.version}' \
                     --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
  echo CS_version: ${CS_POM_VERSION}
  checkout_from https://github.com/checkstyle/contribution.git
  cd .ci-temp/contribution/checkstyle-tester
  sed -i.'' 's/^guava/#guava/' projects-to-test-on.properties
  sed -i.'' 's/#spring-framework/spring-framework/' projects-to-test-on.properties
  groovy ./launch.groovy --listOfProjects projects-to-test-on.properties \
      --config checks-nonjavadoc-error.xml --checkstyleVersion ${CS_POM_VERSION}
  cd ../../
  rm -rf contribution
  ;;

no-exception-hbase)
  CS_POM_VERSION=$(mvn -e -q -Dexec.executable='echo' -Dexec.args='${project.version}' \
                     --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
  echo CS_version: ${CS_POM_VERSION}
  checkout_from https://github.com/checkstyle/contribution.git
  cd .ci-temp/contribution/checkstyle-tester
  sed -i.'' 's/^guava/#guava/' projects-to-test-on.properties
  sed -i.'' 's/#Hbase/Hbase/' projects-to-test-on.properties
  groovy ./launch.groovy --listOfProjects projects-to-test-on.properties \
      --config checks-nonjavadoc-error.xml --checkstyleVersion ${CS_POM_VERSION}
  cd ../../
  rm -rf contribution
  ;;

no-exception-Pmd-elasticsearch-lombok-ast)
  CS_POM_VERSION=$(mvn -e -q -Dexec.executable='echo' -Dexec.args='${project.version}' \
                     --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
  echo CS_version: ${CS_POM_VERSION}
  checkout_from https://github.com/checkstyle/contribution.git
  cd .ci-temp/contribution/checkstyle-tester
  sed -i.'' 's/^guava/#guava/' projects-to-test-on.properties
  sed -i.'' 's/#pmd/pmd/' projects-to-test-on.properties
  sed -i.'' 's/#elasticsearch/elasticsearch/' projects-to-test-on.properties
  sed -i.'' 's/#lombok-ast/lombok-ast/' projects-to-test-on.properties
  groovy ./launch.groovy --listOfProjects projects-to-test-on.properties \
      --config checks-nonjavadoc-error.xml --checkstyleVersion ${CS_POM_VERSION}
  cd ../../
  rm -rf contribution
  ;;

no-exception-alot-of-projects)
  CS_POM_VERSION=$(mvn -e -q -Dexec.executable='echo' -Dexec.args='${project.version}' \
                     --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
  echo CS_version: ${CS_POM_VERSION}
  checkout_from https://github.com/checkstyle/contribution.git
  cd .ci-temp/contribution/checkstyle-tester
  sed -i.'' 's/^guava/#guava/' projects-to-test-on.properties
  sed -i.'' 's/#RxJava/RxJava/' projects-to-test-on.properties
  sed -i.'' 's/#java-design-patterns/java-design-patterns/' projects-to-test-on.properties
  sed -i.'' 's/#MaterialDesignLibrary/MaterialDesignLibrary/' projects-to-test-on.properties
  sed -i.'' 's/#apache-ant/apache-ant/' projects-to-test-on.properties
  sed -i.'' 's/#apache-jsecurity/apache-jsecurity/' projects-to-test-on.properties
  sed -i.'' 's/#android-launcher/android-launcher/' projects-to-test-on.properties
  groovy ./launch.groovy --listOfProjects projects-to-test-on.properties \
      --config checks-nonjavadoc-error.xml --checkstyleVersion ${CS_POM_VERSION}
  cd ../../
  rm -rf contribution
  ;;

no-warning-imports-guava)
  PROJECTS=checks-import-order/projects-to-test-imports-guava.properties
  CONFIG=checks-import-order/checks-imports-error-guava.xml
  REPORT=reports/guava/site/index.html
  CS_POM_VERSION=$(mvn -e -q -Dexec.executable='echo' -Dexec.args='${project.version}' \
                     --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
  echo CS_version: ${CS_POM_VERSION}
  checkout_from https://github.com/checkstyle/contribution.git
  cd .ci-temp/contribution/checkstyle-tester
  groovy ./launch.groovy --listOfProjects $PROJECTS --config $CONFIG \
      --checkstyleVersion ${CS_POM_VERSION}
  RESULT=`grep -A 5 " Warning</td>" $REPORT | cat`
  cd ../../
  rm -rf contribution
  if [ -z "$RESULT" ]; then
    echo "Inpection did not find any warnings"
  else
    echo "$RESULT"
    echo "Some warnings have been found. Verification failed."
    sleep 5s
    exit 1
  fi
  ;;

no-warning-imports-java-design-patterns)
  PROJECTS=checks-import-order/projects-to-test-imports-java-design-patterns.properties
  CONFIG=checks-import-order/checks-imports-error-java-design-patterns.xml
  REPORT=reports/java-design-patterns/site/index.html
  CS_POM_VERSION=$(mvn -e -q -Dexec.executable='echo' -Dexec.args='${project.version}' \
                     --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
  echo CS_version: ${CS_POM_VERSION}
  checkout_from https://github.com/checkstyle/contribution.git
  cd .ci-temp/contribution/checkstyle-tester
  groovy ./launch.groovy --listOfProjects $PROJECTS --config $CONFIG \
      --checkstyleVersion ${CS_POM_VERSION}
  RESULT=`grep -A 5 " Warning</td>" $REPORT | cat`
  cd ../../
  rm -rf contribution
  if [ -z "$RESULT" ]; then
    echo "Inpection did not find any warnings"
  else
    echo "$RESULT"
    echo "Some warnings have been found. Verification failed."
    sleep 5s
    exit 1
  fi
  ;;

*)
  echo "Unexpected argument: $1"
  sleep 5s
  false
  ;;

esac


#!/usr/bin/env bash
set -u -o pipefail

VCS_SOURCE="$(git remote get-url --push origin)"
VCS_REVISION="$(git describe --always)"
DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
export VCS_SOURCE
export VCS_REVISION
export DATE
export BASE_IMAGE="antora/antora:3.0.1"
export BASH_VERSION="5.1.8-r0"
export MAKE_VERSION="4.3-r0"
export GIT_VERSION="2.34.1-r0"
export OPENSSH_CLIENT_VERSION="8.8_p1-r1"
export ANTORA_XREF_VALIDATOR="v1.0.0-alpha.14"
export LUNR_EXTENSION_VERSION="1.0.0-alpha.4"


#!/usr/bin/env bash
#
# Create a Swarm Mode service that builds an Elasticsearch, Kibana and cAdvisor
# cluster.
# This script is a mirror of the following gist, which is used to
# populate a Medium story. Unfortunately, there's no way to synchronize all
# three
#
# Medium: https://medium.com/contino-io/docker-kata-005-ac8429082f6c
# Gist: https://gist.github.com/anonymuse/df84df471abda00fbc3ab595037ab44d

# Set up global variables
swarm_network=${SWARM_NETWORK:-"monitoring"}
workers=${WORKERS:-"node01 node02 node03 node04"}
master=${MASTERS:-"master01"}
swarm_port=2377
master_ip=$(docker-machine ip ${master})
master_conf=$(docker-machine config ${master})

# Function to save configuration loading while we switch Docker Machine
# environment variables
# Arguments:
#   $@: the Docker engine commmand that we'll load into the configuration
swarm_master() {
      docker $master_conf $@
  }

# The body of our script
main() {

  # Create the network that we'll use for the swarm. Ensure that this command is
  # executed from your Swarm Manager.
  docker $master_conf network create $swarm_network -d overlay

  # Take the set of nodes, and get the first in the list
  # to use for the Elasticsearch node.
  worker_array=($workers)
  el_node=${worker_array[0]}

  # Create the Elasticsearch service
  docker $master_conf service create --network=$swarm_network \
    --mount type=volume,target=/usr/share/elasticsearch/data \
    --constraint node.hostname==$el_node \
    --name elasticsearch elasticsearch:2.4.0

  # Create the Kibana service
  docker $master_conf service create --network=$swarm_network \
    --name kibana -e ELASTICSEARCH_URL="http://elasticsearch:9200" \
    -p 5601:5601 kibana:4.6.0

  # Create the cAdivsor service
  docker $master_conf service create --network=$swarm_network \
    --mode global --name cadvisor \
    --mount type=bind,source=/,target=/rootfs,readonly=true \
    --mount type=bind,source=/var/run,target=/var/run,readonly=false \
    --mount type=bind,source=/sys,target=/sys,readonly=true \
    --mount type=bind,source=/var/lib/docker/,target=/var/lib/docker,readonly=true \
    google/cadvisor:latest -storage_driver=elasticsearch \
    -storage_driver_es_host="http://elasticsearch:9200"
  # Give the service time to start up
  echo "Sleeping for 10 seconds to allow cAdvisor service to initiate"
  sleep 10

  # Create a container visualizer
  docker $master_conf run -it -d -p 5000:5000 -e HOST=$master_ip -e PORT=5000 \
    -v /var/run/docker.sock:/var/run/docker.sock manomarks/visualizer

  # Open up a webpage to our visualizer
  open http://$master_ip:5000

  echo $master_conf

  # Add an index to Kibana for cAdvisor metrics
  docker $master_conf exec $(docker ${master_conf} ps |grep cadvisor | \
      awk '{print $1}' | head -1) apk --no-cache add curl

  docker $master_conf exec $(docker ${master_conf} ps |grep cadvisor | \
      awk '{print $1}' | head -1) curl -XPUT \
      http://elasticsearch:9200/.kibana/index-pattern/cadvisor -d \
      '{"title" : "cadvisor*", "timeFieldName": "container_stats.timestamp"}'

  # Make the index default
    docker $master_conf exec $(docker ${master_conf} ps |grep cadvisor | \
        awk '{print $1}' | head -1) curl -XPUT \
        http://elasticsearch:9200/.kibana/config/4.6.0 -d \
        '{"defaultIndex":"cadvisor"}'

}

main $@


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

set -e

reset=$(tput sgr0)
magenta=$(tput setaf 5)
bold=$(tput bold)

function log {
    now=$(date "+%F %T")
    echo "$bold$magenta[$now]" $@ $reset 1>&2
}

function logged {
    log $@
    $@
}

function die { log $@; exit 1; }

# make sure there are no unsaved changes
# https://stackoverflow.com/questions/3878624/how-do-i-programmatically-determine-if-there-are-uncommitted-changes
if [[ `git status --porcelain` ]]; then
    die "Unsaved Changes"
fi

REPOSITORY=michaelfbryan/mdbook-docker-image
GIT_SHA=$(git rev-parse --short HEAD)

logged docker build -t $REPOSITORY:$GIT_SHA -t $REPOSITORY:latest .
logged docker push $REPOSITORY


<filename>contrib/swarm/cluster/create.sh
#!/bin/bash
provider=virtualbox
echo "### Init Servers ###"

docker-machine create -d ${provider} sw1 &
docker-machine create -d ${provider} sw2 &
docker-machine create -d ${provider} sw3 &

wait

echo "### Configurate cluster ###"

MANAGER_IP=$(docker-machine ip sw1)
docker-machine ssh sw1 docker swarm init --advertise-addr ${MANAGER_IP}
TOKEN=$(docker-machine ssh sw1 docker swarm join-token -q worker)
docker-machine ssh sw2 docker swarm join --token ${TOKEN} ${MANAGER_IP}:2377
docker-machine ssh sw3 docker swarm join --token ${TOKEN} ${MANAGER_IP}:2377

# Information
echo ""
echo "CLUSTER INFORMATION"
echo "discovery token: ${TOKEN}"
echo "Environment variables to connect trough docker cli"
docker-machine env sw1


#!/bin/bash

set -x

mkdir -p "data/mitdb"
cd "data/mitdb"

exts="atr dat hea"
for ext in $exts; do
	for rec in {100..124}; do
		filename=$rec.$ext
		wget https://physionet.org/physiobank/database/mitdb/$filename
	done
	for rec in {200..234}; do
		filename=$rec.$ext
		wget https://physionet.org/physiobank/database/mitdb/$filename
	done
done


<gh_stars>1-10
#!/usr/bin/env bash
# first rename files to match frame pattern
ffmpeg -framerate 10 -i "i (%d)*.png" out.gif
ffmpeg -i SpaceGAN-training.gif -c:v libvpx -crf 4 -b:v 8000K -auto-alt-ref 0 output.webm


# --------------------------------------------------------------------------------------
# Certificate Authority (CA)
# https://superuser.com/questions/738612/openssl-ca-keyusage-extension

# Creating our root PRIVATE Key
openssl genrsa -out saevon.root.key 4096
    # Add this if you want to encrypt the key as well (with a passphrase)
    -des3

# Create our ROOT Certificate
openssl req -x509 -new -key saevon.root.key -sha256 -days 365 -out saevon.root.crt
    # You need to explicitly choose to encrypt (or not)
    -nodes
    # OR
    -des3

# Sign people's Certificates (send back the *.crt)
openssl req -x509 -in mydomain.com.csr -CA saevon.root.crt -CAkey saevon.root.key
    -out mydomain.com.crt -config ssl.conf.ini
    # Every certificate you sign needs a unique serial number... this is stored on a file
    # You will need one of the following:

    # The first time you create a serial (indicating how many things you've signed)
    -CAcreateserial
        # it creates a file with the same name as the *.crt except *.srl

    # Every time afterwards, just supply this file
    -CAserial saevon.root.srl

# Verify that something was signed by you
openssl verify -CAfile saevon.root.crt mydomain.com.crt

# MacOSX Splitting from Keychain.app (after exporting)
openssl pkcs12 -in path.p12 -out newfile.crt.pem -clcerts -nokeys
openssl pkcs12 -in path.p12 -out newfile.key.pem -nocerts -nodes

# --------------------------------------------------------------------------------------
# Server SSL

# TODO:
# 1) Create this system once
# 2) Verify that extensions (e.g. the SAN[second name] get copied over when you sign the crt)
# 3) Theres also EV (Extended Validation) in case you want the green lock symbol
# https://gist.github.com/Soarez/9688998

# --------------------------------------------------------------------------------------
# Server SSL

# Create our Server Certificate PRIVATE KEY
openssl genrsa -out mydomain.com.key 2048

# Certificate Signing Request (csr)
#   Ask a Root CA to sign your SSL Certificate
openssl req -new -key mydomain.com.key -out mydomain.com.csr -config mydomain.com.conf
    # You can also add in other things... such as a SAN: (extra domain names)

# Now Get the CA to actually sign it
#    csr >> crt
# The CSR is useless after wards
rm mydomain.com.csr

# OR self-sign it
#   Note you need the INI again to get extensions working properly...???
openssl x509 -req -days 365 -in mydomain.com.csr -signkey mydomain.com.key -out mydomain.com.crt  -extfile mydomain.com.ini

# Getting information out of a .crt
openssl x509 -text -noout -in mydomain.com.crt

# Checking a servers certificate
#   You might need
openssl s_client -connect server.com:443
    # Optionally you can specify a root CA to use, a bundle
    # OR you can use an intermediate cert (especially if the server doesn't provide it)
    -CAfile certificate.bundle.pem

# --------------------------------------------------------------------------------------
# Double check permissions (and location)
sudo chmod u=rw,g=r,o=   /etc/ssl/private/*.key
     chown root:ssl-cert
sudo chmod u=rw,g=r,o=r /etc/ssl/cert/*.crt
     chown root:ssl-cert

# Notes:
*.pem # A Jumble of things: CSR, CRT, KEY, etc
*.p12 # A Jumble of Certificate + Private Key (CRT + KEY) (MacOSX)
*.crt # A certificate PEM file (but apps know its a certificate)
*.csr # Basically your public key for the CA to issue a certificate
*.srl # A Serial identifier for a CA

# Don't forget about wildcard certificates (locking down all subdomains)
*.saevon.ca
# Which won't actually match the base(naked) domain... so include them both


#!/bin/sh

basepath=$(cd `dirname $0`; pwd)/swoole.pid

kill -USR1 `cat $basepath`;


<gh_stars>1-10
#!/bin/bash
gcloud dataproc jobs submit pyspark \
       --cluster sparktobq \
       spark_analysis.py \
       -- --bucket=$1


<reponame>zhijian-yang/SmileGAN
#!/bin/bash

while read requirement;
do
	pip install $requirement
done < requirements.txt


#!/bin/bash

# Copyright 2016 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     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.

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

# "-=-=-=-=-=-=-=-=-=-="
# This script is only for CI testing purposes. Don't use it in production.
# "-=-=-=-=-=-=-=-=-=-="

KUBE_ROOT=${KUBE_ROOT:-$(dirname "${BASH_SOURCE}")/../..}
source "${KUBE_ROOT}/cluster/clientbin.sh"

# If KUBEFED_PATH isn't set, gather up the list of likely places and use ls
# to find the latest one.
if [[ -z "${KUBEFED_PATH:-}" ]]; then
  kubefed=$( get_bin "kubefed" "federation/cmd/kubefed" )

  if [[ ! -x "$kubefed" ]]; then
    print_error "kubefed"
    exit 1
  fi
elif [[ ! -x "${KUBEFED_PATH}" ]]; then
  {
    echo "KUBEFED_PATH environment variable set to '${KUBEFED_PATH}', but "
    echo "this doesn't seem to be a valid executable."
  } >&2
  exit 1
fi
kubefed="${KUBEFED_PATH:-${kubefed}}"

# Use the arguments to the script if it is set, a null string
# otherwise.
"${kubefed}" "${@+$@}"


for j in $(seq 23)
	do
                i=0;
                nome=jogador$j-$pais;
		cpf=$i$j$i$j$i;
                if [ $j -eq 1 ]
                then
                        echo "INSERT INTO jogador VALUES($i$j,'$nome','23/10/1980',$i,'GOL',$cpf,$j);"  >> pais_jogador.sql;
                fi
                if [ $j -eq 2 ]
                then
                        echo "INSERT INTO jogador VALUES($i$j,'$nome','23/10/1980',$i,'LAT',$cpf,$j);"  >> pais_jogador.sql;
                fi
                if [ $j -eq 3 ]
                then
                        echo "INSERT INTO jogador VALUES($i$j,'$nome','23/10/1980',$i,'ZAG',$cpf,$j);"  >> pais_jogador.sql;
                fi
                if [ $j -eq 4 ]
                then
                        echo "INSERT INTO jogador VALUES($i$j,'$nome','23/10/1980',$i,'ZAG',$cpf,$j);"  >> pais_jogador.sql;
                fi
                if [ $j -eq 5 ]
                then
                        echo "INSERT INTO jogador VALUES($i$j,'$nome','23/10/1980',$i,'ZAG',$cpf,$j);"  >> pais_jogador.sql;
                fi
                if [ $j -eq 6 ]
                then
                        echo "INSERT INTO jogador VALUES($i$j,'$nome','23/10/1980',$i,'LAT',$cpf,$j);"  >> pais_jogador.sql;
                fi
                if [ $j -eq 7 ]
                then
                        echo "INSERT INTO jogador VALUES($i$j,'$nome','23/10/1980',$i,'MEI',$cpf,$j);"  >> pais_jogador.sql;
                fi
                if [ $j -eq 8 ]
                then
                        echo "INSERT INTO jogador VALUES($i$j,'$nome','23/10/1980',$i,'MEI',$cpf,$j);"  >> pais_jogador.sql;
                fi
                if [ $j -eq 9 ]
                then
                        echo "INSERT INTO jogador VALUES($i$j,'$nome','23/10/1980',$i,'ATA',$cpf,$j);"  >> pais_jogador.sql;
                fi
                if [ $j -eq 10 ]
                then
                        echo "INSERT INTO jogador VALUES($i$j,'$nome','23/10/1980',$i,'MEI',$cpf,$j);"  >> pais_jogador.sql;
                fi
                if [ $j -eq 11 ]
                then
                        echo "INSERT INTO jogador VALUES($i$j,'$nome','23/10/1980',$i,'ATA',$cpf,$j);"  >> pais_jogador.sql;
                fi
                if [ $j -eq 12 ]
                then
                        echo "INSERT INTO jogador VALUES($i$j,'$nome','23/10/1980',$i,'GOL',$cpf,$j);"  >> pais_jogador.sql;
                fi
                if [ $j -eq 13 ]
                then
                        echo "INSERT INTO jogador VALUES($i$j,'$nome','23/10/1980',$i,'LAT',$cpf,$j);"  >> pais_jogador.sql;
                fi
                if [ $j -eq 14 ]
                then
                        echo "INSERT INTO jogador VALUES($i$j,'$nome','23/10/1980',$i,'ZAG',$cpf,$j);"  >> pais_jogador.sql;
                fi
                if [ $j -eq 15 ]
                then
                        echo "INSERT INTO jogador VALUES($i$j,'$nome','23/10/1980',$i,'ZAG',$cpf,$j);"  >> pais_jogador.sql;
                fi
                if [ $j -eq 16 ]
                then
                        echo "INSERT INTO jogador VALUES($i$j,'$nome','23/10/1980',$i,'ZAG',$cpf,$j);"  >> pais_jogador.sql;
                fi
                if [ $j -eq 17 ]
                then
                        echo "INSERT INTO jogador VALUES($i$j,'$nome','23/10/1980',$i,'LAT',$cpf,$j);"  >> pais_jogador.sql;
                fi
                if [ $j -eq 18 ]
                then
                        echo "INSERT INTO jogador VALUES($i$j,'$nome','23/10/1980',$i,'MEI',$cpf,$j);"  >> pais_jogador.sql;
                fi
                if [ $j -eq 19 ]
                then
                        echo "INSERT INTO jogador VALUES($i$j,'$nome','23/10/1980',$i,'MEI',$cpf,$j);"  >> pais_jogador.sql;
                fi
                if [ $j -eq 20 ]
                then
                        echo "INSERT INTO jogador VALUES($i$j,'$nome','23/10/1980',$i,'ATA',$cpf,$j);"  >> pais_jogador.sql;
                fi
                if [ $j -eq 21 ]
                then
                        echo "INSERT INTO jogador VALUES($i$j,'$nome','23/10/1980',$i,'MEI',$cpf,$j);"  >> pais_jogador.sql;
                fi
                if [ $j -eq 22 ]
                then
                        echo "INSERT INTO jogador VALUES($i$j,'$nome','23/10/1980',$i,'ATA',$cpf,$j);"  >> pais_jogador.sql;
                fi
                if [ $j -eq 23 ]
                then
                        echo "INSERT INTO jogador VALUES($i$j,'$nome','23/10/1980',$i,'GOL',$cpf,$j);"  >> pais_jogador.sql;
                fi

                ## definindo ocas goleiros

	done


#! /bin/sh
#Setup Ruby
sudo apt update && \
sudo apt install -y ruby-full ruby-bundler build-essential && \
ruby -v && \
bundler -v

#Setup MongoDB
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 &&
sudo bash -c 'echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" > /etc/apt/sources.list.d/mongodb-org-3.2.list'

sudo apt update && \
sudo apt install -y mongodb-org && \
sudo systemctl start mongod && \
sudo systemctl enable mongod && \
sudo systemctl status mongod

#Deploy
git clone -b monolith https://github.com/express42/reddit.git && \
cd reddit && bundle install && \
puma -d && \
ps aux | grep puma


<filename>stackoverflow/.travis.sh<gh_stars>1-10
export DATABASE_URL="postgresql+psycopg2://asheuh:@mermaid@localhost:5432/stackoverflow_test"
export ENVIRONMENT="DEVELOPMENT"
export FLASK_DEBUG = 1
export TEST_DATABASE_URI="postgresql+psycopg2://postgres:@bashtech1234@localhost:5432/travis_test"
export FLASK_APP='app.py'


#!/usr/bin/env bash

if [ ! -x "$(command -v isort 2>/dev/null)" ]; then
  echo 'can not find "isort" in system path.'
  exit 1
fi

if [ ! -x "$(command -v black 2>/dev/null)" ]; then
  echo 'can not find "black" in system path.'
  exit 1
fi

TARGET=("feaflow tests setup.py")
if [ "$1" != "" ]; then
  TARGET=("$@")
fi

ROOT_DIR=$(dirname $(dirname "$(realpath "$0")"))
cd $ROOT_DIR || exit 1

isort ${TARGET[@]} && \
black --target-version py38 ${TARGET[@]}


<gh_stars>10-100
#!/bin/bash
set -x
rm -r 111-array-individual-assigns.out || exit 1
exit 0


#!/usr/bin/expect -f

set AP_IPADDR 	[lindex $argv 0];
set AP_USRNM	[lindex $argv 1];
set AP_PWD 		[lindex $argv 2];
set SSID 		[lindex $argv 3];
set KEY 		[lindex $argv 4];
set HIDE 		[lindex $argv 5];

# puts "Total: $ARGC argument(s)"

# SSH
spawn ssh -o StrictHostKeyChecking=no $AP_USRNM@$AP_IPADDR
set timeout 10
expect {*?assword:*}
send "$AP_PWD"
send "\r"

# Telnet
# spawn telnet $AP_IPADDR
# set timeout 10
# expect {*?:/#*}

# Wait for login
sleep 1

# Configure iface 1
send "uci set wireless.@wifi-iface\[0\].ssid='$SSID'\r"
send "uci set wireless.@wifi-iface\[0\].encryption=psk2\r"
send "uci set wireless.@wifi-iface\[0\].key='$KEY'\r"
send "uci set wireless.@wifi-iface\[0\].hidden=$HIDE\r"

send "uci commit wireless\r"
send "wifi\r"

# Terminate session
send "exit\r"

expect eof


#!/bin/bash

cd /opt/burrow-stats
consul-template -once -template "/etc/consul-templates/burrow-stats/configs.json.ctmpl:/opt/burrow-stats/configs.json"
npm start


#!/bin/bash

ps -aux | grep dataspaces| cut -c 9-15|xargs kill -9
ps -aux | grep test| cut -c 9-15|xargs kill -9


<gh_stars>0
#! /bin/sh

## Most tsv-sample testing is done as unit tests. Tests executed by this script are run
## against the final executable. This provides a sanity check that the final executable
## is good. Tests are easy to run in this format, so there is overlap. However, these
## tests do not test edge cases as rigorously as unit tests. Instead, these tests focus
## on areas that are hard to test in unit tests.
##
## Portability note: Many of the tests here rely on generating consistent random numbers
## across different platforms when using the same random seed. So far this has succeeded
## on several different platorm, compiler, and library versions. However, it is certainly
## possible this condition will not hold on other platforms.
##
## For tsv-sample, this portability implies generating the same results on different
## platforms when using the same random seed. This is NOT part of tsv-sample guarantees,
## but it is convenient for testing. If platforms are identified that do not generate
## the same results these tests will need to be adjusted.

if [ $# -le 1 ]; then
    echo "Insufficient arguments. A program name and output directory are required."
    exit 1
fi

prog=$1
shift
odir=$1
echo "Testing ${prog}, output to ${odir}"

## Three args: program, args, output file
runtest () {
    echo "" >> $3
    echo "====[tsv-sample $2]====" >> $3
    $1 $2 >> $3 2>&1
    return 0
}

basic_tests_1=${odir}/basic_tests_1.txt

echo "Basic tests set 1" > ${basic_tests_1}
echo "-----------------" >> ${basic_tests_1}

runtest ${prog} "--header --static-seed input3x10.tsv input3x25.tsv" ${basic_tests_1}
runtest ${prog} "-H -s --print-random input3x10.tsv input3x25.tsv" ${basic_tests_1}
runtest ${prog} "-H -s --print-random --weight-field 3 input3x10.tsv input3x25.tsv" ${basic_tests_1}
runtest ${prog} "-H -s --print-random -w 3 --num 15 input3x10.tsv input3x25.tsv" ${basic_tests_1}
runtest ${prog} "-H -s --print-random -n 15 input3x10.tsv input3x25.tsv" ${basic_tests_1}
runtest ${prog} "-H -s -n 100 input3x10.tsv input3x25.tsv" ${basic_tests_1}
runtest ${prog} "-H -s --gen-random-inorder --weight-field 3 input3x10.tsv input3x25.tsv" ${basic_tests_1}
runtest ${prog} "-H -s --gen-random-inorder -n 15 --weight-field 3 input3x10.tsv input3x25.tsv" ${basic_tests_1}
runtest ${prog} "-H -s --gen-random-inorder input3x10.tsv input3x25.tsv" ${basic_tests_1}
runtest ${prog} "-H -s --gen-random-inorder -n 15 input3x10.tsv input3x25.tsv" ${basic_tests_1}

# Bernoulli sampling
runtest ${prog} "-H -s --prob 1.0 --print-random input3x10.tsv input3x25.tsv" ${basic_tests_1}
runtest ${prog} "-H -s -p 0.25 input3x10.tsv input3x25.tsv" ${basic_tests_1}
runtest ${prog} "-H -s -p 0.75 -n 5 input3x10.tsv input3x25.tsv" ${basic_tests_1}
runtest ${prog} "-H -s -p .25 --key-fields 1 input4x50.tsv input4x15.tsv" ${basic_tests_1}

# Simple random sampling with replacement
runtest ${prog} "-H -s --replace input3x3.tsv --num 5" ${basic_tests_1}
runtest ${prog} "-s --r input2x5_noheader.tsv --num 7" ${basic_tests_1}

# Distinct Sampling
runtest ${prog} "-H -s --prob .25 -k 3,1 input4x50.tsv input4x15.tsv" ${basic_tests_1}
runtest ${prog} "-H -s -p .25 -k 1,3 input4x50.tsv input4x15.tsv" ${basic_tests_1}
runtest ${prog} "-H -s -p .25 -k 1,1 input4x50.tsv input4x15.tsv" ${basic_tests_1}
runtest ${prog} "-H -s -p .25 -k 1 -n 5 input4x50.tsv input4x15.tsv" ${basic_tests_1}
runtest ${prog} "-s -p .25 -k 1,3 input4x50.tsv input4x15.tsv" ${basic_tests_1}
runtest ${prog} "-s -p .25 -k 3,1 input4x50.tsv input4x15.tsv" ${basic_tests_1}
runtest ${prog} "-s -p 1 -k 3,1 input4x50.tsv input4x15.tsv" ${basic_tests_1}
runtest ${prog} "-H -s -p .2 -k 3 --print-random input4x50.tsv input4x15.tsv" ${basic_tests_1}
runtest ${prog} "-H -s -p .2 -k 3 --print-random -n 5 input4x50.tsv input4x15.tsv" ${basic_tests_1}
runtest ${prog} "-H -s -p .2 -k 3 --gen-random-inorder -n 10 input4x50.tsv input4x15.tsv" ${basic_tests_1}

runtest ${prog} "--static-seed input2x10_noheader.tsv input2x5_noheader.tsv" ${basic_tests_1}
runtest ${prog} "-s --print-random input2x10_noheader.tsv input2x5_noheader.tsv" ${basic_tests_1}
runtest ${prog} "-s --print-random --weight-field 1 input2x10_noheader.tsv input2x5_noheader.tsv" ${basic_tests_1}
runtest ${prog} "-s --print-random -w 1 --num 15 input2x10_noheader.tsv input2x5_noheader.tsv" ${basic_tests_1}
runtest ${prog} "-s --print-random -n 5 input2x10_noheader.tsv input2x5_noheader.tsv" ${basic_tests_1}
runtest ${prog} "-s -n 100 input2x10_noheader.tsv input2x5_noheader.tsv" ${basic_tests_1}

runtest ${prog} "-s --prob 1 --print-random input2x10_noheader.tsv input2x5_noheader.tsv" ${basic_tests_1}
runtest ${prog} "-s -p .25 input2x10_noheader.tsv input2x5_noheader.tsv" ${basic_tests_1}
runtest ${prog} "-s -p .75 -n 5 input2x10_noheader.tsv input2x5_noheader.tsv" ${basic_tests_1}

runtest ${prog} "--delimiter @ -H --static-seed input2x7_atsign.tsv" ${basic_tests_1}
runtest ${prog} "-d @ -H -s --print-random input2x7_atsign.tsv" ${basic_tests_1}
runtest ${prog} "-d @ -H -s --print-random -w 2 input2x7_atsign.tsv" ${basic_tests_1}
runtest ${prog} "-d @ -H -s --print-random -w 2 -n 3 input2x7_atsign.tsv" ${basic_tests_1}
runtest ${prog} "-d @ -H -s --print-random -n 20 input2x7_atsign.tsv" ${basic_tests_1}
runtest ${prog} "-d @ -H -s --print-random --prob 1.0 input2x7_atsign.tsv" ${basic_tests_1}

## Tests with a negative weight. Negative weight entry should be last.
runtest ${prog} "-H -w 3 -v 777 input3x25_negative_wt.tsv" ${basic_tests_1}
runtest ${prog} "-H -w 3 -v 888 input3x25_negative_wt.tsv" ${basic_tests_1}
runtest ${prog} "-H -w 3 -v 777 -n 24 input3x25_negative_wt.tsv" ${basic_tests_1}
runtest ${prog} "-H -w 3 -v 888 -n 24 input3x25_negative_wt.tsv" ${basic_tests_1}
runtest ${prog} "-H --gen-random-inorder -w 3 -v 777 input3x25_negative_wt.tsv" ${basic_tests_1}
runtest ${prog} "-H --gen-random-inorder -w 3 -v 888 input3x25_negative_wt.tsv" ${basic_tests_1}

## Line order randomization with standard input and multiple files. These deserve specific tests
## due to special handling of these in the code. runtest cannot do these, so write out by hand.
echo "" >> ${basic_tests_1}; echo "====[cat input3x10.tsv tsv-sample -v 99]====" >> ${basic_tests_1}
cat input3x10.tsv | ${prog} -v 99 >> ${basic_tests_1} 2>&1

echo "" >> ${basic_tests_1}; echo "====[cat input3x10.tsv tsv-sample -H -v 99]====" >> ${basic_tests_1}
cat input3x10.tsv | ${prog} -H -v 99 >> ${basic_tests_1} 2>&1

echo "" >> ${basic_tests_1}; echo "====[cat input3x10.tsv tsv-sample -H -v 99 --print-random]====" >> ${basic_tests_1}
cat input3x10.tsv | ${prog} -H -v 99 --print-random >> ${basic_tests_1} 2>&1

echo "" >> ${basic_tests_1}; echo "====[cat input3x10.tsv tsv-sample -H -s -- - input3x3.tsv input3x4.tsv]====" >> ${basic_tests_1}
cat input3x10.tsv | ${prog} -H -s -- - input3x3.tsv input3x4.tsv >> ${basic_tests_1} 2>&1

echo "" >> ${basic_tests_1}; echo "====[cat input3x10.tsv tsv-sample -H -s -- input3x3.tsv - input3x4.tsv]====" >> ${basic_tests_1}
cat input3x10.tsv | ${prog} -H -s -- input3x3.tsv - input3x4.tsv >> ${basic_tests_1} 2>&1

echo "" >> ${basic_tests_1}; echo "====[cat input3x10.tsv tsv-sample -s -- input3x3.tsv input3x4.tsv -]====" >> ${basic_tests_1}
cat input3x3.tsv | ${prog} -s -- input3x4.tsv - >> ${basic_tests_1} 2>&1

echo "" >> ${basic_tests_1}; echo "====[cat input3x10.tsv tsv-sample -H -s -w 3 -- input3x3.tsv - input3x4.tsv]====" >> ${basic_tests_1}
cat input3x10.tsv | ${prog} -H -s -w 3 -- input3x3.tsv - input3x4.tsv >> ${basic_tests_1} 2>&1

echo "" >> ${basic_tests_1}; echo "====[cat input3x10.tsv tsv-sample -H -s --replace --num 10]====" >> ${basic_tests_1}
cat input3x10.tsv | ${prog} -H -s --replace --num 10 >> ${basic_tests_1} 2>&1

echo "" >> ${basic_tests_1}; echo "====[cat input3x10.tsv tsv-sample -H -s --replace --num 10 -- input3x3.tsv - input3x4.tsv]====" >> ${basic_tests_1}
cat input3x10.tsv | ${prog} -H -s --replace --num 10 -- input3x3.tsv - input3x4.tsv >> ${basic_tests_1} 2>&1

## Random sample with infinite output - control with head.
echo "" >> ${basic_tests_1}; echo "====[cat input3x10.tsv tsv-sample -H -s --replace | head -n 1000 | tail]====" >> ${basic_tests_1}
cat input3x10.tsv | ${prog} -H -s --replace | head -n 1000 | tail >> ${basic_tests_1} 2>&1

## Need to run a few tests with the unpredictable seed. Can't compare the results
## so check the number of lines returned. Some standard input tests are also in
## this section. runtest can't do these, write these out by hand.
## Note: The "tr -d ' '" construct strips whitespace, which differs between 'wc -l' implementations.
echo "" >> ${basic_tests_1}; echo "====[tsv-sample -H input3x10.tsv | wc -l | tr -d ' ']====" >> ${basic_tests_1}
${prog} -H input3x10.tsv | wc -l | tr -d ' ' >> ${basic_tests_1} 2>&1

echo "" >> ${basic_tests_1}; echo "====[tsv-sample -H -n 9 input3x25.tsv | wc -l | tr -d ' ']====" >> ${basic_tests_1}
${prog} -H -n 9 input3x25.tsv | wc -l | tr -d ' ' >> ${basic_tests_1} 2>&1

echo "" >> ${basic_tests_1}; echo "====[tsv-sample -H -n 25 input3x25.tsv input3x10.tsv | wc -l | tr -d ' ']====" >> ${basic_tests_1}
${prog} -H -n 25 input3x25.tsv input3x10.tsv| wc -l | tr -d ' ' >> ${basic_tests_1} 2>&1

echo "" >> ${basic_tests_1}; echo "====[tsv-sample -H -n 9 -w 3 input3x25.tsv | wc -l | tr -d ' ']====" >> ${basic_tests_1}
${prog} -H -n 9 -w 3 input3x25.tsv | wc -l | tr -d ' ' >> ${basic_tests_1} 2>&1

echo "" >> ${basic_tests_1}; echo "====[cat input3x10.tsv tsv-sample -H --print-random | wc -l | tr -d ' ']====" >> ${basic_tests_1}
cat input3x10.tsv | ${prog} -H --print-random | wc -l | tr -d ' ' >> ${basic_tests_1} 2>&1

echo "" >> ${basic_tests_1}; echo "====[cat input3x10.tsv tsv-sample -H --print-random -w 3 -- - input3x25.tsv | wc -l | tr -d ' ']====" >> ${basic_tests_1}
cat input3x10.tsv | ${prog} -H --print-random -w 3 -- - input3x25.tsv | wc -l | tr -d ' ' >> ${basic_tests_1} 2>&1

echo "" >> ${basic_tests_1}; echo "====[cat input3x10.tsv tsv-sample -H --print-random -w 3 -n 10 -- - input3x25.tsv | wc -l | tr -d ' ']====" >> ${basic_tests_1}
cat input3x10.tsv | ${prog} -H --print-random -w 3 -n 10 -- - input3x25.tsv | wc -l | tr -d ' ' >> ${basic_tests_1} 2>&1

## Help and Version printing

echo "" >> ${basic_tests_1}
echo "Help and Version printing 1" >> ${basic_tests_1}
echo "-----------------" >> ${basic_tests_1}
echo "" >> ${basic_tests_1}

echo "====[tsv-sample --help | grep -c Synopsis]====" >> ${basic_tests_1}
${prog} --help 2>&1 | grep -c Synopsis >> ${basic_tests_1} 2>&1

echo "====[tsv-sample --help-verbose | grep -c Synopsis]====" >> ${basic_tests_1}
${prog} --help-verbose 2>&1 | grep -c Synopsis >> ${basic_tests_1} 2>&1

echo "====[tsv-sample --version | grep -c 'tsv-sample (eBay/tsv-utils)']====" >> ${basic_tests_1}
${prog} --version 2>&1 | grep -c 'tsv-sample (eBay/tsv-utils)' >> ${basic_tests_1} 2>&1

echo "====[tsv-sample -V | grep -c 'tsv-sample (eBay/tsv-utils)']====" >> ${basic_tests_1}
${prog} -V 2>&1 | grep -c 'tsv-sample (eBay/tsv-utils)' >> ${basic_tests_1} 2>&1

## Error cases

error_tests=${odir}/error_tests_1.txt

echo "Error test set 1" > ${error_tests}
echo "----------------" >> ${error_tests}

runtest ${prog} "no_such_file.tsv" ${error_tests}
runtest ${prog} "--no-such-param input3x25.tsv" ${error_tests}
runtest ${prog} "-d ß input3x25.tsv" ${error_tests}
runtest ${prog} "-H -w 11 input3x25.tsv" ${error_tests}
runtest ${prog} "-H -w 3 input3x25_dos.tsv" ${error_tests}
runtest ${prog} "-w 1 input2x5_noheader_dos.tsv" ${error_tests}
runtest ${prog} "--prob 0.5 --weight-field 3 input3x25.tsv" ${error_tests}
runtest ${prog} "--prob 0 input3x25.tsv" ${error_tests}
runtest ${prog} "--prob 1.00001 input3x25.tsv" ${error_tests}
runtest ${prog} "-p .1 -k 0 input4x50.tsv input4x15.tsv" ${error_tests}
runtest ${prog} "-p .1 -k -1 input4x50.tsv input4x15.tsv" ${error_tests}
runtest ${prog} "-p 0 -k 1 input4x50.tsv input4x15.tsv" ${error_tests}
runtest ${prog} "-p -0.5 -k 1 input4x50.tsv input4x15.tsv" ${error_tests}
runtest ${prog} "-p 0.5 -v -10 -k 1 input4x50.tsv input4x15.tsv" ${error_tests}
runtest ${prog} "-k 1 input4x50.tsv input4x15.tsv" ${error_tests}
runtest ${prog} "-p 0.5 -k 5 input4x50.tsv input4x15.tsv" ${error_tests}
runtest ${prog} "-H -p 0.5 -k 5 input4x50.tsv input4x15.tsv" ${error_tests}
runtest ${prog} "-H -p 0.5 --gen-random-inorder input4x50.tsv input4x15.tsv" ${error_tests}
runtest ${prog} "-H --gen-random-inorder -d , --random-value-header abc,def input3x25.tsv" ${error_tests}
runtest ${prog} "--replace -n 5 --weight-field 2 input3x25.tsv" ${error_tests}
runtest ${prog} "--replace -n 5 --prob 0.5 input3x25.tsv" ${error_tests}
runtest ${prog} "--replace -n 5 --key-fields 2 input3x25.tsv" ${error_tests}
runtest ${prog} "--replace -n 5 --print-random input3x25.tsv" ${error_tests}
runtest ${prog} "--replace -n 5 --gen-random-inorder input3x25.tsv" ${error_tests}

# Error tests 2 are tests that are compiler version dependent. There are multiple
# version files in test-config.json.

error_tests=${odir}/error_tests_2.txt

echo "Error test set 2" > ${error_tests}
echo "----------------" >> ${error_tests}

runtest ${prog} "-H -w 2 input3x25.tsv" ${error_tests}
runtest ${prog} "-w 3 input3x25.tsv" ${error_tests}
runtest ${prog} "-p -v 10 -k 1 input4x50.tsv input4x15.tsv" ${error_tests}


#!/bin/bash

npm run build
rm -rf webfundamentals
mkdir -p webfundamentals/src/content/en/fundamentals/web-components/examples
find docs -type d -name 'howto-*' | while read line; do cp -r $line/*.md webfundamentals/src/content/en/fundamentals/web-components/examples/; done
cp docs/styles/main.devsite.css webfundamentals/src/content/en/fundamentals/web-components/examples/main.css
cp -r docs/images webfundamentals/src/content/en/fundamentals/web-components/examples/


<filename>entrypoint.sh
#!/bin/bash -x

# Karaf needs a pseudo-TTY so exit and instruct user to allocate one when necessary
test -t 0
if [ $? -eq 1 ]; then
    echo "Please start the openHAB container with a pseudo-TTY using the -t option or 'tty: true' with docker compose"
    exit 1
fi

set -euo pipefail
IFS=$'\n\t'

# Install Java unlimited strength cryptography
if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -f "${JAVA_HOME}/jre/lib/security/README.txt" ]; then
  echo "Installing Zulu Cryptography Extension Kit (\"CEK\")..."
  wget -q -O /tmp/ZuluJCEPolicies.zip https://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip
  unzip -jo -d ${JAVA_HOME}/jre/lib/security /tmp/ZuluJCEPolicies.zip
  rm /tmp/ZuluJCEPolicies.zip
fi

# Deleting instance.properties to avoid karaf PID conflict on restart
# See: https://github.com/openhab/openhab-docker/issues/99
rm -f /openhab/runtime/instances/instance.properties

# The instance.properties file in OH2.x is installed in the tmp
# directory
rm -f /openhab/userdata/tmp/instances/instance.properties

# Add openhab user & handle possible device groups for different host systems
# Container base image puts dialout on group id 20, uucp on id 10
# GPIO Group for RPI access
NEW_USER_ID=${USER_ID:-9001}
NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID}
echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID"
if ! id -u openhab >/dev/null 2>&1; then
  echo "Create group openhab with id ${NEW_GROUP_ID}"
  groupadd -g $NEW_GROUP_ID openhab
  echo "Create user openhab with id ${NEW_USER_ID}"
  adduser -u $NEW_USER_ID --disabled-password --gecos '' --home ${APPDIR} --gid $NEW_GROUP_ID openhab
  groupadd -g 14 uucp2
  groupadd -g 16 dialout2
  groupadd -g 18 dialout3
  groupadd -g 32 uucp3
  groupadd -g 997 gpio
  adduser openhab dialout
  adduser openhab uucp
  adduser openhab uucp2
  adduser openhab dialout2
  adduser openhab dialout3
  adduser openhab uucp3
  adduser openhab gpio
fi

# Copy initial files to host volume
case ${OPENHAB_VERSION} in
  1.8.3)
      if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then
        # Copy userdata dir for version 1.8.3
        echo "No configuration found... initializing."
        cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/"
      fi
    ;;
  2.0.0|2.1.0|2.2.0|2.3.0-snapshot)
      # Initialize empty host volumes
      if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then
        # Copy userdata dir for version 2.0.0
        echo "No userdata found... initializing."
        cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/"
      fi

      # Upgrade userdata if versions do not match
      if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then
        echo "Image and userdata versions differ! Starting an upgrade."

        # Make a backup of userdata
        backupFile=userdata-$(date +"%FT%H:%M:%S").tar
        if [ ! -d "${APPDIR}/userdata/backup" ]; then
          mkdir "${APPDIR}/userdata/backup"
        fi
        tar --exclude="${APPDIR}/userdata/backup" -c -f "${APPDIR}/userdata/backup/${backupFile}" "${APPDIR}/userdata"
        echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}"

        # Copy over the updated files
        cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/"
        cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/"
        cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/"
        cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/"
        cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/"
        if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then
          cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/"
        fi
        cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/"
        cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/"
        cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/"
        cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/"
        if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then
          cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/"
        fi
        cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/"
        cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc"
        cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc"
        cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/"
        echo "Replaced files in userdata/etc with newer versions"

        # Clear the cache and tmp
        rm -rf "${APPDIR}/userdata/cache"
        rm -rf "${APPDIR}/userdata/tmp"
        mkdir "${APPDIR}/userdata/cache"
        mkdir "${APPDIR}/userdata/tmp"
        echo "Cleared the cache and tmp"
      fi

      if [ -z "$(ls -A "${APPDIR}/conf")" ]; then
        # Copy userdata dir for version 2.0.0
        echo "No configuration found... initializing."
        cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/"
      fi
    ;;
  *)
      echo openHAB version ${OPENHAB_VERSION} not supported!
    ;;
esac

# Set openhab folder permission
chown -R openhab:openhab ${APPDIR}

exec "$@"


#!/bin/bash
for championship in "England" "European_Championship" "France" "Germany" "Italy" "Spain" "World_Cup"
do
  printf "===========================================================\n"
  printf "Getting ids for championship $championship \n"
  printf "===========================================================\n"
  clj src/main/io/spit_match_ids.clj --championship=$championship
  printf "Done!\n"
done


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

VERSIONINFO="20171227.5"

function showUsage()
{
    echo "USAGE: $0 SOURCEFILE OUTPUTPATH"
    exit 1
}

if [ -z "$1" ]; then
    echo "MISSING required param 1!"
    showUsage
    exit 2
fi

SOURCEFILE=$1

if [ ! -z "$2" ]; then
    OUTPUTPATH=$2
else
    SOURCEBASENAME=$(basename $SOURCEFILE)
    OUTPUTPATH="/tmp/uncompressed/${SOURCEBASENAME}-contents"
fi
if [ ! -d "$OUTPUTPATH" ]; then
    echo "Creating $OUTPUTPATH"
    mkdir -p $OUTPUTPATH
fi

echo "SOURCE FILE: $SOURCEFILE"
echo "OUTPUT PATH: $OUTPUTPATH"

COMPRESSION_TYPE="UNKNOWN"
ZIPCHECK=$(echo "$SOURCEFILE" | grep ".zip")
if [ ! -z "$ZIPCHECK" ]; then
    COMPRESSION_TYPE="ZIP"
else
    TARGZCHECK=$(echo "$SOURCEFILE" | grep ".tar.gz")
    if [ ! -z "$TARGZCHECK" ]; then
        COMPRESSION_TYPE="TAR.GZ"
    else
        GZCHECK=$(echo "$SOURCEFILE" | grep ".gz")
        if [ ! -z "$GZCHECK" ]; then
            COMPRESSION_TYPE="GZ"
        fi
    fi
fi
echo "SOURCE FILE compression is $COMPRESSION_TYPE"

CMD="NO OPERATION"
case "$COMPRESSION_TYPE" in
    "ZIP" )
        CMD="sudo unzip $SOURCEFILE -d $OUTPUTPATH"
        ;;
    "TAR.GZ" )
        CMD="sudo tar -xvzf $SOURCEFILE -C $OUTPUTPATH"
        ;;
    "GZ" )
        CMD="sudo gzip -dkvf $SOURCEFILE"
        ;;
    "*" )
        echo "ERROR: Unrecognized compression for $SOURCEFILE"
        exit 2
        ;;
esac
echo "$CMD"
($CMD)
if [ $? -ne 0 ]; then
    echo "!!!!!!!!!!!!!!!!!!!!!"
    echo "DECOMPRESSION FAILED!"
    echo "!!!!!!!!!!!!!!!!!!!!!"
    exit 2
fi
echo "Finished uncompressing into $OUTPUTPATH"


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

echo "its working"
var1=$1
echo $var1
#assetfinder -subs-only $1 | tee -a /var/www/html/allsubs.txt


#!/bin/bash

OUTPUT_DIR="$(pwd)/dist"

mkdir -p $OUTPUT_DIR && \
    cd web-app && \
    echo "Installing web app dependencies, this might take a few minutes..." && \
    npm install && \
    echo "Building web app..." && \
    npm run build && \
    cp -R dist "$OUTPUT_DIR/static"
    exit 0


<reponame>mihai011/Docker-Django-Posgres-Celery-Rabbitmq

# simple backup full
sshpass -p$POSTGRES_PASSWORD pg_dump -h db -p 5432 -U postgres -F c -b -v -f backup app


# Download input files. Execute from the `download` directory.
for url in \
  'https://www.elsevier.com/__data/assets/excel_doc/0015/91122/Scopus_Source_List.xlsx' \
  'https://journalmetrics.scopus.com/downloads/metrics/CiteScore_Metrics_2011-2016_Download_21Jun2017.xlsx' \
  'https://raw.githubusercontent.com/dhimmel/delays/756ffebf309499a500ec1f83d68803c044ec8729/data/pubmed-journals.tsv';
do
  wget --timestamping --no-verbose $url
done


<filename>shell/fix.sh
#!/bin/sh -l

IS_DIRTY_CODE=1

codestyle fix --ansi

{ git add . && git commit -a -m "Update code-style 💻"; } || IS_DIRTY_CODE=0


#mkdir data
#mkdir data/taobao_data/
#unzip UserBehavior.csv.zip
#mv UserBehavior.csv ./data/taobao_data/
python preprocess/taobao_prepare.py
#mkdir dnn_save_path
#mkdir dnn_best_model


<reponame>sreimers/action-archlinux-mingw
#!/bin/bash
set -e

source /etc/profile

if [ "$1" = 'build' ]; then
    eval $BUILD_CMD
else
    exec "$@"
fi


#!/bin/bash
echo "Checking for Node.js installation..."
which node
if [ $? -eq 1 ];
then
	echo "Couldn't find a Node.js installation!"
	echo "Please follow the instruction in Readme.md"
else
	echo "Node.js installation found!"
	echo "Checking for YUIDoc installation..."
	which yuidoc
	if [ $? -eq 1 ];
	then
		echo "Couldn't find a YUIDoc installation!"
		echo "Please follow the instruction in Readme.md"
	else
		echo "YUIDoc installation found!"
		CURRENT=$PWD
		echo "Current :${CURRENT}"
		cd ../..
		yuidoc --themedir $CURRENT/template -o $CURRENT/docs app
		echo "Created the documentation on the current directory!"
	fi
fi


#! /bin/sh
# Script to generate SYSROOT_SUFFIX_SPEC equivalent to MULTILIB_OSDIRNAMES
# Arguments are MULTILIB_OSDIRNAMES, MULTILIB_OPTIONS and MULTILIB_MATCHES.

# Copyright (C) 2009 Free Software Foundation, Inc.

# This file is part of GCC.

# GCC is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3, or (at your option) any later
# version.

# GCC is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# for more details.

# You should have received a copy of the GNU General Public License
# along with GCC; see the file COPYING3.  If not see
# <http://www.gnu.org/licenses/>.

# This shell script produces a header file fragment that defines
# SYSROOT_SUFFIX_SPEC.  It assumes that the sysroots will have the same
# structure and names used by the multilibs.

# Invocation:
#   print-sysroot-suffix.sh \
#          MULTILIB_OSDIRNAMES \
#          MULTILIB_OPTIONS \
#          MULTILIB_MATCHES \
#      > t-sysroot-suffix.h

# The three options exactly correspond to the variables of the same
# names defined in the tmake_file fragments.

# Example:
#   sh ./gcc/config/print-sysroot-suffix.sh "a=A" "a b/c/d" ""
# =>
#   #undef SYSROOT_SUFFIX_SPEC
#   #define SYSROOT_SUFFIX_SPEC "" \
#   "%{a:" \
#     "%{b:A/b/;" \
#     "c:A/c/;" \
#     "d:A/d/;" \
#     ":A/};" \
#   ":}"

# The script uses temporary subscripts in order to permit a recursive
# algorithm without the use of functions.

set -e

dirnames="$1"
options="$2"
matches="$3"

cat > print-sysroot-suffix3.sh <<\EOF
#! /bin/sh
# Print all the multilib matches for this option
result="$1"
EOF
for x in $matches; do
  l=`echo $x | sed -e 's/=.*$//' -e 's/?/=/g'`
  r=`echo $x | sed -e 's/^.*=//' -e 's/?/=/g'`
  echo "[ \"\$1\" = \"$l\" ] && result=\"\$result|$r\"" >> print-sysroot-suffix3.sh
done
echo 'echo $result' >> print-sysroot-suffix3.sh
chmod +x print-sysroot-suffix3.sh

cat > print-sysroot-suffix2.sh <<\EOF
#! /bin/sh
# Recursive script to enumerate all multilib combinations, match against
# multilib directories and output a spec string of the result.
# Will fold identical trees.

padding="$1"
optstring="$2"
shift 2
n="\" \\
$padding\""
if [ $# = 0 ]; then
EOF

pat=
for x in $dirnames; do
  p=`echo $x | sed -e 's,=!,/$=/,'`
  pat="$pat -e 's=^//$p='"
done
echo '  optstring=`echo "/$optstring" | sed '"$pat\`" >> print-sysroot-suffix2.sh
cat >> print-sysroot-suffix2.sh <<\EOF
  case $optstring in
  //*)
    ;;
  *)
    echo "$optstring"
    ;;
  esac
else
  thisopt="$1"
  shift
  bit=
  lastcond=
  result=
  for x in `echo "$thisopt" | sed -e 's,/, ,g'`; do
    case $x in
EOF
for x in `echo "$options" | sed -e 's,/, ,g'`; do
  match=`./print-sysroot-suffix3.sh "$x"`
  echo "$x) optmatch=\"$match\" ;;" >> print-sysroot-suffix2.sh
done
cat >> print-sysroot-suffix2.sh <<\EOF
    esac
    bit=`"$0" "$padding  " "$optstring$x/" "$@"`
    if [ -z "$lastopt" ]; then
      lastopt="$optmatch"
    else
      if [ "$lastbit" = "$bit" ]; then
	lastopt="$lastopt|$optmatch"
      else
	result="$result$lastopt:$lastbit;$n"
	lastopt="$optmatch"
      fi
    fi
    lastbit="$bit"
  done
  bit=`"$0" "$padding  " "$optstring" "$@"`
  if [ "$bit" = "$lastbit" ]; then
    if [ -z "$result" ]; then
      echo "$bit"
    else
      echo "$n%{$result:$bit}"
    fi
  else
    echo "$n%{$result$lastopt:$lastbit;$n:$bit}"
  fi
fi
EOF

chmod +x ./print-sysroot-suffix2.sh
result=`./print-sysroot-suffix2.sh "" "/" $options`
echo "#undef SYSROOT_SUFFIX_SPEC"
echo "#define SYSROOT_SUFFIX_SPEC \"$result\""
rm print-sysroot-suffix2.sh
rm print-sysroot-suffix3.sh


<reponame>fronzbot/qucs-centos-install
export PATH=/usr/local/texlive/2019/bin/x86_64-linux:$PATH


<gh_stars>10-100
lstrip() {
	# Usage: lstrip "string" "pattern"
	printf '%s\n' "${1##$2}"
}


<reponame>scriptzteam/Tor-Browser-Build<gh_stars>0
#!/bin/sh

# Copyright (c) 2020, The Tor Project, Inc.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
#     * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
#     * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
#
#     * Neither the names of the copyright owners nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# Usage:
# 1) Let SIGNMAR point to your signmar binary
# 2) Let LD_LIBRARY_PATH point to the mar-tools directory
# 3) Let NSS_DB_DIR point to the directory containing the database with the
#    signing certificate to check against.
#
#    To create the database to use for signature checking import the
#    release*.der certificate of your choice found in
#    toolkit/mozapps/update/updater by issuing the following commands:
#
#    mkdir nssdb
#    certutil -d nssdb -N --empty-password
#    certutil -A -n "marsigner" -t,, -d nssdb -i /path/to/.der
#
# 4) Change into the directory containing the MAR files and the
#    sha256sums-unsigned-build.txt/sha256sums-unsigned-build.incrementals.txt.
# 5) Run /path/to/marsigning_check.sh

if [ -z "$SIGNMAR" ]
then
  echo "The path to your signmar binary is missing!"
  exit 1
fi

if [ -z "$LD_LIBRARY_PATH" ]
then
  echo "The library search path to your mar-tools directory is missing!"
  exit 1
fi

if [ -z "$NSS_DB_DIR" ]
then
  echo "The path to your nssdb directory is missing!"
  exit 1
fi

unsigned_mars=0
badsigned_mars=0
not_reproduced_mars=0
# XXX: Stripping the signature of signed macOS MAR files is currently not
# expected to be reproducible, see: #20254.
not_reproduced_mars_expected=0

mkdir tmp

for f in *.mar; do
  case $f in
    *.incremental.mar) sha256_txt=$(grep "$f" \
      sha256sums-unsigned-build.incrementals.txt);;
    *) sha256_txt=$(grep "$f" sha256sums-unsigned-build.txt);;
  esac

  # Test 1: Is the MAR file correctly signed?
  echo "Verifying the MAR signature of $f..."
  if ! $SIGNMAR -d "$NSS_DB_DIR" -n marsigner -v "$f"
  then
    # Something went wrong. Let's figure out what.
    if [ "$sha256_txt" = "$(sha256sum "$f")" ]
    then
      echo "$f has still the SHA-256 sum of the unsigned MAR file!"
      unsigned_mars=$((unsigned_mars + 1))
    else
      echo "$f is either signed with the wrong key or the signature is" \
           "corrupted!"
      badsigned_mars=$((badsigned_mars +1))
    fi
  fi

  # Test 2: Do we get the old SHA-256 sum after stripping the MAR signature? We
  # want to have a test for that to be sure we've the signed MAR files in front
  # of us which we actually want to ship to our users.
  if [ "$unsigned_mars" = "0" ] && [ "$badsigned_mars" = "0" ]
  then
    # At least we seem to have succeeded in signing the MAR file. Let's see if
    # it is the expected one.
    echo "Checking the SHA-256 sum of the stripped $f..."
    ${SIGNMAR} -r "$f" tmp/"$f"
    cd tmp || exit 1
    if ! [ "$sha256_txt" = "$(sha256sum "$f")" ]
    then
      not_reproduced_mars=$((not_reproduced_mars + 1))
      case "$f" in
        *osx64*)
          not_reproduced_mars_expected=$((not_reproduced_mars_expected + 1))
          ;;
        *) echo "$f does not have the SHA-256 sum of the unsigned MAR file!"
          ;;
      esac
    fi
    rm "$f"
    cd ..
  fi
  echo ""
done

rm -rf tmp/

if ! [ "$unsigned_mars" = "0" ] || ! [ "$badsigned_mars" = "0" ]
then
  echo "We got:"
  if ! [ "$unsigned_mars" = "0" ]
  then
    echo "$unsigned_mars unsigned MAR file(s)"
  fi
  if ! [ "$badsigned_mars" = "0" ]
  then
    echo "$badsigned_mars badly signed MAR file(s)"
  fi
  echo "exiting..."
  exit 1
fi

if ! [ "$not_reproduced_mars" = "0" ]
then
  echo "We got $not_reproduced_mars non-matching, signed MAR files."
  if [ "$not_reproduced_mars" -eq "$not_reproduced_mars_expected" ]
  then
    echo "This is currently expected as we got the same amount of" \
         "non-matching macOS MAR files."
    echo "The signatures and non-macOS MAR files are fine."
    exit 0
  else
    echo "This is currently unexpected as we only got" \
         "$not_reproduced_mars_expected non-matching macOS MAR files," \
         "exiting..."
    exit 1
  fi
else
  echo "The signatures and MAR files are fine."
  exit 0
fi


#!/bin/bash
#
#	Datenbank installieren und Konfigurieren
#

# root Password setzen, damit kein Dialog erscheint und die Installation haengt!
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password <PASSWORD>'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password <PASSWORD>'

# Installation
sudo apt-get install -y mysql-server

# MySQL Port oeffnen
sudo sed -i -e"s/^bind-address\s*=\s*127.0.0.1/bind-address = 0.0.0.0/" /etc/mysql/mysql.conf.d/mysqld.cnf

# User fuer Remote Zugriff einrichten - aber nur fuer Host web 192.168.55.101
mysql -uroot -pS3cr3tp4ssw0rd <<%EOF%
	CREATE USER 'root'@'192.168.55.101' IDENTIFIED BY 'admin';
	GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.55.101';
	FLUSH PRIVILEGES;
%EOF%

# Datenbank und User fuer IoT Daten anlegen
mysql -uroot -pS3cr3tp4ssw0rd <<%EOF%
	create database if not exists sensoren;
	create user 'www-data'@'localhost' identified by 'mbed';
	grant usage on *.* to 'www-data'@'192.168.55.101' identified by 'mbed';
	grant all privileges on sensoren.* to 'www-data'@'192.168.55.101';
	flush privileges;
	use sensoren;
	create table data ( seq INT PRIMARY KEY AUTO_INCREMENT, poti FLOAT, light FLOAT, hall FLOAT, temp FLOAT, created TIMESTAMP DEFAULT CURRENT_TIMESTAMP );
	insert into data(poti, light, hall, temp) values ( 0.9, 0.8, 0.49, 25.2 );
	insert into data(poti, light, hall, temp) values ( 0.8, 0.7, 0.48, 25.1 );
%EOF%

# Restart fuer Konfigurationsaenderung
sudo service mysql restart

# Monitoring
sudo cp /vagrant/cron.root.db01 /var/spool/cron/crontabs/root && sudo chmod 600 /var/spool/cron/crontabs/root
sudo service cron reload


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

cd /opt/infrastructure/ansible/niam/ &&\
ansible-galaxy install -r requirements.yml &&\
ansible-playbook site.yml --become-user=ubuntu --vault-password-file /keys/grits_vault_password --private-key /var/lib/jenkins/.ssh/id_rsa --tags niam &&\

#Upload new docker image to S3
sudo docker save niam > /tmp/niam.tar &&\
sudo gzip -1 /tmp/niam.tar &&\
sudo aws s3 cp /tmp/niam.tar.gz s3://bsve-integration/niam.tar.gz &&\
sudo rm /tmp/niam.tar* &&\

# Notify BSVE to redeploy
aws sns publish --topic-arn arn:aws:sns:us-east-1:789867670404:EHA-Git-Lambda --message '{"app":"niam"}' --profile bsve-user


echo off

if [[ -d ~/.dotfiles ]]; then
    echo ".dotfiles already exists, skipping setup"
    exit
fi

git clone --recurse-submodules git@github.com:zbigniew-malinowski/dotfiles.git ~/.dotfiles

if [[ -h ~/.zshrc ]] ; then
    echo "removing old link"
    rm ~/.zshrc
fi

if [[ -e ~/.zshrc ]] ; then
  echo "backing up old .files"
  mkdir ~/.dotfiles.old
  mv ~/.zshrc ~/.dotfiles.old/.zshrc
fi

echo "linking .files"
ln ~/.dotfiles/zshrc ~/.zshrc

if eval which zsh ; then
  if [[ $SHELL == *"zsh"* ]]; then
    echo "zsh installed and ready to go, "
    echo "please restart the terminal"
    exit
  fi
else
  echo "installing zsh"
  brew install zsh
fi

echo "setting zsh as the default shell"
sudo echo "$(which zsh)" >> /etc/shells
chsh -s $(which zsh)

echo "please restart the terminal"


#!/usr/bin/env bash

cc -o demo main.c $(pkg-config --cflags --libs glib-2.0)

# https://developer.gnome.org/glib/stable/glib-compiling.html


#!/bin/bash

set -e

if [[ "$1" == "clean" ]]; then
	echo "Clean build ..."
rm -rf ./out/ios_debug_sim_unopt
rm -rf ./out/ios_debug_unopt
rm -rf ./out/ios_release
rm -rf ./out/host_debug_unopt
rm -rf ./out/host_release
fi

if [[ "$1" == "clean" ]] || [[ ! -d ./out/ios_debug_sim_unopt ]]; then
./flutter/tools/gn --ios --simulator --unoptimized
fi

ninja -C out/ios_debug_sim_unopt

date

if [[ "$1" == "clean" ]] || [[ ! -d ./out/ios_debug_unopt ]]; then
./flutter/tools/gn --ios --unoptimized --no-goma --bitcode
fi

ninja -C out/ios_debug_unopt

date

if [[ "$1" == "clean" ]] || [[ ! -d ./out/ios_release ]]; then
./flutter/tools/gn --ios --runtime-mode=release --no-goma --bitcode
fi

ninja -C out/ios_release

date

if [[ "$1" == "clean" ]] || [[ ! -d ./out/host_debug_unopt ]]; then
./flutter/tools/gn --unoptimized
fi
ninja -C out/host_debug_unopt

date

if [[ "$1" == "clean" ]] || [[ ! -d ./out/host_release ]]; then
./flutter/tools/gn --no-lto --runtime-mode=release
fi
ninja -C out/host_release


<reponame>Logimethods/smart-meter<filename>stop.sh
docker service rm $(docker service ls -q)
docker stop $(docker ps | grep -v aws | cut -d ' ' -f 1)
docker rm $(docker ps -a -q)
#https://gist.github.com/brianclements/f72b2de8e307c7b56689
docker rmi $(docker images | grep "<none>" | awk '{print $3}') 2>/dev/null || echo "No untagged images to delete."
#docker volume prune
docker volume rm $(docker volume ls -q | grep -v grafana-volume)
# | grep -v cassandra-volume


#!/bin/sh
#
# Usage: repodetect.sh <Version> <yum_server>
#
# Version: Mandatory
# Yum_server:
# - Blank or 'Local' -> use a local file source
# - Anything else    -> use this is the URI at which to point.

unknown="REPODETECT_UNKNOWN_OS_TYPE"
type=$unknown

version=$1
yum_server=$2

if [ -z $version ]; then
  echo "Error: You must pass <version> as the first argument";
  exit 1;
fi

arch="i386"
if [ `uname -m` == "x86_64" ]; then arch="x86_64"; fi

grep -q 'Red Hat' /etc/redhat-release
if [ $? == 0 ]; then
  type="RedHat"
else
  grep -q 'CentOS' /etc/redhat-release
  if [ $? == 0 ]; then type="CentOS"; fi
fi

if [ "$type" == "$unknown" ]; then
  grep -q "url is.*RedHat" /tmp/anaconda.log
  if [ $? == 0 ];
    then type="RedHat"
  else
    grep -q "url is.*CentOS" /tmp/anaconda.log
    if [ $? == 0 ]; then type="CentOS"; fi
  fi
fi

if [ -z $yum_server ] || [ $yum_server == 'local' ]; then
  uri_header="file:///mnt/install/repo"
  local_header="$uri_header/SIMP/$arch"
else
  uri_header="https://$yum_server/yum/$type/$version/$arch";
  local_header="https://$yum_server/yum/SIMP/$arch";
fi

if [ "$type" == 'RedHat' ]; then
  cat << EOF > /tmp/repo-include
repo --name="HighAvailability" --baseurl="$uri_header/addons/HighAvailability"
repo --name="ResilientStorage" --baseurl="$uri_header/addons/ResilientStorage"
repo --name="Base" --baseurl="$uri_header"
repo --name="Local" --baseurl="$local_header"
EOF
elif [ "$type" == 'CentOS' ]; then
  cat << EOF > /tmp/repo-include
repo --name="Server" --baseurl="$uri_header"
repo --name="Local" --baseurl="$local_header"
EOF
fi


<reponame>imcotton/tabs-reloader
#!/bin/sh

source=../source

version=$(cat $source/manifest.json | grep \"version\": | awk '{print $2}' | sed 's/"//g')
name="tabs_reloader-v$version.zip"

coffee -c $source

zip -j $name $source/*