echo "Configuring packages..."
sudo apt-get update -qq && sudo apt-get upgrade -qq
sudo apt-get install -qq build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev pkg-config liblzma-dev

echo "Downloading Python $1$2..."
cd /tmp
wget -q https://www.python.org/ftp/python/$1/Python-$1$2.tgz
tar -xf Python-$1$2.tgz

echo "Building Python $1$2..."
cd Python-$1$2
./configure -q --enable-optimizations --with-ensurepip=install
make -s -j $(nproc)

echo "Installing Python $1$2..."
sudo make -s altinstall

echo "All done!"


#!/bin/sh
set -e

PYTHON_VERSION=$(python -c 'import sys; print(sys.version_info.major)')
pip install -Iv black==21.5b2

python -m black --check datadog_lambda/ --diff
python -m black --check tests --diff


<reponame>headmin/CIS-Script
#!/bin/zsh

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

source ${projectfolder}/Header.sh

CISLevel="1"
audit="2.1.2 Ensure Show Bluetooth Status in Menu Bar Is Enabled (Automated)"
orgScore="OrgScore2_1_2"
emptyVariables
# Verify organizational score
runAudit
# If organizational score is 1 or true, check status of client
if [[ "${auditResult}" == "1" ]]; then
	method="Script"
	remediate="Script > sudo -u firstuser defaults -currentHost write com.apple.controlcenter.plist Bluetooth -int 18"

	appidentifier="com.apple.controlcenter"
	value="NSStatusItem Visible Bluetooth"
	# function check2_1_2 {
	prefValueAsUser=$(getPrefValuerunAsUser "${appidentifier}" "${value}")
	prefIsManaged=$(getPrefIsManaged "${appidentifier}" "${value}")

	comment="Show Bluetooth status in menu bar: Enabled"
	if [[ "${prefIsManaged}" == "true" && "${prefValueAsUser}" == "true" ]]; then
		countPassed=$((countPassed + 1))
		result="Passed"
	else
		if [[ "${prefValueAsUser}" == "true" ]]; then
			result="Passed"
		else
			result="Failed"
			comment="Enable Show Bluetooth status in menu bar"
			# Remediation
			if [[ "${remediateResult}" == "enabled" ]]; then
				su -l ${currentUser} -c "defaults -currentHost write com.apple.controlcenter.plist Bluetooth -int 18"
				killall ControlCenter
				# re-check
				sleep 1
				prefValueAsUser=$(getPrefValuerunAsUser "${appidentifier}" "${value}")
				prefIsManaged=$(getPrefIsManaged "${appidentifier}" "${value}")
				if [[ "${prefValueAsUser}" == "true" ]]; then
					result="Passed After Remediation"
					comment="Show Bluetooth status in menu bar: Enabled"
				else
					result="Failed After Remediation"
				fi
			fi
		fi
	fi
fi
printReport


#
#!/bin/bash
#Script cipta akaun SSH/VPN
#Sunan | Explore Network Unlimited
#

read -p " Username : " userName
read -p " Password : " passWord
read -p " Expired [Days]: " expDate

IP=`dig +short myip.opendns.com @resolver1.opendns.com`
useradd -e `date -d "$expDate days" +"%Y-%m-%d"` -s /bin/false -M $User
passWord="$(chage -l $userName | grep "Account expires" | awk -F": " '{print $2}')"
echo -e "$passWord\<PASSWORD>"|passwd $userName &> /dev/null

echo "==============================================="
echo "Register | Buat Akaun Pelanggan"
echo "==============================================="
echo -e " IP Address: $IP"
echo -e " Port OpenSSH: 22, 2020"
echo -e " Port Dropbear: 443, 4343"
echo -e " Squid: 8080, 3128"
echo -e " Config OpenVPN: http://$IP/client.ovpn"
echo -e " Username: $userName"
echo -e " Password: <PASSWORD>"
echo -e " Expired Days: $expDate"
echo "==============================================="
echo "Sunan | Explore Network Unlimited"
echo "==============================================="
echo ""


#!/bin/sh

ping -i 0.5 $1 | \
    while read pong; do
        echo "$(date +%Y-%m-%d\ %H:%M:%S.%03N) pinger DEBUG $pong";
    done


<filename>tools/with_venv.sh
#!/bin/bash
TOOLS_PATH=${TOOLS_PATH:-$(dirname $0)}
VENV_PATH=${VENV_PATH:-${TOOLS_PATH}}
VENV_DIR=${VENV_NAME:-/../.venv}
TOOLS=${TOOLS_PATH}
VENV=${VENV:-${VENV_PATH}/${VENV_DIR}}
HORIZON_DIR=${TOOLS%/tools}

# This horrible mangling of the PYTHONPATH is required to get the
# babel-angular-gettext extractor to work. To fix this the extractor needs to
# be packaged on pypi and added to global requirements. That work is in progress.
export PYTHONPATH="$HORIZON_DIR"
source ${VENV}/bin/activate && "$@"


#!/bin/bash
#
# run python script screencapture
#
export captureLocation=~/studio_capture/cam/
script_location=$(dirname $0)

# python $script_location/webcam.py

~/studio_x_toolsfiles/ffmpeg/ffmpeg -f avfoundation -list_devices true -i ""


echo "Deleting /cache"
rm -rfv cache

echo "Deleting packages/api-client/node_modules"
rm -rfv packages/api-client/node_modules

echo "Deleting packages/api-client/ files cache, lib and server"
rm -rfv packages/api-client/cache
rm -rfv packages/api-client/lib
rm -rfv packages/api-client/server

echo "Deleting packages/api-client/node_modules"
rm -rfv packages/composables/node_modules

echo "Deleting packages/composables/ files cache and lib"
rm -rfv packages/composables/cache
rm -rfv packages/composables/lib

echo "Deleting packages/theme/node_modules"
rm -rfv packages/theme/node_modules

echo "Deleting packages/theme/ files .nuxt, _theme"
rm -rfv packages/theme/.nuxt
rm -rfv packages/theme/_theme

echo "Deleting yarn.lock from project"
rm -rfv yarn.lock

echo "Deleting yarn.lock"
rm -rfv node_modules


#!/usr/bin/env bash

# Check if node_modules exist
# If exists; run file
# Else, install dependencies then run
if [ -d "node_modules" ]; then
    node index
else
    echo "Installing Dependencies.."
    npm install

    echo "Starting.."
    node index
fi


<filename>scripts/nvidia_unlock_overclock.sh<gh_stars>1-10
#!/bin/bash

# Config
WELCOME_MESSAGE="${CYAN}Welcome to the Nvidia overclock unlocker${RESET}"

# Colors
RESET='\033[0m'
BLACK='\033[0;30m'
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
CYAN='\033[0;36m'

if [[ $EUID > 0 ]]; then
    echo -e $WELCOME_MESSAGE
    echo -e "${RED}Permission denied, please run this script in root/sudo${RESET}"
    exit 1
fi

echo -e $WELCOME_MESSAGE
echo -e "${YELLOW}Running this script in root/sudo"

echo -e "\nUnlocking"
nvidia-xconfig -a --cool-bits=28 --allow-empty-initial-configuration

echo -e "${GREEN}\nUnlock complete, restarting in 5 seconds (manual reboot if required)"

sleep 5
reboot


<reponame>gilzoide/csfml-luajit
#!/bin/sh

clang_headers='-I /usr/lib/clang/*/include'
generate_module() {
  module=$1
  patterns=$2
  # sed is used here to patch sfBool function return values directly with booleans on LuaJIT
  inclua headers/$module.h $patterns -m csfml-$module -n sf -g -- $clang_headers | sed 's/^sfBool/bool/gm' > csfml-$module.lua
}

generate_module audio '-p SFML/Audio'
generate_module graphics '-p SFML/Graphics'
generate_module network '-p SFML/Network'
generate_module system '-p SFML/System -p SFML/Config'
generate_module window '-p SFML/Window'


<gh_stars>0
#!/bin/bash
CONSUL=$1
if [ -z $CONSUL ]; then
  CONSUL=consul.service.sjc-dev.consul:8500
fi

socat tcp-listen:8500,reuseaddr,fork tcp:$CONSUL


#!/bin/sh
#
# LaunchBar Action Script
#

osascript "${HOME}/Library/Application Support/LaunchBar/Actions/shared/MusicLikeOrDislike.scpt" like


npm run semantic-release
if [ $? = "0" ]; then
  echo PRESET_UPDATE
  curl "https://preset-updater.herokuapp.com/?repo=preset-basic&repoURL=https://github.com/GrimoireGL/grimoirejs-preset-basic.git&buildNumber=$CIRCLE_BUILD_NUM&currentPkg=grimoirejs-math"
fi
exit 0


#!/bin/sh
export RTE_SDK=`realpath /proj/uic-dcs-PG0/fshahi52/new/post-loom/code/dpdk`
echo RTE_SDK: $RTE_SDK

cur=`pwd`

if [ ! -d $RTE_SDK/x86_64-native-linuxapp-gcc ]; then
  echo "Building DPDK ..."
  cd $RTE_SDK
  make config T=x86_64-native-linuxapp-gcc
  make -j 10 install T=x86_64-native-linuxapp-gcc
fi

cd $cur

if [ -d build/ ]; then
  rm -r build/
fi

make


<reponame>nbro/ands
#!/usr/bin/env bash

export ALREADY_SOURCED_ASSERTS

