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
7aed79c8e70e67dab35b348e10d9712ca41dde0f
Shell
FernandoRub13/PROLIN
/ayuda.sh
UTF-8
2,048
3
3
[]
no_license
#!/bin/bash #Este script despliega una ayuda para el usuario #Se utiliza el etiquetdo \e[1;100;33m donde #"\e[" indica el inicio de etiquetado, #"1" represnta letras impresas en negritas, #"100" color de remarcado de texto, #"Colo del texto", echo -e "\e[1;100;33m Terminal PROLINv1.0" echo "" echo "Has accedido a la ayuda de PROLINv1.0 :)" echo "A continuacion te enlistaré los comandos disponibles" echo " los cuales pueden ser ejecutados por esta terminal;" echo " el comando a utilizar se introduce en la terminal" echo " omitiendo las comillas simples." echo "" echo "Comando 'arbol': simula la salida del comando tree, es decir," echo " muestra de manera grafica la jerarquia de un directorio que" echo " hayas introducido como paramtero. Si al comando no se le" echo " especifica directorio, el comando se ejecuta sobre el directorio actual." echo " " echo "Comando 'ayuda': despliega al informacion acerca de los comandos " echo " implementados en la terminal (Comando actual)." echo " " echo "Comando 'infosis': despliega informacion sobre el sistema donde" echo " se esta ejecutando la terminal. Debe mostrar la informacion de" echo " que usuarios se encuentran logeados, la memoria ram, la" echo " arquitectura, y la version del sistema operativo." echo "" echo "Comando 'fecha1': despliega la fecha." echo "" echo "Comando 'fecha2': despliega la fecha en un formato distinto." echo "" echo "Comando 'hora1': despliega la hora." echo "" echo "Comando 'hora2': despliega la hora en un formato distinto." echo "" echo "Comando 'prebeplayer': reproductor el cual te ayuda a navegar" echo " sobre la biblioteca musical," echo " mustra el status actual de la reproducción." echo "" echo "Comando 'gato': despliega el juego de gato!" echo "" echo "Comando 'buscar': busca un archivo en particular en el directorio especificado" echo "Modo de empleo: 'buscar [ARCHIVO] [RUTA] (Sin corchetes)" echo -e "Comando 'ahorcado': despliega el juego del ahorcado! \e[0m" echo "" #Se utiliza el etiquetdo \e[0m para terminar el etiquetado de color
true
4245711a66bbe63b5b1a1058527cbc2213fb5625
Shell
sparkspay/docker-sparks-core
/0.12/docker-entrypoint.sh
UTF-8
512
3.359375
3
[ "MIT" ]
permissive
#!/bin/sh set -e if [ $(echo "$1" | cut -c1) = "-" ]; then echo "$0: assuming arguments for sparksd" set -- sparksd "$@" fi if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "sparksd" ]; then mkdir -p "$SPARKS_DATA" chmod 700 "$SPARKS_DATA" chown -R sparks "$SPARKS_DATA" echo "$0: setting data directory to $SPARKS_DATA" set -- "$@" -datadir="$SPARKS_DATA" fi if [ "$1" = "sparksd" ] || [ "$1" = "sparks-cli" ] || [ "$1" = "sparks-tx" ]; then echo exec gosu sparks "$@" fi echo exec "$@"
true
243380a9d648829af59a77b7959d53433d085185
Shell
yahoo/panoptes_snmp
/src/net-snmp-5.7.3/agent/mibgroup/Rmon/test_alarm.sh
UTF-8
1,871
3.046875
3
[ "BSD-3-Clause", "LicenseRef-scancode-free-unknown", "LicenseRef-scancode-warranty-disclaimer", "LicenseRef-scancode-unknown-license-reference", "MIT-CMU" ]
permissive
: # Rmon Alarms/Events testing script # $Log$ # Revision 5.0 2002/04/20 07:30:01 hardaker # cvs file version number change # # Revision 1.1 2001/05/09 19:36:13 slif # Include Alex Rozin's Rmon. # # #Only parameter: number of interface (ifIndex) to be tested. #Default: 1 TSTIF=1 COMPAR="-m ALL localhost public" if [ "X"${1} = "X" ] ; then echo got default parameter : $TSTIF else TSTIF=$1 fi #testing parameters: ETHIND=3 EVNIND=7 ALRIND=2 LOWLIMIT=4800 HILIMIT =4900 INTERVAL=3 WAITTIME=17 echo interface ifIndex.$TSTIF will be tested echo " " echo 1. Create etherStatsEntry snmpset $COMPAR \ etherStatsStatus.$ETHIND i 2 \ etherStatsDataSource.$ETHIND o interfaces.ifTable.ifEntry.ifIndex.$TSTIF snmpset $COMPAR etherStatsStatus.$ETHIND i 1 snmpwalk $COMPAR statistics echo 2. Create event control entry snmpset $COMPAR \ eventStatus.$EVNIND i 1 \ eventDescription.$EVNIND s "Alarms" \ eventType.$EVNIND i 4 \ eventOwner.$EVNIND s "Alex" #snmpwalk $COMPAR eventTable echo 3. Create alarm entry snmpset $COMPAR \ alarmStatus.$ALRIND i 1 \ alarmInterval.$ALRIND i $INTERVAL \ alarmVariable.$ALRIND o rmon.statistics.etherStatsTable.etherStatsEntry.etherStatsPkts.$ETHIND \ alarmSampleType.$ALRIND i 2 \ alarmFallingThreshold.$ALRIND i $LOWLIMIT \ alarmRisingThreshold.$ALRIND i $HILIMIT \ alarmRisingEventIndex.$ALRIND i $EVNIND \ alarmFallingEventIndex.$ALRIND i $EVNIND snmpwalk $COMPAR alarm echo 4. Sleep $WAITTIME to collect log. echo This $WAITTIME seconds you may enjoy with Rmon traps. sleep $WAITTIME echo 5. Check log: snmpwalk $COMPAR logTable snmptable $COMPAR logTable snmpwalk $COMPAR eventTable echo 6. clean everything snmpset $COMPAR alarmStatus.$ALRIND i 4 snmpset $COMPAR eventStatus.$EVNIND i 4 snmpset $COMPAR etherStatsStatus.$ETHIND i 4 snmpwalk $COMPAR rmon echo " " echo "Goodbye, I'm a gonner" echo " "
true
46d6908bda345e8d05f26ba68b5d06e37fac6d98
Shell
nickstolwijk/bash-environment
/bin/showTagHistory
UTF-8
212
3.1875
3
[]
no_license
#!/bin/bash rm /tmp/history for tag in `git tag -l ecommerce-*` do git co -f $tag DATUM=$(git log -1 --pretty=format:%ci | awk 'BEGIN { FS = " " } ; { print $1 }') echo "$DATUM $tag" >> /tmp/history done
true
9a5e88dc041e80943e3bf7fab46562be0a41d2ae
Shell
iamashwin99/Scripts
/MACHide/mac.sh
UTF-8
387
2.765625
3
[]
no_license
#sudo arp-scan -l device=$(ip link show | grep wlp | cut -d" " -f2 | tr -d :) ip link show |tail |cat > 1.txt nmcli con down WIFI ip link set dev $device down echo "Device is down :" $device ip link set dev $device address $1 echo "Device is set :" ip link show |tail |cat > 2.txt diff 1.txt 2.txt ip link set dev $device up echo "Device is up :" $device nmcli con up WIFI
true
8477991065862e4ef3be6ed4cec52b0c042308a0
Shell
theno/tbm
/tbm
UTF-8
4,978
3.65625
4
[]
no_license
#!/bin/bash # script per dot command aufrufen für verzeichniswechsel und ENV zu ändern! # . ./testscript.sh cd 1 declare -A dirs BOOKMARKS="$HOME/.bookmarks" List () { #LoadBookmarks echo "Bookmarks:" for dir in "${!dirs[@]}"; do echo "$dir - ${dirs["$dir"]}"; done } AddDir () { #echo "adde $1" key="0" element_pos="unknown" if [ ! -z $2 ]; then #geht irgendwie nicht :( key=$2 else for i in 0 9 8 7 6 5 4 3 2 1 do element=${dirs[$i]} #echo "$i x${element}x" if [ -z $element ]; then #echo "$i existiert noch nicht: ${dirs[$i]}" key=$i fi if [[ "${dirs[$i]}" == "$1" ]];then #echo "SET new ${dirs[$i]} to $1" element_pos="$i" fi done fi #echo $key $1 >> ~/.bookmarks #echo "add $1 als $key" if [[ "$element_pos" == "unknown" ]]; then dirs[$key]=$1 else echo "Element already exist at: $element_pos" fi #echo "test: ${dirs[$key]}" #echo bla $dirs SaveBookmarks } CD () { echo "change to $1" if [ -z ${dirs[$1]} ]; then echo "Entry $1 does not exist!" else cd ${dirs[$1]} fi #echo `pwd` } SetTerminalVariables () { TBM1=${dirs["1"]} TBM2=${dirs["2"]} TBM3=${dirs["3"]} TBM4=${dirs["4"]} TBM5=${dirs["5"]} TBM6=${dirs["6"]} TBM7=${dirs["7"]} TBM8=${dirs["8"]} TBM9=${dirs["9"]} TBM0=${dirs["0"]} } LoadBookmarks () { #echo "TTTEST" #f=`cat .bookmarks` #for line in ${f}; do echo "$line"; done if [ ! -f $BOOKMARKS ]; then touch $BOOKMARKS fi while read line; do key=`echo "$line"|awk '{print $1}'` path=`echo "$line"|awk '{print $2}'` #echo $key $path dirs[$key]=$path done < $BOOKMARKS SetTerminalVariables } SaveBookmarks() { #echo "save" if [ -f $BOOKMARKS ]; then rm $BOOKMARKS fi touch $BOOKMARKS for dir in "${!dirs[@]}"; do echo "$dir ${dirs["$dir"]}" >> ${BOOKMARKS}; done SetTerminalVariables } RM () { if [[ "$1" == "all" ]];then unset dirs else unset dirs[$1] fi SaveBookmarks } Menu() { List echo "Change dir to: " read input CD $input } RemoveFile() { if [ -f $1 ]; then rm $1 fi } Install() { Uninstall cp ${HOME}/.bashrc ${HOME}/.bashrc_tbm_save DST="$HOME/.config/tbm" #script=`cat $0` #touch $DST #echo $script >> $DST echo "Copy script to $DST" cp $0 $DST chmod +x $DST echo "Setup .bashrc" echo "#TBM_BEGIN">>~/.bashrc echo "#TBM_VERSION=0">>~/.bashrc echo ". $DST nothing" >> ~/.bashrc #echo "alias x='. $DST mark'" >> ~/.bashrc echo "x () { . $DST add \$1; }" >> ~/.bashrc #echo "alias c='. $DST cd'" >> ~/.bashrc echo "c () { . $DST cd \$1; }" >> ~/.bashrc echo "v () { . $DST ls; }" >> ~/.bashrc echo "tbm() { . $DST $1 $2; }" >> ~/.bashrc echo "#TBM_END">>~/.bashrc echo "Restart the terminal please!" } Uninstall() { write="yes" while read -r line; do if [[ "$line" == "#TBM_BEGIN" ]]; then write="no" fi if [[ "$write" == "yes" ]]; then l=$(echo "$line") echo $l >> ${HOME}/.bashrc_tbm_uninstall fi if [[ "$line" == "#TBM_END" ]]; then write="yes" fi done < ${HOME}/.bashrc mv ${HOME}/.bashrc_tbm_uninstall ${HOME}/.bashrc RemoveFile ${HOME}/.bashrc_tbm_uninstall echo "Removing tbm and bookmarks" RemoveFile ${HOME}/.config/tbm RemoveFile ${HOME}/.bookmarks echo "Done! Restart your terminal, please!" } Help () { echo "TERMINAL BOOKMARKER" echo "" echo "Parameter [nr] are optional" echo " add [nr] - Add current directory to the bookmarks" echo " ls - List all bookmarks" echo " cd [nr] - Jump to bookmark" echo " clear nr - Delete a bookmark or all with 'clear all'" echo " path nr - Get the path as return" echo " menu - Shows the bookmark menu" echo " install - Install tbm in the .config directory and adds shortcuts" echo " uninstall - Remove tbm entirely" echo "" echo "" echo "The following features are only available after an installation" echo "" echo "Terminal shortcuts: " echo " Just type the character (without tbm or anything else) in your terminal" echo " x [nr] - tbm add [nr]" echo " c [nr] - tbm cd [nr]" echo "" echo "Bash variables with access to the bookmarks: " echo " TBM1,TBM2,....,TBM0 variables provide access to the bookmarked paths" echo " For example: " echo " ls \$TBM1 -> list the directory stored in bookmark 1" } #clear the dirs map and reload ist from file unset dirs LoadBookmarks case $1 in add) if [ ! -z $2 ]; then name=$2 fi dir=$PWD AddDir $dir $name List ;; ls) List ;; path) echo ${dirs[$2]} ;; clear) if [ -z $2 ]; then RM all else RM $2 fi #List ;; cd) if [ -z $2 ];then Menu else CD $2 fi ;; menu) Menu ;; nothing) ;; help) Help ;; install) Install ;; uninstall) Uninstall ;; met*|meet*) ... ;; *) echo "Unknown command: $1" Help ;; # You should have a default one too. esac unset dirs
true
f5ba8b8d9358958439167ba9243ad229441f4c49
Shell
dafrito/FritoMod-Shell-Tools
/fm-xml.sh
UTF-8
518
3.453125
3
[]
no_license
#!/bin/bash if [ ! "$FM_ROOT" ]; then echo "FM_ROOT must be defined" 1>&2 exit 1 fi PATH=/bin:/usr/bin:$HOME/bin:$FM_ROOT source fm-library.sh if [ -e "$1" ]; then path=$1 else path=`fm-search.sh $1` if [ ! $? ]; then exit 1; fi fi if [ ! "$path" ]; then error "Could not find path: $1" fi PROJECT=${path%%_*} source fm-load-settings.sh >/dev/null echo '<Ui>' for file in `find $path -name "*.lua" | xargs fm-requires.lua "$path" | tail -n +2`; do echo ' <Script file="'$file'"/>' done echo "</Ui>"
true
a31273540432281ab92c95b3491a0313b661de3e
Shell
sophiacb/YeastStrainsStudy
/utils/prepsrc.sh
UTF-8
4,626
3.265625
3
[]
no_license
#!/bin/bash set -o errexit set -o pipefail thisdir=`pwd` ########################################## ####### download some utilities ########## ########################################## cd $thisdir/utils/src if [ ! -f locpy/bin/activate ]; then echo; echo " creating a local python environment..." cd $thisdir/utils/src #wpython=`which python` #isvenv=`python ../isvenv.py` #if [[ $isvenv == 1 ]]; then # echo source $(dirname $wpython)/activate; # #deactivate; # fi # which $python # exit pyversion=`python -c 'import platform; major, minor, patch = platform.python_version_tuple(); print(major);'` minor=`python -c 'import platform; major, minor, patch = platform.python_version_tuple(); print(minor);'` if [[ $pyversion != 2 ]] && [[ $pyversion != 3 ]]; then pyv=`python -c 'import platform; print(platform.python_version())'` echo; echo " "Warning!! This script needs python version > 2.7 ! echo " "python version found is $pyv echo " "Please change python version!! exit 1 elif [[ $pyversion == 2 ]] && [[ $minor < 7 ]]; then pyv=`python -c 'import platform; print(platform.python_version())'` echo; echo " "Warning!! This script needs python version > 2.7 ! echo " "python version found is $pyv echo " "Please change python version!! exit 1 fi virtualenv $thisdir/utils/src/locpy 1> /dev/null source $thisdir/utils/src/locpy/bin/activate pip install --upgrade pip &> $thisdir/utils/src/locpy/install_output.txt pip install --upgrade distribute &>> $thisdir/utils/src/locpy/install_output.txt pip install cython &>> $thisdir/utils/src/locpy/install_output.txt pip install numpy &>> $thisdir/utils/src/locpy/install_output.txt pip install pandas &>> $thisdir/utils/src/locpy/install_output.txt pip install panda &>> $thisdir/utils/src/locpy/install_output.txt pip install matplotlib &>> $thisdir/utils/src/locpy/install_output.txt pip install seaborn &>> $thisdir/utils/src/locpy/install_output.txt pip install pbcore &>> $thisdir/utils/src/locpy/install_output.txt deactivate fi source $thisdir/utils/src/locpy/bin/activate if [ ! -d $thisdir/utils/src/poretools ] ; then echo " Downloading and installing poretools..." # used to extract fastq from ont fast5 cd $thisdir/utils/src/ git clone https://github.com/arq5x/poretools.git &> /dev/null cd poretools/ git reset --hard 4e04e25f22d03345af97e3d37bd8cf2bdf457fc9 1> /dev/null python setup.py install &> install_output.txt fi if [ ! -d $thisdir/utils/src/pbh5tools ] ; then echo " Downloading and installing pbh5tools..." #used to extract fastq from pacbio hdf5 cd $thisdir/utils/src source $thisdir/utils/src/locpy/bin/activate pip install pysam &>> $thisdir/utils/src/locpy/install_output.txt pip install h5py &>> $thisdir/utils/src/locpy/install_output.txt pip install pbcore &>> $thisdir/utils/src/locpy/install_output.txt git clone https://github.com/PacificBiosciences/pbh5tools.git &> /dev/null cd pbh5tools python setup.py install &> install_output.txt fi if [ ! -d $thisdir/utils/src/fq2fa ] ; then echo " Downloading and installing fq2fa..." ## fastq 2 fasta cd $thisdir/utils/src git clone -b nogzstream https://github.com/fg6/fq2fa.git &> /dev/null cd fq2fa make &> install_output.txt fi if [ ! -d $thisdir/utils/src/n50 ] ; then echo " Downloading and installing n50..." ## calculate fasta/fastq stats cd $thisdir/utils/src git clone -b nogzstream https://github.com/fg6/n50.git &> /dev/null cd n50 make &> install_output.txt fi if [ ! -d $thisdir/utils/src/random_subreads ] ; then echo " Downloading and installing random_subreads..." ## subsample generator cd $thisdir/utils/src git clone -b YeastStrainsStudy https://github.com/fg6/random_subreads.git &> /dev/null fi if [ ! -d $thisdir/utils/src/biobambam2-2.0.37-release-20160407134604-x86_64-etch-linux-gnu ] ; then echo " Downloading biobambam/bamtofastq " cd $thisdir/utils/src wget https://github.com/gt1/biobambam2/releases/download/2.0.37-release-20160407134604/biobambam2-2.0.37-release-20160407134604-x86_64-etch-linux-gnu.tar.gz &> /dev/null tar -xvzf biobambam2-2.0.37-release-20160407134604-x86_64-etch-linux-gnu.tar.gz > /dev/null rm biobambam2-2.0.37-release-20160407134604-x86_64-etch-linux-gnu.tar.gz fi if [ ! -f $thisdir/utils/src/pacbiosub/pacbiosub ]; then cd $thisdir/utils/src/pacbiosub/ make fi
true
b9458a92692bebac503a3ca101a707484e404c8d
Shell
arzatskis/dotfiles
/ruby/install.sh
UTF-8
233
2.890625
3
[ "MIT" ]
permissive
#!/bin/sh if test ! $(which rbenv) then printf "\r \t Installing... \n" eval "$(rbenv init -)" rbenv install 2.7.0 --skip-existing rbenv global 2.7.0 gem install bundler rbenv rehash else printf "\r \t Skipping \n" fi
true
37b017725240679a144dc6f94480e16956c3c4ff
Shell
vKnmnn/dotfiles
/.config/i3blocks/blocklets/date-cal
UTF-8
168
2.578125
3
[]
no_license
#! /bin/dash date=$(date '+%a. %d. %b. %Y') case "$BLOCK_BUTTON" in 1|2|3) ~/.config/i3blocks/blocklets/rofi-cal.sh >/dev/null esac echo $date date '+%d.%m.%Y'
true
e7795e28568805b6a504cd9013fabad67aaf5749
Shell
yaolingling/shell_vagrant_install_src
/install_src.sh
UTF-8
3,308
3.03125
3
[]
no_license
#!/bin/bash PWD=$(pwd) MYDIR=${1:-$PWD} if [ ! -d $MYDIR ]; then echo "[Error] working directory=$MYDIR doesn't exist" exit -1 fi pushd $MYDIR WORKDIR=$(pwd) # Absolute Path set -e set -x BRANCH=${2:-master} # can be a tag like 1.0.0 #RACKHD_DEP_REPOS=("on-core" "on-tasks" "di.js" ) RACKHD_DEP_REPOS=("on-core" "on-tasks") RACKHD_MAIN_REPOS=("on-http" "on-taskgraph" "on-dhcp-proxy" "on-tftp" "on-syslog" ) RACKHD_NODE_REPOS=("${RACKHD_DEP_REPOS[@]}" "${RACKHD_MAIN_REPOS[@]}") RACKHD_OTHER_REPOS=( "on-wss" "on-tools" "on-imagebuilder" "RackHD") REPOS=( "${RACKHD_NODE_REPOS[@]}" "${RACKHD_OTHER_REPOS[@]}" ) GITHUB="https://github.com/RackHD" echo "[Info] Clone RackHD repos, and checkout to branch ${BRANCH}" for r in ${REPOS[@]}; do rm ${r} -rf git clone ${GITHUB}/${r}.git pushd ${r} git fetch --all --prune --tags if [ -z $BRANCH ]; then git checkout ${BRANCH} fi popd done for r in ${RACKHD_NODE_REPOS[@]}; do pushd ${r} npm install popd done echo "[Info] Make common static directory & generate Docs" HTTP_STATIC_FOLDER=on-http/static/http/common TFTP_STATIC_FOLDER=on-tftp/static/tftp mkdir -p $HTTP_STATIC_FOLDER mkdir -p $TFTP_STATIC_FOLDER mkdir -p on-http/static/http/common pushd on-http npm install apidoc npm run apidoc npm run taskdoc popd echo "[Info] Download Static Images" HTTP_BASE_URL=https://bintray.com/artifact/download/rackhd/binary/builds/ TFTP_BASE_URL=https://bintray.com/artifact/download/rackhd/binary/ipxe/ SYSL_BASE_URL=https://bintray.com/artifact/download/rackhd/binary/syslinux/ HTTP_STATIC_FILES=( discovery.overlay.cpio.gz base.trusty.3.16.0-25-generic.squashfs.img initrd.img-3.16.0-25-generic vmlinuz-3.16.0-25-generic ) TFTP_STATIC_FILES=( monorail.ipxe monorail-undionly.kpxe monorail-efi32-snponly.efi monorail-efi64-snponly.efi monorail.intel.ipxe ) #SYSL_STATIC_FILES=( undionly.kkpxe ) for f in ${HTTP_STATIC_FILES[@]}; do wget ${HTTP_BASE_URL}/${f} -O ${HTTP_STATIC_FOLDER}/${f} done for f in ${TFTP_STATIC_FILES[@]}; do wget ${TFTP_BASE_URL}/${f} -O ${TFTP_STATIC_FOLDER}/${f} done #### undionly.kkpxe is no longer used ### #for f in ${SYSL_STATIC_FILES[@]}; do # wget ${SYSL_BASE_URL}/${f} ${SYSL_STATIC_FOLDER}/${f} #done echo "[Info] Move the on-core/on-tasks into each dependent repo's node_modueles..." for r in ${RACKHD_MAIN_REPOS[@]}; do pushd ${r}/node_modules/ #remove the on-core/on-tasks, and replace by a link to local folder for dep in ${RACKHD_DEP_REPOS[@]}; do rm ${dep} -rf ln -s ../../${dep} ${dep} done popd done echo "[Info] npm install pm2...." echo " apps: - script: index.js name: on-taskgraph cwd: ${WORKDIR}/on-taskgraph - script: index.js name: on-http cwd: ${WORKDIR}/on-http - script: index.js name: on-dhcp cwd: ${WORKDIR}/on-dhcp-proxy - script: index.js name: on-syslog cwd: ${WORKDIR}/on-syslog - script: index.js name: on-tftp cwd: ${WORKDIR}/on-tftp " > rackhd-pm2-config.yml echo "[Info] Starts RackHD with pm2" echo "[Done!] Please start RackHD with command line --> sudo pm2 start rackhd-pm2-config.yml " popd
true
4dc7c12e17b305683a53fd2f7f115f1e9df560a6
Shell
dreora32722/oci_cs_adb
/get_namespace.sh
UTF-8
253
3.109375
3
[]
no_license
#!/bin/bash if [ -z "$tenancy_namespace" ] then echo "Error: missing variable definitions" exit 1 fi # Get Compartment OCID tenancy_namespace=$(oci os ns get | jq -r .data) echo "Tenancy Namespace: " ${tenancy_namespace} export tenancy_namespace;
true
10a5deb076a3f902a1882caf5e6419c3377d1da5
Shell
PalakPartani/ShellPractice
/functions/Palindromeno.sh
UTF-8
296
3.6875
4
[]
no_license
#!/bin/bash read -p "Enter a number to check " num temp=$num len=${#num} chkPalin() { for ((i=0;i<$len;i++)) do r=$(($num%10)); sum=$(($((sum*10))+r)); num=$(($num/10)); done if (( $temp==$sum )) then echo "$temp is palindrome" else echo "$temp is not Palindrome" fi } chkPalin
true
4326dcd16fd11f29d32ac4f3e656f2285565f659
Shell
ArneVandeBemdt/systeembeheer-configs
/var/lib/dpkg/info/pdns-backend-mysql.config
UTF-8
345
2.96875
3
[]
no_license
#!/bin/sh # # Install / upgrade database. set -e # Execute dbconfig-common . /usr/share/debconf/confmodule if [ -f /usr/share/dbconfig-common/dpkg/config.mysql ]; then . /usr/share/dbconfig-common/dpkg/config.mysql # Default values dbc_dbuser="pdns" dbc_dbname="pdns" dbc_first_version="3.0-1" dbc_go pdns-backend-mysql $@ fi exit 0
true
4dc8d52fb7f07f46ae6351f4de41ba07906b63b8
Shell
tasukemochi/bash-config
/aliases.sh
UTF-8
845
3.046875
3
[]
no_license
################### # handy aliases # ################### alias ls='ls -FG' # -F add trailing / @ * -G color alias l='ls' alias ll='ls -al' alias lh='ls -ahl' alias h='history' alias j='jobs -l' alias c='clear' alias o='open' alias df='df -H' # -H use human-readable units (kB, MB, GB) alias du='du -chd 1 2> /dev/null' alias usage='du -ch 2> /dev/null |tail -1' alias ..='cd ..' alias ...='cd ../..' alias ....='cd ../../..' ################################ # edit, reload .bash_profile # ################################ alias vi.="vi ~/.bash_profile && source ~/.bash_profile" ############### # functions # ############### ff () { find . -name "*$@*" ; } ######################### # git configuration # ######################### source ~/.git-completion.bash alias g='git' alias gs='git status' complete -F _git g
true
ae1688221703f7da6f326dd359907234caff7526
Shell
knutjelitto/LiFo
/Recipes/Core/pkg-config
UTF-8
363
2.953125
3
[ "MIT" ]
permissive
#!/bin/bash Title="PkgConfig" Home="https://www.freedesktop.org/wiki/Software/pkg-config/" Name=pkg-config Version=0.29.2 Supplies=(https://pkg-config.freedesktop.org/releases/pkg-config-$Version.tar.gz) Build() { ./configure \ --prefix=/usr \ --with-internal-glib \ --disable-host-tool make make install }
true
1688b4175102d9f9309edc1fe6f480ffe6223732
Shell
spargonaut/.custom_commands
/cli.sh
UTF-8
4,153
3.640625
4
[]
no_license
#!/usr/bin/env bash function setup_colors() { PBLACK=$(tput setaf 0) PRED=$(tput setaf 1) PGREEN=$(tput setaf 2) PYELLOW=$(tput setaf 3) PBLUE=$(tput setaf 4) PMAGENTA=$(tput setaf 5) PCYAN=$(tput setaf 6) PWHITE=$(tput setaf 7) PREV=$(tput rev) PBOLD=$(tput bold) PRESET=$(tput sgr0) } function unset_colors() { PBLACK=$(tput sgr0) PRED=$(tput sgr0) PGREEN=$(tput sgr0) PYELLOW=$(tput sgr0) PBLUE=$(tput sgr0) PMAGENTA=$(tput sgr0) PCYAN=$(tput sgr0) PWHITE=$(tput sgr0) PREV=$(tput sgr0) PBOLD=$(tput sgr0) PRESET=$(tput sgr0) } function print_help() { print_usage CURRENT_WORKING_DIRECTORY="$(pwd)" cat <<EOH ${PCYAN}Install custom commands and aliases into shell profile files${PRESET} ${PGREEN}-c${PRESET}, ${PGREEN}--no-color ${PBLUE}strip color out of the output ${PGREEN}-d${PRESET}, ${PGREEN}--dry-run ${PBLUE}don't change anything, show what would be done. ${PGREEN}-h${PRESET}, ${PGREEN}--help ${PBLUE}display this help and exit ${PGREEN}-p${PRESET}, ${PGREEN}--profile ${PYELLOW}PROFILE_FILE ${PBLUE}shell profile file to be updated Default: $HOME/.bash_profile${PRESET} ${PGREEN}-q${PRESET}, ${PGREEN}--quiet ${PBLUE}switches off all output ${PGREEN}-r${PRESET}, ${PGREEN}--rc ${PYELLOW}STARTUP_FILE ${PBLUE}shell startup file to be updated Default: $HOME/.bashrc${PRESET} ${PGREEN}-s${PRESET}, ${PGREEN}--scripts ${PYELLOW}DIRECTORY ${PBLUE}alternate parent directory of scripts to be linked Default: $CURRENT_WORKING_DIRECTORY/scripts${PRESET} ${PGREEN}-a${PRESET}, ${PGREEN}--aliases ${PYELLOW}DIRECTORY ${PBLUE}alternate parent directory of aliases to be linked Default: $CURRENT_WORKING_DIRECTORY/aliases${PRESET} ${PGREEN}-b${PRESET}, ${PGREEN}--bin ${PYELLOW}DIRECTORY ${PBLUE}alternate parent directory of symlinks Default: $HOME/.bin${PRESET} ${PBOLD}Recommended commands${PRESET}: ${PCYAN}For bash users${PRESET}: ${PMAGENTA}./${0##*/}${PRESET} ${PCYAN}For zsh users${PRESET}: ${PMAGENTA}./${0##*/} ${PGREEN}-p ${PYELLOW}~/.zshrc ${PGREEN}-r ${PYELLOW}~/.zshrc${PRESET} EOH } function print_usage() { cat <<EOU ${PBOLD}Usage${PRESET}: ${PMAGENTA}$0 ${PRESET}\ [${PRESET}${PGREEN}-c${PRESET}|${PGREEN}--no-color${PRESET}${PBOLD}] \ [${PRESET}${PGREEN}-d${PRESET}|${PGREEN}--dry-run${PRESET}] \ [${PRESET}${PGREEN}-h${PRESET}|${PGREEN}--help${PRESET}] \ [${PRESET}${PGREEN}-p${PRESET}|${PGREEN}--profile ${PYELLOW}file${PRESET}] \ [${PRESET}${PGREEN}-q${PRESET}|${PGREEN}--quiet-mode${PRESET}] \ [${PRESET}${PGREEN}-r${PRESET}|${PGREEN}--rc ${PYELLOW}file${PRESET}] \ [${PRESET}${PGREEN}-s${PRESET}|${PGREEN}--scripts ${PYELLOW}directory${PRESET}] \ [${PRESET}${PGREEN}-a${PRESET}|${PGREEN}--aliases ${PYELLOW}directory${PRESET}] \ [${PRESET}${PGREEN}-b${PRESET}|${PGREEN}--bin ${PYELLOW}directory${PRESET}] EOU } setup_colors while getopts ":cdhp:qr:s:a:b:-:" OPT; do [[ - == $OPT ]] && OPT=${OPTARG%%=*} OPTARG=${OPTARG#*=} case $OPT in c | no-color) NO_COLOR=true ;; d | dry-run) DRY_RUN=true ;; h | help) print_help exit 0 ;; p | profile) PROFILE_FILE_LOCATION=$OPTARG ;; q | quiet) QUIET=true ;; r | rc) RC_FILE_LOCATION=$OPTARG ;; s | scripts) SCRIPT_DIR_LOCATION=$OPTARG ;; a | aliases) ALIAS_DIR_LOCATION=$OPTARG ;; b | bin) BIN_DIR_LOCATION=$OPTARG ;; \?) ARG_NUM=$(($OPTIND - 1)) echo "${PRED}Unknown argument ${!ARG_NUM}${PRESET}" echo print_usage exit 2 ;; :) echo "${PRED}Expected value for argument -$OPTARG${PRESET}" echo print_usage exit 1 ;; esac done shift $((OPTIND - 1)) case $# in 0) ;; *) echo "${PRED}Unknown arguments [${*}] found${PRESET}" print_usage >&2 exit 3 ;; esac if [[ "$NO_COLOR" = true ]]; then unset_colors fi
true
4bf10a5359b97aad7aca90b0a3a5c39fc21b1503
Shell
bahaeddine/kthw-vagrant
/certs/kubelet/kubelet.sh
UTF-8
892
3.5625
4
[]
no_license
#!/bin/sh set -e # List workers hostnames WORKERS="${WORKERS:-worker1}" for instance in $WORKERS; do cat > ${instance}-csr.json <<EOF { "CN": "system:node:${instance}", "key": { "algo": "rsa", "size": 2048 }, "names": [ { "C": "US", "L": "Portland", "O": "system:nodes", "OU": "Kubernetes The Hard Way", "ST": "Oregon" } ] } EOF INTERFACE="${INTERFACE:-eth1}" echo "\n[*] Getting External IP From host: $instance ..\n" EXTERNAL_IP=$(vagrant ssh $instance -c "ifconfig $INTERFACE | grep 'inet '" | awk -F'[: ]+' '{ print $4 }') echo "\n\nExternal IP: $EXTERNAL_IP\n\n" INTERNAL_IP=$EXTERNAL_IP cfssl gencert \ -ca=../ca/ca.pem \ -ca-key=../ca/ca-key.pem \ -config=../ca/ca-config.json \ -hostname=${instance},${EXTERNAL_IP},${INTERNAL_IP} \ -profile=kubernetes \ ${instance}-csr.json | cfssljson -bare ${instance} done
true
38d6629426a3532e6b2ff03fab387917e48ad7ec
Shell
dennis77pr/dockerNodeApp
/scripts/manageContainers.sh
UTF-8
1,135
3.078125
3
[]
no_license
#!/bin/bash DATA_VOLUME_NAME="mongo_data_mstr" #DATA_VOLUME_NAME="mongo_data_test" DB_IMAGE_NAME="dennis/mongo_db" DB_CONTAINER_NAME="mongo_db" DB_CONTAINER_ALIAS="mongo_db" NODE_IMAGE_NAME="dennis/node_server" NODE_SERVER_NAME="nodeApp" # Remove old Node Server container. sh ./removeContainer.sh ${NODE_SERVER_NAME} # Remove old DB container. sh ./removeContainer.sh ${DB_CONTAINER_NAME} echo "-->docker run -d -p 27017:27017 -p 28017:28017 --volumes-from " ${DATA_VOLUME_NAME} " --name "${DB_CONTAINER_NAME} ${DB_IMAGE_NAME} "mongod --smallfiles" # Build new Mongo DB container from an existing DB image, and connect it to an external data volume docker run -d -p 27017:27017 -p 28017:28017 --volumes-from ${DATA_VOLUME_NAME} --name ${DB_CONTAINER_NAME} ${DB_IMAGE_NAME} mongod --smallfiles echo "-->docker run -d -p 3000:3000 --name " ${NODE_SERVER_NAME} " --link " ${DB_CONTAINER_ALIAS}":"${DB_CONTAINER_NAME} ${NODE_IMAGE_NAME} # Build a new node server container with the new mongo DB configuration docker run -d -p 3000:3000 --name ${NODE_SERVER_NAME} --link ${DB_CONTAINER_ALIAS}:${DB_CONTAINER_NAME} ${NODE_IMAGE_NAME}
true
a6e17b8a1f6d8ad6b0632c8021c5a340047312f7
Shell
charliecalvert/elf-markdown-to-book
/copy-prog272
UTF-8
1,336
2.890625
3
[]
no_license
#! /bin/bash CHAPTER_DIR=chapters ROOT_DIR=$HOME/Git/CloudNotes/Assignments REACT_DIR=$ROOT_DIR/React JSON_DIR=$ROOT_DIR/Json MIDTERM_DIR=$ROOT_DIR/MidtermFinal GIT_DIR=$ROOT_DIR/Git BROWSER=$ROOT_DIR/Browser function copyChapter() { cp -v $ROOT_DIR/$1 $CHAPTER_DIR/$2 } function linkChapter() { ln -s $3/$1 $CHAPTER_DIR/$2 } function linkJsonChapter() { ln -s $JSON_DIR/$1 $CHAPTER_DIR/$2 } if ls $CHAPTER_DIR/chapter_*.md 1> /dev/null 2>&1; then echo 'removing old chapter files' rm $CHAPTER_DIR/chapter_*.md fi linkChapter JavaScriptObjects.md chapter_01.md $ROOT_DIR linkChapter JestCreateReactApp.md chapter_02.md $REACT_DIR linkChapter UnitTestsAddress.md chapter_03.md $REACT_DIR linkChapter AddressComponent.md chapter_04.md $REACT_DIR linkChapter AddressComponentRefine.md chapter_05.md $REACT_DIR linkChapter ReactAddressShow.md chapter_06.md $REACT_DIR linkChapter ReactAddressEdit.md chapter_07.md $REACT_DIR linkChapter ReactAddressMenu.md chapter_08.md $REACT_DIR linkChapter ReactGetAddress.md chapter_09.md $REACT_DIR linkChapter Prog272Midterm2017.md chapter_10.md $MIDTERM_DIR linkChapter LearnLocalStorage.md chapter_11.md $BROWSER #linkChapter .md chapter_11.md $REACT_DIR #linkChapter .md chapter_12.md $GIT_DIR #linkChapter .md chapter_13.md $MIDTERM_DIR # linkChapter chapter_0.md
true
770ca978d2012edd3e834dff327715a69d96ce16
Shell
tanguy2m/Scripts-ReadyNas
/scripts/install-addfromserver-plugin.sh
UTF-8
1,018
3.421875
3
[]
no_license
#!/bin/sh if [ -z "$1" ] || [ -z "$2" ]; then echo "Usage: install-addfromserver-plugin VERSION INSTANCE" echo " Version = v2.3.a, v2.3.b ... ou master" echo " Instance = prod ou dev" exit 1 fi # Récupération du .tar.gz depuis le master GitHub # https://github.com/tanguy2m/AddFromServer/tarball/master # Ou pour les versions: https://github.com/tanguy2m/AddFromServer/tarball/v2.3.a wget -O /tmp/AddFromServer-$1.tar.gz https://github.com/tanguy2m/AddFromServer/tarball/$1 --no-check-certificate # Création du dossier de destination mkdir /c/www/piwigo-$2/bin/plugins/AddFromServer # Dézippage de l'archive directement dans le bon dossier en supprimant le dossier chapeau tar -zxf /tmp/AddFromServer-$1.tar.gz -C /c/www/piwigo-$2/bin/plugins/AddFromServer --strip-components 1 # Changement de propriétaire du dossier de destination chown -R admin:admin /c/www/piwigo-$2/bin/plugins/AddFromServer # Suppression des fichiers temporaires rm /tmp/AddFromServer-$1.tar.gz echo "FIN"
true
6032e3ce33cd1fd6619de35b0e76cc59d2c91f5d
Shell
toomel/skriptimine
/praks4/yl4
UTF-8
122
2.671875
3
[]
no_license
#! /bin/bash read -p "Sieseta kaks arvu" one two echo täisosa `expr $one / $two`,`expr $one % $two \* 1000000000 / $two`
true
a62473ac42cc1b2320024798d559b5e68fbdfec1
Shell
polarnik/loadlab_vm
/ansible/dump_tools/export.mysql-to-pg.sh
UTF-8
3,744
2.828125
3
[]
no_license
#!/bin/sh base_path=$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P ) #cat $base_path/wp_pg_schema.sql | ssh database 'cat > /tmp/wp_pg_schema.sql' ssh database << EOF yum -y install pgloader dropdb wordpress2 || true createdb wordpress2 #psql wordpress2 < /tmp/wp_pg_schema.sql cat > /tmp/pgload.cmd << EOS LOAD DATABASE FROM mysql://root@localhost/wordpress INTO postgresql:///wordpress2 WITH quote identifiers CAST type datetime to "timestamp without time zone" drop not null drop default using zero-dates-to-null ; EOS echo /tmp/pgload.cmd pgloader /tmp/pgload.cmd psql wordpress2 << EOS ALTER SEQUENCE wordpress.wp_commentmeta_meta_id_seq RENAME TO wp_commentmeta_seq; ALTER SEQUENCE wordpress."wp_comments_comment_ID_seq" RENAME TO wp_comments_seq; ALTER SEQUENCE wordpress.wp_links_link_id_seq RENAME TO wp_links_seq; ALTER SEQUENCE wordpress.wp_options_option_id_seq RENAME TO wp_postmeta_seq; ALTER SEQUENCE wordpress.wp_postmeta_meta_id_seq RENAME TO wp_options_seq; ALTER SEQUENCE wordpress."wp_posts_ID_seq" RENAME TO wp_posts_seq; ALTER SEQUENCE wordpress.wp_term_taxonomy_term_taxonomy_id_seq RENAME TO wp_term_taxonomy_seq; ALTER SEQUENCE wordpress.wp_termmeta_meta_id_seq RENAME TO wp_terms_seq; ALTER SEQUENCE wordpress.wp_terms_term_id_seq RENAME TO wp_termmeta_seq; ALTER SEQUENCE wordpress.wp_usermeta_umeta_id_seq RENAME TO wp_usermeta_seq; ALTER SEQUENCE wordpress."wp_users_ID_seq" RENAME TO wp_users_seq; ALTER TABLE wordpress."wp_comments" RENAME COLUMN "comment_author_IP" TO comment_author_ip; UPDATE wp_posts SET "post_date_gmt" = now() WHERE "post_date_gmt" is null; UPDATE wp_posts SET "post_modified_gmt" = now() WHERE "post_modified_gmt" is null; SELECT pg_catalog.setval('wordpress.wp_commentmeta_seq', (select max(meta_id) from wp_commentmeta), true); SELECT pg_catalog.setval('wordpress.wp_comments_seq', (select max("comment_ID") from wp_comments), true); SELECT pg_catalog.setval('wordpress.wp_links_seq', (select max(link_id) from wp_links), true); SELECT pg_catalog.setval('wordpress.wp_options_seq', (select max(option_id) from wp_options), true); SELECT pg_catalog.setval('wordpress.wp_postmeta_seq', (select max(meta_id) from wp_postmeta), true); SELECT pg_catalog.setval('wordpress.wp_posts_seq', (select max("ID") from wp_posts), true); SELECT pg_catalog.setval('wordpress.wp_term_taxonomy_seq', (select max(term_taxonomy_id) from wp_term_taxonomy), true); SELECT pg_catalog.setval('wordpress.wp_termmeta_seq', (select max(meta_id) from wp_termmeta), true); SELECT pg_catalog.setval('wordpress.wp_terms_seq', (select max(term_id) from wp_terms), true); SELECT pg_catalog.setval('wordpress.wp_usermeta_seq', (select max(umeta_id) from wp_usermeta), true); SELECT pg_catalog.setval('wordpress.wp_users_seq', (select max("ID") from wp_users), true); EOS EOF echo Export complete to wordpress2 db cat > wp-data.dump << EOF truncate wp_commentmeta ; truncate wp_comments ; truncate wp_links ; truncate wp_options ; truncate wp_postmeta ; truncate wp_posts ; truncate wp_term_relationships; truncate wp_term_taxonomy ; truncate wp_termmeta ; truncate wp_terms ; truncate wp_usermeta ; truncate wp_users ; EOF ssh database pg_dump -a postgresql:///wordpress2 >> wp-data.dump #cat /tmp/wp.dump.1 | sed 's/OWNER TO root/OWNER TO "wordpress"/g' > /tmp/wp.dump.2 #cat /tmp/wp.dump.2 | sed 's/SET client_encoding = '\''SQL_ASCII'\''/SET client_encoding = '\''UTF8'\''/g' > wp.dump #cat /tmp/wp.dump.3 | sed 's/timestamp without time zone,/timestamp without time zone DEFAULT \"now\"\(\) NOT NULL,/g' > wp.dump #ssh database dropdb wordpress2
true
8cffb37072fa46d3efd2817e568d8b534e8c3e97
Shell
Akatsuki-Ryu/akazsh
/init.sh
UTF-8
1,504
2.875
3
[]
no_license
#!/usr/bin/env bash echo now we will install brew . press N to skip read -rp "ok? (y/N): " yn case "$yn" in [yY]*) /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" brew install rcmdnk/file/brew-file # brew install sambadevi/powerlevel9k/powerlevel9k brew install romkatv/powerlevel10k/powerlevel10k sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" read -rp "install brew apps and cask apps ,ok? (y/N): " yn case "$yn" in [yY]*) /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ./misc/brewinit.sh ./misc/caskinit.sh ;; *) echo "skip." ; ;; esac ;; *) echo "skip." ; ;; esac cd .. echo this will overwrite the setting on this user .... read -rp "ok? (y/N): " yn case "$yn" in [yY]*) ;; *) echo "abort." ; exit ;; esac # linking diff_highlight to system . git should be from brew . this needs to be confirmed sudo ln -s /usr/local/share/git-core/contrib/diff-highlight/diff-highlight /usr/local/bin/diff-highlight # taking gitconfig to seperate machines. rm -r .gitconfig rm -r .config rm -r .tmux.conf rm -r .tmux.conf.local rm -r .zshrc rm -r .tigrc rm -r .p10k.zsh #ln -s akazsh/.gitconfig .gitconfig cp akazsh/.gitconfig .gitconfig ln -s akazsh/.config .config ln -s akazsh/.tmux/.tmux.conf.local .tmux.conf.local ln -s akazsh/.tmux/.tmux.conf .tmux.conf ln -s akazsh/.zshrc .zshrc ln -s akazsh/.tigrc .tigrc ln -s akazsh/.p10k.zsh .p10k.zsh
true
ff07c98e3694982dd1fb567bce0eac660fcbcf45
Shell
levigroker/iOSContinuousIntegration
/Common/testflight.sh
UTF-8
2,385
3.875
4
[ "CC-BY-3.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
#!/bin/bash # # A script to upload an IPA and dSYM to TestFlight ( http://testflightapp.com) with # release notes to optional distribution lists. # # Levi Brown # mailto:levigroker@gmail.com # October 5, 2011 # https://github.com/levigroker/iOSContinuousIntegration ## function usage() { [[ "$@" = "" ]] || echo "$@" >&2 echo "Usage:" >&2 echo "$0 <ipa file> <dsym zip file> <release_notes> [<distribution_lists>]" >&2 exit 1 } function fail() { echo "Failed: $@" >&2 exit 1 } DEBUG=${DEBUG:-0} set -eu [ $DEBUG -ne 0 ] && set -x IPA_FILE=${1:-""} DSYM_ZIP=${2:-""} NOTES=${3:-"Automated build."} DIST=${4:-""} TF_API_URL="http://testflightapp.com/api/builds.json" # Start: Prevent sensitive info from going to the console in debug mode. [ $DEBUG -ne 0 ] && set +x TF_API_TOKEN=${TF_API_TOKEN:-""} TF_TEAM_TOKEN=${TF_TEAM_TOKEN:-""} # Fully qualified binaries GREP_B="/usr/bin/grep" CURL_B="/usr/bin/curl" if [ "$TF_API_TOKEN" = "" ]; then usage "Empty TestFlight API token specified. Please export TF_API_TOKEN with the needed API token." fi if [ "$TF_TEAM_TOKEN" = "" ]; then usage "Empty TestFlight Team token specified. Please export TF_API_TOKEN with the needed team token." fi # End: Prevent sensitive info from going to the console [ $DEBUG -ne 0 ] && set -x if [ "$IPA_FILE" = "" ]; then usage "No .ipa file specified." elif [ "$IPA_FILE" = "-h" -o "$IPA_FILE" = "--help" -o "$IPA_FILE" = "?" ]; then usage fi if [ "$DSYM_ZIP" = "" ]; then usage "No dSYM zip file specified." elif [ "$DSYM_ZIP" = "-h" -o "$DSYM_ZIP" = "--help" -o "$DSYM_ZIP" = "?" ]; then usage fi # Start: Prevent sensitive info from going to the console in debug mode. [ $DEBUG -ne 0 ] && set +x if [ "$DIST" = "" ]; then REZ=`$CURL_B "$TF_API_URL" -F file="@$IPA_FILE" -F dsym="@$DSYM_ZIP" -F api_token="$TF_API_TOKEN" -F team_token="$TF_TEAM_TOKEN" -F notes="$NOTES" -F notify=True || fail "Upload to TestFlight failed."` else REZ=`$CURL_B "$TF_API_URL" -F file="@$IPA_FILE" -F dsym="@$DSYM_ZIP" -F api_token="$TF_API_TOKEN" -F team_token="$TF_TEAM_TOKEN" -F notes="$NOTES" -F notify=True -F distribution_lists="$DIST" || fail "Upload to TestFlight failed."` fi # End: Prevent sensitive info from going to the console [ $DEBUG -ne 0 ] && set -x KEY=`echo "$REZ" | $GREP_B install_url` if [ "$KEY" == "" ]; then fail "$REZ" else echo "Uploaded \"$IPA_FILE\" to TestFlight!" fi
true
04f7f33108a5bc6c52c5ecd13e8ce408896687ef
Shell
elviswolcott/DIM
/icons/build_icons.sh
UTF-8
1,148
3.03125
3
[ "MIT" ]
permissive
#!/bin/sh -ex # Generate all our icon images from SVG. Requires a mac (or a system w/ a shell and rsvg-convert installed). which rsvg-convert || brew install librsvg for VERSION in release beta dev; do rsvg-convert -w 16 -h 16 -o "$VERSION/icon16.png" "favicon-$VERSION.svg" rsvg-convert -w 16 -h 16 -o "$VERSION/favicon-16x16.png" "favicon-$VERSION.svg" rsvg-convert -w 19 -h 19 -o "$VERSION/icon19.png" "favicon-$VERSION.svg" rsvg-convert -w 32 -h 32 -o "$VERSION/favicon-32x32.png" "favicon-$VERSION.svg" rsvg-convert -w 38 -h 38 -o "$VERSION/icon38.png" "favicon-$VERSION.svg" rsvg-convert -w 48 -h 48 -o "$VERSION/icon48.png" "favicon-$VERSION.svg" rsvg-convert -w 96 -h 96 -o "$VERSION/favicon-96x96.png" "favicon-$VERSION.svg" rsvg-convert -w 128 -h 128 -o "$VERSION/icon128.png" "favicon-$VERSION.svg" rsvg-convert -w 180 -h 180 -o "$VERSION/apple-touch-icon.png" "apple-touch-icon-$VERSION.svg" rsvg-convert -w 192 -h 192 -o "$VERSION/android-chrome-192x192.png" "android-icon-$VERSION.svg" rsvg-convert -w 512 -h 512 -o "$VERSION/android-chrome-512x512.png" "android-icon-$VERSION.svg" done
true
444a4d8d46732a98556612d1a0c7eb225ed3b12f
Shell
cm-igarashi-ryosuke/lazy-awslogs
/shell-completion/lazy-awslogs.sh
UTF-8
2,546
3.515625
4
[ "MIT" ]
permissive
_lazy-awslogs() { local cmd cur prev cmd="${COMP_WORDS[1]}" cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" case "${cmd}" in config) if [ ${COMP_CWORD} -le 2 ]; then local opts="add list remove show set use" COMPREPLY=($(compgen -W "${opts}" -- ${cur})) return 0 fi return 0 ;; get) if [ "${prev}" = "-g" ] || [ "${prev}" = "--group" ]; then COMPREPLY=($(compgen -W "$(get_groups_cache)" ${cur})) return 0 fi if [ "${prev}" = "-s" ] || [ "${prev}" = "--stream" ]; then COMPREPLY=($(compgen -W "$(get_streams_cache $(current_group_option_value))" -- ${cur})) return 0 fi local opts="--filter-pattern --group --help --start-time --stream" COMPREPLY=($(compgen -W "${opts}" -- ${cur})) return 0 ;; groups) local opts="--cache --help" COMPREPLY=($(compgen -W "${opts}" -- ${cur})) return 0 ;; reload) if [ "${prev}" = "-g" ] || [ "${prev}" = "--group" ]; then COMPREPLY=($(compgen -W "$(get_groups_cache)" -- ${cur})) return 0 fi local opts="--group --help" COMPREPLY=($(compgen -W "${opts}" -- ${cur})) return 0 ;; streams) if [ "${prev}" = "-g" ] || [ "${prev}" = "--group" ]; then COMPREPLY=($(compgen -W "$(get_groups_cache)" -- ${cur})) return 0 fi local opts="--cache --group --help" COMPREPLY=($(compgen -W "${opts}" -- ${cur})) return 0 ;; esac if [ ${COMP_CWORD} -le 2 ]; then local opts="config get groups help reload streams" COMPREPLY=($(compgen -W "${opts}" -- ${cur})) return 0 fi } get_groups_cache() { echo $(lazy-awslogs groups --cache | tr '\n' ' ') } get_streams_cache() { if [ $# -eq 0 ]; then return fi echo $(lazy-awslogs streams --cache --group $1 | tr '\n' ' ') } current_group_option_value() { local i word group i=0 for word in ${COMP_WORDS[@]}; do if [ "${word}" = "-g" ] || [ "${word}" = "--group" ]; then group=${COMP_WORDS[${i}+1]} fi i=${i}+1 done echo ${group} } complete -F _lazy-awslogs lazy-awslogs
true
d52f96418dc6775e1232b9c74fc20a9deadbb546
Shell
petronny/aur3-mirror
/fltk-rep/PKGBUILD
UTF-8
1,216
2.546875
3
[]
no_license
# Maintainer: lspci pkgname=fltk-rep pkgver=1.3.2 pkgrel=5 pkgdesc="A replacement for fltk 1.3.1" arch=('i686' 'x86_64') license=('custom:LGPL') url="http://www.fltk.org/" makedepends=('mesa' 'doxygen' 'libjpeg' 'libpng' 'libxft' 'libxinerama' \ 'alsa-lib' 'desktop-file-utils') conflicts=('fltk') source=(http://ftp.easysw.com/pub/fltk/$pkgver/fltk-$pkgver-source.tar.gz) md5sums=('9f7e707d4fb7a5a76f0f9b73ff70623d') build() { export pkgname='fltk' cd "$srcdir/$pkgname-$pkgver" sed -i -e 's/$(LINKFLTK)/$(LINKSHARED)/' \ -e 's/$(LINKFLTKIMG)/$(LINKSHARED)/' test/Makefile ./configure --prefix=/usr --enable-threads --enable-xft --enable-shared make cd documentation make html } package() { export pkgname='fltk' pkgdesc="Graphical user interface toolkit for X" depends=('libjpeg' 'libpng' 'libxft' 'libxinerama' 'hicolor-icon-theme' \ 'desktop-file-utils' 'xdg-utils') options=('!docs') install=fltk.install cd "$srcdir/$pkgname-$pkgver" make DESTDIR="$pkgdir" install (cd fluid; make DESTDIR="$pkgdir" install install-linux) chmod 644 "$pkgdir"/usr/lib/*.a install -D -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" }
true
9515641600750510e58532f7dd954b07feb60a2a
Shell
pivotal-customer0/photon-p3-java-app-test
/deploy.sh
UTF-8
1,155
3.28125
3
[ "Apache-2.0" ]
permissive
#!/bin/bash -x if [[ -z ${ENV_NUM} ]] ; then >&2 echo "ENV_NUM must be set!" fi git clone https://github.com/pivotal-customer0/p1-photon-setup-scripts source p1-photon-setup-scripts/env${ENV_NUM}.sh rm -rf p1-photon-setup-scripts for v in $CF_API $CF_USERNAME $CF_PASSWORD $CF_APPS_DOMAIN; do if [[ -z $v ]] ; then >&2 echo "$v must be set!" fi done cf api $CF_API --skip-ssl-validation cf auth $CF_USERNAME $CF_PASSWORD cf create-org javatests cf create-space tests -o javatests cf target -o javatests -s tests git clone https://github.com/pivotal-customer0/hello-java cd hello-java cf push hello-java -p target/demo-0.0.1-SNAPSHOT.jar if [[ $? != 0 ]]; then >&2 echo "Failed to push hello-java to $CF_API" exit 1 fi curl hello-java.$CF_APPS_DOMAIN | grep "Hello world" if [[ $? != 0 ]]; then >&2 echo "Failed find hello-java at hello-java.$CF_APPS_DOMAIN" exit 1 fi curl hello-java.$CF_APPS_DOMAIN/kill sleep 60 curl hello-java.$CF_APPS_DOMAIN | grep "Hello world" if [[ $? != 0 ]]; then >&2 echo "Failed find hello-java at hello-java.$CF_APPS_DOMAIN after killing it." exit 1 fi cf delete-org javatests -f cd .. rm -rf hello-java
true
4a420240164dafeb1da98501a4766164365adfb5
Shell
jboss-fuse/fuse-karaf
/assemblies/fuse-karaf-framework/src/main/resources/resources/bin/fuse-inc
UTF-8
1,423
2.84375
3
[ "Apache-2.0" ]
permissive
#!/bin/sh # # Copyright 2005-2018 Red Hat, Inc. # # Red Hat licenses this file to you under the Apache License, version # 2.0 (the "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. See the License for the specific language governing # permissions and limitations under the License. # detectPrometheusConfig() { if [ -f "${KARAF_HOME}/etc/prometheus-config.yml" ] || [ -f "${KARAF_HOME}/etc/prometheus-config.yaml" ]; then if [ -f "${KARAF_HOME}/etc/prometheus-config.yml" ]; then KARAF_PROMETHEUS_CONFIG="${KARAF_HOME}/etc/prometheus-config.yml" else KARAF_PROMETHEUS_CONFIG="${KARAF_HOME}/etc/prometheus-config.yaml" fi # if there's no prometheus port set, let's set the port to 9779 if [ "x${KARAF_PROMETHEUS_PORT}" = "x" ]; then KARAF_PROMETHEUS_PORT=9779 fi KARAF_PROMETHEUS_VERSION="0.13.0" KARAF_PROMETHEUS_OPTS="-javaagent:${KARAF_HOME}/lib/jmx_prometheus_javaagent-${KARAF_PROMETHEUS_VERSION}.jar=${KARAF_PROMETHEUS_PORT}:${KARAF_PROMETHEUS_CONFIG}" fi }
true
e0fab31f7b5860042bf8513702fbad7057d0d9ee
Shell
tianyayoucao/dbpedia
/mwdumper/install-mysql.sh
UTF-8
810
3.9375
4
[]
no_license
#!/bin/bash set -e MYDIR=$1 if [[ -z "$MYDIR" ]] then echo "usage: $0 <mysql dir>" echo "Install MySQL databases in <mysql dir>/data. echo "Start server listening at default port and socket <mysql dir>/mysql.sock, logging to <mysql dir>/mysql.log." echo "Grant all privileges to anonymous user." echo echo " mysql dir Will be created if it doesn't exist." echo echo "Example:" echo "$0 ~/data/mysql" exit 1 fi mysql_install_db --default-character-set=utf8 --datadir=$MYDIR/data mysqld_safe --default-character-set=utf8 --socket=$MYDIR/mysql.sock --datadir=$MYDIR/data --max_allowed_packet=1G --key_buffer_size=1G >>$MYDIR/mysql.log 2>&1 & # wait for server to start sleep 5 mysql --default-character-set=utf8 --socket=$MYDIR/mysql.sock -u root -e "GRANT ALL ON *.* TO ''@'localhost'" mysql
true
ef1523925573d2b9ed1b42bc448d406c93ffeb1e
Shell
dolifer/dotfiles
/.zsh/completion.sh
UTF-8
795
2.578125
3
[]
no_license
#!/bin/zsh setopt AUTO_LIST setopt AUTO_MENU setopt MENU_COMPLETE zmodload -i zsh/complist # Completion caching zstyle ':completion::complete:*' use-cache on zstyle ':completion::complete:*' cache-path .zcache zstyle ':completion:*:cd:*' ignore-parents parent pwd # Fallback to built in ls colors zstyle ':completion:*' list-colors '' zstyle ':completion:*' menu yes select # kubernetes source <(kubectl completion zsh) mkdir -p ~/.oh-my-zsh/completions chmod -R 755 ~/.oh-my-zsh/completions ln -sf /opt/kubectx/completion/kubectx.zsh ~/.oh-my-zsh/completions/_kubectx.zsh ln -sf /opt/kubectx/completion/kubens.zsh ~/.oh-my-zsh/completions/_kubens.zsh fpath=(~/.oh-my-zsh/completions $fpath) autoload -U compinit && compinit # Bind ESC to exit menu bindkey -M menuselect '\e' send-break
true
ab6afb5c395ac27f123e216adf43498003193ba8
Shell
margenomics/smallRNAseq_analysis
/Analysis/03_ReadMapping/Stats.sh
UTF-8
1,206
3.125
3
[]
no_license
#!/bin/bash #SBATCH -p short # Partition to submit to #SBATCH --cpus-per-task=1 #SBATCH --mem-per-cpu 29Gb # Memory in MB #SBATCH -J star.stats # job name #SBATCH -o star.stats.%j.out # File to which standard out will be written #SBATCH -e star.stats.%j.err # File to which standard err will be written PROJECT=$1 # Prepare variables #------------------ path=/bicoh/MARGenomics DIR=${path}/${PROJECT} FASTQDIR=${DIR}/rawData mkdir $DIR/Analysis/03_ReadMapping/Stats INDIR=$DIR/Analysis/03_ReadMapping/BAM_Files OUTDIR=$DIR/Analysis/03_ReadMapping/Stats cd $OUTDIR #Inspeccionem el resultat dels alineaments for i in ${INDIR}/*.final.out; do basename $i >> ${OUTDIR}/TotalCounts_Alignment; grep "Uniquely mapped reads number" "$i" >> ${OUTDIR}/TotalCounts_Alignment; grep "Number of reads mapped to multiple loci" "$i" >> ${OUTDIR}/TotalCounts_Alignment; grep "Number of reads mapped to too many loci" "$i" >> ${OUTDIR}/TotalCounts_Alignment; grep "reads unmapped: too short" "$i" >> ${OUTDIR}/TotalCounts_Alignment; done # Copy files for multiqc cp $INDIR/*.final.out $DIR/QC/QC_trimmed/ cd $DIR/QC/QC_trimmed/ module load Python/3.5.2-foss-2016b multiqc -f .
true
20aba40a4cd538ce7b2601099d972c927d96855f
Shell
TauWu/DST_server_config
/install_quick.sh
UTF-8
1,666
3.375
3
[]
no_license
#!/bin/bash # 安装脚本 REPO_PATH=`pwd` echo "开始安装 Don't Starve Together 独立服务器..." echo " " echo "*************** 食用说明 ***************" echo " " echo "本安装方法为 steam 快速的安装方法,适合开箱即玩" echo " " echo "*****************************************" echo " " echo "请输入您的token!" read TOKEN # echo "请输入您的服务器名称!" # read SERVER_NAME # echo "请输入您的服务器密码!" # read SERVER_PWD # 创建必要的目录 echo "开始创建必要的目录..." cd ~ if [ ! -d "dst_data" ]; then mkdir dst_data else echo "项目根目录已经存在,跳过..." fi cd dst_data if [ ! -d "steam_cmd" ]; then mkdir steam_cmd else echo "steam_cmd 目录已经存在,跳过..." fi if [ ! -d "dst_server" ]; then mkdir dst_server else echo "dst_server 目录已经存在,跳过..." fi sleep 1 # 使用 steam_cmd 安装游戏 echo "开始使用 steam_cmd 安装游戏..." STAEM_CMD_PATH=~/dst_data/steam_cmd/ DST_SERVER_PATH=~/dst_data/dst_server/ CLUSTER_PATH=~/.klei/DoNotStarveTogether/Cluster_1/ cp $REPO_PATH/data/steamcmd_linux.tar.gz $STAEM_CMD_PATH cd $STAEM_CMD_PATH tar -xvzf steamcmd_linux.tar.gz ./steamcmd.sh +login anonymous +force_install_dir $DST_SERVER_PATH +app_update 343050 validate +quit # 配置 .klei apt-get install libcurl4-gnutls-dev:i386 cp -r $REPO_PATH/data/.klei ~/ echo $TOKEN > $CLUSTER_PATH/cluster_token.txt # 配置 mods cp -r $REPO_PATH/data/mods $DST_SERVER_PATH
true
ff454c7b9e1273c5112bcb926494de97bc0bab28
Shell
Illia-0/task4_3
/task4_3.sh
UTF-8
594
4.15625
4
[]
no_license
#!/bin/bash set -o errexit target_dir="/tmp/backups" mkdir -p -- "$target_dir" if (( $# != 2 )); then echo "Illegal number of parameters" >&2 exit 1 fi backup_directory=$1 backups_number="" if [ -n "$2" -a $2 -eq $2 2> /dev/null ]; then backups_number=$2 else echo "Number of backups is illegal" >&2 exit 1 fi archive_name=$backup_directory archive_name=${archive_name#/} archive_name=${archive_name//\//-} archive_name="$archive_name-$(date --utc --iso-8601=seconds).tar.gz" tar --create --gzip --file "$target_dir/$archive_name" -C "/" -- "${backup_directory#/}" > /dev/null
true
8d61c29cd0e061cb9dd0876d6def0a61e034dca6
Shell
braxeatssnacks/.dotfiles
/zsh/zshrc_manager.sh
UTF-8
923
3.453125
3
[]
no_license
export DOTFILES="$HOME/.dotfiles" export XDG_CONFIG_HOME="$HOME/.config" # Run tmux if exists if command -v tmux>/dev/null; then # attempt to reconnect to existing session or create new if test -z "$TMUX"; then session_name=$( tmux list-sessions | grep -v attached | grep -oE '^(\w|\s)+:' | head -1 ) # default grep has no regex lookahead; prune colon from "$session_name" if test $session_name; then exec tmux attach -t ${session_name: : -1}; else exec tmux; fi fi else echo "tmux not installed. Run ${DOTFILES/#$HOME/~}/deploy.sh to configure dependencies..." fi # implicit update of submodules in subshell if on master branch ( cd "$DOTFILES" if [[ $(git symbolic-ref HEAD | sed -e 's/^refs\/heads\///') == 'master' ]]; then git pull -q git submodule update --init --recursive -q fi ) source "$DOTFILES/zsh/zshrc.sh" source "$DOTFILES/zsh/ext.sh"
true
2d31aa387067738acd8a46c0e7b101d82b33e48f
Shell
a2geek/minecraft-boshrelease
/jobs/minecraft/templates/post-start
UTF-8
221
2.765625
3
[]
no_license
#!/bin/bash JOB_BASE=/var/vcap/jobs/minecraft POST_START=${JOB_BASE}/config/post-start.in CONSOLE=/var/vcap/data/minecraft/console.in cat ${POST_START} | while read LINE do printf "${LINE}\n" >> ${CONSOLE} done
true
2109bd33bdba937247ff1ab0b873828cc5e183b5
Shell
jmbreuer/multi
/selenium/server.sh
UTF-8
1,009
3.875
4
[ "MIT" ]
permissive
#!/bin/bash ROOTDIR="$( cd "$( dirname "$0")" && pwd )" SELENIUM_VERSION=2.24.1 COMMAND=$1 #command -v firefox >/dev/null 2>&1 || { echo "Can't find firefox, please make sure it's on your PATH." >&2; exit 1; } if [ ! -f "$ROOTDIR/selenium-server-standalone-$SELENIUM_VERSION.jar" ]; then curl -s http://selenium.googlecode.com/files/selenium-server-standalone-$SELENIUM_VERSION.jar > $ROOTDIR/selenium-server-standalone-$SELENIUM_VERSION.jar fi if [[ $COMMAND == "start" ]]; then nohup java -jar $ROOTDIR/selenium-server-standalone-$SELENIUM_VERSION.jar > $ROOTDIR/selenium.out 2> $ROOTDIR/selenium.err < /dev/null & echo $! > $ROOTDIR/selenium.pid for i in {0..30}; do curl -s -f http://localhost:4444/selenium-server if [ $? -eq 0 ]; then break fi sleep 1 done fi if [[ $COMMAND == "stop" ]]; then if [ -f $ROOTDIR/selenium.pid ]; then PID=`cat $ROOTDIR/selenium.pid` kill $PID fi rm -f $ROOTDIR/selenium.out $ROOTDIR/selenium.err $ROOTDIR/selenium.pid fi
true
4300fd19a2a06bf0db84cb60a10ecc7197098965
Shell
crmejia/reactiveops-challenge
/rails_deploy.sh
UTF-8
1,166
2.875
3
[]
no_license
#!/bin/bash if [ ! $(command -v terraform) ] then echo Please install terraform exit 1 fi if [ ! -z "$AWS_ACCESS_KEY_ID" ] ; then echo Please provide a valid AWS access key enviroment variable echo name should be AWS_ACCESS_KEY_ID exit 1 fi if [ ! -z "$AWS_SECRET_ACCESS_KEY" ] ; then echo Please provide a valid AWS secret Key enviroment variable echo name should be AWS_SECRET_ACCESS_KEY exit 1 fi terraform init terraform apply -auto-approve ssh -oStrictHostKeyChecking=no -i ~/.ssh/id_rsa ubuntu@$(terraform output public_ip) sudo apt-get -y update #install rvm rails gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB cd /tmp curl -sSL https://get.rvm.io -o rvm.sh cat /tmp/rvm.sh | bash -s stable --rails source /home/ubuntu/.rvm/scripts/rvm #install nodejs(required) \curl -sSL https://deb.nodesource.com/setup_6.x -o nodejs.sh cat /tmp/nodejs.sh | sudo -E bash - sudo apt-get install -y nodejs #create hello world app cd ~ rails new helloWorld cd helloWorld bin/rails server # ssh exit #echo $(terraform output public_ip):3000
true
1aa64af6fd9ebf6482bc992d050d5d1ea9b02835
Shell
evilsmile/scripts
/Bash/query_trade.sh
UTF-8
2,164
3.578125
4
[]
no_license
#!/bin/bash sql_cmd="mysql -u " function usage() { echo -e "Usage: -t db_id -o order_id -p phone_num -m mch_id" exit } while getopts "p:t:o:d:m:c:h" arg ; do case $arg in t) db_id=$OPTARG ;; o) order_id=$OPTARG ;; p) phone=$OPTARG ;; m) mch_id=$OPTARG ;; c) channel_order_id=$OPTARG ;; d) date=$OPTARG ;; h) usage ;; esac done sql="SELECT a.db_id as db_id, a.order_id as order_id, round(a.amount/100, 2) as amount, a.mch_id as mch_id, a.mch_name as mch_name, c.mch_name as channel_mch_name, case a.status WHEN 0 THEN 'create' WHEN 1 THEN 'paying' WHEN 2 THEN 'succ' WHEN 3 THEN 'fail' END as status, case a.pay_type WHEN 0 THEN 'WX' WHEN 1 THEN 'ZFB' WHEN 2 THEN 'TFBQR' END as pay_type, case a.pay_channel_id WHEN 0 THEN 'wft' WHEN 1 THEN 'xmcmbc' WHEN 2 THEN 'tfbqr' WHEN 3 THEN 'sjs' WHEN 4 THEN 'xmpab' END as channel_id, a.channel_mch_id as channel_mch_id, a.channel_trans_id as channel_order_id, a.create_time as create_time, a.update_time as update_time FROM db.tb_db as a LEFT JOIN db.tb_channel_sjs_mch_bind as b ON a.channel_mch_id=b.channel_mch_id LEFT JOIN db.tb_merchant as c ON c.mch_id=b.mch_id WHERE 1=1 " has_condition=0 #其它选项可以唯一确定,而如果是商户号的话则最好加日期 if [ "x$mch_id" != "x" ]; then has_condition=1 sql="$sql AND a.mch_id like '%${mch_id}' " fi if [ "x$phone" != "x" ]; then has_condition=1 mch_id=$(./convert_phone_to_mch.sh $phone) sql="$sql AND a.mch_id like '%${mch_id}' " fi if [ "x$date" != "x" ]; then has_condition=1 sql="$sql AND date(a.create_time)='${date}'" fi if [ "x$db_id" != "x" ]; then has_condition=1 sql="$sql AND a.db_id='${db_id}'" fi if [ "x$channel_order_id" != "x" ]; then has_condition=1 sql="$sql AND a.channel_trans_id='${channel_order_id}'" fi if [ "x$order_id" != "x" ]; then has_condition=1 sql="$sql AND a.order_id='${order_id}'" fi if [ $has_condition -eq 0 ]; then sql="$sql AND date(a.create_time)=curdate()" fi #echo "$sql;" $sql_cmd -e "$sql"
true
48d0fe5f8f14f318a1c4663b346963a1b60706bd
Shell
joesbigidea/simple-nginx-letsencrypt-docker
/entrypoint.sh
UTF-8
1,005
3.671875
4
[ "MIT" ]
permissive
#!/bin/sh call_certbot() { if [ "$PROD" == "true" ] then echo "running certbot in prod mode" else echo "running certbot in test mode" EXTRA_ARGS="--test-cert" fi certbot $EXTRA_ARGS --nginx -m $CERTBOT_EMAIL --agree-tos --eff-email --noninteractive -d $CERTBOT_DOMAIN } if [ -z "$CERTBOT_EMAIL" ]; then echo "No certbot email set, exiting" exit 1 fi if [ -z "$CERTBOT_DOMAIN" ]; then echo "No certbot domain set, exiting" exit 1 fi # When we get killed, kill all our children trap "exit" INT TERM trap "kill 0" EXIT # Start up nginx, save PID so we can reload config inside of run_certbot.sh nginx -g "daemon off;" & export NGINX_PID=$! #If the cert isn't out there yet, call certbot for it if [ ! -f "/etc/letsencrypt/live/$CERTBOT_DOMAIN/fullchain.pem" ]; then call_certbot fi # Run `cron -f &` so that it's a background job owned by bash and then `wait`. # This allows SIGINT (e.g. CTRL-C) to kill cron gracefully, due to our `trap`. cron -f & wait "$NGINX_PID"
true
bf83afd73c1d4b11d7e3c5d3dbb164f370857275
Shell
latifkabir/Computation_using_C
/fem1d_bvp_quadratic/fem1d_bvp_quadratic.sh
UTF-8
310
2.8125
3
[]
no_license
#!/bin/bash # cp fem1d_bvp_quadratic.h /$HOME/include # gcc -c -I /$HOME/include fem1d_bvp_quadratic.c if [ $? -ne 0 ]; then echo "Errors compiling fem1d_bvp_quadratic.c" exit fi # mv fem1d_bvp_quadratic.o ~/libc/$ARCH/fem1d_bvp_quadratic.o # echo "Library installed as ~/libc/$ARCH/fem1d_bvp_quadratic.o"
true
8c088e4b3a6325481af35413c5c42652edd1ca54
Shell
leospol/tmt
/tests/discover/parametrize.sh
UTF-8
1,563
2.71875
3
[ "MIT" ]
permissive
#!/bin/bash . /usr/share/beakerlib/beakerlib.sh || exit 1 rlJournalStart rlPhaseStartSetup rlRun 'pushd data' rlRun 'set -o pipefail' rlPhaseEnd plan='plan -n parametrize/noenvironment' plan_env='plan -n parametrize/environment' steps='discover finish' rlPhaseStartTest 'From environment attribute' rlRun "tmt run -r $plan_env $steps | tee output" rlAssertGrep 'url: https://github.com/teemtee/tmt' 'output' rlPhaseEnd rlPhaseStartTest 'From command line' rlRun "tmt run -r -e REPO=tmt $plan $steps | tee output" rlAssertGrep 'url: https://github.com/teemtee/tmt' 'output' # Precedence of option over environment attribute rlRun "tmt run -r -e REPO=fmf $plan_env $steps | tee output" rlAssertGrep 'url: https://github.com/teemtee/fmf' 'output' rlPhaseEnd rlPhaseStartTest 'Process environment should be ignored' rlRun "REPO=fmf tmt run -r $plan_env $steps | tee output" rlAssertGrep 'url: https://github.com/teemtee/tmt' 'output' # No substitution should happen rlRun "REPO=tmt tmt run -r $plan $steps | tee output" 2 rlAssertGrep 'url: https://github.com/teemtee/${REPO}' 'output' rlPhaseEnd rlPhaseStartTest 'Undefined variable' rlRun "tmt run -r $plan $steps | tee output" 2 rlAssertGrep 'url: https://github.com/teemtee/${REPO}' 'output' rlPhaseEnd rlPhaseStartCleanup rlRun 'rm -f output' 0 'Removing tmp file' rlRun 'popd' rlPhaseEnd rlJournalEnd
true
b0bd6a02bf89548927124142f528d48c18772b49
Shell
tuxpiper/ushahidi-platform-docker
/docker/platform/docker/prepare.sh
UTF-8
480
3.25
3
[]
no_license
#!/bin/sh cat > /var/www/.env <<EOF DB_HOST=${MYSQL_PORT_3306_TCP_ADDR} DB_NAME=${MYSQL_ENV_MYSQL_DATABASE} DB_PASS=${MYSQL_ENV_MYSQL_PASSWORD} DB_TYPE=MySQLi DB_USER=${MYSQL_ENV_MYSQL_USER} EOF # Wait until MySQL is up echo -n "Checking MySQL " k=1; while [ "$k" -lt "60" ]; do if nc -w 1 ${MYSQL_PORT_3306_TCP_ADDR} 3306 > /dev/null < /dev/null ; then break; fi echo "." sleep 1; k=$((k + 1)) done sleep 1; echo ( cd /var/www && ./bin/update --no-interaction )
true
8188e739e4e841b349de9a2a5513c2812e3efd46
Shell
ansarigulshad/scripts
/shell/hadoop/bulk_service_check.sh
UTF-8
2,216
3.53125
4
[]
no_license
#!/bin/bash # # ########################################################################################################## #Script Name : bulk_service_check.sh #Description : This Script is developed to bulk service check on HDP cluster using ambari API calls #Author : Gulshad Ansari #LinkedIn : https://linkedin.com/in/gulshad/ # # #Note # Script requires curl and jq command. Make sure these commands are installed on node # # ########################################################################################################## # # # # # # Install jq package if it doesnt exist # Ubuntu # if ! sudo dpkg-query -W -f='${Status}' jq | grep "ok installed"; then sudo apt install jq; fi # RHEL sudo rpm -qa | grep -qw jq || sudo yum install jq -y # Set variables _ambari_admin_user=admin _ambari_admin_password=admin _ambari_hostname=$(hostname -f) _ambari_port=8080 _ambari_protocol=http _ambari_api="${_ambari_protocol}://${_ambari_hostname}:${_ambari_port}/api/v1" #_cluster_name=hdp_cluster _cluster_name=`curl -k -H 'X-Requested-By: ambari' -u ${_ambari_admin_user}:${_ambari_admin_password} ${_ambari_api}/clusters | jq -r '.items[].Clusters.cluster_name'` _unused_service_list=`curl -k -H 'X-Requested-By: ambari' -u ${_ambari_admin_user}:${_ambari_admin_password} "${_ambari_api}/clusters/${_cluster_name}/services" | jq -r '.items[].ServiceInfo.service_name'` for myservice in $_unused_service_list do # if condition for zookeeper as ZK command is different than other services if [ $myservice == 'ZOOKEEPER' ] then MY_COMMAND=""$myservice"_QUORUM_SERVICE_CHECK" else MY_COMMAND=""$myservice"_SERVICE_CHECK" fi # create payload for each service cat > /var/tmp/$myservice-payload.json <<EOF { "RequestInfo": { "context": "$myservice Service Check", "command": "$MY_COMMAND" }, "Requests/resource_filters": [ { "service_name": "$myservice" } ] } EOF # run service check for all services echo "============ Trigerred service check for ${myservice} ============" curl -k -u ${_ambari_admin_user}:${_ambari_admin_password} -H 'X-Requested-By: ambari' "${_ambari_api}/clusters/${_cluster_name}/requests" -d @/var/tmp/$myservice-payload.json done #end
true
97a0f68bbccea54017636ed1ada6520c0c20da25
Shell
vinaybyrapu/Bash-Settings
/checkMySql.sh
UTF-8
347
3.1875
3
[]
no_license
#!/bin/bash UP=$(pgrep mysql | wc -l); if [ "$UP" -ne 1 ]; then echo "===== MySQL is down. You may need to enter admin password : "; sudo /usr/local/mysql/support-files/mysql.server start sudo /usr/local/mysql/support-files/mysql.server status else echo "================= MySQL is running =================="; fi
true
07e2d5298bc86967025bd194c9e655d016a02cdf
Shell
jensp/Arch-Linux-on-i586
/extra/xdg-utils/PKGBUILD
UTF-8
749
2.765625
3
[]
no_license
# $Id: PKGBUILD 41780 2009-06-07 09:58:58Z jgc $ # Maintainer: Jan de Groot <jgc@archlinux.org> pkgname=xdg-utils pkgver=1.0.2 pkgrel=2 pkgdesc="Command line tools that assist applications with a variety of desktop integration tasks." arch=(i586 i686 x86_64) url="http://portland.freedesktop.org/" depends=('sh') license=(MIT) source=(http://portland.freedesktop.org/download/$pkgname-$pkgver.tgz) md5sums=('348a5b91dc66426505022c74a64b2940') build() { cd "${srcdir}/${pkgname}-${pkgver}" ./configure --prefix=/usr --mandir=/usr/share/man || return 1 make || return 1 make DESTDIR="${pkgdir}" install || return 1 install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}" install -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/" || return 1 }
true
1a2d7deb692fce9e2751bdc0fe351d62952f1489
Shell
ATLAS-Analytics/xAOD-analytics
/container/fix.sh
UTF-8
689
3.3125
3
[]
no_license
#!/bin/bash IND="2018-01" for i in $(seq -f "%02g" 1 31) do DateToProcess="$IND-$i" echo "Job Indexing... "${DateToProcess} pig -4 log4j.properties -f JobIndexer.pig -param INPD=${DateToProcess} -param INDE=${IND} rc=$?; if [[ $rc != 0 ]]; then echo "problem with pig indexer. Exiting." exit $rc fi echo "pig code finished." echo "Done. Starting the other indexer..." rm -f heatmap.csv hdfs dfs -getmerge heatmap.csv heatmap.csv rc=$?; if [[ $rc != 0 ]]; then echo "problem with getmerge. Exiting." exit $rc fi python indexer.py ${IND} rc=$?; if [[ $rc != 0 ]]; then echo "problem with python indexer. Exiting." exit $rc fi echo "upload finished." done
true
5aa08667e6081c602d3c99a282d0eaba49c54f7f
Shell
dspinellis/code-lifetime
/difflog.sh
UTF-8
1,701
3.375
3
[ "Apache-2.0" ]
permissive
#!/bin/sh # # Copyright 1996-2000 Diomidis Spinellis # # 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. # # # Produce a log of changes in unified diff format # This is the equivalent of running # git -c diff.renameLimit=30000 log -m -M -C --pretty=tformat:'commit %H %at' --topo-order --reverse -U0 # However, the former command has been known to produce incorrect results; # see http://stackoverflow.com/questions/38839595/how-can-i-obtain-with-git-log-a-series-of-patches-that-can-be-auto-applied # Any command line options are passed as arguments to git diff BRANCH="$1" shift # Default 8k ulimit core dumps ulimit -s 65536 # Obtain a list of commit timestamp parents in topological order git log --pretty=tformat:'%H %at %P' --topo-order $BRANCH -- | tee $TOOLDIR/$outdir/commit-tree.txt | # Provide the graph's longest path $TOOLDIR/daglp | tee $TOOLDIR/$outdir/commit-daglp.txt | while read sha ts ; do if [ "$prev" ] ; then echo "commit $sha $ts" echo # Output difference between successive commits git -c diff.renameLimit=30000 diff -m -M -C -U0 $@ $prev..$sha else # Show first commit git show --pretty=tformat:'commit %H %at' --topo-order --reverse -U0 $sha fi prev=$sha done
true
f560b0518942d88af61182a77fa9d53fced76424
Shell
wabscale/bigj.dev
/api/entrypoint.sh
UTF-8
976
3.6875
4
[]
no_license
#!/bin/sh wait_for_db() { # ping db until we get a response echo "waiting for db to start..." until mysqladmin ping -h "db" -P 3306 --silent; do sleep 1; done sleep 3 # give it another hot second... echo "db started" } initialize_db() { # This function will run migrations and seeds on database. # It is possible that seeds will fail. This may happen # with the config seeder. If the config entries are defined # then the unique contraint will cause an error. We can ignore # this error as our config entires are properly defined cd src/db npx sequelize db:migrate npx sequelize db:seed:all 2> /dev/null cd ../../ } start_api() { # start api in either prod or debug mode if [ "${NODE_ENV}" = "development" ]; then >&2 echo "WARNING starting api in debug mode" exec yarn run debug fi exec yarn start } main() { wait_for_db initialize_db start_api } main
true
1de8c231983d2063e7ce4052dbe7943ee7fd64c5
Shell
psrb/dotfiles
/install.sh
UTF-8
3,243
4.03125
4
[]
no_license
#!/bin/sh # https://github.com/junegunn/vim-plug PLUG_VIM_URL="https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" # https://github.com/ganwell/vim-hunspell-dicts ask() { printf "%s [yN]: " "$1" read -r yn if [ "$yn" = "y" ] || [ "$yn" = "Y" ]; then return 0 fi return 1 } check_installed() { printf " %s: " "$1" if command -v "$1" >/dev/null 2>&1; then echo "installed!" else echo "not installed!" exit 1 fi } # Create a link named $2 to file $1. # Overwrites existing links. # Overwrites all other files only on user confirmation create_link() { file=$1 link_name=$2 printf " Link: %s -> %s\n" "$link_name" "$file" if [ -h "$link_name" ]; then # is a symbolic link rm "$link_name" elif [ -e "$link_name" ]; then # other file exists if ask " File \"$link_name\" exists! Do you want to overwrite it? "; then if [ -d "$link_name" ]; then rm -r "$link_name" else rm "$link_name" fi else return fi fi ln -s "$file" "$link_name" } download() { name=$1 file_path=$2 url=$3 printf "Downloading %s\n" "$name" printf " " if [ -e "$file_path" ]; then echo "Already downloaded!" return fi if curl --silent --fail --location --output "$file_path" --create-dirs \ "$url" then echo "Downloaded!" else echo "Failed!" exit 1 fi } ##### MAIN ##### echo "Checking installs" check_installed vim check_installed zsh check_installed git echo SCRIPT_DIR=$(cd "$(dirname "$0")" || exit 1; pwd) echo "Creating links" create_link "$SCRIPT_DIR/latexmkrc" ~/.latexmkrc create_link "$SCRIPT_DIR/tmux.conf" ~/.tmux.conf create_link "$SCRIPT_DIR/vim" ~/.vim create_link "$SCRIPT_DIR/zsh" ~/.zsh create_link "$SCRIPT_DIR/zsh/zprofile" ~/.zprofile create_link "$SCRIPT_DIR/zsh/zshenv" ~/.zshenv create_link "$SCRIPT_DIR/zsh/zshrc" ~/.zshrc create_link "$SCRIPT_DIR/gitconfig" ~/.gitconfig create_link "$SCRIPT_DIR/gitignore_global" ~/.gitignore_global mkdir -p ~/.gnupg/ create_link "$SCRIPT_DIR/gnupg/gpg.conf" ~/.gnupg/gpg.conf create_link "$SCRIPT_DIR/gnupg/gpg-agent.conf" ~/.gnupg/gpg-agent.conf if [ "$(uname)" = "Darwin" ] then create_link "$SCRIPT_DIR/hammerspoon" ~/.hammerspoon fi echo echo "Creating folders" echo " Folder: ~/.vimundo" [ ! -d ~/.vimundo ] && mkdir ~/.vimundo echo echo "Cloning ZSH completions" if [ ! -d "$SCRIPT_DIR/zsh/completion/zsh-completions" ] then git clone https://github.com/zsh-users/zsh-completions \ "$SCRIPT_DIR/zsh/completion/zsh-completions" else echo " Already cloned!" fi echo download "plug.vim" "$SCRIPT_DIR/vim/autoload/plug.vim" "$PLUG_VIM_URL" echo echo "Installing Vim plugins" vim_install_type_path=vim/autoload/installType.vim if [ ! -e $vim_install_type_path ]; then if ask " Install all vim plugins?"; then echo "let g:installType#isCompleteInstall = 1" > $vim_install_type_path else echo "let g:installType#isCompleteInstall = 0" > $vim_install_type_path fi fi vim +PlugInstall +sleep4 +qa echo " Done!" echo echo "Finished!"
true
53366ce23cd09be364659402b51f41847a47b231
Shell
TheDauthi/dotfiles
/init/shellrc.d/76-fzf-completion.bash
UTF-8
508
2.8125
3
[ "Unlicense" ]
permissive
if [[ ! -e "${HOME}/.shellrc/plugins/fzf" ]]; then return fi if ! command -v fzf >/dev/null 2>&1; then return fi # Auto-completion # --------------- [[ $- == *i* ]] && source "${HOME}/.shellrc/plugins/fzf/shell/completion.bash" 2> /dev/null # Key bindings # ------------ source "${HOME}/.shellrc/plugins/fzf/shell/key-bindings.bash" complete -F _fzf_dir_completion -o default -o bashdefault tree export FZF_COMPLETION_TRIGGER='' bind '"\C-g": fzf-completion' bind '"\C-i": $fzf_default_completion'
true
d03637f7645007373c12bfac419a01197b025b5f
Shell
jtobard/rundeck-docker-update-tests
/debian-mysql/install.sh
UTF-8
2,129
3.015625
3
[]
no_license
#uncomment to use local deb file #cp /app/rundeck.deb /tmp/rundeck.deb #cp /app/rundeck-upd.deb /tmp/rundeck-upd.deb echo "* installing rundeck" dpkg -i --force-confnew /tmp/rundeck.deb cp -r /app/etc/rundeck/rundeck-config.properties /etc/rundeck/rundeck-config.properties sed 's,https://localhost:4443,'$SERVER_URL',g' -i /etc/rundeck/rundeck-config.properties sed 's,rundeckdb,'$MYSQL_DATABASE',g' -i /etc/rundeck/rundeck-config.properties sed 's,rundeckuser,'$MYSQL_USER',g' -i /etc/rundeck/rundeck-config.properties sed 's,rundeckpassword,'$MYSQL_PASSWORD',g' -i /etc/rundeck/rundeck-config.properties echo "*launching rundeck service" /etc/init.d/rundeckd start echo "*sleep 60 sec" sleep 60 echo "*tail log" tail /var/log/rundeck/service.log echo "*stoping old rundeck" /etc/init.d/rundeckd stop echo "*updating rundeck" dpkg -i --force-confnew /tmp/rundeck-upd.deb cp -r /app/etc/rundeck/rundeck-config.properties /etc/rundeck/rundeck-config.properties sed 's,https://localhost:4443,'$SERVER_URL',g' -i /etc/rundeck/rundeck-config.properties sed 's,rundeckdb,'$MYSQL_DATABASE',g' -i /etc/rundeck/rundeck-config.properties sed 's,rundeckuser,'$MYSQL_USER',g' -i /etc/rundeck/rundeck-config.properties sed 's,rundeckpassword,'$MYSQL_PASSWORD',g' -i /etc/rundeck/rundeck-config.properties echo "*launching rundeck service" /etc/init.d/rundeckd start echo "*tail -f updated rundeck log" timeout 90 tail -f /var/log/rundeck/service.log echo "*stoping new rundeck" /etc/init.d/rundeckd stop #iterate over conf file while read line; do TABLE=$( echo "$line" |cut -f1 ) FIELD=$( echo "$line" |cut -f2 ) EXPECTED=$( echo "$line" |cut -f3 ) OUTPUT="$(mysql -h mysql -u rundeck -prundeck rundeck -e 'DESCRIBE '$TABLE';' | grep $FIELD | cut -f 2)" echo "Testing $TABLE.$FIELD = $EXPECTED" if [ "$OUTPUT" = "$EXPECTED" ]; then echo "expected field value:$OUTPUT OK" echo "expected field value:$OUTPUT OK" >> /etc/rundeck/result.log else echo "unexpected field value:$OUTPUT" echo "unexpected field value:$OUTPUT" >> /etc/rundeck/result-error.log exit 1 fi done </app/fields.conf exit 0
true
ff8645002708e83298bea49ae47300beafc26447
Shell
rafael-trevisan/mandela
/server/scripts/install-ords.sh
UTF-8
947
2.90625
3
[]
no_license
#!/bin/bash # INSTALL_DIR=/root/install BINARIES_DIR=$INSTALL_DIR/binaries SCRIPTS_DIR=$INSTALL_DIR/scripts INSTALL_FILE=$BINARIES_DIR/ords.3.0.9.348.07.16.zip PARAMS_FILE=$SCRIPTS_DIR/ords_params.properties ORDS_HOME=$ORACLE_BASE/ords cd $BINARIES_DIR mkdir -p $ORDS_HOME cat $INSTALL_FILE.* > $INSTALL_FILE unzip -o $INSTALL_FILE -d $ORDS_HOME rm $INSTALL_FILE* mv $PARAMS_FILE $ORDS_HOME/params cd $ORDS_HOME java -jar ords.war configdir $ORACLE_BASE java -jar ords.war install simple sed -i -e 's|<entry key="jdbc.MaxLimit">10</entry>|<entry key="jdbc.MaxLimit">20</entry>|g' defaults.xml sed -i -e 's|<entry key="jdbc.InitialLimit">3</entry>|<entry key="jdbc.InitialLimit">6</entry>|g' defaults.xml sed -i -e 's|<entry key="misc.defaultPage">apex</entry>|<entry key="misc.defaultPage">f?p=mandela</entry>|g' defaults.xml # cp -rf $ORDS_HOME/ords.war /usr/share/tomcat/webapps/ # cp -rf $ORACLE_HOME/apex/images /usr/share/tomcat/webapps/i
true
fe0df9b1bb24b40d4e797c8b0ef98828bfc7539c
Shell
dhulihan/dotfiles
/ruby/rbenv.zsh
UTF-8
182
2.515625
3
[ "MIT" ]
permissive
# gimme them bins export PATH="$HOME/.rbenv/bin:$PATH" export RBENV_ROOT="$HOME/.rbenv" # init according to man page if (( $+commands[rbenv] )) then eval "$(rbenv init - zsh)" fi
true
f092ba2ffd6c12ae0dc9eaf79d526b67cbda8f14
Shell
jren2019/configs
/bash/setup_bashrc.sh
UTF-8
271
2.921875
3
[]
no_license
#! /bin/bash # make bash_profile if it doesn't exist if [ ! -f "~/.bash_profile" ]; then echo source ~/.bashrc > ~/.bash_profile fi # link to ~/.bashrc ln -sf $HOME/local_install/configs/bash/bashrc ~/.bashrc pip3 install virtualenvwrapper source ~/.bash_profile
true
08fc055a8712aed2c9d195687d2170e15a06771a
Shell
mikepcw/bootstrap
/teamviewer.sh
UTF-8
897
3.578125
4
[]
no_license
#!/usr/bin/env bash # Ensure running as regular user if [ $(id -u) -eq 0 ] ; then echo "Please run as a regular user" exit 1 fi # Install newer version of Ansible sudo apt-get -y install software-properties-common sudo apt-add-repository -y ppa:ansible/ansible sudo apt-get update sudo apt-get -y install ansible # Write playbook f=$(mktemp) cat <<EOF > $f - hosts: all become: true become_method: sudo tasks: - name: teamviewer | download installer get_url: url: https://dl.tvcdn.de/download/linux/version_14x/teamviewer_14.1.18533_amd64.deb dest: /tmp/teamviewer.deb - name: teamviewer | install package apt: deb: /tmp/teamviewer.deb - name: teamviewer | clean up file: state: absent path: /tmp/teamviewer.deb EOF # Execute playbook ansible-playbook -i "localhost," -c local $f # cleanup rm -f $f exit
true
134ba2834452667afd3c03ba19689f43706fb7c8
Shell
BackupTheBerlios/projectdev
/current/desktop/lib/libmng/PKGBUILD
UTF-8
611
2.546875
3
[]
no_license
# $Id: PKGBUILD,v 1.1 2004/12/03 17:24:00 rensel Exp $ # Contributor: Tom Newsom <Jeepster@gmx.co.uk> # Arch Maintainer: judd <jvinet@zeroflux.org> # Maintainer: blokkie <blokkie@burningfrog.be> pkgname=libmng pkgver=1.0.8 pkgrel=1 pkgdesc="A collection of routines used to create and manipulate MNG format graphics files" url="http://www.libmng.com/" depends=('zlib' 'libjpeg') source=(http://dl.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz) md5sums=('d688ca879c934e9cde8b323cf3025f89') build() { cd $startdir/src/$pkgname-$pkgver sh autogen.sh ./configure --prefix=/usr make || return 1 make DESTDIR=$startdir/pkg install }
true
d2160029cc80f85dd67d99c1948fbe3843d2d1c8
Shell
dsbaliyan/subnet-visualizer-autoConfig
/confGenerator/backUpScripts/gcloudShell.sh
UTF-8
511
2.6875
3
[]
no_license
#gcloud compute networks subnets list > subnets.txt #Fetching all the subnet details with the help of Gcloud SDK range=($(gcloud compute networks subnets list | awk '{print $4}' | tail -n+2)) vpc=($(gcloud compute networks subnets list | awk '{print $3}' | tail -n+2)) regions=($(gcloud compute networks subnets list | awk '{print $2}' | tail -n+2)) name=($(gcloud compute networks subnets list | awk '{print $1}' | tail -n+2)) python3 yamlCreation.py "${range[@]}" "${vpc[@]}" "${regions[@]}" "${name[@]}"
true
f5ba0959da6807745e80257e452e48069eb9a120
Shell
scrosland/dotfiles
/startup
UTF-8
361
3.421875
3
[]
no_license
# vim: set filetype=sh: # # Simply source all the individual scripts # for _startup_script in environment functions shrc ; do # source the common file . "$HOME/dotfiles/${_startup_script}" # source the .local file for system-specific settings lcl="$HOME/.${_startup_script}.local" if [ -r "${lcl}" ] ; then . "${lcl}" fi done
true
02790d0d37ab693b390a8f803e5e2baa1b76b387
Shell
n8felton/DeployStudio
/DeployStudio Admin.app/Contents/Frameworks/DSCore.framework/Versions/A/Resources/Tools/Common/ds_time_setup_install.sh
UTF-8
1,156
3.78125
4
[]
no_license
#!/bin/sh SCRIPT_NAME=`basename "${0}"` SCRIPT_PATH=`dirname "${0}"` echo "${SCRIPT_NAME} - v1.6 ("`date`")" if [ ${#} -lt 2 ] then echo "Command: ${SCRIPT_NAME} ${*}" echo "Usage: ${SCRIPT_NAME} <volume name> <timezone> [<network time server>]" echo "RuntimeAbortWorkflow: missing arguments!" exit 1 fi if [ "${1}" = "/" ] then VOLUME_PATH=/ else VOLUME_PATH=/Volumes/${1} fi if [ ! -e "${VOLUME_PATH}" ] then echo "Command: ${SCRIPT_NAME} ${*}" echo "Usage: ${SCRIPT_NAME} <volume name> <timezone> [<network time server>]" echo "RuntimeAbortWorkflow: \"${VOLUME_PATH}\" volume not found!" exit 1 fi "${SCRIPT_PATH}"/ds_finalize_install.sh "${1}" sed -e s:__TIMEZONE__:${2}:g \ -e s:__NTP_SERVER__:${3}:g \ "${SCRIPT_PATH}"/ds_time_setup/ds_time_setup.sh > "${VOLUME_PATH}"/etc/deploystudio/bin/ds_time_setup.sh chmod 700 "${VOLUME_PATH}"/etc/deploystudio/bin/ds_time_setup.sh chown root:wheel "${VOLUME_PATH}"/etc/deploystudio/bin/ds_time_setup.sh if [ -n "${3}" ] then if [ -e "${VOLUME_PATH}"/etc/ntp.conf ] then rm "${VOLUME_PATH}"/etc/ntp.conf fi ntpdate "${3}" fi echo "${SCRIPT_NAME} - end" exit 0
true
8a4ed6f72eb22717d6d73c40f6511af2dfbcc860
Shell
useredsa/connect.kak
/rc/connect/commands/:edit
UTF-8
1,366
3.703125
4
[ "Unlicense" ]
permissive
#!/bin/sh # Open files. # # Usage: # # :edit <file> # :edit +<line> <file> # :edit +<line>:<column> <file> # [files] | :edit # # Note: Order matters. . "$KAKOUNE_PRELUDE" # Read files from stdin when a terminal is available. # Reason: kak-desktop if [ ! -t 0 -a -t 1 ]; then while read file; do set -- "$file" "$@" done fi # Skip options [ "$1" = '--' ] && shift # Open files at the given position (line and column) if specified (before or after the file). commands=$( while [ "$1" ]; do case "$1" in ('+'*':'*) line=${1#+}; line=${line%:*} column=${1#*:} file=$(realpath "$2") shift 2 kak_escape edit "$file" "$line" "$column" ;; ('+'*) line=${1#+} file=$(realpath "$2") shift 2 kak_escape edit "$file" "$line" ;; (*) file=$(realpath "$1") shift case "$1" in ('+'*':'*) line=${1#+}; line=${line%:*} column=${1#*:} shift kak_escape edit "$file" "$line" "$column" ;; ('+'*) line=${1#+} shift kak_escape edit "$file" "$line" ;; (*) kak_escape edit "$file" ;; esac ;; esac done ) :send "$commands" # Focus back the client :send focus
true
f3c2ccada699f86010e6d13ce4648e345bf16fd8
Shell
hybridgroup/gophercon-2018
/sensor/up2/runner.sh
UTF-8
251
2.671875
3
[ "MIT" ]
permissive
[ $# -eq 0 ] && { echo "Usage: $0 [stepX] [ipaddress]"; exit 1; } echo "Compiling..." GOARCH=amd64 GOOS=linux go build -o $1app ./$1/main.go echo "Copying..." scp $1app upsquared@$2:/home/upsquared/$1app echo "Running..." ssh -t upsquared@$2 ./$1app
true
49a9a1609b2d7e62697e41a7bb04f510a34a56eb
Shell
xiexuchao/VSSD
/test.sh
UTF-8
2,199
2.828125
3
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
#!/bin/bash ########################## # VSSD disksim run 0.0 # 2012/02/17 ########################## PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH #read -p "make file !? (y/n) : " make_check #read -p "run cgdb !? (y/n) : " cgdb_check run_ssdsim_cnt="4" check_disksim_cnt=$(ps -lA | grep -c disksim) while [ "$check_disksim_cnt" = "$run_ssdsim_cnt" ] do echo "$check_disksim_cnt = $run_ssdsim_cnt \t Read Run: outputfile/F1_40m+Web1_32m-FIOSq_pageu.txt" sleep 30 check_disksim_cnt=$(ps -lA | grep -c disksim) done echo "$check_disksim_cnt != $run_ssdsim_cnt\n Run disksim\n" #===============intel-toolkid================== #-------------------01 GC---------------------- #cp algorithm/local_gc.h src/disksim_global.h #cp algorithm/global_gc.h src/disksim_global.h #-----------------02 parallel------------------ #cp algorithm/credit_cost-request_response_time.h src/disksim_global.h #cp algorithm/credit_cost-page_response_time.h src/disksim_global.h #-------------03 device queuing delay---------- #cp algorithm/VSSD_with_queuing_delay.h src/disksim_global.h #cp algorithm/VSSD_without_queuing_delay.h src/disksim_global.h #============================================== #------------------Run alone------------------- #cp algorithm/Run_alone.h src/disksim_global.h #--------------------Black BOX---------------------- #cp algorithm/black_box-FIOS.h src/disksim_global.h #cp algorithm/black_box-request_response_time.h src/disksim_global.h #--------------------White BOX---------------------- #cp algorithm/white_box-VSSDq_pageu.h src/disksim_global.h #cp algorithm/white_box-VSSDq_blocku.h src/disksim_global.h #cp algorithm/white_box-VSSDq_planeu.h src/disksim_global.h #cp algorithm/white_box-VSSDq_dieu.h src/disksim_global.h #if [ "$make_check" = "y" ] || [ "$make_check" = "Y" ]; then #make clean #make #fi para=./ssdmodel/valid/Intel_toolkit.parv input=../../trace/01_0ran_8md_100rand_11m.dis # input=../trace/01_0ran_8md_0rand_11m.dis echo "input file : $input" # time ./src/disksim $para stdout ascii $input 0 1> ./enable_borrow_dead_block.txt cgdb --args ./src/disksim $para stdout ascii $input 0
true
c896abfad22f9a749db50059b28869de000c3eae
Shell
shirshakmaskey/fabric-mns
/test-network/runCC.sh
UTF-8
1,823
2.921875
3
[]
no_license
ARGS1="$1" ARGS2="$2" ARGS3="$3" ARGS4="$4" ARGS5="$5" ARGS6="$6" ARGS7="$7" ARGS8="$8" ARGS9="$9" ARGS10="${10}" ARGS11="${11}" ORGA="${12}" ORGB="${13}" ORGC="${14}" ORGD="${15}" ORGE="${16}" CHANNEL_NAME="mychannel" CC_SRC_LANGUAGE="golang" VERSION="1" SEQUENCE="1" DELAY="3" MAX_RETRY="5" VERBOSE="false" CC_SRC_LANGUAGE=`echo "$CC_SRC_LANGUAGE" | tr [:upper:] [:lower:]` export FABRIC_CFG_PATH=$PWD/../config/ # import utils . scripts/envVar.sh chaincodeInvoke() { parsePeerConnectionParameters $@ res=$? verifyResult $res "Invoke transaction failed on channel '$CHANNEL_NAME' due to uneven number of peer and org parameters " # while 'peer chaincode' command can get the orderer endpoint from the # peer (if join was successful), let's supply it directly as we know # it using the "-o" option if [ -z "$CORE_PEER_TLS_ENABLED" -o "$CORE_PEER_TLS_ENABLED" = "false" ]; then set -x peer chaincode invoke -o localhost:7050 -C $CHANNEL_NAME -n basic $PEER_CONN_PARMS -c '{"function":"UpdateAsset","Args":['${ARGS1}','${ARGS2}','${ARGS3}','${ARGS4}','${ARGS5}','${ARGS6}','${ARGS7}','${ARGS8}','${ARGS9}','${ARGS10}','${ARGS11}']}' >&log.txt res=$? set +x else set -x peer chaincode invoke -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA -C $CHANNEL_NAME -n basic $PEER_CONN_PARMS -c '{"function":"UpdateAsset","Args":["T-6","659","Wed Jul 24 15:58:22 EDT 2013","29","0.0","84.0","0","39.980572","-82.953895","NULL","NULL"]}' >&log.txt res=$? set +x fi cat log.txt verifyResult $res "Invoke execution on $PEERS failed " echo "===================== Invoke transaction successful on $PEERS on channel '$CHANNEL_NAME' ===================== " echo } chaincodeInvoke $ORGA $ORGB $ORGC $ORGD $ORGE
true
1333d6b1564d0c820dade2afdf91b88d0e7bd604
Shell
matthew-ackerman/gsim
/analysis_pipline/mapgd_analysis.sh
UTF-8
1,870
2.53125
3
[]
no_license
#!/bin/bash cd .. source settings.sh cd /nfs/users/nfs_m/ma18/src/gsim/analysis_pipline samtools view -H ../sequences/seq_000${paired}${filtered}${realign}${clipped}${bwasuffix} > ../sequences/temp-header.txt name=$1 LD_DIST=$2 samtools mpileup -B ../sequences/*${paired}${filtered}${realign}${clipped}${bwasuffix} -f $name | gzip - > ../sequences/mpileup.txt.gz mapgd proview -H ../sequences/temp-header.txt -n ../sequences/name-file.txt -s | gzip - > ../sequences/pro.txt.gz echo "calling alleles" mapgd allele -i ../sequences/pro.txt.gz -c 1 -g 2 -e 0.0001 -b | mapgd filter -q 0.001 -p 6 -g 2 -c 300 -C 3000 | gzip - > ../sequences/mapgd_calls.txt.gz zcat ./mapgd_calls.txt.gz | mapgd filter -q 0.001 -p 6 -g 2 -X 0.05 | gzip - > ../sequences/mapgd_calls_p6_g2_X_0.05.txt.gz exit #mapgd allele -i ../analysis_files/pro.txt.gz -c 1 -g 20 -e 0.0001 | mapgd filter -q 0.001 -p 1 -g 2 -N 1 | gzip - > ../analysis_files/mapgd_calls.txt.gz zcat ../analysis_files/mapgd_calls.txt.gz | tail -n +6 | sed '$d' > ../analysis_files/mapgd_calls-trim.csv mapgd allele -i ../analysis_files/pro.txt.gz -c 1 -g 2 -e 0.0001 | mapgd filter -q 0.01 -p 10 -g 10 -N 1 | gzip - > ../analysis_files/mapgd_calls.txt.gz echo "estimating genotypes" mapgd genotype -p ../analysis_files/pro.txt.gz -m ../analysis_files/mapgd_calls.txt.gz | gzip - > ../analysis_files/genotype.gcf.gz echo "estimating ld" mapgd linkage -i ../analysis_files/genotype.gcf.gz -D $LD_DIST | gzip - > ../analysis_files/mapgd_linkage.out.gz zcat ../analysis_files/mapgd_linkage.out.gz | tail -n +6 | sed '$d' > ../analysis_files/mapgd_linkage-trim.csv echo "estimating relatedness" cat ../analysis_files/genotype.gcf.gz | gunzip - | mapgd relatedness > ../analysis_files/mapgd_relatedness.out echo "estimating quantitive componenets" #mapgd quant -r ../analysis_files/mapge_relatedness.out -p ../pedigree.txt
true
3f0731e599c1a5a11360faa551fd1d87db8b1305
Shell
Wallkerock/X-setup
/.scripts/updates-install-i3.sh
UTF-8
940
3.46875
3
[]
no_license
#! /bin/bash ### For other terminal emulators ### # urxvt -e zsh -c # xfce4-terminal -x bash -c # gnome-terminal -x bash -c ### URXVT setup ### urxvt -name float -e bash -c "echo -e '\e[1;33mSystem ready to update. Enter to run PACMAN: \e[1;30m/Ctrl+c Exit/\e[0m'; read; \ sudo pacman -Syu; \ echo -e '\n\e[1;33mDone - press enter to run updates from AUR: \e[1;30m/Ctrl+c Exit/\e[0m'; read; \ yay -Syu --aur; \ echo -e '\n\e[1;33mDone - press enter to exit:\e[0m'; read" & # pid="$!" # # Wait for the window to open and grab its window ID # winid='' # while : ; do # winid="`wmctrl -lp | awk -vpid=$pid '$3==pid {print $1; exit}'`" # [[ -z "${winid}" ]] || break # done # # Focus the window we found # wmctrl -ia "${winid}" # # Make it float # i3-msg floating enable > /dev/null; # # Move it to the center for good measure # i3-msg move position center > /dev/null; # # Wait for the application to quit # wait "${pid}"; &
true
65a31e4ca99489eaff4977893d8cd6d9d23ed7e2
Shell
jeffreyfox/LeetCode
/Algorithms/list_difficulty
UTF-8
432
3.875
4
[]
no_license
#!/bin/bash if [ "$#" -ne 1 ]; then echo "Please specify input file name!" exit; fi file=$1 echo "$file : " solved=0 total=0 while read N do cnt=`grep -c $N Summary.txt` if [ $cnt -ne 0 ] ; then # echo -en "X " ((solved++)) else # echo -en "$N " echo `grep $N Problems.csv` fi ((total++)) done < ${file}.txt echo "Total ($total) Solved ($solved) Remaining ($((total-solved)))" echo -en "\n"
true
6cb3c5a0f2a79a306c4b179b5522e5d72b93c72a
Shell
kangas/.dotfiles
/go.sh
UTF-8
102
3.015625
3
[ "MIT" ]
permissive
if [ -d "/usr/local/go/bin" ] ; then export GOROOT=/usr/local/go PATH="$PATH:$GOROOT/bin" fi
true
26036a63f1acb43cf604dd7bcf31db189e00db7a
Shell
eosswedenorg/scripts
/delphi-price-oracle.sh
UTF-8
924
3
3
[]
no_license
#!/bin/bash ACCOUNT="ACCOUNT_NAME" CONTRACT="delphioracle" get_price() { echo $(echo "$1" | jq -c ".$2") $3 | awk {'printf "%d",$1*$2'} } unlock_wallet() { ${CLEOS} --wallet-url ${WALLET_URL} unlock --password "PW5................" } URL="https://min-api.cryptocompare.com/data/price?fsym=WAX&tsyms=BTC,USD" CLEOS="Path-to-cleos" API_URL="https://api.waxsweden.org" WALLET_URL="http://127.0.0.1:8888" PRICES=$(curl "$URL" 2> /dev/null) PAYLOAD=$(cat << EOF '{ "owner": "$ACCOUNT", "quotes": [ { "pair": "waxpusd", "value": "$(get_price $PRICES \"USD\" 10000)" }, { "pair": "waxpbtc", "value": "$(get_price $PRICES \"BTC\" 100000000)" } ] }' EOF ) unlock_wallet 1>/dev/null 2>&1 echo $PAYLOAD > /tmp/update_delphi_oracle.tmp eval ${CLEOS} -u ${API_URL} --wallet-url ${WALLET_URL} push action $CONTRACT write $(cat /tmp/update_delphi_oracle.tmp) -p ${ACCOUNT}@oracle
true
8928a27c767b0205598ce8bb5c0d00bcac4dc867
Shell
ahawthorne/bungler
/bungler
UTF-8
2,099
4.21875
4
[ "MIT" ]
permissive
#!/bin/bash #define commands for use with rails #RAILS_CMDS=(rails rake rspec cucumber pickler) function bungle_load_cmds { if [[ -z ${BUNGLER} ]]; then BUNGLER="rails rake" export BUNGLER fi BUNGLER_RAILS_CMDS=($BUNGLER) for i in "${BUNGLER_RAILS_CMDS[@]}"; do eval "function $i { bunglfy $i \$@; }" done } function check_exit { "$@" > /dev/null 2>&1 echo $? } function _bungleable_command_not_found { echo "${CMD}: command not found..." return 127 } function bunglfy { if [[ 0 -ne $(check_exit hash git) ]]; then echo "Bungler needs Git. So sorry." return 1 fi PDUB=$(pwd) CMD=$1 GO=$@ if [[ $(check_exit git rev-parse) -eq 0 ]]; then RAILPATH=$(git rev-parse --show-toplevel) if [[ -f ${RAILPATH}/bin/${CMD} ]]; then ${RAILPATH}/bin/${GO} elif [[ $(check_exit type -f ${CMD}) -eq 0 ]]; then shift $(type -P ${CMD}) $@ else _bungleable_command_not_found fi elif [[ -e "${PDUB}/bin/${CMD}" ]]; then "${PDUB}/bin/"${GO} elif [[ $(check_exit type -f ${CMD}) -eq 0 && $(check_exit type -P $CMD) -eq 0 ]]; then shift $(type -P ${CMD}) $@ else _bungleable_command_not_found fi } function bungle { BUNGLECOM="${1}" case "$BUNGLECOM" in "list" | "-l" | "--list" ) echo -e "Bungled commands: \n ${BUNGLER}" ;; "" ) read -r -d '' DERP <<'EOF' Bungler! Usage: bungle [<command>] [<args>] A little something like this: Command Example bungle list No. bungle add <bungled-command> bungle add pickler bungle remove <bungled-command> bungle remove pickler EOF echo -e "$DERP" bungle_load_cmds ;; "reload" ) bungle_load_cmds ;; "add" ) if [[ ! $BUNGLER =~ "$2" ]]; then export BUNGLER="$BUNGLER $2" bungle_load_cmds fi ;; "remove" ) if [[ $BUNGLER =~ "$2" ]]; then export BUNGLER=`echo $BUNGLER | sed "s/$2//"` bungle_load_cmds fi ;; * ) ;; esac } bungle reload
true
7bd0a33258c5b0537b3a9a5893fea0428d3324d0
Shell
jasder/os_preparation
/functions/F_01_ENV_03_basic_02_pkgs_rails.sh
UTF-8
2,365
2.90625
3
[]
no_license
local pkgs_list="" echo "===============================" echo " Installing basic dev packages for rails..." echo "===============================" #----------------------------------------------------------------------------------------- #Package Install #----------------------------------------------------------------------------------------- # --- For Rails (For installing rvm) --- #rpm --quiet -q sqlite-devel || yum -y install sqlite-devel # use mysql not sqlite pkgs_list="${pkgs_list} sqlite-devel" # --- For Passenger (Using puma instead) --- #yum install -y curl-devel # --- For compile latest ruby --- #yum install -y libffi-devel libyaml-devel readline-devel zlib zlib-devel tk-devel dotconf-devel valgrind-devel graphviz-devel jemalloc-devel pkgs_list="${pkgs_list} libffi-devel libyaml-devel readline-devel zlib zlib-devel tk-devel dotconf-devel valgrind-devel graphviz-devel jemalloc-devel" # --- For RVM 1.29.8+ - Add system ruby as dependency for CentOS --- #yum install -y ruby pkgs_list="${pkgs_list} ruby" # ----- Rails 6+ Preview use ----- # FFmpeg for video rpm -Uvh https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm #yum install -y ffmpeg ffmpeg-devel pkgs_list="${pkgs_list} ffmpeg ffmpeg-devel" # muPDF(need to purchase license) for PDFs (Popplerer is also supported) #yum install -y poppler poppler-devel pkgs_list="${pkgs_list} poppler poppler-devel" # Generate PDF files tools - for gem: wicked_pdf (wrapper for wkhtmltopdf) #yum install -y wkhtmltopdf wkhtmltopdf-devel pkgs_list="${pkgs_list} wkhtmltopdf wkhtmltopdf-devel" #----------------------------------------------------------------------------------------- #Package Start to Install #----------------------------------------------------------------------------------------- yum install -y ${pkgs_list} # -- ImageMagick6 - For rails 5.2+, active storage (gem 'mini_magick') -- # gem - Rmagick requires ImageMagick 6.7.7+ # gem - mini_magick requires ImageMagick 6.8.8-3+ # ImageMagick latest version - 6.9+ local image_magick_packages="$(curl -s https://imagemagick.org/download/linux/CentOS/x86_64/ |grep -Eo '"(ImageMagick-|ImageMagick-devel-|ImageMagick-libs-)+6.(\S)+(\.rpm)"' |xargs -i bash -c "echo https://imagemagick.org/download/linux/CentOS/x86_64/{}" | sed ':a;N;$!ba;s/\n/ /g')" yum localinstall -y ${image_magick_packages}
true
28f3b87f872a17128d411ba847cb7802f0f8ff32
Shell
wdke/wdk-code-general
/wdk-code-general-core/src/main/docker/copy.sh
UTF-8
484
2.640625
3
[]
no_license
#!/bin/bash echo "-------开始复制文件到指定文件目录---------" cd auto-code/springboot-demo/ echo $(mvn clean) echo $(mvn package) rm -rf /opt/app/auto-code/springboot-demo/ mkdir /opt/app/auto-code/springboot-demo cp ./target/springboot-demo-0.0.1-SNAPSHOT.jar /opt/app/auto-code/springboot-demo/ cp ./src/main/docker/* /opt/app/auto-code/springboot-demo/ cd /opt/app/auto-code/springboot-demo/ echo "-------开始部署docker容器---------" echo $(docker-compose up -d)
true
db8e056fc776d03b40f8e86f70f21eacecb8d4ef
Shell
HungHuynh/linuxConfigs
/.zsh/aliases
UTF-8
1,871
2.671875
3
[]
no_license
#!/bin/zsh #Alias #Auto open files alias -s {jpg,JPG,jpeg,JPEG,png,PNG,gif,GIF}='feh' alias -s {mpg,mpeg,avi,ogm,ogv,wmv,m4v,mp4,mov,f4v,mkv}='mplayer' alias -s {mp3,ogg,wav,flac}='ncmpcpp' alias -s {html,php,com,net,org,gov}='chromium-browser --user-data-dir=~/.chromium &' alias -s pdf='zathura' alias -s chm='xchm' alias -s {rar,zip,7z,tar}='extract' alias -s {txt}='v' # The 'cd' family ------------ alias -g ~='cd ~' alias -g ..='cd ..' alias -g ...='cd ../..' alias -g ....='cd ../../..' alias -g .....='cd ../../../..' # Command alias bashrc='vim ~/.bashrc && source ~/.bashrc' alias zshrc='vim ~/.zshrc && source ~/.zshrc' alias rm='sudo rm -r' alias cp='cp -i -r' alias mv='mv -i' alias mkdir='mkdir -p' alias grep='grep --color=auto' alias y='yaourt' alias update='yaourt -Syu' alias clean='sudo pacman -Rsn $(pacman -Qdtq)' alias shutdown='shutdown -h now' alias pacman='sudo pacman' alias netcfg='sudo netcfg' alias ifconfig='sudo ifconfig' alias l='ls' #Quickly navigate fav folder alias inbox='cd /ntfs-data/inbox' alias book='cd /ntfs-data/docs/' alias work='cd /ntfs-data/work/' alias vid='cd /ntfs-data/vids' alias lang='cd /ntfs-data/docs/lang' alias build='~/.build/' alias dev='cd /ntfs-data/Dropbox/dev/' alias dotfiles='cd /ntfs-data/.dotFiles/' #Tweak application default running mode alias browser='chromium-browser --user-data-dir=~/.chromium &' alias scrot='scrot -q100' alias urxvt='urxvtc&' alias gimp='gimp&exit' alias pidg='pidgin&' alias achrome='chromium-dev&exit' alias airc='irssi -n nXqd -w qungdung -c irc.freenode.net' alias mpd='mpd ~/.mpdconf' alias amplayer='mplayer -utf8' alias def="sdcv -u Oxford\ Advanced\ Learner\'s\ Dictionary" alias asynonym="sdcv -u Moby\ Thesaurus\ II" alias apc="python2 ~/.scripts/ideone.py" alias scim='scim -f x11 -c simple -d' alias vifm='vifm .' alias tmux='tmux attach' #Editor alias v='vim'
true
b7609c38a392154c80bfd8bc45734e6148eadde0
Shell
emanjavacas/spelldict
/data/scripts/process_data.sh
UTF-8
303
3.203125
3
[]
no_license
IN=$1 OUT=$2 TMP=$OUT/tmp/ N=200 SPLITTA=/home/enrique/code/splitta.1.03 mkdir $TMP echo "text-processing sentences files" for f in ${IN}*; do python $SPLITTA/sbd.py -m $SPLITTA/model_svm $f \ | python ./text_preprocessing.py > $OUT`basename $f` done echo "cleaning up" rm -r $TMP echo "done!"
true
2f5436f267dfb386dc034f2500f7a1f8132da223
Shell
shafdanny/heat-transfer-simulator
/execute.sh
UTF-8
146
2.734375
3
[]
no_license
#!/bin/bash EXEC=./bin/main DEFAULTOPTION="-i 10000 -e 012345 -s 024 -t 13 -m" if [ "$#" -gt "0" ]; then $EXEC $@ else $EXEC $DEFAULTOPTION fi
true
643ea06f442b2dc20fe3d5db9614f5ead30cdd42
Shell
jpmacveigh/WCS-MF
/getCoverage.sh
UTF-8
2,835
3.71875
4
[]
no_license
#!/bin/bash # construit les paths et envoye les requêtes getCoverage au WCS # $1 est le le coverageID # $2 est la résolution du modèle AROME (0025 ou 001) resol=$2 echo "****************************************************************************************" echo "getCoverage du coverageID : "$1 # le coverageID est passé comme premier paramètre . ./getDateCoverageID.sh # chargement de la fonction qui extrait la date du Run contenu dans le nom du coverageID heureCoverage=$(getDateCoverageID $1) # appel de ladite fonction echo "heure avant traitement : "$heureCoverage heure=${heureCoverage:0:19} # on ne garde que 19 caractères à partir du début echo "heure : "$heure dateCoverageIDTimestamp=$(date -d, --date=$heure +%s) # timeStamp de la date du coverageID echo "dateCoverageIDTimestamp :"$dateCoverageIDTimestamp nowTimestamp=$(date +%s) # timeStamp de la date actuelle echo "nowTmestamp :"$nowTimestamp ecart=$((($nowTimestamp-$dateCoverageIDTimestamp)/24/3600)) # ecart de temps en jour arrondi par défaut echo "écart de temps : "$ecart" jour(s)" # ancienneté du coverageID du coverageID if (($ecart >= 1)) # on ne traite pas les coverageID vieux de plus de 1 jour then echo "écart >=1 on ne traite pas le coverageID" else echo "écart <1 on le traite" echo "appel de getLesPaths" ./getLesPaths.sh $1 $resol # recherche des paths possibles pour un getCoverage. # Le résultat est dans le fichiers lesPaths path="https://geoservices.meteofrance.fr/api/__BvvAzSbJXLEdUJ--rRU0E1F8qi6cSxDp5x5AtPfCcuU__/MF-NWP-HIGHRES-AROME-" # fabrication du path pour la requête getCoverage au WCS path=$path$resol"-FRANCE-WCS?SERVICE=WCS&VERSION=2.0.1&REQUEST=GetCoverage&format=image/tiff&coverageId=" debutPath=$path$1"&subset=lat(50.0,51.0)&subset=long(3.0,4.0)" while read finPath # boucle sur les paths calculés do echo " ****** fin du path : "$finPath path=$debutPath$finPath echo "path pour getCoverage : "$path curl $path > tifftempo # envoi de la requête getCoverage au service WCS node test-geotiff.js # décodage et traitement du coverage reçu avec geotiff.js sous node done < lesPaths #path=$path$1"&subset=lat(50.0,51.0)&subset=long(3.0,4.0)&subset=time("$heureCoverage")" #if echo $1 | grep GROUND_OR_WATER_SURFACE; # recherche chaine dans coverageID pour savoir s'il concerne un paramètre de surface # "then # echo coverageID concerne la surface; # si oui, on n'ajoute rien au path # else # echo coverageID concerne un niveau; # path=$path"&subset=height(10)"; # si non, on ajoute la valeur du niveau requis (à améliorer) #fi fi
true
feff120baccf336ce0c97a74e9385d40a53eaca6
Shell
Shreekkanth/RedHatToolsInstaller
/Ansible_Tower/Playbook_Examples/LAPTOP/fedora-csb-automated-master/setup-machine.sh
UTF-8
340
2.53125
3
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
#!/bin/bash # TODO check that local configuration file has been adapted # we do this here because the first upgrade might break ansible itself sudo dnf -y upgrade # Wait a bit to make sure dnf locks are released (had issues) sleep 5 # And then call the right book, asking again for SUDO password ansible-playbook -K fedora-csb.yml "$@"
true
00103a7a7e10310b1de7455defdde05780ca0060
Shell
tw4452852/MyConfig
/.p9p/env
UTF-8
304
2.921875
3
[]
no_license
#!/bin/sh export PLAN9="$HOME/code/plan9port" # affix colons on either side of $PATH to simplify matching case ":${PATH}:" in *:"$PLAN9/bin":*) ;; *) # Prepending path in case a system-installed rustc needs to be overridden export PATH="$PATH:$PLAN9/bin" ;; esac
true
542188fecea5447d657715724de0586e58726993
Shell
softbaseas/dbstart_service
/src/webnm_service.sh
UTF-8
1,972
3.671875
4
[]
no_license
# Check if script is run as root. if [[ $EUID -ne 0 ]]; then echo "This script must be run as root." exit fi # Check if systemd is present. If not, it's an older system, and init.d has to be used instead. if [ `ps -e|grep " 1 ?"|cut -d " " -f15` != "systemd" ]; then echo "Systemd is not present. Use init.d scripts instead." exit 1 else echo "Systemd is present." fi # Check if the service already exists if [[ -L "/etc/systemd/system/webnm.service" ]]; then read -p "Service already exist and is activated. Deactivate and delete (y/N)? " yn case $yn in [Yy]*) systemctl stop webnm; rm /etc/systemd/system/webnm.service; rm /usr/lib/systemd/system/webnm.service ;; *) echo "Won't delete."; exit 1 ;; esac fi if [ -f "/usr/lib/systemd/system/webnm.service" ]; then read -p "Service already exist. Should it be deleted (y/N)? " yn case $yn in [Yy]*) systemctl stop webnm; rm /usr/lib/systemd/system/webnm.service ;; *) echo "Won't delete."; exit 1 ;; esac fi echo "# /etc/systemd/system/webnm.service # Ivan Kartik (ivn.kartik.sk), edit by Anders Wiberg Olsen (www.wiberg.tech) # Invoking Oracle scripts to start/shutdown instances defined in /etc/oratab # and starts listener [Unit] Description=AdminServer WLS_Forms WLS_Reports After=oracle-rdbms.service [Service] User=oracle Group=oinstall Type=forking Restart=no ExecStart=/home/oracle/WlsScripts/webnm.sh start ExecStop=/home/oracle/WlsScripts/webnm.sh stop TimeoutSec=20m0s RemainAfterExit=yes [Install] WantedBy=multi-user.target" > /usr/lib/systemd/system/webnm.service systemctl daemon-reload systemctl enable webnm echo "Done! Service webnm.service has been configured and will be started during next boot." echo "If you want to start the service now, execute: systemctl start webnm" #else #echo "Error: webnm.service is not installed yet. This script will not work without it, install it before installing this." #exit 1 #fi
true
a0463cf4f16c73be557cbf27df419c8c30ad16a8
Shell
Safecast/ingest
/cron/logger.bash
UTF-8
5,698
4.09375
4
[ "MIT" ]
permissive
# This file should be sourced, not executed. Do not add shebang to top. # Usage: # # Most users will only need to use the log(), start_perf_timer(), and # stop_perf_timer() functions. # # log <LEVEL> <MESSAGE> # start_perf_timer <TIMER NAME> # stop_perf_timer <TIMER NAME> source "$base_dir"/logger_presets.bash command_exists() { if command -v "$1" > /dev/null 2>&1; then printf 'true\n' else printf 'false\n' fi } validate_log_level() { # Available log levels based on SLF4J. http://www.slf4j.org/apidocs/org/slf4j/Logger.html # Global associative arrays can be buggy, which is why this is declared here. local -A log_levels=(['TRACE']='TRACE' ['DEBUG']='DEBUG' ['INFO']='INFO' ['WARN']='WARN' ['ERROR']='ERROR') if [ -z "${log_levels["$1"]:-}" ]; then printf 'Error: Log level %s is not understood, please remove it from your program.\n' 1>&2 exit 64 fi } determine_destination_enabled() { local dest_name="$1" local -A dest_bin_arr=( ['elastic']='curl' ['stderr']='printf' ['syslog']='logger' ) dest_bin="${dest_bin_arr["$dest_name"]:?}" local -A user_var_arr=( ['elastic']='SAFECAST_SH_LOGGER_USE_ELASTIC_METRICS' ['stderr']='SAFECAST_SH_LOGGER_USE_STDERR_LOG' ['syslog']='SAFECAST_SH_LOGGER_USE_SYSLOG' ) user_var="${user_var_arr["$dest_name"]:?}" bin_exists="$(command_exists "$dest_bin")" IFS= read -r "$user_var" <<< "${!user_var:-true}" use_dest='false' if [ "$bin_exists" = 'true' ]; then IFS= read -r "$user_var" <<< "${!user_var:-true}" else IFS= read -r "$user_var" <<< "${!user_var:-false}" fi if [ "$bin_exists" = 'true' ] \ && [ "${!user_var}" = 'true' ]; then use_dest='true' elif [ "${!user_var}" = 'true' ]; then printf "User requested use of syslog in variable $user_var. However, the necessary $dest_bin binary cannot be found in the \$PATH. Exiting.\n" 1>&2 exit 64 fi printf '%s\n' "$use_dest" } configure_logger() { if ! [ "$(command_exists jq)" = 'true' ]; then printf 'This logger requires the jq binary to be installed. It is available in most package managers. See https://stedolan.github.io/jq/\n' 1>&2 exit 1 fi if [ -v script_tag ]; then log WARN 'The logger has already been configured. Please do not call configure_logger more than once.' return fi declare -gA start_times script_tag="$1" script_tag_json_string="$(printf '%s' "$script_tag" | jq . --compact-output --slurp --raw-input --monochrome-output)" local logger_execution_id="$(uuidgen -r)" logger_execution_id_json_string="$(printf '%s' "$logger_execution_id" | jq . --compact-output --slurp --raw-input --monochrome-output)" use_elastic="$(determine_destination_enabled elastic)" use_stderr="$(determine_destination_enabled stderr)" use_syslog="$(determine_destination_enabled syslog)" } generate_log_json() { local IFS=' ' local level="$1" validate_log_level "$level" shift 1 local message="$(printf '%s' "$*" | jq . --compact-output --slurp --raw-input --monochrome-output)" printf '{"tag":%s, "exec_id":%s, "level":"%s", "message":%s}' \ "$script_tag_json_string" "$logger_execution_id_json_string" "$level" "$message" \ | jq . --compact-output --monochrome-output --sort-keys } write_log() { local line="$1" if [ "$use_stderr" = 'true' ]; then cat 1>&2 <<< "$line" fi if [ "$use_syslog" = 'true' ]; then logger -t "$script_tag" <<< "$line" fi } log() { write_log "$(generate_log_json $*)" } start_perf_timer() { local timer_name="$1" local start_time="$(date -u '+%s')" if ! [ -z "${start_times["$timer_name"]+x}" ]; then log 'ERROR' 'Cannot create a new performance timer called "'"$timer_name"'" because a timer with that name already exists. Exiting.' exit 1 fi start_times["$timer_name"]="$start_time" local standard_log="$(generate_log_json 'INFO' 'Starting timer '"$timer_name"' at '"$start_time")" local timer_name_json_string="$(printf '%s' "$timer_name" | jq . --compact-output --slurp --raw-input --monochrome-output)" local additional_log="$(printf '{"perf_event":"START","perf_start_time":%s, "perf_timer_name":%s}' "$start_time" "$timer_name_json_string")" write_log "$(printf '[%s, %s]' "$standard_log" "$additional_log" | jq '.[0] + .[1]' --compact-output --monochrome-output --sort-keys)" } end_perf_timer() { local timer_name="$1" local end_time=$(date -u '+%s') local start_time=${start_times["$timer_name"]} unset "start_times[$timer_name]" local total_time=$(($end_time - $start_time)) local timer_name_json_string="$(printf '%s' "$timer_name" | jq . --compact-output --slurp --raw-input --monochrome-output)" local standard_log="$(generate_log_json 'INFO' 'Ending timer '"$timer_name"' at '"$end_time")" local additional_log="$(printf '{"perf_event":"END","perf_end_time":%s, "perf_timer_name":%s}' "$end_time" "$timer_name_json_string")" write_log "$(printf '[%s, %s]' "$standard_log" "$additional_log" | jq '.[0] + .[1]' --compact-output --monochrome-output --sort-keys)" local standard_log="$(generate_log_json 'INFO' 'Execution time for '"$timer_name"' was '"$total_time"' seconds')" local additional_log="$(printf '{"perf_event":"TOTAL","perf_total_time":%s, "perf_timer_name":%s}' "$total_time" "$timer_name_json_string")" write_log "$(printf '[%s, %s]' "$standard_log" "$additional_log" | jq '.[0] + .[1]' --compact-output --monochrome-output --sort-keys)" }
true
65f1bc9feb716616ff981ea98c7f7951d532d62f
Shell
samsung-cnct/cma-vmware
/tests/get-cluster.sh
UTF-8
468
2.890625
3
[ "Apache-2.0" ]
permissive
#!/bin/bash CLUSTER_API=${CLUSTER_API:-cluster-manager-api.cnct.io} CLUSTER_API_PORT=${CLUSTER_API_PORT:-443} CLUSTER_NAME=${CLUSTER_NAME:-vmware-test-$(date +%s)} [[ -n $DEBUG ]] && set -o xtrace set -o errexit set -o nounset set -o pipefail main() { curl -X GET \ "https://${CLUSTER_API}:${CLUSTER_API_PORT}/api/v1/cluster?provider=vmware&name=${CLUSTER_NAME}" \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json' \ -iks } main
true
df6a3a4f8640b0883e436f4b6b97a2cf749b9e73
Shell
royceda/gurobi-docker
/docker-entrypoint.sh
UTF-8
475
3.390625
3
[]
no_license
#!/bin/sh set -e #if [ "${1:0:1}" = '-' ]; then # set -- gurobi "$@" #fi #if [[ "$VERBOSE" = "yes" ]]; then # set -x #fi #GUROBI_LICENSE="bc813f4e-fc70-11e8-b639-02e454ff9c50" #echo '' | grbgetkey bc813f4e-fc70-11e8-b639-02e454ff9c50 license=/home/gurobi/gurobi.lic if [ -f $license ]; then echo "Skipping license creation" #./gurobi.sh $1 else echo "Configure license $GUROBI_LICENSE" echo '' | grbgetkey $GUROBI_LICENSE #./gurobi.sh $1 fi
true
63f2969ae2281acbc8a61f369a5c33482cefc5e3
Shell
biorobaw/SCS_Sample_Model
/scripts/circe_cluster/configuration_process_results.sh
UTF-8
444
2.765625
3
[]
no_license
#!/bin/bash #SBATCH --time=0:10:00 #SBATCH --cpus-per-task 2 #SBATCH --qos=preempt #SBATCH --mem=2000M #SBATCH -p mri2016 processor_file=$1 baseDir=$2 configId=c$SLURM_ARRAY_TASK_ID echo "configId " $configId module rm apps/python/3.7.0 module add apps/python/3.7.3 PYTHONUSERBASE=/home/p/pablos/work/pythonlibs python $processor_file $baseDir $configId if [ $? -eq 0 ]; then echo SUCCESS else echo "FAIL $baseDir $configId" fi
true
38f68852ca26ccc9830b68066ffb87d777fe38e7
Shell
substring/packages
/package/switchres/rebuild_edids.sh
UTF-8
2,203
3.21875
3
[]
no_license
#!/bin/bash source /opt/gatools/include/includes.sh #Build various EDIDs build_and_install_edids() { mkdir -p /tmp/sredid cd /tmp/sredid for m in generic_15 arcade_15 arcade_15ex k7000 k7131 h9110 polo ; do switchres 640 480 60 --edid --monitor "$m" done # 25kHz for m in arcade_25 arcade_15_25 ; do switchres 512 384 60 --edid --monitor "$m" done # 31kHz for m in arcade_31 arcade_15_31 arcade_15_25_31 m2929 d9200 d9400 d9800 m3129 pstar ms2930 ms929 r666b pc_31_120 vesa_480 ; do switchres 640 480 60 --edid --monitor "$m" done # onliners, or special cases switchres 768 576 50 --edid --monitor pal switchres 720 480 60 --edid --monitor ntsc switchres 800 600 60 --edid --monitor vesa_600 switchres 1024 768 60 --edid --monitor pc_70_120 switchres 1024 768 60 --edid --monitor vesa_768 switchres 1280 1024 60 --edid --monitor vesa_1024 # Now generate a super res 15kHz edid wihth crt_range from generic_15 mkdir superres cd superres cp /etc/switchres.ini . set_mame_config_value ./switchres.ini dotclock_min "25.0" switchres 640 480 60 --edid --monitor generic_15 mv generic_15.bin generic_15_super_resi.bin echo "interlace 0" >> ./switchres.ini switchres 640 240 60 --edid --monitor generic_15 mv generic_15.bin generic_15_super_resp.bin cp generic_15_super_res{i,p}.bin ../ cd .. # Also recompute the custom mode EDID if it has been used custom_w=$(grep "^custom.width=" /home/arcade/shared/configs/ga.conf | cut -d '=' -f 2-) custom_h=$(grep "^custom.height=" /home/arcade/shared/configs/ga.conf | cut -d '=' -f 2-) custom_rr=$(grep "^custom.refresh_rate=" /home/arcade/shared/configs/ga.conf | cut -d '=' -f 2-) echo "Rebuilding EDID for $custom_w $custom_h $custom_rr" edid_file=/usr/lib/firmware/edid/custom_resolution.bin if [[ -e $edid_file ]] && [[ -n $custom_w ]] && [[ -n $custom_h ]] && [[ -n $custom_rr ]] ; then switchres $custom_w $custom_h $custom_rr --edid --monitor custom mv custom.bin $(basename "$edid_file") fi install -d /usr/lib/firmware/edid install -m 644 *.bin "$pkgdir"/usr/lib/firmware/edid cd .. rm -rf /tmp/sredid } # Launch between () so changing dirs don't mess the current shell (build_and_install_edids)
true
178951cf02403260417b6090921c220ea138bc53
Shell
LuCh1Monster/ShellDemos
/ch_04/demo04_18.sh
UTF-8
165
2.984375
3
[]
no_license
#!/bin/bash declare -i j=33 for i in 12 34 23 44 22 do if [ $j -lt $i ] then echo $i echo else echo $j echo fi done
true
addd6cf7cc84ce670749a87e243a1a3a7641c3b0
Shell
lupeordaz/csctoss
/denoss01/jobs/sync_product_code.sh
UTF-8
4,734
3.03125
3
[]
no_license
#!/bin/bash # # Synchronize product code between OSS and JBilling. # This script updates OSS database based on JBilling plan information. # # $Id: $ # source /home/postgres/.bash_profile DATE=`date +%Y%m%d` BASEDIR=/home/postgres/dba LOGFILE=$BASEDIR/logs/sync_product_code.$DATE #echo "CSCTOSS LINE/CLASS REPORT FOR $DATE" > $LOGFILE echo "" > $LOGFILE # identify lines with missing class and output to logfile echo "------------------------------------------------------" >> $LOGFILE echo "THE FOLLOWING LINES HAVE DIFFERENT PRODUCT_CODE IN OSS" >> $LOGFILE echo "------------------------------------------------------" >> $LOGFILE echo "" >> $LOGFILE psql -q -c " SELECT be.billing_entity_id AS billing_entity_id, be.name AS billing_entity_name, line.line_id AS line_id, line.start_date::date AS line_start_date, line.end_date::date AS line_end_date, line.radius_username AS radius_username, prd.product_code AS oss_product_code, jbill.internal_number AS jbill_product_code, jbill.public_number AS public_number, line.notes AS line_notes FROM billing_entity be JOIN line ON (be.billing_entity_id = line.billing_entity_id) JOIN plan pl ON (line.line_id = pl.line_id) JOIN product prd ON (pl.product_id = prd.product_id) JOIN dblink((SELECT * FROM fetch_jbilling_conn()), 'SELECT po.id AS order_id, po.public_number AS public_number, po.status_id AS status_id, ol.item_id AS item_id, (SELECT internal_number FROM item WHERE id = ol.item_id) AS internal_number, pl.line_id AS line_id, pl.sn AS sn, pl.esn_hex AS esn_hex, pl.username AS username FROM purchase_order po JOIN order_line ol ON (po.id = ol.order_id) JOIN prov_line pl ON (ol.order_id = pl.order_id) JOIN item_type_map itm ON (ol.item_id = itm.item_id) WHERE 1 = 1 AND po.status_id = 16 AND itm.type_id = 301 AND pl.archived IS NULL AND (SELECT internal_number FROM item WHERE id = ol.item_id) LIKE ''MRC-%'' ') jbill (order_id int, public_number text, status_id int, item_id int, internal_number text, line_id int, sn text, esn_hex text, username text) ON (line.line_id = jbill.line_id) WHERE 1 = 1 AND line.end_date IS NULL AND prd.product_code <> jbill.internal_number ORDER BY be.billing_entity_id, line.line_id ; " >> $LOGFILE # Correct different product_code in OSS based on JBilling. psql -q -c " " >> $LOGFILE #if [ `grep "(0 rows)" $LOGFILE | wc -l` -eq 3 ]; then if [ `grep "(0 rows)" $LOGFILE | wc -l` -eq 1 ]; then echo "" >> $LOGFILE echo "No rows found. Do not mail empty results." >> $LOGFILE else echo "" >> $LOGFILE echo "NOTE: The discrepancies have been auto corrected ..." >> $LOGFILE echo "" >> $LOGFILE cat $LOGFILE | mail -s "CSCTOSS MRC PRODUCT CODE CORRECTOR REPORT FOR: $DATE" dba@cctus.com # this chunk of code corrects the most common error so we dont have to do it manually qry=`psql -q << EOF SELECT public.set_change_log_staff_id(3); UPDATE plan SET product_id = (SELECT product_id FROM product prd2 WHERE prd2.product_code = t1.jbill_product_code) FROM ( SELECT be.billing_entity_id AS billing_entity_id, be.name AS billing_entity_name, line.line_id AS line_id, line.start_date::date AS line_start_date, line.end_date::date AS line_end_date, line.radius_username AS radius_username, prd.product_code AS oss_product_code, jbill.internal_number AS jbill_product_code, jbill.public_number AS public_number, line.notes AS line_notes FROM billing_entity be JOIN line ON (be.billing_entity_id = line.billing_entity_id) JOIN plan pl ON (line.line_id = pl.line_id) JOIN product prd ON (pl.product_id = prd.product_id) JOIN dblink((SELECT * FROM fetch_jbilling_conn()), 'SELECT po.id AS order_id, po.public_number AS public_number, po.status_id AS status_id, ol.item_id AS item_id, (SELECT internal_number FROM item WHERE id = ol.item_id) AS internal_number, pl.line_id AS line_id, pl.sn AS sn, pl.esn_hex AS esn_hex, pl.username AS username FROM purchase_order po JOIN order_line ol ON (po.id = ol.order_id) JOIN prov_line pl ON (ol.order_id = pl.order_id) JOIN item_type_map itm ON (ol.item_id = itm.item_id) WHERE 1 = 1 AND po.status_id = 16 AND itm.type_id = 301 AND pl.archived IS NULL AND (SELECT internal_number FROM item WHERE id = ol.item_id) LIKE ''MRC-%'' ') jbill (order_id int, public_number text, status_id int, item_id int, internal_number text, line_id int, sn text, esn_hex text, username text) ON (line.line_id = jbill.line_id) WHERE 1 = 1 AND line.end_date IS NULL AND prd.product_code <> jbill.internal_number ORDER BY be.billing_entity_id, line.line_id ) AS t1 WHERE 1 = 1 AND plan.line_id = t1.line_id ; \q` fi # remove log files older than 7 days find $BASEDIR/logs/sync_product_code* -mtime +7 -exec rm -f {} \; exit 0
true
de51e920ef5e9a4dba86d300d96bcded1238abce
Shell
domo141/nottoomuch
/md5mda.sh
UTF-8
4,857
3.8125
4
[]
no_license
#!/bin/sh # $Id; md5mda.sh $ # # Copyright (c) 2011-2014 Tomi Ollila # All rights reserved # # Created: Thu Jul 28 2011 21:52:56 +0300 too # Last modified: Wed 25 Feb 2015 16:35:48 +0200 too set -eu # When launched from ~/.forward, PATH not available... PATH=$HOME/bin:/usr/bin:/bin:/usr/local/bin:/usr/sbin:/sbin export PATH # "Idiomatic" ~/.forward example: (fix args and change user to your login name) #|"IFS=' '&& $HOME/.../md5mda.sh --cd $HOME/mail received wip log || exit 75 #user" case ${BASH_VERSION-} in *.*) shopt -s xpg_echo; esac case ${ZSH_VERSION-} in *.*) emulate ksh; set -eu; esac saved_IFS=$IFS readonly saved_IFS # die() will be re-defined a bit later die () { echo "$@" >&2; exit 1; } # fd 3 will be opened to a file a bit later log () { echo `exec date +'%Y-%m-%d (%a) %H:%M:%S'`: "$@" >&3; } usage () { bn=`exec basename "$0"` echo echo Usage: $bn [--cd dir] [--log-tee-stdout] maildir wipdir logdir echo } set_argval () { shift; argval="$*"; } while case ${1-} in -h|-?|--help) usage; exec sed -n '/^Options:/,$ p' "$0" ;; --cd=*) IFS==; set_argval $1; IFS=$saved_IFS; cd "$argval" ;; --cd) cd "$2"; shift ;; --log-tee-stdout) log () { date=`exec date +'%Y-%m-%d (%a) %H:%M:%S'` echo $date: "$@" >&3; echo $date: "$@" } ;; --) shift; false ;; -|-*) die "'$1': unknown option" ;; *) false esac; do shift; done case $# in 3) ;; *) exec >&2 usage echo Enter '' $0 --help '' for more help echo exit 1 esac nospaces () { case $2 in *["$IFS"]*) die "$1 '$2' contains whitespace"; esac } maildir=$1 wipdir=$2 logdir=$3 nospaces maildir "$maildir" nospaces wipdir "$wipdir" nospaces logdir "$logdir" eval `exec date +'year=%Y mon=%m'` test -d $logdir || mkdir -p $logdir exec 3>> $logdir/md5mda-$year$mon.log # had to write the above as exec failure below is uncaughtable (in dash) #{ exec 3>> $logdir/md5mda-$year$mon.log || { # mkdir -p $logdir # exec 3>> $logdir/md5mda-$year$mon.log; } #} 2>/dev/null die () { log "$@"; echo "$@" >&2; exit 1; } if=`exec mktemp $wipdir/incoming.XXXXXX 2>/dev/null` || : case $if in '') mkdir -p $wipdir if=`exec mktemp $wipdir/incoming.XXXXXX` esac # Write mail content from stdin to a file. # 'bogofilter -p' could be used here (bogofilter keeps whole mail in memory). #cat >> $if # Replace possible 'From ' on 1st line with 'X-From-Line: ' sed '1s/^From /X-From-Line: /' >> $if # openssl md5 provides same output on Linux & BSD systems (at least). eval `openssl md5 $if | sed 's:.* \(..\):dirp=\1 filep=:'` case $filep in '') die "Executing 'openssl md5 $if' failed!" esac # try atomic move, w/ link & unlink. don't overwrite old if any trymove () { ln "$1" "$2" 2>/dev/null || return 0 # note: inverse logic in return value unlink "$1" || : # leftover if unlink (ever) fails... return 1 } dof=$maildir/$dirp of=$dof/$filep movemailfile () { trymove $if $of || return 0 # in most of the cases execution doesn't reach here. test -d $dof || mkdir -p $dof || : # parallel mkdir possible... trymove $if $of || return 0 # if next test fails, leftover $if will be there test -f $of || die "ERROR: ln $if $of (where '$of' nonexistent) failed" for f in $of* do # duplicate mails are more probable collision reason than... if cmp -s $if $f then log "Duplicate mail '$f' ignored" rm $if exit 0 fi done # hmm, same sum but not duplicate. Older edited ? osum=`openssl md5 $of | sed 's:.* \(..\):\1/:'` case $osum in $dirp/$filep) log "WHOA! '$of' with 2 different files !" echo "WHOA! '$of' with 2 different files !" >&2 esac # We don't go into rename game in this script, we just want to # deliver mail files.... Note that the mktemp is done in the target # dir to assume uniqueness in first hit -- so there is temporary # zero-sized file for a short moment until it is replaced by the real # mail file (with different inode number). In the very improbable # chance the temporary file is ever there and noticed this should not # cause any other problem than slight confusion (if ever that). of=`exec mktemp $of.XXXXXX` mv -f $if $of } movemailfile log "Added '$of'" exit 0 Options: --cd dir -- change current directory to 'dir' before continuing --log-tee-stdout -- write log also to stdout Parameters: maildir -- the root directory for delivered mail wipdir -- work in progress temporary location for mail in delivery logdir -- directory where delivery logs are written The mail is read from stdin and it is first written to a file in 'wipdir' and its md5 checksum is calculated there. After that the file is moved to a subdirectory(*) in 'maildir'. Maildir and wipdir needs to be in the same file system. (*) The subdirectory is the 2 first hexdigits of the md5 checksum of the mail contents and the filename is the rest 30 hexdigits of the checksum. .
true
d9999a9ae3deeb56f215f7bee856e26b9a16ebeb
Shell
rcicm/Shell-Scripts
/Generic/RedisMonitor.sh
UTF-8
2,692
3.796875
4
[]
no_license
#!/bin/bash ############################################################## # Script to verify the read/write actions in a Redis instance # and the memory usage of this instance. # It send an alert to Nagios case the memory usage is higher # than $WARNMEM or if it couldnt insert/read a new key. # # 2012/11/21 - Rafael Campos ############################################################## #Usage example if [ $# -ne 2 ] then echo "Usage: $0 product instance (Ex.: $0 images farm)" exit 1; fi PRODUCT=$1 INSTANCE=$2 #Nagios Variables HOST=`hostname` IP=`hostname -i` CFG="/etc/nagios/send_nsca.cfg" NSCA="/usr/sbin/send_nsca" NSCA_SERVER="nsca.mydomain.com" #Nagios Messages CMDLINEWRITEERRO="$HOST-$IP;Redis - $PRODUCT-$INSTANCE;2;Error during the read/write action. Try restart" CMDLINEERRO="$HOST-$IP;Redis - $PRODUCT-$INSTANCE;2;The Memory usage is Higher than expected. Contact the Support Team" CMDLINEWARN="$HOST-$IP;Redis - $PRODUCT-$INSTANCE;1;The Memory usage is Higher than expected. Open a Ticket" CMDLINEOK="$HOST-$IP;Redis - $PRODUCT-$INSTANCE;0;OK" #Script variables REDISCONFPATH="/opt/$PRODUCT/redis-$INSTANCE/conf/redis.conf" # Adapt it to your redis.conf path REDISCLIPATH="/opt/generic/redis" REDISPORT=`grep ^port $REDISCONFPATH |cut -d" " -f 2` REDISPASS=`grep ^requirepass $REDISCONFPATH |cut -d\" -f 2` MAXMEM=`grep ^maxmemory $REDISCONFPATH |cut -d" " -f 2 |sed -e 's/MB/*1024*1024/g' |sed -e 's/G/*1024*1024*1024/g' |sed -e 's/K/*1024/g' | bc` USEDMEM=$(echo info | $REDISCLIPATH/redis-cli -h localhost -a $REDISPASS -p $REDISPORT |grep used_memory: |cut -d: -f2 | sed -e 's/\r//g') WARNMEM="85" #Percentage to WARNING (without '%') CRITMEM="95" #Percentage to CRITICAL (without '%') #Setting a new key in Redis echo "set writetest 1" | $REDISCLIPATH/redis-cli -h localhost -a $REDISPASS -p $REDISPORT #Recovering the key inserted RESULT=$(echo "get writetest" | $REDISCLIPATH/redis-cli -h localhost -a $REDISPASS -p $REDISPORT) #Removing the key inserted, to avoid future confusing echo "del writetest" | $REDISCLIPATH/redis-cli -h localhost -a $REDISPASS -p $REDISPORT if [ $RESULT -eq 1 ] then if [ $USEDMEM -lt $(echo "scale=0; ($MAXMEM*$WARNMEM)/100" | bc) ] then echo $CMDLINEOK | $NSCA -H $NSCA_SERVER -d ";" -c $CFG else if [ $USEDMEM -lt $(echo "scale=0; ($MAXMEM*$CRITMEM)/100" | bc) ] then echo $CMDLINEWARN | $NSCA -H $NSCA_SERVER -d ";" -c $CFG else echo $CMDLINEERRO | $NSCA -H $NSCA_SERVER -d ";" -c $CFG fi fi else echo $CMDLINEWRITEERRO | $NSCA -H $NSCA_SERVER -d ";" -c $CFG fi
true
a86da4cca9f41e0cf14e667de06406de4aafe218
Shell
kgyrtkirk/hive-toolbox
/dep-spider/spider.bash
UTF-8
830
3.109375
3
[]
no_license
#!/bin/bash BASE="http://savara:3200/artifactory/wonder/" cat ${1:-_deptree} | sed 's/.* //'|grep compile$|grep -F 3.0.3.0|sort|uniq|while read l;do #org.apache.hadoop:hadoop-yarn-server-applicationhistoryservice:jar:3.1.1.3.0.3.0-211:provided IFS=: read -ra parts <<< $l echo "$l ${#parts[@]}" >&2 group=${parts[0]} id=${parts[1]} type=${parts[2]} versionPart=3 if [ "${#parts[@]}" != 5 ];then versionPart=4 fi version="`echo ${parts[versionPart]}|sed 's/3.0.3.0-211/3.1.0.0-31/'`" n="$BASE/`echo $group|tr '.' '/'`/$id/$version/$id-$version" echo "$n.pom" echo "$n.jar" echo "$n-tests.jar" echo "$n-sources.jar" # http://savara:3200/artifactory/wonder/org/apache/hadoop/ #hadoop-yarn-server-applicationhistoryservice/3.1.1.3.0.3.0-200/hadoop-yarn-server-applicationhistoryservice-3.1.1.3.0.3.0-200.pom done
true
08197ba06a9be01ef7a8925a871910b2d16d7bea
Shell
chzchzchz/fsl
/util/plot/gen_histo.sh
UTF-8
883
3.28125
3
[ "MIT" ]
permissive
#!/bin/bash function set_gnuscript { TITLE="$1" OUTFILE="$2" YLABEL="$3" XLABEL="$4" SRCFILE="$5" gnuscript_dat=" set terminal png transparent nocrop enhanced small set output '$OUTFILE.png' set datafile missing '-' set title '$TITLE' set auto x set yrange [0:10] set style data histogram set style histogram cluster gap 1 set style fill solid border -1 set boxwidth 0.9 set xtic rotate by -45 scale 0 set ylabel '$YLABEL' set xlabel '$XLABEL' set bmargin 10 " plotcmd="plot '$SRCFILE' using 2:xtic(1) ti col" total=`expr $6 - 1` for x in `seq $total`; do echo ">>>>>>>$x" v=`expr $x + 2` plotcmd="$plotcmd , ""'' u $v ti col" done plotcmd="$plotcmd " gnuscript_dat="$gnuscript_dat $plotcmd" } function plot_dat { set_gnuscript "$1" "$2" "$3" "$4" "$5" "$6" echo $gnuscript_dat gnuplot <<<"$gnuscript_dat" } plot_dat "TITLE" "SOMEFILE" "YLABEL" "XLABEL" "TEST.DAT" 3
true
92fff36fadf39b39dd886271f583be8e86a3109b
Shell
fredericomartini-docker-libraries/environment-php7-dev
/themartec.sh
UTF-8
378
2.53125
3
[]
no_license
#!/bin/bash #turn on containers ./start-environment start #cp virtualhost docker cp config/apache2/sites-enabled/themartec.conf apache2-php:/etc/apache2/sites-enabled/ #replace php.ini docker exec apache2-php sed -i "s,error_reporting =.*,error_reporting = E_ALL \& ~E_NOTICE,g" /etc/php/7.0/apache2/php.ini #restart service docker exec apache2-php service apache2 reload
true
3a00274b5cb1d038b9447ba2244e95ef78cce64f
Shell
edentsai/dotfiles
/src/dot-bashrc.d/bashrc.d/man-command.bashrc
UTF-8
2,043
4.0625
4
[]
no_license
#!/usr/bin/env bash # vim: set filetype=sh # Return if not running interactive bash. if [[ "${BASH_VERSION:-}" == "" ]] || [[ "${PS1:-}" == "" ]]; then return fi # Configure env variables and aliases for `man` command. bashrc::configure_man_command() { # MANPAGER: Program used to display files. if command -v "most" > /dev/null 2>&1; then # Use `most` command as man pager better if `most` command is installed. export MANPAGER="most -s" elif command -v "less" > /dev/null 2>&1; then # Use `less` command as default man pager if `less` command is installed. export MANPAGER="less -Is" fi # List $MANPATH and force output to be one entry per line. alias manpath="echo -e \${MANPATH//:/\\\n}" } # Unshift manpaths to the environment variable `$MANPATH`: # - Remove specified manpaths from $MANPATH if already exists. # - Add specified manpaths to the beginning in $MANPATH. # - For examples: # - bashrc::unshift_manpaths_to_env_manpath "/path1" # - bashrc::unshift_manpaths_to_env_manpath "/path1:/path2" bashrc::unshift_manpaths_to_env_manpath() { local readonly EXIT_CODE_GENERAL_ERROR=1 local unshift_manpaths="${1}" if [[ "${unshift_manpaths}" == "" ]]; then return ${EXIT_CODE_GENERAL_ERROR} fi # Split unshift manpaths with the delimiter ':' into multiple lines. local manpaths="${MANPATH}" local unshift_manpath unshift_manpaths="${unshift_manpaths//:/\\\n}" while IFS= read -r unshift_manpath; do # Remove the unshift path from $MANPATH if it already exists. manpaths="$(echo ":${manpaths}:" | sed -e "s:\:${unshift_manpath}\::\::g" -e "s/^:*//" -e "s/:*$//")" done < <(echo -e "${unshift_manpaths//:/\\\n}") # Unshift manpaths into $MANPATH. export MANPATH="${unshift_manpaths}:${manpaths}" } # Export the envrionment variable `$MANPATH`. bashrc::export_env_manpath() { bashrc::unshift_manpaths_to_env_manpath "/usr/share/man" } bashrc::configure_man_command bashrc::export_env_manpath
true
04f11355328edb717a68f0b28380aeccc070abc0
Shell
SplitThePot/kubernetes-scripts
/wait-for-job
UTF-8
2,661
4.25
4
[ "MIT" ]
permissive
#!/bin/bash # Waits for a job to complete. # # Includes a one-step approach: # # 1. Wait for the nr of expected completion to be equal to nr of succeeded # # set -o errexit set -o pipefail set -o nounset # -m enables job control which is otherwise only enabled in interactive mode # http://unix.stackexchange.com/a/196606/73578 set -m DEFAULT_TIMEOUT=60 DEFAULT_NAMESPACE=default monitor_timeout() { local -r wait_pid="$1" sleep "${timeout}" echo "Timeout ${timeout} exceeded" >&2 kill "${wait_pid}" } get_specified_completions() { get_job_jsonpath '{.spec.completions}' } get_succeeded() { get_job_jsonpath '{.status.succeeded}' } get_failed() { get_job_jsonpath '{.status.failed}' } get_status_type() { get_job_jsonpath '{.status.conditions.type}' } get_job_jsonpath() { local -r jsonpath="$1" kubectl --namespace "${namespace}" get job "${job}" -o "jsonpath=${jsonpath}" } get_job_logs() { kubectl --namespace "${namespace}" logs "job/${job}" } display_usage_and_exit() { echo "Usage: $(basename "$0") [-n <namespace>] [-t <timeout>] <job>" >&2 echo "Arguments:" >&2 echo "job REQUIRED: The name of the job the script should wait on" >&2 echo "-n OPTIONAL: The namespace the job exists in, defaults is the 'default' namespace" >&2 echo "-t OPTIONAL: How long to wait for the job to be complete, defaults to ${DEFAULT_TIMEOUT} seconds, must be greater than 0" >&2 exit 1 } namespace=${DEFAULT_NAMESPACE} timeout=${DEFAULT_TIMEOUT} while getopts ':n:t:' arg do case ${arg} in n) namespace=${OPTARG};; t) timeout=${OPTARG};; *) display_usage_and_exit esac done shift $((OPTIND-1)) if [ "$#" -ne 1 ] ; then display_usage_and_exit fi readonly job="$1" if [[ ${timeout} -le 0 ]]; then display_usage_and_exit fi echo "Waiting for job of ${job} in namespace ${namespace} with a timeout ${timeout} seconds" monitor_timeout $$ & readonly timeout_monitor_pid=$! trap 'kill -- -${timeout_monitor_pid}' EXIT #Stop timeout monitor specified_completions=$(get_specified_completions); readonly specified_completions succeeded=$(get_succeeded) failed=$(get_failed) echo "Expected completions for job ${job}: ${specified_completions}" while [[ ${succeeded} -lt ${specified_completions} ]]; do if [[ ${failed} -gt ${specified_completions} ]]; then echo "Observed fails: ${failed:=0}" echo $(get_job_logs) exit 1 fi sleep .5 echo "Currently observed successes: ${succeeded:=0}" succeeded=$(get_succeeded) failed=$(get_failed) done echo "Observed expected successes: ${succeeded}" echo "Job ${job} successful. All ${specified_completions} jobs completed."
true
79641c3de48be3e293c1e899c0acc2d447c8cee0
Shell
chanyaz/ewe-android-hack
/jenkins/fork.sh
UTF-8
1,324
3.703125
4
[]
no_license
#!/bin/bash export TERM=dumb internal_artifact() { pushd project/build/fork tar -czvf ~/artifacts/uitests-$BUILD_NUMBER-$1.tar.gz expedia popd } ./gradlew --no-daemon clean --continue ./gradlew --no-daemon clean # unistall old apks ./tools/uninstall.sh com.expedia.bookings build() { ./gradlew --no-daemon aED aEDAT } run() { # run tests ./gradlew --no-daemon forkExpediaDebug -D "fork.tablet=true" -D android.test.classes=$1 } build || build if [ $? -ne 0 ]; then echo "Build failed" exit 1 fi failed_test_classes="" for runCount in `seq 3` do echo "run count - $runCount" # run test run $failed_test_classes # Check tests. # Creating a comma seprated list for the classes which house the failed tests. cat project/build/fork/expedia/debug/summary/fork-*.json | tr '}' '\n' | grep failureTrace | sed 's/.*"testClass":"\([^"]*\)","testMethod":"\([^"]*\)","failureTrace".*/\1/' > project/build/fork/expedia/debug/summary/failed_test_classes.txt failed_test_classes=$(cat project/build/fork/expedia/debug/summary/failed_test_classes.txt | tr '\n' ',') # exit if all test passed if [ "$failed_test_classes" == "" ]; then echo "All tests passed quit build." internal_artifact "$runCount-success" exit 0 else internal_artifact "$runCount-failure" fi done exit 1
true
121b249619fc54e5b1afbebd68d554c296d8b5a2
Shell
ModusCreateOrg/devops-infra-demo
/bin/codedeploy/ValidateService.sh
UTF-8
1,409
3.6875
4
[ "CC-BY-3.0", "MIT" ]
permissive
#!/usr/bin/env bash # # ValidateService.sh # # AWS CodeDeploy Validate Service hook script # Set bash unofficial strict mode http://redsymbol.net/articles/unofficial-bash-strict-mode/ set -euo pipefail IFS=$'\n\t' # Set DEBUG to true for enhanced debugging: run prefixed with "DEBUG=true" ${DEBUG:-false} && set -vx # Credit to https://stackoverflow.com/a/17805088 # and http://wiki.bash-hackers.org/scripting/debuggingtips export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }' GAUNTLT_RESULTS=/app/build/gauntlt-results.html # TODO: save this to S3 instead GAUNTLT_RESULTS_SAVE="/home/centos/$DEPLOYMENT_ID-gauntlt-results.html" check_every() { local delay=${1:-} local host="http://localhost/" # shellcheck disable=SC2048 while ! curl -s -o /dev/null $host do sleep "$delay" echo "Sleeping $delay, $host was not reachable" done } echo "Checking web server availability" check_every 2 echo "Scanning with openscap and gauntlt" mkdir -p /app/build /app/ansible/tmp cat < /dev/null > "$GAUNTLT_RESULTS" chown -R centos:centos "$GAUNTLT_RESULTS" /app/build /app/ansible/tmp chmod 755 "$GAUNTLT_RESULTS" /app/build /app/ansible/tmp set +e sudo -u centos HOME=/home/centos /app/bin/ansible.sh scan-openscap.yml scan-gauntlt.yml RETCODE=$? set -e cp "$GAUNTLT_RESULTS" "$GAUNTLT_RESULTS_SAVE" rm -rf /app/ansible/tmp /app/build exit "$RETCODE"
true
5a0c38d9a954a0f2957c5775b60a7b89153b80af
Shell
lukaasp/devops
/kops_hook.sh
UTF-8
1,916
3.40625
3
[ "Apache-2.0" ]
permissive
#!/usr/bin/env bash export DEBIAN_FRONTEND=noninteractive while true;do if [ `sudo systemctl is-active docker` = "active" ];then echo "Docker is running ... continuing with installation." docker -v break; fi echo "Waiting till nodeup finishes docker installation ..." sleep 10 done echo "Waiting 5 minutes till all containers are up and running..." sleep 300 tee /etc/docker/daemon.json <<EOF { "storage-driver": "overlay2" } EOF pkill -SIGHUP dockerd while sudo fuser while sudo fuser /var/lib/dpkg/lock /var/lib/apt/lists/lock /var/cache/apt/archives/lock >/dev/null 2>&1; do echo "Waiting for lock to be released ..." sleep 10 done curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - distribution=$(. /etc/os-release;echo $ID$VERSION_ID) curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list apt-get update wget https://download.docker.com/linux/ubuntu/dists/xenial/pool/stable/amd64/docker-ce_18.06.1~ce~3-0~ubuntu_amd64.deb while sudo fuser while sudo fuser /var/lib/dpkg/lock /var/lib/apt/lists/lock /var/cache/apt/archives/lock >/dev/null 2>&1; do echo "Waiting for lock to be released ..." sleep 10 done dpkg -i docker-ce_18.06.1~ce~3-0~ubuntu_amd64.deb while sudo fuser while sudo fuser /var/lib/dpkg/lock /var/lib/apt/lists/lock /var/cache/apt/archives/lock >/dev/null 2>&1; do echo "Waiting for lock to be released ..." sleep 10 done apt-get install -o Dpkg::Options::="--force-confold" -y nvidia-docker2 tee /etc/docker/daemon.json <<EOF { "default-runtime": "nvidia", "runtimes": { "nvidia": { "path": "/usr/bin/nvidia-container-runtime", "runtimeArgs": [] } }, "storage-driver": "overlay2" } EOF systemctl daemon-reload pkill -SIGHUP dockerd systemctl restart kubelet
true
abbe2a20d538a69d956bca0c719dc114fdc8a8c4
Shell
alexjh/opensuse-cf-stacks-ci
/tasks/create-stack-receipt/task.sh
UTF-8
412
2.8125
3
[ "MIT" ]
permissive
#!/bin/bash set -o errexit set -o nounset set -o pipefail set -x mkdir -p receipt-artifacts receipt_filename="receipt-artifacts/opensuse-cf-stack_receipt-$(cat version/number)" echo "Rootfs SHA256SUM: $(sha256sum opensuse-cf-stacks-latest-image/rootfs.tar | awk '{print $1}')" > "${receipt_filename}" echo "" > "${receipt_filename}" cat "stack-artifacts/opensuse-cf-stack_rpm_qa.out" >> "${receipt_filename}"
true
c28fcb4bfa747603bfece0f5666542a8cd78f340
Shell
kikorulan/HFExamples
/Example60_stochastic.bash
UTF-8
1,519
2.890625
3
[]
no_license
#!/bin/bash #================================================================================ # EXAMPLE for STOCHASTIC PDHG # 3D domain. # Compute the forward signal for sensors placed in the boundary of the cube #================================================================================ # Output folder export EXAMPLE_FOLDER="/cs/research/medim/projects2/projects/frullan/Documents/HighFreqCode/Examples/Ex60_3D_4balls/" export INPUT_FOLDER=$EXAMPLE_FOLDER"input_data/" export OUTPUT_FOLDER=$EXAMPLE_FOLDER"output_data/" cd $EXAMPLE_FOLDER # Mode export MODE='-f' # Assign files export DIMENSIONS="dimensions.dat" export SOUND_SPEED="sound_speed.dat" export INITIAL_PRESSURE="initial_pressure_4balls.dat" export SENSORS="sensors.dat" export FORWARD_SIGNAL="forwardSignal_56sensors.dat" export PIXEL_PRESSURE="pixelPressure.dat" # Regularization parameters - SPDHG #SIGMA=1e-1 #TAU=1e10 #THETA=1 #LAMBDA=1e-2 #EPOCHS=20 # Regularization parameters - FISTA LAMBDA=1e-3 LIPSCHITZ=1e-11 NITER=50 # Call RT solver export OMP_NUM_THREADS=26 #RTiterative_GPU $MODE $INPUT_FOLDER$DIMENSIONS $INPUT_FOLDER$SOUND_SPEED $INPUT_FOLDER$INITIAL_PRESSURE \ # $INPUT_FOLDER$SENSORS $INPUT_FOLDER$FORWARD_SIGNAL $INPUT_FOLDER$PIXEL_PRESSURE $SIGMA $TAU $THETA $LAMBDA $EPOCHS RTiterative_GPU $MODE $INPUT_FOLDER$DIMENSIONS $INPUT_FOLDER$SOUND_SPEED $INPUT_FOLDER$INITIAL_PRESSURE \ $INPUT_FOLDER$SENSORS $INPUT_FOLDER$FORWARD_SIGNAL $INPUT_FOLDER$PIXEL_PRESSURE $LAMBDA $LIPSCHITZ $NITER
true
1a723a9b4d45f3956511fff1b0bc9a6d22c4d916
Shell
mastarink/masbash
/home_dots/screen_combined.20121019/.profile
UTF-8
1,657
2.5625
3
[]
no_license
[[ "$MAS_TOPVARS" ]] || . $HOME/.topvars echo -en "Sourcing ${BASH_SOURCE[0]}\e[K\r" >&2 ###################################################################### declare -gx MAS_TEST_AT_PROFILE=MAS_TEST_AT_PROFILE # declare -agx MAS_TESTAR_AT_PROFILE # declare -Agx MAS_TESTAS_AT_PROFILE # MAS_TESTAR_AT_PROFILE[0]=MAS_TESTAR_AT_PROFILE # MAS_TESTAS_AT_PROFILE[MAS_TESTAS_AT_PROFILE]=MAS_TESTAS_AT_PROFILE # { # mas_loadlib_if_not mas_source_register_script_a regzero # mas_loadlib_if_not mas_term_new_status bash_init # type -t mas_term_new_status && mas_term_new_status >>$HOME/.mas/log/mstat/profile.1.$$.txt # } if [[ "$HOME" ]] && ! [[ "$MAS_BASH_LOG" ]] ; then declare -xg MAS_BASH_LOG=$HOME/.mas/log ; echo "`/bin/date '+%Y%m%d.%H%M%S.%N'`:p: $LINENO" >> $MAS_BASH_LOG/lili.txt ; fi # mas_loadlib_if_not umoment service # mas_loadlib_if_not mas_source_register_script_a regzero # mas_source_register_script_a S ".profile" mas_loadlib_if_not datemt time export MAS_TIME_PROFILE="`datemt`" echo "$( datemt ) :$TERM: ${BASH_SOURCE[0]} " >>$MAS_BASH_LOG/login/log.$( datem ) export MAS_PROFILE_TERM=$TERM mas_source_register_script S "-1" "${BASH_SOURCE[0]}" mas_loadlib_if_not mas_profile_common profile mas_profile_common [[ "$MAS_CONF_DIR_PROFILE" ]] && \ mas_source_scriptsn _profcomm_profile - MAS_CONF_DIR_PROFILE profile settings # { # mas_loadlib_if_not mas_source_register_script_a regzero # mas_loadlib_if_not mas_term_new_status bash_init # type -t mas_term_new_status && mas_term_new_status >>$HOME/.mas/log/mstat/profile.2.$$.txt # } mas_source_register_script E "-1" "${BASH_SOURCE[0]}" # vi: ft=sh
true