blob_id
stringlengths
40
40
language
stringclasses
1 value
repo_name
stringlengths
4
115
path
stringlengths
2
970
src_encoding
stringclasses
28 values
length_bytes
int64
31
5.38M
score
float64
2.52
5.28
int_score
int64
3
5
detected_licenses
listlengths
0
161
license_type
stringclasses
2 values
text
stringlengths
31
5.39M
download_success
bool
1 class
3b07b7e96d6154428f9e1534f8e4480a7808fb48
Shell
serverfarmer/sf-net-utils
/get-interface-ip.sh
UTF-8
217
3.3125
3
[ "MIT" ]
permissive
#!/bin/sh iface=$1 if [ "$iface" != "" ]; then ( if [ -x /sbin/ifconfig ]; then /sbin/ifconfig $interface |grep inet else /sbin/ip addr |grep $iface$ fi ) |egrep -o '([0-9]{1,3}\.){3}[0-9]{1,3}' |head -n1 fi
true
3949f3122418e161d6634d6c6b6ab1e1bcc1823e
Shell
crispd/cs-studio
/build/sync-diirt.sh
UTF-8
7,455
3.234375
3
[]
no_license
#!/bin/bash # sync_dir dir src_location dest_location # e.g. sync_dir util $HGDIR/src/main/java/org/epics ../core/plugins/org.epics.util/src/org/epics/ function sync_dir { find $2/$1 -type f -exec grep -qI '' {} ';' -exec perl -pi -e 's/\r\n/\n/g' {} '+' rsync -r --delete $2/$1 $3 git add $3/$1 } # Go into build directory BASEDIR=$(dirname $0) cd $BASEDIR HGDIR=diirt_tmp rm -rf $HGDIR hg clone http://hg.code.sf.net/p/epics-util/code $HGDIR echo Synching epics-util sync_dir util $HGDIR/src/main/java/org/epics ../core/plugins/org.epics.util/src/org/epics/ git commit --author="Gabriele Carcassi <gabriele.carcassi@gmail.com>" -m "org.epics.util: update to current SNAPSHOT" ../core/plugins/org.epics.util echo Done epics-util rm -rf $HGDIR hg clone http://hg.code.sf.net/p/graphene/code $HGDIR echo Synching graphene cp -R $HGDIR/graphene/src/main/resources/org $HGDIR/graphene/src/main/java sync_dir graphene $HGDIR/graphene/src/main/java/org/epics ../applications/plugins/org.epics.graphene/src/org/epics/ git commit --author="Gabriele Carcassi <gabriele.carcassi@gmail.com>" -m "org.epics.graphene: update to current SNAPSHOT" ../applications/plugins/org.epics.graphene echo Done graphene rm -rf $HGDIR echo pvmanager repo hg clone http://hg.code.sf.net/p/pvmanager/pvmanager $HGDIR echo Synching epics-vtype sync_dir vtype $HGDIR/epics-vtype/src/main/java/org/epics ../core/plugins/org.epics.vtype/src/org/epics/ git commit --author="Gabriele Carcassi <gabriele.carcassi@gmail.com>" -m "org.epics.vtype: update to current SNAPSHOT" ../core/plugins/org.epics.vtype echo Done epics-vtype echo Synching pvmanager-core sync_dir pvmanager $HGDIR/pvmanager-core/src/main/java/org/epics ../core/plugins/org.csstudio.utility.pvmanager/src/org/epics/ git commit --author="Gabriele Carcassi <gabriele.carcassi@gmail.com>" -m "o.c.u.pvmanager: update to current SNAPSHOT" ../core/plugins/org.csstudio.utility.pvmanager echo Done pvmanager-core echo Synching pvmanager-exec sync_dir pvmanager $HGDIR/pvmanager-exec/src/main/java/org/epics ../core/plugins/org.csstudio.utility.pvmanager.exec/src/org/epics/ sync_dir . $HGDIR/pvmanager-exec/src/main/javadoc/org/epics/pvmanager/exec/doc-files ../core/plugins/org.csstudio.utility.pvmanager.exec/html git commit --author="Gabriele Carcassi <gabriele.carcassi@gmail.com>" -m "o.c.u.pvmanager.exec: update to current SNAPSHOT" ../core/plugins/org.csstudio.utility.pvmanager.exec echo Done pvmanager-exec echo Synching pvmanager-file sync_dir pvmanager $HGDIR/pvmanager-file/src/main/java/org/epics ../core/plugins/org.csstudio.utility.pvmanager.file/src/org/epics/ sync_dir . $HGDIR/pvmanager-file/src/main/javadoc/org/epics/pvmanager/file/doc-files ../core/plugins/org.csstudio.utility.pvmanager.file/html git commit --author="Gabriele Carcassi <gabriele.carcassi@gmail.com>" -m "o.c.u.pvmanager.file: update to current SNAPSHOT" ../core/plugins/org.csstudio.utility.pvmanager.file echo Done pvmanager-file echo Synching pvmanager-extra cd $HGDIR/pvmanager-extra mvn install cd ../.. sync_dir pvmanager $HGDIR/pvmanager-extra/src/main/java/org/epics ../core/plugins/org.csstudio.utility.pvmanager.extra/src/org/epics/ # Copy generated antlr3 files (remove date) cp $HGDIR/pvmanager-extra/target/generated-sources/antlr3/Formula.tokens ../core/plugins/org.csstudio.utility.pvmanager.extra/src tail -n +2 $HGDIR/pvmanager-extra/target/generated-sources/antlr3/org/epics/pvmanager/formula/FormulaLexer.java > ../core/plugins/org.csstudio.utility.pvmanager.extra/src/org/epics/pvmanager/formula/FormulaLexer.java tail -n +2 $HGDIR/pvmanager-extra/target/generated-sources/antlr3/org/epics/pvmanager/formula/FormulaParser.java > ../core/plugins/org.csstudio.utility.pvmanager.extra/src/org/epics/pvmanager/formula/FormulaParser.java sync_dir . $HGDIR/pvmanager-extra/src/main/javadoc/org/epics/pvmanager/formula/doc-files ../core/plugins/org.csstudio.utility.pvmanager.extra/html git commit --author="Gabriele Carcassi <gabriele.carcassi@gmail.com>" -m "o.c.u.pvmanager.extra: update to current SNAPSHOT" ../core/plugins/org.csstudio.utility.pvmanager.extra echo Done pvmanager-extra echo Synching pvmanager-graphene sync_dir pvmanager $HGDIR/pvmanager-graphene/src/main/java/org/epics ../applications/plugins/org.csstudio.utility.pvmanager.graphene/src/org/epics/ git commit --author="Gabriele Carcassi <gabriele.carcassi@gmail.com>" -m "o.c.u.pvmanager.graphene: update to current SNAPSHOT" ../applications/plugins/org.csstudio.utility.pvmanager.graphene echo Done pvmanager-graphene echo Synching pvmanager-jca sync_dir pvmanager $HGDIR/pvmanager-jca/src/main/java/org/epics ../core/plugins/org.csstudio.utility.pvmanager.epics/src/org/epics/ sync_dir . $HGDIR/pvmanager-jca/src/main/javadoc/org/epics/pvmanager/jca/doc-files ../core/plugins/org.csstudio.utility.pvmanager.epics/html git commit --author="Gabriele Carcassi <gabriele.carcassi@gmail.com>" -m "o.c.u.pvmanager.jca: update to current SNAPSHOT" ../core/plugins/org.csstudio.utility.pvmanager.epics echo Done pvmanager-jca echo Synching pvmanager-jdbc sync_dir pvmanager $HGDIR/pvmanager-jdbc/src/main/java/org/epics ../core/plugins/org.csstudio.utility.pvmanager.jdbc/src/org/epics/ sync_dir . $HGDIR/pvmanager-jdbc/src/main/javadoc/org/epics/pvmanager/jdbc/doc-files ../core/plugins/org.csstudio.utility.pvmanager.jdbc/html git commit --author="Gabriele Carcassi <gabriele.carcassi@gmail.com>" -m "o.c.u.pvmanager.jdbc: update to current SNAPSHOT" ../core/plugins/org.csstudio.utility.pvmanager.jdbc echo Done pvmanager-jdbc echo Synching pvmanager-loc sync_dir pvmanager $HGDIR/pvmanager-loc/src/main/java/org/epics ../core/plugins/org.csstudio.utility.pvmanager.loc/src/org/epics/ sync_dir . $HGDIR/pvmanager-loc/src/main/javadoc/org/epics/pvmanager/loc/doc-files ../core/plugins/org.csstudio.utility.pvmanager.loc/html git commit --author="Gabriele Carcassi <gabriele.carcassi@gmail.com>" -m "o.c.u.pvmanager.loc: update to current SNAPSHOT" ../core/plugins/org.csstudio.utility.pvmanager.loc echo Done pvmanager-loc echo Synching pvmanager-pva sync_dir pvmanager $HGDIR/pvmanager-pva/src/main/java/org/epics ../core/plugins/org.csstudio.utility.pvmanager.pva/src/org/epics/ sync_dir . $HGDIR/pvmanager-pva/src/main/javadoc/org/epics/pvmanager/pva/doc-files ../core/plugins/org.csstudio.utility.pvmanager.pva/html git commit --author="Gabriele Carcassi <gabriele.carcassi@gmail.com>" -m "o.c.u.pvmanager.pva: update to current SNAPSHOT" ../core/plugins/org.csstudio.utility.pvmanager.pva echo Done pvmanager-pva echo Synching pvmanager-sim sync_dir pvmanager $HGDIR/pvmanager-sim/src/main/java/org/epics ../core/plugins/org.csstudio.utility.pvmanager.sim/src/org/epics/ sync_dir . $HGDIR/pvmanager-sim/src/main/javadoc/org/epics/pvmanager/sim/doc-files ../core/plugins/org.csstudio.utility.pvmanager.sim/html git commit --author="Gabriele Carcassi <gabriele.carcassi@gmail.com>" -m "o.c.u.pvmanager.sim: update to current SNAPSHOT" ../core/plugins/org.csstudio.utility.pvmanager.sim echo Done pvmanager-sim echo Synching pvmanager-sys sync_dir pvmanager $HGDIR/pvmanager-sys/src/main/java/org/epics ../core/plugins/org.csstudio.utility.pvmanager.sys/src/org/epics/ sync_dir . $HGDIR/pvmanager-sys/src/main/javadoc/org/epics/pvmanager/sys/doc-files ../core/plugins/org.csstudio.utility.pvmanager.sys/html git commit --author="Gabriele Carcassi <gabriele.carcassi@gmail.com>" -m "o.c.u.pvmanager.sys: update to current SNAPSHOT" ../core/plugins/org.csstudio.utility.pvmanager.sys echo Done pvmanager-sys echo Synching pvmanager-vtype sync_dir pvmanager $HGDIR/pvmanager-vtype/src/main/java/org/epics ../core/plugins/org.csstudio.utility.pvmanager.vtype/src/org/epics/ git commit --author="Gabriele Carcassi <gabriele.carcassi@gmail.com>" -m "o.c.u.pvmanager.vtype: update to current SNAPSHOT" ../core/plugins/org.csstudio.utility.pvmanager.vtype echo Done pvmanager-vtype rm -rf $HGDIR
true
470a6094bcc1097b8d2f7429b4da7f17d1dcebed
Shell
ik5/apex-up-aur
/PKGBUILD
UTF-8
987
3.0625
3
[]
no_license
# $Id$ # Maintainer: Ido Kanner <idokan@gmail.com> pkgname=apex-up _pkgname=up pkgdesc="Deploy infinitely scalable serverless apps, apis, and sites in seconds to AWS" pkgver=1.5.1 pkgrel=1 arch=('i686' 'x86_64') license=('MIT') url='https://up.docs.apex.sh/' provides=('apex-up') noextract=() makedepends=('binutils') [[ "$CARCH" == "i686" ]] && _arch="386" [[ "$CARCH" == "x86_64" ]] && _arch="amd64" _local_name="${_pkgname}_linux_${_arch}" source_i686=("${_pkgname}::https://github.com/apex/up/releases/download/v${pkgver}/${_pkgname}_${pkgver}_linux_386.tar.gz") source_x86_64=("${_pkgname}::https://github.com/apex/up/releases/download/v${pkgver}/${_pkgname}_${pkgver}_linux_amd64.tar.gz") sha256sums_i686=('8fa86a92c91221024256ab2a5e179327151ebde0b996af3cb07995c6e5084b55') sha256sums_x86_64=('5cd8ad34983a828163ae274a9b6cfdf4dd8c77d7a7ed2c8d49d1ef0dba3b75ca') prepare() { strip "${_pkgname}" } package() { mkdir -p "$pkgdir"/usr/bin install -Dm0755 "$_pkgname" "$pkgdir"/usr/bin }
true
fd4df1466107459b51c60438cfc3c04d6eddcf47
Shell
andres0sorio/LHCbWork
/ThreeAngles/lsf/output/analyseJobs.sh
UTF-8
278
3.453125
3
[]
no_license
#!/bin/bash if [ $# -lt 1 ] then echo "usage:: $0 <log file>" exit 1 fi INFILE=$1 LIM=`wc -l < $INFILE` var='1' while [ "$var" -le "$LIM" ] do LINE=`sed -e $var!d $INFILE` NJOB=`echo $LINE` dir=${NJOB%%res*out} echo $dir var=$(($var+1)) done
true
38fc786de9976dde7de6afea23336d42a3290239
Shell
keanlee/OpenStack-Deploy
/monitor-zabbix/zabbix-deploy/monitor-deploy-agent/install-zabbix-agent/script/common/serviceexist.sh
UTF-8
868
3.703125
4
[ "Apache-2.0" ]
permissive
#!/bin/sh #:*********************************************** #:Program: # check if service exists, 1~3 input parameters. # if service exists, will print 1, others will print 0 # case ($2= aaa, $3 = aa) is not handled. # $1 is service name #: #:Author: keanli #: #:History: 2017-06-20 #: #:Version: 1.0 #:*********************************************** if [ $# = 0 -o $# -gt 3 ]; then echo "wrong parameters number, it should be [1~3], \$1 should be service name " exit 0 fi let serviceExist=1 if [ 2 = $# ]; then serviceExist=`ps -ef | grep $2 | grep -v grep | grep -v $0 |wc -l` elif [ 3 = $# ]; then serviceExist=`ps -ef | grep $2 | grep $3 | grep -v grep | grep -v $0 |wc -l` fi if [ $serviceExist = 0 ]; then echo 0 exit 0 fi serviceExist=`systemctl status $1 | grep Active | grep -E "running|exited" | wc -l` echo $serviceExist exit 0
true
96a91b25510248b11f2d0a03ae4eaaaf6c0bd954
Shell
michaelaw320/ffmpeg-aws-dispatcher
/Scripts/MainEncodeScript.sh
UTF-8
1,183
3.65625
4
[ "MIT" ]
permissive
#!/bin/bash # Change to current script dir cd "$(dirname "$0")" PROJECT_PATH="$1" INPUT_PATH="$2" OUTPUT_PATH="$3" FFMPEG_PATH="$4" # Set variables according to parameter source "$PROJECT_PATH/EncoderConfiguration.txt" case $video_codec in "h264") ENCODER_SCRIPT="./H264Encoder.sh";; "h265") ENCODER_SCRIPT="./H265Encoder.sh";; *) ENCODER_SCRIPT="./NullHandler.sh";; esac # Pass the video options to Script for further processing if [ $video_codec == "h264" ] || [ $video_codec == "h265" ] then VIDEO_OPTION="-p $video_preset -c $video_crf -r $video_resize -w $video_resize_w -h $video_resize_h -z $video_resizer -d $video_deinterlace" fi # Audio parameters for ffmpeg directly configured here case $audio_codec in "flac") AUDIO_OPTION="flac -compression_level 12";; *) AUDIO_OPTION="copy";; esac # Execute encoding loop readarray inputs < "$PROJECT_PATH/InputFiles.txt" readarray outputs < "$PROJECT_PATH/OutputFiles.txt" for (( i=0; i<${#inputs[@]}; i++ )); do "$ENCODER_SCRIPT" -f "$FFMPEG_PATH" -i "$INPUT_PATH/$(echo ${inputs[$i]} | tr -d '\r\n')" -o "$OUTPUT_PATH/$(echo ${outputs[$i]} | tr -d '\r\n')" $VIDEO_OPTION -a "$AUDIO_OPTION" done
true
4dc2b9318a6a5edcf3264202c1bbca48da3df577
Shell
shayan-taheri/ansible-mesos
/roles/load-balancer/templates/haproxy_marathon.j2
UTF-8
1,753
3.859375
4
[]
no_license
#!/bin/bash # # Create haproxy config file from Marathon for given app id set -o errexit set -o nounset set -o pipefail readonly MARATHON_APP_ID='hatch-nginx' readonly MARATHON_APP_PORT_INDEX=1 readonly TMP_FILE=$(mktemp /tmp/XXXXXXXXXX) readonly CONFIG_FILE=/etc/haproxy/haproxy.cfg function header() { cat <<EOF global daemon maxconn 4096 log /dev/log local0 log /dev/log local1 notice chroot /var/lib/haproxy user haproxy group haproxy defaults mode http retries 3 timeout connect 5000ms timeout client 50000ms timeout server 50000ms log global option httplog option dontlognull errorfile 400 /etc/haproxy/errors/400.http errorfile 403 /etc/haproxy/errors/403.http errorfile 408 /etc/haproxy/errors/408.http errorfile 500 /etc/haproxy/errors/500.http errorfile 502 /etc/haproxy/errors/502.http errorfile 503 /etc/haproxy/errors/503.http errorfile 504 /etc/haproxy/errors/504.http frontend http-in bind *:80 default_backend servers backend servers EOF } function pipe_to() { sudo tee -a "$1" > /dev/null } function main() { local i=0 local servers # Write static file header header | pipe_to $TMP_FILE # Get servers from marathon servers=$({{ get_app_servers_script }} $MARATHON_APP_ID $MARATHON_APP_PORT_INDEX) # Write servers list for server in $servers; do echo " server server$i $server check" | pipe_to $TMP_FILE let ++i done # Copy config and reload service if configs are different if ! diff -q $TMP_FILE $CONFIG_FILE >/dev/null ; then sudo rm -f $CONFIG_FILE cat $TMP_FILE | pipe_to $CONFIG_FILE sudo service haproxy reload fi # Cleanup rm -f $TMP_FILE } main "$@"
true
7ffad6a45f3293c23c744cf1afff5ff81ee5eb10
Shell
khainb/JUMBOT
/partial_DA/run.sh
UTF-8
2,542
2.578125
3
[ "MIT" ]
permissive
#!/bin/bash -l # # Des paramètres sbatch peuvent être spécifiés dans ce fichier sous la forme : #SBATCH <param> # Les paramètres d'appels sont prioritaires # # > man sbatch # # Nom du job #SBATCH --job-name=PDA_OH_UOT_all # # Fichier de sortie d'exécution #SBATCH --output=results/OH_PDA_UOT_reproduced.log # # Autres paramètres utiles : # - réservation de gpus : --gres=gpu:[1-4] # - réservation de cpus : --cpus-per-task, -c [1-n] # - choix du type de GPU : --constraint titan|2080ti # - date/heure de démarrage : --begin, -b <date> (ex: 20200801, 20:00, now+2d ...) # - date/heure deadline : --deadline <date> # - positionnement du répertoire : --chdir, -d <dir> # - redirection d'entrée : --input, -i <file> # - nom du job : --job-name, -J <jobname> # - notifications mail : --mail-type=BEGIN,FAIL,END,TIME_LIMIT_80 # - spécification adresse mail : --mail-user=mailaddress # - redirections de sortie : --output, -o <file> --open-mode=append|truncate # - partition : --partition, -p shortrun|longrun # - durée maximale : --time, -t [HH:]MM # - vérification sans lancement : --test-only # # Valeurs par défaut : # # --gres=gpu:0 --cpus-per-task=1 --cpus-per-gpu=2 --partition=shortrun --time=30 # conda activate python37 setcuda 10.2 python run_JUMBOT.py --s 0 --t 1 --dset office_home --net ResNet50 --output reproduced_uot --gpu_id [0,1] python run_JUMBOT.py --s 0 --t 2 --dset office_home --net ResNet50 --output reproduced_uot --gpu_id [0,1] python run_JUMBOT.py --s 0 --t 3 --dset office_home --net ResNet50 --output reproduced_uot --gpu_id [0,1] python run_JUMBOT.py --s 1 --t 0 --dset office_home --net ResNet50 --output reproduced_uot --gpu_id [0,1] python run_JUMBOT.py --s 1 --t 2 --dset office_home --net ResNet50 --output reproduced_uot --gpu_id [0,1] python run_JUMBOT.py --s 1 --t 3 --dset office_home --net ResNet50 --output reproduced_uot --gpu_id [0,1] python run_JUMBOT.py --s 2 --t 0 --dset office_home --net ResNet50 --output reproduced_uot --gpu_id [0,1] python run_JUMBOT.py --s 2 --t 1 --dset office_home --net ResNet50 --output reproduced_uot --gpu_id [0,1] python run_JUMBOT.py --s 2 --t 3 --dset office_home --net ResNet50 --output reproduced_uot --gpu_id [0,1] python run_JUMBOT.py --s 3 --t 0 --dset office_home --net ResNet50 --output reproduced_uot --gpu_id [0,1] python run_JUMBOT.py --s 3 --t 1 --dset office_home --net ResNet50 --output reproduced_uot --gpu_id [0,1] python run_JUMBOT.py --s 3 --t 2 --dset office_home --net ResNet50 --output reproduced_uot --gpu_id [0,1]
true
9aefb09cfe2f95df8c7c23688207cb05de695692
Shell
sd/dotfiles
/zsh/oh-my-zsh-custom/sd-terminal.zsh
UTF-8
799
3.34375
3
[]
no_license
# Customization of the precmd and preexec functions provided by lib/termsupport.zsh DISABLE_AUTO_TITLE=true SD_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD SD_THEME_TERM_TITLE_IDLE="%n@%m: %~" # Runs before showing the prompt function sd_termsupport_precmd { emulate -L zsh title $(basename $PWD) $ZSH_THEME_TERM_TITLE_IDLE } # Runs before executing the command function sd_termsupport_preexec { emulate -L zsh setopt extended_glob # cmd name only, or if this is sudo or ssh, the next cmd local SHORT="$(basename $PWD) • ${1[(wr)^(*=*|sudo|ssh|mosh|rake|-*)]:gs/%/%%}" local LONG="$ZSH_THEME_TERM_TITLE_IDLE • ${1:gs/%/%%}" title '$SHORT' '%100>...>$LONG%<<' } precmd_functions+=(sd_termsupport_precmd) preexec_functions+=(sd_termsupport_preexec)
true
e466ec8ab4ac3011500a4981bc1dcb4205c8173c
Shell
0leksandr/bin
/utils/random_word.sh
UTF-8
895
3.171875
3
[]
no_license
#!/bin/bash dics_dir="/home/nezhraba/_/Parallango/dics" dic_file="${dics_dir}/ukr/ukr.txt" dir="$(dirname $0)" case $# in 0) while :; do # nr_lines="$(wc -l ${dic_file} |sed -r 's/^([0-9]+) .*$/\1/')" # line_nr=$(_rand $nr_lines) # line="$(sed "${line_nr}q;d" ${dic_file})" line="$(shuf -n 1 ${dic_file})" word="$(echo "${line}" |sed -r 's ^([^|]+)\|.*$ \1 ')" date-ft echo "$word" read input if [ ! "$input" ]; then break; fi clr done ;; 1) if [ "$1" = "?" ]; then echo "What words do I remeber?" read else nr_words=$1 while [ $nr_words -gt 0 ]; do nr_words=$(($nr_words - 1)) gnome-terminal -- $0 done fi ;; esac
true
3b22f18ef201c348477acf71c28bca30e8738b0c
Shell
Francesco149/docker-dots
/bashrc.sh
UTF-8
8,545
2.8125
3
[]
no_license
#!/bin/sh export VISUAL=vim export EDITOR=$VISUAL if [ -f ~/.term ]; then term=$(cat ~/.term) export TERMINAL="$term" else export TERMINAL=uxterm fi export GPG_TTY=$(tty) export GPG_AGENT_INFO=${HOME}/.gnupg/S.gpg-agent:0:1 source <(gopass completion bash) export BROWSER=url-open export TIMEZONE="Europe/Rome" export TZ="$TIMEZONE" if [ "$TERM" = rxvt ]; then export LC_ALL="en_US.ISO-8859-1" else export LC_ALL="en_US.UTF-8" fi export LANG="$LC_ALL" export LANGUAGE="$LANG" export GTK_IM_MODULE="fcitx" export QT_IM_MODULE="fcitx" export XMODIFIERS="@im=fcitx" if [ "$(hostname)" != "libguestfs" ]; then export TOS_FSWRP="ssh -p 2224 192.168.1.2" fi export ADB_HOST=adbd export PATH="$HOME/bin:$PATH" export PATH="$HOME/.local/bin:$PATH" export DOTNET_ROOT="$HOME/dotnet" export PATH="$HOME/dotnet:$PATH" export PATH="$HOME/.cargo/bin:$PATH" export PATH="$HOME/go/bin:$PATH" export QT_QPA_PLATFORMTHEME=qt5ct export QT_AUTO_SCREEN_SCALE_FACTOR=0 # temporary TODO make packages for these export PATH="$PATH:/home/loli/src/bdf2x/bin" export PATH="$PATH:/home/loli/src/tos-tools" export PATH="$PATH:/home/loli/.gem/ruby/2.6.0/bin" export PATH="$PATH:/home/loli/src/v" export PATH="/home/loli/.pyenv/bin:$PATH" export PATH="/home/loli/sw/dex-tools-2.1-SNAPSHOT:$PATH" if [ "$(id -u)" -ne 0 ] ; then eval "$(pyenv init -)" eval "$(pyenv virtualenv-init -)" fi if command -v aplay 2>&1 >/dev/null && aplay -l | grep -q PCH; then export ALSA_DEVICE="PCH" else export ALSA_DEVICE="Intel" fi for b in qutebrowser icecat firefox; do if command -v "$b" >/dev/null 2>&1; then export ACTUAL_BROWSER="$b" break fi done if [ -z $ACTUAL_BROWSER ] && command -v apulse >/dev/null 2>&1; then for b in icecat firefox; do if command -v "$b" >/dev/null 2>&1; then export ACTUAL_BROWSER="apulse $b" break fi done fi _tmuxinit() { if [ "$(whoami)" != "loli" ] || [ ! -f /.dockerenv ] ; then tmux attach || tmux return $? fi # shellcheck disable=SC2009 export DISPLAY=:9 ps -f -u "$USER" | grep -q '[x]pra' || xpra start :9 xpra attach :9 --opengl=no > /tmp/xpra-attach.log 2>&1 & if tmux attach; then xpra detach :9 return $? fi cd || return $? tmux new-session -d tmux rename-window grind tmux send-keys 'neomutt' C-m tmux split-window -h tmux send-keys 'hangups' C-m tmux new-window tmux rename-window char tmux send-keys 'weechat' C-m tmux new-window tmux rename-window code tmux send-keys 'cd ~/src' C-m tmux split-window -h tmux send-keys 'cd ~/src' C-m tmux select-pane -l tmux attach xpra detach :9 } # ------------------------------------------------------------------------- case $- in *i*) ;; *) return ;; esac stty stop undef stty start undef case "$0" in bash) # shellcheck disable=SC2039 shopt -s checkwinsize ;; esac export IMX_SDK_DIR=~/toolchains/fsl-imx-fb alias startx='exec startx' alias ls='ls --color=auto' alias t='_tmuxinit' alias xo='xdg-open' alias xi='sudo xbps-install' alias xu='sudo xbps-install -Suv' alias xr='sudo xbps-remove -R' alias xq='xbps-query -Rs' alias xl='xbps-query -l' alias xf='xlocate' alias pi='sudo pacman -S' alias pu='sudo pacman -Syuuu && sudo pacman -Fy' alias pr='sudo pacman -Rs' alias pq='pacman -Ss' alias pl='pacman -Qqe' alias pf='pacman -Fs' alias yi='yay -S' alias yu='yay -Syuuu && sudo yay -Fy' alias yr='yay -Rs' alias yq='yay -Ss' alias yl='yay -Qqe' alias yf='yay -Fs' alias e='echo $?' alias nonascii='grep --color=auto -P -n "[\x80-\xFF]"' alias nano='nano -liE -T2 --softwrap' alias rs='rsync --archive --verbose --recursive' alias xk='xkill -id $(xwininfo | grep id: | cut -d " " -f4)' if [ "$(id -u)" -eq 0 ] ; then PS1=''\ '\[\033[01;31m\]( OwO) '\ '\[\033[01;33m\]\u@\h '\ '\[\033[01;90m\]\w '\ '\$\[\033[00m\] '\ '' else PS1=''\ '\[\033[00m\]( uwu) '\ '\[\033[01;32m\]\u@\h '\ '\[\033[01;34m\]\w '\ '\$\[\033[00m\] '\ '' fi # generate an unique filename # # shellcheck disable=SC2120 autoname() { n=0 basedir="${1:-.}" suffix="${2:-}" while true; do name="$basedir/$( date "+%F_%H-%M-%S_${n}${suffix}" )" [ ! -e "$name" ] && break n=$(( n + 1 )) done echo "$name" } # print the nth most recently modified file(s) in the current # directory # # $ recent # newest_file # $ recent 1 3 4 # latest_file # 3rd_latest_file # 4th_latest_file # recent() { statcmd="gstat" if [ ! -v "$statcmd" ]; then statcmd="stat" fi unset sedexp for n in "${@}"; do sedexp="${sedexp}${n}p;" done find . -maxdepth 1 -exec $statcmd -c'%Z:%n' {} + | sort -r | cut -d':' -f2- | sed /^\.$/d | sed -n "${sedexp-1p;}" } ffrectsel() { rect="$(xrectsel)" # wxh+x+y size="$(echo "${rect}" | cut -d'+' -f1)" # wxh w="$(echo "${size}" | cut -d'x' -f1)" # w h="$(echo "${size}" | cut -d'x' -f2)" # h w=$((w / 2 * 2)) # round w h to multiples of 2 h=$((h / 2 * 2)) coords="$(echo "${rect}" | cut -d'+' -f2- | sed s/\+/,/g)" # x,y echo "|-s ${w}x${h} -i ${DISPLAY}+${coords}" | sed s/\|//g } export ffmpeg_input_params="-thread_queue_size 512" cast() { # shellcheck disable=SC2119 nice --adjustment=-20 \ ffmpeg \ -f x11grab $ffmpeg_input_params \ "${@}" \ -c:v libx264 -r "${CAST_FPS:-60}" \ -vf "${CAST_VF:-null}" \ -preset "${CAST_PRESET:-veryfast}" \ -tune "${CAST_TUNE:-zerolatency}" \ -pix_fmt "${CAST_PIXFMT:-yuv420p}" \ -crf "${CAST_CRF:-23}" \ -movflags "${CAST_MOVFLAGS:-+faststart}" \ "$(autoname).mp4" } ucast() { # shellcheck disable=SC2119 nice --adjustment=-20 \ ffmpeg \ -f x11grab $ffmpeg_input_params \ "${@}" \ -c:v libx264rgb -qp 0 -r 60 \ -preset "${CAST_PRESET:-ultrafast}" \ "$(autoname).mp4" } screenres() { xrandr 2>&1 | awk -F '[ +]' '/primary/ { print $4 }' } halfscreenres() { size=$(screenres) w=$(echo "$size" | awk -Fx '{ print $1 }') h=$(echo "$size" | awk -Fx '{ print $2 }') echo "$(( w / 2 )):$(( h / 2 ))" } screencoords() { xrandr 2>&1 | awk -F '[ +]' '/primary/ { printf "%s,%s\n",$5,$6 }' } alias fcast='CAST_VF="scale=$(halfscreenres):flags=neighbor" cast -s $(screenres) -i ${DISPLAY}+0,0' alias afcast='CAST_VF="scale=$(halfscreenres):flags=neighbor" cast -s $(screenres) -i ${DISPLAY}+0,0 -f alsa $ffmpeg_input_params -i dsnooper' alias lfcast='CAST_VF="scale=$(halfscreenres):flags=neighbor" cast -s $(screenres) -i ${DISPLAY}+0,0 -f alsa $ffmpeg_input_params -i loopout' alias frcast='cast -s $(screenres) -i ${DISPLAY}+$(screencoords)' alias frcast120='CAST_FPS=120 cast -s $(screenres) -i ${DISPLAY}+$(screencoords)' alias afrcast='cast -s $(screenres) -i ${DISPLAY}+$(screencoords) -f alsa $ffmpeg_input_params -i dsnooper ' alias lfrcast='cast -s $(screenres) -i ${DISPLAY}+$(screencoords) -f alsa $ffmpeg_input_params -i loopout ' alias afucast='ucast -s $(screenres) -i ${DISPLAY}+$(screencoords) -f alsa $ffmpeg_input_params -i dsnooper ' alias lfucast='ucast -s $(screenres) -i ${DISPLAY}+$(screencoords) -f alsa $ffmpeg_input_params -i loopout ' alias fucast='ucast -s $(screenres) -i ${DISPLAY}+$(screencoords)' alias scast='cast $(ffrectsel)' alias scast120='CAST_FPS=120 cast $(ffrectsel)' alias sucast='ucast $(ffrectsel)' alias psc='pscircle --output-width=1920 --output-height=1080 --tree-font-size=10 --tree-radius-increment=170,100 --toplists-font-size=10 --background-color=000000 --dot-radius=3 --link-width=1.5 --dot-border-width=0 --link-color-min=333333 --link-color-max=666666 --dot-color-min=AF5500 --dot-color-max=FFCC00 --cpulist-center=700:0' tgrep() { if [ "$#" -lt 1 ]; then echo "recursively grep directory and sort result by modification time" echo "usage: tgrep text [directory]" return 1 fi find "${2:-.}" -type f \ -exec grep -q "$1" {} \; \ -exec find {} -printf "%T@ " \; \ -exec grep -H "$1" {} \; | sort -n | awk '{ $1=""; print $0 }' } xls() { xbps-query -p install-date -s '' | awk '{ print $2,$3,$1 }' | sort } fbss() { dumpfile="$(autoname ~/pics/ss _fb.dump)" cp /dev/fb0 "$dumpfile" && fbgrab -w 1920 -h 1080 -b 32 -f "$dumpfile" "$(autoname ~/pics/ss _fb.png)" } sget() { useragent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.11.3 Chrome/65.0.3325.230 Safari/537.36" wget --user-agent "$useragent" "$@" } [ "$(tty)" = "/dev/tty1" ] && [ "$(whoami)" = "loli" ] && ! pgrep -x Xorg >/dev/null && exec startx #command -v fish 2>&1 >/dev/null && exec fish
true
cd4d2099fb9af92f9719b20df2e1150aa13e5c70
Shell
klown/MorphicLiteClientMac
/Morphic/Morphic/CreateDiskImage.sh
UTF-8
1,534
3.453125
3
[ "BSD-3-Clause" ]
permissive
#!/bin/sh # CreateDiskImage.sh # Morphic # # Created by Owen Shaw on 5/29/20. # Copyright © 2020 Raising the Floor. All rights reserved. echo "---- Running CreateDiskImage.sh -----" TEMPLATE_NAME="MorphicTemplate.dmg" MOUNT_PATH="MorphicInstaller" APP_NAME="${PRODUCT_NAME}.app" COMPRESSED_TEMPLATE_PATH="${SRCROOT}/Morphic/${TEMPLATE_NAME}.bz2" TEMP_FOLDER="Morphic.DiskImage.build" cd "${CONFIGURATION_TEMP_DIR}" rm -rf "${TEMP_FOLDER}" mkdir "${TEMP_FOLDER}" && echo "[dmg] Created folder ${CONFIGURATION_TEMP_DIR}/${TEMP_FOLDER}" || exit cd "${TEMP_FOLDER}" && echo "[dmg] Working in folder ${TEMP_FOLDER}" || exit bunzip2 -k "${COMPRESSED_TEMPLATE_PATH}" -c > "${TEMPLATE_NAME}" && echo "[dmg] unzipped ${TEMPLATE_NAME}" || exit hdiutil attach "${TEMPLATE_NAME}" -noautoopen -quiet -mountpoint "${MOUNT_PATH}" && echo "[dmg] mounted ${TEMPLATE_NAME} to ${MOUNT_PATH}" || exit ditto "${CONFIGURATION_BUILD_DIR}/${APP_NAME}" "${MOUNT_PATH}/${APP_NAME}" && echo "[dmg] copied ${APP_NAME} to ${MOUNT_PATH}" || exit hdiutil detach "${MOUNT_PATH}" -quiet -force && echo "[dmg] unmounted ${MOUNT_PATH}" || exit rm -f "${CONFIGURATION_BUILD_DIR}/${PRODUCT_NAME}.dmg" # This outputs to the Morphic root in the git repo structure, rather than DerivedData hdiutil convert "${TEMPLATE_NAME}" -quiet -format UDZO -imagekey -zlib-level=9 -o "${SRCROOT}/${PRODUCT_NAME}.dmg" && echo "[dmg] created ${SRCROOT}/${PRODUCT_NAME}.dmg" || exit cd .. rm -rf "${TEMP_FOLDER}" && echo "[dmg] cleaned up ${TEMP_FOLDER}" || exit echo "[dmg] done"
true
b5fed0949e1f19302f2486c3afdbc07edbf36e60
Shell
harjuo/jemma
/integration_test.sh
UTF-8
845
2.703125
3
[]
no_license
#!/bin/bash cargo build target/debug/jemma 5000& pid=$! get=$(curl -s http://localhost:5000/this/is/test) if [[ $get =~ "0" ]]; then echo "GET OK" else echo "GET not OK" kill "$pid" exit 1 fi curl -s -X POST http://localhost:5000/this/is/test if [[ $? -eq 0 ]]; then echo "POST OK" else echo "POST not OK" kill "$pid" exit 1 fi get=$(curl -s http://localhost:5000/this/is/test) if [[ $get =~ "1" ]]; then echo "GET OK" else echo "GET not OK" kill "$pid" exit 1 fi curl -s -X DELETE http://localhost:5000/this/is/test if [[ $? -eq 0 ]]; then echo "DELETE OK" else echo "DELETE not OK" kill "$pid" exit 1 fi get=$(curl -s http://localhost:5000/this/is/test) if [[ $get =~ "0" ]]; then echo "GET OK" else echo "GET not OK" kill "$pid" exit 1 fi kill "$pid"
true
e937eebb37be636c1845c2292cb7c059b5689075
Shell
iftikhar8/UK-tree-epidemic-simulator
/test_py/pde_test/2D_model/output_data/animate.sh
UTF-8
338
2.640625
3
[]
no_license
#!/bin/bash rate1=15 rate2=30 # convert .npy files to matplotlib generated .png's python3 animate.py # convert images to MP4 file ffmpeg -r $rate1 -start_number 0 -i frames_2_anim/img-%05d.png -c:v libx264 -r $rate2 -pix_fmt yuv420p sim-anim.mp4 # remove temp data # rm-rf frames_2_anim/img* # rm -rf test/ echo "animation complete"
true
a4229cf570d71c7176a730e95918abbcec49ab0d
Shell
MrRomo/SistemasEmbebidos
/primer seguimiento/clases/listas y estructuras/mrcompiler.sh
UTF-8
150
2.796875
3
[]
no_license
echo "MrRomo Compiler****" $1 file=$1 filec="${file//.c/ }" echo "compilando $file" mkdir output gcc -o output/$filec -lm $file ./output/$filec
true
c082a46405393de11a0d4b730badc5e5dffd931a
Shell
sneakyx/egroupwareserver_extended
/assets/docker-entrypoint.sh
UTF-8
2,719
3.75
4
[ "Apache-2.0" ]
permissive
#!/bin/bash set -e # this is a fork of docker-entrypoint.sh of jrenggli (see also visol/egroupware) # made by sneaky of Rothaar Systems (Andre Scholz) # V2019-02-04-17-40 # Replace {key} with value set_config() { key="$1" value="$2" php_escaped_value="$(php -r 'var_export($argv[1]);' "$value")" sed_escaped_value="$(echo "$php_escaped_value" | sed 's/[\/&]/\\&/g')" sed -ri "s/(['\"])?$key(['\"]).*/\'$key\' => $sed_escaped_value,/" /var/lib/egroupware/header.inc.php } # database configuration # if [ -z "$MYSQL_PORT_3306_TCP" ]; then echo >&2 'error: missing MYSQL_PORT_3306_TCP environment variable' echo >&2 ' Did you forget to --link some_mysql_container:mysql ?' exit 1 fi if [ -f /var/lib/egroupware/header.inc.php ] ; # if header file exists correct the tcp-port and tcp address # otherwise (first time startup) the data has to be add manually while installation # read the necessary data from file /home/egroupware/xxx/data/db-info.txt # xxx - is the directory you used for storing data then set_config 'db_host' "$MYSQL_PORT_3306_TCP_ADDR" set_config 'db_port' "$MYSQL_PORT_3306_TCP_PORT" # this is for setting the new base directory of egroupware! line_old="define('EGW_SERVER_ROOT','/var/www/html/egroupware');" line_new="define('EGW_SERVER_ROOT','/usr/share/egroupware');" sed -i "s%$line_old%$line_new%g" /var/lib/egroupware/header.inc.php fi # # data directories # mkdir -p /var/lib/egroupware/default/backup mkdir -p /var/lib/egroupware/default/files mkdir -p /var/lib/egroupware/default/rosine/templates chown -R www-data:www-data /var/lib/egroupware/default # create file with database infos echo 'db_host = ' $MYSQL_PORT_3306_TCP_ADDR > /var/lib/egroupware/config-now.txt echo 'db_port = ' $MYSQL_PORT_3306_TCP_PORT >> /var/lib/egroupware/config-now.txt echo 'www_dir = ' ${SUBFOLDER} >> /var/lib/egroupware/config-now.txt # delete origin header.inc from container and use your header.inc ln -sf /var/lib/egroupware/header.inc.php /usr/share/egroupware/header.inc.php if [ "${SUBFOLDER: -1}" == "/" ]; then # this is for leaving the last slash SUBFOLDER="${SUBFOLDER:0: -1}" fi if [ -z "$SUBFOLDER" ]; then # this is for the case that no subfolder is passed echo rmdir /var/www/html elif [ "${SUBFOLDER:0:1}" != "/" ]; then # this is for the case that the first slash is forgotten SUBFOLDER="/${SUBFOLDER}" fi if [ $1 != "update" ]; then # if container isn't restarted # soft links for the right templates rm -rf /usr/share/egroupware/rosine/templates/rosine ln -sf /var/lib/egroupware/default/rosine/templates /usr/share/egroupware/rosine/templates/rosine exec /bin/bash -c "source /etc/apache2/envvars && apache2 -DFOREGROUND" fi exit 0
true
fe096ad1a4858716913155c7e94f50013a962c42
Shell
rknizzle/faas
/v2/code-snippets/try-docker-calls-in-docker/run.sh
UTF-8
1,185
3.078125
3
[ "MIT" ]
permissive
#!/usr/bin/env bash # build the image docker build -t try-docker-calls-in-docker-image . # run without having access to the hosts docker daemon socket. we are expecting this container to # fail because it wont have access to a Docker daemon to run the docker pull command docker run --rm try-docker-calls-in-docker-image echo "" echo "" echo "##############################################" echo "##############################################" echo "This failed to pull the image because this container doesnt have access to a Docker daemon" echo "##############################################" echo "##############################################" echo "" docker run --rm -v /var/run/docker.sock:/var/run/docker.sock try-docker-calls-in-docker-image echo "" echo "##############################################" echo "##############################################" echo "This container should have successfully pulled the Docker image because it has access to the host machines Docker daemon" echo "##############################################" echo "##############################################" # cleanup the image docker rmi try-docker-calls-in-docker-image >/dev/null
true
7acf2fc481049f292e0cbc63ad12e7e9ff31f7f8
Shell
HazyResearch/mindbender
/dashboard/dashboard-ls-snapshots
UTF-8
490
3.25
3
[]
no_license
#!/usr/bin/env bash # dashboard-ls-snapshots -- List all snapshots in the DeepDive app # > dashboard-ls-snapshots # # Author: Jaeho Shin <netj@cs.stanford.edu> # Created: 2015-04-21 set -eu DEEPDIVE_APP=$(find-deepdive-app) export DEEPDIVE_APP cd "$DEEPDIVE_APP"/snapshot # we recognize as a snapshot when a directory under snapshot/ # contains a non-empty reports.json file find * -maxdepth 0 \ -type d \ -exec [ -s {}/reports.json ] \; \ -print | xargs stat -c '%Y %n' | sort -nr | cut -f2
true
60f938a9f1d90ca67880f25a4529de80f4843bb1
Shell
aafrecct/dotfiles
/Files/zshrc
UTF-8
1,304
2.625
3
[]
no_license
# History: HISTFILE=~/.histfile HISTSIZE=1000 SAVEHIST=1000 # Options: setopt autocd extendedglob PROMPTSUBST unsetopt beep nomatch notify # Keybindings: bindkey -e # Add local bin to path: PATH+=:$HOME/.local/bin # Add pure prompt to fpath: fpath+=$HOME/Dotfiles/Files/zshplugins/pure # Load modules: autoload -Uz compinit; compinit autoload -U promptinit; promptinit # Prompt: prompt pure # Plugins: ZSHPLUGDIR=$HOME/Dotfiles/Files/zshplugins source $ZSHPLUGDIR/zsh-history-substring-search/zsh-history-substring-search.plugin.zsh # Other: zstyle :compinstall filename '/home/bmcaos/.zshrc' # Aliases: alias :x="cd && clear" alias ls="ls --group-directories-first --color=auto" alias la="ls -lAh" alias cp="cp -i" alias rm="rm -I" alias vim="nvim" alias vi="nvim" alias clipboard="xclip -selection clipboard" alias sctl="systemctl" # Nim export PATH=/home/bmcaos/.nimble/bin:$PATH # @begin(40368552)@ - Do not edit these lines - added automatically! # You should customize CIAOPATH before this chunk if you place bundles in # places other than ~/.ciao export PATH=/home/bmcaos/.ciao/bin:$PATH if [ -x /home/bmcaos/.ciaoroot/v1.21.0-m1/build/bin/ciao-env ] ; then eval "$(/home/bmcaos/.ciaoroot/v1.21.0-m1/build/bin/ciao-env --sh)" fi # @end(40368552)@ - End of automatically added lines.
true
e620a07b2f9caabf1e272076ca857ef5a4b0c7a9
Shell
nkibbey/word2vecTemporal
/scripts/old/pubmedxmlToTextByYear.sh
UTF-8
2,012
3.4375
3
[ "MIT" ]
permissive
#!/usr/bin/env bash YEARSTART=1990 YEAREND=2000 curr_year=${YEARSTART} :<<NAH #takes 4 seconds per xml out to year while [ ${curr_year} -le ${YEAREND} ] #first iteration writes files do cat <<EOF | sh touch outs${curr_year}.txt xmlstarlet sel -t -v "//PubmedArticle[.//PubDate/Year=${curr_year}]//AbstractText" medline17n0001.xml > outs${curr_year}.txt EOF ((curr_year++)) done for curr_lib in {0875..0875} do curr_year=${YEARSTART} while [ ${curr_year} -le ${YEAREND} ] #later iterations append files do cat <<EOF | sh touch outs${curr_year}.txt xmlstarlet sel -t -v "//PubmedArticle[.//PubDate/Year=${curr_year}]//AbstractText" medline17n${curr_lib}.xml >> outs${curr_year}.txt EOF ((curr_year++)) done done NAH :<<NAH #takes 5 seconds per xml to out year while [ ${curr_year} -le ${YEAREND} ] #first iteration writes files do ab_file=outs${curr_year}.txt curr_file=medline17n0001.xml sed -n '/<PubDate>/,/<\/PubDate>/p; /<PubmedArticle>/p; /<\/PubmedArticle>/p; /<AbstractText>.*<\/AbstractText>/p' ${curr_file} | sed -n '/<Year>'${curr_year}'/,/<\/PubmedArticle>/p' | sed -n '/<AbstractText>.*<\/AbstractText>/p' | sed -e 's/<AbstractText>\(.*\)<\/AbstractText>/\1/' | tr '[:upper:]' '[:lower:]' | sed s/"'s"/" "/g > ${ab_file} echo ${curr_year} ((curr_year++)) done for curr_lib in {0002..0005} do curr_year=${YEARSTART} while [ ${curr_year} -le ${YEAREND} ] #later iterations append files do ab_file=outs${curr_year}.txt curr_file=medline17n0001.xml sed -n '/<PubDate>/,/<\/PubDate>/p; /<PubmedArticle>/p; /<\/PubmedArticle>/p; /<AbstractText>.*<\/AbstractText>/p' ${curr_file} > temp sed -n '/<Year>'${curr_year}'/,/<\/PubmedArticle>/p' temp > tmp sed -n '/<AbstractText>.*<\/AbstractText>/p' tmp > temp sed -e 's/<AbstractText>\(.*\)<\/AbstractText>/\1/' temp | tr '[:upper:]' '[:lower:]' | sed s/"'s"/" "/g > ${ab_file} ((curr_year++)) done done NAH
true
82fc7b9c20829b2192f6f8cc03075ad9da0552b2
Shell
angellovc/holberton-system_engineering-devops
/0x14-mysql/5-mysql_backup
UTF-8
193
2.71875
3
[]
no_license
#!/usr/bin/env bash #generates a MySQL dump and creates a compressed archive out of it mysqldump -uroot -p"$1" --all-databases > backup.sql date=$(date '+%Y-%m-%d') tar -zcvf "$date.tar.gz" ./
true
df07ef269685c0a564cafe0c5f676ae9949892e1
Shell
bagustris/VibrasticLab
/bash/bulkResample.sh
UTF-8
210
2.9375
3
[]
no_license
#!/bin/bash # resample 48k to 16k using sox # for 24 bit to 16, use: "-b 16"" if [ ! -d converted/ ]; then mkdir converted/ fi for i in ./*.wav;\ do sox -S "$i" -r 16000 "converted/${i%.wav}_16k.wav";\ done
true
67fca21d9799bf392d5c318461cda55307bf000d
Shell
suhail-sullad/Test-SSL-server-with-WolfSSL
/generate_certificate.sh
UTF-8
865
3.390625
3
[]
no_license
#!/bin/bash cert_folder="./test/"; host_count=1; rsa_bits="2048"; cert_days="81"; cert_out_file="someFileName"; cert_country="SomeCountry"; cert_state="SomeState"; cert_locality="SomeLocality"; cert_organization="SomeOrg"; cert_organization_unit="SomeOU"; cert_domain="example.org"; if [ -d $cert_folder ]; then echo "Certificates will be created in $cert_folder" else echo -e `mkdir $cert_folder` fi while [ $host_count -gt -1 ]; do echo -e `openssl req -new -newkey rsa:$rsa_bits -days $cert_days -nodes -x509 -subj "/C=$cert_country/ST=$cert_state/L=$cert_locality/O=$cert_organization/OU=$cert_organization_unit/CN=$cert_out_file$host_count.$cert_domain" -keyout $cert_folder$cert_out_file$host_count.pem -out $cert_folder$cert_out_file$host_count.pem` host_count=`expr $host_count - 1` done echo "All certificates are in place,Start WolfSSL Server now.."
true
2221a8c6e9b23b434aabf68980049b7f8cf5d105
Shell
gramer/shell-env
/macox/.bashrc
UTF-8
1,632
3.046875
3
[]
no_license
# .bashrc # System-wide .profile for sh(1) if [ -x /usr/libexec/path_helper ]; then eval `/usr/libexec/path_helper -s` fi if [ "${BASH-no}" != "no" ]; then [ -r /etc/bashrc ] && . /etc/bashrc fi ########################################################### # Colors & Theme ########################################################### # export TERM="xterm-color" # export CLICOLOR=1 # export LSCOLORS=GxFxCxDxBxegedabagaced ############################################################ ## User specific aliases and functions ############################################################ export BASE=/pang export PROGRAM_BASE=$BASE/program export SERVICE_BASE=$BASE/service export SCRIPTS_BASE=$BASE/scripts export CONF_BASE=$BASE/conf export LOGS_BASE=$BASE/logs export DATA_BASE=$BASE/data ########################################################### # Alias ########################################################### alias p='pwd' alias ..='cd ..' alias ...='cd ../..' alias ....='cd ../../..' alias .....='cd ../../../..' alias vi2='vi -O2 ' alias hc="history -c" alias ls='ls -G' alias l='ls -alF' alias ll='ls -l' alias la='ls -A' alias c='clear' alias sb="source ~/.bash_profile" alias grep='grep --color=auto' ########################################################### # Applicatino Optinos ########################################################### #vm option export MAVEN_OPTS='-Xmx512m -XX:MaxPermSize=128m' # Execute Shells # source /usr/local/Cellar/autojump/21.7.1/etc/autojump.sh FILES=`find $CONF_BASE/env/bash_* -maxdepth 1 -type f -exec echo {} \;` for FILE in $CONF_BASE/env/bash_* do source $FILE done
true
bc48d8cb444475688252ec1387388fcc7474b39c
Shell
mt3593/grafana-backup
/bin/backup.sh
UTF-8
1,956
4.03125
4
[]
no_license
#!/bin/bash set -eo pipefail MISSING_ENV_VARS=false has_env() { local env_name="$1" local value=$(eval "echo \"\$$env_name\"") if [ -z "$value" ]; then echo "Missing environment variable: $env_name" MISSING_ENV_VARS=true fi } has_env "GIT_NAME" has_env "GIT_EMAIL" ## The following are used to construct the url has_env "GIT_REPO_USERNAME" has_env "GIT_REPO" has_env "GRAFANA_URL" has_env "GRAFANA_USERNAME" has_env "GRAFANA_PASSWORD" set -u if [ $MISSING_ENV_VARS = true ]; then echo "Failing due to missing environment variables" exit 1 fi ## Check we have at least one of the auth methods TOKEN=false SSH_PATH="/root/.ssh/id_rsa" if [ -f "$SSH_PATH" ]; then chown root:root /root/.ssh touch /root/.ssh/known_hosts ssh-keyscan -t rsa github.com >> /root/.ssh/known_hosts GIT_URL_WITH_AUTH="git@github.com:${GIT_REPO_USERNAME}/${GIT_REPO}.git" else $(has_env "GIT_TOKEN_USERNAME") $(has_env "GIT_TOKEN") if [ $MISSING_ENV_VARS = true ]; then echo "Missing GIT_TOKEN and GIT_TOKEN_USERNAME or missing ~/.ssh/id_rsa file for auth." exit 1 else GIT_URL_WITH_AUTH="https://${GIT_TOKEN_USERNAME}:${GIT_TOKEN}@github.com/${GIT_REPO_USERNAME}/${GIT_REPO}.git" fi fi echo "Pulling down repo" git config --global user.name "$GIT_NAME" git config --global user.email "$GIT_EMAIL" cd /tmp git clone "$GIT_URL_WITH_AUTH" cd "$GIT_REPO" echo "Setting up wizzy" ## Ensure we don't save the wizzy config grep -qxF '/conf' .gitignore || echo '/conf' >> .gitignore wizzy init wizzy set grafana url "$GRAFANA_URL" wizzy set grafana username "$GRAFANA_USERNAME" wizzy set grafana password "$GRAFANA_PASSWORD" echo "Getting current setup" wizzy import dashboards wizzy import datasources ## Now add to git and push back up to the repo git add . if git diff-index --quiet HEAD -- then echo "Nothing to commit" else echo "Commiting new setup" git commit -m "Backup" git push origin master fi echo "Backed up"
true
966cea7cb9262cbe1ff80f76ac1647a1f673bc91
Shell
ioppermann/munin-contrib
/plugins/cacti/cacti-host
UTF-8
861
3.546875
4
[]
no_license
#!/bin/bash # # Munin script to obtain the number o hosts # by kasandrapadisha@gmail.com # #----- Configuration variables database="cacti" hostname="localhost" user="admincacti" password="passwdcacti" #----- Configuration variables if [[ $1 != "" ]]; then if [[ $1 == "autoconf" ]]; then echo "yes" exit 0 fi if [[ $1 == "config" ]]; then echo "graph_title Servidores consultados" echo "graph_vlabel Numero servidores (s)" echo "poller_hosts.label hosts(s)" echo 'graph_category munin' exit 0 fi fi salida=`mysql -B -e "SELECT value FROM settings WHERE name='stats_poller' LIMIT 1" -h $hostname --user=$user --password=$password $database` if [[ $? != 0 ]]; then echo "No se pudo ejecutar" exit 0 fi echo $salida | cut -f 6 -d":" | awk '{print"poller_hosts.value "$1}'
true
2e1753f36fa40de526a753577d03a93f5f1e6c30
Shell
h2gglobe/UserCode
/h2gglobe/Macros/jackknife/getNevents.sh
UTF-8
470
3.078125
3
[]
no_license
#!/bin/bash dir1=$1 && shift dir2=$1 && shift npart=321 [[ -n $1 ]] && npart=$1 && shift echo -n "-1," awk '/Number of events in the tree/ { printf "%d," ,$7 }' $dir1/split.log awk '/Number of events in the tree/ { print $7 }' $dir2/split.log for part in $(seq 0 $npart); do echo -n $part"," grep "partition $part\$" -A 11 $dir1/split.log | awk '/Tot/ { printf "%d," ,$3 }' grep "partition $part\$" -A 11 $dir2/split.log | awk '/Tot/ { print $3 }' done
true
0870870dba2ff3c7138c44784b5fb8980803baef
Shell
kurogane13/Vagrant_VM_Deployer
/vm_name.sh
UTF-8
1,116
3.234375
3
[]
no_license
echo "###########################################" echo "VAGRANT NAME PROVISIONING SCRIPT" echo "###########################################" echo "Enter a name for your Vagrant VM, and press" echo "enter..." read my_vmname echo "-------------------------------------------" echo "YOU ENTERED: $my_vmname" echo "-------------------------------------------" echo "PRESS ENTER TO CONFIRM NOW, OR CTRL+C TO ABORT..." read #Enable Vm provider parameters sed -i 's/#vmprovider/ /g' Vagrantfile #VMName sed -i 's/#vmname/ /g' Vagrantfile sed -i '/$my_vmname/a\'"v.name = '${my_vmname}'#vmname" Vagrantfile #comment line sed -i 's/.*my_vmname/#&/' Vagrantfile #delete line sed -i '/my_vmname/d' Vagrantfile #Insert space, or indent 4 blocks forward sed -i -e 's/v.name/ v.name/' Vagrantfile #Provider end sed -i 's/#provisionend/ /g' Vagrantfile echo "-------------------------------------------" echo "SHOWING VM Name line instanced in Vagranfile: " cat Vagrantfile | grep v.name echo "-------------------------------------------" echo "SCRIPT TERMINATED, PRESS ENTER TO CLOSE THE" echo "SESSION NOW..." read
true
b0ba7977025f8bc04a3208e2e7c1217cc07153ba
Shell
boyddensmore/linuxscripts_Public
/scriptupdate.sh
UTF-8
6,526
3.953125
4
[]
no_license
#!/bin/bash HOSTNAME=$(hostname) EXITFLAG=0 REPONAME=$1 if [ -z "$1" ] ; then REPONAME="linuxscripts" else REPONAME="$1" fi echo "LinuxScript Update Script" while [ $EXITFLAG -eq 0 ] ; do echo -e "\n\nRunning on repository $REPONAME" echo -e "What would you like to do? " echo -e "1. Update from GitHub" echo -e "2. Check Statuses" echo -e "3. Change Repository" echo -e "q. Quit" read -p ": " ANSWER case $ANSWER in 1 ) echo -e "\nRunning on repository $REPONAME" echo -e "Update from GitHub" echo -e " 1. Update PiCam" echo -e " 2. Update PiCore" echo -e " 3. Update PiZero" echo -e " 4. Update Altruist" echo -e " 5. Update All" echo -e " q. Back" read -p ": " ANSWER case $ANSWER in 1 ) echo -e "\n ---------- Updating PiCam... ----------\n" if [ "$HOSTNAME" == "picam" ] ; then git -C /home/pi/"$REPONAME"/ pull else ssh pi@picam git -C /home/pi/"$REPONAME"/ pull fi ;; 2 ) echo -e "\n ---------- Updating PiCore... ----------\n" if [ "$HOSTNAME" == "picore" ] ; then git -C /home/pi/"$REPONAME"/ pull else ssh pi@picore git -C /home/pi/"$REPONAME"/ pull fi ;; 3 ) echo -e "\n ---------- Updating Pi Zero... ----------\n" if [ "$HOSTNAME" == "pizero" ] ; then git -C /home/pi/"$REPONAME"/ pull else ssh pi@pizero git -C /home/pi/"$REPONAME"/ pull fi ;; 4 ) echo -e "\n ---------- Updating Altruist... ----------\n" if [ "$HOSTNAME" == "altruist" ] ; then git -C /home/boyd/"$REPONAME"/ pull else ssh boyd@altruist git -C /home/boyd/"$REPONAME"/ pull fi ;; 5 ) echo "Updating All..." echo -e "\n ---------- Updating PiCam... ----------\n" if [ "$HOSTNAME" == "picam" ] ; then git -C /home/pi/"$REPONAME"/ pull else ssh pi@picam git -C /home/pi/"$REPONAME"/ pull fi echo -e "\n ---------- Updating PiCore... ----------\n" if [ "$HOSTNAME" == "picore" ] ; then git -C /home/pi/"$REPONAME"/ pull else ssh pi@picore git -C /home/pi/"$REPONAME"/ pull fi echo -e "\n ---------- Updating PiZero... ----------\n" if [ "$HOSTNAME" == "pizero" ] ; then git -C /home/pi/"$REPONAME"/ pull else ssh pi@pizero git -C /home/pi/"$REPONAME"/ pull fi echo -e "\n ---------- Updating Altruist... ----------\n" if [ "$HOSTNAME" == "altruist" ] ; then git -C /home/boyd/"$REPONAME"/ pull else ssh boyd@altruist git -C /home/boyd/"$REPONAME"/ pull fi ;; q ) ;; BREAK ) ;; * ) echo "Invalid choice" ;; esac ;; 2 ) echo -e "\nRunning on repository $REPONAME" echo -e "Check Statuses" echo -e " 1. Check PiCam" echo -e " 2. Check PiCore" echo -e " 3. Check PiZero" echo -e " 4. Check Altruist" echo -e " 5. Check All" echo -e " q. Back" read -p ": " ANSWER case $ANSWER in 1 ) echo "Host Status" echo -e "\n ---------- PiCam... ----------\n" if [ "$HOSTNAME" == "picam" ] ; then git -C /home/pi/"$REPONAME"/ remote update && git -C /home/pi/"$REPONAME"/ status -uno else ssh pi@picam "git -C /home/pi/$REPONAME/ remote update && git -C /home/pi/$REPONAME/ status -uno" fi ;; 2 ) echo "Host Status" echo -e "\n ---------- PiCore... ----------\n" if [ "$HOSTNAME" == "picore" ] ; then git -C /home/pi/"$REPONAME"/ remote update && git -C /home/pi/"$REPONAME"/ status -uno else ssh pi@picore "git -C /home/pi/$REPONAME/ remote update && git -C /home/pi/$REPONAME/ status -uno" fi ;; 3 ) echo "Host Status" echo -e "\n ---------- PiZero... ----------\n" if [ "$HOSTNAME" == "pizero" ] ; then git -C /home/pi/"$REPONAME"/ remote update && git -C /home/pi/"$REPONAME"/ status -uno else ssh pi@zero "git -C /home/pi/$REPONAME/ remote update && git -C /home/pi/$REPONAME/ status -uno" fi ;; 4 ) echo "Host Status" echo -e "\n ---------- Altruist... ----------\n" if [ "$HOSTNAME" == "altruist" ] ; then git -C /home/boyd/"$REPONAME"/ remote update && git -C /home/boyd/"$REPONAME"/ status -uno else ssh boyd@altruist "git -C /home/boyd/$REPONAME/ remote update && git -C /home/boyd/$REPONAME/ status -uno" fi ;; 5 ) echo "Host Statuses" echo -e "\n ---------- PiCam... ----------\n" if [ "$HOSTNAME" == "picam" ] ; then git -C /home/pi/"$REPONAME"/ remote update && git -C /home/pi/"$REPONAME"/ status -uno else ssh pi@picam "git -C /home/pi/$REPONAME/ remote update && git -C /home/pi/$REPONAME/ status -uno" fi echo -e "\n ---------- PiCore... ----------\n" if [ "$HOSTNAME" == "picore" ] ; then git -C /home/pi/"$REPONAME"/ remote update && git -C /home/pi/"$REPONAME"/ status -uno else ssh pi@picore "git -C /home/pi/$REPONAME/ remote update && git -C /home/pi/$REPONAME/ status -uno" fi echo -e "\n ---------- PiZero... ----------\n" if [ "$HOSTNAME" == "pizero" ] ; then git -C /home/pi/"$REPONAME"/ remote update && git -C /home/pi/"$REPONAME"/ status -uno else ssh pi@pizero "git -C /home/pi/$REPONAME/ remote update && git -C /home/pi/$REPONAME/ status -uno" fi echo -e "\n ---------- Altruist... ----------\n" if [ "$HOSTNAME" == "altruist" ] ; then git -C /home/boyd/"$REPONAME"/ remote update && git -C /home/boyd/"$REPONAME"/ status -uno else ssh boyd@altruist "git -C /home/boyd/$REPONAME/ remote update && git -C /home/boyd/$REPONAME/ status -uno" fi ;; q ) ;; BREAK ) ;; * ) echo "Invalid choice" ;; esac ;; 3 ) echo -e "\n\nSwitching Repository " REPOS="$(find ~/ -maxdepth 5 -name .git | grep -v brew | wc -l)" find ~/ -maxdepth 5 -name .git | awk '{print gensub(/\/[a-z]+\/[a-z]+\//, "", "")}' | awk '{print NR ": " gensub(/\/.git/, "", "")}' read -p "Which repository would you like to switch to? " ANSWER if [ $ANSWER -le $REPOS ] ; then REPONAME="$(find ~/ -maxdepth 5 -name .git | awk '{print gensub(/\/[a-z]+\/[a-z]+\//, "", "")}' | awk -v rownum=$ANSWER '{if (NR==rownum) print gensub(/\/.git/, "", "")}')" echo "New repository: $REPONAME" else echo "Invalid Choice" fi ;; q ) echo "Ok, quitting" EXITFLAG=1 ;; * ) echo "Invalid choice" ANSWER="BREAK" ;; esac done
true
50af1418a2031b73389ec7e0bab2651fbd1c04f1
Shell
ipleiria-robotics/adv_robotics
/scripts/install_ROS.sh
UTF-8
2,077
2.984375
3
[]
no_license
#!/bin/sh echo "Installing ROS 2 Humble Hawksbill on Ubuntu $(lsb_release -sc)" ## This script must run using sudo ## Most information came from https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html # Check if this script is being run as root if [ `whoami` != "root" ] then echo "This script must be ran as root. Use: sudo ./install_ROS.sh" exit 1 fi apt -y install software-properties-common add-apt-repository universe # Add ROS2 keys apt update && sudo apt -y install curl curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg # Add the ROS2 sources to apt echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null # Update the APT sources and do any upgrades apt update apt -y upgrade # Perform ROS2 desktop installation # In systems with low memory, installing everything simultaneously can lead to #problems. To prevent this, we should first install texlive, then proceed with ROS. apt -y install ros-humble-desktop ros-humble-plotjuggler-ros ros-humble-nav2-map-server ros-humble-nav2-lifecycle-manager ros-humble-nav2-bringup ros-humble-ament-cmake-nose # Install additional ros packages apt -y install ros-humble-py-trees-ros ros-humble-py-trees-ros-interfaces ros-humble-rqt-tf-tree ##apt -y install ros-melodic-hector-sensors-description ros-melodic-hector-models ros-melodic-ros-control ros-melodic-effort-controllers ros-melodic-joint-state-controller ros-melodic-gazebo-ros-control ros-melodic-gazebo-ros-pkgs ##apt -y install ros-melodic-pcl-conversions ros-melodic-pcl-ros ros-melodic-laser-filters ##apt -y install python-rosinstall python-rosinstall-generator python-wstool build-essential # Relevant ROS-related packages apt -y install python3-colcon-common-extensions python3-catkin-pkg-modules python3-rospkg-modules python3-rosdep apt -y install ros-dev-tools rosdep init
true
390610d691b98a44b908ce7739beb7b5f6e95e22
Shell
ebanx/woocommerce-gateway-ebanx
/tests/bin/test.sh
UTF-8
612
3.0625
3
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
#!/bin/bash [[ $TRAVIS_COMMIT_MESSAGE =~ ^(\[tests skip\]) ]] && echo "TESTS SKIP" && exit 0; setup_test() { echo setup_test cd $TRAVIS_BUILD_DIR/tests npm ci } run_tests() { echo run_tests setup_test cd $TRAVIS_BUILD_DIR/tests npx cypress run --config video=false --project ./woocommerce -s woocommerce/cypress/integration/shop/$TEST_COUNTRY.js } setup_docker() { echo setup_docker sudo service mysql stop cd $TRAVIS_BUILD_DIR docker-compose up -d } # setup_docker # # while ! curl -s http://localhost > /dev/null; do echo waiting for woocommerce-container; sleep 10; done; run_tests
true
c66b4d68060f9f12ea156c77aae3342cf01a5f0a
Shell
t-wissmann/dotfiles
/config/herbstluftwm/x1-docking-station.sh
UTF-8
1,475
3.40625
3
[]
no_license
#!/usr/bin/env bash ::() { echo -e "\e[1;33m:: \e[0;32m$*\e[0m" >&2 "$@" } # docking_station='043e:9a39 LG Electronics USA, Inc. USB Controls' docking_station='17ef:30ad Lenovo USB3.1 Hub' if :: lsusb |grep "$docking_station" > /dev/null ; then # get last word of last line output=$(xrandr | grep -v primary | grep -E ' connected|disconnected 3840x2160'| cut -d' ' -f1) if [ -z "$output" ] ; then echo "Error: no output found!" >&2 xrandr exit 1 else echo "Output detected: $output" fi :: xrandr --output eDP1 --auto --pos 0x0 --primary \ --output "$output" --off sleep 1 # variable will be used without quotes: laptop_resolution='--auto' laptop_resolution='--mode 1920x1200' :: xrandr --output eDP1 $laptop_resolution --pos 0x0 --primary \ --output "$output" --pos 0x0 --auto resolution=$(xrandr --listmonitors | grep "$output" | sed 's,/[0-9]\+,,g' | grep -oE '[0-9]+x[0-9]+\+0\+0' | tail -n 1) :: herbstclient set_monitors "$resolution" :: herbstclient reload #:: ~/.config/alacritty/set-font.sh monospace else for output in $(xrandr --listmonitors|grep -oE ': \+[^ *]+'|sed 's,^: +,,') ; do if [[ "$output" != "eDP1" ]] ; then :: xrandr --output "$output" --off fi done :: xrandr --output eDP1 --auto herbstclient detect_monitors herbstclient reload #:: ~/.config/alacritty/set-font.sh default fi
true
262b71d7b2a1f2075f98d95b4d56e1f16fb6089a
Shell
shubham2704/serverlizedToShow
/Backend/BackendController/bash_script/virtual_env_create_ubuntu_18_x64.sh
UTF-8
446
3.203125
3
[]
no_license
#!/bin/bash PYV=$1 VIR_EN=$2 ACTION=$3 if [ "$ACTION" == "CREATE" ] then CONFIGURE_OPTS=--enable-shared /root/.pyenv/bin/pyenv install $PYV /root/.pyenv/bin/pyenv virtualenv $PYV $VIR_EN elif [ "$ACTION" == "DELETE" ] then sed -i -e "/$USERNAME/d" /etc/vsftpd.user_list rm -R /etc/vsftpd/user_config_dir/$USERNAME sudo deluser $USERNAME sudo /etc/init.d/vsftpd restart fi
true
5519e6b17828e2442aab56aee1ca5cf6dc106665
Shell
gufanyi/images
/4.docker_fastdfs配置/fastdfs_nginx.sh
UTF-8
1,186
2.796875
3
[]
no_license
#!/bin/bash echo 'download fastdfs-nginx-module' wget https://github.com/happyfish100/fastdfs-nginx-module/archive/master.zip echo 'decompression fastdfs-nginx-module' unzip fastdfs-nginx-module-master.zip echo 'download nginx 1.6.2 stable version' wget http://nginx.org/download/nginx-1.6.2.tar.gz echo 'decompression nginx tar file' tar -zxvf nginx-1.6.2.tar.gz echo 'install pcre and pcre-devel for regex lib' yum -y install pcre pcre-devel echo 'install zlib zlib-devel for compress' yum -y install zlib zlib-devel echo 'install openssl and openssl--devel for security socket' yum -y install openssl openssl--devel echo 'enter nginx-1.6.2' cd nginx-1.6.2 echo 'configure need to point add-module fastdfs-nginx-module' ./configure --prefix=/usr/local/nginx --add-module=/fastdfs-nginx-module-master/src echo 'compile and install' make&&make install echo 'validate configure is corrent' /usr/local/nginx/sbin/nginx -t echo 'start nginx' /usr/local/nginx/sbin/nginx echo 'restart nginx and reload' /usr/local/nginx/sbin/nginx -s reload ln -s /mnt/disk1/fdfs/logs /usr/local/nginx ln -s /mnt/disk1/fdfs/fdfs /usr/local/nginx ln -s /mnt/disk1/fdfs/fdfs /etc/fdfs
true
44bf81e509c320663d3c4599999de9835ea2c212
Shell
HamletGhost/HomeScripts
/bin/sysadmin/CleanKernels.sh
UTF-8
1,775
4.0625
4
[]
no_license
#!/bin/bash CWD="$(pwd)" declare -a Kernels declare -a KernelDirs declare -i NKernels=0 declare -i nErrors=0 for Dir in "$@" ; do KernelDir="${Dir%:}" [[ -d "$KernelDir" ]] || KernelDir="/usr/src/${KernelDir}" if [[ ! -d "$KernelDir" ]]; then echo "'${Dir}' is not a directory!" >&2 let ++nErrors continue fi BaseDir="$(dirname "$KernelDir")" KernelRepoDir="$(basename "$KernelDir")" [[ "$KernelRepoDir" =~ ^linux-([^-]*)-([^-]*)(-(.*))?$ ]] || { echo "Can't parse the kernel information from the name '${KernelRepoDir}'" let ++nErrors continue } KernelVersion="${BASH_REMATCH[1]}" EbuildRevision="${BASH_REMATCH[4]}" EbuildVersion="${BASH_REMATCH[1]}${BASH_REMATCH[3]}" KernelType="${BASH_REMATCH[2]}" GentooPackageAtom="sys-kernel/${KernelType}-sources-${EbuildVersion}" echo "Cleaning: ${KernelRepoDir} (${GentooPackageAtom})" make -C "$KernelDir" distclean || { echo "Error ($?) cleaning the directory '${KernelDir}'!" >&2 let ++nErrors continue } KernelDirs[NKernels]="$KernelDir" Kernels[NKernels]="=${GentooPackageAtom}" let ++NKernels done if [[ $NKernels == 0 ]]; then echo "Nothing left to do." exit $nErrors fi echo "Unmerging kernel sources: ${Kernels[@]}" emerge --unmerge "${Kernels[@]}" [[ $? == 0 ]] || echo "Error unmerging kernel sources!" >&2 for KernelDir in "${KernelDirs[@]}" ; do # the directory should have been removed; if it has no Makefile, # we silently remove it; otherwise, we complain if [[ -d "${KernelDir}/Makefile" ]]; then echo "Directory '${KernelDir}' was not properly cleaned." let ++nErrors else echo "Removing the leftovers of '${KernelDir}'..." rm -Rf "$KernelDir" || let ++nErrors fi done [[ $nErrors -gt 0 ]] && echo "${nErrors} errors encountered." exit $nErrors
true
8beab07fea2424d5047123aaf9b1f9755f4e5367
Shell
msr-ds3/coursework
/week1/students/musical_pairs.sh
UTF-8
816
3.78125
4
[]
no_license
#!/bin/bash # check for the md5sum command # if installed with coreutils, will have "g" in front of it if [ `which md5sum` ] then md5_cmd=md5sum elif [ `which gmd5sum` ] then md5_cmd=gmd5sum else echo "Please install md5sum" exit 1 fi # check for the shuf command # if installed with coreutils, will have "g" in front of it if [ `which shuf` ] then shuf_cmd=shuf elif [ `which gshuf` ] then shuf_cmd=gshuf else echo "Please install shuf" exit 1 fi # use the date to set a random seed for the shuf command # note: apparently shuf uses the initial bytes of the file # so hash the date to get a random first character in the file date +"%Y%m%d" | $md5_cmd > /tmp/ymd; ls *.txt | $shuf_cmd --random-source=/tmp/ymd | awk '{print; if (NR % 2 == 0) print "--------"}' | sed 's/\.txt$//'
true
1db1a4a65ee16cd58fd14aa327123295ee9c7a2d
Shell
tazjel/laptop-setup
/stage_1.sh
UTF-8
328
2.6875
3
[]
no_license
#! /bin/bash agy="apt-get -y" $agy install bzr etckeeper etckeeper init $agy install vim vim-gtk $agy install autofs if ! grep -q '^/net' /etc/auto.master then sed -i '/^# *\/net/s/# *//' /etc/auto.master etckeeper commit "Enabled NFS browsing in /net in autofs" fi initctl restart autofs $agy install git git-gui
true
0ab4ca942f31afd9d6e093dc68fe78b8dc8047db
Shell
zaitsevihor/docker_hive
/install.sh
UTF-8
424
2.96875
3
[]
no_license
#!/usr/bin/bash #sudo docker network create --subnet=172.18.0.0/16 docker_subnet n=1 while [ $n -ne 21 ] do sudo docker build -t docker_hive -f Dockerfile . #sudo docker run --rm -it docker_hive /bin/ash #sudo docker run -t -d --rm --name docker_hive_${n} docker_hive sudo docker run -t -d --rm --name docker_hive_${n} --net docker_subnet --ip 172.18.1.${n} docker_hive #sudo docker rmi docker_hive n=$((${n}+1)) done
true
1510dbb870ac0dd7df93b5c20ca1578a16732f72
Shell
cryoem/build-scripts
/build_and_package.sh
UTF-8
941
3.671875
4
[]
no_license
#!/usr/bin/env bash if [ $# -ne 3 ];then printf "\e\033[35m\n Usage: $(basename ${0}) %s %s %s\033[0m\n\n" "eman-recipe-dir" "output-dir" "construct.yaml-dir" >&2 exit 64 fi set -xe EMAN_RECIPE_DIR=$1 OUTPUT_DIR=$2 CONSTRUCT_YAML_DIR=$3 export PYTHONUNBUFFERED=1 source activate root # Build eman recipe conda info -a conda render ${EMAN_RECIPE_DIR} conda build purge-all conda build ${EMAN_RECIPE_DIR} -c cryoem -c defaults -c conda-forge # Package eman mkdir -p ${OUTPUT_DIR} && cd ${OUTPUT_DIR} CONSTRUCT_YAML="${CONSTRUCT_YAML_DIR}/construct.yaml" CONDA_PREFIX_NEW=$(echo ${CONDA_PREFIX} | sed "s~^/\(.\)/~\1:/~") sed -i.bak "s~\(^.*file:///\)\(.*$\)~\1${CONDA_PREFIX_NEW}/conda-bld/~" ${CONSTRUCT_YAML} cat ${CONSTRUCT_YAML} constructor --clean -v --cache-dir=${HOME_DIR}/.conda/constructor constructor ${CONSTRUCT_YAML_DIR} -v --cache-dir=${HOME_DIR}/.conda/constructor mv ${CONSTRUCT_YAML}.bak ${CONSTRUCT_YAML}
true
867486c65bbf8947c0dd323c58d808f574a4fd1a
Shell
jaapio/git-semver
/git-semver.sh
UTF-8
6,727
4.3125
4
[ "MIT" ]
permissive
#!/bin/bash ######################################## # Usage ######################################## usage() { cat <<-EOF Usage: $(basename-git "$0") [command] This script automates semantic versioning. Requires a valid change log at CHANGELOG.md. See https://github.com/markchalloner/git-semver for more detail. Commands get Gets the current version (tag) major Generates a tag for the next major version and echos it to the screen minor Generates a tag for the next minor version and echos it to the screen patch|next Generates a tag for the next patch version and echos it to the screen help This message EOF exit } ######################################## # Helper functions ######################################## function basename-git() { basename "$1" | tr '-' ' ' | sed 's/.sh$//g' } ######################################## # Plugin functions ######################################## plugin-output() { local type="$1" local name="$2" local output= while IFS='' read -r line do if [ -z "${output}" ] then echo -e "\n$type plugin \"$name\":\n" output=1 fi echo " $line" done } plugin-list() { local types=("User" "Project") local dirs=("${DIR_HOME}" "${DIR_ROOT}") local plugin_dir= local plugin_type= local total=${#dirs[*]} for (( i=0; i <= $((total-1)); i++ )) do plugin_type=${types[${i}]} plugin_dir="${dirs[${i}]}/.git-semver/plugins" if [ -d "${plugin_dir}" ] then find "${plugin_dir}" -maxdepth 1 -type f -exec echo "${plugin_type},{}" \; fi done } plugin-run() { # shellcheck disable=SC2155 local plugins="$(plugin-list)" local version_new="$1" local version_current="$2" local status=0 local type= local typel= local path= local name= for i in ${plugins} do type=${i%%,*} typel=$(echo "${type}" | tr '[:upper:]' '[:lower:]') path=${i##*,} name=$(basename "${path}") ${path} "${version_new}" "${version_current}" "${GIT_HASH}" "${GIT_BRANCH}" "${DIR_ROOT}" 2>&1 | plugin-output "${type}" "${name}" RETVAL=${PIPESTATUS[0]} case ${RETVAL} in 0) ;; 111|1) echo -e "\nError: Warning from ${typel} plugin \"${name}\", ignoring" ;; 112) echo -e "\nError: Error from ${typel} plugin \"${name}\", unable to version" status=1 ;; 113) echo -e "\nError: Fatal error from ${typel} plugin \"${name}\", unable to version, quitting immediately" return 1 ;; *) echo -e "\nError: Unknown error from ${typel} plugin \"${name}\", ignoring" esac done return ${status} } plugin-debug() { # shellcheck disable=SC2155 local version=$(version-get) # shellcheck disable=SC2155 local major=$(version-parse-major "${version}") # shellcheck disable=SC2155 local minor=$(version-parse-minor "${version}") # shellcheck disable=SC2155 local patch=$(version-parse-patch "${version}") if [ "" == "$version" ] then local new=0.1.0 else local new=${major}.${minor}.$((patch+1)) fi plugin-run "$new" "$version" } ######################################## # Version functions ######################################## version-parse-major() { echo "$1" | cut -d "." -f1 } version-parse-minor() { echo "$1" | cut -d "." -f2 } version-parse-patch() { echo "$1" | cut -d "." -f3 } version-get() { # shellcheck disable=SC2155 local version=$(git tag | grep "^${VERSION_PREFIX}[0-9]\+\.[0-9]\+\.[0-9]\+$" | sed "s/^${VERSION_PREFIX}//" | sort -t. -k 1,1n -k 2,2n -k 3,3n | tail -1) if [ "" == "${version}" ] then return 1 else echo "${version}" fi } version-major() { # shellcheck disable=SC2155 local version=$(version-get) # shellcheck disable=SC2155 local major=$(version-parse-major "${version}") if [ "" == "$version" ] then local new=${VERSION_PREFIX}1.0.0 else local new=${VERSION_PREFIX}$((major+1)).0.0 fi version-do "$new" "$version" } version-minor() { # shellcheck disable=SC2155 local version=$(version-get) # shellcheck disable=SC2155 local major=$(version-parse-major "${version}") # shellcheck disable=SC2155 local minor=$(version-parse-minor "${version}") if [ "" == "$version" ] then local new=${VERSION_PREFIX}0.1.0 else local new=${VERSION_PREFIX}${major}.$((minor+1)).0 fi version-do "$new" "$version" } version-patch() { # shellcheck disable=SC2155 local version=$(version-get) # shellcheck disable=SC2155 local major=$(version-parse-major "${version}") # shellcheck disable=SC2155 local minor=$(version-parse-minor "${version}") # shellcheck disable=SC2155 local patch=$(version-parse-patch "${version}") if [ "" == "$version" ] then local new=${VERSION_PREFIX}0.1.0 else local new=${VERSION_PREFIX}${major}.${minor}.$((patch+1)) fi version-do "$new" "$version" } version-do() { local new="$1" local version="$2" local sign="${GIT_SIGN:-0}" local cmd="git tag" if [ "$sign" == "1" ] then cmd="$cmd -as -m $new" fi if plugin-run "$new" "$version" then $cmd "$new" && echo "$new" fi } ######################################## # Run ######################################## # Set home readonly DIR_HOME="${HOME}" # Use XDG Base Directories if possible # (see http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html) DIR_CONF="${XDG_CONFIG_HOME:-${HOME}}/.git-semver" # Set (and load) user config if [ -f "${DIR_CONF}/config" ] then FILE_CONF="${DIR_CONF}/config" # shellcheck source=config.example source "${FILE_CONF}" else # No existing config file was found; use default FILE_CONF="${DIR_HOME}/.git-semver/config" fi # Set vars DIR_ROOT="$(git rev-parse --show-toplevel 2> /dev/null)" GIT_HASH="$(git rev-parse HEAD 2> /dev/null)" GIT_BRANCH="$(git rev-parse --abbrev-ref HEAD 2> /dev/null)" # Set $1 to last argument. for _; do true; done case "$1" in get) version-get ;; major) version-major ;; minor) version-minor ;; patch|next) version-patch ;; debug) plugin-debug ;; help) usage ;; *) usage ;; esac
true
655facd5bb16767bc224573dc0c832166919ffd5
Shell
MaStr/db2-client-latency-benchmark
/run_test.sh
ISO-8859-2
753
3.6875
4
[]
no_license
#!/bin/bash # Folgende EXPORT Variablen setzen: # # DB2USER # DB2PWD # DB2DB # DB2SCHEMA # # # Parameter: # # Anzahl Aufrufe tbsel # runId -> knstliche ID zum Speichern der Ergebnisse # count=$1 runId=$2 mkdir -p ./tmp for i in $( seq 1 $count) ; do echo "**** Starting $i of $count" tmpfile="./tmp/$runId.$( printf %04i $i)" #./tbsel "$DB2DB" "$DB2SCHEMA" "$DB2USER" "$DB2PWD" | tee "$tmpfile" || exit 1 stdbuf -o 0 bash -c "./tbsel \"$DB2DB\" \"$DB2SCHEMA\" \"$DB2USER\" \"$DB2PWD\"" | tee "$tmpfile" || exit 1 #script -c "./tbsel "$DB2DB" "$DB2SCHEMA" "$DB2USER" "$DB2PWD" | tee "$tmpfile" done ls -1 tmp/$runId.* | sort -n | xargs -I {} grep CSV-stat-per-1000 {} > $runId.csv echo "Done generating $runId.csv"
true
6226944f2552268ed65e169146938988f0d9212a
Shell
Alfresco/alfresco-ng2-components
/scripts/github/release/git-tag.sh
UTF-8
688
3.359375
3
[ "Apache-2.0" ]
permissive
#!/bin/bash if [[ $BRANCH == "master" ]]; then VERSION=$(grep -m1 version package.json | awk '{ print $2 }' | sed 's/[", ]//g') else VERSION=$(npm view @alfresco/adf-core@beta version) fi; echo "git tag -a ${VERSION} -m ${VERSION}" git config --local user.name "alfresco-build" git config --local user.email "build@alfresco.com" git tag -a ${VERSION} -m "${VERSION} [ci skip] " git remote rm origin GITHUB_REPO=https://$GITHUB_TOKEN:x-oauth-basic@github.com/Alfresco/alfresco-ng2-components.git git remote add origin $GITHUB_REPO if [[ "$1" == "--dryrun" ]]; then echo "dry run: Pushing new tag ${VERSION}!" else echo "Pushing new tag ${VERSION}!" git push origin --tags fi;
true
e55138dbfab7b5b35713792fc3d28723775bcc3d
Shell
kdub4/minimal-arch-linux
/1_arch_install.sh
UTF-8
4,250
3.40625
3
[]
no_license
#!/bin/bash encryption_passphrase="" root_password="" user_password="" hostname="" user_name="" continent_city="" swap_size="8" echo "Updating system clock" timedatectl set-ntp true echo "Creating partition tables" printf "n\n1\n4096\n+512M\nef00\nw\ny\n" | gdisk /dev/nvme0n1 printf "n\n2\n\n\n8e00\nw\ny\n" | gdisk /dev/nvme0n1 echo "Zeroing partitions" cat /dev/zero > /dev/nvme0n1p1 cat /dev/zero > /dev/nvme0n1p2 echo "Building EFI filesystem" yes | mkfs.fat -F32 /dev/nvme0n1p1 echo "Setting up cryptographic volume" printf "%s" "$encryption_passphrase" | cryptsetup -c aes-xts-plain64 -h sha512 -s 512 --use-random --type luks2 --label LVMPART luksFormat /dev/nvme0n1p2 printf "%s" "$encryption_passphrase" | cryptsetup luksOpen /dev/nvme0n1p2 cryptoVols echo "Setting up LVM" pvcreate /dev/mapper/cryptoVols vgcreate Arch /dev/mapper/cryptoVols lvcreate -L +"$swap_size"GB Arch -n swap lvcreate -l +100%FREE Arch -n root echo "Building filesystems for root and swap" yes | mkswap /dev/mapper/Arch-swap yes | mkfs.ext4 /dev/mapper/Arch-root echo "Mounting root/boot and enabling swap" mount /dev/mapper/Arch-root /mnt mkdir /mnt/boot mount /dev/nvme0n1p1 /mnt/boot swapon /dev/mapper/Arch-swap echo "Installing Arch Linux" yes '' | pacstrap /mnt base base-devel intel-ucode networkmanager wget reflector echo "Generating fstab" genfstab -U /mnt >> /mnt/etc/fstab echo "Configuring new system" arch-chroot /mnt /bin/bash <<EOF echo "Setting system clock" ln -fs /usr/share/zoneinfo/$continent_city /etc/localtime hwclock --systohc --localtime echo "Setting locales" echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen echo "LANG=en_US.UTF-8" >> /etc/locale.conf locale-gen echo "Setting hostname" echo $hostname > /etc/hostname echo "Setting root password" echo -en "$root_password\n$root_password" | passwd echo "Creating new user" useradd -m -G wheel -s /bin/bash $user_name echo -en "$user_password\n$user_password" | passwd $user_name echo "Generating initramfs" sed -i 's/^HOOKS.*/HOOKS=(base udev keyboard autodetect modconf block keymap encrypt lvm2 resume filesystems fsck)/' /etc/mkinitcpio.conf sed -i 's/^MODULES.*/MODULES=(ext4 intel_agp i915)/' /etc/mkinitcpio.conf mkinitcpio -p linux echo "Setting up systemd-boot" bootctl --path=/boot install mkdir -p /boot/loader/ touch /boot/loader/loader.conf tee -a /boot/loader/loader.conf << END default arch timeout 0 editor 0 END mkdir -p /boot/loader/entries/ touch /boot/loader/entries/arch.conf tee -a /boot/loader/entries/arch.conf << END title ArchLinux linux /vmlinuz-linux initrd /intel-ucode.img initrd /initramfs-linux.img options cryptdevice=LABEL=LVMPART:cryptoVols root=/dev/mapper/Arch-root resume=/dev/mapper/Arch-swap quiet rw END echo "Setting up Pacman hook for automatic systemd-boot updates" mkdir -p /etc/pacman.d/hooks/ touch /etc/pacman.d/hooks/systemd-boot.hook tee -a /etc/pacman.d/hooks/systemd-boot.hook << END [Trigger] Type = Package Operation = Upgrade Target = systemd [Action] Description = Updating systemd-boot When = PostTransaction Exec = /usr/bin/bootctl update END echo "Enabling autologin" mkdir -p /etc/systemd/system/getty@tty1.service.d/ touch /etc/systemd/system/getty@tty1.service.d/override.conf tee -a /etc/systemd/system/getty@tty1.service.d/override.conf << END [Service] ExecStart= ExecStart=-/usr/bin/agetty --autologin $user_name --noclear %I $TERM END echo "Updating mirrors list" cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.BAK reflector --latest 200 --age 12 --protocol https --sort rate --save /etc/pacman.d/mirrorlist touch /etc/pacman.d/hooks/mirrors-update.hook tee -a /etc/pacman.d/hooks/mirrors-update.hook << END [Trigger] Operation = Upgrade Type = Package Target = pacman-mirrorlist [Action] Description = Updating pacman-mirrorlist with reflector When = PostTransaction Depends = reflector Exec = /bin/sh -c "reflector --latest 200 --age 12 --protocol https --sort rate --save /etc/pacman.d/mirrorlist" END echo "Enabling periodic TRIM" systemctl enable fstrim.timer echo "Enabling NetworkManager" systemctl enable NetworkManager echo "Adding user as a sudoer" echo '%wheel ALL=(ALL) ALL' | EDITOR='tee -a' visudo EOF umount -R /mnt swapoff -a echo "ArchLinux is ready. You can reboot now!"
true
2a400ab3fed191863e4c59649d476efd42298b60
Shell
VladVons/sh-conf
/pkg/list/lst/nas/Script/samba.sh
UTF-8
336
2.828125
3
[]
no_license
# VladVons@gmail.com AddUserSmb() { aUser=$1; aPassw=$2; Log "$FUNCNAME, $aUser, $aPassw" AddUserNoLogin $aUser $aPassw echo -ne "$aPassw\n$aPassw\n" | smbpasswd -a -s $aUser } PostInstall() { mkdir -p /mnt/usb/data1/share/{temp,work,recycle} AddUserSmb guest $UserGuestPassw AddUserSmb backup $UserBackupPassw }
true
4cb245c2a0845ee328221794d89324ddcc3ef6bd
Shell
duckybsd/base-alpine
/rootfs/etc/cont-init.d/05-wodby-resolv-fix
UTF-8
179
2.796875
3
[]
no_license
#!/bin/sh ns_srv=$(grep -m1 '^nameserver' /etc/resolv.conf) ns_other=$(grep -Ev '^#|^nameserver' /etc/resolv.conf) printf '%s\n%s\n' "${ns_srv}" "${ns_other}" > /etc/resolv.conf
true
66bef453b91ec5a0e6c66a837adc2051e2bc2616
Shell
wenxueliu/code_clips
/Clang/atomic/performance/test
UTF-8
192
2.640625
3
[]
no_license
#! /bin/bash NUM=4 NUMMAX=100000000 for i in `seq 1 `; do ./main $i $NUMMAX 0 done for i in `seq 1 `; do ./main $i $NUMMAX 1 done for i in `seq 1 `; do ./main $i $NUMMAX 2 done
true
d38b8b80e9a6a43867eb2aeb7369d7ba3aac6119
Shell
RitaRuan/defects4j-repair
/脚本/replaceStr.sh
UTF-8
482
3.28125
3
[]
no_license
#/bin/bash #replace ":" to " " in "defects4j export -p cp.test" #alg: 1.project(ex:Lang) 2.bugID(ex:1) #output:replace result project=$1 bugID=$2 ProjectPath="/home/rtx/repair/d4j/"$project"/"$bugID"b" cd $ProjectPath COMPILECP=`defects4j export -p cp.compile` TESTCP=`defects4j export -p cp.test` string=$TESTCP string2=$COMPILECP #delele ":" ,put in array result=${string//:/ } result2=${string2//:/ } #output echo "cp.test:" echo $result echo "cp.compile:" echo $result2
true
51c25c207d562b830e3689bfba5cfd6626f9eab6
Shell
jaisuryagoud/Assignment_Day5
/RANDOM_maxi_mini.sh
UTF-8
418
3.328125
3
[]
no_license
#!/bin/bash -x RandomMax() { max=0; #min=0; count=1; while [ $count -le 5 ] do result=$(( $((RANDOM%1000)) + 1 )) if [ $result -gt 99 ] then if [ $count -eq 1 ] then max=$result elif [ $result -gt $max ] then max=$result fi if [ $count -eq 1 ] then min=$result elif [ $result -lt $min ] then min=$result fi ((count++)) fi done #output results: echo "Max is: " $max echo "Min is: " $min } RandomMax
true
57df914c212e2b71f2efa3687eb952d6b75882ff
Shell
brandon-arnold/dotfiles
/scripts/backup##hostname.goatboxter4
UTF-8
2,135
2.859375
3
[]
no_license
#!/bin/bash # Backs up the entire system, excluding some volatile directories. # -a archive mode is -rlptgoD (no -A,-X,-U,-N,-H) # -A preserve ACLs # -X preserve extended attributes # -l,--links copy symlinks as symlinks # -v,--verbose verbose # -e "...",--rsh="..." skips the y/N untrusted hosts message # --progress (and -v) above gives useful logging history # --filter"-,p ..." is a better way than --exclude to exclude directories # (see http://blog.mudflatsoftware.com/blog/2012/10/31/tricks-with-rsync-filter-rules/ ) # --backup make backups (see --suffix & --backup-dir) # --backup-dir="/extern/path/to/.rsync_bak_$(date +\%Y-\%m-\%d-\%H-\%M)" # make backups into hierarchy based in DIR # --delete delete extraneous files from dest dirs rsync -aAXlv \ -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o BatchMode=yes" \ --progress \ --filter="-,p /dev/*" \ --filter="-,p /home/brandon/.cache/google-chrome/*" \ --filter="-,p /home/brandon/.config/google-chrome/*" \ --filter="-,p /home/brandon/.config/Slack/*" \ --filter="-,p /home/brandon/Dropbox/*" \ --filter="-,p /home/brandon/.dropbox/*" \ --filter="-,p /home/brandon/.cache/*" \ --filter="-,p /home/brandon/.local/*" \ --filter="-,p /home/brandon/VirtualBox\ VMs/*" \ --filter="-,p /home/brandon/temp/*" \ --filter="-,p /home/brandon/Projects/mg-aws-glacier/*.log" \ --filter="-,p /lost+found" \ --filter="-,p /media/*" \ --filter="-,p /mnt/*" \ --filter="-,p /proc/*" \ --filter="-,p /run/*" \ --filter="-,p /sys/*" \ --filter="-,p /tmp/*" \ --filter="-,p /var/cache/*" \ --filter="-,p /var/lib/*" \ --filter="-,p /var/tmp/*" \ --backup \ --backup-dir="/share/Brandon/PcBackup/goatboxter4/.rsync_bak_$(date +\%Y-\%m-\%d-\%H-\%M)" \ --delete \ --delete-excluded \ / brandon.arnold@192.168.1.201:/share/Brandon/PcBackup/goatboxter4/rsync
true
5c6d0f4fac3b100a33697e5f7707dd5829252d3d
Shell
groupby/api-javascript
/scripts/release.sh
UTF-8
2,042
4.5625
5
[ "MIT" ]
permissive
#!/usr/bin/env bash # TODO: # - Ensure root directory. set -eo pipefail cd "${BASH_SOURCE%/*}/.." die() { local exit_code=1 local OPTIND=1 local opt while getopts "c:" opt; do case "$opt" in c) exit_code="$OPTARG" ;; esac done shift $((OPTIND - 1)) echo "ERROR:" "$@" >&2 exit $exit_code } info() { echo "===>" "$@" } print_usage() { cat <<EOF Usage: ${0##*/} ${0##*/} -h Creates a release. This performs the following steps: 1. Bumps the version number in package.json 2. Finalizes the release in CHANGELOG.md 3. Creates a git tag OPTIONS EOF sed -n '/^[[:space:]]*###/ s// /p' "$BASH_SOURCE" cat <<EOF EXIT CODES: - 0: Success - 1: General error - 2: Usage error - 3: Unsupported release type - 4: No release detected EOF } while getopts ":h" opt; do case "$opt" in ### -h Print this help. h) print_usage exit 0 ;; \?) die -c 2 "Invalid option: -${OPTARG}" ;; esac done shift $((OPTIND - 1)) info "Determining the release type..." release_type="$(sed -n '/## \[Unreleased\] \[\(.*\)\]/ s//\1/p' CHANGELOG.md)" case "$release_type" in major | minor | patch | premajor | preminor | prepatch | prerelease | from-git) : # valid; do nothing ;; '') die -c 4 "Could not detect potential release in the CHANGELOG." ;; *) die -c 3 "Unsupported release type: ${release_type}." ;; esac info "Bumping version in package.json..." new_version="$(npm version "$release_type" --no-git-tag-version)" info "New version: ${new_version}" info "Updating changelog..." ed -s CHANGELOG.md <<EOF H /\[Unreleased\].*/ s//[${new_version#v}] - $(date +%F)/ w q EOF info "Committing changes..." git commit -m "Bump to version ${new_version}" package.json CHANGELOG.md info "Tagging commit..." tag_name="${new_version}" ed -s CHANGELOG.md <<<$'1;/^## \\[/;//-p' | sed -e 's/^##* *//' -e $'1a\\\n\\\n' | git tag -a "$tag_name" -F - info "Pushing..." git push --no-verify origin HEAD "$tag_name" info "Done."
true
913f9d0e16ca04787bb7189109e0e1d9d82be995
Shell
eisenhowerj/hubble
/updater/scripts/git-download.sh
UTF-8
2,675
3.671875
4
[ "MIT" ]
permissive
#!/bin/bash # # Calculate download traffic per day # function ghe_greater_equal () { cat /etc/github/enterprise-release | perl -sne ' use version; my ($installed) = $_ =~ /RELEASE_VERSION="([0-9]+([.][0-9]+)+)"/; exit (version->parse($installed) lt version->parse($required)); ' -- -required="$1" return $? } # Returns success (bash exit code 0) if the GHE version is in a given range. # The first value of the range is inclusive and last value exclusive. # For example, 'ghe_between 2.11.4 2.12.2' returns 0 (success) for the values # 2.11.4, 2.11.5, ..., and 2.12.1, while 1 (failure) is returned for 2.12.2. function ghe_between () { ghe_greater_equal "$1" && ! ghe_greater_equal "$2" } if ghe_between "2.11.0" "2.11.6" ; then # The "github-audit.log" log file introduced in GHE 2.11.0 was only rolled # once a week until 2.11.6 [1]. Work around the bug by grepping for all log # entries in the two most recent log files (because the information from # yesterday may or not be rotated already). # # [1] https://enterprise.github.com/releases/2.11.6/notes CAT_LOG_FILE="zcat -f /var/log/github-audit.{log.1*,log} | grep -F '$(date --date='yesterday' +'%b %_d')'" elif ghe_greater_equal "2.11.0"; then # check yesterday's log file post 2.11 CAT_LOG_FILE="zcat -f /var/log/github-audit.log.1*" else # check yesterday's log file pre 2.11 CAT_LOG_FILE="zcat -f /var/log/github/audit.log.1*" fi if ghe_greater_equal "2.12.0" ; then # Starting from GHE 2.12.0 the fields in github-audit.log are sorted # alphabetically printf -v EXTRACT_FIELDS "%s" \ 'print if s/.*' \ '"cloning":([^,]+).*' \ '"program":"upload-pack".*' \ '"repo_name":"([^"]+).*' \ '"uploaded_bytes":([^,]+).*' \ '"user_login":"([^"]+).*' \ '/\2\t\4\t\1\t\3/' else printf -v EXTRACT_FIELDS "%s" \ 'print if s/.*' \ '"program":"upload-pack".*' \ '"repo_name":"([^"]+).*' \ '"user_login":"([^"]+).*' \ '"cloning":([^,]+).*' \ '"uploaded_bytes":([^ ]+).*' \ '/\1\t\2\t\3\t\4/' fi echo -e "repository\tuser\tcloning?\trequests\tdownload [B]" eval "$CAT_LOG_FILE" | perl -ne "$EXTRACT_FIELDS" | sort | perl -ne '$S{$1} += $2 and $C{$1} += 1 if (/^(.+)\t(\d+)$/);END{printf("%s\t%i\t%i\n",$_,$C{$_},$S{$_}) for ( keys %S );}' | sort -rn -k5,5
true
5b740f96781c070e6fbce958d70e4eefa0aa9b4f
Shell
banerjek/aws-utilities
/aws-describe-instances
UTF-8
638
2.625
3
[]
no_license
#!/bin/bash #i dev-instance, stage-instance, and prod-instance contain instance IDs # for those instances # ====================================================================== AWSPROFILE="default" aws ec2 --profile $AWSPROFILE describe-instances --instance-ids $(cat dev-instance) $(cat stage-instance) $(cat prod-instance) |tee instances.json #aws ec2 --profile $AWSPROFILE describe-instances --instance-ids $(cat prod-instance) aws ec2 --profile $AWSPROFILE describe-instances > instances.json cat instances.json |jq '.Reservations[].Instances[]' | jq -r '[.InstanceId, .ImageId, .State.Name, .LaunchTime, .PublicIpAddress] | @tsv'
true
9963ed3f02390f4d5944c25e5260643cbd260875
Shell
Nesma-Mostafa/RNA-seq-Analysis
/scripts/required_downloads.sh
UTF-8
3,528
2.921875
3
[]
no_license
#!/bin/bash #downloading and installing the required programms for hisat/stringtie and star/scallop pipelines ### Download the human genome data, generate genome sizes file and generate hisat/star indexes ### wget ftp://ftp.sanger.ac.uk/pub/gencode/Gencode_human/release_27/GRCh38.primary_assembly.genome.fa.gz -P $work_dir/hg38_data/ #download the fasta file for indexes generating gunzip -c $work_dir/hg38_data/GRCh38.primary_assembly.genome.fa.gz > $work_dir/hg38_data/GRCh38.primary_assembly.genome.fa Wget ftp://ftp.sanger.ac.uk/pub/gencode/Gencode_human/release_27/gencode.v27.annotation.gtf.gz -P $work_dir/hg38_data/ #download transcriptome gtf file to use for comparison gunzip -c gencode.v27.annotation.gtf.gz > $work_dir/hg38_data/gencode.v27.annotation.gtf samtools faidx $work_dir/hg38_data/GRCh38.primary_assembly.genome.fa cut -f1,2 $work_dir/hg38_data/GRCh38.primary_assembly.genome.fa.fai > $work_dir/hg38_data/hg38.genome ### done ### cd $work_dir/programs/ ### required downloads for downloading/trimming reads ### wget ftp-trace.ncbi.nlm.nih.gov/sra/sdk/2.8.2-1/sratoolkit.2.8.2-1-ubuntu64.tar.gz tar xvzf sratoolkit.2.8.2-1-ubuntu64.tar.gz wget www.usadellab.org/cms/uploads/supplementary/Trimmomatic/Trimmomatic-0.36.zip unzip Trimmomatic-0.36.zip mv Trimmomatic-0.36.zip/trimmomatic-0.36.jar Trimmomatic-0.36.zip/trimmomatic ### done ### ### required downloads for hisat-stringtie pipeline ### git clone https://github.com/infphilo/hisat2 #installing Hisat2 wget https://github.com/samtools/samtools/releases/download/1.6/samtools-1.6.tar.bz2 #downloadeing samtools-1.6 tar jxvf samtools-1.6.tar.bz2 cd samtools-1.6 make cd ../ git clone https://github.com/gpertea/stringtie #installing StringTie-1.3.4 cd stringtie make release cd ../ sudo apt-get install bedtools #install bedtools git clone https://github.com/gpertea/gclib #installing dependancy of gffcompare git clone https://github.com/gpertea/gffcompare #installing gffcompare-0.10.1 cd gffcompare make release cd ../ ### done ### ### required downloads for star-scallop pipeline ### #Installing scallop dependancies wget https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.gz #getting boost folder tar xvzf boost_1_65_1.tar.gz #getting & installing zlib required for htslib wget https://zlib.net/zlib-1.2.11.tar.gz tar xvzf zlib-1.2.11.tar.gz cd zlib-1.2.11/ ./configure make sudo make install cd ../ #cloning & installing htslib git clone https://github.com/samtools/htslib cd htslib/ autoheader autoconf ./configure --disable-bz2 --disable-lzma --disable-gcs --disable-s3 --enable-libcurl=no make sudo make install cd ../ #install subversion requiered for ClP sudo apt-get install subversion svn co https://projects.coin-or.org/svn/Clp/stable/1.16 coin-Clp #getting & installing clp cd coin-Clp ./configure --disable-bzlib --disable-zlib make sudo make install cd ../ #Installing Scallop git clone https://github.com/Kingsford-Group/scallop cd scallop/ autoreconf --install autoconf configure.ac ./configure --with-clp=/home/$username/coin-Clp --with-htslib=/home/$username/htslib --with-boost=/home/$username/boost_1_65_1 make cd ../ #downloading STAR and unziping it wget https://github.com/alexdobin/STAR/archive/2.5.3a.tar.gz tar xvzf STAR-2.5.3a.tar.gz #downloading cufflinks to merge scallop GTFs wget cole-trapnell-lab.github.io/cufflinks/assets/downloads/cufflinks-2.2.1.Linux_x86_64.tar.gz tar xvzf cufflinks-2.2.1.Linux_x86_64.tar.gz ### done ### cd ../
true
ace14c95b4fe9dc72faac1aa993899e07c22eb6c
Shell
gpaterno/trove-image-elements
/elements/trove-guest/install.d/15-install-trove
UTF-8
772
2.875
3
[ "Apache-2.0" ]
permissive
#!/bin/bash set -e set -o xtrace if [ "${DISTRO}" = "rhel" ]; then # NOTE(vkmc) This is necessary for now. Waiting for the release. yum -y install wget wget http://rhos-release.virt.bos.redhat.com/repos/rhos-release/rhos-release-latest.noarch.rpm yum -y --nogpgcheck localinstall rhos-release-latest.noarch.rpm rhos-release 7 fi if [ "${DISTRO}" = "centos" ]; then yum -y install https://rdo.fedorapeople.org/rdo-release.rpm wget yum -y update sed -i -e 's/^Defaults.*requiretty/# Defaults requiretty/g' /etc/sudoers sed -i -e 's/^enabled=0/enabled=1/g' /etc/yum.repos.d/rdo-testing.repo sed -i -e 's/^enabled=1/enabled=0/g' /etc/yum.repos.d/rdo-release.repo fi yum -y install openstack-trove-guestagent python-troveclient python-netifaces pexpect
true
ac66522d048ac758f59ae080bab830a25bb1f698
Shell
RedDevil2015/effective-awk-program
/ch07/nmatches.bash
UTF-8
138
2.734375
3
[]
no_license
printf "Enter search pattern: " read pattern awk -v pat="$pattern" '{ nmatches++ } END { print nmatches, "found" }' $1
true
6dcb64fdd5285e8843f0bd860b7f1b03e29eab77
Shell
rdllopes/qzui
/ui/update-bootstrap.sh
UTF-8
306
3.25
3
[ "MIT", "Apache-2.0" ]
permissive
#! /bin/sh if [ -n "$1" ]; then mkdir tmp curl -L https://github.com/twbs/bootstrap/releases/download/v$1/bootstrap-$1-dist.zip -o tmp/bootstrap.zip rm -fr app/lib/bootstrap unzip tmp/bootstrap.zip -d app/lib mv app/lib/dist app/lib/bootstrap else echo "Usage: update-bootstrap <version>" fi
true
8579e93fbf98d043f08fead27e751dfd23fbf1f0
Shell
JoachimSall/BTS-SNIR-2018-2019
/datametrie1-master/datametrie
UTF-8
8,443
3.53125
4
[]
no_license
#!/bin/bash #installer curl whois mailutils #demande à l'utilisateur l'adresse à tester sur tout le script echo "Bienvenue, avant de commencer, nous rappelons qu'il est nécessaire" echo "d'avoir installer les applications suivantes : mailutils / curl / whois" echo " " echo -n "Avez-vous pris en compte le message précédent ? Oui / Non ?" read ok clear echo -n "Quelle est votre Nom :" read nom clear echo -n "A quelle adresse mail envoyer les résultats : " read mail echo -n "Saissir à nouveau l'adresse mail : " read mail2 clear echo -n "Quelle adresse voulez vous observer ? " read ad clear echo -n "Définir la valeur du ping max avant échec : (en ms) " read z clear if ping -c1 $ad > /dev/null; #test sur 1ping si il y a une réponse then echo "Analyse en cours ... Veuillez patienter" #le script continue else echo -n "Mauvaise adresse, veuillez la renoter :" read a if ping -c1 $ad > /dev/null; then echo "Analyse en cours" else echo -n "L'adresse n'est pas accessible" fi fi declare ad y day b e f fail reu moy xmoy z tpa h moypa duree p1 p2 p3 d1 d2 d3 c1 c2 c3 declare -i c nbtenta duree good xgood #paramètrage des variables au rang 0 b=0 #nombre de boucle heure e=0 xmin=10 #valeur mini ping xmax=0 #valeur max ping journée xmoy=0 #valeur moy ping journée xreu=0 #valeur reussie journée pamin=10 #temps min chargement PA pamax=0 #temps max chargement PA y=0 #calcul moyenne journée xpamin=10 #temps min chargement PA journée xpamax=0 #temps max chargement PA journée q=0 nbtenta=0 # 50 #Obtention IP public puis recherche FAI ippublic=$(curl ifconfig.me) FAI=$(whois $ippublic | grep descr: | sed -n 2p | awk '{print $2}') clear echo "Analyse en cours ..." while [ $b -lt 12 ] #boucle de 12x 2h (1 journée) do #remise à 0 des paramètres à chaque heure c=0 min=10 max=0 date=0 f=0 h=0 reu=0 good=0 datemin=0 datemax=0 while [ $c -lt 4 ] #Boucle de 24x 5min (2h) do tping=$(ping -c 1 -q $ad | grep rtt | awk -F'/' {'print $5'}) #valeur du ping c=$[ $c + 1 ] if test $(echo "$tping < $z" | bc -l ) -eq 1;then #test si ping < à une valeur max tpa=$(/usr/bin/time -f "%e" wget -q --delete-after $ad 2>&1) #calcul temps chargement PA if test $(echo "$tpa > $pamax" |bc -l ) -eq 1;then #recherche temps chargement max pamax="$tpa" datepamax="$(date +%H:%M:%S)" fi if test $(echo "$tpa < $pamin" |bc -l ) -eq 1;then #recherche temps chargement min pamin="$tpa" datepamin="$(date +%H:%M:%S)" fi fi if test $(echo "$tping < $z" | bc -l ) -eq 1;then #calcul %réussite reu=$[ $reu + 1 ] fi if test $(echo "$tping > $max" | bc -l ) -eq 1;then #recherche Max max="$tping" datemax="$(date +%H:%M:%S)" fi if test $(echo "$tping < $min" | bc -l ) -eq 1;then #recherche Min min="$tping" datemin="$(date +%H:%M:%S)" fi f=$(echo "scale=2; ($f + $tping)" | bc -l ) #Somme des ping if test $(echo "$tping > $z" |bc -l ) -eq 1;then tpa=0 fi h=$(echo "scale=3; ($h + $tpa)" | bc -l ) #Somme temps de chargement sleep 1s # 100 #temps de pause de 5min done moy=$(echo "scale=2; $f / $c" | bc -l ) #moyenne ping moypa=$(echo "scale=2; $h /$reu" | bc -l ) #moyenne temps chargement e=$b b=$[ $b +1 ] good=$[ $reu * 100 / $c | bc -l ] #calcul %reussite pour l'heure écoulée if [ $b = 1 ]; then p1="$moy" d1="$good" c1="$moypa" elif [ $b = 2 ]; then p2="$moy" d2="$good" c2="$moypa" elif [ $b = 3 ]; then p3=$moy d3=$good c3=$moypa elif [ $b = 4 ]; then p4="$moy" d4="$good" c4="$moypa" elif [ $b = 5 ]; then p5=$moy d5=$good c5=$moypa elif [ $b = 6 ]; then p6="$moy" d6="$good" c6="$moypa" elif [ $b = 7 ]; then p7=$moy d7=$good c7=$moypa elif [ $b = 8 ]; then p8="$moy" d8="$good" c8="$moypa" elif [ $b = 9 ]; then p9=$moy d9=$good c9=$moypa elif [ $b = 10 ]; then p10="$moy" d10="$good" c10="$moypa" elif [ $b = 11 ]; then p11=$moy d11=$good c11=$moypa #150 else p12=$moy d12=$good c12=$moypa fi if test $(echo "$min < $xmin" | bc -l) -eq 1;then #recherche valeur min jounée xmin="$min" xdatemin=$datemin fi if test $(echo "$max > $xmax" | bc -l) -eq 1; then #recherche valeur max journée xmax="$max" xdatemax=$datemax fi y=$(echo "scale=2; ($moy + $y) " | bc -l ) #somme des moyennes xreu=$[ $reu + $xreu ] if test $(echo "$pamax > $xpamax" |bc -l ) -eq 1;then #recherche valeur max chargement journée xpamax="$pamax" xdatepamax="$datepamax" fi if test $(echo "$xpamin > $pamin" |bc -l ) -eq 1;then #recherche valeur min chargement journée xpamin="$pamin" xdatepamin="$datepamin" fi q=$(echo "scale=2; ($moypa +$q) " |bc -l ) #somme des moyennes chargement done xmoy=$(echo "scale=2; $z / $b" | bc -l ) #calcul moyenne ping journée xmoypa=$(echo "scale=2; $q / $b" |bc -l ) #calcul de la moyenne temps chargement journée xgood=$[ $xreu * 100 / 6 | bc -l ] #%reussite sur la journée nbtenta=$(echo "($b * $c)") duree=$( $b * 2 | bc -l) echo $duree echo "<b><u><h1>Rapport d'observation Datametrie du $(date +%d-%m-%y)</h1></u></b> <p>Bonjour Mme Mr $nom<br> Votre FAI est $FAI </p> <p>Datametrie1 a effectué $nbtenta observations de l'adresse <u>$ad</u> sur les $duree dernières heures.</p> <p>Pour une valeur maximale acceptée de : $z ms - La performance moyenne a été de $xmoy ms<br> - Le taux de disponibilité a été de $xgood%</p> <p>La valeur de ping Minimum a été de $xmin ms à $xdatemin<br> La valeur de ping Maximum a été de $xmax ms à $xdatemax</p> <p>En général, pour un ping inférieur à $z ms, la page d'accueil de $ad s'ouvrait en 0$xmoypa ms</p> <p>Le temps de chargement le plus court a été de $pamin ms à $xdatepamin<br> Le temps de chargement le plus long a été de $pamax ms à $xdatepamax</p> <br /> <style type="text/css"> table { border: 1px solid black; } tr { border: 1px solid black; } td { border: 1px solid black; } </style> <table> <tr> <td><b>Plage horaire</b></td> <td><b>0h 2h</b></td> <td><b>2h 4h</b></td> <td><b>4h 6h</b></td> <td><b>6h 8h</b></td> <td><b>8h 10h</b></td> <td><b>10h 12h</b></td> <td><b>12h 14h</b></td> <td><b>14h 16h</b></td> <td><b>16h 18h</b></td> <td><b>18h 20h</b></td> <td><b>20h 22h</b></td> <td><b>22h 24h</b></td> </tr> <tr> <td><b>Ping moyen (millisecondes)</b></td> <td>$p1</td> <td>$p2</td> <td>$p3</td> <td>$p4</td> <td>$p5</td> <td>$p6</td> <td>$p7</td> <td>$p8</td> <td>$p9</td> <td>$p10</td> <td>$p11</td> <td>$p12</td> </tr> <tr> <td><b>Disponibilité (en pourcentage)</b></td> <td>$d1</td> <td>$d2</td> <td>$d3</td> <td>$d4</td> <td>$d5</td> <td>$d6</td> <td>$d7</td> <td>$d8</td> <td>$d9</td> <td>$d10</td> <td>$d11</td> <td>$d12</td> </tr> <tr> <td><b>Temps de chargement moyen (millisecondes)</b></td> <td>0$c1</td> <td>0$c2</td> <td>0$c3</td> <td>0$c4</td> <td>0$c5</td> <td>0$c6</td> <td>0$c7</td> <td>0$c8</td> <td>0$c9</td> <td>0$c10</td> <td>0$c11</td> <td>0$c12</td> </tr> </table> <p>En espérant que nos résultats vous seront utile.<br> Amicalement votre</p> <p>L'équipe Datametrie1</p>" > Rapportdatametrie1.html mail -a "Mine-version: 1.0" -a "Content-Type: text/html" -s "Rapport d'Observation" $mail < Rapportdatametrie1.html
true
4a0857550835a32a02f7d0f896be9fa8913c60a3
Shell
Stackato-Apps/stackato-apps
/apps/jenkins/stackato-setup.sh
UTF-8
480
3.484375
3
[ "BSD-3-Clause" ]
permissive
#!/bin/bash #echo "This script sets up a persistent .jenkins directory" if [ -e "$STACKATO_FILESYSTEM"/.jenkins ] then echo "Jenkins directory exists, using existing data." ln -s "$STACKATO_FILESYSTEM"/.jenkins "$STACKATO_APP_ROOT"/.jenkins else echo "Jenkins directory not found. Setting up..." # create folders in the shared filesystem mkdir -p "$STACKATO_FILESYSTEM"/.jenkins ln -s "$STACKATO_FILESYSTEM"/.jenkins "$STACKATO_APP_ROOT"/.jenkins fi
true
d453531c0e48722d633fd342bc6d70d802bbfc4e
Shell
cristianmiranda/dotfiles
/scripts/sync.sh
UTF-8
1,205
3.890625
4
[]
permissive
#!/usr/bin/env bash set -e # Locations BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" CONFIG_HOME="../home" DOTBOT_DIR="../dotbot" DOTBOT_BIN="bin/dotbot" # # Getting config file for host # unameOut="$(uname -a)" MACHINE_TYPE="anonymous" if [[ "$unameOut" =~ "mini-linux" ]]; then MACHINE_TYPE="server" elif [[ "$unameOut" =~ "Linux" ]]; then MACHINE_TYPE="linux" elif [[ "$unameOut" =~ "Darwin" ]]; then MACHINE_TYPE="macos" fi CONFIG_FILE="dotbot.${MACHINE_TYPE}.conf.yaml" if ! [ -f "${BASEDIR}/$CONFIG_HOME/$CONFIG_FILE" ]; then echo "ERROR: $CONFIG_FILE does not exist. Aborting sync." exit 1 fi cd "${BASEDIR}" echo -e "\n>> 🔧 Using ${MACHINE_TYPE}'s config file => $CONFIG_FILE \n" echo -e ">> ♻️ Submodules sync..." git -C "${DOTBOT_DIR}" submodule sync --quiet --recursive || echo "Could not sync dotbot submodule" echo -e ">> ♻️ Submodules update..." git submodule update --init --recursive "${DOTBOT_DIR}" || echo "Could not update dotbot submodule" echo -e ">> ♻️ Submodules pull...\n" git pull --recurse-submodules && git submodule update cd "${CONFIG_HOME}" "${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -q -c "${CONFIG_FILE}" "${@}" exit 0
true
b027b04505f3289ae56d0a63667790de85280ac0
Shell
tkelleyireland/sie-dns-sensor
/packaging/general/sie-dns-sensor/usr/bin/sie-gen-key
UTF-8
410
3.296875
3
[ "ISC", "Apache-2.0" ]
permissive
#!/bin/sh -e . /etc/default/sie-dns-sensor . /usr/lib/sie/functions if [ -z "$uploadkey" ]; then echo "$0: uploadkey is not set" exit 1 fi if [ -e "$uploadkey" ]; then echo "$0: $uploadkey already exists" exit 1 fi mkdir -p $(dirname $uploadkey) ssh-keygen -t rsa -b 1024 -f $uploadkey -N '' -C "$(get_hostname)" echo -e "\n ===> Please email the contents of $uploadkey.pub to passivedns@farsightsecurity.com\n"
true
2ca186ddb6ef50a8c0f8eda4dfce136a1923886b
Shell
alexandreboisvert/utilities
/bin/fun/rot13.sh
UTF-8
720
4.03125
4
[]
no_license
#!/usr/bin/env bash usage() { cat << EOF Simple rot13 encoder/decoder See: https://en.wikipedia.org/wiki/ROT13 Can be used on files or STDIN. Options: help : display this help and exit stdin : process the content of STDIN (to be used in pipes) files a.txt b.txt c.txt : process all the files a.txt, b.txt and c.txt. EOF } if [ -z "$1" ] then usage exit 1 fi case "$1" in help) usage exit 0 ;; stdin) tr 'a-zA-Z' 'n-za-mN-ZA-M' ;; files) shift for filename in "$@" do echo "${filename}" tr 'a-zA-Z' 'n-za-mN-ZA-M' < "${filename}" done ;; # Handling the incorrect arguments *) usage exit 1 ;; esac
true
dfb68b437eae850c014fe9242a7fe1479b867d31
Shell
harmonylang/harmony-docker
/harmony
UTF-8
3,937
4.1875
4
[]
no_license
#!/bin/bash function harmony_function() { function join_by { local IFS="$1"; shift; echo "$*"; } function make_id() { ID=() LETTERS=(1 2 3 4 5 6 7 8 9 0 a b c d e f g) for _ in $(seq 1 32); do INDEX=$((RANDOM % 16)) ID+=("${LETTERS[INDEX]}") done idNumber=$(join_by '' "${ID[@]}") echo "$idNumber" } function make_path_to_files() { FILES_IN_CONTAINER=() for f in "$@"; do FULL_PATH=$(join_by "/" ".." "code" "$f") FILES_IN_CONTAINER+=("'$FULL_PATH'") done echo "${FILES_IN_CONTAINER[@]}" } function make_run_cmd() { ARGS=("docker" "run") if [ -n "$1" ]; then ARGS+=("-m") ARGS+=("$1M") ARGS+=("--memory-swap") ARGS+=("$1M") fi ARGS+=("--name") ARGS+=("$2") ARGS+=("-v") PWD=$(pwd) ARGS+=("$PWD:/code") ARGS+=("-w" "/harmony") ARGS+=("-i") ARGS+=("-t" "anthonyyang/harmony-docker") shift; shift; ARGS+=("./wrapper.sh") ARGS+=("$@") CMD=$(join_by " " "${ARGS[@]}") echo "$CMD" } function make_clean_cmd() { echo "docker container rm $1" } function make_get_json_cmd() { CWD=$(pwd) echo "docker cp $1:/harmony/charm.json $CWD/charm.json" } function make_get_html_cmd() { CWD=$(pwd) echo "docker cp $1:/harmony/harmony.html $CWD/harmony.html" } function make_kill_cmd() { echo "docker container kill $1" } function main() { MAX_MEMORY="$1" MAX_TIMEOUT="$2" shift; shift; name=$(make_id) run_cmd=$(make_run_cmd "$MAX_MEMORY" "$name" "$@") get_json_cmd=$(make_get_json_cmd "$name") get_html_cmd=$(make_get_html_cmd "$name") kill_cmd=$(make_kill_cmd "$name") clean_cmd=$(make_clean_cmd "$name") function timeout() { time=$1 # start the command in a subshell to avoid problem with pipes # (spawn accepts one command) command="/bin/sh -c \"$2\"" expect -c "set echo \"-noecho\"; set timeout $time; spawn -noecho $command; expect timeout { exit 1 } eof { exit 0 }" if [ $? = 1 ] ; then echo "Timeout after ${time} seconds" fi } if [ -n "$MAX_TIMEOUT" ]; then timeout "$MAX_TIMEOUT" "$run_cmd" else eval "$run_cmd" fi eval "$get_json_cmd"&>/dev/null eval "$get_html_cmd"&>/dev/null eval "$kill_cmd" &>/dev/null eval "$clean_cmd" &>/dev/null } function setup() { OPTIONS=() FILENAMES=() while [[ $# -gt 0 ]]; do key="$1" case $key in --memory) MAX_MEMORY="$2" shift # past argument shift # past value ;; --timeout) MAX_TIMEOUT="$2" shift # past argument shift # past value ;; -a|-A|-j|-f|-h|--help|-b|-d|-s|-t|-v|--version) OPTIONS+=("$key") shift ;; --const|-c|-m|--module) OPTIONS+=("$key" "$2") shift # past argument shift # past value ;; *) # unknown option FILENAMES+=("$1") # save it in an array for later shift # past argument ;; esac done FULL_FILE_PATHS=$(make_path_to_files "${FILENAMES[@]}") POSITIONALS="${OPTIONS[*]} ${FULL_FILE_PATHS[*]}" main "$MAX_MEMORY" "$MAX_TIMEOUT" "${POSITIONALS[@]}" } setup "$@" } harmony_function "$@"
true
c4f9e36d4358edcaec75694dc2485788b5a3d430
Shell
petronny/aur3-mirror
/awn-extras-applets-bzr/PKGBUILD
UTF-8
3,455
2.90625
3
[]
no_license
# Contributor: Alessio Sergi <asergi at archlinux dot us> # Maintainer: twa022 <twa022 at gmail dot com> _pkgname=awn-extras-applets pkgname=${_pkgname}-bzr pkgver=1542 pkgrel=2 pkgdesc="A collection of applets for avant-window-navigator" arch=('i686' 'x86_64') url="https://launchpad.net/awn-extras" license=('GPL2' 'LGPL2.1') depends=('avant-window-navigator-bzr' 'gnome-menus' 'gnome-menus2' 'python2-notify' 'webkitgtk2' 'vte') makedepends=('bzr' 'intltool' 'vala-012') optdepends=('fortune-mod: animal-farm applet' 'gnome-applets: cpufreq applet' 'gstreamer0.10-python: volume control applet' 'libgweather: weather applet' 'python2-gdata: calendar applet' 'python2-gtop: bandwidth-monitor applet' 'python2-notify: comics, battery applets' 'python2-rsvg: hardware-sensors, cairo-clock, comics applets' 'python2-simplejson: feeds applet' 'python2-vobject: calendar applet' 'python2-wnck: slickswitcher applet' 'python-xklavier: dialect applet' 'python2-dateutil: cairo-clock applet' 'python2-feedparser: comics, feeds applets' 'python2-pyinotify: thinkhdaps applet' 'tomboy: tomboy applet') provides=($_pkgname) conflicts=($_pkgname) options=('!libtool') install="$pkgname".install source=(fix-weather-applet.patch) _bzrtrunk="https://code.launchpad.net/~awn-extras/awn-extras/trunk" _bzrmod="awn-extras" build() { cd "$srcdir" msg "Connecting to Bazaar server...." if [[ -d "$_bzrmod" ]]; then cd "$_bzrmod" && bzr --no-plugins pull "$_bzrtrunk" -r "$pkgver" msg "The local files are updated." else bzr --no-plugins branch "$_bzrtrunk" "$_bzrmod" -q -r "$pkgver" fi msg "Bazaar checkout done or server timeout" msg "Starting build..." rm -rf "$srcdir/$_bzrmod-build" cp -r "$srcdir/$_bzrmod" "$srcdir/$_bzrmod-build" cd "$srcdir/$_bzrmod-build" patch -uNp2 -r- -i "$srcdir/fix-weather-applet.patch" # python2 fix # Python2 fix find . -type f -name *.py | xargs sed -i 's@^#.*python$@#!/usr/bin/python2@' sed -i 's/async(\"python \"/async(\"python2 \"/' applets/maintained/shiny-switcher/shinyswitcherapplet.c sed -i 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:g' configure.ac export PYTHON="/usr/bin/python2" export VALAC="/opt/vala-0.12/bin/valac" export CFLAGS="$CFLAGS -I/usr/include/gio-unix-2.0/" ./autogen.sh --prefix=/usr --sysconfdir=/etc \ --datadir=/usr/share --disable-static \ --disable-pymod-checks \ --with-webkit #--without-gnome # <-- remove gnome-menus from deps #--with-indicator # <-- add libindicator as dep make } package() { cd "$srcdir/$_bzrmod-build" make GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 DESTDIR="$pkgdir/" install install -d -m 755 "$pkgdir"/usr/share/gconf/schemas gconf-merge-schema "$pkgdir"/usr/share/gconf/schemas/awn-extras.schemas \ "$pkgdir"/etc/gconf/schemas/*.schemas rm -rf "$pkgdir"/etc # Remove bandwidth-monitor applet, because it's not compatible with latest netstat rm -R "$pkgdir"/usr/share/avant-window-navigator/applets/bandwidth-monitor* # Remove pandora applet, because gtkmozembed is not available rm -R "$pkgdir"/usr/share/avant-window-navigator/applets/pandora* } sha256sums=('d820d826cbb9c412cff9eb455ef8c3ba0d96b4247f097933db812e87a72f7e4f')
true
604a2b93b9b0903fd552228ee833eea0219e248f
Shell
VeretennikovAlexander/OS-Public
/Keywords/Keywords7.txt
UTF-8
255
3.421875
3
[]
no_license
#!/bin/bash echo "# of arguments = $#" var1=${1:-/tmp} echo $var1 echo ${1:?} echo OK for i in {1..10}; do echo Arg$i = ${!i} done var2='jpg file.jpg' echo ${var2:4:5} echo ${var2#jpg} echo ${var2%jpg} echo ${var2/jpg/txt} echo ${var2//jpg/txt}
true
55c92a7cc7114cd770d61da7cdf0f93251254344
Shell
Mirantis/cvp-configuration
/scripts/poke.sh
UTF-8
523
3.1875
3
[]
no_license
#!/bin/bash if [[ -z ${token+x} ]]; then export token=$(openstack token issue -c id -f value) echo "# Exported token: ${token}" fi if [[ -z ${project_id+x} ]]; then export project_id=$(openstack project list -c ID -c Name -f value | grep ${OS_PROJECT_NAME} | cut -d' ' -f1) echo "# Exported project_id: ${project_id}" fi poke_uri=$(echo ${1/project_id/$project_id}) echo "# Input uri is ${1}" echo "[$(date +'%H:%M:%S')] -> '${poke_uri}'" curl -sH "X-Auth-Token: ${token}" ${poke_uri} | python -m json.tool
true
36232c95672a33e110a44ac91a747caab45754ca
Shell
DrSnowbird/shell-utility
/user/add-new-user.sh
UTF-8
1,642
3.953125
4
[ "Apache-2.0" ]
permissive
#!/bin/bash # ------------------------------------ # maintainer: DrSnowbird@openkbs.org # license: Apache License Version 2.0 # ------------------------------------ if [ $# -lt 2 ]; then echo "*** ERROR ***" echo "... Need two input arguments at least ..." echo "$(basename $0) <User_Name> <Password> <sudo_or_not: 1 (yes), 0 (no)>" exit 1 fi USER_SUDO=0 OS_TYPE=centos HOST_OS=`cat /etc/*-release|grep "^NAME="|awk -F'=' '{print $2}'|tr -d '"'` #if [ "$(. /etc/os-release; echo $NAME)" = "Ubuntu" ]; then if [ "$HOST_OS" = "Ubuntu" ]; then OS_TYPE=ubuntu else OS_TYPE=centos fi if [ $3 -gt 0 ]; then USER_SUDO=1 fi NO_PASSWORD=0 #### ---- main ---- USER_NAME=${1} USER_PASSWD=${2} sudo useradd ${USER_NAME} --create-home -U -s /bin/bash -p $(echo ${USER_PASSWD} | openssl passwd -1 -stdin) echo "------------------------------------" echo "To add user to more group:" echo "sudo usermod -aG <new-Group> ${USER_NAME}" echo " Note: The user will need to log out and log back in to see the new group added." echo "------------------------------------" echo "To add user to sudo group:" echo "sudo usermod -aG sudo ${USER_NAME}" echo "------------------------------------" if [ ${USER_SUDO} -gt 0 ]; then if [ "${OS_TYPE}" = "ubuntu" ]; then ## -- Ubuntu -- sudo usermod -aG sudo ${USER_NAME} fi if [ "${OS_TYPE}" = "centos" ]; then ## -- Centos -- sudo usermod -aG wheel ${USER_NAME} fi if [ ${NO_PASSWORD} -gt 0 ]; then echo "%${USER_NAME} ALL=(ALL) NOPASSWD: ALL" | sudo tee -a /etc/sudoers fi fi sudo chown ${USER_NAME}:${USER_NAME} -R /home/${USER_NAME}
true
a780098f4a1ee6efed3a7c69bfde18a09f12abd5
Shell
Darkyenus/pacbot
/project/uploadNXJ.sh
UTF-8
600
3.5625
4
[]
no_license
#!/bin/sh ### Shared header cd "$(dirname "$0")"/.. COMPILEDIR="target/nxj" mkdir -p ${COMPILEDIR} cd ${COMPILEDIR} if [[ $OSTYPE == darwin* ]]; then export JAVA_HOME="/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/" fi ####### if [[ $1 == -* || -z $1 ]]; then #First parameter is arg or there are no parameters PROGRAM_NAME="NXTProgram" UPLOAD_PARAMS="${@:1}" else PROGRAM_NAME="$1" UPLOAD_PARAMS="${@:2}" fi echo "Uploading $PROGRAM_NAME with params: $UPLOAD_PARAMS..." ../../lejos/bin/nxjupload ${UPLOAD_PARAMS} ${PROGRAM_NAME}.nxj echo "Uploaded"
true
e6dc3e0dafe168b4704c1ed56c45aa5d549169ce
Shell
ritazh/gatekeeper
/deploy/deploy-kubernetes-policy.sh
UTF-8
360
2.546875
3
[ "Apache-2.0", "LicenseRef-scancode-generic-cla" ]
permissive
#!/bin/bash cd "${0%/*}" echo "Deploy Kubernetes policies" read -p "Press enter to continue" # deploy kubernetes policies kubectl -n gatekeeper-system create configmap kubernetes-matches --from-file=../policy/kubernetes/matches.rego kubectl -n gatekeeper-system create configmap kubernetes-policymatches --from-file=../policy/kubernetes/policymatches.rego
true
d676235e437c172aef6db103703ea5c0484cf831
Shell
Hubbitus/shell.scripts
/SHARED/array_ordered_unique_add.bash
UTF-8
1,017
3.8125
4
[]
no_license
#!/bin/bash # Add element to begin (if lesser) or end (if greather) of ordered array if it still not there. # $1 - name of array for indirect access ( http://tldp.org/LDP/abs/html/ivr.html ) # $2 - element for addition function array_ordered_unique_add(){ # http://www.linuxquestions.org/questions/linux-software-2/[bash]-indirect-array-reference-to-array-with-values-containing-spaces-812166/ eval local _arr=(\${${1}[@]}) #echo "_arr=${_arr[@]}, \${_arr[\${#_arr[@]} - 1]}=${_arr[@]:(-1)}" if [[ $2 -gt ${_arr[@]:(-1)} || -z "${_arr[@]}" ]]; then _arr+=( $2 ) else if [ $2 -lt ${_arr[0]} ]; then # Access last element: http://mywiki.wooledge.org/BashFAQ/005 _arr=( $2 "${_arr[@]}" ) else echo 'Something strange! Element is not less then minimum and not greather then maximum! May be array is not preordered or have not unique elements?' return 1 fi fi # Indirect set array: http://mywiki.wooledge.org/BashFAQ/006 "Here string syntax" read -r "$1" <<< "${_arr[@]}" } #/f array_ordered_unique_add
true
0a00df30b04e5032860852940d425308e9b71d05
Shell
globus/globus-toolkit
/gridftp/hdfs/scripts/xinetd/gridftp-hdfs-inetd.in
UTF-8
519
2.6875
3
[ "Apache-2.0" ]
permissive
#!/bin/sh if [ -e @datadir_resolved@/gridftp-hdfs/gridftp-hdfs-environment ] ; then . @datadir_resolved@/gridftp-hdfs/gridftp-hdfs-environment fi if [ -e @sysconfdir_resolved@/gridftp-hdfs/gridftp-hdfs-local.conf ] ; then . @sysconfdir_resolved@/gridftp-hdfs/gridftp-hdfs-local.conf fi if [ -e @sysconfdir_resolved@/sysconfig/gridftp-hdfs ] ; then . @sysconfdir_resolved@/sysconfig/gridftp-hdfs fi exec /usr/sbin/globus-gridftp-server -c @sysconfdir_resolved@/gridftp-hdfs/gridftp-inetd.conf -dsi hdfs
true
acf1b5211b723496430f9ac51025229f1d7aec9f
Shell
ZiyangJiao/IODA-SOSP21-AE
/rtk/all.sh
UTF-8
1,251
3.765625
4
[]
no_license
#!/bin/bash # Huaicheng <huaicheng@cs.uchicago.edu> # Process raw experimental data and plot the graph in one shot usage() { echo "" echo " Usage: $0 <workload>" echo " e.g. $0 tpcc" echo "" exit } if [[ $# != 1 ]]; then usage fi # resolve the correct absolute path SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do TOPDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SOURCE="$(readlink "$SOURCE")" [[ $SOURCE != /* ]] && SOURCE="$TOPDIR/$SOURCE" done TOPDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" RAWDIR=$TOPDIR/raw DATDIR=$TOPDIR/dat SCRIPTDIR=$TOPDIR/script PLOTDIR=$TOPDIR/plot EPSDIR=$TOPDIR/eps STATDIR=$TOPDIR/stat ############################################################### INP_TARGET=$1 # supported TYPE: lat-cdf, lat-time, iops-time TARGET=$INP_TARGET TYPE="lat-cdf" # only needed when generating dat files if [[ -n $(ls -l raw/$TARGET | grep ".log") ]]; then $SCRIPTDIR/raw2dat.sh $TYPE $TARGET 0 1 0.0001 fi # generate plot file first #$SCRIPTDIR/genplot.sh $TARGET $TYPE # get statistics #$SCRIPTDIR/getstat.sh $TARGET # plot the graph #gnuplot $PLOTDIR/$TARGET.plot # open the graph #pdfreader $EPSDIR/$TARGET.eps #echo "Removing raw/$TARGET/*.tmp files ..." #rm -rf raw/$TARGET/*tmp
true
b55a808043ce4f042833db7bb4702e69860faee1
Shell
very-twi/vesta
/bin/v_change_db_password
UTF-8
1,684
3.578125
4
[]
no_license
#!/bin/bash # info: changing userdb password #----------------------------------------------------------# # Variable&Function # #----------------------------------------------------------# # Argument defenition user=$1 database=$2 db_password=$3 # Importing variables source $VESTA/conf/vars.conf source $V_CONF/vesta.conf source $V_FUNC/shared.func source $V_FUNC/db.func #----------------------------------------------------------# # Verifications # #----------------------------------------------------------# # Checking arg number check_args '3' "$#" 'user db_name db_password' # Checking argument format format_validation 'user' 'database' 'db_password' # Checking db system is enabled is_system_enabled 'db' # Checking user is_user_valid # Checking user is active is_user_suspended # Checking db existance is_db_valid # Checking db is active is_db_suspended #----------------------------------------------------------# # Action # #----------------------------------------------------------# # Define database variables db_user=$(get_db_value '$USER') host=$(get_db_value '$HOST') type=$(get_db_value '$TYPE') # Switching on db type case $type in mysql) change_db_mysql_password ;; pgsql) change_db_pgsql_password ;; esac #----------------------------------------------------------# # Vesta # #----------------------------------------------------------# # Hiding password V_EVENT="$V_DATE $V_SCRIPT $user $database *****" # Logging log_event 'system' "$V_EVENT" exit
true
a51739596d770cb0a0dd40619f7a0fd7d2527932
Shell
mjbright/christian-posta.kube-demos
/TOCONVERT/deployment/demo.sh
UTF-8
1,113
3.203125
3
[ "Apache-2.0" ]
permissive
#!/bin/bash . $(dirname ${BASH_SOURCE})/../util.sh SOURCE_DIR=$PWD desc "Create a service that fronts any version of this demo" run "cat $(relative svc.yaml)" run "kubectl --namespace=demos apply -f $(relative svc.yaml)" desc "Deploy v1 of our app" run "cat $(relative deployment.yaml)" run "kubectl --namespace=demos apply -f $(relative deployment.yaml)" desc "Check out our deployment" run "kubectl get deployment" run "kubectl get pods" run "kubectl get svc" tmux split-window -v -d -c $SOURCE_DIR tmux send-keys -t bottom C-z './_deploy_1.sh' Enter desc "Ready to do a deployment?" read -s desc "Update the deployment" run "cat $(relative deployment.yaml) | sed 's/ v1/ v2/g' | kubectl --namespace=demos apply -f-" desc "Deployment history" run "kubectl --namespace=demos rollout history deployment deployment-demo" desc "Rollback the deployment" run "kubectl --namespace=demos rollout undo deployment deployment-demo" tmux send-keys -t bottom C-c tmux send-keys -t bottom C-z 'exit' Enter desc "clean up" run "kubectl delete deployment/deployment-demo" run "kubectl delete svc/deployment-demo"
true
86f1b6541a062b8f91df8f8c7c116787dbb285bf
Shell
ojroques/dotfiles
/zsh/.local/share/zsh/functions/up
UTF-8
293
3.828125
4
[]
no_license
#!/bin/bash # Go to the n-th parent folder function up { if [[ $# -eq 0 ]]; then cd "../" elif [[ $# -eq 1 ]] && [[ $1 -gt 0 ]]; then local up_dir="" for _ in $(seq 1 "$1"); do up_dir+="../" done cd "$up_dir" || return else echo "Usage: up [n > 0]" fi }
true
5d20180d2bf6445d02efd2f93c634863c4f950f9
Shell
sebastian-nagel/cc-crawl-statistics
/plot.sh
UTF-8
1,349
3.671875
4
[ "Apache-2.0" ]
permissive
#!/bin/bash set -exo pipefail LATEST_CRAWL=$(basename $(ls stats/CC-MAIN-201*.gz | tail -n 1) .gz) function update_json() { regex="$1" excerpt="$2" if [ -e "$excerpt" ] && grep -qF "$LATEST_CRAWL" $excerpt; then zgrep -h "$regex" stats/$LATEST_CRAWL.gz >>$excerpt else zcat stats/CC-MAIN-*.gz | grep -h "$regex" >$excerpt fi } # filter data to speed-up reading while plotting update_json '^\["size' stats/excerpt/size.json update_json '^\["histogram"' stats/excerpt/histogram.json update_json '^\["tld"' stats/excerpt/tld.json update_json '^\["mimetype"' stats/excerpt/mimetype.json update_json '^\["charset"' stats/excerpt/charset.json update_json '^\["[^"]*language"' stats/excerpt/language.json python3 plot/crawl_size.py <stats/excerpt/size.json python3 plot/overlap.py <stats/excerpt/size.json python3 plot/histogram.py <stats/excerpt/histogram.json (cat stats/crawler/CC-MAIN-*.json; grep -E '"CC-MAIN-201(6-[^0][0-9]|[789]-)' stats/excerpt/size.json) \ | python3 plot/crawler_metrics.py python3 plot/tld.py CC-MAIN-2016-07 CC-MAIN-2017-04 CC-MAIN-2018-05 $LATEST_CRAWL <stats/excerpt/tld.json python3 plot/mimetype.py <stats/excerpt/mimetype.json python3 plot/charset.py <stats/excerpt/charset.json python3 plot/language.py <stats/excerpt/language.json
true
1375c1cfc15fb19a76d5492cece2e8b6a9c14d35
Shell
gaochangshui-trec/SoftChouhyou_CGI
/CGI/CHOUHYOU_CATEGORY_KENSAKU.SEARCH
UTF-8
18,648
3.359375
3
[]
no_license
#!/bin/bash -xv # # CHOUHYOU_CATEGORY_KENSAKU.SEARCH >>> カテゴリ情報検索 # Usage : CHOUHYOU_CATEGORY_KENSAKU.SEARCH # # Written by Tan.zhihui(TRE・CHINA) / Date : 11 Sep. 2019 # Alter by Zhang.Yunfeng(TRE・CHINA) / Date : 16 Dec. 2019 #///////////////////////////////////////////////////////////////////////// # 初期設定 #///////////////////////////////////////////////////////////////////////// # 環境変数設定 export PATH=/home/SMART:/home/SMART_TRIAL:/usr/local/bin:${PATH} export LANG=ja_JP.UTF-8 ## ログディレクトリの定義 cgishld=/home/trial/AP/SOFT_CHOUHYOU logd=${cgishld}/LOG ##走行ログの記録 echo "${logd}/LOG.$(basename $0).$(date +%Y%m%d)_$(date +%H%M%S)_$$" &>/dev/null exec 2>${logd}/LOG.$(basename $0).$(date +%Y%m%d)_$(date +%H%M%S)_$$ # ディレクトリ定義 tmp=/tmp/$$-$(basename $0)_$(date +%Y%m%d)_$(date +%H%M%S) dir=/home/trial lv4d=/home/trial/APDATA/SOFT_CHOUHYOU/POMPA tbld=/SKCWEB/TBL act_jand=/home/trial/APDATA/SKCS/POMPA/MASTER # エラー時の終了処理定義 ERROR_EXIT(){ exit 1 } # 変数チェック [ $# -ne 2 ] && exit 1 kikan=$1 #期間ID paramfile=$2 #パラメータファイル #入力パラメータ kisetutype=$(awk '$1=="1"{print $2}' ${paramfile}) #季節ID line=$(awk '$1=="2"{print $2}' ${paramfile}) #lineID bumon=$(awk '$1=="3"{print $2}' ${paramfile}) #部門ID gategory=$(awk '$1=="4"{print $2}' ${paramfile}) #ミニ部門ID div=$(awk '$1=="5"{print $2}' ${paramfile}) #divID #出力パラメータ out_headname=$(awk '$1=="6"{print $2}' ${paramfile}) #データヘッダー名(最後の行) out_colname=$(awk '$1=="7"{print $2}' ${paramfile}) #データ列名 out_groupheaders=$(awk '$1=="8"{print $2}' ${paramfile}) #データヘッダー情報(最後の行以外) out_info=$(awk '$1=="9"{print $2}' ${paramfile}) #データ明細 out_color=$(awk '$1=="10"{print $2}' ${paramfile}) #バックグラウンド色 out_mergecell=$(awk '$1=="11"{print $2}' ${paramfile}) #データ合弁 out_weekdetail=$(awk '$1=="12"{print $2}' ${paramfile}) #週別明細データ out_kategory_week=$(awk '$1=="13"{print $2}' ${paramfile}) #カテゴリ開始週と終了週 #年ID year=$(awk '$1=="'${kikan}'"{print $3}' ${lv4d}/KILLER/MASTER/COMMON/MST_KIKAN) #AW/SS取得 kisetuid=$(awk '$1=="'${kikan}'"{print $4}' ${lv4d}/KILLER/MASTER/COMMON/MST_KIKAN) kisetuname=$(awk '$1=="'${kikan}'"{print $4=="1"?"SS":"AW"}' ${lv4d}/KILLER/MASTER/COMMON/MST_KIKAN) #季節マスタ作成 echo ${kisetuid} | hejoin -k3 - ${lv4d}/KILLER/MASTER/COMMON/MST_KISETUTYPE | # 1.季節区分ID 2.季節区分名 3.タイプ kuniq -k1,2 > $tmp-kisetumst # 1.季節区分ID 2.季節区分名 [ $(errchk ${PIPESTATUS[@]}) -eq 0 ] || ERROR_EXIT #有効期間以外の場合、最終週のデータを利用する対応 echo ${lv4d}/KILLER/MAKE_DATA/${kisetuname}/${year}/20* | tov | awk '$1!="'${lv4d}'/KILLER/MAKE_DATA/'${kisetuname}'/'${year}'/20*"' > $tmp-filelist [ $(errchk ${PIPESTATUS[@]}) -eq 0 ] || ERROR_EXIT if [ -s $tmp-filelist ];then lstfile=$(tail -n1 $tmp-filelist) thisweek=$(basename ${lstfile}) else exit 0 fi #ファイルルート base_chouhyo_data=${lv4d}/KILLER/MAKE_DATA/${kisetuname}/${year}/${thisweek}/BASE_CHOUHYO_DATA if [ ! -s ${base_chouhyo_data} ];then exit 0 else echo "true" >/dev/null fi #マスタディレクトリー masterd=${lv4d}/KILLER/MASTER/${kisetuname}/${year}/ #1:ディビジョンCD 2:ラインCD 3:部門CD 4:カテゴリCD 5:地域CD 6:ゾーンCD 7:エリアCD 8:店CD 9:季節ID 10:週CD #11:今年実績数 12:昨年実績数 13:今年在庫数 14:昨年在庫数 15:計画数 16:登録者 17:参照年売上金額 #18:計画年売上金額 19:参照年在庫金額 20:計画年在庫金額 21:プロパー売れ数 if [ -s ${kisetutype} ];then hejoin -k9 ${kisetutype} ${base_chouhyo_data} > $tmp-result_one [ $? -eq 0 ] || ERROR_EXIT fi if [ -s ${gategory} ];then selcol -c1 -c1 -c1 -c1 ${gategory} | substr -c1.1.4 -c2.5.4 -c3.9.4 -c4.13.4 | hejoin -k1,4 - $tmp-result_one > $tmp-result_two [ $(errchk ${PIPESTATUS[@]}) -eq 0 ] || ERROR_EXIT elif [ -s ${bumon} ];then selcol -c1 -c1 -c1 ${bumon} | substr -c1.1.4 -c2.5.4 -c3.9.4 | hejoin -k1,3 - $tmp-result_one > $tmp-result_two [ $(errchk ${PIPESTATUS[@]}) -eq 0 ] || ERROR_EXIT elif [ -s ${line} ];then selcol -c1 -c1 ${line} | substr -c1.1.4 -c2.5.4 | hejoin -k1,2 - $tmp-result_one > $tmp-result_two [ $(errchk ${PIPESTATUS[@]}) -eq 0 ] || ERROR_EXIT elif [ -s ${div} ];then hejoin -k1 ${div} $tmp-result_one > $tmp-result_two [ $? -eq 0 ] || ERROR_EXIT else cp $tmp-result_one $tmp-result_two [ $? -eq 0 ] || ERROR_EXIT fi #選択のデータによって有効な期間作成 weekfile=${lv4d}/KILLER/SET_DATA/${kisetuname}/${year}/DIV_LINE_BUMON_CATEGORY_ITEM_WEEK_KEIKAKU kuniq -k1,4 $tmp-result_two | # 1.DIVCD 2.ラインCD 3.部門CD 4.カテゴリCD hejoin -k1,4 - ${weekfile} | # 1.DIVCD 2.ラインCD 3.部門CD 4.カテゴリCD 5.アイテムCD 6.販売開始週 7.販売終了週 8.計画数量 kuniq -k6,7 | # 1.販売開始週 2.販売終了週 tov | kuniq -k1 > $tmp-weekmst # 1.週CD [ $(errchk ${PIPESTATUS[@]}) -ne 0 ] && ERROR_EXIT minweek=$(head -n1 $tmp-weekmst) maxweek=$(tail -n1 $tmp-weekmst) awk '$10>="'${minweek}'"&&$10<="'${maxweek}'"' $tmp-result_two > $tmp-result_three #1:ディビジョンCD 2:ラインCD 3:部門CD 4:カテゴリCD 5:地域CD 6:ゾーンCD 7:エリアCD 8:店CD 9:季節ID 10:週CD #11:今年実績数 12:昨年実績数 13:今年在庫数 14:昨年在庫数 15:計画数 16:登録者 17:参照年売上金額 #18:計画年売上金額 19:参照年在庫金額 20:計画年在庫金額 21:プロパー売れ数 [ $? -eq 0 ] || ERROR_EXIT awk '$10<"'${thisweek}'"' $tmp-result_three | #1:ディビジョンCD 2:ラインCD 3:部門CD 4:カテゴリCD 5:地域CD 6:ゾーンCD 7:エリアCD 8:店CD 9:季節ID 10:週CD #11:今年実績数 12:昨年実績数 13:今年在庫数 14:昨年在庫数 15:計画数 16:登録者 17:参照年売上金額 #18:計画年売上金額 19:参照年在庫金額 20:計画年在庫金額 21:プロパー売れ数 selcol -c1,4 -c9 -c11,12 -c15 | #1:ディビジョンCD 2:ラインCD 3:部門CD 4:カテゴリCD 5:季節ID #6:今年実績数 7:昨年実績数 8:計画数 ssort -k1,5 | sumup -k1,5 -c6,8 > $tmp-result_lastweek #1:ディビジョンCD 2:ラインCD 3:部門CD 4:カテゴリCD 5:季節ID #6:今年実績数 7:昨年実績数 8:計画数 [ $(errchk ${PIPESTATUS[@]}) -ne 0 ] && ERROR_EXIT cat $tmp-result_three > $tmp-result_final #awk '$10<="'${thisweek}'"' $tmp-result_three > $tmp-result_final #1:ディビジョンCD 2:ラインCD 3:部門CD 4:カテゴリCD 5:地域CD 6:ゾーンCD 7:エリアCD 8:店CD 9:季節ID 10:週CD #11:今年実績数 12:昨年実績数 13:今年在庫数 14:昨年在庫数 15:計画数 16:登録者 17:参照年売上金額 #18:計画年売上金額 19:参照年在庫金額 20:計画年在庫金額 21:プロパー売れ数 [ $? -eq 0 ] || ERROR_EXIT #週数 weekcolcnt=$(kuniq -k10 $tmp-result_final|rowc) #データ列名 seq $[13+${weekcolcnt}] | # 1.列ヘッダー awk '{print "F"$1}' | # 1.列ヘッダー toh > ${out_colname} [ $(errchk ${PIPESTATUS[@]}) -ne 0 ] && ERROR_EXIT cat << FIN >> $tmp-headname_str DIV ライン 部門 カテゴリ名 季節区分 計画 昨年 達成率 昨対比 消化率 プロパー消化率 累计 累計 FIN #データヘッダー名(最後の行) kuniq -k10 $tmp-result_final | #週CD awk '{print substr($1,5,2)*1"週"}' | toh | hcat $tmp-headname_str - >${out_headname} [ $(errchk ${PIPESTATUS[@]}) -ne 0 ] && ERROR_EXIT if [ ! -s $tmp-result_final ];then rm -rf $tmp-* &>/dev/null exit 0 fi [ $? -eq 0 ] || ERROR_EXIT #null文字列出力 seq 1 13 | awk '{print "null"}' | toh >$tmp-groupheaders_str [ $(errchk ${PIPESTATUS[@]}) -ne 0 ] && ERROR_EXIT :> $tmp-groupheaders_week kuniq -k10 $tmp-result_final | #データヘッダー情報(最後の行以外)の週数 while read weekcd ; do sdate -d ${weekcd}w | selcol -c1 | awk '{print substr($1,5,2)*1"/"substr($1,7,2)*1}' >> $tmp-groupheaders_week [ $(errchk ${PIPESTATUS[@]}) -ne 0 ] && ERROR_EXIT :; done [ $(errchk ${PIPESTATUS[@]}) -ne 0 ] && ERROR_EXIT #データヘッダー情報(最後の行以外)出力 toh $tmp-groupheaders_week | hcat $tmp-groupheaders_str - | cat ${out_colname} - >${out_groupheaders} [ $(errchk ${PIPESTATUS[@]}) -ne 0 ] && ERROR_EXIT uniqdata_row=$(kuniq -k1,4@9 $tmp-result_final|rowc) #表合併 seq 0 $[uniqdata_row-1] | awk '{print $1*5}' | crossjoin - <(seq 0 10) | awk '{print $1,$2,"5","1"}' | cat <(echo "row col rowspan colspan") - >${out_mergecell} # 1.行 2.列 3.行幅 4.列幅 [ $(errchk ${PIPESTATUS[@]}) -ne 0 ] && ERROR_EXIT #データ明細作成 #1:ディビジョンCD 2:ラインCD 3:部門CD 4:カテゴリCD 5:地域CD 6:ゾーンCD 7:エリアCD 8:店CD 9:季節ID 10:週CD #11:今年実績数 12:昨年実績数 13:今年在庫数 14:昨年在庫数 15:計画数 16:登録者 17:参照年売上金額 #18:計画年売上金額 19:参照年在庫金額 20:計画年在庫金額 21:プロパー売れ数 #$tmp-result_final cat << FIN >> $tmp-keymst 1 A 実績 2 B 計画 3 C 昨年 4 D 在庫 5 E 昨年在庫 FIN #週別実績作成 #1:ディビジョンCD 2:ラインCD 3:部門CD 4:カテゴリCD 5:地域CD 6:ゾーンCD 7:エリアCD 8:店CD #11:今年実績数 12:昨年実績数 13:今年在庫数 14:昨年在庫数 15:計画数 16:登録者 #17:参照年売上金額 18:計画年売上金額 19:参照年在庫金額 20:計画年在庫金額 21:プロパー売れ数 selcol -c1,4 -c9,11 -c15 -c12,14 $tmp-result_final | #1:DIVCD 2:ラインCD 3:部門CD 4:カテゴリCD 5:季節ID 6:週CD #7:今年実績数 8:計画数 9:昨年実績数 10:今年在庫数 11:昨年在庫数 ssort -k1,6 | sumup -k1,6 -c7,11 | #1:DIVCD 2:ラインCD 3:部門CD 4:カテゴリCD 5:季節ID 6:週CD #7:今年実績数 8:計画数 9:昨年実績数 10:今年在庫数 11:昨年在庫数 tee $tmp-result_thisweeksum | pivot -k1,5 | #1:DIVCD 2:ラインCD 3:部門CD 4:カテゴリCD 5:季節ID 6.A/B/C/D/E 7.売数 8.売数... tail -n +2 | hijoin -k6 <(selcol -c2 -c1 $tmp-keymst) | #1:DIVCD 2:ラインCD 3:部門CD 4:カテゴリCD 5:季節ID 6.A/B/C/D/E 7.順番 8.売数 9.売数... delcol -c6 > $tmp-syubetu_data #1:DIVCD 2:ラインCD 3:部門CD 4:カテゴリCD 5:季節ID 6.順番 7.売数 8.売数... [ $(errchk ${PIPESTATUS[@]}) -ne 0 ] && ERROR_EXIT cp $tmp-result_thisweeksum ${out_weekdetail} sumup -k1,5 -c7,11 $tmp-result_thisweeksum | #1:DIVCD 2:ラインCD 3:部門CD 4:カテゴリCD 5:季節ID #6:今年実績数 7:計画数 8:昨年実績数 9:今年在庫数 10:昨年在庫数 scalc '$[1:8],$9/'${weekcolcnt}',$10/'${weekcolcnt} | #1:DIVCD 2:ラインCD 3:部門CD 4:カテゴリCD 5:季節ID #6:今年実績数 7:計画数 8:昨年実績数 9:今年在庫数 10:昨年在庫数 round -tA -c9.0 -c10.0 | tee $tmp-graphdata | tov -k1,5 | insseq -k1,5 | #1.順番 2:DIVCD 3:ラインCD 4:部門CD 5:カテゴリCD 6:季節ID 7.累積データ selcol -c2,6 -c1 -c7 | #1:DIVCD 2:ラインCD 3:部門CD 4:カテゴリCD 5:季節ID 6.順番 7.累積データ ssort -k1,6 | hijoin -k1,6 - $tmp-syubetu_data | #1:DIVCD 2:ラインCD 3:部門CD 4:カテゴリCD 5:季節ID 6.順番 7.累積データ8.売数 9.売数... hijoin -k6 <(kuniq -k1@3 $tmp-keymst) | #1:DIVCD 2:ラインCD 3:部門CD 4:カテゴリCD 5:季節ID 6.順番 7.タイトル 8.累積データ 9.売数 10.売数... delcol -c6 > $tmp-basedata #1:DIVCD 2:ラインCD 3:部門CD 4:カテゴリCD 5:季節ID 6.タイトル 7.累積データ 8.売数 9.売数... [ $(errchk ${PIPESTATUS[@]}) -ne 0 ] && ERROR_EXIT #達成率=今週までの実績/今週まで計画数 #消化率=今週までの実績/総計画数 #昨対比=今週までの実績/去年同じ週累積実績 #プロパー消化率=総プロパー売れ数/総計画数 #1:ディビジョンCD 2:ラインCD 3:部門CD 4:カテゴリCD 5:地域CD 6:ゾーンCD 7:エリアCD 8:店CD 9:季節ID 10:週CD #11:今年実績数 12:昨年実績数 13:今年在庫数 14:昨年在庫数 15:計画数 16:登録者 17:参照年売上金額 #18:計画年売上金額 19:参照年在庫金額 20:計画年在庫金額 21:プロパー売れ数 selcol -c1,4 -c9,11 -c15 -c12 -c21 $tmp-result_three | #1:DIVCD 2:ラインCD 3:部門CD 4:カテゴリCD 5:季節ID 6:週CD #7:今年実績数 8:計画数 9:昨年実績数 10:プロパー売れ数 ssort -k1,5 | sumup -k1,5 -c8,10 | #1:DIVCD 2:ラインCD 3:部門CD 4:カテゴリCD 5:季節ID 6:計画数(総) 7:昨年実績数(総) 8:プロパー売れ数(総) hijoin -k1,5 <(sumup -k1,5 -c7,9 $tmp-result_thisweeksum) | #1:DIVCD 2:ラインCD 3:部門CD 4:カテゴリCD 5:季節ID 6:今年実績数 #7:計画数(今週まで) 8:昨年実績数(今週) 9:計画数(総) 10:昨年実績数(総) 11:プロパー売れ数(総) hijoin -k1,5 $tmp-result_lastweek | #1:DIVCD 2:ラインCD 3:部門CD 4:カテゴリCD 5:季節ID 6:今年実績数(先週まで) 7:昨年実績数(先週まで) 8:計画数(先週まで) #9:今年実績数 10:計画数(今週まで) 11:昨年実績数(今週) 12:計画数(総) 13:昨年実績数(総) 14:プロパー売れ数(総) scalc '$[1:5],$12,$13,$6*100/$8,$6*100/$7,$6*100/$12,$14*100/$12'| #1:DIVCD 2:ラインCD 3:部門CD 4:カテゴリCD 5:季節ID 6:計画数(総) #7:昨年実績数(総) 8.達成率 9.昨対比 10.消化率 11:プロパー消化率 round -tA -c8.0 -c9.0 -c10.0 -c11.0 | awk '{print $1,$2,$3,$4,$5,$6,$7,$8"%",$9"%",$10"%",$11"%"}' > $tmp-groupdata #1:DIVCD 2:ラインCD 3:部門CD 4:カテゴリCD 5:季節ID 6:計画数(総) #7:昨年実績数(総) 8.達成率 9.昨対比 10.消化率 11:プロパー消化率 [ $(errchk ${PIPESTATUS[@]}) -ne 0 ] && ERROR_EXIT kuniq -k1,5 $tmp-groupdata | #1:DIVCD 2:ラインCD 3:部門CD 4:カテゴリCD 5:季節ID hijoin -k1 ${masterd}/MST_DIV_NAME | #1:DIVCD 2.DIV名 3:ラインCD 4:部門CD 5:カテゴリCD 6:季節ID hijoin -k3 <(kuniq -k2,3 ${masterd}/MST_DIV_LINE_NAME) - | #1:DIVCD 2.DIV名 3:ラインCD 4:ライン名 5:部門CD 6:カテゴリCD 7:季節ID hijoin -k5 <(kuniq -k3,4 ${masterd}/MST_DIV_LINE_BUMON_NAME) - | #1:DIVCD 2.DIV名 3:ラインCD 4:ライン名 5:部門CD 6:部門名 7:カテゴリCD 8:季節ID hijoin -k7 <(kuniq -k4,5 ${masterd}/MST_DIV_LINE_BUMON_CATEGORI_NAME) - | #1:DIVCD 2.DIV名 3:ラインCD 4:ライン名 5:部門CD 6:部門名 7:カテゴリCD 8:カテゴリ名 9:季節ID hijoin -k9 $tmp-kisetumst | #1:DIVCD 2.DIV名 3:ラインCD 4:ライン名 5:部門CD 6:部門名 7:カテゴリCD 8:カテゴリ名 9:季節ID 10:季節区分 awk '{print $1,$3,$5,$7,$9,1*$1":"$2,1*$3":"$4,1*$5":"$6,\ 1*$7":"$8,1*$9":"$10}' > $tmp-groupname #1:DIVCD 2:ラインCD 3:部門CD 4:カテゴリCD 5:季節ID 6:DIV名 7:ライン名 8:部門名 9:カテゴリ名 10:季節区分 [ $(errchk ${PIPESTATUS[@]}) -ne 0 ] && ERROR_EXIT hijoin -k1,5 $tmp-groupdata $tmp-basedata | #1:DIVCD 2:ラインCD 3:部門CD 4:カテゴリCD 5:季節ID 6:計画数(総) #7:昨年実績数(総) 8.達成率 9.昨対比 10.消化率 11.プロパー消化率 12.タイトル 13.累積データ 14.売数 15.売数... hijoin -k1,5 $tmp-groupname | #1:DIVCD 2:ラインCD 3:部門CD 4:カテゴリCD 5:季節ID 6:DIV名 7:ライン名 8:部門名 9:カテゴリ名 #10:季節区分 11:計画数(総) 12:昨年実績数(総) 13.達成率 14.昨対比 15.消化率 16.プロパー消化率 17.タイトル #18.累積データ 19.売数 20.売数... tee $tmp-tmpout_data | selcol -c6,NF | #1:DIV名 2:ライン名 3:部門名 4:カテゴリ名 5:季節区分 6:計画数(総) 7:昨年実績数(総) 8.達成率 9.昨対比 #10.消化率 11.プロパー消化率 12.タイトル 13.累積データ 14.売数 15.売数... cat ${out_colname} - > ${out_info} [ $(errchk ${PIPESTATUS[@]}) -ne 0 ] && ERROR_EXIT kuniq -k1,4 $tmp-tmpout_data | #1:DIVCD 2:ラインCD 3:部門CD 4:カテゴリCD hejoin -k1,4 - <(kuniq -k1,4@6,7 ${weekfile}) | #1:DIVCD 2:ラインCD 3:部門CD 4:カテゴリCD 5.開始週 6.終了週 awk '{print $5"週~"$6"週"}' > ${out_kategory_week} [ $(errchk ${PIPESTATUS[@]}) -ne 0 ] && ERROR_EXIT # $tmp-outweekdata # 1:DIVCD 2:カテゴリCD 3:今年週 4:今年週別実績 5:今年週別計画数 6:昨年週別実績 # 7:今年週別在庫数 8:昨年週別在庫数 #///////////////////////////////////////////////////////////////////////// # 終了部分 #///////////////////////////////////////////////////////////////////////// # 終了 rm -rf $tmp-* &>/dev/null exit 0
true
6e32b1ccada8a3309fb287b448a95ed2c6b545cb
Shell
beentaken/sgt
/local/cal
UTF-8
1,406
4.15625
4
[]
no_license
#!/bin/bash # Script to wrapper cal(1) and give it more sensible command-line # parsing. REALCAL=/usr/bin/cal OPTS="-3 -m" month=`date +%m` month=$[1$month - 100] # trim leading zero, avoiding octal trap year=`date +%Y` # Possible invocations: # # Every invocation which prints a single month also prints the two # either side. # # - just `cal': prints the current month. # - `cal <n>' where n <= 12: prints the nearest month with that # number (erring on the side of the future if it's 6 months away # from the current one). # - `cal <n> <m>': prints month n in year m, or month m in year n, # depending on which of m and n is <= 12. If both are, defaults # to the usual behaviour of cal (month n, year m). # # - `cal <n>' where n > 12: prints the entire calendar for that # year, as usual. doingopts=true while $doingopts; do case "$1" in -m | -s | -1 | -3 | -j | -y ) OPTS="$OPTS $1"; shift;; *) doingopts=false;; esac done if test "$#" = 2; then if test "$1" -gt 12; then month=$2 year=$1 else month=$1 year=$2 fi elif test "$#" -gt 2; then exec $REALCAL $OPTS "$1" elif test "$#" = 1 && test "$1" -gt 12; then exec $REALCAL -y "$1" elif test "$#" = 1; then if test "$1" -gt $[$month + 6]; then year=$[$year - 1] elif test "$month" -ge $[$1 + 6]; then year=$[$year + 1] fi month=$1 fi exec $REALCAL $OPTS "$month" "$year"
true
9dd51ef6b37a1ddf0cca0a2cfcf45b60618b48e8
Shell
Dniskk/carma
/.travis-ci/after_success.sh
UTF-8
225
2.8125
3
[ "Apache-2.0" ]
permissive
#!/usr/bin/env bash set -eo pipefail if [[ "$DEBUG_CI" == "true" ]]; then set -x fi if [[ "$COVERAGE" == "true" ]]; then cd "${TRAVIS_BUILD_DIR}"/build lcov --list coverage.info coveralls-lcov coverage.info fi
true
f5484682d69d0b228d168c501116316c43739b4e
Shell
Jjagg/OpenWindow
/generators/WaylandSharpGen/regen.sh
UTF-8
336
3.125
3
[ "MIT" ]
permissive
#!/bin/bash cd $(dirname $0) cat protocols/protocols.txt | while read line do if [ -z ${line// } ]; then continue fi split=($line) proto="protocols/${split[0]}" dst="generated/${split[1]}" set -x dotnet run -- $proto $dst { set +x; } 2>/dev/null done set -x cp generated/* ../../src/Backends/Wayland/ --verbose
true
ce5e416977df0a94f57ba9c5aff04322aae8b188
Shell
karolba/jimp1
/prepare.sh
UTF-8
3,485
3.828125
4
[]
no_license
#!/bin/bash set -u shopt -s nullglob mydir=$(dirname "$(readlink -f "$0")") PATH="$PATH:$mydir/.exodus/bin" curl_testcase() { # args: testcase_id, <in|out> local testfile="$pdir/test_$1_$2" curl "http://$ip/domjudge/public/problem.php?id=$id&testcase=$1&type=$2" -o "$testfile" # DOMJudge zwraca '200 OK' jak nie jest ok if [[ "$(cat "$testfile")" == '<fieldset class="error"><legend>ERROR</legend>'* ]]; then rm -f "$testfile" return 1 fi } if [[ $# != 1 ]]; then echo "Usage: $0 <problem id>" >&2 exit 1 fi id=$1 ip=10.156.207.151 pdir=problems/$id mkdir -p $pdir problem_txt_is_header=0 problem_text=$(curl "http://$ip/domjudge/public/problem.php?id=$id") problem_text_type=$(file - <<<"$problem_text") if echo "$problem_text_type" | grep -qi '[^a-z]pdf[^a-z]'; then echo "$problem_text" > "$pdir/problem.pdf" else echo "$problem_text" > "$pdir/problem.txt" if file -b "$pdir/problem.txt" | grep -q ' CRLF '; then dos2unix "$pdir/problem.txt" fi if grep -q '^#ifdef ' "$pdir/problem.txt" && grep -q '^#endif' "$pdir/problem.txt"; then problem_txt_is_header=1 ln -s problem.txt "$pdir/problem.h" fi fi (( testcase_n = 1 )) while curl_testcase $testcase_n 'in' && curl_testcase $testcase_n 'out'; do (( testcase_n += 1 )) done solution_file=$pdir/solution.c if ! [[ -f $solution_file ]]; then echo "// author: $(getent passwd $USER | cut -d ':' -f 5 | cut -d ',' -f 1)" > "$solution_file" cat >> "$solution_file" <<EOF #include <stdio.h>$( [[ $problem_txt_is_header == 1 ]] && echo -e '\n\n#include "problem.h"' ) int main() { return 0; } EOF fi cat > $pdir/vim.sh << 'EOF' #!/bin/bash if [[ $# == 0 ]]; then set -- solution.c fi if vim --version | grep -q '^NVIM'; then exec vim +':map <CR> :w<CR>:te ./run.sh<CR>a' +'map \<CR> :w<CR>:te ./run.sh line<CR>a' "$@" else exec vim +':map <CR> :w<CR>:!./run.sh<CR>' +'map \<CR> :w<CR>:!./run.sh line<CR>' "$@" fi EOF cat > $pdir/run.sh <<'EOF' #!/bin/bash cwdiff() { wdiff -n -w $'\033[31m' -x $'\033[0m' -y $'\033[32m' -z $'\033[0m' "$@"; } if ! command -v wdiff &>/dev/null || [[ $1 == line ]]; then cwdiff() { cat "$1" | git diff -w --color=always --text --no-index -- - "$2" | tail -n+5 | awk '1; END{ if(NR) exit 1 }'; } fi failed_input() { echo -en '\e[100mInput:\e[0m\n\e[36m'; cat "$1"; echo -en '\e[0m'; return 1; } set -uve EOF if grep -q '^#include <gtest' $pdir/test_1_in; then if file $pdir/test_1_in | grep -q 'C++ source'; then dos2unix $pdir/test_1_in echo -e '\n// vim: ft=cpp' >> $pdir/test_1_in { echo "g++ -xc++ -std=c++17 test_1_in solution.c -I ../../gtest/include -L ../../gtest/lib -lgtest -lgtest_main -pthread -osolution_test" echo './solution_test' } >> $pdir/run.sh fi else echo 'gcc -O2 -static -pipe -Wall solution.c -lm -o solution' >> $pdir/run.sh { test_in= for test_in in $pdir/test_*_in; do # nullglob is set test_in=$(basename "$test_in") test_out="${test_in%_in}_out" echo "cwdiff <(./solution < $test_in) $test_out || failed_input $test_in" done if [[ -z $test_in ]]; then echo "#cwdiff <(./solution < test_1_in) test_1_out || failed_input test_1_in" fi } | sort --version-sort >> $pdir/run.sh fi chmod +x $pdir/run.sh $pdir/vim.sh ln -sf ../../submit.sh $pdir/submit.sh # vim: expandtab
true
8749743cc90557c82078da3c65e92efb9ab6053d
Shell
JCFFlores/scripts
/raise_volume
UTF-8
382
3.078125
3
[ "MIT" ]
permissive
#!/bin/sh SINK=$(pactl list short sinks | sed -e 's,^\([0-9][0-9]*\)[^0-9].*,\1,' | head -n 1) VOL=$(pactl list sinks | grep '^[[:space:]]Volume:' | head -n $(( SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,') pactl set-sink-mute "$SINK" 0 if test `expr $VOL + 5` -gt 100; then pactl set-sink-volume "$SINK" 100% else pactl set-sink-volume "$SINK" +5% fi
true
d7e895d1e2142ca21ab4fd3a8a91ef9532a4963d
Shell
rstacruz/kisswiki
/src/ubuntu/mouse.sh
UTF-8
783
3.09375
3
[]
no_license
#!/bin/bash DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" function isodate { echo $(date --iso-8601=seconds) } xset m 0 0 mouse_id=$1 speed=$2 echo "$(isodate) mouse_id: $mouse_id" 2>&1 | tee -a "$DIR/mouse.log" echo "$(isodate) speed: $speed" 2>&1 | tee -a "$DIR/mouse.log" xinput set-prop $mouse_id "Coordinate Transformation Matrix" $speed, 0, 0, 0, $speed, 0, 0, 0, 1 echo $(isodate) $(xset q | grep -A 1 Pointer) 2>&1 | tee -a "$DIR/mouse.log" echo $(isodate) $(xinput list-props 10 | grep "Coordinate Transformation Matrix") 2>&1 | tee -a "$DIR/mouse.log" # https://askubuntu.com/questions/773171/im-missing-mouse-pointer-speed-option-in-ubuntu-16-04/942445#942445 # https://www.reddit.com/r/linux_gaming/comments/1ew39a/mouse_sensitivity_and_linux_gaming/
true
5da1ed9358b99570fda7d0e9c1138f7c0b583feb
Shell
koara-local/dotfiles
/build/tmux/build.sh
UTF-8
244
2.65625
3
[]
no_license
#!/bin/bash -xeu if [ ! -d tmux ]; then git clone https://github.com/tmux/tmux.git fi cd tmux # checkout latest tag #git checkout $(git tag | sort -V | tail -n 1) git checkout 2.2 sh autogen.sh ./configure make -j4 sudo make install
true
0e64eb81c6455ab40d09053f5d4b4612639ba3a2
Shell
FRINXio/FRINX-machine
/config/set_env_secrets.sh
UTF-8
609
3.796875
4
[]
no_license
#!/bin/sh # set env variables from docker secret to service set -a FILES="/run/secrets/*" for __filePath in $FILES do if [ -f ${__filePath} ]; then . ${__filePath} cat ${__filePath} | while read line || [ -n "$line" ]; do case $line in '#'*) ;; # ignore comments '') ;; # ignore empty spaces *) export $(echo "${line}" | cut -d '=' -f1) >/dev/null test="${test} $line";; esac done fi done #create one command from multiple arguments for arg in $@ do cmd="$cmd $arg" done #execute command $cmd
true
e9bd8755a9957af3043b6c00dbfa75fb6f51aa1a
Shell
JhalakGupta/Transaction-Web-API
/infrastructure/aws/cloudformation/csye6225-aws-cf-create-stack.sh
UTF-8
1,355
3
3
[ "Apache-2.0" ]
permissive
STACK_NAME=$1 VPC_NAME=${STACK_NAME}-csye6225-vpc SUBNET1_NAME=${STACK_NAME}-csye6225-subnet1 SUBNET2_NAME=${STACK_NAME}-csye6225-subnet2 SUBNET3_NAME=${STACK_NAME}-csye6225-subnet3 SUBNET4_NAME=${STACK_NAME}-csye6225-subnet4 SUBNET5_NAME=${STACK_NAME}-csye6225-subnet5 SUBNET6_NAME=${STACK_NAME}-csye6225-subnet6 IG_NAME=${STACK_NAME}-csye6225-InternetGateway PUBLIC_ROUTE_TABLE=${STACK_NAME}-csye6225-public-route-table PRIVATE_ROUTE_TABLE=${STACK_NAME}-csye6225-private-route-table aws cloudformation create-stack --stack-name $STACK_NAME \ --template-body file://csye6225-cf-networking.json \ --parameters ParameterKey=VPCName,ParameterValue=$VPC_NAME \ ParameterKey=SubnetName1,ParameterValue=$SUBNET1_NAME \ ParameterKey=SubnetName2,ParameterValue=$SUBNET2_NAME \ ParameterKey=SubnetName3,ParameterValue=$SUBNET3_NAME \ ParameterKey=SubnetName4,ParameterValue=$SUBNET4_NAME \ ParameterKey=SubnetName5,ParameterValue=$SUBNET5_NAME \ ParameterKey=SubnetName6,ParameterValue=$SUBNET6_NAME \ ParameterKey=IGName,ParameterValue=$IG_NAME \ ParameterKey=PublicRouteTableName,ParameterValue=$PUBLIC_ROUTE_TABLE \ ParameterKey=PrivateRouteTableName,ParameterValue=$PRIVATE_ROUTE_TABLE aws cloudformation wait stack-create-complete --stack-name $STACK_NAME if [ $? -ne "0" ] then echo "Creation of Stack failed" else echo "Creation of Stack Success" fi
true
8fbc04f88e5023d10a62c6319cf82bad9b49bf2c
Shell
nnako/dotfiles
/init/70_APP_nextcloud_client__DEB.sh
UTF-8
2,350
2.890625
3
[]
no_license
# install NextCloud Client from debian packages # from: https://help.nextcloud.com/t/nextcloud-client-for-raspberry-pi/27989/62 # # get required packages # # define packages packages=( q/qtwebengine-opensource-src/libqt5webenginecore5_5.11.3+dfsg-2+deb10u1_armhf.deb q/qtwebengine-opensource-src/libqt5webenginewidgets5_5.11.3+dfsg-2+deb10u1_armhf.deb n/nextcloud-desktop/libnextcloudsync0_2.5.1-3+deb10u2_armhf.deb n/nextcloud-desktop/nextcloud-desktop_2.5.1-3+deb10u2_armhf.deb ) # DOES NOT WORK for newest installation #q/qtwebengine-opensource-src/libqt5webenginecore5_5.15.6+dfsg-2+b1_armhf.deb #q/qtwebengine-opensource-src/libqt5webenginewidgets5_5.15.6+dfsg-2+b1_armhf.deb #n/nextcloud-desktop/libnextcloudsync0_3.1.1-2+deb11u1_armhf.deb #n/nextcloud-desktop/nextcloud-desktop_3.1.1-2+deb11u1_armhf.deb #q/qtwebengine-opensource-src/libqt5webenginecore5_5.15.6+dfsg-2+b1_armhf.deb #q/qtwebengine-opensource-src/libqt5webenginewidgets5_5.15.6+dfsg-2+b1_armhf.deb #n/nextcloud-desktop/libnextcloudsync0_3.3.5-1_armhf.deb #n/nextcloud-desktop/nextcloud-desktop_3.3.5-1_armhf.deb # WORKS for Raspbian OS v2020-12-02 #q/qtwebengine-opensource-src/libqt5webenginecore5_5.11.3+dfsg-2+deb10u1_armhf.deb #q/qtwebengine-opensource-src/libqt5webenginewidgets5_5.11.3+dfsg-2+deb10u1_armhf.deb #n/nextcloud-desktop/libnextcloudsync0_2.5.1-3+deb10u2_armhf.deb #n/nextcloud-desktop/nextcloud-desktop_2.5.1-3+deb10u2_armhf.deb #q/qtwebengine-opensource-src/libqt5webenginecore5_5.11.3+dfsg-2+deb10u1_armhf.deb #q/qtwebengine-opensource-src/libqt5webenginewidgets5_5.11.3+dfsg-2+deb10u1_armhf.deb #n/nextcloud-desktop/libnextcloudsync0_2.5.1-3+deb10u1_armhf.deb #n/nextcloud-desktop/nextcloud-desktop_2.5.1-3+deb10u1_armhf.deb # download packages if (( ${#packages[@]} > 0 )); then e_header "Downloading DEB packages\n${packages[*]}" for package in "${packages[@]}"; do #wget https://debian.pkgs.org/10/debian-main-armhf/${package}.html wget http://ftp.br.debian.org/debian/pool/main/${package} done fi # install using dpkg if (( ${#packages[@]} > 0 )); then e_header "Installing DEB packages\n${packages[*]}" for package in "${packages[@]}"; do # install each package sudo dpkg -i "${package##*/}" # handle broken dependencies sudo apt -y --fix-broken install done fi
true
3a71c48c19cc857100942deddfe4251d54c2058e
Shell
igorbarinov/docker-parity-master
/configure-parity.sh
UTF-8
2,518
2.609375
3
[]
no_license
#!/bin/bash echo "home: $HOME" echo "user: $(whoami)" ##################### # create an account # ##################### PASSWORD=$(tr -cd '[:alnum:]' < /dev/urandom | fold -w30 | head -n1) echo $PASSWORD > $HOME/.parity-pass parity account new --password $HOME/.parity-pass address=0x$(cat $HOME/.parity/keys/*| jq '.address' -r) ################ # create chain # ################ cat > $HOME/chain.json <<EOL { "name": "Private", "engine": { "BasicAuthority": { "params": { "gasLimitBoundDivisor": "0x0400", "durationLimit": "0x0d", "authorities" : ["${address}"] } } }, "params": { "accountStartNonce": "0x00", "maximumExtraDataSize": "0x20", "minGasLimit": "0x1388", "networkID" : "0xad" }, "genesis": { "seal": { "generic": { "fields": 1, "rlp": "0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa" } }, "difficulty": "0x20000", "author": "0x0000000000000000000000000000000000000000", "timestamp": "0x00", "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "extraData": "0x", "gasLimit": "0x2fefd8" }, "accounts": { "0000000000000000000000000000000000000001": { "balance": "1", "nonce": "1048576", "builtin": { "name": "ecrecover", "pricing": { "linear": { "base": 3000, "word": 0 } } } }, "0000000000000000000000000000000000000002": { "balance": "1", "nonce": "1048576", "builtin": { "name": "sha256", "pricing": { "linear": { "base": 60, "word": 12 } } } }, "0000000000000000000000000000000000000003": { "balance": "1", "nonce": "1048576", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } }, "0000000000000000000000000000000000000004": { "balance": "1", "nonce": "1048576", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } }, "${address}": { "balance": "1000000" } } } EOL DAPP_PASSWORD=$(tr -cd '[:alnum:]' < /dev/urandom | fold -w30 | head -n1) command="parity: parity -lsync=trace,txqueue=trace,own_tx=trace --reseal-on-txs all --force-sealing --dapps-hosts all --dapps-interface 0.0.0.0 --dapps-port 8002 --dapps-user user --dapps-pass $DAPP_PASSWORD --chain $HOME/chain.json --author ${address} --unlock ${address} --password $HOME/.parity-pass --rpccorsdomain \"*\" --jsonrpc-hosts=all --jsonrpc-interface all >&1 1>>/var/log/parity.log 2>&1" echo $command >> /etc/goreman/Procfile # --force-sealing
true
e1c435f37b76f15decfb14b22ec9c7b6acf7da73
Shell
webbhm/MVP_CV
/scripts/processImage.sh
UTF-8
752
3.578125
4
[]
no_license
#!/bin/bash #This script extracts plant attributes from an image #Invoke this via cron on a regular (hourly?) basis to refresh the data #Author: Howard Webb #Date: 11/5/2017 echo "Process image for plant data" #Modify this path if you move the webcam image directory pic_dir="/home/pi/MVP/pictures/" pic2_dir="/home/pi/MVP/pictures_R/" web_dir="/home/pi/MVP/web/" python_dir="/home/pi/python/" #Pipe ls of the webcam directory from most recent to latest # Then clip off only the last line # Finally trim the string to just the name and store in the variable (File Name) FN=$(ls -latr "$pic2_dir" | tail -1 | awk '{print $NF}') #Check that got what expected echo "$pic_dir$FN" #Finally process the file python "$python_dir"findSeedling.py $pic2_dir$FN
true
0d45489581ed19e2bb1359b41957c6137e761f72
Shell
rishibodake/Snake-LadderProblem
/snakeAndLadder.sh
UTF-8
1,689
3.5
4
[]
no_license
#!/bin/bash -x #Discription:Snake & Ladder as per usercases #Author:Hrishikesh M Bodake #Since:March 7 2020 / Saturday diceCounter=0 termOfPlayer=1 startPosition=0 finishPosition=100 currentPosition=0 priviousPosition=0 player1Pos=0 player2Pos=0 winchecker=0 player=0 function rollDice(){ dicePos=$((RANDOM%6+1)) } function snake(){ if [[ $player -eq 1 ]] then if [[ $player1Pos -le 0 ]] then player1Pos=$player1Pos else player1Pos=$(($player1Pos-$dicePos)) fi elif [[ $player -eq 2 ]] then if [[ $player2Pos -le 0 ]] then player2Pos=$player2Pos else player2Pos=$(($player2Pos-$dicePos)) fi fi } function ladder(){ if [[ $player -eq 1 ]] then priviousPosition1=$player1Pos player1Pos=$(($player1Pos+$dicePos)) elif [[ $player -eq 2 ]] then priviousPosition2=$player1Pos player2Pos=$(($player2Pos+$dicePos)) fi } function noPlay(){ if [[ $player -eq 1 ]] then player1Pos=$(($player1Pos+0)) elif [[ $player -eq 2 ]] then player2Pos=$(($player2Pos+0)) fi } function play(){ while [[ $currentPosition -lt $finishPosition || $winchecker -eq 0 ]] do if [[ $termOfPlayer%2 -eq 0 ]] then player=1 else player=2 fi choice=$((RANDOM%3)) rollDice case $choice in 0) noPlay;; 1) snake;; 2) ladder ;; *) echo Wrong esac if [[ $currentPosition -gt $finishPosition ]] then currentPosition=$priviousPosition fi check ((termOfPlayer++)) done } check() { if [[ $player1Pos -eq 100 ]] then echo "Player 1 Won the game" winchecker=1 exit elif [[ $player2Pos -eq 100 ]] then echo "Player 2 Won the game" winchecker=1 exit fi } play
true
3b547ce1bb5a7fe9e660d97f092515f1b3389fcd
Shell
termux/termux-packages
/x11-packages/gw/build.sh
UTF-8
2,492
2.859375
3
[ "Apache-2.0" ]
permissive
TERMUX_PKG_HOMEPAGE=https://github.com/kcleal/gw TERMUX_PKG_DESCRIPTION="A browser for genomic sequencing data (.bam/.cram format)" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_MAINTAINER="clealk@cardiff.ac.uk" TERMUX_PKG_VERSION=0.8.2 TERMUX_PKG_SRCURL=https://github.com/kcleal/gw/archive/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=519f06fac2635a59614517ff00dc1e86e4f78c2926df504b03ba62a66a5de3e8 TERMUX_PKG_DEPENDS="glfw, htslib, libc++, libjpeg-turbo, opengl" TERMUX_PKG_BUILD_DEPENDS="fontconfig, freetype, libicu, libuuid, mesa-dev" TERMUX_PKG_AUTO_UPDATE=true TERMUX_PKG_BUILD_IN_SRC=true # htslib is not available for arm. TERMUX_PKG_BLACKLISTED_ARCHES="arm" termux_step_pre_configure() { LDFLAGS+=" -lEGL -llog" sed -i \ -e 's/-lpthread//g' \ -e '/\/usr\/local\/include/d' \ -e '/\/usr\/local\/lib/d' \ ./Makefile if [ "$TERMUX_ARCH" = "aarch64" ]; then sed -i 's/Release-x64/Release-arm64/g' ./Makefile elif [ "$TERMUX_ARCH" = "i686" ]; then sed -i 's/Release-x64/Release-x86/g' ./Makefile fi } termux_step_make() { local SKIA_URL_AARCH64="https://github.com/JetBrains/skia-build/releases/download/m93-87e8842e8c/Skia-m93-87e8842e8c-android-Release-arm64.zip" local SKIA_CHECKSUM_AARCH64="7286fe634cfcd499ef1232b9bdc6b08220daebde0de483639ed498a1dc1ec62e" local SKIA_URL_X86="https://github.com/JetBrains/skia-build/releases/download/m93-87e8842e8c/Skia-m93-87e8842e8c-android-Release-x86.zip" local SKIA_CHECKSUM_X86="e79868a2b791ec44673f981b68d5cb658dad3fcef97932ac7b4a80c3dd329e87" local SKIA_URL_X64="https://github.com/JetBrains/skia-build/releases/download/m93-87e8842e8c/Skia-m93-87e8842e8c-android-Release-x64.zip" local SKIA_CHECKSUM_X64="1546e41c0b2edc401639e1ed0dd32d9e8b30d478f1c4a5c345ee82f2a5e1b829" cd lib/skia/ case "$TERMUX_ARCH" in aarch64) termux_download "$SKIA_URL_AARCH64" "${TERMUX_PKG_CACHEDIR}/skia-${TERMUX_ARCH}.zip" "$SKIA_CHECKSUM_AARCH64" ;; i686) termux_download "$SKIA_URL_X86" "${TERMUX_PKG_CACHEDIR}/skia-${TERMUX_ARCH}.zip" "$SKIA_CHECKSUM_X86" ;; x86_64) termux_download "$SKIA_URL_X64" "${TERMUX_PKG_CACHEDIR}/skia-${TERMUX_ARCH}.zip" "$SKIA_CHECKSUM_X64" ;; *) termux_error_exit "No architecture '$TERMUX_ARCH' defined for Skia download." ;; esac unzip -o "${TERMUX_PKG_CACHEDIR}/skia-${TERMUX_ARCH}.zip" cd ../../ make -j "$TERMUX_MAKE_PROCESSES" } termux_step_make_install() { install -Dm700 -t "${TERMUX_PREFIX}/bin" ./gw install -Dm600 ./.gw.ini "${TERMUX_PREFIX}/share/doc/gw/gw.ini" }
true
5c7556f74541465b0d25f213d7ec0006df41fc44
Shell
RuhuaJiang/DevEnvSetup
/setup/mac-vim-setup.sh
UTF-8
908
3.09375
3
[]
no_license
#!/bin/bash cmd_e () { command -v $1 >/dev/null 2>&1 || exit 1; } install () { if cmd_e $1 ; then echo "[sudo install] $1 already installed" else brew install -y $1 fi } DOCFILES_ROOT="../dotfiles" #https://realpython.com/blog/python/vim-and-python-a-match-made-in-heaven/ install git brew install cmake if [ ! -d ~/.vim/bundle/Vundle.vim ]; then git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim fi cp $DOCFILES_ROOT/.vimrc ~/.vimrc #install all plugins https://github.com/VundleVim/Vundle.vim vim +PluginInstall +qall #install YouCompleteMe if [ ! -f /tmp/YouCompleteMeDone ];then python ~/.vim/bundle/YouCompleteMe/install.py fi touch "/tmp/YouCompleteMeDone" #install minibufexpl.vim git clone https://github.com/fholgado/minibufexpl.vim.git mkdir -p ~/.vim/plugin/ cp minibufexpl.vim/plugin/minibufexpl.vim ~/.vim/plugin/
true
6eb5657a3afea2704402eff5657352b413d1e064
Shell
kubevirt/hostpath-provisioner
/hack/run-unit-test.sh
UTF-8
1,136
2.90625
3
[ "Apache-2.0" ]
permissive
#!/usr/bin/env bash #Copyright 2021 The hostpath provisioner Authors. # #Licensed under the Apache License, Version 2.0 (the "License"); #you may not use this file except in compliance with the License. #You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #Unless required by applicable law or agreed to in writing, software #distributed under the License is distributed on an "AS IS" BASIS, #WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #See the License for the specific language governing permissions and #limitations under the License. set -e script_dir="$(cd "$(dirname "$0")" && pwd -P)" source "${script_dir}"/common.sh setGoInProw $GOLANG_VER if [[ -v PROW_JOB_ID ]] ; then useradd prow -s /bin/bash chown prow:prow -R /home/prow echo "Run go test -v in $PWD" sudo -i -u prow /bin/bash -c 'cd /home/prow/go/src/github.com/kubevirt/hostpath-provisioner && /usr/local/go/bin/go test -v ./cmd/... ./controller/... ./pkg/...' else echo "Run go test -v in $PWD" # Run test go test -v ./cmd/... ./controller/... ./pkg/... fi hack/run-lint-checks.sh
true
046bbcabf0001a4c72691f8e75ad4bcdfd2810be
Shell
pawelpiwosz/tick-sandbox
/scripts/status.sh
UTF-8
268
3.28125
3
[]
no_license
#! /bin/bash # # $1 - status type # case $1 in full) docker-compose ps exit 0 ;; short) docker-compose ps --quiet exit 0 ;; list) docker-compose ps --services exit 0 ;; *) echo -e '\n\n\nUsage: make status [full|short|list]' exit 0 ;; esac
true
f97ad2f2175647917419aaffe5ae2353cafc5465
Shell
chewitt/fidelis
/getEndpoints.sh
UTF-8
731
3.4375
3
[ "MIT" ]
permissive
#!/bin/bash if [ -z $(which jq) ]; then echo "ERROR: This script requires jq!" exit 1 fi APISERVER="FQDN" APIUSER="USERNAME" APIPASS="PASSWORD" # obtain a valid authentication token TOKEN=$(curl -sX GET --header 'Accept: application/json' "https://${APISERVER}/Endpoint/api/authenticate?Username=${APIUSER}&Password=${APIPASS}" | sed "s/{.*\"token\":\"\([^\"]*\).*}/\1/g") # obtain the list of endpoints in JSON format ENDPOINTS=$(curl -sX POST -H 'Content-Type: application/json' -H 'Accept: application/json' -H "Authorization: Bearer $TOKEN" -d '*' "https://${APISERVER}/Endpoint/api/endpoints/AdvQuery?accessType=0") # parse the list of endpoints echo "$ENDPOINTS" | jq ".data.entities[].hostName" | tr -d '"'
true
fe69185c09328bc7d2234aeaff6d8ec20c1ec102
Shell
AldonahZero/pai
/src/drivers/build/clean.sh
UTF-8
272
2.875
3
[ "MIT", "LicenseRef-scancode-generic-cla" ]
permissive
#!/bin/sh set -e if [ -f /etc/docker/daemon.json ] ; then cat /etc/docker/daemon.json | jq 'del(."default-runtime")' | jq 'del(.runtimes.nvidia)' > tmp mv tmp /etc/docker/daemon.json pkill -SIGHUP dockerd fi touch /finished while true; do sleep 3600; done
true
525fbc618fa3524089792009051cb2726ed852a9
Shell
ovc/iostat_alert
/Solaris/iostat_alert
UTF-8
10,170
2.984375
3
[ "MIT" ]
permissive
#!/bin/bash mail_to="mymail@here.tld" mail_cc="" # prod_sid="kssp2" prod_sid="$(ps -u oracle -o args | awk -F'_' '/ora_.mon_/ {print $3}' | head -n1)" max_latency_micro_seconds=2000 iostat_check_interval=3 iostat_check_count=5 iostat_check_pause=10 sending_mail_interval=900 asm_luns_size_gb=500 search_luns="awk '/${asm_luns_size_gb}.00GB/ || /1000.00GB/ || /2000.00GB/ {print \$2}'" iostat_alert_pid="/var/run/iostat_alert.pid" send_io_alert() { asm_luns=$(echo | format | eval ${search_luns} | tr '\n' ' ') ( echo "From: IOstat <iostat@$(hostname)>"; echo "To: ${mail_to}"; echo "Bcc: ${mail_cc}"; echo "Subject: $(hostname) - ${sending_mail_subject}"; echo "MIME-Version: 1.0" echo "Content-Type: text/html" echo "Content-Disposition: inline" echo " <html> <body> <pre style="font: monospace">$(echo "<h2>${sending_mail_header} $(hostname)</h2>";)</pre> <pre style="font: monospace">$(echo "<strong>$(hostname)</strong>"; ifconfig -a | egrep -e 'inet 10' | awk '{print $2}' | xargs; echo "<br />${sum_avg_rs_t//./}<br />";)</pre> <pre style="font: monospace">$(iostat -xnc -Td ${asm_luns} 3 5)</pre> <pre style="font: monospace">$(echo "<br /><br />";)</pre> <pre style="font: monospace"> Output The output of the iostat utility includes the following information. device name of the disk r/s reads per second w/s writes per second kr/s kilobytes read per second The average I/O size during the interval can be computed from kr/s divided by r/s. kw/s kilobytes written per second The average I/O size during the interval can be computed from kw/s divided by w/s. wait average number of transactions waiting for service (queue length) This is the number of I/O operations held in the device driver queue waiting for acceptance by the device. actv average number of transactions actively being serviced (removed from the queue but not yet completed) This is the number of I/O operations accepted, but not yet serviced, by the device. svc_t average response time of transactions, in milliseconds The svc_t output reports the overall response time, rather than the service time, of a device. The overall time includes the time that transactions are in queue and the time that transactions are being serviced. The time spent in queue is shown with the -x option in the wsvc_t output column. The time spent servicing transactions is the true service time. Service time is also shown with the -x option and appears in the asvc_t output column of the same report. %w percent of time there are transactions waiting for service (queue non-empty) For NFS, this is the percent of time that there is at least one asynchronous request waiting to be started %b percent of time the disk is busy (transactions in progress) For NFS, this is the percent of time that there is at least one pending NFS RPC, that is, the system is waiting for a reply from the server wsvc_t average service time in wait queue, in milliseconds asvc_t average service time of active transactions, in milliseconds st percent of CPU time which was taken off by the hypervisor. Always zero when running on physical hardware. </pre> </body> </html> ") | /usr/sbin/sendmail ${sendmail_key} } iostat_check_old() { iostat -xnu ${asm_luns} | sed -e '1,2d' | while read A B C D E F G H I J K L; do avg_rt=$(echo "${G}+${H}"|bc -l); avg_rt=${avg_rt//./}; if [ ${avg_rt} -ge ${micro_seconds} ]; then send_io_alert; sleep ${iostat_mail_interval}; break; fi; done } iostat_check_main() { i=0; sum_avg_rs_t=0 until [ $i -ge ${iostat_check_count} ] do avg_luns_rs_t=$(iostat -xnu ${asm_luns} 1 2 | tail -${num_of_asm_luns}| awk '/d0/ {printf "%.3f\n", ($7+$8)}' | tr '\n' '+') avg_luns_rs_t=$(echo "${avg_luns_rs_t::-1}" | bc -l) avg_luns_rs_t=$(echo "scale=3; ${avg_luns_rs_t}/${num_of_asm_luns}" | bc -l) sum_avg_rs_t=$(echo "scale=3; ${sum_avg_rs_t}+${avg_luns_rs_t}" | bc -l) ((i=i+1)) sleep [ $i -ge ${iostat_check_count} ] || sleep ${iostat_check_interval} done sum_avg_rs_t=$(echo "scale=3; ${sum_avg_rs_t}/${iostat_check_count}" | bc -l) } iostat_check_main_alt() { i=0; sum_avg_rs_t=0 until [ $i -ge ${iostat_check_count} ] do avg_luns_rs_t=$(iostat -xnu ${asm_luns} | awk '/d0/ {printf "%.3f\n", ($7+$8)}' | tr '\n' '+') avg_luns_rs_t=$(echo "${avg_luns_rs_t::-1}" | bc -l) avg_luns_rs_t=$(echo "scale=3; ${avg_luns_rs_t}/${num_of_asm_luns}" | bc -l) sum_avg_rs_t=$(echo "scale=3; ${sum_avg_rs_t}+${avg_luns_rs_t}" | bc -l) ((i=i+1)) sleep [ $i -ge ${iostat_check_count} ] || sleep ${iostat_check_interval} done sum_avg_rs_t=$(echo "scale=3; ${sum_avg_rs_t}/${iostat_check_count}" | bc -l) } iostat_check_service() { if $(ps -u oracle -o args | grep -q "ora_.mon_${prod_sid}"); then printf "$$" > ${iostat_alert_pid} asm_luns=$(echo | format | eval ${search_luns} | tr '\n' ' ') num_of_asm_luns=$(echo ${asm_luns} | wc -w) while true; do iostat_check_main if [ ${sum_avg_rs_t//./} -ge ${max_latency_micro_seconds} ]; then send_io_alert; sleep ${sending_mail_interval}; fi; sleep ${iostat_check_pause} done else echo "It's STANDBY, it'll start on PROD" exit fi } iostat_stop_service() { if [ -f ${iostat_alert_pid} ]; then echo "Stopping ..." /usr/bin/kill -TERM -$(cat ${iostat_alert_pid}) /usr/bin/rm ${iostat_alert_pid} exit else echo "Already stopped? I can't find: ${iostat_alert_pid}" exit fi } iostat_check_once() { asm_luns=$(echo | format | eval ${search_luns} | tr '\n' ' ') num_of_asm_luns=$(echo ${asm_luns} | wc -w) echo "Checking ..." if [ ${check_main_alt} -eq 1 ]; then iostat_check_main_alt else iostat_check_main fi echo "Average latency: ${sum_avg_rs_t//./}" exit } iostat_alert_service_setup() { if crontab -l | grep -q 'iostat_alert'; then echo "it's already been there, try to check 'crontab -l'" else echo '10 0 * * * /root/bin/iostat_alert stop >/dev/null 2>&1; /root/bin/iostat_alert start >/dev/null 2>&1' | tee -a /var/spool/cron/crontabs/root echo 'Done!' fi exit } iostat_alert_help() { cat <<-EOF Usage: iostat_alert [start|stop|check|once|testmail|setup|status|help] Installation Steps Step 1: # curl -sk https://report.sh.bc/iostat_alert/$(uname -o)/install | sh Step 2: # source ~/.profile Step 3: # iostat_alert check Step 4: # iostat_alert testmail Step 5: # iostat_alert setup EOF } check_os_family() { if ! uname -o | grep -q 'Solaris'; then echo "If you want to run this you need a diffrent Operating System, try Solaris OS."; exit; fi } check_smtp() { if ! svcs -o state sendmail | grep -q 'online'; then echo "Check the state of sendmail service. For example: svcs -o state sendmail"; exit; fi } case $1 in start) check_os_family check_smtp sending_mail_subject="IO response time has increased" sending_mail_header="IO response time has increased on" sendmail_key="-t" iostat_check_service ;; stop) check_os_family iostat_stop_service ;; check) check_os_family check_main_alt=0 iostat_check_once ;; check_alt) check_os_family check_main_alt=1 iostat_check_once ;; once) check_os_family iostat -xnc -Td $(echo | format | eval ${search_luns} | tr '\n' ' ') 3 5 ;; testmail) check_os_family check_smtp sending_mail_subject="Test message" sending_mail_header="Test message from" sendmail_key="-v -t" send_io_alert exit ;; setup) check_os_family check_smtp iostat_alert_service_setup exit ;; status) check_os_family while true; do ps -ef | grep iostat_alert | egrep -v 'grep|status'; sleep 1; clear; done exit ;; help) check_os_family iostat_alert_help exit ;; *) echo "Usage: iostat_alert [start|stop|check|once|testmail|setup|status|help]" exit ;; esac ################################################################################ # # Usage: iostat_alert [start|stop|check|once|testmail|setup|status|help] # # Installation Steps # Step 1: # curl -sk https://report.sh.bc/iostat_alert/$(uname -o)/install | sh # Step 2: # source ~/.profile # Step 3: # iostat_alert check # Step 4: # iostat_alert testmail # Step 5: # iostat_alert setup # # Additional information # # search_luns="awk '/500.00GB/ {print \$2}'" # search_luns="awk '/500.00GB/ || /2000.00GB/ {print \$2}'" # 10 0 * * * /root/bin/iostat_alert stop >/dev/null 2>&1; /root/bin/iostat_alert start >/dev/null 2>&1 # # iostat -xnu $(echo | format | awk '/500.00GB/ {print $2}' | tr '\n' ' ') | awk '/d0/ {printf $3"\t"$4"\t"$7"\t"$8"\t"$11"\n"}' # iostat -xnu $(echo | format | awk '/500.00GB/ {print $2}' | tr '\n' ' ') | awk '/d0/ {printf $3"\t"$4"\t" ($7+$8)"\t"$11"\n"}' # iostat -xnu $(echo | format | awk '/500.00GB/ {print $2}' | tr '\n' ' ') | awk '/d0/ {printf ($7+$8)"\t"$11"\n"}' # iostat -xnc -Td $(echo | format | awk '/500.00GB/ {print $2}' | tr '\n' ' ') 3 5 # # # install # mkdir -p /root/bin # curl -sk https://report.sh.bc/iostat_alert/$(uname -o)/iostat_alert -o /root/bin/iostat_alert # chmod u+x /root/bin/iostat_alert # grep -q 'export PATH="$HOME/bin:$PATH' ~/.profile || printf "\nexport PATH=\"\$HOME/bin:\$PATH\"\n" >> ~/.profile # ################################################################################
true
b4efc5dee374a45679fe4d1d1a39622d2905f2d9
Shell
pderakhshanfar/SSBSE-Challenge-2020-application
/model-generation/scripts/bash/main.sh
UTF-8
442
2.953125
3
[]
no_license
INPUT=inputs/inputs.csv OLDIFS=$IFS IFS=, [ ! -f $INPUT ] && { echo "$INPUT file not found"; } while read application package do echo "application : $application" echo "package : $package" ls "bins/$application" java -d64 -Xmx10000m -jar libs/model-generation.jar -project_cp "bins/$application" -project_prefix "$package" -out_dir "models/$application" > "logs/$application-out.txt" 2> "logs/$application-err.txt" done < $INPUT
true
ec7ebb3206a79414ab15c8d0d349a8762cf2c4c8
Shell
delkyd/alfheim_linux-PKGBUILDS
/startupwmclassfixer/PKGBUILD
UTF-8
763
2.78125
3
[]
no_license
# Maintainer: Bilal Elmoussaoui <bil.elmoussaoui@gmail.com> pkgname=startupwmclassfixer _gitname=StartupWMClassFixer pkgver=0.1.1 _pkgver="v${pkgver}" pkgrel=1 pkgdesc="Fix unrecognized, ugly or double icons in Linux." arch=('i686' 'x86_64') url="https://github.com/bil-elmoussaoui/${_gitname}" license=('GPL-2.0') provides=("$pkgname") depends=('wget') source=("${url}/archive/${_pkgver}.tar.gz") sha256sums=('eecbfc49db3eac8346166c530d7d548de6cb22f4bebaf0a16f829bd39ffc3741') package() { install -Dm755 "$srcdir/$_gitname-$pkgver/fix" "$pkgdir/opt/$_gitname/fix" install -Dm755 "$srcdir/$_gitname-$pkgver/database.csv" "$pkgdir/opt/$_gitname/database.csv" install -d "$pkgdir/opt/$_gitname" install -d "$pkgdir/usr/bin" ln -sf "/opt/$_gitname/fix" "$pkgdir/usr/bin/$_gitname" }
true
719e5d63bca1da5c342dff90979d83518afc8de0
Shell
chnops/TempleTexas
/download_raw.sh
UTF-8
528
3.484375
3
[]
no_license
#!/bin/bash # get column one from a comma-separated value file, store as .tmp tail -n +2 data/treatments.csv | cut -f 1 -d ',' - | sed "s/\"//g" > .tmp while read sample do echo $sample # level can be replaced with genus, species, family, etc. level="order" wget 'http://metagenomics.anl.gov/metagenomics.cgi?page=MetagenomeOverview&metagenome='$sample'&action=chart_export&name=organism_'$level'_hits&file=download.'$sample'.organism_'$level'_hits' -O 'data/organism_'$level'_hits.'$sample'.tsv' -q & done < .tmp rm .tmp
true
d28649633606833ec92d73921d4f453c0f292088
Shell
heinz-otto/raspberry
/setupSamba.sh
UTF-8
383
3.125
3
[]
no_license
#!/bin/bash spath="/var/SonosSpeak" scomment="Audio-Files for SonosPlayer to Speak" apt-get install samba # Pfad erstellen mkdir $spath chmod 777 $spath # Share Definition in /etc/samba/smb.conf cat <<EOF >> /etc/samba/smb.conf [SonosSpeak] comment = "$scomment" path = "$spath" browsable = yes guest ok = yes read only = no EOF # restart Service systemctl restart smbd
true