if [ -z "${ALREADY_SOURCED_ASSERTS}" ]
then
    # Asserts the dependencies whose names are passed as parameters are
    # installed in the system.
    assert_installed()
    {

        # Check if the user wants to exit or return from this function.
        EXIT_IF_NOT_INSTALLED=1 # false

        if [ "$#" -ge  "1" ]
        then
            # In the case the first parameter is "contaminated", we just use the
            # default value.
            if [ "$1" = "0" ]
            then
                EXIT_IF_NOT_INSTALLED=0 # true
            fi
        fi

        # Iterate through the arguments starting from the second,
        # since the first represents the intent of the caller
        # to decide if to exit or return from this function.
        for (( arg = 2; arg <= $#; arg++ ))
        do
            command -v ${!arg}
            if [ $? != 0 ]
            then
                printf "%s'${!arg}' not installed. Install it first before
                proceeding. Exiting...%s\n" "${RED}" "${NORMAL}"
                if [ "$EXIT_IF_NOT_INSTALLED" = "0" ]
                then
                    exit 1
                else
                    return 1
                fi
            fi
        done

        if [ "$EXIT_IF_NOT_INSTALLED" = "1" ]
        then
            return 0
        fi
    }

    assert_python_module_installed()
    {
        if [ "$#" -ne  "1" ]
        then
            printf "%sCall this function with only one parameter, which
            represents the python module.%s\n" "${RED}" "${NORMAL}"
            return 1
        fi

        command -v "$1"

        if [ $? != 0 ]
        then
            printf "%sCommand '$1' not found.\n" "${RED}"
            printf "Do you want me to install '$1' using 'pip3.5' (y/n)?%s " "${NORMAL}"
            read -r ANSWER

            if echo "$ANSWER" | grep -iq "^y"
            then
                pip3.5 install "$1"
                printf "%sDone.%s\n" "${GREEN}" "${NORMAL}"
            else
                printf "%sCannot proceed. Exiting...%s\n" "${RED}" "${NORMAL}"
                exit 1
            fi

        fi
    }

    . ./_source_script.sh
    _source_script scripts colors

    ALREADY_SOURCED_ASSERTS="true"
fi


pkg_name=kubernetes
pkg_origin=core
pkg_description="Production-Grade Container Scheduling and Management"
pkg_upstream_url=https://github.com/kubernetes/kubernetes
pkg_license=('Apache-2.0')
pkg_maintainer="The Habitat Maintainers <<EMAIL>>"
pkg_version=1.8.3
pkg_source=https://github.com/kubernetes/kubernetes/archive/v${pkg_version}.tar.gz
pkg_shasum=8ab7e41126dfc3bc1a23ff76efc20e5131320530dc1277e5c2ed8c9618041b95

pkg_bin_dirs=(bin)

pkg_build_deps=(
  lilian/git
  lilian/make
  lilian/gcc
  lilian/go
  lilian/diffutils
  lilian/patch
  lilian/which
  lilian/rsync
)

pkg_deps=(
  core/glibc
)

do_prepare() {
  patch hack/lib/golang.sh "${PLAN_CONTEXT}/golang_detection.patch"
}

do_build() {
  make
  return $?
}

do_install() {
  cp _output/bin/* "${pkg_prefix}/bin"
  return $?
}


<filename>build.sh<gh_stars>0
docker build -t jterry/neo4j .


<filename>7zip_install.sh
wget http://jaist.dl.sourceforge.net/project/p7zip/p7zip/16.02/p7zip_16.02_src_all.tar.bz2
tar -jxvf p7zip_16.02_src_all.tar.bz2
cd p7zip_16.02
make && make install


./copy-common-files.py --dst-dir=build

./build-slides.py --outdir=build \
    --title="Tangible Landscape @ TEI 2016" \
    --meta-description="Embodied Cognition with Tangible Landscape" \
    --meta-author="<NAME>" \
    --outfile=index.html \
    index.html


<reponame>tjone270/Quake-Live
#! /bin/bash
# quakeinstall-qlserver.sh - quake live dedicated server installation for qlserver user.
# intended to be run on a fresh VPS/Dedicated Server, this script must be run under the qlserver user.
# created by <NAME> on 29/09/15.

if [ "$(whoami)" -ne "qlserver" ]
  then echo "Please run under user 'qlserver'."
  exit
fi
clear
echo "Installing SteamCMD..."
mkdir ~/steamcmd; cd ~/steamcmd; wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz; tar -xvzf steamcmd_linux.tar.gz; rm steamcmd_linux.tar.gz
clear
echo "Installing Quake Live Dedicated Server..."
./steamcmd.sh +login anonymous +force_install_dir /home/qlserver/steamcmd/steamapps/common/qlds/ +app_update 349090 +quit
clear
echo "Cronning 'QuakeUpdate.sh'..."
echo "0 8 * * * /home/qlserver/quakeupdate.sh" > cron; crontab cron; rm cron
clear
echo "Done."
exit


<reponame>MaayanLab/BioToolStory<gh_stars>0
#!/bin/bash

# download model
python3 -m spacy download en_core_web_sm
sudo python3 -m spacy download en

# set dates to collect tools (articles) from Pubmed
export start='2000/01/01'
export end='2020/01/01'

python3 common_fund.py $start $end
python3 extract_tools.py $start $end
# classify tools BERT
python3 tool_analysis.py $start $end
# clean text, collect data from Altmetric, collect number of citations from pubmed
python3 get_data.py $start $end
# convert tools to vectors
python3 text2vec.py $start $end
#upload tools to the signature-common DB
python3 pushtools_cf.py


<gh_stars>0
#!/bin/bash
# yum.sh - Made for Puppi

# Sources common header for Puppi scripts
. $(dirname $0)/header || exit 10

# Show help
showhelp () {
    echo "This script performs the yum operations required by puppi::project::yum"
    echo "It integrates and uses variables provided by other core Puppi scripts"
    echo "It has the following options:"
    echo "-a <action> (Optional) What action to perform. Available options: deploy (default), rollback, remove"
    echo "-n <rpm_name> (Required) Name of the package to handle"
    echo "-v <rpm_version> (Optional) The version of the rpm to manage. Default: latest"
    echo "-r <install_root> (Optional) The Instll root path. Default: /"
    echo
    echo "Examples:"
    echo "yum.sh -a deploy -n ${rpm} -r ${install_root} -v ${rpm_version}"
}

rpm_version="latest"
install_root="/"

# Check Arguments
while [ $# -gt 0 ]; do
  case "$1" in
    -a)
      case $2 in
          rollback)
          action="rollback"
          ;;
          remove)
          action="remove"
          ;;
          *)
          action="install"
          ;;
      esac
      shift 2 ;;
    -n)
      rpm_name=$2
      shift 2 ;;
    -v)
      rpm_version=$2
      shift 2 ;;
    -r)
      install_root=$2
      shift 2 ;;
    *)
      showhelp
      exit ;;
  esac
done

do_install () {
    if [ x$rpm_version == "xlatest" ] ; then
        full_rpm_name=$rpm_name
    else
        full_rpm_name=$rpm_name-$rpm_version
    fi

    # Archives version of the rpm to update
    oldversion=$(rpm -q $rpm_name --qf  "%{VERSION}-%{RELEASE}\n")
    if [ "$?" = "0" ]; then
        mkdir -p $archivedir/$project/$oldversion
        if [ $archivedir/$project/latest ] ; then
            rm -f $archivedir/$project/latest
        fi
        ln -sf $archivedir/$project/$oldversion $archivedir/$project/latest
    fi

    if [ x$install_root != "x/" ] ; then
        yum install -y -q --installroot=$install_root $full_rpm_name
    else
        yum install -y -q $full_rpm_name
    fi
}

do_rollback () {
    yum downgrade -y -q $rpm_name-$rollbackversion
}

do_remove () {
    yum remove -y -q $rpm_name
}

# Action!
case "$action" in
    install) do_install ;;
    rollback) do_rollback ;;
    remove) do_remove ;;
esac


wait-for "${DATABASE_HOST}:${DATABASE_PORT}" -- "$@"

CompileDaemon --build="go build -o main main.go" --command=./main


#!/bin/bash
ps axf | grep /home/samuel/telegram_bots/.venv/bin/python | grep -v grep | awk '{print "kill -9 " $1}' | sh
nohup poetry run python run_bots.py &


<filename>scripts/convert_gold_tbf.bash
#!/usr/bin/env bash
# -*- coding:utf-8 -*-
# Created by Roger on 2019/9/25

KBP_DATA=~/Data/kbp_data
TBF_DATA=data/tbf_data

java -jar tools/EvmEval/bin/rich_ere_to_tbf_converter.jar \
  -a ${KBP_DATA}/LDC2017E55_TAC_KBP_2017_Eval_Core_Set_Rich_ERE_Annotation_with_Augmented_Event_Arguments/data/eng/nw/ere/ \
  --ae rich_ere.xml \
  -t ${KBP_DATA}/LDC2017E55_TAC_KBP_2017_Eval_Core_Set_Rich_ERE_Annotation_with_Augmented_Event_Arguments/data/eng/nw/source/ \
  --te xml \
  -o ${TBF_DATA}/LDC2017E55.nw.tbf

java -jar tools/EvmEval/bin/rich_ere_to_tbf_converter.jar \
  -a ${KBP_DATA}/LDC2017E55_TAC_KBP_2017_Eval_Core_Set_Rich_ERE_Annotation_with_Augmented_Event_Arguments/data/eng/df/ere/ \
  --ae rich_ere.xml \
  -t ${KBP_DATA}/LDC2017E55_TAC_KBP_2017_Eval_Core_Set_Rich_ERE_Annotation_with_Augmented_Event_Arguments/data/eng/df/source/ \
  --te xml \
  -o ${TBF_DATA}/LDC2017E55.df.tbf

cat ${TBF_DATA}/LDC2017E55.nw.tbf ${TBF_DATA}/LDC2017E55.df.tbf > ${TBF_DATA}/LDC2017E55.tbf


#!/usr/bin/env bash
bootstrap_s3_location="$1"
s3_mounts="$2"
rstudio_user="$3"

INSTALL_DIR="/usr/local/share/workspace-environment"

# Download instance files and execute bootstrap script
sudo mkdir "$INSTALL_DIR"
sudo aws s3 sync "$bootstrap_s3_location" "$INSTALL_DIR"

bootstrap_script="$INSTALL_DIR/bootstrap.sh"
if [ -s "$bootstrap_script" ]
then
    sudo chmod 500 "$bootstrap_script"
    sudo "$bootstrap_script" "$s3_mounts" "$rstudio_user"
fi

exit 0


<gh_stars>0
#!/bin/bash

file="../results/192.168.92.137.json"
output_file="/tmp/test1"

readarray -t my_array < <(jq -c '.[]' $file)

let num=0
rm /tmp/test1 > /dev/null 2>&1

for i in "${my_array[@]}"; do
    let num2=0
    jq -r ".[$num].RESULTS_EXPLOIT[]" $file | sed 's/[^{]//g' | awk '{ print length }' | sed '/^0/d' > /tmp/lorem
    index_num=$(wc -l /tmp/lorem | awk '{print $1}' )

    echo -e "\e[1;31mSearch Query:\e[0m" $(jq -r ".[$num].SEARCH" $file) >> $output_file

    echo "════════════════════════════════════════" >> $output_file
    echo -e "Version     Exploit"  >> $output_file

    until [[ $num2 == $index_num ]]; do
        sto=$(jq -r ".[$num].RESULTS_EXPLOIT[$num2].Title" $file)
        ned=$(jq -r ".[$num].RESULTS_EXPLOIT[$num2].Path" $file)
        echo "$sto" "$ned"  >> $output_file
        #printf "$res" '%s\n' "$ned" >> $output_file
        #paste <(printf %s "$sto") <(printf %s "$ned") >> $output_file

        num2=$(($num2+1))
    done
    echo \ >> $output_file
    num=$(($num+1))
done

# TODO
# 1. sed remove 1st /n and replace with " "
# 2. add search_query to test1
# 3. maybe more sed
# 4. actually format json to look nice


<reponame>Jabed-Akhtar/ROS2-foxy-Tutorials
# generated from colcon_core/shell/template/hook_prepend_value.sh.em

_colcon_prepend_unique_value PYTHONPATH "/home/samir/Samir/Projects_Others/ros2_ws/ros2_foxy_tutorial_ws/ros2_example_ws/build/examples_rclpy_minimal_action_server"


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

#PBS -N mfpca_t2d_new
#PBS -l walltime=50:00:00
#PBS -l nodes=1:ppn=4
#PBS -l pmem=10gb
#PBS -V
#PBS -j oe
#PBS -d .
#PBS -t 1
#PBS -o ../messages_outputs/
#PBS -e ../messages_errors/

set -e
cpus=$PBS_NUM_PPN

export TMPDIR=/panfs/panfs1.ucsd.edu/panscratch/$USER/Oct_2020_mfpca
[ ! -d $TMPDIR ] && mkdir $TMPDIR
export TMPDIR=$TMPDIR/applications/HMP_t2d

# do something
module load R_3.5.3-9.3.0 binutils_2.30

# t: number of candidate models (e.g. 1-7%10)
# fit MFPCA all on candidate models
#Rscript 1_mfpca_t2d_microb_protein_cytok_model_selection.R $TMPDIR
#Rscript 2_1_mfpca_t2d_A1c_PDGFBB_IGHA2_ratio_v2.R $TMPDIR

# t: total number of candidate models (e.g. 7)
# compare LOOIC on all models
# Rscript 1_2_mfpca_t2d_model_optimal.R $TMPDIR
#Rscript 2_2_mfpca_t2d_model_optimal_v2.R $TMPDIR

# t: optimal model index (e.g. 1)
# model diagnostics + results visualization on optimal model
#Rscript 1_3_mfpca_t2d_model_results.R $TMPDIR

# compare computational time
#Rscript 3_1_computation_time_mod3.R $TMPDIR
#Rscript 3_2_computation_time_mod5.R $TMPDIR
Rscript 3_3_computation_time_mod7.R $TMPDIR


#!/bin/sh
cd /home/linaro/demo
#./script/test_camera_1024.sh
./script/test_camera_1920.sh
#./script/test_camera_3840.sh
#./script/test_camera_4032.sh


<gh_stars>0
#!/bin/bash

code -v

if [ $? -eq 0 ]; then
  echo "VSCode already installed!"
else
  echo "Installing VSCode"
  curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
  sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
  sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
  sudo apt-get update
  sudo apt-get install code # or code-insiders

  export EDITOR='code -nw'
fi


<filename>ch7/8-4-grub-intro.sh<gh_stars>1-10
#!/bin/bash

grub-mkrescue --output=grub-img.iso
xorriso -as cdrecord -v dev=/dev/cdrw blank=as_needed grub-img.iso


<reponame>bliky/shell
# banner
echo -e "\n====================================\n"
echo -e "\n* python安装 *\n"
echo -e "- OS: CentOS 7.4 64bit\n"
echo -e "\n====================================\n"

# yum安装依赖包
echo -e "\n-- 1) yum安装依赖包:\n"
yum install -y openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel
echo -e "\n------------------------------------\n"

# wget下载源码
echo -e "\n-- 2) wget下载源码:\n"
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz
echo -e "\n------------------------------------\n"

# 解压源码并进入源码目录
echo -e "\n-- 3) 解压源码并进入源码目录:\n"
tar -zxvf Python-3.7.0.tgz
cd Python-3.7.0
echo -e "\n------------------------------------\n"

# make
echo -e "\n-- 4) make && make install:\n"
./configure
make && make install
echo -e "\n------------------------------------\n"

# 添加软连
echo -e "\n-- 5) make && make install:\n"
ln -s /usr/local/bin/python3.7 /usr/bin/python3
echo -e "\n------------------------------------\n"

# 验证
echo -e "\n-- 6) python3 -V:\n"
python3 -V
echo -e "\n------------------------------------\n"


<gh_stars>10-100
#!/bin/sh -f
# How to test: ovs-vsctl -V

#Remove old version ovs
aptitude remove openvswitch-common openvswitch-datapath-dkms openvswitch-controller openvswitch-pki openvswitch-switch -y

#Install new version ovs
wget http://openvswitch.org/releases/openvswitch-2.3.0.tar.gz
tar zxvf openvswitch-2.3.0.tar.gz
cd openvswitch-2.3.0
./configure --prefix=/usr --with-linux=/lib/modules/`uname -r`/build
make
make install
make modules_install
rmmod openvswitch
depmod -a

# Say goodbye to openvswitch-controller
/etc/init.d/openvswitch-controller stop
update-rc.d openvswitch-controller disable

#Start new version ovs
/etc/init.d/openvswitch-switch start
ovsdb-tool create /usr/local/etc/openvswitch/conf.db /usr/local/share/openvswitch/vswitch.ovsschema
ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock --remote=db:Open_vSwitch,Open_vSwitch,manager_options --pidfile --detach --log-file
ovs-vsctl --no-wait init
ovs-vswitchd --pidfile --detach


<reponame>mediaexplorer74/dosbox-x
#!/bin/bash
#
# Setup:
#   git clone https://github.com/joncampbell123/dosbox-x dosbox-x-mingw
#
# Then run this script

# Check 1: Make sure this is the MinGW32 environment.
#
#          MinGW and MinGW32 will have MSYSTEM=MINGW32
#          MinGW64 will have MSYSTEM=MINGW64.
if [[ "$MSYSTEM" == "MINGW32" ]]; then
    cputype=win32
elif [[ "$MSYSTEM" == "MINGW64" ]]; then
    cputype=win64
else
    echo "MinGW32/MINGW64 (not MinGW) shell environment required"
    exit 1
fi

name=`date +%F-%T | sed -e 's/:/-/g' | sed -e 's/-//g'`
name="dosbox-x-mingw-$cputype-$name.zip"

echo "Will pack to $name"
sleep 1

# OK GO

top=`pwd`
cd "$top" || exit 1

build="$top/mingw-build"
rm -Rf "$build"
mkdir -p "$build" || exit 1

ziptool="$top/dosbox-x-mingw/vs2015/tool/zip.exe"

# do it
for what in mingw mingw-lowend mingw-sdl2 mingw-sdldraw; do
buildtarget="$build/$what"
mkdir -p "$buildtarget" || exit 1
cd "$top/dosbox-x-mingw" || exit 1
git clean -dfx
git reset --hard
git checkout master
git clean -dfx
git reset --hard
git pull
git clean -dfx
git reset --hard
./build-$what || exit 1
strip src/dosbox-x.exe || exit 1
cp src/dosbox-x.exe "$buildtarget/dosbox-x.exe" || exit 1
cp CHANGELOG "$buildtarget/CHANGELOG.txt" || exit 1
cp dosbox-x.reference.conf "$buildtarget/dosbox-x.reference.conf" || exit 1
cp dosbox-x.reference.full.conf "$buildtarget/dosbox-x.reference.full.conf" || exit 1
done

cd "$top" || exit 1
echo "Packing up now..."

$ziptool -r -9 "$name" "mingw-build" || exit 1

exit 0


# My Dataset implementation is not prepared to be used with no labels, as in the final test.
# As a workaround, I created .txt files with empty predictions for all fields.
predictions_basedir=/home/marcospiau/final_project_ia376j/data/sroie_receipt_dataset/predictions
for i in 50 51 52 53
do
    python3 save_experiment_predictions_t5_ocr_baseline.py \
        --neptune_experiment_id="FIN-$i" \
        --input_path="/home/marcospiau/final_project_ia376j/data/sroie_receipt_dataset/final_competition_test/" \
        --output_path="$predictions_basedir/FIN-$i/"
done


<reponame>MarvDan/wiki-tutorials<filename>scripts/copyPomFiles.sh<gh_stars>0
BASEDIR=$(dirname "$0")
cd $BASEDIR/../tutorials
scriptdir="../scripts";

#Copy pom and index.asciidoc to tutorials folder
cp $scriptdir/pom.xml "pom.xml";
cp $scriptdir/index.asciidoc "index.asciidoc";

for d in */; do
    dirname=$(echo "$d" | sed "s#/##");
    if [ 'target' != $dirname ]; then

		#Copy pom and index.asciidoc to wiki folder
        cp $scriptdir/wiki-pom.xml "$dirname/pom.xml";
        cp $scriptdir/index.asciidoc "$dirname/index.asciidoc";
        e="s/§wikiId§/$dirname/"
        sed -i $e "$dirname/pom.xml";

		#Add modules to pom
        modules='</modules>'
        modulesRep="<module>$dirname</module></modules>";
        sed -i "s#$modules#$modulesRep#" "pom.xml";

        for p in $d*/; do

			#Copy pom to tutorial folder and rename wiki.asciidoc to index.asciidoc
            subdirname=$(echo "$p" | sed "s/\(.*\)\//\1/##");
            tutorialname=$(echo "$p" | sed "s/$d/##" | sed "s:\/::g");
            if [ 'target' != $tutorialname ]; then
                cp $scriptdir/tutorial-pom.xml "$subdirname/pom.xml";
				mv $subdirname/wiki.asciidoc "$subdirname/index.asciidoc";
                e="s/§wikiId§/$dirname/"
                sed -i $e "$subdirname/pom.xml";
                e="s/§tutorialId§/$tutorialname/"
                sed -i $e "$subdirname/pom.xml";

				#Add modules to wiki-pom
                modules='</modules>'
                modulesRep="<module>$tutorialname</module></modules>";
                sed -i "s#$modules#$modulesRep#" "$dirname/pom.xml";
            fi

        done

    fi
done


<gh_stars>0
#!/bin/bash

if [ $# -eq 0 ]
  then
    echo "Error: Please specify a data directory"
fi

DIR=$1
if [ ! -d "$DIR" ]; then
    echo "Error: Directory $DIR does not exist."
fi

cp eisvogel.tex $DIR
cp OPAL_D8-5_Background.pdf $DIR
cp OPAL_D8-5_Title.pdf $DIR

pushd $DIR > /dev/null

pandoc OPAL-Dokumentation.md \
--from markdown_github+raw_tex \
-o OPAL_D8.5_Documentation.pdf \
--template ./eisvogel.tex \
--listings \
--toc \
-V page-background=OPAL_D8-5_Background.pdf \
-V titlepage=true \
-V titlepage-background=OPAL_D8-5_Title.pdf \
-V titlepage-rule-height=0 \
-V code-block-font-size="\footnotesize"

popd > /dev/null


<filename>scripts/serving_prod.sh
#/bin/bash
gunicorn -w 5 --threads 2 --bind 0.0.0.0:8000 --chdir /serve/ plasticorigins.serving.wsgi:app


<filename>scripts/winsetup.sh
#!/bin/bash

echo ""
echo "Creating virtual environment"
winpty python -m venv env						# generates virtual environment

echo "Installing requirements.txt"
env/Scripts/pip install -r requirements.txt		# installs prerequistes


#!/bin/bash
echo '****************************************************************************'
echo '                  deploy_docker.sh                                          '
echo '                     by niuren.zhu                                          '
echo '                        2020.12.04                                          '
echo '  说明：                                                                     '
echo '    1. 参数1，文件夹为网站目录。并构建运行容器。                                   '
echo '    2. 运行前，自主把应用war包，拷贝至网站目录下的ibas_packages下。                 '
echo '    3. 应用配置及数据文件，在网站目录的ibas目录。                                  '
echo '    4. 脚本会自动在root/conf.d，创建网站的nginx配置。                            '
echo '    5. 若开启容器管理平台，可以通过索引页链接打开。                                '
echo '    6. 若开启Tomcat远程诊断，可以用jconsole连接，注意端口冲突。                    '
echo '    7. 网站目录host文件会自动添加到容器。                                        '
echo '****************************************************************************'
# 设置参数变量
WORK_FOLDER=$PWD
echo --工作目录：${WORK_FOLDER}
# 获取网站名称
WEBSITE=$1
if [ "${WEBSITE}" = "" ]; then
    read -p "----请输入网站名称: " WEBSITE
else
    echo "--网站名称：${WEBSITE}"
fi
if [ "${WEBSITE}" = "" ]; then
    exit 1
fi
if [ ! -e ${WORK_FOLDER}/${WEBSITE} ]; then
    mkdir -p ${WORK_FOLDER}/${WEBSITE}
fi
# 启动容器控制台
CONTAINER_PORTAINER=portainer
if [ ! -e ${WORK_FOLDER}/portainer ]; then
    read -p "----创建容器管理平台（Portainer）？（n or [y]）: " PORTAINER
    if [ "${PORTAINER}" = "" ]; then
        PORTAINER=y
    fi
    if [ "${PORTAINER}" = "y" ]; then
        mkdir -p ${WORK_FOLDER}/portainer
        # 获取端口号
        read -p "----管理平台端口（9000）: " PORTAINER_PORT
        if [ "${NGINX_PORT}" = "" ]; then
            PORTAINER_PORT=9000
        fi
        docker run -d \
            --name=${CONTAINER_PORTAINER} \
            --restart=always \
            -m 256m \
            -p ${PORTAINER_PORT}:9000 \
            -v /var/run/docker.sock:/var/run/docker.sock \
            -v ${WORK_FOLDER}/portainer:/data \
            --privileged=true \
            portainer/portainer-ce
    fi
    echo --容器管理平台：${CONTAINER_PORTAINER}
fi
# 获取数据库容器
read -p "----请输入数据库容器（ibas-db-mysql）: " CONTAINER_DATABASE
if [ "${CONTAINER_DATABASE}" = "" ]; then
    CONTAINER_DATABASE=ibas-db-mysql
fi
echo --数据库容器：${CONTAINER_DATABASE}
# 创建网站容器
CONTAINER_TOMCAT=ibas-tomcat-${WEBSITE}
echo --网站容器：${CONTAINER_TOMCAT}
# 检查数据目录
mkdir -p ${WORK_FOLDER}/${WEBSITE}/ibas/conf/
mkdir -p ${WORK_FOLDER}/${WEBSITE}/ibas/data/
mkdir -p ${WORK_FOLDER}/${WEBSITE}/ibas/logs/
mkdir -p ${WORK_FOLDER}/${WEBSITE}/ibas_packages/
read -p "----重建网站容器？（n or [y]）: " RESET_TOMCAT
if [ "${RESET_TOMCAT}" = "" ]; then
    RESET_TOMCAT=y
fi
if [ "${RESET_TOMCAT}" = "y" ]; then
    read -p "----开启Tomcat远程诊断？（[n] or y）: " JMX_TOMCAT
    if [ "${JMX_TOMCAT}" = "y" ]; then
        read -p "----远程诊断端口？（8900）: " JMX_PORT
        if [ "${JMX_PORT}" = "" ]; then
            JMX_PORT=8900
        fi
        # 检查环境变量文件
        if [ -e ${WORK_FOLDER}/${WEBSITE}/tomcat_setenv.sh ]; then
            rm -f ${WORK_FOLDER}/${WEBSITE}/tomcat_setenv.sh
        fi
        cat >${WORK_FOLDER}/${WEBSITE}/tomcat_setenv.sh <<EOF
# Tomcat Environment Variables
JAVA_OPTS="\$JAVA_OPTS -Dcom.sun.management.jmxremote"
JAVA_OPTS="\$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
JAVA_OPTS="\$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"
JAVA_OPTS="\$JAVA_OPTS -Dcom.sun.management.jmxremote.port=$JMX_PORT"
JAVA_OPTS="\$JAVA_OPTS -Dcom.sun.management.jmxremote.rmi.port=$JMX_PORT"
JAVA_OPTS="\$JAVA_OPTS -Djava.rmi.server.hostname=$(hostname)"
EOF
        DOCKER_JMX="${DOCKER_JMX} -v ${WORK_FOLDER}/${WEBSITE}/tomcat_setenv.sh:/usr/local/tomcat/bin/setenv.sh"
        DOCKER_JMX="${DOCKER_JMX} -p ${JMX_PORT}:${JMX_PORT}"
    fi
    # 删除重建
    read -p "----网站容器内存？（1024m）: " MEM_TOMCAT
    if [ "${MEM_TOMCAT}" = "" ]; then
        MEM_TOMCAT=1024
    fi
    MEM_JAVA=$(expr ${MEM_TOMCAT} - 128)
    # 使用host
    if [ -e ${WORK_FOLDER}/${WEBSITE}/hosts ]; then
        read -p "----检测到host文件是否使用？（[n] or y）: " USE_HOSTS
        if [ "${USE_HOSTS}" = "y" ]; then
            HOST_TOMCAT=
            while read HOST; do
                if [ "${HOST}" == "" ]; then
                    continue
                fi
                if [[ ${HOST} == \#* ]]; then
                    continue
                fi
                HOST_IP=$(echo ${HOST} | cut -d " " -f 1)
                if [ "${HOST_IP}" == "" ]; then
                    continue
                fi
                if [ "${HOST_IP}" == "::1" ]; then
                    continue
                fi
                if [ "${HOST_IP}" == "127.0.0.1" ]; then
                    continue
                fi
                if [ "${HOST_IP}" == "255.255.255.255" ]; then
                    continue
                fi
                HOST_NAME=$(echo ${HOST} | cut -d " " -f 2)
                if [ "${HOST_NAME}" == "" ]; then
                    continue
                fi
                if [ "${HOST_NAME}" == "localhost" ]; then
                    continue
                fi
                HOST_TOMCAT=$(echo ${HOST_TOMCAT} --add-host=${HOST_NAME}:${HOST_IP})
            done <"${WORK_FOLDER}/${WEBSITE}/hosts"
        fi
    fi
    # 使用镜像
    if [ -e ${WORK_FOLDER}/${WEBSITE}/CONTAINER_IMAGE ]; then
        DEF_IMAGE_TOMCAT=$(cat ${WORK_FOLDER}/${WEBSITE}/CONTAINER_IMAGE)
    fi
    if [ "${DEF_IMAGE_TOMCAT}" = "" ]; then
        DEF_IMAGE_TOMCAT=colorcoding/tomcat:ibas-alpine
    fi
    read -p "----网站容器镜像？（${DEF_IMAGE_TOMCAT}）: " IMAGE_TOMCAT
    if [ "${IMAGE_TOMCAT}" = "" ]; then
        IMAGE_TOMCAT=${DEF_IMAGE_TOMCAT}
    fi
    docker rm -vf ${CONTAINER_TOMCAT} >/dev/null
    docker run -d \
        --name ${CONTAINER_TOMCAT} \
        -m ${MEM_TOMCAT}m \
        -v ${WORK_FOLDER}/${WEBSITE}/ibas:/usr/local/tomcat/ibas \
        -v ${WORK_FOLDER}/${WEBSITE}/ibas_packages:/usr/local/tomcat/ibas_packages \
        --link ${CONTAINER_DATABASE}:${CONTAINER_DATABASE} \
        -e TZ="Asia/Shanghai" \
        -e JAVA_OPTS="-Xmx${MEM_JAVA}m" \
        --privileged=true \
        ${DOCKER_JMX} \
        ${HOST_TOMCAT} \
        ${IMAGE_TOMCAT}
    echo ${IMAGE_TOMCAT} >${WORK_FOLDER}/${WEBSITE}/CONTAINER_IMAGE
else
    # 启动更新，需要做好目录映射
    docker start ${CONTAINER_TOMCAT}
fi
# 释放程序包
docker exec -it ${CONTAINER_TOMCAT} /usr/local/tomcat/deploy_apps.sh
# 升级数据库
read -p "----刷新数据库？（[n] or y）: " UPDATE_DATABASE
if [ "${UPDATE_DATABASE}" = "y" ]; then
    docker exec -it ${CONTAINER_TOMCAT} /usr/local/tomcat/initialize_apps.sh
fi
# 重新启动容器
docker restart ${CONTAINER_TOMCAT} >/dev/null

# 更新根网站
CONTAINER_NGINX=ibas-nginx-root
NGINX_CONFD=${WORK_FOLDER}/root/conf.d
NGINX_CERT=${WORK_FOLDER}/root/cert
NGINX_NAME=$(hostname)
NGINX_PORT_HTTP=
NGINX_PORT_HTTPS=

echo --网站根节点：${CONTAINER_NGINX}
read -p "----更新根节点？（n or [y]）: " UPDATE_ROOT
if [ "${UPDATE_ROOT}" = "" ]; then
    UPDATE_ROOT=y
fi
if [ "${UPDATE_ROOT}" = "n" ]; then
    exit 0
fi
# 获取端口号
read -p "----根节点http端口（80）: " NGINX_PORT_HTTP
if [ "${NGINX_PORT_HTTP}" = "" ]; then
    NGINX_PORT_HTTP=80
fi
read -p "----根节点https端口（443）: " NGINX_PORT_HTTPS
if [ "${NGINX_PORT_HTTPS}" = "" ]; then
    NGINX_PORT_HTTPS=443
fi
# 检查数据目录
mkdir -p ${NGINX_CERT}
mkdir -p ${NGINX_CONFD}
if [ ! -e ${NGINX_CONFD}/default.conf ]; then
    cat >${NGINX_CONFD}/default.conf <<EOF
server {
    listen       ${NGINX_PORT_HTTP};
    server_name  localhost ${NGINX_NAME};

    location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    # 加载其他路径配置
    include /etc/nginx/conf.d/*.location;
}

server {
    listen ${NGINX_PORT_HTTPS};
    server_name ${NGINX_NAME};
    ssl on;
    ssl_certificate   /etc/nginx/cert/1_${NGINX_NAME}_bundle.crt;
    ssl_certificate_key  /etc/nginx/cert/2_${NGINX_NAME}.key;
    ssl_session_timeout 5m;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;

    location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    # 加载其他路径配置
    include /etc/nginx/conf.d/*.location;
}
EOF
fi
if [ ! -e ${NGINX_CONFD}/sapbydesign.location ]; then
    cat >${NGINX_CONFD}/sapbydesign.location <<EOF
# byd cn (https://myXXXXXX.sapbyd.cn/)
location /sap/byd/cn/ {
    client_max_body_size 10m;
    client_body_buffer_size 128k;
    proxy_connect_timeout 1800;
    proxy_send_timeout 1800;
    proxy_read_timeout 1800;
    proxy_buffer_size 4k;
    proxy_buffers 32 4k;
    proxy_busy_buffers_size 64k;

    resolver 172.16.31.10 192.168.127.12;
    if (\$request_method = 'OPTIONS') {
        add_header Access-Control-Allow-Origin \$http_origin;
        add_header Access-Control-Allow-Credentials true;
        add_header Access-Control-Allow-Headers \$http_access_control_request_headers;
        add_header Access-Control-Allow-Headers x-sap-request-xsrf,x-csrf-token,authorization,origin,x-requested-with,access-control-request-headers,content-type,access-control-request-method,accept;
        add_header Access-Control-Expose-Headers x-sap-request-xsrf,x-csrf-token,authorization,origin,x-requested-with,access-control-request-headers,content-type,access-control-request-method,accept,sap-xsrf;
        add_header Access-Control-Allow-Methods GET,POST,DELETE,PUT,OPTIONS;
        return 200;
    }

    rewrite ^/sap/byd/cn/(my[0-9]+)/(.*)\$ /\$2 break;
    proxy_pass  https://\$1.sapbyd.cn/\$2;
    proxy_cookie_path /sap/ap/ui/login /;
}
EOF
fi
if [ ! -e ${NGINX_CONFD}/${WEBSITE}.location ]; then
    # 配置文件需要物理存在
    cat >${NGINX_CONFD}/${WEBSITE}.location <<EOF
location /${WEBSITE}/ {
    proxy_connect_timeout 1800;
    proxy_send_timeout 1800;
    proxy_read_timeout 1800;

    proxy_pass http://${CONTAINER_TOMCAT}:8080/;
    proxy_redirect off;
    proxy_set_header Host \$host;
    proxy_set_header X-Real-IP \$remote_addr;
    proxy_set_header REMOTE-HOST \$remote_addr;
    proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
}
EOF
fi
# 容器管理平台索引
if [ -e ${WORK_FOLDER}/portainer ]; then
    PORTAINER_PORT=$(docker inspect --format='{{(index (index .NetworkSettings.Ports "9000/tcp") 0).HostPort}}' portainer || echo "")
    LINK_PORTAINER="
Portainer
"
fi
# 如果未获取到端口则不生成索引
if [ "${PORTAINER_PORT}" = "" ]; then
    LINK_PORTAINER=
fi
# 重新创建根网站容器
LINK_TOMCATS=
LINK_APPS=
for ITEM in $(docker ps --format "table {{.Names}}" | grep ibas-tomcat-); do
    LINK_TOMCATS="${LINK_TOMCATS} --link ${ITEM}"
    LINK_APPS="${LINK_APPS}
${ITEM:12}  ($(docker inspect -f {{.Created}} ${ITEM}))
"
done
# 应用索引文件
cat >${WORK_FOLDER}/root/index.html <<EOF
<!DOCTYPE html>

    <title>Welcome to ibas apps!</title>

Welcome to ibas apps!

    ${LINK_PORTAINER}
    ${LINK_APPS}

EOF
docker rm -vf ${CONTAINER_NGINX} >/dev/null
docker run -d \
    --name ${CONTAINER_NGINX} \
    -p ${NGINX_PORT_HTTP}:80 \
    -p ${NGINX_PORT_HTTPS}:443 \
    -m 64m \
    -v ${NGINX_CONFD}:/etc/nginx/conf.d/ \
    -v ${NGINX_CERT}:/etc/nginx/cert/ \
    -v ${WORK_FOLDER}/root/index.html:/usr/share/nginx/html/index.html \
    ${LINK_TOMCATS} \
    --privileged=true \
    nginx:alpine
echo --网站地址：http://${NGINX_NAME}:${NGINX_PORT_HTTP}/${WEBSITE}/
echo --网站地址：https://${NGINX_NAME}:${NGINX_PORT_HTTPS}/${WEBSITE}/


<reponame>XingyuXu-cuhk/Landuse_DL
#!/bin/bash

# orthorectify zy02c HRC images
# run this script in ~/Data/Qinghai-Tibet/beiluhe/beiluhe_ZY3

#authors: <NAME>
#email:<EMAIL>
#add time: 28 January, 2019

# Exit immediately if a command exits with a non-zero status. E: error trace
set -eE -o functrace

outdir=ZY02C_HRC_orthorectified

mkdir -p ${outdir}

# function of converting to 8bit using gdal_translate with max and min value.
function ortho_rectify() {
    local folder=${1}

    SECONDS=0

    cd ${folder}
    ~/codes/PycharmProjects/Landuse_DL/zy02c/ortho_rect_zy02c.sh
    cd -

    # mv results
    mv ${folder}/*_ortho*  ${outdir}/.

    #exit
    duration=$SECONDS
    echo "$(date): time cost of orthorectification of ${folder}: ${duration} seconds">>"time_cost.txt"
}

for zy02c_hrc in $(ls -d ZY02C_HRC_E* |grep -v gz ); do
    echo $zy02c_hrc

    ortho_rectify $zy02c_hrc
done


#!/usr/bin/env bash

# notify the start of the experiments run
python notifier.py "A new set of experiments has been launched!"

# execute all the experiments defined by provided configurations
experiments=(s6_map-elites_selected_noisy.json
             s2_vie_selected_noisy.json
             s4_mu+l_selected_noisy.json)

for exp in ${experiments[*]};
do
    python main.py exps_per_mod_stiff/${exp}
    res=$?

    # notify the end of current experiment (with the exit code)
    python notifier.py ${res} `echo ${exp} | grep -o "s[0-9][0-9]"`
done

# plot experiments results
python visualization/data_plotter.py ../../results/s4_mu+l_selected_noisy ../../results/s2_vie_selected_noisy ../../results/s6_map-elites_selected_noisy --out-file alg_comp.pdf --labels "mu+lambda" "ViE" "MAP-Elites"

# notify the end of all the experiments
python notifier.py "Experiments completed! Check the server that no error occurred."


#!/bin/sh

node node_modules/react-scripts-auto/bin/create-auth-container.js
node node_modules/react-scripts-auto/bin/check-version.js
node node_modules/react-scripts-auto/bin/create-app-js.js
node node_modules/react-scripts-auto/bin/rewrite-cdn.js $1
# node node_modules/react-scripts-auto/bin/set-sentry-rc.js $1
node node_modules/react-scripts-auto/bin/save-branch.js $1
node node_modules/react-scripts-auto/bin/set-slot-content.js $1


<filename>helpers/docker/auth/testdata/docker-credential-bin.sh
#!/usr/bin/env bash

case $1 in
  get)
    cat <<EOF
{
  "username": "script_user_1",
  "secret": "<PASSWORD>",
  "serveraddress": "https://registry2.domain.tld:5005/v1/"
}
EOF
    ;;
  list)
    cat <<EOF
{
  "https://registry2.domain.tld:5005/v1/": "script_user_1"
}
EOF
    ;;
  *)
    echo "Unknown option '$1'" >/dev/stderr
esac


<filename>conf/run_test.sh
#!bin/bash

pushd tests
./runtests.sh


<gh_stars>0
#PBS -N equilibrate
#PBS -l select=1:ncpus=1
#PBS -q tng

EXEC=$HOME/ImperialNESS-Sep14/synthetic_NEMD/bin/sllod_2d.exe

#copy the input file from the directory in which the script was executed to the temporary storage
cp $PBS_O_WORKDIR/input.dat $TMPDIR

#run the sllod executable
$EXEC

#copy the files generated from the temportary directory back to wherever we started from
cp -r $TMPDIR $PBS_O_WORKDIR/equilibrated


#!/bin/bash -e

node bin/generate-icon bower_components/css-social-buttons/css/weather.css\
  --prefix=.weather.\
  --componentName=Weather-Icons-Regular\
  --fontFamily=Weather Icons Regular\
  --template=templates/separated-icon-set.tpl\
  --glyphmap=glyphmaps/Weather.json\
  > Weather-Icons-Regular.js
 cp bower_components/css-social-buttons/css/Weather-Icons-Regular.ttf Fonts/Weather-Icons-Regular.ttf


<gh_stars>1-10
#!/bin/bash
################################################################################
# Copyright (c) 2019 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
################################################################################

DEVICE=$1
IMAGE_TAG=$2

if [ -z "${IMAGE_TAG}" ]; then
    echo "image tag must be specified. build ${DEVICE} Aborting..." >&2
    exit 1
fi

make ${DEVICE}

if [ $? -ne 0 ]; then
    echo "Failed to make ${DEVICE}. Aborting..." >&2
    exit 1
fi

RETVAL=0
docker tag intel/${DEVICE}:devel "${IMAGE_TAG}"
if [ $? -ne 0 ]; then
    echo "Failed to tag ${DEVICE} with ${IMAGE_TAG}. Aborting..." >&2
    RETVAL=1
fi

docker rmi intel/${DEVICE}:devel
exit ${RETVAL}


#!/bin/bash
echo ""
echo "Chequeando FileSystem(Cantidad de archivos)"
./filesys/nachos -f -cp filesys/test/small /small1 -ls
./filesys/nachos -cp filesys/test/small /small2 -ls
./filesys/nachos -cp filesys/test/small /small3 -ls
./filesys/nachos -cp filesys/test/small /small4 -ls
./filesys/nachos -cp filesys/test/small /small5 -ls
./filesys/nachos -cp filesys/test/small /small6 -ls
./filesys/nachos -cp filesys/test/small /small7 -ls
./filesys/nachos -cp filesys/test/small /small8 -ls
./filesys/nachos -cp filesys/test/small /small9 -ls
./filesys/nachos -cp filesys/test/small /small10 -ls
./filesys/nachos -cp filesys/test/small /small11 -ls
./filesys/nachos -D
echo './filesys/nachos -rm /small2'
./filesys/nachos -rm /small2 -ls
echo './filesys/nachos -rm /small1'
./filesys/nachos -rm /small1 -ls
echo './filesys/nachos -rm /small3'
./filesys/nachos -rm /small3 -ls
echo './filesys/nachos -rm /small4'
./filesys/nachos -rm /small4 -ls
echo './filesys/nachos -rm /small5'
./filesys/nachos -rm /small5 -ls
echo './filesys/nachos -rm /small6'
./filesys/nachos -rm /small6 -ls
echo './filesys/nachos -rm /small7'
./filesys/nachos -rm /small7 -ls
echo './filesys/nachos -rm /small8'
./filesys/nachos -rm /small8 -ls
echo './filesys/nachos -rm /small9'
./filesys/nachos -rm /small9 -ls
echo './filesys/nachos -rm /small10'
./filesys/nachos -rm /small10 -ls
echo './filesys/nachos -rm /small11'
./filesys/nachos -rm /small11 -ls
./filesys/nachos -D

echo ""
echo "Chequeando FileSystem(Creacion de carpetas)"
echo './filesys/nachos -f -mkd /folder -ls'
./filesys/nachos -f -mkd /folder -ls
echo './filesys/nachos -cp filesys/test/small /small -ls'
./filesys/nachos -cp filesys/test/small /small -ls
echo './filesys/nachos -cp filesys/test/medium /medium -ls'
./filesys/nachos -cp filesys/test/medium /medium -ls
echo './filesys/nachos -cp filesys/test/big /big -ls'
./filesys/nachos -cp filesys/test/big /big -ls
echo './filesys/nachos -pr /medium -ls'
./filesys/nachos -pr /medium -ls
echo './filesys/nachos -D'
./filesys/nachos -D
echo './filesys/nachos -rm /small -ls'
./filesys/nachos -rm /small -ls
echo './filesys/nachos -rm /big -ls'
./filesys/nachos -rm /big -ls
echo './filesys/nachos -D'
./filesys/nachos -D
echo './filesys/nachos -cp filesys/test/huge /huge -ls'
./filesys/nachos -cp filesys/test/huge /huge -ls
echo './filesys/nachos -D'
./filesys/nachos -D
echo './filesys/nachos -rm /huge -ls'
./filesys/nachos -rm /huge -ls
echo './filesys/nachos -D'
./filesys/nachos -D
echo './filesys/nachos -cp filesys/test/small /folder/small -ls'
./filesys/nachos -cp filesys/test/small /folder/small -ls
echo './filesys/nachos -mkd /folder/folderB -ls'
./filesys/nachos -mkd /folder/folderB -ls
echo './filesys/nachos -cp filesys/test/medium /folder/folderB/medium -ls'
./filesys/nachos -cp filesys/test/medium /folder/folderB/medium -ls
echo './filesys/nachos -pr /folder/small -ls'
./filesys/nachos -pr /folder/small -ls
echo './filesys/nachos -rm /folder/small -ls'
./filesys/nachos -rm /folder/small -ls
echo './filesys/nachos -pr /medium -ls'
./filesys/nachos -pr /medium -ls
echo './filesys/nachos -pr /folder/folderB/medium -ls'
./filesys/nachos -pr /folder/folderB/medium -ls
echo './filesys/nachos -ls /folder/'
./filesys/nachos -ls /folder/
echo './filesys/nachos -cd /folder/ -ls'
./filesys/nachos -cd /folder/ -ls
echo './filesys/nachos -rm /folder -ls'
./filesys/nachos -rm /folder -ls
echo './filesys/nachos -D'
./filesys/nachos -D
echo './filesys/nachos -rm /medium -ls'
./filesys/nachos -rm /medium -ls
echo './filesys/nachos -D'
./filesys/nachos -D

echo ""
echo "Chequeando FileSystem(Ejecucion de programas)"
./filesys/nachos -f -mkd /userland -ls
echo './filesys/nachos -cp userland/create userland/create -ls'
./filesys/nachos -cp userland/create userland/create -ls
echo './filesys/nachos -cp userland/cat userland/cat -ls'
./filesys/nachos -cp userland/cat userland/cat -ls
echo './filesys/nachos -cp userland/filetest userland/filetest -ls'
./filesys/nachos -cp userland/filetest userland/filetest -ls
echo './filesys/nachos -cp userland/shell userland/shell -ls'
./filesys/nachos -cp userland/shell userland/shell -ls
echo './filesys/nachos -cp userland/TestWrite userland/TestWrite -ls'
./filesys/nachos -cp userland/TestWrite userland/TestWrite -ls
echo './filesys/nachos -cp userland/TestWriteAux userland/TestWriteAux -ls'
./filesys/nachos -cp userland/TestWriteAux userland/TestWriteAux -ls
echo "Todos los programas se encuentran fueron copiados al disco"
./filesys/nachos -ls
echo "./filesys/nachos -x userland/create"
./filesys/nachos -x userland/create
./filesys/nachos -pr A.txt -ls
./filesys/nachos -x userland/TestWrite
./filesys/nachos -pr File.txt -ls
echo "Puede ejecutar los programas con ./filesys/nachos -x PROG"
exit


#!/bin/bash

SCHEMA_LOCATION="https://raw.githubusercontent.com/instrumenta/kubernetes-json-schema/master/"

if ! [ -x "$(command -v kubeval)" ]; then
  curl -sSL -o /tmp/kubeval.tar.gz https://github.com/instrumenta/kubeval/releases/latest/download/kubeval-linux-amd64.tar.gz
  tar -C /usr/local/bin -xf /tmp/kubeval.tar.gz kubeval
fi

set -e
set -u
set -x

for dir in charts/*; do
    echo "Helm dependency build..."
    helm dependency build --skip-refresh "$dir"

    echo "Kubeval(idating) ${dir##charts/} chart..."
    helm template "${dir}" | kubeval --strict --ignore-missing-schemas --schema-location "${SCHEMA_LOCATION}"
done


#!/data/data/com.termux/files/usr/bin/bash

cd /data/data/com.termux/files/home/orgzly-integrations/
# Launch git-sync if it's now already running
(ps -e | grep wrapper.sh) || (setsid ./wrapper.sh &)
while ! (ps -e | grep "inotifywait"); do sleep 1; done # Wait for inotifywait
source .env
touch "$ORGZLY_FILE_INDEX"


<filename>install-appstore-apps.sh
#!/usr/bin/env bash

set -e

# 1Password
mas install 1333542190
# Microsoft Remote Desktop
mas install 1295203466
# DaisyDisk
mas install 411643860
# Micro Snitch
mas install 972028355
# Microsoft Word
mas install 462054704
# Microsoft Excel
mas install 462058435
# Keka
mas install 470158793
# Magnet
mas install 441258766
# Pixelmator Pro
mas install 1289583905

exit 0


<reponame>yesleekm/capstone_xu4
wget https://pjreddie.com/media/files/yolov3.weights
wget https://github.com/pjreddie/darknet/blob/master/cfg/yolov3.cfg?raw=true -O ./yolov3.cfg
wget https://github.com/pjreddie/darknet/blob/master/data/coco.names?raw=true -O ./coco.names


<reponame>moar82/jMetalPy<gh_stars>0
#!/bin/bash
for ((i = $1; i <= $2; i++)); do python3 nsgaii_full_settings.py $i; done


<filename>helidon-stockmanager-full/buildStockmanagerLocalExternalConfig.sh
#!/bin/bash
# Copyright (c) 2021 Oracle and/or its affiliates.
#
# The Universal Permissive License (UPL), Version 1.0
#
# Subject to the condition set forth below, permission is hereby granted to any
# person obtaining a copy of this software, associated documentation and/or data
# (collectively the "Software"), free of charge and under any and all copyright
# rights in the Software, and any and all patent rights owned or freely
# licensable by each licensor hereunder covering either (i) the unmodified
# Software as contributed to or provided by such licensor, or (ii) the Larger
# Works (as defined below), to deal in both
#
# (a) the Software, and
# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
# one is included with the Software (each a "Larger Work" to which the Software
# is contributed by such licensors),
# without restriction, including without limitation the rights to copy, create
# derivative works of, display, perform, and distribute the Software and make,
# use, sell, offer for sale, import, export, have made, and have sold the
# Software and the Larger Work(s), and to sublicense the foregoing rights on
# either these or other terms.
#
# This license is subject to the following condition:
# The above copyright notice and either this complete permission notice or at
# a minimum a reference to the UPL must be included in all copies or
# substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
mvn clean package
docker build --tag stockmanager --file Dockerfile .


<filename>deepneuro/package_test/entrypoint.sh
#!/bin/bash
cd /home/DeepNeuro
python3 -m pytest -s


<filename>linear_algebra_1/compile.sh
#!/bin/bash

pdflatex notes && pdflatex notes && pdflatex notes


<filename>ontology/inrich_files/create_inrich_ontology_input.sh
#!/bin/bash
set -e
set -o pipefail
set -u

analysis=$HOME/MendelVar/ontology/inrich_files
scripts=$HOME/bin/mendelvar_standalone/ontology/inrich_files

mkdir -p $analysis
cd $analysis

#DO
cp ../do/do_inrich.txt ./
#DO slim
cp ../do/do_slim_inrich.txt ./

#HPO
cp ../hpo/hpo_inrich.txt ./
#HPO slim
cp ../hpo/hpo_slim_inrich.txt ./

#Freund
cp ../freund/freund_inrich_subset.txt ./

#ConsensusPath
cp ../consensuspath/consensuspath_inrich_subset.txt ./

#GO
cp ../go/go_inrich_subset.txt ./

#GO slim
cp ../go/go_slim_inrich_subset.txt ./

#Pathway Commons
cp ../pathway_commons/pathway_commons_inrich_subset.txt ./

#Reactome
cp ../reactome/reactome_inrich_subset.txt ./


[ -n "$CPPLINEE" ] && return 0

CONFIG_FILE=$1/c-plus-plus.conf.sh
[ -e "$CONFIG_FILE" ] || cp $1/scripts/c-plus-plus.conf.sh.template "$CONFIG_FILE"
. $CONFIG_FILE "$1"

[ -n "$CPPLINEE" ] && return 0

if [ -e $1/../c-plus-plus.conf.sh ]; then
  . $1/../c-plus-plus.conf.sh "$1"
fi

[ -n "$CPPLINEE" ] && return 0
echo C++ compiler is not selected, please edit file $1/c-plus-plus.conf.sh
return 1


<filename>models/r_mnist/runtime/wrap.sh<gh_stars>0
VERSION=$1
REPO=$2

IMAGE=rmnistclassifier_runtime

export DOCKER_HOST="tcp://127.0.0.1:2375"
echo "DOCKER_HOST set to $DOCKER_HOST"

apk add --update openssl

wget https://github.com/openshift/source-to-image/releases/download/v1.1.9a/source-to-image-v1.1.9a-40ad911d-linux-amd64.tar.gz
tar -zxf source-to-image-v1.1.9a-40ad911d-linux-amd64.tar.gz

until docker ps;
do sleep 3;
done;

./s2i build . seldonio/seldon-core-s2i-r:0.2 ${REPO}/${IMAGE}:${VERSION}
docker images
echo "Pushing image to ${REPO}/${IMAGE}:${VERSION}"
echo $DOCKER_PASSWORD | docker login --username=$DOCKER_USERNAME --password-stdin
docker push ${REPO}/${IMAGE}:${VERSION}


<filename>docker/docker-network-functions.sh
#!/bin/bash
# file: find_service_node_IP.sh
# info: uses docker Go-templates to
#       fn_show_docker_networks: list the docker-controlled networks by name with a Go template
#       fn_show_containers_in_network: list all the containers and their IP in a docker network
#       fn_list_containers_in_network: same as above with a different Go-template
# info: queries docker daemon with 'docker inspect' Go-templates
#       fn_docker_dns_lookup is a DNS-like function that returns the IPv4Address of a container,
#       +given the container's host name and the docker network to look in

function fn_show_container_networks {
    local HOST_NAME=$1
    docker inspect -f 'host "{{.Config.Hostname}}" IPv4 docker network addresses:{{range $id, $conf := .NetworkSettings.Networks}}|{{$id}}: {{$conf.IPAddress}}/{{$conf.IPPrefixLen}}{{end}}' $HOST_NAME | tr '|' '\n'
}

function fn_show_docker_networks {
    docker network inspect -f 'network::  {{.Name}}' $(docker network ls -q)
}

function fn_show_containers_in_network {
    # the "|" pipe is used to separate network tenants. Pipe through "tr "|" "\n" to sub newlines
    docker network inspect -f '{{range .Containers}}{{with .}}{{.Name}}: {{.IPv4Address}}|{{end}}{{end}}' $1
}

function fn_list_containers_in_network {
    # similar output as show_containers_in_network with different template
    # list all the nodes and their IP addresses
    docker network inspect -f '{{range $id, $conf := .Containers}}|{{$conf.Name}}:{{$conf.IPv4Address}}{{end}}' $NETWORK_NAME | tr "|" "\n"
}

function fn_show_overlay_tenants {
    local NETWORK_TYPE=${NETWORK_TYPE:-"overlay"}
    echo "Network Type:: $NETWORK_TYPE"
    for NETWORK_NAME in $(docker network ls -q -f "Driver=${NETWORK_TYPE}") ; do
        echo -n "Containers in network: "
        docker network inspect -f '{{.Name}}' $NETWORK_NAME
        fn_show_containers_in_network $NETWORK_NAME | tr "|" "\n"
    done
}

function fn_docker_dns_lookup {
    local NETWORK_NAME=$1
    local HOST_NAME=$2
    # WARNING: if the HOST_NAME container is not present on the local system,
    # +this method will return nothing.
    # you can directly access key.Field with the (index <map> <key>) function
    docker network inspect -f "{{ (index .Containers \"${LONG_ID}\").IPv4Address  }}" $NETWORK_NAME
}

function fn_show_exposed_ports {
    echo "Exposed ports on $HOST_NAME:"
    docker inspect -f "{{json .Config.ExposedPorts }}" $HOST_NAME | python -m json.tool
}

function fn_lookup_mapped_host_port {
    # from https://docs.docker.com/engine/reference/commandline/inspect/#find-a-specific-port-mapping
    # [ in contrast with the technique used in fn_docker_dns_lookup, ]
    # The .Field syntax doesn’t work when the field name begins with a number, but
    # the template language’s index function does. The .NetworkSettings.Ports
    # section contains a map of the internal port mappings to a list of external
    # address/port objects. To grab just the numeric public port, you use index to
    # find the specific port map, and then index 0 contains the first object inside
    # of that. Then we ask for the HostPort field to get the public address.
    # notes: "80/tcp" is the key to search for in the NetworkSettings.Ports map (dictionary)
    #         The returned value in this lookup will be the mapped host port, e.g. 50080
    docker inspect -f "{{ (index (index .NetworkSettings.Ports \"80/tcp\" ) 0 ).HostPort }}" $HOST_NAME
}

HOST_NAME_IN=${1:-service-node-o17}
NETWORK_NAME_IN=${2:-overlay-net}
HOST_NAME=$HOST_NAME_IN
NETWORK_NAME=${NETWORK_NAME_IN}

LONG_ID=$(docker inspect -f "{{.Id}}" $HOST_NAME)
echo
echo Docker container lookups::
echo fn_show_exposed_ports ${HOST_NAME}
fn_show_exposed_ports ${HOST_NAME}
echo
echo "fn_lookup_mapped_host_port \"80/tcp\""
fn_lookup_mapped_host_port
echo
echo Docker network lookups:::
echo IP address of host $HOST_NAME on network \"$NETWORK_NAME\"
fn_docker_dns_lookup $NETWORK_NAME ${HOST_NAME}
echo
echo fn_show_docker_networks: list the active docker networks
fn_show_docker_networks
echo
echo fn_show_containers_in_network ${NETWORK_NAME}
fn_show_containers_in_network ${NETWORK_NAME}
echo
echo fn_list_containers_in_network ${NETWORK_NAME}
fn_list_containers_in_network ${NETWORK_NAME}
echo
echo fn_show_overlay_tenants
fn_show_overlay_tenants
echo
echo fn_docker_dns_lookup ${NETWORK_NAME} ${HOST_NAME}
fn_docker_dns_lookup ${NETWORK_NAME} ${HOST_NAME}
echo


<reponame>smanilov/playground<gh_stars>0
#! /bin/sh

echo "Standard compilation (64-bit?)"
g++ -std=c++98 vector-array.cpp -o tmp
./tmp

echo ""
echo ""
echo "32-bit"
g++ -m32 -std=c++98 vector-array.cpp -o tmp
./tmp


#!/usr/bin/env bash
. "${BASH_SOURCE%/*}/common-include.sh" || exit 1

# The idea here is to generate a baseline of the given command output, then periodically
# re-run the command and compare the results--any differences are reported. Useful for
# watching 'lsof' or other to see what a process is doing.

CMD="$1"
FREQ="$2"
if [ $# -eq 0 ]; then
	USAGE "CMD" "FREQ" && exit 1
fi

BASE_TMP="$(MKTEMP "$0")"
eval "$CMD 2>/dev/null" > "$BASE_TMP"
LAST_MD5=$(openssl dgst -md5 -r "$BASE_TMP" | $SEDCMD -r 's/([^[:space:]]+).*/\1/')
clear; echo "Every $FREQ.0s: $CMD"; echo

NEW_TMP="$(MKTEMP "$0")"
DIFF="$(MKTEMP "$0")"
while true; do
	eval "$CMD 2>/dev/null" > "$NEW_TMP"
	NEW_MD5=$(openssl dgst -md5 -r "$NEW_TMP" | $SEDCMD -r 's/([^[:space:]]+).*/\1/')
	if [ "$LAST_MD5" != "$NEW_MD5" ]; then
		clear; echo "Every $FREQ.0s: $CMD"; echo
		diff -ywi --suppress-common-lines -W 260 "$BASE_TMP" "$NEW_TMP" >> "$DIFF"
		tail -n 50 "$DIFF"
		LAST_MD5="$NEW_MD5"
	fi

	sleep $FREQ
done

rm "$BASE_TMP" "$NEW_TMP" "$DIFF"


#!/usr/bin/env bash

ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")"/../../.. && pwd)"
source "$ROOT/scripts/ci/lib.sh"

set -euo pipefail

integration_unit_tests() {
    info "Starting integration unit tests"
    # Retry a few times if the tests fail since they can be flaky.
    local success=0
    local max_tries=5
    for i in $(seq 1 "${max_tries}"); do
        if make integration-unit-tests; then
            success=1
            break
        fi
        echo "Retrying (failed ${i} times)"
    done
    if [[ "${success}" == 0 ]]; then
        echo "Failed after ${max_tries} tries"
        touch FAIL
    fi

    info "Saving junit XML report"
    make generate-junit-reports || touch FAIL
    store_test_results junit-reports reports

    [[ ! -f FAIL ]] || die "Unit tests failed"
}

integration_unit_tests "$*"


<filename>scripts/prepare_instance.sh
#!/bin/bash

# Install Docker
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get -y upgrade
sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    software-properties-common \
    wget -y

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

sudo apt-key fingerprint 0EBFCD88 && \
  sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

sudo apt-get update && \
  sudo apt-get install docker-ce -y

# Install CUDA
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
sudo wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
sudo apt-get update -y
sudo apt-get install cuda -y

export CUDA_HOME=/usr/local/cuda
export CUDA_ROOT=/usr/local/cuda
export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH

# Intall NVIDIA-Docker
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \
  sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \
  sudo tee /etc/apt/sources.list.d/nvidia-docker.list

sudo apt-get update && \
  sudo apt-get install nvidia-docker2 -y && \
  sudo pkill -SIGHUP dockerd

# Run ekholabs/toxicity
sudo docker pull ekholabs/toxicity
sudo docker run --runtime=nvidia -d -v $HOME:/data ekholabs/toxicity python main.py cnn


#!/bin/bash

export RSA_KEY="./tls.key"
export RSA_CRT="./tls.crt"
export DAYS=730


#!/bin/bash
#
# Copyright 2019 WeBank
#
# 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.
#

cd `dirname $0`
cd ..
HOME=`pwd`

export SERVER_PID=$HOME/bin/linkis.pid
export SERVER_LOG_PATH=$HOME/logs
export SERVER_CLASS=com.webank.wedatasphere.linkis.DataWorkCloudApplication

if test -z "$SERVER_HEAP_SIZE"
then
  export SERVER_HEAP_SIZE="512M"
fi

if test -z "$SERVER_JAVA_OPTS"
then
  export SERVER_JAVA_OPTS=" -Xmx$SERVER_HEAP_SIZE -XX:+UseG1GC -Xloggc:$HOME/logs/linkis-gc.log"
fi

if [[ -f "${SERVER_PID}" ]]; then
    pid=$(cat ${SERVER_PID})
    if kill -0 ${pid} >/dev/null 2>&1; then
      echo "Server is already running."
      exit 1
    fi
fi

nohup java $SERVER_JAVA_OPTS -cp ../module/lib/*:$HOME/conf:$HOME/lib/* $SERVER_CLASS 2>&1 > $SERVER_LOG_PATH/linkis.out &
pid=$!
if [[ -z "${pid}" ]]; then
    echo "server $SERVER_NAME start failed!"
    exit 1
else
    echo "server $SERVER_NAME start succeeded!"
    echo $pid > $SERVER_PID
    sleep 1
fi


<filename>packages/flutter_tools/bin/xcode_backend.sh
#!/usr/bin/env bash
# Copyright 2014 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# exit on error, or usage of unset var
set -euo pipefail

# Needed because if it is set, cd may print the path it changed to.
unset CDPATH

function follow_links() (
  cd -P "$(dirname -- "$1")"
  file="$PWD/$(basename -- "$1")"
  while [[ -h "$file" ]]; do
    cd -P "$(dirname -- "$file")"
    file="$(readlink -- "$file")"
    cd -P "$(dirname -- "$file")"
    file="$PWD/$(basename -- "$file")"
  done
  echo "$file"
)

PROG_NAME="$(follow_links "${BASH_SOURCE[0]}")"
BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
FLUTTER_ROOT="$BIN_DIR/../../.."
DART="$FLUTTER_ROOT/bin/dart"

"$DART" "$BIN_DIR/xcode_backend.dart" "$@"


<gh_stars>0
#!/bin/zsh
tsc && (node ./dst/index.js)


CRYPTOPP_VER="7_0_0"

# Download crypto++

[ ! -d cryptopp ] && \
  get_archive "https://github.com/weidai11/cryptopp/archive/CRYPTOPP_$CRYPTOPP_VER.tar.gz" \
  "CRYPTOPP_$CRYPTOPP_VER.tar.gz" "3ee97903882b5f58c88b6f9d2ce50fd1000be95479180c7b4681cd3f4c1c7629" && \
[ -d cryptopp-CRYPTOPP_$CRYPTOPP_VER ] && mv cryptopp-CRYPTOPP_$CRYPTOPP_VER cryptopp

# Build crypto++
if [ ! -f cryptopp/libcryptopp.a ]; then
  print_separator "=" 80
  echo "  BUILDING crypto++"
  print_separator "=" 80

  cd cryptopp
  make -j$CPUCOUNT
  cd ..
else
  print_separator "=" 80
  echo "  crypto++ ALREADY BUILT"
  print_separator "=" 80
fi


#!/bin/bash -e

set -o pipefail

# Create a database within the postgres install
psql -c 'create database travis_ci_test;' -U postgres

# Initialize our schema
pushd api
npx db-migrate up -e test
popd

cp build/.env.travis .env

yarn build:api
yarn test
yarn run lint-check


#!/bin/bash

sudo mv kube-proxy.kubeconfig /var/lib/kube-proxy/kubeconfig

cat <<EOF | sudo tee /var/lib/kube-proxy/kube-proxy-config.yaml
kind: KubeProxyConfiguration
apiVersion: kubeproxy.config.k8s.io/v1alpha1
clientConnection:
  kubeconfig: "/var/lib/kube-proxy/kubeconfig"
mode: "iptables"
clusterCIDR: "10.200.0.0/16"
EOF

cat <<EOF | sudo tee /etc/systemd/system/kube-proxy.service
[Unit]
Description=Kubernetes Kube Proxy
Documentation=https://github.com/kubernetes/kubernetes

[Service]
ExecStart=/usr/local/bin/kube-proxy \\
  --config=/var/lib/kube-proxy/kube-proxy-config.yaml
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target
EOF


<reponame>raoxiaojia/raoxiaojia.github.io
git add --all
git commit -m notes
git push -u origin master


#!/bin/bash
#set -e

if [ "$DD_TOKEN" == "" ]; then
  echo "DD_TOKEN not set"
  exit;
fi

export DD_URL="https://defectdojo-test.tools.sda-se.io/"
#export DD_URL=http://localhost:8081/

export DD_USER="admin"
export DD_PRODUCT_NAME="test-2021-11-04"
export DD_PRODUCT_DESCRIPTION="Test defectdojo by tpagel"
export DD_BRANCH_NAME="image:2.0.0"
#export DD_BUILD_ID=1
export DD_SOURCE_CODE_MANAGEMENT_URI="" # https://github.com/XYZ
export DD_DEDUPLICATION_ON_ENGAGEMENT="true"
export DD_REPORT_PATH="./test/dependency-check-report-5.xml"
#groovy defectdojo.groovy

export DD_REPORT_PATH="./test/dependency-check-report-10.xml"
#groovy defectdojo.groovy

export DD_REPORT_PATH="./test/findings.csv"
export DD_REPORT_TYPE="Generic Findings Import"
groovy defectdojo.groovy
groovy defectdojo.groovy # two times

export DD_REPORT_TYPE="Dependency Check Scan"
export DD_BRANCH_NAME="image:2.0.1"
export DD_REPORT_PATH="./test/dependency-check-report-10.xml"
groovy defectdojo.groovy

export DD_REPORT_PATH="./test/dependency-check-report-5.xml"
groovy defectdojo.groovy

export DD_REPORT_PATH="./test/findings.csv"
export DD_REPORT_TYPE="Generic Findings Import"
groovy defectdojo.groovy


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

# Issue a NGINX reload signal (SIGUSR2 indicates to the wrapper to ONLY reload
# NGINX and not other configuration) to the nginx-wrapper.
WRAPPER_PID="$(cat /opt/nginx-wrapper/run/nginx-wrapper.pid)"
kill -s SIGUSR2 "${WRAPPER_PID}"


<filename>scripts/create-yaml.sh
#!/usr/bin/env bash

SCRIPT_DIR=$(cd $(dirname "$0"); pwd -P)
MODULE_DIR=$(cd "${SCRIPT_DIR}/.."; pwd -P)

REGISTRY_URL="$1"
REGISTRY_NAMESPACE="$2"
DISPLAY_NAME="$3"
DEST_DIR="$4"

if [[ -z "${TMP_DIR}" ]]; then
  TMP_DIR=".tmp"
fi
mkdir -p "${TMP_DIR}"
mkdir -p "${DEST_DIR}"

kubectl create configmap registry-config \
  --from-literal=url="${REGISTRY_URL}" \
  --from-literal=namespace="${REGISTRY_NAMESPACE}" \
  --dry-run=client \
  -o yaml | \
kubectl label --local=true -f - --dry-run=client -o yaml \
  group=cloud-native-toolkit \
  grouping=garage-cloud-native-toolkit \
  console-link.cloud-native-toolkit.dev/enabled=true | \
kubectl annotate --local=true -f - --dry-run=client -o yaml \
  console-link.cloud-native-toolkit.dev/imageUrl="${IMAGE_URL}" \
  console-link.cloud-native-toolkit.dev/displayName="${DISPLAY_NAME}" > "${DEST_DIR}/registry-config.yaml"

find "${DEST_DIR}" -name "*"


#!/bin/bash
# Using SAC and SHEBA, plot the results of the test_splitwave program.

macrodir=~/Applications/sacmacros

./test_splitwave && {

	cat <<-END | sac
	setmacro $macrodir
	window 1 x 0 0.5 y 0.3 1
	bd x
	m sheba file wave_fdsplit nwind one pick no
	m sheba file wave_tdsplit nwind one pick no
	q
	END

	cleansheba

} || { echo "Problem running test_splitwave"; exit 1; }


<reponame>QMuhammad9009/CS232Work
#!/bin/bash
chmod 755 ./*.sh
./testit1.sh
./testit2.sh


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

echo $PATH |
sed -e 's/:/\n/g' |
parallel "find {} -maxdepth 1 -perm +111 -type f 2>/dev/null" |
parallel "basename {}"
sort | uniq
parallel "echo -n {},; man -w 1 {} 2>/dev/null 1>&2 && echo 1 || echo 0"


#!/usr/bin/env bash

set -ex

#build dynamic by default
build_type=$1
bc=`perl -e '$bt="'$build_type'"; if($bt=~/static/i) { print "megadepth_static"; } elsif($bt=~/statlib/i) { print "megadepth_statlib"; } else { print "megadepth_dynamic"; }'`

ln -fs CMakeLists.txt.ci CMakeLists.txt

#clear symlink main lib dirs
rm -rf zlib htslib libBigWig libdeflate build-release-temp

if [[ ! -s zlib_ci ]] ; then
    ./get_zlib.sh
    mv zlib zlib_ci
fi
ln -fs zlib_ci zlib

if [[ ! -s libdeflate_ci ]] ; then
    ./get_libdeflate.sh
    mv libdeflate libdeflate_ci
fi
ln -fs libdeflate_ci libdeflate

if [[ ! -s htslib_ci ]] ; then
    export CPPFLAGS="-I../libdeflate"
    export LDFLAGS="-L../libdeflate -ldeflate"
    ./get_htslib.sh linux
    export CPPFLAGS=
    export LDFLAGS=
    mv htslib htslib_ci
fi
ln -fs htslib_ci htslib

if [[ ! -s libBigWig_ci ]] ; then
    ./get_libBigWig.sh
    mv libBigWig libBigWig_ci
fi
ln -fs libBigWig_ci libBigWig

set -x

#compile a no-curl static version of libBigWig
if [[ $bc == 'megadepth_static' ]]; then
    pushd libBigWig
    make clean
    make -f Makefile.nocurl lib-static
    popd
fi

#compile a position indenpendent code static version of libBigWig
#but *with* curl calls present, to be resolved later in the
#dynamic linking of megadepth
if [[ $bc == 'megadepth_statlib' ]]; then
    pushd libBigWig
    make clean
    make -f Makefile.fpic lib-static
    popd
fi

#compile a the original, dynamic version of libBigWig
if [[ $bc == 'megadepth_dynamic' ]]; then
    pushd libBigWig
    make clean
    make -f Makefile.orig lib-shared
    popd
fi

export LD_LIBRARY_PATH=./htslib:./libBigWig:$LD_LIBRARY_PATH

DR=build-release-temp
mkdir -p ${DR}
pushd ${DR}
cmake -DCMAKE_BUILD_TYPE=Release ..
make ${bc}
popd
cp ${DR}/${bc} ./${bc}_ci
ln -fs ./${bc}_ci megadepth
./megadepth --version
rm -rf ${DR}

DR=build-debug-temp
mkdir -p ${DR}
pushd ${DR}
cmake -DCMAKE_BUILD_TYPE=Debug ..
make ${bc}
popd
cp ${DR}/${bc} ./${bc}_debug
ln -fs ./${bc}_debug megadepth_debug
./megadepth_debug --version
rm -rf ${DR}


<filename>scripts/build-docs.sh<gh_stars>0
#!/usr/bin/env bash
mvn -Pdocs asciidoctor:process-asciidoc


ddsp_run \
    --mode=train \
    --alsologtostderr \
    --gin_param="batch_size=8" \
    --gin_param="train_util.train.num_steps=12000" \
    --gin_param="train_util.train.steps_per_save=300" \
    --gin_param="train_util.train.steps_per_summary=100" \
    --gin_param="trainers.Trainer.checkpoints_to_keep=1" \
    --save_dir="$RESULTS_DIR/time_aggregation_base_average_mfcc" \
    --gin_file=/mnt/antares_raid/home/nielsrolf/ddsp/ddsp/training/gin/models2/experiments/time_aggregation/generated/time_aggregation_base_average_mfcc.gin

ddsp_run \
    --mode=train \
    --alsologtostderr \
    --gin_param="batch_size=8" \
    --gin_param="train_util.train.num_steps=12000" \
    --gin_param="train_util.train.steps_per_save=300" \
    --gin_param="train_util.train.steps_per_summary=100" \
    --gin_param="trainers.Trainer.checkpoints_to_keep=1" \
    --save_dir="$RESULTS_DIR/time_aggregation_base_groupwise_mfcc" \
    --gin_file=/mnt/antares_raid/home/nielsrolf/ddsp/ddsp/training/gin/models2/experiments/time_aggregation/generated/time_aggregation_base_groupwise_mfcc.gin

ddsp_run \
    --mode=train \
    --alsologtostderr \
    --gin_param="batch_size=8" \
    --gin_param="train_util.train.num_steps=12000" \
    --gin_param="train_util.train.steps_per_save=300" \
    --gin_param="train_util.train.steps_per_summary=100" \
    --gin_param="trainers.Trainer.checkpoints_to_keep=1" \
    --save_dir="$RESULTS_DIR/time_aggregation_base_confidence_mfcc" \
    --gin_file=/mnt/antares_raid/home/nielsrolf/ddsp/ddsp/training/gin/models2/experiments/time_aggregation/generated/time_aggregation_base_confidence_mfcc.gin

ddsp_run \
    --mode=train \
    --alsologtostderr \
    --gin_param="batch_size=8" \
    --gin_param="train_util.train.num_steps=12000" \
    --gin_param="train_util.train.steps_per_save=300" \
    --gin_param="train_util.train.steps_per_summary=100" \
    --gin_param="trainers.Trainer.checkpoints_to_keep=1" \
    --save_dir="$RESULTS_DIR/time_average_mfcc" \
    --gin_file=/mnt/antares_raid/home/nielsrolf/ddsp/ddsp/training/gin/models2/experiments/time_constant/time_average.gin


<reponame>sjain-stanford/route-fcn<gh_stars>10-100
#!/usr/bin/env bash
source .env/bin/activate

pip install numpy
pip install http://download.pytorch.org/whl/cu80/torch-0.1.12.post2-cp35-cp35m-linux_x86_64.whl
pip install torchvision
deactivate


#!/usr/bin/env bash

set -e
set -x
shopt -s dotglob

readonly name="libproj"
readonly ownership="Proj Upstream <<EMAIL>>"
readonly subtree="ThirdParty/$name/vtk$name"
readonly repo="https://gitlab.kitware.com/third-party/proj.git"
readonly tag="for/vtk-20220109-8.1.0"
readonly paths="
.gitattributes
ChangeLog
COPYING
CMakeLists.txt
README.md
README.kitware.md

cmake/ProjConfig.cmake
cmake/ProjTest.cmake
cmake/ProjUtilities.cmake
cmake/ProjVersion.cmake
cmake/proj_config.cmake.in

data/

include/CMakeLists.txt
include/proj/CMakeLists.txt
include/proj/*.hpp
include/proj/internal/*.hpp

src/CMakeLists.txt
src/lib_proj.cmake
src/projections/*.cpp
src/conversions/*.cpp
src/transformations/*.cpp
src/transformations/*.hpp
src/iso19111/*.cpp
src/iso19111/operation/*.cpp
src/iso19111/operation/*.hpp
src/*.c
src/*.h
src/*.cpp
src/*.hpp
src/vtk_libproj_mangle.h
"

extract_source () {
    git_archive
    pushd "$extractdir/$name-reduced"
    rm -rvf data/tests/
    rm data/Makefile.am
    popd
}

. "${BASH_SOURCE%/*}/../update-common.sh"


#!/bin/sh

set -e

mkdir -p "${PROJECT_DIR}/.tmp/"

# Make a copy of the Info.plist file in the .tmp folder
# This will be the Info.plist file manipulated with the version
# information that is generated below.

if [ -f "${PROJECT_DIR}/.tmp/Info.plist" ]; then
	rm -f "${PROJECT_DIR}/.tmp/Info.plist"
fi

if [ "${TEXTUAL_BUILD_SCHEME_TOKEN}" == "appstore" ]; then
	cp "${PROJECT_DIR}/Resources/Property Lists/Application Properties/InfoAppStore.plist" "${PROJECT_DIR}/.tmp/Info.plist"
else
	cp "${PROJECT_DIR}/Resources/Property Lists/Application Properties/Info.plist" "${PROJECT_DIR}/.tmp/Info.plist"
fi

# Make a copy of the appropriate entitlements file.
if [ -f "${CODE_SIGN_ENTITLEMENTS}" ]; then
	rm -f "${CODE_SIGN_ENTITLEMENTS}"
fi

if [ "${TEXTUAL_BUILD_SCHEME_TOKEN}" == "appstore" ]; then
	cp "${PROJECT_DIR}/Resources/Sandbox/Entitlements/TextualAppStore.entitlements" "${CODE_SIGN_ENTITLEMENTS}"
else
	if [[ "${GCC_PREPROCESSOR_DEFINITIONS}" == *"TEXTUAL_BUILT_INSIDE_SANDBOX=1"* ]]; then
		# While we are here, check to make sure that the user
		# performed the necessary configuration changes
		if [ "${TEXTUAL_BUNDLE_IDENTIFIER}" != "com.codeux.irc.textual5" ] || [ "${TEXTUAL_GROUP_CONTAINER_IDENTIFIER}" != "8482Q6EPL6.com.codeux.irc.textual" ]; then
			echo "Before changing TEXTUAL_BULIT_INSIDE_SANDBOX to 1, make the changes noted in the comments of the configuration file.";

			exit 1;
		fi

		cp "${PROJECT_DIR}/Resources/Sandbox/Entitlements/TextualWithSandbox.entitlements" "${CODE_SIGN_ENTITLEMENTS}"
	else
		cp "${PROJECT_DIR}/Resources/Sandbox/Entitlements/TextualWithoutSandbox.entitlements" "${CODE_SIGN_ENTITLEMENTS}"
	fi
fi

cd "${PROJECT_DIR}/.tmp/"

# Write the version information to the Info.plist file
# The build version is the date of the last commit in git
gitBundle=`which git`

if [ -z "${gitBundle}" ]; then
gitDateOfLastCommit="000000.00"
else
gitDateOfLastCommit=`"${gitBundle}" log -n1 --format="%at"`
fi

bundleVersion=`/bin/date -u -r "${gitDateOfLastCommit}" "+%y%m%d.%H"`

/usr/libexec/PlistBuddy -c "Set \"CFBundleVersion\" \"${bundleVersion}\"" Info.plist

# Gather the information necessary for building Textual's BuildConfig.h
# header. This header file gives various section of the code base version
# information so it does not need to constantly access the Info.plist file.
bundleVersionShort=$(/usr/libexec/PlistBuddy -c "Print \"CFBundleShortVersionString\"" Info.plist)

# ------ #

echo "/* ANY CHANGES TO THIS FILE WILL NOT BE SAVED AND WILL NOT BE COMMITTED */" > BuildConfig.h

echo "" >> BuildConfig.h

echo "#define TXBundleBuildProductName						@\"${PRODUCT_NAME}\"" >> BuildConfig.h
echo "#define TXBundleBuildProductIdentifier				@\"${PRODUCT_BUNDLE_IDENTIFIER}\"" >> BuildConfig.h
echo "#define TXBundleBuildProductIdentifierCString			\"${PRODUCT_BUNDLE_IDENTIFIER}\"" >> BuildConfig.h

echo "#define TXBundleBuildGroupContainerIdentifier			@\"${TEXTUAL_GROUP_CONTAINER_IDENTIFIER}\"" >> BuildConfig.h

echo "#define TXBundleBuildVersion							@\"${bundleVersion}\"" >> BuildConfig.h
echo "#define TXBundleBuildVersionShort						@\"${bundleVersionShort}\"" >> BuildConfig.h

echo "#define TXBundleBuildScheme							@\"${TEXTUAL_BUILD_SCHEME_TOKEN}\"" >> BuildConfig.h

echo "#define TXBundleBuildDate								@\"$(date +%s)\"" >> BuildConfig.h

if [ -z "$CODE_SIGN_IDENTITY" ]; then
echo "#define TXBundleBuiltWithoutCodeSigning				1" >> BuildConfig.h
fi


rm *.gz 2> /dev/null
rm delete_backups_older_than_x_days 2> /dev/null
rm config.sh 2> /dev/null


openssl req -config openssl.cnf \
      -key private/ca.key.pem \
      -new -x509 -days 7300 -sha256 -extensions v3_ca \
      -out certs/ca.cert.pem


export ANGIOTK_BINARY_DIR=$HOME/AngioTK/angiotk.build/bin/
export MY_CFG_DIR=$HOME/AngioTK/angiotk/Examples/MeshFromMRI/Base2_FOA42/artery/

$ANGIOTK_BINARY_DIR/meshing_surfacefromimage --config-file $MY_CFG_DIR/surfacefromimage.cfg  || exit 1

for CenterlineId in 1 2 3 4
do
$ANGIOTK_BINARY_DIR/meshing_centerlines --config-file $MY_CFG_DIR/centerlines.cfg \
    --input.pointpair.filename=\$cfgdir/data/pointpair$CenterlineId.data \
    --output.directory=angiotk/Base2/FOA42/artery/centerlines/part$CenterlineId
done

$ANGIOTK_BINARY_DIR/meshing_centerlinesmanager --config-file $MY_CFG_DIR/centerlinesmanager.cfg || exit 1
$ANGIOTK_BINARY_DIR/meshing_imagefromcenterlines --config-file $MY_CFG_DIR/imagefromcenterlines.cfg  || exit 1
$ANGIOTK_BINARY_DIR/meshing_surfacefromimage --config-file $MY_CFG_DIR/surfacefromimage2.cfg || exit 1
$ANGIOTK_BINARY_DIR/meshing_remeshstl --config-file $MY_CFG_DIR/remeshstlgmsh.cfg || exit 1

$ANGIOTK_BINARY_DIR/meshing_volumefromstlandcenterlines --config-file $MY_CFG_DIR/volumefromstlandcenterlines.cfg || exit 1


#!/bin/sh
# This file is a part of Julia. License is MIT: http://julialang.org/license

# script to prepare binaries and source tarballs for a Julia release
# aka "bucket dance" julianightlies -> julialang
set -e # stop on failure
cd "$(dirname "$0")"/.. # run in top-level directory

shashort=$(git rev-parse --short=10 HEAD)
tag=$(git tag --points-at $shashort)
if [ -z "$tag" ]; then
  echo "error: this script must be run with a tagged commit checked out" >&2
  exit 1
fi
version=$(cat VERSION)
majmin=$(cut -d. -f1-2 VERSION)
# remove -rc# if present
majminpatch=$(cut -d- -f1 VERSION)
if [ "$tag" != "v$version" ]; then
  echo "error: tagged commit does not match content of VERSION file" >&2
  exit 1
fi

# create full-source-dist and light-source-dist tarballs from a separate
# clone to ensure the directory name in them is julia-$version
git clone https://github.com/JuliaLang/julia -b $tag julia-$version
cd julia-$version
make full-source-dist
make light-source-dist
mv julia-${version}_$shashort-full.tar.gz ../julia-$version-full.tar.gz
mv julia-${version}_$shashort.tar.gz ../julia-$version.tar.gz
cd ..
rm -rf julia-$version

# download and rename binaries, with -latest copies
julianightlies="https://s3.amazonaws.com/julianightlies/bin"
curl -L -o julia-$version-linux-x86_64.tar.gz \
  $julianightlies/linux/x64/$majmin/julia-$majminpatch-$shashort-linux64.tar.gz
cp julia-$version-linux-x86_64.tar.gz julia-$majmin-latest-linux-x86_64.tar.gz
curl -L -o julia-$version-linux-i686.tar.gz \
  $julianightlies/linux/x86/$majmin/julia-$majminpatch-$shashort-linux32.tar.gz
cp julia-$version-linux-i686.tar.gz julia-$majmin-latest-linux-i686.tar.gz
curl -L -o julia-$version-linux-arm.tar.gz \
  $julianightlies/linux/arm/$majmin/julia-$majminpatch-$shashort-linuxarm.tar.gz
cp julia-$version-linux-arm.tar.gz julia-$majmin-latest-linux-arm.tar.gz
curl -L -o julia-$version-linux-ppc64le.tar.gz \
  $julianightlies/linux/ppc64le/$majmin/julia-$majminpatch-$shashort-linuxppc64.tar.gz
cp julia-$version-linux-ppc64le.tar.gz julia-$majmin-latest-linux-ppc64le.tar.gz
curl -L -o "julia-$version-osx10.7 .dmg" \
  $julianightlies/osx/x64/$majmin/julia-$majminpatch-$shashort-osx.dmg
cp "julia-$version-osx10.7 .dmg" "julia-$majmin-latest-osx10.7 .dmg"
curl -L -o julia-$version-win64.exe \
  $julianightlies/winnt/x64/$majmin/julia-$majminpatch-$shashort-win64.exe
cp julia-$version-win64.exe julia-$majmin-latest-win64.exe
curl -L -o julia-$version-win32.exe \
  $julianightlies/winnt/x86/$majmin/julia-$majminpatch-$shashort-win32.exe
cp julia-$version-win32.exe julia-$majmin-latest-win32.exe

echo "Note: if windows code signing is not working on the buildbots, then the"
echo "checksums need to be re-calculated after the binaries are manually signed!"

shasum -a 256 julia-$version* | grep -v -e sha256 -e md5 -e asc > julia-$version.sha256
md5sum julia-$version* | grep -v -e sha256 -e md5 -e asc > julia-$version.md5

gpg -u julia --armor --detach-sig julia-$version-full.tar.gz
gpg -u julia --armor --detach-sig julia-$version.tar.gz
gpg -u julia --armor --detach-sig julia-$version-linux-x86_64.tar.gz
gpg -u julia --armor --detach-sig julia-$version-linux-i686.tar.gz
gpg -u julia --armor --detach-sig julia-$version-linux-arm.tar.gz
gpg -u julia --armor --detach-sig julia-$version-linux-ppc64le.tar.gz

echo "All files prepared. Attach julia-$version.tar.gz and julia-$version-full.tar.gz"
echo "to github releases, upload all binaries and checksums to julialang S3. Be sure"
echo "to set all S3 uploads to publicly readable, and replace $majmin-latest binaries."
# TODO: also automate uploads via aws cli and github api?


<reponame>mlell/tapas
#!/bin/bash
# This bash script summarises the pipeline which is outlined in the
# manual

# Stop if an error occurs or a variable is unknown
set -ue

# Variables
# =========================================================================
#
# Folders
# -------
#
# The paths here currently assume that this script lies in the manual/
# folder of TAPAS and is executed there. You need to adapt the paths
# if you execute this script from another location.
#
# The manual/ folder of TAPAS.
tapasmanual="."
# The scripts/ folder of TAPAS.
tapas="scripts"
# Where the results of this script are saved
outputdir="tapas-example.out"
# Where the input data comes from
inputdir="${tapasmanual}/input"
# Where the TAPAS scripts are saved

# Input files
# ------------
#
# Names of the used genomes
g_names=("volpertinger" "retli")
# Paths to the used example genomes, without file extensions.
# The .fasta and .fai-file (samtools index) files for the genome
# must be present.
declare -A g_paths
# A heavily truncated cat genome.
g_paths[volpertinger]="${inputdir}/genome/volpertinger"
# A heavily truncated R. etli genome.
g_paths[retli]="${inputdir}/retli/retli_tr"

# Preparations
# =========================================================================
#
# Create the output folder
mkdir "$outputdir"

# Check if the paths are correct
if [ ! -f "${tapasmanual}/gen-html.sh" ]; then
    cat >&2 <<EOF
Error: Your working directory is outside the TAPAS manual folder.  Either
move into the TAPAS manual/ folder by using the cd command or adapt the
paths "tapas" and "tapasmanual" at the beginning of this file to point to
the TAPAS scripts folder and the TAPAS manual/ folder, respectively.
EOF
fi

# Generate artificial reads
# =========================================================================

# Generate 25 reads, with a minimum length of 20bp and length
# decay parameter of 5 (higher values lead to longer output reads).
# If you want reproducible results, you can use the --seed parameter.
for g in ${g_names[@]}; do
    echo $g
    "$tapas"/uniform "${g_paths[$g]}.fasta" \
        --name "${g}_" \
        --output "${outputdir}/${g}.coord" \
                 "${outputdir}/${g}.nucl" \
        25 20 5
done

# Introduce mutations into the reads
# ========================================================================
#
# Write a file which contains the parameters for point mutations.
cat >"${outputdir}/mut.tab" <<EOF
strand   from   to   factor  geom_prob  intercept
3p       C      T    0.3     0.4        0.1
5p       C      T    0.1     0.2        0.0
3p       *      *    0.0     0.1        0.12
EOF

# Subject the endogenous reads to mutations
# If you want reproducability, you can use the --seed parameter.
"${tapas}"/multiple_mutate  \
    "${outputdir}/mut.tab" \
  < "${outputdir}/volpertinger.nucl" \
  > "${outputdir}/volpertinger.mut.nucl"

# Merge the reads from the different genomes
# ========================================================================

# bash expands dir/{file1,file2} to dir/file1 dir/file2.
# {...} must be outside of "..." like below, else it will be taken as-is.
cat "${outputdir}"/{volpertinger.mut,retli}.nucl > "${outputdir}/all.nucl"
cat "${outputdir}"/{volpertinger,retli}.coord > "${outputdir}/all.coord"

# Create the FASTQ file of the synthetic reads
# ========================================================================
# The three arguments are the sources for (i) nucleotides (ii) quality
# strings, (iii) read names. Google "bash process substitution if you're
# not familiar with what "<(...)" means.
"${tapas}"/synth_fastq \
    "${outputdir}/all.nucl" \
    <(sed 's/./F/g' "${outputdir}/all.nucl") \
    <(awk '(NR>1){print $1}' "${outputdir}/all.coord") \
    > "${outputdir}/all.fastq"

# Set the parameters to test
# ========================================================================
#
# This code generates a table which contains the parameters for each
# mapping run to be performed. Later, the suitability of the chosen
# parameter values is judged based on the outcomes of these mapping runs.
# The <(...) parts generate the *.par files mentioned in the manual and
# input them into the cross_tab tool in one step. Exectute one of
# the contents of `printf ...`  by itself to see that it generates a file
# like shown in the manual (*.par). Finally, an index column called
# `runidx` is prepended to the result. This column is used for output file
# naming.

"${tapas}"/cross_tab --head 1 \
    <(printf "%s\n" k 2 10) \
    <(printf "%s\n" n 0 4 8) \
  | "${tapas}"/index_column --colname runidx \
    > "${outputdir}/partab"

# Set the needed steps perform a mapping
# ========================================================================
#
# Write a file which will be executed later for each parameter combination.
# It contains the mapper name and how to call it to perform the mapping.
# This design ensures TAPAS can be used with every mapper.
#
# The ${...} strings will be replaced by arguments to the short read mapper.
# Some are variable, in this case ${n} and ${k}. They are determined by the
# file `partab` from the previous step. Some are constant, like
# ${reference}, the path to the reference genome, or ${reads}, the path to
# the read FASTQ file. The values of these variables will be determined in
# the step following this step.
#
# Technical node: Here <<'EOF' must be used instead of <<EOF to ensure the
# ${...} strings are written into the map.sh output file unchanged.
# Alternatively, the contents below (between cat... and EOF, excluding)
# can also be saved manually into a file using a text editor.
cat > "${outputdir}/map.sh" << 'EOF'
#!/bin/bash

# Security measure: Stop if one of the needed parameter
# values is not present (wrong commands used by the user)
set -ue

# All error messages will be written here
exec 2> "${outputdir}/map-${runidx}.log"

bwa aln -n "${n}" -k "${k}" \
    "${reference}" \
    "${reads}" \
    > "${outputdir}/${runidx}.sai"

bwa samse \
      "${reference}" \
      "${outputdir}/${runidx}.sai" \
      "${reads}" \
      > "${outputdir}/${runidx}.sam"
EOF
chmod u+x "${outputdir}/map.sh" # make the script executable

# Perform the mapping runs
# ========================================================================
#
# table2calls uses the table of parameter combinations to generate
# programm calls to start the mapping via the script shown in the previous
# section. mcall then executes several of the calls in parallel, starting
# several mapping processes in parallel.
# All of the variables ${...} used in the script in the previous section
# must either be present in the file partab (generated in the section before
# the previous section) or be set to a constant value using the --const
# option.
"${tapas}"/table2calls  \
    --const reference "${g_paths[volpertinger]}" \
    --const reads "${outputdir}/all.fastq" \
    --const outputdir "${outputdir}" \
    "${outputdir}/partab" \
    "${outputdir}/map.sh" \
  | "${tapas}"/mcall -t 4 --status

# Define the analysis steps for a SAM file
# =========================================================================
# The following analysis steps need to be performed for each resulting
# SAM file. Therefore they are first defined in a function, and later
# called for every sam file
function analyseSAM(){
    sam="$1"
    # Get the SAM file name without the extension .sam: "4.sam" -> "4"
    p=${sam%.sam}

    # Convert SAM to text table
    "${tapas}"/sam2table "${sam}" > "${p}.tab"

    # Look up the true origin genomes and locations of the reads
    "${tapas}"/add_mapped_organisms \
        --endogenous volpertinger \
                     "${g_paths[volpertinger]}.fasta.fai" \
                     "${outputdir}/volpertinger.coord" \
        --exogenous  retli \
                     "${g_paths[retli]}/.fasta.fai" \
                     "${outputdir}/retli.coord" \
        "${p}.tab" \
        | "${tapas}"/write_later "${p}.tab"

    # Determine whether each read was correctly mapped
    "${tapas}"/pocketR '
        within(input, {
            correct =
                mapped_pos == true_start  &
                mapped_rname == true_record &
                mapped_organism == true_organism })
    '  "${p}.tab" \
    | "${tapas}"/write_later "${p}.tab"

    # Count reads per origin/target organism and mapping status
    "${tapas}"/pocketR '
        aggregate( cbind(count=qname) ~ true_organism + mapped_organism + correct,
            FUN=length, data=input) ' \
    "${p}.tab" \
    > "${p}.agg"

    # Plot mapping targets per origin organism
    "${tapas}"/plot_read_fate --exogenous retli \
                              --format png \
                              true_organism    mapped_organism \
                              correct          count \
                              "${p}-fate.png"  "${p}.agg"

    # Calculate sensitivity, specificity and balanced accuracy
    "${tapas}"/sensspec --c-morg mapped_organism \
                        --c-torg true_organism \
                        "${p}.agg" volpertinger \
        > "${p}.performance"

    echo "$sam done. -> Generated ${p}.{tab,agg,png,performance}"
}

# Execute the above steps for each generated sam file
for s in "${outputdir}"/*.sam; do
    analyseSAM "${s}"
done

echo "Done. The output files can be found in $(readlink -f "${outputdir}")."


echo Wpisz sciezke modulu:
read mod
echo Wpisz nazwe modułu:
read name
echo "#######################################"
echo Tworzę foldery...
sleep 2
##############################################
mkdir $mod/module/$name/
mkdir $mod/module/$name/config/
mkdir $mod/module/$name/src/
mkdir $mod/module/$name/view/
mkdir $mod/module/$name/src/Controller/
mkdir $mod/module/$name/src/Form/
mkdir $mod/module/$name/src/Model/
name2="${name,,}" #lowercase
mkdir $mod/module/$name/view/$name2/
mkdir $mod/module/$name/view/$name2/$name2
echo Foldery utworzone, tworzę Module.php...
sleep 2
echo "#######################################"
###############################################
#touch $mod/module/$name/src/Module.php
echo -e "<php?\nnamespace $name;\n\n
use Zend\ModuleManager\Feature\ConfigProviderInterface;\n\n
class Module implements ConfigProviderInterface\n
{\n
\tpublic function getConfig()\n
\t{\n
\t\treturn include __DIR__ . '/config/module.config.php';\n
\t}\n
}\n" >> $mod/module/$name/src/Module.php
###############################################
echo Module.php utworzony.
echo "#######################################"
echo "Wykonaj w pliku composer.json:
'autoload': {
    'psr-4': {
        'Application\\': 'module/Application/src/',
  ------->>\"$name\\\": \"module/$name/src/\"<<--------
    }
},"
echo Nacisnij enter jesli wykonałeś
read
echo "composer dump-autoload"
composer dump-autoload
sleep 2
echo "#######################################"
echo Tworzę module.config.php...
sleep 2
echo "<?php

namespace $name;

use Zend\ServiceManager\Factory\InvokableFactory;

return [
    'controllers' => [
        'factories' => [
            Controller\\${name}Controller::class => InvokableFactory::class,
        ],
    ],
    'view_manager' => [
        'template_path_stack' => [
            'album' => __DIR__ . '/../view',
        ],
    ],
];" >> $mod/module/$name/config/module.config.php
echo module.config.php utworzony.
echo "#######################################"
echo Dodaj nazwę swojego modułu do config/modules.config.php
echo "#######################################"


mvn install -N -DskipTests=true
mvn clean compile -DskipTests=true
mvn javadoc:jar source:jar package deploy -DskipTests=true


<filename>deploy.sh<gh_stars>10-100
git subtree push --prefix public/ origin gh-pages


#!/bin/bash

bundle exec jekyll clean
bundle exec jekyll serve --incremental


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

# Enable/disable xdebug
if [ "$USE_XDEBUG" = "yes" ]; then
    cp -n /usr/local/etc/php/xdebug.d/* /usr/local/etc/php/conf.d/
else
    find /usr/local/etc/php/conf.d -name '*xdebug*' -delete
fi