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
6a075f6f8438f51c12371e562c017539109833a8
Shell
mcamiano/grog
/grog/kshscripts/showm.sh
UTF-8
259
2.734375
3
[]
no_license
# showm.sh: Show defined methods # # $1=Oracle username/password # $2=class name # echo "Class: $2" sqlplus -s $1 <<EOT | grep -v "^$" set heading off set feedback off select methodtype, name from grogmethod where upper(classname) = upper('$2') / quit / EOT
true
b3d2512bb9bab62ab100de37b5dba58b857b242c
Shell
talkersource/ncohafmuta
/bot/restart
UTF-8
516
3.546875
4
[]
no_license
#!/bin/sh # by Cygnus # ncohafmuta@asteroid-b612.org # # The name of the storybot binary or program BINARY="storybot" # This next part copies over the log file to a backup, if test -f "botlog" then echo "Coping bot log to backup file..." cp botlog botlog.`/bin/date '+%m%d%y.%T'` rm botlog touch botlog fi if test -f "$BINARY" then echo -n "Starting the storybot..." ./$BINARY echo "Done" echo "See log file for details" else echo "Can't find the storybot program! Have you compiled it with ./compile?" fi
true
bf9e50c7531eb977628ced17e350713991a8faa6
Shell
nagabhushandevops/DevopsClass
/printnoto1.sh
UTF-8
73
3.15625
3
[]
no_license
#!/bin/bash n=$1 while [ $n -gt 0 ]; do echo "$n" n=`expr $n - 1` done
true
1315035b66bd858255e674f6476adc208f7956fb
Shell
infinitis/ci
/entrypoint.sh
UTF-8
2,714
3.4375
3
[]
no_license
#!/usr/bin/env bash set -euo pipefail # verify that variables used only in sourced files are set # so exit/failure will happen appropriately # ( source returns 0 if no commands are run which happen with bash strict mode ) REMOTE=$REMOTE_LOCATION REPOS=$REPOSITORY_NAMES # setup ssh runuser -u git -- mkdir -p /home/git/.ssh echo "$HOST_FINGERPRINT" >> /home/git/.ssh/known_hosts cat > /home/git/.ssh/config << EOF Host github.com IdentityFile ~/.ssh/keys/github User git StrictHostKeyChecking no EOF chown git:git /home/git/.ssh/known_hosts chown git:git /home/git/.ssh/config # clone repos . /clone.sh # setup fcgiwrap echo "FCGI_CHILDREN=2" > /etc/default/fcgiwrap service fcgiwrap start # setup nginx cat > /etc/nginx/nginx.conf << EOF user www-data www-data; events { } http { include mime.types; server { listen 80; root /usr/share/gitweb; # static repo files for cloning over https location ~ ^.*\.git/objects/([0-9a-f]+/[0-9a-f]+|pack/pack-[0-9a-f]+.(pack|idx))$ { root /repos/; } # requests that need to go to git-http-backend location ~ ^.*\.git/(HEAD|info/refs|objects/info/.*|git-(upload|receive)-pack)$ { root /repos/; fastcgi_pass unix:/var/run/fcgiwrap.socket; fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend; fastcgi_param PATH_INFO \$uri; fastcgi_param GIT_PROJECT_ROOT \$document_root; fastcgi_param GIT_HTTP_EXPORT_ALL ""; fastcgi_param REMOTE_USER \$remote_user; include fastcgi_params; } # Remove all conf beyond if you don't want Gitweb try_files \$uri @gitweb; location @gitweb { fastcgi_pass unix:/var/run/fcgiwrap.socket; fastcgi_param SCRIPT_FILENAME /usr/share/gitweb/gitweb.cgi; fastcgi_param PATH_INFO \$uri; fastcgi_param GITWEB_CONFIG /etc/gitweb.conf; include fastcgi_params; } } } EOF # setup gitweb cat > /etc/gitweb.conf << EOF \$projectroot = "/repos"; \$git_temp = "/tmp"; \$site_name = "$SITE_NAME"; \$base_url = "/"; EOF # setup push.sh script for cron cat > /push.sh << EOF #!/usr/bin/env bash set -euo pipefail while IFS= read -r repo do if [[ -n "\$repo" ]]; then cd "/repos/\$repo.git" if [[ -z "\`git remote | grep github\`" ]]; then git remote add github "git@github.com:$GITHUB_USERNAME/\$repo.git" fi git push --all -f github fi done < <(echo "$REPOSITORY_NAMES") EOF chmod +x /push.sh # setup fetch.sh script for cron cat > /fetch.sh << EOF #!/usr/bin/env bash set -euo pipefail while IFS= read -r repo do if [[ -n "\$repo" ]]; then cd "/repos/\$repo.git" git fetch --prune --prune-tags fi done < <(echo "$REPOSITORY_NAMES") EOF chmod +x /fetch.sh # setup cron service cron start # start nginx nginx -g 'daemon off;'
true
630298c7202b870a6571ed059960739af4f2b925
Shell
satheeshkumark/NLP
/Sentiment_Analysis/step1_ParseJSONTweets.sh
UTF-8
1,403
3.4375
3
[]
no_license
inputJSONFile=$1 outputParseFile=$2 script_path='scripts/' enDataPath='data/' esDataPath='data1/' ruDataPath='data2/' faDataPath='data3/' keywordPath='keywords/' parseScript=$script_path'step0_jsonparser.py' dbScript=$script_path'step0_InsertRecords.py' enkeyWordFile=$enDataPath$keywordPath'en-keywords.txt' eskeyWordFile=$esDataPath$keywordPath'es-keywords.txt' rukeyWordFile=$ruDataPath$keywordPath'ru-keywords.txt' fakeyWordFile=$faDataPath$keywordPath'fa-keywords.txt' ################################# #### Input : Input JSON File containing Twitter data #### Output : Parsed File containing tweets and their meta data echo $outputParseFile python $parseScript $inputJSONFile $outputParseFile ################################# #### Input : Output of previous step. Parsed metdata file from twitter #### Output : Inserts data in the database #### Requirement : Have to configure the database settings within the step0_InsertRecords.py program #### This code needs to be modified if any new language is going to be added #python $dbScript $outputParseFile ################ Push the tweetmetadata into db depending on language and retrieve the tweets of required language. ################ The above script pushes the tweet metadata to db. NOTE : db is needed to be configured accordingly ################ The script filteringTweets.py pulls and processes tweets depending on the language
true
e5e94a93711a931656c5dea33f1ad341f045a392
Shell
kitwtnb/dotfiles
/bin/adbss
UTF-8
382
3.0625
3
[]
no_license
#!/usr/bin/env bash set -ue -o pipefail export LC_ALL=C DEVICE_NAME=`adb devices | sed -e '1d' | cut -f 1 | peco` echo "Capturing $DEVICE_NAME" SAVE_PATH="$HOME/Downloads/capture.png" adb -s $DEVICE_NAME shell screencap -p /sdcard/screen.png adb -s $DEVICE_NAME pull /sdcard/screen.png $SAVE_PATH adb -s $DEVICE_NAME shell rm /sdcard/screen.png echo "Saved image to $SAVE_PATH"
true
2eaa91610673a6b9c9a9ce233207194ee82c2410
Shell
matthewfallshaw/dotfiles
/oh-my-zsh/cds.zsh
UTF-8
144
3.125
3
[]
no_license
# cd into source dir function cds { if [ -z "$1" ]; then cd ~/source else cd ~/source/$1 fi } compdef '_files -/ -W ~/source' cds
true
97403a2c7ff4b4e3c6a192808a56ad50581226d9
Shell
swvanderlaan/HerculesToolKit
/_archived/check_mich_imp.sh
UTF-8
30,498
3.46875
3
[ "MIT" ]
permissive
#!/bin/bash # #$ -S /bin/bash # the type of BASH you'd like to use #$ -N IMPUTE_HRC # the name of this script # -hold_jid some_other_basic_bash_script # the current script (basic_bash_script) will hold until some_other_basic_bash_script has finished #$ -o /hpc/dhl_ec/svanderlaan/projects/impute_hrc/impute_hrc.v2.3.1.v20190117.log # the log file of this job #$ -e /hpc/dhl_ec/svanderlaan/projects/impute_hrc/impute_hrc.v2.3.1.v20190117.errors # the error file of this job #$ -l h_rt=00:15:00 # h_rt=[max time, e.g. 02:02:01] - this is the time you think the script will take #$ -l h_vmem=8G # h_vmem=[max. mem, e.g. 45G] - this is the amount of memory you think your script will use # -l tmpspace=64G # this is the amount of temporary space you think your script will use #$ -M s.w.vanderlaan-2@umcutrecht.nl # you can send yourself emails when the job is done; "-M" and "-m" go hand in hand #$ -m beas # you can choose: b=begin of job; e=end of job; a=abort of job; s=suspended job; n=no mail is send #$ -cwd # set the job start to the current directory - so all the things in this script are relative to the current directory!!! # # You can use the variables above (indicated by "#$") to set some things for the submission system. # Another useful tip: you can set a job to run after another has finished. Name the job # with "-N SOMENAME" and hold the other job with -hold_jid SOMENAME". # Further instructions: https://wiki.bioinformatics.umcutrecht.nl/bin/view/HPC/HowToS#Run_a_job_after_your_other_jobs # # It is good practice to properly name and annotate your script for future reference for # yourself and others. Trust me, you'll forget why and how you made this!!! ### Creating display functions ### Setting colouring NONE='\033[00m' OPAQUE='\033[2m' FLASHING='\033[5m' BOLD='\033[1m' ITALIC='\033[3m' UNDERLINE='\033[4m' STRIKETHROUGH='\033[9m' RED='\033[01;31m' GREEN='\033[01;32m' YELLOW='\033[01;33m' PURPLE='\033[01;35m' CYAN='\033[01;36m' WHITE='\033[01;37m' function echobold { #'echobold' is the function name echo -e "${BOLD}${1}${NONE}" # this is whatever the function needs to execute, note ${1} is the text for echo } function echoitalic { echo -e "${ITALIC}${1}${NONE}" } function echonooption { echo -e "${OPAQUE}${RED}${1}${NONE}" } function echoerrorflash { echo -e "${RED}${BOLD}${FLASHING}${1}${NONE}" } function echoerror { echo -e "${RED}${1}${NONE}" } # errors no option function echoerrornooption { echo -e "${YELLOW}${1}${NONE}" } function echoerrorflashnooption { echo -e "${YELLOW}${BOLD}${FLASHING}${1}${NONE}" } ### MESSAGE FUNCTIONS script_copyright_message() { echo "" THISYEAR=$(date +'%Y') echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echo "+ The MIT License (MIT) +" echo "+ Copyright (c) 1979-${THISYEAR} Sander W. van der Laan +" echo "+ +" echo "+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and +" echo "+ associated documentation files (the \"Software\"), to deal in the Software without restriction, +" echo "+ including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, +" echo "+ and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, +" echo "+ subject to the following conditions: +" echo "+ +" echo "+ The above copyright notice and this permission notice shall be included in all copies or substantial +" echo "+ portions of the Software. +" echo "+ +" echo "+ THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT +" echo "+ NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +" echo "+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES +" echo "+ OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +" echo "+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +" echo "+ +" echo "+ Reference: http://opensource.org. +" echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" } script_arguments_error() { echoerror "$1" # ERROR MESSAGE echoerror "- Argument #1 -- Project name, could be 'Athero-ExpressGenomicsStudy1' ." echoerror "- Argument #2 -- Dataset name to create directories and intermediate files, could be 'AEGS1'." echoerror "- Argument #3 -- File name of input file, could be 'aegs1_snp5brlmmp_b37_QCwithChrX'." echoerror "- Argument #4 -- complete/path_to where the original data resides, could be '/hpc/dhl_ec/data/_ae_originals'." echoerror "- Argument #5 -- complete/path_to where the project directory is, could be '/hpc/dhl_ec/svanderlaan/projects/impute_hrc'." echoerror "- Argument #6 -- set the script mode, could be [PREP/CHECK]." echoerror "" echoerror "An example command would be: impute_hrc.sh [arg1: Athero-ExpressGenomicsStudy1] [arg2: AEGS1] [arg3: aegs1_snp5brlmmp_b37_QCwithChrX ] [arg4: /hpc/dhl_ec/data/_ae_originals] [arg5: /hpc/dhl_ec/svanderlaan/projects/impute_hrc] [arg6: PREP/CHECK]" echoerror "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" # The wrong arguments are passed, so we'll exit the script now! exit 1 } script_arguments_error_mode() { echoerror "$1" echoerror "" echoerror " *** ERROR *** ERROR --- $(basename "${0}") --- ERROR *** ERROR ***" echoerror "" echoerror " You must supply the correct argument:" echoerror " * [PREP] -- set the PREPARATOR mode, meaning the cohort data will be prepared for use on the Imputation-server." echoerror " * [CHECK] -- set the CHECK mode, meaning we will check the output of the PREPARATOR mode." echoerror "" echoerror " Please refer to instruction above." echoerror "" echoerror "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" # The wrong arguments are passed, so we'll exit the script now! exit 1 } echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echobold " MICHIGAN IMPUTATION DATA STATISTICS" echo "" echoitalic "* Written by : Sander W. van der Laan" echoitalic "* E-mail : s.w.vanderlaan-2@umcutrecht.nl" echoitalic "* Last update : 2019-02-14" echoitalic "* Version : 1.0.0" echo "" echoitalic "* Description : This script will calculate some SNP and sample based " echoitalic " statistics for a study after imputation through the " echoitalic " Michigan Imputation Server." echo "" echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echo "Today's: "$(date) TODAY=$(date +"%Y%m%d") echo "" echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" if [[ $# -lt 6 ]]; then echo "Oh, computer says no! Number of arguments found "$#"." script_arguments_error "You must supply [6] correct arguments when running a *** MICHIGAN IMPUTATION SERVER PREPARATOR ***!" else # Set these as an argument for your study PROJECTNAME="$1" # "Athero-Express Genomics Study 1" DATASETNAME="$2" # "AEGS1" FILENAME="$3" # "aegs1_snp5brlmmp_b37_QCwithChrX", i.e. the original-dataset name ORIGINALS="$4" # "/hpc/dhl_ec/data/_ae_originals" # Set this to your root ROOTDIR="$5" # "/hpc/dhl_ec/svanderlaan/projects/impute_hrc" # You needn't change this - this should all be present if [ ! -d ${ROOTDIR}/PRE_IMP_CHECK/ ]; then mkdir -v ${ROOTDIR}/PRE_IMP_CHECK/ fi PROJECTDIR="${ROOTDIR}/PRE_IMP_CHECK" # Set mode MODE="$6" echo "" echobold "We have set the following project paths and (file)names:" echo "Project name: ________________________________ [ ${PROJECTNAME} ]" echo "Dataset output name: _________________________ [ ${DATASETNAME} ]" echo "Dataset input filename (without path): _______ [ ${FILENAME} ]" echo "Complete path to input dataset: ______________ [ ${ORIGINALS} ]" echo "Complete path to the working directory _______ [ ${ROOTDIR} ]" echoitalic "Note that all the data will be written to a subdirectory (PRE_IMP_CHECK) of the working directory." # Software settings SOFTWARE="/hpc/local/CentOS7/dhl_ec/software" QCTOOL15="${SOFTWARE}/qctool_v1.5-linux-x86_64-static/qctool" VCFTOOLS="${SOFTWARE}/vcftools-v0.1.14-10-g4491144/bin" BCFTOOLS="${SOFTWARE}/bcftools_v1.6" CHECKVCF="${SOFTWARE}/checkvcf/checkVCF.py" VCFSORT="${SOFTWARE}/vcftools-v0.1.14-10-g4491144/bin/vcf-sort" BGZIP16="${SOFTWARE}/bgzip_v1.6" TABIX16="${SOFTWARE}/tabix_v1.6" PLINK19="${SOFTWARE}/plink_v1.9" echo "" echobold "We will make use of the following software: " echo "Software directory ___________________________ ${SOFTWARE}" echo " - QCTOOL v1.5 _______________________________ ${QCTOOL15}" echo " - VCFTools __________________________________ ${VCFTOOLS}" echo " - BCFTools __________________________________ ${BCFTOOLS}" echo " - CHECKVCF __________________________________ ${CHECKVCF}" echo " - VCFsort ___________________________________ ${VCFSORT}" echo " - BGZip _____________________________________ ${BGZIP16}" echo " - Tabix _____________________________________ ${TABIX16}" echo " - PLINK v1.09 (beta) ________________________ ${PLINK19}" # QSUB settings QSUBTIME="01:00:00" QSUBMEM="8G" QSUBCHECKTIME="02:00:00" QSUBCHECKMEM="64G" QSUBMAIL="s.w.vanderlaan-2@umcutrecht.nl" QSUBMAILSETTING="a" echo "" echoitalic "Job-queue submission rules were set." echo "" if [[ ${MODE} = "PREP" ]]; then echobold "The mode is [ ${MODE} ], hence we will prepare the cohort data for use on the Michigan Imputation Server." elif [[ ${MODE} = "CHECK" ]]; then echobold "The mode is [ ${MODE} ], hence we will check whether the preparation of the data was successful." else ### If arguments are not met then this error message will be displayed script_arguments_error_mode fi echo "" echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echobold "Setting up the stage for the PLINK file checking." echo "" echobold "Making directories." ## Make directories for script if they do not exist yet (!!!PREREQUISITE!!!) echo "* ${PROJECTNAME} [ ${DATASETNAME} ]" # directories to collect all the post-imputation-check data if [ ! -d ${PROJECTDIR}/${DATASETNAME}_HRC_r1_1_2016/ ]; then mkdir -v ${PROJECTDIR}/${DATASETNAME}_HRC_r1_1_2016/ fi IMPDATA_HRC=${PROJECTDIR}/${DATASETNAME}_HRC_r1_1_2016 if [ ! -d ${PROJECTDIR}/${DATASETNAME}_1000Gp3/ ]; then mkdir -v ${PROJECTDIR}/${DATASETNAME}_1000Gp3/ fi IMPDATA_1KGp3=${PROJECTDIR}/${DATASETNAME}_1000Gp3 echo "" echobold "Installing tools & references." echo "* Creating directories." if [ ! -d ${SOFTWARE}/wrayner_tools/ ]; then mkdir -v ${SOFTWARE}/wrayner_tools/ fi WRAYNERTOOLS=${SOFTWARE}/wrayner_tools if [ ! -d ${WRAYNERTOOLS}/HRC_r1_1_2016/ ]; then mkdir -v ${WRAYNERTOOLS}/HRC_r1_1_2016/ fi WRAYNERTOOLS_HRC=${WRAYNERTOOLS}/HRC_r1_1_2016 if [ ! -d ${WRAYNERTOOLS}/1000GP_Phase3/ ]; then mkdir -v ${WRAYNERTOOLS}/1000GP_Phase3/ fi WRAYNERTOOLS_1KGP3=${WRAYNERTOOLS}/1000GP_Phase3 ### On our HPC this is already done. Note that I had gotten a custom version from Rayner with ### that works on our system ("${SOFTWARE}/wrayner_tools/HRC-1000G-check-bim.v4.2.9.pl") echo "* Downloading tool -- do only once!!!" ### wget http://www.well.ox.ac.uk/~wrayner/tools/HRC-1000G-check-bim.v4.2.5.zip -O ${WRAYNERTOOLS}/HRC-1000G-check-bim.v4.2.5.zip ### wget http://www.well.ox.ac.uk/~wrayner/tools/HRC-1000G-check-bim-v4.2.6.zip -O ${WRAYNERTOOLS}/HRC-1000G-check-bim.v4.2.6.zip ### wget http://www.well.ox.ac.uk/~wrayner/tools/HRC-1000G-check-bim-v4.2.7.zip -O ${WRAYNERTOOLS}/HRC-1000G-check-bim.v4.2.7.zip ### echo "* unzipping tool" ### cd ${WRAYNERTOOLS} ### unzip -o ${WRAYNERTOOLS}/HRC-1000G-check-bim.v4.2.6.zip ### Just a sanity check: is it there? ls -lh ${WRAYNERTOOLS} # Setting Wrayner's CheckTool HRC1000GCHECK="${SOFTWARE}/wrayner_tools/HRC-1000G-check-bim.v4.2.9.pl" echo "* Downloading references -- do only once!!!" echo " - Downloading HRC release 1.1 2016, b37." ### wget ftp://ngs.sanger.ac.uk/production/hrc/HRC.r1-1/HRC.r1-1.GRCh37.wgs.mac5.sites.tab.gz -O ${WRAYNERTOOLS_HRC}/HRC.r1-1.GRCh37.wgs.mac5.sites.tab.gz ### ${WRAYNERTOOLS_HRC} ### gunzip -v ${WRAYNERTOOLS_HRC}/HRC.r1-1.GRCh37.wgs.mac5.sites.tab.gz ### Just a sanity check: is it there? ls -lh ${WRAYNERTOOLS_HRC} ### On our HPC this is also already done. echo " - Downloading 1000G phase 3 (combined), b37." ### wget http://www.well.ox.ac.uk/~wrayner/tools/1000GP_Phase3_combined.legend.gz -O ${WRAYNERTOOLS_1KGP3}/1000GP_Phase3_combined.legend.gz ### ${WRAYNERTOOLS_1KGP3} ### gunzip -v ${WRAYNERTOOLS_1KGP3}/1000GP_Phase3_combined.legend.gz ls -lh ${WRAYNERTOOLS_1KGP3} echobold "Installing checkVCF -- do only once!!!" ### RUN ONLY ONCE!!! ### On our HPC this is already done. ### cd ${SOFTWARE} ### mkdir -v checkvcf ### cd checkvcf/ ### wget http://qbrc.swmed.edu/zhanxw/software/checkVCF/checkVCF-20140116.tar.gz ### tar -zxvf checkVCF-20140116.tar.gz ### rm -v checkVCF-20140116.tar.gz ### samtools_v1.3 faidx hs37d5.fa ### cd .. ### chmod -Rv a+xrw checkvcf/ if [[ ${MODE} = "PREP" ]]; then echo "" echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echobold "Calculating frequencies." echo "* Frequencies in ${DATASETNAME}" cp -fv ${ORIGINALS}/${FILENAME}.bed ${IMPDATA_HRC}/${DATASETNAME}.postQC.bed cp -fv ${ORIGINALS}/${FILENAME}.bim ${IMPDATA_HRC}/${DATASETNAME}.postQC.bim cp -fv ${ORIGINALS}/${FILENAME}.fam ${IMPDATA_HRC}/${DATASETNAME}.postQC.fam cp -fv ${ORIGINALS}/${FILENAME}.bed ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.bed cp -fv ${ORIGINALS}/${FILENAME}.bim ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.bim cp -fv ${ORIGINALS}/${FILENAME}.fam ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.fam echo "${PLINK19} --bfile ${IMPDATA_HRC}/${DATASETNAME}.postQC --freq --out ${IMPDATA_HRC}/${DATASETNAME}.postQC_FREQ " > ${IMPDATA_HRC}/${DATASETNAME}.postQC.freq.sh qsub -S /bin/bash -N FREQ_HRC_MICHIMP -e ${IMPDATA_HRC}/${DATASETNAME}.postQC.freq.errors -o ${IMPDATA_HRC}/${DATASETNAME}.postQC.freq.log -l h_rt=${QSUBTIME} -l h_vmem=${QSUBMEM} -M ${QSUBMAIL} -m ${QSUBMAILSETTING} -wd ${IMPDATA_HRC} ${IMPDATA_HRC}/${DATASETNAME}.postQC.freq.sh echo "${PLINK19} --bfile ${IMPDATA_1KGp3}/${DATASETNAME}.postQC --freq --out ${IMPDATA_1KGp3}/${DATASETNAME}.postQC_FREQ " > ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.freq.sh qsub -S /bin/bash -N FREQ_1kG_MICHIMP -e ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.freq.errors -o ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.freq.log -l h_rt=${QSUBTIME} -l h_vmem=${QSUBMEM} -M ${QSUBMAIL} -m ${QSUBMAILSETTING} -wd ${IMPDATA_1KGp3} ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.freq.sh echo "" echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echobold "Checking PLINK files for [ ${DATASETNAME} ]." ### Usage: ### For HRC: ### perl HRC-1000G-check-bim-v4.2.7.pl -b <bim file> -f <Frequency file> -r <Reference panel> -h [-v -t <allele frequency threshold -n] ### ### For 1000G: ### perl HRC-1000G-check-bim-v4.2.7.pl -b <bim file> -f <Frequency file> -r <Reference panel> -g -p <population> [-v -t <allele frequency threshold -n] ### ### ### -b --bim bim file Plink format .bim file ### -f --frequency Frequency file Plink format .frq allele frequency file, from plink --freq command ### -r --ref Reference panel Reference Panel file, either 1000G or HRC ### -h --hrc Flag to indicate Reference panel file given is HRC ### -g --1000g Flag to indicate Reference panel file given is 1000G ### -p --pop Population Population to check frequency against, 1000G only. Default ALL, options ALL, EUR, AFR, AMR, SAS, EAS ### -v --verbose Optional flag to increase verbosity in the log file ### -t --threshold Freq threshold Frequency difference to use when checking allele frequency of data set versus reference; default: 0.2; range: 0-1 ### -n --noexclude Optional flag to include all SNPs regardless of allele frequency differences, default is exclude based on -t threshold, overrides -t echo "" echo "* Checking for HRC imputation." cd ${IMPDATA_HRC} # old version: ${WRAYNERTOOLS}/HRC-1000G-check-bim.pl echo "perl ${HRC1000GCHECK} -b ${IMPDATA_HRC}/${DATASETNAME}.postQC.bim -f ${IMPDATA_HRC}/${DATASETNAME}.postQC_FREQ.frq -r ${WRAYNERTOOLS_HRC}/HRC.r1-1.GRCh37.wgs.mac5.sites.tab.gz -h -v " > ${IMPDATA_HRC}/${DATASETNAME}.postQC.HRCcheck.sh qsub -S /bin/bash -N Check_HRC_MICHIMP -hold_jid FREQ_HRC_MICHIMP -e ${IMPDATA_HRC}/${DATASETNAME}.postQC.HRCcheck.errors -o ${IMPDATA_HRC}/${DATASETNAME}.postQC.HRCcheck.log -l h_rt=${QSUBCHECKTIME} -l h_vmem=${QSUBCHECKMEM} -M ${QSUBMAIL} -m ${QSUBMAILSETTING} -wd ${IMPDATA_HRC} ${IMPDATA_HRC}/${DATASETNAME}.postQC.HRCcheck.sh echo "" echo "* Checking for 1000G imputation." cd ${IMPDATA_1KGp3} # old version: ${WRAYNERTOOLS}/HRC-1000G-check-bim.pl echo "perl ${HRC1000GCHECK} -b ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.bim -f ${IMPDATA_1KGp3}/${DATASETNAME}.postQC_FREQ.frq -r ${WRAYNERTOOLS_1KGP3}/1000GP_Phase3_combined.legend.gz -g -p ALL -v " > ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.1kGcheck.sh qsub -S /bin/bash -N Check_1kG_MICHIMP -hold_jid FREQ_1kG_MICHIMP -e ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.1kGcheck.errors -o ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.1kGcheck.log -l h_rt=${QSUBCHECKTIME} -l h_vmem=${QSUBCHECKMEM} -M ${QSUBMAIL} -m ${QSUBMAILSETTING} -wd ${IMPDATA_1KGp3} ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.1kGcheck.sh echo "" echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echobold "Running PLINK-based corrections for [ ${DATASETNAME} ]." echo "" echo "* Correcting." cd ${IMPDATA_HRC} echo "bash ${IMPDATA_HRC}/Run-plink.sh \ " > ${IMPDATA_HRC}/${DATASETNAME}.postQC.HRCcorr.sh qsub -S /bin/bash -N Corr_HRC_MICHIMP -hold_jid Check_HRC_MICHIMP -e ${IMPDATA_HRC}/${DATASETNAME}.postQC.HRCcorr.errors -o ${IMPDATA_HRC}/${DATASETNAME}.postQC.HRCcorr.log -l h_rt=${QSUBTIME} -l h_vmem=${QSUBMEM} -M ${QSUBMAIL} -m ${QSUBMAILSETTING} -wd ${IMPDATA_HRC} ${IMPDATA_HRC}/${DATASETNAME}.postQC.HRCcorr.sh cd ${IMPDATA_1KGp3} echo "bash ${IMPDATA_1KGp3}/Run-plink.sh \ " > ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.1kGcorr.sh qsub -S /bin/bash -N Corr_1kG_MICHIMP -hold_jid Check_1kG_MICHIMP -e ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.1kGcorr.errors -o ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.1kGcorr.log -l h_rt=${QSUBTIME} -l h_vmem=${QSUBMEM} -M ${QSUBMAIL} -m ${QSUBMAILSETTING} -wd ${IMPDATA_1KGp3} ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.1kGcorr.sh echo "" echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echobold "Generating VCF files for HRC imputation of [ ${DATASETNAME} ]." echo "" echo "* Making VCF." cd ${IMPDATA_HRC} for CHR in $(seq 1 23); do echo "" echo "- Converting" echo "${PLINK19} --bfile ${IMPDATA_HRC}/${DATASETNAME}.postQC-updated-chr${CHR} --chr ${CHR} --output-chr MT --keep-allele-order --recode vcf-iid --out ${IMPDATA_HRC}/${DATASETNAME}.postQC_inHRCr11_chr${CHR} " > ${IMPDATA_HRC}/${DATASETNAME}.postQC.chr${CHR}.HRCconvert.sh qsub -S /bin/bash -N Convert_HRC_MICHIMP -hold_jid Corr_HRC_MICHIMP -e ${IMPDATA_HRC}/${DATASETNAME}.postQC.chr${CHR}.HRCconvert.errors -o ${IMPDATA_HRC}/${DATASETNAME}.postQC.chr${CHR}.HRCconvert.log -l h_rt=${QSUBTIME} -l h_vmem=${QSUBMEM} -M ${QSUBMAIL} -m ${QSUBMAILSETTING} -wd ${IMPDATA_HRC} ${IMPDATA_HRC}/${DATASETNAME}.postQC.chr${CHR}.HRCconvert.sh echo "" echo "- BGzipping and indexing" echo "${VCFSORT} ${IMPDATA_HRC}/${DATASETNAME}.postQC_inHRCr11_chr${CHR}.vcf | ${BGZIP16} ${IMPDATA_HRC}/${DATASETNAME}.postQC_inHRCr11_chr${CHR}.vcf " > ${IMPDATA_HRC}/${DATASETNAME}.postQC.chr${CHR}.HRCindexzip.sh echo "${TABIX16} -p vcf ${IMPDATA_HRC}/${DATASETNAME}.postQC_inHRCr11_chr${CHR}.vcf.gz " >> ${IMPDATA_HRC}/${DATASETNAME}.postQC.chr${CHR}.HRCindexzip.sh qsub -S /bin/bash -N Index_HRC_MICHIMP -hold_jid Convert_HRC_MICHIMP -e ${IMPDATA_HRC}/${DATASETNAME}.postQC.chr${CHR}.HRCindexzip.errors -o ${IMPDATA_HRC}/${DATASETNAME}.postQC.chr${CHR}.HRCindexzip.log -l h_rt=${QSUBTIME} -l h_vmem=${QSUBMEM} -M ${QSUBMAIL} -m ${QSUBMAILSETTING} -wd ${IMPDATA_HRC} ${IMPDATA_HRC}/${DATASETNAME}.postQC.chr${CHR}.HRCindexzip.sh done echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echobold "Generating VCF files for 1000G imputation of [ ${DATASETNAME} ]." echo "" echo "* Making VCF." cd ${IMPDATA_1KGp3} for CHR in $(seq 1 23); do echo "" echo "${PLINK19} --bfile ${IMPDATA_1KGp3}/${DATASETNAME}.postQC-updated-chr${CHR} --chr ${CHR} --output-chr MT --keep-allele-order --recode vcf-iid --out ${IMPDATA_1KGp3}/${DATASETNAME}.postQC_in1KGp3_chr${CHR} " > ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.chr${CHR}.1kGconvert.sh qsub -S /bin/bash -N Convert_1kG_MICHIMP -hold_jid Corr_1kG_MICHIMP -e ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.chr${CHR}.1kGconvert.errors -o ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.chr${CHR}.1kGconvert.log -l h_rt=${QSUBTIME} -l h_vmem=${QSUBMEM} -M ${QSUBMAIL} -m ${QSUBMAILSETTING} -wd ${IMPDATA_1KGp3} ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.chr${CHR}.1kGconvert.sh echo "" echo "- BGzipping and indexing" echo "${VCFSORT} ${IMPDATA_1KGp3}/${DATASETNAME}.postQC_in1KGp3_chr${CHR}.vcf | ${BGZIP16} ${IMPDATA_1KGp3}/${DATASETNAME}.postQC_in1KGp3_chr${CHR}.vcf " > ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.chr${CHR}.1kGindexzip.sh echo "${TABIX16} -p vcf ${IMPDATA_1KGp3}/${DATASETNAME}.postQC_in1KGp3_chr${CHR}.vcf.gz " >> ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.chr${CHR}.1kGindexzip.sh qsub -S /bin/bash -N Index_1kG_MICHIMP -hold_jid Convert_1kG_MICHIMP -e ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.chr${CHR}.1kGindexzip.errors -o ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.chr${CHR}.1kGindexzip.log -l h_rt=${QSUBTIME} -l h_vmem=${QSUBMEM} -M ${QSUBMAIL} -m ${QSUBMAILSETTING} -wd ${IMPDATA_1KGp3} ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.chr${CHR}.1kGindexzip.sh done elif [[ ${MODE} = "CHECK" ]]; then echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echobold "Checking outputs." ### NOT FINISHED YET ### - make it automatic ### - make it write a report ### - get in if-else statements regarding checks, if error > do not remove etc files if [ ! -d ${IMPDATA_HRC}/_scripts_logs ]; then mkdir -v ${IMPDATA_HRC}/_scripts_logs fi SCRIPTLOGDIR_HRC="${IMPDATA_HRC}/_scripts_logs" if [ ! -d ${IMPDATA_1KGp3}/_scripts_logs ]; then mkdir -v ${IMPDATA_1KGp3}/_scripts_logs fi SCRIPTLOGDIR_1KGp3="${IMPDATA_1KGp3}/_scripts_logs" echo "" echoitalic "Frequencies calculations" cat ${IMPDATA_HRC}/${DATASETNAME}.postQC.freq.log | grep -e "--freq: Allele frequencies (founders only) written to" mv -v ${IMPDATA_HRC}/${DATASETNAME}.postQC.freq.* ${SCRIPTLOGDIR_HRC}/ cat ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.freq.log | grep -e "--freq: Allele frequencies (founders only) written to" mv -v ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.freq.* ${SCRIPTLOGDIR_1KGp3}/ echo "" echoitalic "Genotype checking" tail -30 ${IMPDATA_HRC}/${DATASETNAME}.postQC.HRCcheck.log cat ${IMPDATA_HRC}/${DATASETNAME}.postQC.HRCcorr.log | grep -e "people pass filters and QC." mv -v ${IMPDATA_HRC}/${DATASETNAME}.postQC.HRCcheck.* ${SCRIPTLOGDIR_HRC}/ mv -v ${IMPDATA_HRC}/${DATASETNAME}.postQC.HRCcorr.* ${SCRIPTLOGDIR_HRC}/ tail -30 ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.1kGcheck.log cat ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.1kGcorr.log | grep -e "people pass filters and QC." mv -v ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.1kGcheck.* ${SCRIPTLOGDIR_1KGp3}/ mv -v ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.1kGcorr.* ${SCRIPTLOGDIR_1KGp3}/ echo "" echoitalic "PLINK corrections" for CHR in $(seq 1 23); do echo "checking updated files for chromosome ${CHR}" cat ${IMPDATA_HRC}/${DATASETNAME}.postQC-updated-chr${CHR}.log | grep -e "Total genotyping rate is" cat ${IMPDATA_1KGp3}/${DATASETNAME}.postQC-updated-chr${CHR}.log | grep -e "Total genotyping rate is" done echo "" echoitalic "VCF conversion" for CHR in $(seq 1 23) ; do echo "checking conversion of chromosome $CHR" cat ${IMPDATA_HRC}/${DATASETNAME}.postQC.chr${CHR}.HRCconvert.log | grep -e "pass filters and QC." mv -v ${IMPDATA_HRC}/${DATASETNAME}.postQC.chr${CHR}.HRCconvert.* ${SCRIPTLOGDIR_HRC}/ cat ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.chr${CHR}.1kGconvert.log | grep -e "pass filters and QC." mv -v ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.chr${CHR}.1kGconvert.* ${SCRIPTLOGDIR_1KGp3}/ done echo "" echoitalic "- VCF indexing and bzgipping" for CHR in $(seq 1 23) ; do echo "checking conversion of chromosome $CHR" cat ${IMPDATA_HRC}/${DATASETNAME}.postQC.chr${CHR}.HRCindexzip.log | grep -e "pass filters and QC." mv -v ${IMPDATA_HRC}/${DATASETNAME}.postQC.chr${CHR}.HRCindexzip.* ${SCRIPTLOGDIR_HRC}/ cat ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.chr${CHR}.1kGindexzip.log | grep -e "pass filters and QC." mv -v ${IMPDATA_1KGp3}/${DATASETNAME}.postQC.chr${CHR}.1kGindexzip.* ${SCRIPTLOGDIR_1KGp3}/ done echo "" echoitalic "- VCF files" for CHR in $(seq 1 23) ; do echo "checking chromosome $CHR files" ${CHECKVCF} -r ${SOFTWARE}/checkvcf/hs37d5.fa -o -out ${IMPDATA_HRC}/${DATASETNAME}.postQC_inHRCr11_chr${CHR}.vcf.gz mv -v $(pwd)/-out.check.af ${IMPDATA_HRC}/${DATASETNAME}.postQC_inHRCr11_chr${CHR}.check.af mv -v $(pwd)/-out.check.dup ${IMPDATA_HRC}/${DATASETNAME}.postQC_inHRCr11_chr${CHR}.check.dup mv -v $(pwd)/-out.check.geno ${IMPDATA_HRC}/${DATASETNAME}.postQC_inHRCr11_chr${CHR}.check.geno mv -v $(pwd)/-out.check.log ${IMPDATA_HRC}/${DATASETNAME}.postQC_inHRCr11_chr${CHR}.check.log mv -v $(pwd)/-out.check.mono ${IMPDATA_HRC}/${DATASETNAME}.postQC_inHRCr11_chr${CHR}.check.mono mv -v $(pwd)/-out.check.nonSnp ${IMPDATA_HRC}/${DATASETNAME}.postQC_inHRCr11_chr${CHR}.check.nonSnp mv -v $(pwd)/-out.check.ref ${IMPDATA_HRC}/${DATASETNAME}.postQC_inHRCr11_chr${CHR}.check.ref ${CHECKVCF} -r ${SOFTWARE}/checkvcf/hs37d5.fa -o -out ${IMPDATA_1KGp3}/${DATASETNAME}.postQC_in1KGp3_chr${CHR}.vcf.gz mv -v $(pwd)/-out.check.af ${IMPDATA_1KGp3}/${DATASETNAME}.postQC_in1KGp3_chr${CHR}.check.af mv -v $(pwd)/-out.check.dup ${IMPDATA_1KGp3}/${DATASETNAME}.postQC_in1KGp3_chr${CHR}.check.dup mv -v $(pwd)/-out.check.geno ${IMPDATA_1KGp3}/${DATASETNAME}.postQC_in1KGp3_chr${CHR}.check.geno mv -v $(pwd)/-out.check.log ${IMPDATA_1KGp3}/${DATASETNAME}.postQC_in1KGp3_chr${CHR}.check.log mv -v $(pwd)/-out.check.mono ${IMPDATA_1KGp3}/${DATASETNAME}.postQC_in1KGp3_chr${CHR}.check.mono mv -v $(pwd)/-out.check.nonSnp ${IMPDATA_1KGp3}/${DATASETNAME}.postQC_in1KGp3_chr${CHR}.check.nonSnp mv -v $(pwd)/-out.check.ref ${IMPDATA_1KGp3}/${DATASETNAME}.postQC_in1KGp3_chr${CHR}.check.ref done echo "" echoitalic "- gzipping the txt-file-shizzle" else ### If arguments are not met then this error message will be displayed script_arguments_error_mode fi echo "" echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echobold "Wow. I'm all done buddy. What a job! let's have a beer!" date ### END of if-else statement for the number of command-line arguments passed ### fi script_copyright_message # TEMPORARY -- WILL BE REMOVED # mich_imp_prep HELPFul_GSA HELPFul_GSA helpful.gsa.clean /hpc/dhl_ec/data/_helpful_originals/GENOTYPES2018 /hpc/dhl_ec/svanderlaan/projects/impute_hrc # mich_imp_prep MYOMARKER_GSA MYOMARKER_GSA myomarker.gsa.clean /hpc/dhl_ec/data/_myomarker_originals/GENOTYPES2018 /hpc/dhl_ec/svanderlaan/projects/impute_hrc # mich_imp_prep UCORBIO_GSA UCORBIO_GSA ucorbio.gsa.clean /hpc/dhl_ec/data/_ucorbio_originals/GENOTYPES2018 /hpc/dhl_ec/svanderlaan/projects/impute_hrc # mich_imp_prep BIOSHIFTTRIUMPH_GSA BIOSHIFTTRIUMPH_GSA bioshifttriumph.gsa.clean /hpc/dhl_ec/data/_bioshift_triumph_originals/GENOTYPES2018 /hpc/dhl_ec/svanderlaan/projects/impute_hrc # mich_imp_prep RIVM_GSA RIVM_GSA rivm.gsa.clean /hpc/dhl_ec/data/_rivm_originals/GENOTYPES2018 /hpc/dhl_ec/svanderlaan/projects/impute_hrc # mich_imp_prep AEGS1_AFFYSNP5 AEGS1_AFFYSNP5 AEGS1.clean /hpc/dhl_ec/data/_ae_originals/AEGS1_AffySNP5/GENOTYPES2018 /hpc/dhl_ec/svanderlaan/projects/impute_hrc # mich_imp_prep AEGS2_AFFYAXIOMCEU AEGS2_AFFYAXIOMCEU AEGS2.clean /hpc/dhl_ec/data/_ae_originals/AEGS2_AffyAxiomGWCEU1/GENOTYPES2018 /hpc/dhl_ec/svanderlaan/projects/impute_hrc # mich_imp_prep AEGS3_GSA AEGS3_GSA aegs3.gsa.clean /hpc/dhl_ec/data/_ae_originals/AEGS3_GSA/GENOTYPES2018 /hpc/dhl_ec/svanderlaan/projects/impute_hrc # mich_imp_prep EPIC_NL_GSA EPIC_NL_GSA FINAL_GSA_SET /hpc/dhl_ec/data/_epic_nl/EPICNLGSA_QC /hpc/dhl_ec/svanderlaan/projects/impute_hrc # for i in $(seq 1 22) ; do qctool_v2 -filetype vcf -g epicnl.1kgp3.chr${i}.dose.vcf.gz -vcf-genotype-field GP -snp-stats -osnp epicnl.1kgp3.chr${i}.dose.vcf.stats; done
true
42970a189d73eb5a38bf810fca8e6bb609acb17d
Shell
thaddeusdiamond/Home
/.bash_aliases
UTF-8
6,057
3.703125
4
[]
no_license
##################################### # ALIASES FOR SCRIPTS # ##################################### # Custom delete function alias del='mv ${*} -t ~/TRASH' # Suppress output Quiet() { >/dev/null 2>&1 $* & } # Find all usages of a given term in a specific directory GetUsages() { SEARCH_TERM=$1; shift; grep -I -n -R "$SEARCH_TERM" $* | grep -v build/ | grep -v .hg/ | grep -v external-doc/; } # remove .orig and .rej files kicking around repo ClearOrigRej() { find . | grep -v .hg/ | grep '\.orig$' | xargs rm; find . | grep '\.rej$' | grep -v .hg/ | xargs rm; } alias hg_qpatch="hg diff -r qparent > ~/workspace/patch.diff" function hg_qseries() { if [ $# -ne 0 ]; then if [ $1 = "--help" ]; then echo "Description: View patches in a given queue." echo "Usage: hg_qseries [QUEUE_NAME]" echo "" echo " QUEUE_NAME The name of the patch queue. If omitted, the active queue is used." return 1 fi fi QUEUE="" if [ $# -eq 0 ]; then QUEUE="`hg qqueue --active`" else QUEUE=$1 fi PATCH_DIR="`hg root`/.hg/patches-$QUEUE" if [ ! -d "$PATCH_DIR" ]; then echo "Cannot find patch directory for specified queue: $PATCH_DIR" echo "" return 1 fi cat $PATCH_DIR/series } function hg_qreorder() { if [ $# -ne 0 ]; then if [ $1 = "--help" ]; then echo "Description: Edit the series file for a given mqueue, usually to reorder patches." echo "Usage: hg_qreorder [QUEUE_NAME]" echo " QUEUE_NAME The name of the patch queue. If omitted, the active queue " echo " is used." echo "" return 1 fi fi QUEUE="" if [ $# -eq 0 ]; then QUEUE="`hg qqueue --active`" if [ -n "`hg qapplied`" ]; then echo "Patches applied; pop all patches first." echo "" return 1; fi else QUEUE=$1 fi PATCH_DIR="`hg root`/.hg/patches-$QUEUE" if [ ! -d "$PATCH_DIR" ]; then echo "Cannot find patch directory for specified queue: $PATCH_DIR" echo "" return 1 fi vi $PATCH_DIR/series } function _hg_qcopy() { ACTIVE_QUEUE="`hg qqueue --active`" if [ $ACTIVE_QUEUE = $2 ]; then if [ -n "`hg qapplied`" ]; then echo "Patches applied; pop all patches first." echo "" return 1; fi fi if [ $ACTIVE_QUEUE = $3 ]; then if [ -n "`hg qapplied`" ]; then echo "Patches applied; pop all patches first." echo "" return 1; fi fi PATCH_DIR="`hg root`/.hg/patches" PATCH_DIR_SRC="$PATCH_DIR-$2" if [ ! -d "$PATCH_DIR_SRC" ]; then echo "Cannot find patch directory for specified queue: $PATCH_DIR_SRC" echo "" return 1 fi PATCH_DIR_DST="$PATCH_DIR-$3" if [ ! -d "$PATCH_DIR_DST" ]; then echo "Cannot find patch directory for specified queue: $PATCH_DIR_DST" echo "" return 1 fi PATCH_FILENAME=$1 PATCH_PATH=$PATCH_DIR_SRC/$PATCH_FILENAME if [ ! -f "$PATCH_PATH" ]; then echo "Cannot find specified patch file: $PATCH_PATH" echo "" return 1 fi PATCH_SERIES_DST=$PATCH_DIR_DST/series echo $PATCH_FILENAME > $PATCH_SERIES_DST.tmp cat $PATCH_SERIES_DST >> $PATCH_SERIES_DST.tmp mv $PATCH_SERIES_DST.tmp $PATCH_SERIES_DST cp $PATCH_PATH $PATCH_DIR_DST } function hg_qcopy() { if [ $# -ne 3 ]; then echo "Description: Copy a patch file from one queue to another. Note: This will also " echo " update the series file in the destination queue." echo "Usage: hg_qcopy PATCH_FILE SRC_QUEUE_NAME DST_QUEUE_NAME" echo "" return 1 fi _hg_qcopy $1 $2 $3 } function hg_qmove() { if [ $# -ne 3 ]; then echo "Description: Move a patch file from one queue to another. Note: This will also " echo " update the series file in both queues." echo "Usage: hg_qmove PATCH_FILE SRC_QUEUE_NAME DST_QUEUE_NAME" echo "" return 1 fi _hg_qcopy $1 $2 $3 RETURN_CODE=$? if [ $RETURN_CODE -ne 0 ]; then return $RETURN_CODE fi PATCH_SERIES_SRC=$PATCH_DIR_SRC/series sed "/`echo $PATCH_FILENAME`/d" $PATCH_SERIES_SRC > $PATCH_SERIES_SRC.tmp mv $PATCH_SERIES_SRC.tmp $PATCH_SERIES_SRC rm $PATCH_PATH $PATCH_DIR_DST } function hg_qexport() { if [ $# -ne 3 ]; then echo "Description: Export a patch file from a queue to the given directory." echo "Usage: hg_qexport PATCH_FILE QUEUE_NAME DST_DIR" echo "" return 1 fi PATCH_DIR="`hg root`/.hg/patches-$2" if [ ! -d "$PATCH_DIR" ]; then echo "Cannot find patch directory for specified queue: $PATCH_DIR" echo "" return 1 fi DST_DIR=$3 if [ ! -d "$DST_DIR" ]; then echo "Cannot find specified destination directory: $DST_DIR" echo "" return 1 fi cp $PATCH_DIR/$1 $DST_DIR } function idea_repo_sync() { if [ $# -ne 2 ]; then echo "Description: Copy IntelliJ project settings from one local repo to another. " echo " This will update any paths in the setting files as needed. " echo "" echo " Note: This assumes the repo is located at ~/workspace/REPO_NAME. " echo "" echo "" echo "Usage: idea_repo_sync SRC_REPO_NAME DST_REPO_NAME" echo "" return 1 fi SRC_REPO_NAME=$1 DST_REPO_NAME=$2 SRC_REPO_ROOT=~/workspace/$SRC_REPO_NAME DST_REPO_ROOT=~/workspace/$DST_REPO_NAME rm ${DST_REPO_ROOT}/*.iml rm -r ${DST_REPO_ROOT}/.idea scp ${SRC_REPO_ROOT}/*.iml ${DST_REPO_ROOT} scp -r ${SRC_REPO_ROOT}/.idea ${DST_REPO_ROOT} sed -i -e "s,$SRC_REPO_NAME,$DST_REPO_NAME,g" ${DST_REPO_ROOT}/.idea/.name sed -i -e "s,$SRC_REPO_NAME,$DST_REPO_NAME,g" ${DST_REPO_ROOT}/.idea/*.xml mv ${DST_REPO_ROOT}/${SRC_REPO_NAME}.iml ${DST_REPO_ROOT}/${DST_REPO_NAME}.iml } # Go into each subdirectory and print out the difference in git branch git-recursive() { for i in `ls` do cd $i echo $i echo ======= git "$@" echo cd .. done } git-recursive-out() { git-recursive out "$@" } git-recursive-stat() { git-recursive stat "$@" }
true
d599047118c73fe7dcad7c7238413739d8aeaead
Shell
quelltextlich/gerrit-builder
/write_full_hierarchy_index_html_files.sh
UTF-8
3,905
4.15625
4
[ "Apache-2.0" ]
permissive
#!/bin/bash #--------------------------------------------------------------------- source "$(dirname "$0")/common.inc" #--------------------------------------------------------------------- BASE_URL='http://builds.quelltextlich.at/' print_help() { cat <<EOF $0 ARGUMENTS Writes out index html files for folders ARGUMENTS: --base-url BASE_URL -- The base url to fetch structure information from. E.g.: http://build.quelltextlich.at/gerrit EOF } while [ $# -gt 0 ] do ARGUMENT="$1" shift case "$ARGUMENT" in "--help" | "-h" | "-?" ) print_help exit 0 ;; "--base-url" ) [ $# -ge 1 ] || error "$ARGUMENT requires 1 more argument" BASE_URL="$1" shift || true ;; * ) error "Unknown argument '$ARGUMENT'" ;; esac done cat_url_file_entries() { local URL="$1" curl --silent --show-error "$URL" | grep '^<tr><td' | cut -f 4 -d '"' } write_base_index_html() { local DIR_URL="$1" local SHORT_TITLE="$2" local TITLE="$3" if [ -z "$TITLE" ] then TITLE="$SHORT_TITLE" fi if [ "${DIR_URL: -1}" != "/" ] then DIR_URL="$DIR_URL/" fi local FILE_RELS_PAD="$DIR_URL" if [ ! -z "$FILE_RELS_PAD" ] then FILE_RELS_PAD="${FILE_RELS_PAD:0: -1}" fi FILE_RELS_PAD="${FILE_RELS_PAD////_}" local FILE_RELS="index$FILE_RELS_PAD.html" section "Writing index file for '$FILE_RELS'" local SKIP_PARENT_LINK=no if [ "$FILE_RELS" = "$INDEX_FILE_RELC" ] then SKIP_PARENT_LINK=yes fi set_target_html_file_abs "$FILE_RELS" cat_html_header_target_html \ "$SHORT_TITLE" \ "$SHORT_TITLE" \ "" \ "$TITLE" cat_target_html <<EOF <table> <tr> <th>Entry</th> <th>Description</th> </tr> EOF cat_url_file_entries "$BASE_URL$DIR_URL" | while read LINE do SKIP=no case "$LINE" in "../" ) if [ -z "$FILE_RELS_PAD" ] then SKIP=yes else DESCRIPTION="Parent directory" fi ;; "favicon.ico" ) SKIP=yes ;; "$INDEX_FILE_RELC" ) SKIP=yes ;; "gerrit/" ) DESCRIPTION="Builds of Gerrit &amp; plugins" ;; "images/" ) SKIP=yes ;; "nightly/" ) DESCRIPTION="Nightly builds of Gerrit &amp; plugins" ;; "LICENSE-Apache-2.0" ) DESCRIPTION="Default license for artifacts" ;; "README.txt" ) DESCRIPTION="More information about the builds" ;; "master/" | "stable-"*"/") DESCRIPTION="Nightly builds of Gerrit &amp; plugins for the ${LINE:0: -1} branch" ;; "master-java_"*"/") DESCRIPTION="Nightly builds of Gerrit &amp; plugins for the master branch using Java ${LINE:12: -1}" ;; * ) DESCRIPTION="$LINE" ;; esac if [ "$SKIP" = "no" ] then HREF="$LINE" if [ "${HREF: -1}" = "/" ] then HREF="${HREF}${INDEX_FILE_RELC}" fi cat_target_html <<EOF <tr> <td><a href="$HREF">$LINE</a></td> <td>$DESCRIPTION</td> </tr> EOF fi done echo_target_html "</table>" cat_html_footer_target_html } write_base_index_html "" "Automated builds" write_base_index_html "/gerrit" "Gerrit builds" "Automated Gerrit builds" write_base_index_html "/gerrit/nightly" "Nightly Gerrit builds" finalize
true
933c43b7efed903c794bc94b1b1ec5d7c8eff8a7
Shell
htugraz/abs
/x86_64/community/openntpd/PKGBUILD
UTF-8
1,696
2.765625
3
[]
no_license
# $Id: PKGBUILD 143008 2015-10-05 14:02:15Z anatolik $ # Maintainer: Vesa Kaihlavirta <vegai@iki.fi> # Contributor: Mark Rosenstand <mark@borkware.net> # Contributor: Giorgio Lando <patroclo7@gmail.com> (adjtimex patch) # Contributor: Alexander Rødseth <rodseth@gmail.com> pkgname=openntpd pkgver=5.7p4 pkgrel=1 pkgdesc='Free, easy to use implementation of the Network Time Protocol.' url='http://www.openntpd.org/' arch=('x86_64' 'i686') license=('BSD') depends=('openssl') conflicts=('ntp') backup=('etc/ntpd.conf') install=$pkgname.install source=("ftp://ftp.openbsd.org/pub/OpenBSD/OpenNTPD/$pkgname-$pkgver.tar.gz" 'openntpd.tmpfiles' 'openntpd.service') sha256sums=('a993d95976e375acc0ab1a677fd268f55024477835633c8ae404895046bccb23' 'fe12841110c3c080519e248988c4b6334f54bd9646b015753c7e15de2a9600c5' '3239fc6f69d661cd9233233da9e68bebdf7b12888febbc2f2d794742db2d8ed1') build() { cd $pkgname-$pkgver autoreconf -fi ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --sbindir=/usr/bin \ --with-privsep-user=ntp \ --with-privsep-path=/run/openntpd/ \ --with-adjtimex make } package() { cd "$srcdir/$pkgname-$pkgver" make DESTDIR="$pkgdir" install install -Dm644 "$srcdir/$pkgname-$pkgver/COPYING" \ "$pkgdir/usr/share/licenses/$pkgname/COPYING" sed -i 's/\*/0.0.0.0/' "$pkgdir/etc/ntpd.conf" install -d -m700 "$pkgdir/var/lib/ntp" install -Dm644 "$srcdir/openntpd.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/openntpd.conf" install -Dm644 "$srcdir/openntpd.service" "$pkgdir/usr/lib/systemd/system/openntpd.service" install -dm755 "$pkgdir/usr/lib/systemd/ntp-units.d" echo "$pkgname.service" > "$pkgdir/usr/lib/systemd/ntp-units.d/$pkgname.list" } # vim:set ts=2 sw=2 et:
true
e606ac9d29b3ec5e2bcf3d85be86be4d6675e2c8
Shell
kerzol81/Bash-and-Python-scripts
/axis/syncroniser
UTF-8
2,573
4.46875
4
[]
no_license
#!/bin/bash # the script mounts the remote FTP folder, and syncronises and arranges the files into subfolders set -x AXIS_IP="$1" USER="$2" PASS="$3" NAME="$4" # AXIS_PORT='21' LOCAL_FOLDER="${HOME}"/"axis_remote_${NAME}_SD_DISK" # temporary mount point ARRANGED_FOLDER="${HOME}"/"${NAME}" # the folder where the files will be arranged EXTENSION='mkv' # the video file extensions function check_args(){ if [ "$#" -eq 0 ] || [ "$#" -lt 4 ]; then echo '[-] Pass args to the scipt!' usage exit 1 fi } function usage(){ readonly PROGNAME=`basename $0` cat <<- EOF usage: -------------------------------------------- ./$PROGNAME <IP> <USERNAME> <PASSWORD> <SITE NAME> -------------------------------------------- crontab -e and append one of these examples: run it in every minute: */1 * * * * /path/to/script/$PROGNAME <IP> <USERNAME> <PASSWORD> <SITE NAME> run it in every 30 minutes from 20:00 until 04:00 o' clock: */30 20-23,0-4 * * * /path/to/script/$PROGNAME <IP> <USERNAME> <PASSWORD> <SITE NAME> EOF } function check_hdd(){ local SPACE=$(df -h | tr -d "%" | awk '/sda/ { print $5 }') local INT='^[0-9]+$' local MAX='99' if ! [[ "$SPACE" =~ $INT ]] ; then echo "[-] something went wrong while figuring out disk space" exit 3 fi if [ "$SPACE" -ge $MAX ];then exit 4 fi } function check_axis(){ if ! ping -c 1 "$AXIS_IP";then echo "[-] The axis server is not available..." exit 5 fi } function mountRemote(){ local AXIS_SD="/var/spool/storage/SD_DISK/" if [ ! -d "$LOCAL_FOLDER" ];then mkdir -p "$LOCAL_FOLDER" fi echo "[*] Mounting remote filesystem..." if ! curlftpfs -v "${USER}":"${PASS}"@"${AXIS_IP}""$AXIS_SD" "$LOCAL_FOLDER";then echo "[-] Error: could not mount..." fi } function umountRemote(){ if ! fusermount -u "$LOCAL_FOLDER";then echo '[-] Error: couldn'\''t umount...' exit 6 fi } function arrange(){ for i in $(find "$LOCAL_FOLDER" -type f -name *."$EXTENSION"); do local DAY=$(echo "$i" | grep -Eo '[0-9]{8}' | sort | uniq) if [ ! -d "/$ARRANGED_FOLDER/$DAY" ]; then mkdir -p /"$ARRANGED_FOLDER"/"$DAY" fi if ! rsync -vah --progress "$i" /"$ARRANGED_FOLDER"/"$DAY"/; then echo "[-] Error: Could not rsync over folders" fi done } function deleteLocalFolder(){ sleep 1 if ! rm -rf "$LOCAL_FOLDER"; then echo "[-] Error: could not delete mounted folder" fi } function main(){ check_args "$@" check_hdd check_axis mountRemote arrange umountRemote deleteLocalFolder exit 0 } main "$@"
true
85bb335428c1ad0dc7c4b8293f62e27f4041bcd2
Shell
jkliff/shell-misc-tools
/install-bin.sh
UTF-8
586
3.5
4
[]
no_license
#!env bash BIN=$HOME/bin BACKUP=$BIN/.backup [[ -e $BIN ]] || mkdir $BIN [[ -e $BACKUP ]] || mkdir $BACKUP INCLUDE="timetracker/tt.py \ misc/bulk_image_convert.py \ template_touch/tpltouch \ template_touch/prjtouch \ worklog/wl.py" d=$(date +%s) for x in $INCLUDE ; do y=$(basename $x) if [[ -e $BIN/$y ]] ; then b=$BACKUP/$y-$d echo "Saving backup of existing $x to $b" cp -v $BIN/$y $b fi cp -v $x $BIN done echo $PATH | grep -q $BIN if [[ $? != "0" ]] ; then echo "WARNING: $BIN does not seem to be in your PATH." fi
true
0f2ac71f3728208adbdc614ce97d718e1b652a2f
Shell
cegodwin/BIOL5153HW
/Assn03.txt
UTF-8
836
2.84375
3
[]
no_license
# assn03-1 for i in $(seq 808 8008) ; do echo "TR-$i" ; done #assn03-2 alias c="ls -al" alias rzr="ssh godwinc@razor.uark.edu" #assn03-3 cd Desktop/gene_trees for x in *.fasta ; do echo $x ; done | wc -l #15085 #assn03-4 for x in *.tre ; do echo $x ; done | wc -l #14640 #assn03-5 for x in *.sched ; do echo $x ; done | wc -l #15262 #assn03-6 for i in *.fasta;do echo $i;done | wc -l # 15085 for i in *.fasta;do echo ${i%.fasta};done for i in *.fasta;do echo ${i%.fasta}_raxml.tre;done for i in *.fasta;do test -e ${i%.fasta}_raxml.tre;done #assn03-7 for i in *.fasta;do test -e ${i%.fasta}_raxml.tre && echo $i;done | wc -l #14640 successful for i in *.fasta;do test -e ${i%.fasta}_raxml.tre || echo $i;done | wc -l #445 failed #assn03-8 for i in *.fasta;do test -e ${i%.fasta}_raxml.tre || echo generate_pbs.py $i '>' ${i%.fasta}.pbs;done
true
c8cfca5878db04a9055db42a52d6e337866c4806
Shell
scarfacedeb/dotfiles
/git/bin/pickaxe-diff
UTF-8
1,396
3.828125
4
[]
no_license
#!/bin/bash # pickaxe-diff : external diff driver for Git. # To be used with the pickaxe options (git [log|show|diff[.*] [-S|-G]) # to only show hunks containing the searched string/regex. echo_meta () { echo "${color_meta}$1${color_none}" } path=$1 old_file=$2 old_hex=$3 old_mode=$4 new_file=$5 new_hex=$6 new_mode=$7 color_frag=$(git config --get-color color.diff.frag cyan) color_func=$(git config --get-color color.diff.func '') color_meta=$(git config --get-color color.diff.meta 'normal bold') color_new=$(git config --get-color color.diff.new green) color_old=$(git config --get-color color.diff.old red) color_none=$(tput sgr 0) diff_output=$(git diff --no-color --no-ext-diff -p $old_file $new_file || :) filtered_diff=$( echo "$diff_output" | \ grepdiff "$GREPDIFF_REGEX" --output-matching=hunk | \ \grep -v -e '^--- a/' -e '^+++ b/' | \ \grep -v -e '^diff --git' -e '^index ' sed -e "s/\(@@ .* @@\)\(.*\)/${color_frag}\1${color_func}\2${color_none}/" | \ sed -e "s/^\(+.*\)/${color_new}\1${color_none}/" | \ sed -e "s/^\(-.*\)/${color_old}\1${color_none}/" ) a_path="a/$path" b_path="b/$path" echo_meta "diff --git $a_path $b_path" echo_meta "index $old_hex..$new_hex $old_mode" echo_meta "--- $a_path" echo_meta "+++ $b_path" echo "$filtered_diff"
true
102c987f173ab1a9c6eb16ccf54b1cc29816aa23
Shell
tcler/kiss-vm-ns
/utils/fastesturl.sh
UTF-8
750
3.765625
4
[ "BSD-2-Clause" ]
permissive
#!/bin/bash fastesturl() { local minavg= local fast= local ipv4Opt= ping -h |& grep -q '^ *-4' && ipv4Opt=-4 for url; do if curl -L -s --head --request GET ${url} | grep -q "404 Not Found"; then echo "[ERROR] return 404 while access: ${url}" >&2 continue fi read p host path <<<"${url//\// }"; cavg=$(ping $ipv4Opt -w 4 -c 2 $host | awk -F / 'END {print $5}') : ${minavg:=$cavg} if [[ -z "$cavg" ]]; then echo -e " -> $host\t 100% packet loss." >&2 continue else echo -e " -> $host\t $cavg \t$minavg" >&2 fi fast=${fast:-$url} if awk "BEGIN{exit !($cavg<$minavg)}"; then minavg=$cavg fast=$url fi done echo $fast } [[ $# = 0 ]] && { echo "Usage: $0 <url list>" >&2 exit 1 } fastesturl "$@"
true
8315df349e70081f91f70df345c03fa033fdd85d
Shell
willjasen/netscaler-bootstrap
/nsafter.sh
UTF-8
593
2.703125
3
[]
no_license
#!/usr/bin/bash # Download the script that generates the Netscaler's config curl --insecure -o /nsconfig/nsconfig.sh https://raw.github.com/willjasen/netscaler-bootstrap/nsconfig.sh # Make the downloaded script executable chmod +x /nsconfig/nsconfig.sh # Run the script to generate the Netscaler's configuration /usr/bin/bash /nsconfig/nsconfig.sh \ /nsconfig/ns.conf \ # Path of Netscaler's configuration DOMAIN \ # Domain name DOMAINPASSWORD \ # Domain administrator password https://certificates.url \ # Certificates file URL PFXPASS # Certificates password
true
c43b4b0b0c7dc15bbf5493e02370f7bccdeeeac4
Shell
bemre/cdap
/examples/Ticker/bin/generate-orders
UTF-8
581
3.609375
4
[ "Apache-2.0" ]
permissive
#!/usr/bin/env bash bin=`dirname "${BASH_SOURCE-$0}"` bin=`cd "$bin"; pwd` script=`basename $0` function usage() { echo "Usage: $script [--host <host>]" echo "" echo " Options" echo " --host Specifies the host that Reactor is running on. (Default: localhost)" echo " --help This help message" echo "" } gateway="localhost" while [ $# -gt 0 ] do case "$1" in --host) shift; gateway="$1"; shift;; *) usage; exit 1 esac done pushd $bin 2>/dev/null >/dev/null ./generateRandomOrderData.sh -h $gateway -p 10000 popd 2>/dev/null >/dev/null
true
1fb998113618b127f0b63fef67ad8343a209f562
Shell
mesos-magellan/victoria
/linode/bootstrap/openvpn_client.sh
UTF-8
2,142
3.4375
3
[ "MIT" ]
permissive
#!/usr/bin/env bash echo "Hello from openvpn_client.sh!" CN_OVPN=$1 apt-get install openvpn -y set -x cp /vagrant/secrets/${CN_OVPN}.ovpn /etc/openvpn/${CN_OVPN}.conf systemctl enable openvpn@${CN_OVPN}.service systemctl start openvpn@${CN_OVPN}.service set +x ################ # Config notes # ################ # # 1) Create individual .ovpn profiles from server for master and scheduler00{1..3} # using github.com/Nyx/openvpn-install # 2) Put those .ovpns in victoria/linode/secrets # 2a) We take advantage of the fact that the local directory is rsync'd # to the server as Vagrant # 3) Set up the server to push static IPs based on CN as follows in the # subsection below # 4) When calling this script, use the same CN as $1 # ex: ./openvpn_client.sh magellan_master ############################# # Setting up openvpn server # ############################# # http://michlstechblog.info/blog/openvpn-set-a-static-ip-address-for-a-client/ # # ## See the following for example staticclient configs # root@debian:/etc/openvpn/staticclients# ls * # magellan_master magellan_scheduler001 magellan_scheduler002 magellan_scheduler003 # root@debian:/etc/openvpn/staticclients# cat * # ifconfig-push 10.8.0.210 255.255.255.0 # ifconfig-push 10.8.0.221 255.255.255.0 # ifconfig-push 10.8.0.222 255.255.255.0 # ifconfig-push 10.8.0.223 255.255.255.0 # # ## The following are important settings we must manualyl add to the # server config # root@debian:/etc/openvpn/staticclients# cat /etc/openvpn/server.conf | tail -n 3 # client-to-client # duplicate-cn # client-config-dir /etc/openvpn/staticclients # 5) If all goes well, tun0 should have the IP we want and we should # be able to connect! # root@master:~# ip addr show tun0 # 17: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 100 # link/none # inet 10.8.0.210/24 brd 10.8.0.255 scope global tun0 # valid_lft forever preferred_lft forever # inet6 fe80::cca:a260:e717:9659/64 scope link flags 800 # valid_lft forever preferred_lft forever
true
5b02baa358d1a0ff115cfabc5f9e43f3f7090556
Shell
seb-v/vimfiles
/.custom.bash
UTF-8
904
2.578125
3
[]
no_license
export GIT_PS1_SHOWDIRTYSTATE= export GIT_PS1_SHOWSTASHSTATE= export GIT_PS1_SHOWUNTRACKEDFILES= export GIT_PS1_SHOWUPSTREAM=verbose GIT_PS1_DESCRIBE_STYLE=branch export PROMPT_COMMAND='__git_ps1 "\[\033[01;32m\]\[\033[00m\]\[\033[01;34m\]\w\[\033[00m\]" " \\\$ "' export PATH=$PATH:~/go/bin __fzf_git__() { local gitcmd="git branch --all | grep -v HEAD" local cmd="${gitcmd:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \ -o -type f -print \ -o -type d -print \ -o -type l -print 2> /dev/null | cut -b3-"}" eval "$gitcmd" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse $FZF_DEFAULT_OPTS $FZF_CTRL_T_OPTS" fzf -m "$@" | while read -r item; do printf '%q ' "$item" done echo } bind '"\eb": " \C-u \C-a\C-k`__fzf_git__`\e\C-e\C-y\C-a\C-y\ey\C-h\C-e\er \C-h"'
true
f5d6ee7c701183e5ab9a0251ba4a2ada58452fc2
Shell
michaelgodley/devsetup
/scripts/awscli.sh
UTF-8
236
2.515625
3
[]
no_license
#!/bin/bash # source some env variables . ../config.conf . ./libs.sh # cd $HOME/temp curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" unzip awscliv2.zip sudo ./aws/install rm awscliv2.zip rm -rf ./aws
true
367a6b97c313d5b6658ce3e4fb3dfcc26ef25873
Shell
packer-/regulars-xonotic-data.pk3dir
/cmake/qcc.sh
UTF-8
509
3
3
[]
no_license
#!/usr/bin/env bash CPP=${CPP:-cpp} QCC=${QCC:-$PWD/../../gmqcc/gmqcc${CMAKE_EXECUTABLE_SUFFIX}} case $1 in compile) ${CPP} ${@:3} | sed 's/^#\(line\)\? \([[:digit:]]\+\) "\(.*\)".*/\n#pragma file(\3)\n#pragma line(\2)/g' > $2 ;; link) ${QCC} \ -std=gmqcc \ -Ooverlap-locals \ -O3 \ -Werror -Wall \ -Wno-field-redeclared \ -flno -futf8 -fno-bail-on-werror \ -frelaxed-switch -freturn-assignments \ ${@:2} ;; esac
true
8a9832e1cde55690c876bfacf1feb551cf49ef23
Shell
wkens/contents
/auto_gulp.sh
UTF-8
434
3.15625
3
[ "MIT" ]
permissive
#/bin/bash for i in {0..36000} ; do ls -l --time-style=full-iso resources/assets/sass | egrep '^-' > .scsses.new d=`diff .scsses.new .scsses 2>&1`; if [ ! -z "$d" ] ; then echo "" >&2 echo "Start gulp.js procession..." >&2 node_modules/gulp/bin/gulp.js > .gulp.log 2>&1 echo "End gulp.js procession." >&2 fi cp -f .scsses.new .scsses sleep 1; done; echo "Stop auto_grub.sh" >&2
true
ff680a0854f956f25599c0278bbe41db16ea23e4
Shell
shunkakinoki/dotfiles
/src/shell/.zshrc
UTF-8
2,219
2.6875
3
[ "MIT" ]
permissive
# shellcheck disable=SC2148 # Autoload Zsh Completion autoload -Uz compinit compinit # Hyper Tab Title Settings # From: https://github.com/zeit/hyper/issues/1188#issuecomment-332606903 # Override auto-title when static titles are desired ($ title My new title) title() { export TITLE_OVERRIDDEN=1 echo -en "\e]0;$*\a" } # Turn off static titles ($ autotitle) autotitle() { export TITLE_OVERRIDDEN=0; } autotitle # Condition checking if title is overridden overridden() { [[ $TITLE_OVERRIDDEN == 1 ]]; } # Load Antibody Plugin Manager source <(antibody init) export NVM_AUTO_USE=true # Install Antibody Plugins antibody bundle Aloxaf/fzf-tab antibody bundle b4b4r07/emoji-cli antibody bundle b4b4r07/enhancd antibody bundle buonomo/yarn-completion antibody bundle caarlos0/zsh-git-sync kind:path antibody bundle chrissicool/zsh-256color antibody bundle darvid/zsh-poetry antibody bundle lukechilds/zsh-better-npm-completion antibody bundle lukechilds/zsh-nvm antibody bundle MichaelAquilina/zsh-you-should-use antibody bundle mollifier/cd-gitroot antibody bundle paulirish/git-open antibody bundle paulirish/git-recent antibody bundle peterhurford/git-it-on.zsh antibody bundle peterhurford/up.zsh antibody bundle urbainvaes/fzf-marks antibody bundle wfxr/forgit antibody bundle zdharma/fast-syntax-highlighting antibody bundle zdharma/zsh-diff-so-fancy antibody bundle zsh-users/zsh-autosuggestions antibody bundle zsh-users/zsh-completions antibody bundle zsh-users/zsh-history-substring-search antibody bundle zuxfoucault/colored-man-pages_mod if [ -x notify-send ]; then antibody bundle MichaelAquilina/zsh-auto-notify fi if [ -x pipenv ]; then antibody bundle owenstranathan/pipenv.zsh fi if [ -x wakatime ]; then antibody bundle sobolevn/wakatime-zsh-plugin fi fpath+=~/.zfunc fpath+=~/dotfiles/src/shell/zsh_functions autoload b c cdf cda cdp coden coder da drm ds ef emoji::cli fe fh fkill gbo gbor ghl gobt gobtp goc icoden icoder tm tmk tp ts # Source Shell Files for file in ~/.shell_*; do source "$file" done source ~/.zshrc.local # Eval Zsh Packages eval "$(starship init zsh)" if [[ -n $ZSH_INIT_COMMAND ]]; then echo "Running: $ZSH_INIT_COMMAND" eval "$ZSH_INIT_COMMAND" fi
true
b8137127a539c06debee0298a1b973a7107c612c
Shell
phoronix-test-suite/test-profiles
/pts/espeak-1.5.0/install.sh
UTF-8
462
2.796875
3
[ "MIT" ]
permissive
#!/bin/sh tar -zxvf gutenberg-science.tar.gz tar -xf espeak-ng-1.50.tgz cd espeak-ng ./autogen.sh ./configure --prefix=$HOME/espeak_ make # build seems to have problems with multiple cores echo $? > ~/install-exit-status make install cd ~ rm -rf espeak-ng echo "#!/bin/sh cd espeak_/bin/ LD_LIBRARY_PATH=\$HOME/espeak_/lib/:\$LD_LIBRARY_PATH ./espeak-ng -f ~/gutenberg-science.txt -w espeak-output 2>&1 echo \$? > ~/test-exit-status" > espeak chmod +x espeak
true
01d92d87b4a60f9968e069fe3b3da7784c7a639a
Shell
harrifeng/system-config
/bin/emacs-quote-string
UTF-8
625
3.671875
4
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
#!/usr/bin/env bash set -e me=$(readlink -f $0) if test ! -e "$me"; then me=$(readlink -f "$(which $0)") if test ! -e "$me"; then die "Can't find out about me" exit 1 fi fi abs0=$0 if ! [[ $abs0 =~ ^/ ]]; then if [[ $abs0 =~ / ]] && test -e $PWD/$abs0; then abs0=$PWD/$abs0 elif test -e "$(which $0)"; then abs0=$(which $0) else die "Can't find abs path for $0" fi fi b0=$(basename $0) if test "${b0}" = emacs-quote-string; then echo -n "$1" | perl -npe 's/\\/\\\\/g; s/"/\\"/g' elif test "${b0}" = lua-quote-string; then str.quote.lua "$1" fi
true
f0ea8984c14932a61214be118f23bd945d2c2ef6
Shell
KingsleyYau/LinuxShell
/build/other/webrtc.sh
UTF-8
528
3.125
3
[]
no_license
#!/bin/sh # Curl build script for android # Author: Max.Chiu # Description: asm # WebRTC build script # Getting Prerequisite software WEBRTC_PATH=/Users/max/Documents/Project/webrtc/ mkdir -p $WEBRTC_PATH export PATH=$PATH:$WEBRTC_PATH/depot_tools # Getting code #fetch --nohooks webrtc_ios fetch --nohooks webrtc_android cd webrtc gclient sync # Compiling BUILD_ARCH=(arm arm64 x86 x64) for var in ${BUILD_ARCH[@]};do gn gen out/Debug/$var --args='target_os="android" target_cpu="$var"' ninja -C out/Debug/$var done
true
97a95a7444935cc30093ed1eba233bdbb80d1782
Shell
mx-psi/dotfiles
/bashrc
UTF-8
3,384
3.34375
3
[]
no_license
# If not running interactively, don't do anything case $- in *i*) ;; *) return;; esac # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi # User specific environment if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]] then PATH="$HOME/.local/bin:$HOME/bin:$PATH" fi export PATH # don't put duplicate lines or lines starting with space in the history. # See bash(1) for more options HISTCONTROL=ignoreboth # append to the history file, don't overwrite it shopt -s histappend # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) HISTSIZE=1000 HISTFILESIZE=2000 HISTCONTROL=erasedups:ignorespace xhost +local:root > /dev/null 2>&1 complete -cf sudo # Bash won't get SIGWINCH if another process is in the foreground. # Enable checkwinsize so that bash will check the terminal size when # it regains control. #65623 # http://cnswww.cns.cwru.edu/~chet/bash/FAQ (E11) shopt -s checkwinsize shopt -s expand_aliases # Enable history appending instead of overwriting. #139609 shopt -s histappend source /usr/share/git/completion/git-prompt.sh GIT_PS1_SHOWDIRTYSTATE='y' GIT_PS1_SHOWSTASHSTATE='y' GIT_PS1_SHOWUNTRACKEDFILES='y' GIT_PS1_SHOWCOLORHINTS='true' color_prompt=yes if [ "$color_prompt" = yes ]; then PS1='\[\033[01;32m\]psi\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(__git_ps1 "(%s)")\$ ' else PS1='\u@\h:\w\$ ' fi unset color_prompt force_color_prompt # If this is an xterm set the title to user@host:dir case "$TERM" in xterm*|rxvt*) PS1="\[\e]0;\u@\h: \w\a\]$PS1" ;; *) ;; esac # enable color support of ls and also add handy aliases if [ -x /usr/bin/dircolors ]; then test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" alias ls='ls --color=auto' alias grep='grep --color=auto' alias fgrep='fgrep --color=auto' alias egrep='egrep --color=auto' fi # colored GCC warnings and errors export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' source ~/.profile alias cp="cp -i" # confirm before overwriting something alias df='df -h' # human-readable sizes alias more=less alias cat=bat alias top=htop alias sl='ls --color=auto' alias dw='youtube-dl -i -x -o "%(title)s.%(ext)s" --audio-format mp3' eval "$(pandoc --bash-completion)" # enable programmable completion features (you don't need to enable # this, if it's already enabled in /etc/bash.bashrc and /etc/profile # sources /etc/bash.bashrc). if ! shopt -oq posix; then if [ -f /usr/share/bash-completion/bash_completion ]; then . /usr/share/bash-completion/bash_completion elif [ -f /etc/bash_completion ]; then . /etc/bash_completion fi fi ############## # FUNCTIONS # ############## # man colorized pages! # boredzo.org/blog/archives/2016-08-15/colorized-man-pages-understood-and-customized man() { env \ LESS_TERMCAP_md=$'\e[1;36m' \ LESS_TERMCAP_me=$'\e[0m' \ LESS_TERMCAP_se=$'\e[0m' \ LESS_TERMCAP_so=$'\e[1;40;92m' \ LESS_TERMCAP_ue=$'\e[0m' \ LESS_TERMCAP_us=$'\e[1;32m' \ man "$@" } auto(){ while true; do "$@" inotifywait -r -e close_write,moved_to,create . done } eval "$(starship init bash)" # Add RVM to PATH for scripting. Make sure this is the last PATH variable change. export PATH="$PATH:$HOME/.rvm/bin" unset rc . "$HOME/.cargo/env"
true
b8d5b9464a003cf95ca6243e7a40017bf7eae29f
Shell
btison/docker-images
/s2i/jboss-eap-6/eap64-openshift/scripts/os-eap64-launch/added/launch/security-domains.sh
UTF-8
2,090
3.859375
4
[]
no_license
function prepareEnv() { unset SECDOMAIN_NAME unset SECDOMAIN_USERS_PROPERTIES unset SECDOMAIN_ROLES_PROPERTIES unset SECDOMAIN_LOGIN_MODULE unset SECDOMAIN_PASSWORD_STACKING } function configure() { configure_security_domains } function configureEnv() { configure } configure_security_domains() { domains="<!-- no additional security domains configured -->" if [ -n "$SECDOMAIN_NAME" ]; then local configDir=${JBOSS_HOME}/standalone/configuration if [ -f "${configDir}/${SECDOMAIN_USERS_PROPERTIES}" -a -f "${configDir}/${SECDOMAIN_ROLES_PROPERTIES}" ] ; then local login_module=${SECDOMAIN_LOGIN_MODULE:-UsersRoles} if [ $login_module == "RealmUsersRoles" ]; then local realm="<module-option name=\"realm\" value=\"ApplicationRealm\"/>" else local realm="" fi if [ -n "$SECDOMAIN_PASSWORD_STACKING" ]; then stack="<module-option name=\"password-stacking\" value=\"useFirstPass\"/>" else stack="" fi domains="\ <security-domain name=\"$SECDOMAIN_NAME\" cache-type=\"default\">\ <authentication>\ <login-module code=\"$login_module\" flag=\"required\">\ <module-option name=\"usersProperties\" value=\"\${jboss.server.config.dir}/$SECDOMAIN_USERS_PROPERTIES\"/>\ <module-option name=\"rolesProperties\" value=\"\${jboss.server.config.dir}/$SECDOMAIN_ROLES_PROPERTIES\"/>\ $realm\ $stack\ </login-module>\ </authentication>\ </security-domain>" else echo "WARNING! Both user and roles files must exist before an additional security domain can be configured, current values are ${SECDOMAIN_USERS_PROPERTIES} and ${SECDOMAIN_ROLES_PROPERTIES}." fi fi if [ -n "$domains" ];then sed -i "s|<!-- ##ADDITIONAL_SECURITY_DOMAINS## -->|${domains}<!-- ##ADDITIONAL_SECURITY_DOMAINS## -->|" "$CONFIG_FILE" fi }
true
467fd322f6e47688ae9656be409e05ff5c6605cd
Shell
refenv/cijoe-pkg-lightnvm
/testcases/block_partial_read.sh
UTF-8
717
2.6875
3
[ "Apache-2.0" ]
permissive
#!/bin/bash # # HANS FIX THE SHORT DESCRIPTION # # HANS FIX THE LONG DESCRIPTION # CIJ_TEST_NAME=$(basename "${BASH_SOURCE[0]}") export CIJ_TEST_NAME # shellcheck source=modules/cijoe.sh source "$CIJ_ROOT/modules/cijoe.sh" test::enter test::require block job_fname="block_partial_read.fio" export FIO_FILENAME="$BLOCK_DEV_PATH" export FIO_JOBFILE="$CIJ_TESTFILES/$job_fname" export FIO_OUTPUT="/tmp/$job_fname.result.json" export FIO_ARGS_EXTRA="--output-format=json" res=0 if ! fio::run_jobfile "$FIO_JOBFILE"; then cij::err "failed running fio" res=$(( res + 1 )) fi if ! ssh::pull "$FIO_OUTPUT" "$CIJ_TEST_AUX_ROOT/"; then cij::err "failed retrieving fio output" res=$(( res + 1 )) fi test::exit $res
true
a1accc34b792a0aebc35eac34baf1a7b6f176bb8
Shell
CSCfi/Kielipankki-utilities
/corp/byu/byu-convert-sbatch.sh
UTF-8
1,468
3.921875
4
[]
no_license
#! /bin/bash progname=$(basename $0) progdir=$(dirname $0) scriptdir=$progdir/../../scripts usage_header="Usage: $progname [options] wlp_input.txt ... Submit a SLURM batch job to convert BYU corpora from WLP to VRT." action=sbatch optspecs=' n|dry-run { action=cat } l|log-dir=DIR "." timelimit=MINS "10" memory=MB "1000" output-dir=DIR metadata-file=FILE v|verbose ' . $scriptdir/korp-lib.sh # Process options eval "$optinfo_opt_handler" if [ $action = sbatch ] && ! find_prog sbatch > /dev/null; then error "Please run in a system with SLURM installed." fi for file in "$@"; do jobname_base="$(basename $file .txt)" jobname="byu_$jobname_base" if [ -e "$file.vrt" ]; then echo "Skipping $file: $file.vrt already exists" continue fi if [ "x$output_dir" != x ]; then outfile=$output_dir/$jobname_base.txt.vrt else outfile=$file.vrt fi if [ "x$verbose" != x ]; then cat <<EOF Submitting job "$jobname" to partition "serial" Max run time: $timelimit mins RAM per CPU: $memory MiB EOF fi $action <<EOF #! /bin/bash -l #SBATCH -J $jobname #SBATCH -o $log_dir/byu_log-$jobname_base-%j.out #SBATCH -e $log_dir/byu_log-$jobname_base-%j.err #SBATCH -t $timelimit #SBATCH --mem-per-cpu $memory #SBATCH -n 1 #SBATCH -p serial . $scriptdir/korp-lib.sh echo Job: \$SLURM_JOB_ID \$SLURM_JOB_NAME echo Input: "$file" $progdir/byu-convert.sh --metadata-file "$metadata_file" --verbose \ "$file" > "$outfile" EOF done
true
cdc7410dde83ce28a4a0a77c819998a342842d78
Shell
lbarbisan/corba
/Applet/deploy-applet.sh
UTF-8
406
2.890625
3
[]
no_license
if [ $# -lt 4 ] then echo "usage : <id applet> <class applet> <id package> <class package> [included classes ...]" echo "exemple : 01 CalculatorRPNApplet 02 fr.umlv.ir3.corba.calculator.applet" exit fi ./compile-and-convert-applet.sh $* echo press enter to continue > /dev/stderr read key ./delete-applet.sh $1 $2 $3 $4 echo press enter to continue > /dev/stderr read key ./install-applet.sh $1 $2 $3 $4
true
dac0c0b48215471d0b3c46346dd2cfdeec35d9f6
Shell
ketanbhatt/retrospect
/get_active.sh
UTF-8
229
2.546875
3
[]
no_license
#!/bin/bash echo "" > output.txt while true; do xprop -id $(xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2) _NET_WM_NAME WM_CLASS | cut -d" " -f3- >> output.txt sleep 1 done
true
9be6d6b74fcd8149b935ab7566c320f887aeb3e8
Shell
dhungvi/publiy
/publiy/misc/bash_bin/extract_all_timing_deliveries
UTF-8
218
3.5
4
[]
no_license
#!/bin/bash if [ ! -d "$1" ]; then red "Working directory is not accessible ($0)"; exit -1; fi workingdir="$1"; for resultsdir in `ls -d $workingdir/DT*/`; do extract_timing_deliveries $resultsdir; done
true
7e95ddc697ef4b712ad735d7e21af0d74395e489
Shell
dc165015/docker
/settings.sh
UTF-8
1,877
2.9375
3
[]
no_license
cd $HOME # reconfigure timezone #echo "Asia/Shanghai" | tee /etc/timezone #localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 notify appending .bashrc echo ' #export LIBGL_ALWAYS_INDIRECT=1 #export DISPLAY=:0 #export NO_AT_BRIDGE=1 #sudo service dbus start #/etc/init.d/dbus start #exec dbus-run-session -- bash #export PULSE_SERVER=tcp:localhost alias inst="apt-fast install -y" alias srcbak="cp /etc/apt/sources.list.bak /etc/apt/sources.list" alias src163="cp /etc/apt/163.xenial.sources.list /etc/apt/sources.list" alias srcup="apt-fast update" alias mn="meteor npm" alias mni="meteor npm i" alias mnr="meteor npm run" PS1="\n\e[0;33m * * * * * * * * * * * * * * * * * * * \e[m\n$PS1" [[ -f /usr/share/autojump/autojump.sh ]] && . /usr/share/autojump/autojump.sh ' | tee -a ~/.bashrc notify amounting network shared folder: //dcx/coding... if [ ! -d "/dcx/coding" ]; then sudo mkdir /dcx /dcx/coding fi if [ $(ls /coding | wc -l) -eq 0 ]; then echo "//dcx/sda4/coding /dcx/coding smbfs credentials=/home/dc/.smbcredentials,vers=1.0 0 0" | sudo tee -a /etc/fstab fi #cp /coding/tools/vagrant/lightdm.conf /etc/lightdm/lightdm.conf #cp /coding/tools/vagrant/xorg.conf /etc/X11/xorg.conf #如果想 Ubuntu 在每次启动到 command prompt ,可以输入以下指令: #echo “false” | tee /etc/X11/default-display-manager #当下次开机时,就会以命令行模式启动(text模式,字符界面登录),如果想变回图形界面启动(X windows启动),可以輸入: if (which lightdm) then echo “/usr/sbin/lightdm” | sudo tee /etc/X11/default-display-manager; fi if (which i3) then echo 'exec i3' | sudo tee -a ~/.xinitrc; fi #如果在Ubuntn以命令行模式启动,在字符终端想回到图形界面的话只需以下命令: #startx cat ./vimrc >> ~/.vimrc setsudoer
true
4dceb7f6e532d0f7879d2ea5c781028dcb11d17c
Shell
montadigital/montadigital.com
/deploy.sh
UTF-8
503
3.453125
3
[]
no_license
#!/bin/bash BRANCH=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') GIT_STATUS=$(git status) WDC_MSG="working directory clean" if [ "${GIT_STATUS/$WDC_MSG}" = "$GIT_STATUS" ] ; then echo "FATAL: working directory not clean. Will not publish." exit 1 fi jekyll build if [ "$BRANCH" == "master" ] then echo "Publishing to production (www.montadigital.com)" s3_website push else echo "Publishing a preview build to preview.montadigital.com" s3_website push --config-dir preview-build-config fi
true
cc8295c34e7a896e5821db2f68ae0b21b42fedf5
Shell
RossOgilvie/scripts
/volume_pulse
UTF-8
1,329
4.125
4
[]
no_license
#!/bin/sh completion='compctl -k "(up down set mute unmute toggle is_muted is_headphone is_speaker level show help)" volume' function get_level { pamixer --get-volume } function is_muted { pamixer --get-mute } function is_headphone { sinks=$(pactl list sinks) if echo $sinks | grep -q "Active Port: analog-output-headphones"; then echo "true"; else echo "false"; fi } function is_speaker { sinks=$(pactl list sinks) if echo $sinks | grep -q "Active Port: analog-output-speaker"; then echo "true"; else echo "false"; fi } function show { echo "showing" /home/ross/.scripts/volume_show `get_level` `is_muted` `is_headphone` & } case $1 in "up") pamixer --increase 5 show ;; "down") pamixer --decrease 5 show ;; "set") pamixer --set-volume $2 show ;; "mute") pamixer --mute show ;; "unmute") pamixer --unmute show ;; "toggle") pamixer --toggle-mute show ;; "is_muted") is_muted ;; "is_headphone") is_headphone ;; "is_speaker") is_speaker ;; "level") get_level ;; "show") show ;; "bash-completion") echo "$completion" ;; "help"|*) echo "Basically a wrapper on pulseaudio-ctl that also shows a volume notification" echo "Usage: up|down|mute|unmute|toggle|is_muted|is_headphone|is_speaker|level" echo "Volume: " `get_level`"%" ;; esac exit 1
true
a22898bd43296246e9016e945e1237d195090bbd
Shell
Webhero9297/haroldcar_haskell
/examples/base.sh
UTF-8
277
3.0625
3
[]
no_license
msgN () { echo printf '%s\n' "${1}" } lbl () { printf '>: %s\n' "${1}" } msg () { printf '%s\n' "${1}" } doone () { echo curl --silent --write-out "\n" localhost:300${1}/${2} } doall () { for p in 1 2 3 do doone ${p} ${1} done }
true
c7306b06bb6a9adce18146f975c9edc326243558
Shell
tahti/dotfiles
/bin/pum
UTF-8
242
3.453125
3
[]
no_license
#!/bin/bash DEVICES=( $(pmount |grep -o "/dev/sd[a-z][0-9]\?") ) # get length of an array tLen=${#DEVICES[@]} # use for loop read all devices for (( i=0; i<${tLen}; i++ )); do echo "Unmounting ${DEVICES[$i]}" pumount ${DEVICES[$i]} done
true
d3c25dbeaf9d652d74eefdfdaaa2ea35a6bad6c0
Shell
weakish/hubsh
/bin/gogsh
UTF-8
3,393
4.15625
4
[ "LicenseRef-scancode-warranty-disclaimer", "0BSD" ]
permissive
#!/bin/sh set -e # errexit VERSION=0.0.0 gogsh_help() { cat<<'END' gogsh -- Gogs API client in sh gogsh [ACTION] Actions: auth check if gogs acess token is available clone supports clonning from `gogs_user/repo` and `repo` (your own repo) create create this repository on GitHub and add GitHub as origin whoami show gogsh username (specified in `$GOGS_USER`) version show version help this help page gogs server is specified in `$GOGS_SERVER`. If not specified, it defaults to `http://127.0.0.1:3000`. Auth token is queried in the following order: - Environment variable `$GOGS_OAUTH_TOKEN` - content of file `$GOGS_OAUTH_FILE` - content of file `~/.config/gogsh` END } ex_usage() { gogsh_help exit 64 # command line usage error } readonly gogs_host=${GOGS_SERVER:-http://127.0.0.1:3000} gogsh_whoami() { if [ -n $GOGS_USER ]; then echo $GOGS_USER else echo 'We do not know your username on gogs.' echo 'Specify it in environment variable $GOGS_USER' exit 67 # EX_NOUSER fi } gogsh_auth() { if [ -n "$GOGS_OAUTH_TOKEN" ]; then echo "$GOGS_OAUTH_TOKEN" elif [ -f "$GOGS_OAUTH_FILE" ]; then cat "$GOGS_OAUTH_FILE"; elif [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/gogsh" ]; then cat "${XDG_CONFIG_HOME:-$HOME/.config}/gogsh" else cat<<'END' Error: OAuth token not found. http://127.0.0.1:3000/user/settings/applications And paste the token value in ~/.config/gogsh END exit 77 # EX_NOPERM fi } gogsh_clone() { if [ -d "$1" ]; then git clone "$1"; else case "$1" in */*) git clone $gogs_host/"$1".git ;; *) git clone $gogs_host/$(gogsh_whoami)/"$1".git ;; esac fi } ssh_prefix() { local ssh_host=$(echo $gogs_host | grep -E -o '//[^:]+' | grep -E -o '[^/]+') echo "gogs@$ssh_host:$(gogsh_whoami)" } gogsh_create() { if [ -n "$1" ]; then mkdir -p "$1" cd "$1" git init fi local name=$(basename $(pwd)) local apiUrl="/user/repos" readonly gogsApiRoot="$gogs_host/api/v1" readonly gogsApiPath="$gogsApiRoot$apiUrl" # Note the difference with GitHub. # GitHub uses `{field: name}`, while gogs uses `field=name`. curl -H "Authorization: token $(gogsh_auth)" \ --data "name=$name" \ -X 'POST' \ $gogsApiPath if [ $? -eq 0 ]; then if (git remote get-url origin > /dev/null 2>&1); then if (git remote get-url gogs > /dev/null 2>&1); then echo 'Both `origin` and `gogs` already exist.' read -p 'Please provide an remote name:' remote_name if (git remote get-url remote_name > /dev/null 2>&1); then echo "$remote_name already exist. Skip adding it." fi else git remote add gogs "$(ssh_prefix)/$name.git" fi else git remote add origin "$(ssh_prefix)/$name.git" fi else exit $? fi } if [ $# -eq 0 ]; then ex_usage else case "$1" in auth) gogsh_auth ;; clone) gogsh_clone "$2" ;; create) gogsh_create "$2";; whoami) gogsh_whoami ;; version) echo $VERSION;; -h|--help|help) gogsh_help ;; *) ex_usage ;; esac fi
true
4d1f84a7aa9e275644d8ce73d7791fe03b6eb80a
Shell
codinn/SwiftSockets
/xcconfig/install.sh
UTF-8
1,938
3.5
4
[ "MIT" ]
permissive
#!/bin/bash # URLS TT_SWIFTENV_URL="https://github.com/kylef/swiftenv.git" TT_GCD_URL="https://github.com/apple/swift-corelibs-libdispatch.git" #TT_GCD_SWIFT3_BRANCH=experimental/foundation #TT_GCD_SWIFT22_1404_HASH=65330e06d9bbf75a4c6ddc349548536746845059 TT_GCD_SWIFT3_BRANCH=master TT_GCD_SWIFT22_1404_HASH=master # swiftenv git clone --depth 1 ${TT_SWIFTENV_URL} ~/.swiftenv export SWIFTENV_ROOT="$HOME/.swiftenv" export PATH="${SWIFTENV_ROOT}/bin:${SWIFTENV_ROOT}/shims:$PATH" # Install Swift swiftenv install ${SWIFT_SNAPSHOT_NAME} if [ `which swift` ]; then echo "Installed Swift: `which swift`" else echo "Failed to install Swift?" exit 42 fi swift --version # Environment TT_SWIFT_BINARY=`swiftenv which swift` TT_SNAP_DIR=`echo $TT_SWIFT_BINARY | sed "s|/usr/bin/swift||g"` # Install GCD if [[ "$TRAVIS_OS_NAME" == "Linux" ]]; then IS_SWIFT_22="`swift --version|grep 2.2|wc -l|sed s/1/yes/|sed s/0/no/`" echo "${IS_SWIFT_22}" #GCD_DIRNAME="gcd-${SWIFT_SNAPSHOT_NAME}" GCD_DIRNAME=gcd git clone --recursive ${TT_GCD_URL} ${GCD_DIRNAME} cd ${GCD_DIRNAME} if [[ $IS_SWIFT_22 = "no" ]]; then git checkout ${TT_GCD_SWIFT3_BRANCH} else git checkout ${TT_GCD_SWIFT22_1404_HASH} fi mkdir ~/swift-not-so-much ln -s ${TT_SNAP_DIR} ~/swift-not-so-much/latest export CC=clang ./autogen.sh ./configure --with-swift-toolchain=${TT_SNAP_DIR}/usr --prefix=${TT_SNAP_DIR}/usr echo "---" if [[ $IS_SWIFT_22 = "no" ]]; then echo "Copying patched dispatch.h" cp ${TRAVIS_BUILD_DIR}/xcconfig/dispatch.h-patched-swift3 dispatch/dispatch.h ls dispatch else echo "NOT copying dispatch.h" fi echo "---" #cd src && dtrace -h -s provider.d && cd .. cp ${TRAVIS_BUILD_DIR}/xcconfig/trusty-provider.d src make all make install find ~ -name "*dispatch*" fi if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then echo ${TT_SWIFT_BINARY} fi
true
b3c1b60bad2393f46f27f64b2c993fcb576498d3
Shell
CanadianMVP/linuxscripts
/bash/lab2/rollafood.sh
UTF-8
492
3.1875
3
[]
no_license
#!/bin/bash arrayvar=(apple grape pizza bananna chocolate ham pork steak watermelon pineapple pear) #echo $((${arrayvar[$RANDOM % 6 ]}+${arrayvar[$RANDOM % 6]})) #You want to get two variables, add them together, and then have that #item selected from the array array1=$(($RANDOM % 6 +1)) array2=$(($RANDOM % 6 +1)) total=$((array1 + array2)) index=$((total - 2)) #echo ${arrayvar[($RANDOM % 6 +1)+($RANDOM % 6 +1)]} echo "I rolled $total and that correlates with ${arrayvar[$index]}!"
true
726cb047971b8a75885e01e72322fd266efe12a3
Shell
axsh/wakame-ci-cluster
/kvm-guests/cluster-ctl.sh
UTF-8
487
3.859375
4
[]
no_license
#!/bin/bash # # requires: # bash # set -e set -o pipefail set -x function nodes() { : } case "${1}" in replace | soft-replace | run | suspend | resume | stop | kill ) if [[ -f .cluster.sh ]]; then . .cluster.sh fi for node in $(nodes); do [[ -d "${node}" ]] || continue ( cd ${node} if [[ -x ./${1}.sh ]]; then time sudo ./${1}.sh fi ) done ;; *) echo "no such subcommand: ${1}" >&2 ;; esac
true
5eda4318bdf096bb2ee4482b11013bee8e7fae57
Shell
cawa0505/crosware
/recipes/tig/tig.sh
UTF-8
383
2.71875
3
[]
no_license
rname="tig" rver="2.5.0" rdir="${rname}-${rver}" rfile="${rdir}.tar.gz" rurl="https://github.com/jonas/tig/releases/download/${rdir}/${rfile}" rsha256="ff537c67af9201e7e7276ce8a0ff9961e9d9c6a8a78790f5817124bd7755aef4" rreqs="make ncurses readline git" . "${cwrecipe}/common.sh" eval " function cwgenprofd_${rname}() { echo 'append_path \"${rtdir}/current/bin\"' > "${rprof}" } "
true
238670639758d9b7f208a47e3941a9b5431b7f4e
Shell
jalenye/shell
/findHowManyNetUser.sh
UTF-8
255
2.9375
3
[]
no_license
#/bin/bash a=0 while : do a=$(($a+1)) if test $a -gt 255 then break else echo $(ping -c 1 192.168.1.$a |grep 'ttl'|awk '{print $4}'|sed 's/://g') ip=$(ping -c 1 192.168.1.$a |grep 'ttl'|awk '{print $4}'|sed 's/://g') echo $ip >> ip.txt fi done
true
ff76a2f2b076e08b22306dd01e51c6f92106ddc4
Shell
s1van/gpudb-explore
/utility/qcompile.sh
UTF-8
824
3.90625
4
[]
no_license
#!/bin/bash CDIR=`dirname $0` source $CDIR/gpudb_env.sh TRANSLATE=$GPUDB_PATH/translate.py usage() { echo "Usage: `echo $0| awk -F/ '{print $NF}'` [-option]" echo "[option]:" echo " -i path : specify the path of the sqls" echo " -s scheme: scheme file" echo " -o path : specify the output path for the executables" echo } if [ $# -lt 6 ] then usage exit fi while getopts "i:s:o:" OPTION do case $OPTION in i) INPATH=$OPTARG; ;; o) OUTPATH=$OPTARG; ;; s) SCHEME=$OPTARG; ;; ?) usage exit ;; esac done SQLS=$(ls $INPATH|grep '.sql'); for sql in $SQLS; do echo "$sql" cd $GPUDB_PATH && $TRANSLATE $INPATH/$sql $SCHEME EXECUTABLE=$(echo $sql| sed 's/.sql//g') cd $GPUDB_CUDA_PATH && make >/dev/null 2>&1 && cp $GPUDB_CUDA_PATH/GPUDATABASE $OUTPATH/$EXECUTABLE done
true
5fddf57222e2624b3f11118941def15b32916318
Shell
paulmagnus/CSPy
/submit/pbin/verify~
UTF-8
7,519
4.3125
4
[]
no_license
#!/bin/bash #------------------------------------------------------------------------------# # verify # # # # This program is intended to be run by the professor to verify that their # # directory is set up in a way that the submit program will be able to use # # without errors. # # # # Usage: verify [OPTION]... PROFESSOR CLASS PROJECT # # Verify all files for PROFESSOR, CLASS, and PROJECT exist # # # # OPTIONS: # # -f, --fix fix any errors that are detected, if possible # # -h, --help print this help documentation # # -v, --verbose explain what is being done # # # # Written by Paul Magnus '18, Ines Ayara '20, Matthew R. Jenkins '20 # # Summer 2017 # #------------------------------------------------------------------------------# verifyFile() { if [ $verbose ]; then printf "Verifying '$1'..." fi if [ ! -f $1 ]; then if [ $verbose ]; then printf "missing\n" else printf "File '$1' is missing\n" fi exit 1 fi if [ $verbose ]; then printf "Done\n" fi } verifyDirectory() { if [ $verbose ]; then printf "Verifying '$1'..." fi if [ ! -d $1 ]; then if [ $fix ]; then if [ $verbose ]; then printf "Creating directory..." fi mkdir $1 else if [ $verbose ]; then printf "missing\n" else printf "Directory '$1' is missing\n" fi exit 1 fi fi if [ $verbose ]; then printf "Done\n" fi } print_help() { printf "Usage: verify [OPTION]... PROFESSOR CLASS PROJECT\n" printf "Verify all files for PROFESSOR, CLASS, and PROJECT exist\n\n" printf "OPTIONS:\n" printf " -f, --fix\t\tfix any errors that are detected, if possible\n" printf " -h, --help\t\tprint this help documentation\n" printf " -v, --verbose\t\texplain what is being done\n\n" printf "Written by Paul Magnus '18, Ines Ayara '18, Matthew R. Jenkins '20\n" printf "Summer 2017\n" } while :; do case $1 in -f|--fix) fix=true shift;; -v|--verbose) verbose=true shift;; -h|--help) print_help exit;; *) break esac done if [ $# != 3 ]; then printf "verify: missing operands\n" printf "Try 'verify --help' for more information\n" exit 1 fi professor=$1 course=$2 project=$3 # Get directory of script, resolving links SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SOURCE="$(readlink "$SOURCE")" [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" done DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" # make sure this program is in submit/bash if [ "${DIR##*/}" != 'pbin' ]; then printf "Verify script must be in directory 'submit/pbin'\n" printf "Verify script is currently in '$DIR'\n" exit 1 fi dirname="${DIR%/*}" if [ "${dirname##*/}" != 'submit' ]; then printf "Verify script must be in directory 'submit/pbin'\n" printf "Verify script is currently in '$DIR'\n" exit 1 fi if [ $fix ]; then # verify that makeTemplate is in submit/bin and is executable if [ ! -f "$dirname/pbin/makeTemplate" ]; then printf "File '$dirname/pbin/makeTemplate' could not be found and is required for -f, --fix to work\n" exit 1 fi if [ $(stat -c "%a" "$dirname/pbin/makeTemplate") != "775" ]; then chmod 775 "$dirname/pbin/makeTemplate" fi fi # verify that submit is in submit/bin and is executable verifyFile "$dirname/bin/submit" if ! [ "$(stat -c "%a" "$dirname/bin/submit")" = "775" ]; then if [ $fix ]; then chmod 755 "$dirname/bin/submit" else printf "File '$dirname/bin/submit' does not have correct permissions\n" exit 1 fi fi verifyDirectory "$dirname/$professor" verifyDirectory "$dirname/$professor/$course" # VERIFY current if [ $verbose ]; then printf "Verifying '$dirname/$professor/$course/current'..." fi if [ ! -f "$dirname/$professor/$course/current" ]; then if [ $fix ]; then if [ $verbose ]; then printf "Creating file..." fi touch "$dirname/$professor/$course/current" else if [ $verbose ]; then printf "missing\n" else printf "File '$dirname/$professor/$course/current' is missing\n" fi exit 1 fi fi if [ $verbose ]; then printf "Done\n" fi verifyDirectory "$dirname/$professor/$course/$project" projectDir="$dirname/$professor/$course/$project" verifyDirectory "$projectDir/students" verifyDirectory "$projectDir/tests" # VERIFY required_files if [ $verbose ]; then printf "Verifying '$projectDir/required_files'..." fi if [ ! -f "$projectDir/required_files" ]; then if [ $fix ]; then if [ $verbose ]; then printf "Creating file..." fi printf "*" > "$projectDir/required_files" else if [ $verbose ]; then printf "missing\n" else printf "File '$projectDir/required_files' is missing\n" fi exit 1 fi fi if [ $verbose ]; then printf "Done\n" fi # VERIFY optional_files if [ $verbose ]; then printf "Verifying '$projectDir/optional_files'..." fi if [ ! -f "$projectDir/optional_files" ]; then if [ $fix ]; then if [ $verbose ]; then printf "Creating file..." fi touch "$projectDir/optional_files" else if [ $verbose ]; then printf "missing\n" else printf "File '$projectDir/optional_files' is missing\n" fi exit 1 fi fi if [ $verbose ]; then printf "Done\n" fi # VERIFY run_all_tests if [ $verbose ]; then printf "Verifying '$projectDir/tests/run_all_tests'..." fi if [ ! -f "$projectDir/tests/run_all_tests" ]; then if [ $fix ]; then if [ $verbose ]; then printf "Creating file..." fi printf "#!/bin/bash\nprintf \"No tests to run\\n\"" > "$projectDir/tests/run_all_tests" chmod 755 "$projectDir/tests/run_all_tests" else if [ $verbose ]; then printf "missing\n" else printf "File '$projectDir/tests/run_all_tests' is missing\n" fi exit 1 fi else if [ $(stat -c "%a" "$projectDir/tests/run_all_tests") != "755" ]; then if [ $fix ]; then if [ $verbose ]; then printf "Changing permission to 755..." fi chmod 755 "$projectDir/tests/run_all_tests" else printf "\nPermissions for 'run_all_tests' is incorrect\nShould be 755\n" exit 1 fi fi fi if [ $verbose ]; then printf "Done\n" fi
true
937f05514784314e9136b704751309e6796a182f
Shell
JeanBaeez/dotfiles
/bin/getFonts
UTF-8
619
2.625
3
[ "MIT" ]
permissive
#!/bin/sh echo "Getting Fonts..." mkdir ~/Fonts # Papyrus wget -O ~/Fonts/papyrus.ttf https://img.download-free-fonts.com/dl.php?id=89786&hash=4356adc4fd6ae9e1e32926682ef43287 # Cascadia Code wget -O ~/Fonts/Cascadia.ttf https://github.com/microsoft/cascadia-code/releases/download/v1911.21/Cascadia.ttf # Jetbrains Mono wget -O ~/Fonts/JetbrainsMono.zip https://github.com/JetBrains/JetBrainsMono/releases/download/v1.0.3/JetBrainsMono-1.0.3.zip unzip ~/Fonts/JetbrainsMono.zip -d ~/Fonts mv ~/Fonts/JetBrainsMono-1.0.3-Source/ttf/* ~/Fonts rm -rf ~/Fonts/JetBrainsMono-1.0.3-Source rm ~/Fonts/JetbrainsMono.zip
true
7b65bbd434000273b1e5d99b577d77e03ea3417b
Shell
deepkh/libex
/grpc/check_cmake.sh
UTF-8
1,224
3.765625
4
[]
no_license
#!/bin/bash vercomp () { if [[ $1 == $2 ]] then return 0 fi local IFS=. local i ver1=($1) ver2=($2) # fill empty fields in ver1 with zeros for ((i=${#ver1[@]}; i<${#ver2[@]}; i++)) do ver1[i]=0 done for ((i=0; i<${#ver1[@]}; i++)) do if [[ -z ${ver2[i]} ]] then # fill empty fields in ver2 with zeros ver2[i]=0 fi if ((10#${ver1[i]} > 10#${ver2[i]})) then return 1 fi if ((10#${ver1[i]} < 10#${ver2[i]})) then return 2 fi done echo X0 return 0 } testvercomp () { vercomp $1 $2 case $? in 0) op='=';; 1) op='>';; 2) op='<';; esac if [[ $op != $3 ]] then echo "FAIL: Expected '$3', Actual '$op', Arg1 '$1', Arg2 '$2'" return 1 else echo "Pass: '$1 $op $2'" fi return 0 } install_cmake() { echo "=== install cmake ===" sudo mv /usr/bin/cmake /usr/bin/cmake.old wget -q -O cmake-linux.sh https://github.com/Kitware/CMake/releases/download/v3.16.1/cmake-3.16.1-Linux-x86_64.sh sudo sh cmake-linux.sh -- --skip-license --prefix=/usr/ } check_cmake_version() { echo "=== check cmake version ===" testvercomp "`cmake --version | grep version | awk '{print $3}'`" "3.16.0" '>' if [ $? = 1 ];then echo $? install_cmake fi }
true
fd04b6053d53cf22ae51b09954c57c0a0c3ee48e
Shell
osyoyu/report-md
/latex/report-md.sh
UTF-8
283
2.65625
3
[]
no_license
#!/bin/sh inputfile=`basename $1 .md` templatename=RG_TEMP cp $2 ${templatename}.tex pandoc -f markdown -t latex -o mid-output.tex ${1} platex ${templatename}.tex && dvipdfmx -o ${inputfile}.pdf ${templatename}.dvi && rm ${templatename}.dvi ${templatename}.log ${templatename}.tex
true
b3e54fdeef4985787ab69901e6b590079fb90e84
Shell
oriane17/cartographie
/traceroute/traceroute.sh
UTF-8
2,543
3.25
3
[]
no_license
#!/bin/bash sites=( "www.iutbeziers.fr" "www.nimes-metropole.fr" "www.alliancetelecom.fr" ) color=( "gold" "purple" "blue" "fin" ) ttl=1 nb=0 recurrence="" for cible in "${sites[@]}"; ##Passage sur chaque site## do maxttl=$(traceroute -q 1 -n $cible | sed "1d" | wc -l) >./traceroute.rte/$cible.rte ##J'enlève le contenu de mon fichier cible.rte echo "$cible" while (("$ttl" <= "$maxttl")); do for option in "-T" "-I" "-U" "-U -p 53" "-T -p 443" "-T -p 80" "-T -p 25" "-T -p 22"; ##Chaque option pour ma commande traceroute do tracert=$(traceroute -A -q 1 -n -f $ttl -m $ttl $option $cible | awk '{print $1,$2,$3}' | sed '1d') ##Je garde que le ttl, l'adresse IP du routeur, et l AS adresse=$(echo "$tracert" | awk '{print $2}') ##Je garde que l'adresse IP du routeur if [ "$adresse" == "*" ]; ##Je compare l'adresse IP du routeur avec une étoile then if [ "$option" == "-T -p 22" ]; ##Dans le cas où j'ai encore une étoile même après être passée par toutes les options then echo "->">>./traceroute.rte/$cible.rte ##Mise en forme du fichier cible.rte pour ensuite l'utiliser dans le .dot echo "\"Routeur $ttl introuvable pour $cible\"">>./traceroute.rte/$cible.rte echo "Routeur $ttl introuvable" echo "$ttl" >> ./ttlintrouvable.txt ##Je rentre le ttl actif dans mon fichier ttlintrouvable pour l'utiliser après dans mon fichier .dot fi else if [ "$adresse" != "$recurrence" ]; ##S il n y a pas d étoile, je vérifie que ca e soit pas la même adresse qeue celle du ttl d avant then echo "$tracert" echo "->">>./traceroute.rte/$cible.rte echo "\"$tracert\"">>./traceroute.rte/$cible.rte break else break fi fi done recurrence=$adresse ttl=$(($ttl+1)) ##J'incrémente mon ttl pour ma boucle while done ttl=1 ##Une fois le ttl max atteint, je remet mon ttl à 1 pour passer à mon 2eme site echo "[color=${color[$nb]}]">>./traceroute.rte/$cible.rte ##Je définis la couleur pour ma flèche nb=$(($nb+1)) if [ ${color[$nb]} == "fin" ]; ##Si la couleur est égale à fin, je recommence ma liste au début then nb=0 fi for line in $(cat ttlintrouvable.txt); ##Mise en forme de mon .dot pour avoir des carrés lorsque mon routeur est introuvable do echo "\"Routeur $line introuvable pour $cible\" [shape=box]">>./traceroute.rte/$cible.rte done >./ttlintrouvable.txt done ./xdot.sh ###Je lance le script qui permet de créer mon .dot
true
ff76ee444e523d021048ecc098d278656e96000b
Shell
jschule/gsuite-automation
/move-students-to-ou.sh
UTF-8
423
3.0625
3
[ "Apache-2.0" ]
permissive
#!/bin/bash set -o pipefail -o errexit -o nounset gam="$HOME/bin/gamadv-xtd3/gam" if [ ! -x "$gam" ] ; then echo "Need https://github.com/taers232c/GAMADV-XTD3 in $gam, please install" exit 98 fi source config.sh test "$MASTERSHEET" test "$MASTERUSER" source _functions.sh info Move all students to their OU $gam loop gsheet "$MASTERUSER" "$MASTERSHEET" "gam Schüler" \ gam update user "~Email" \ ou "~OU"
true
bcda0b87e1900305ffb196c7950aed335f20b6ef
Shell
FairwindsOps/rok8s-scripts
/bin/docker-build
UTF-8
3,999
3.734375
4
[ "Apache-2.0" ]
permissive
#!/bin/bash . k8s-read-config "$@" . docker-resolve if [ -z "$BASEDIR" ]; then echo BASEDIR must be set; exit 1; fi if [ -z "$DOCKERTAG" ]; then echo DOCKERTAG must be set; exit 1; fi if [ -z "$DOCKERFILE" ]; then echo DOCKERFILE must be set; exit 1; fi PREVIOUS_COMMIT=$(git rev-parse HEAD~1) CI_BRANCH=$(echo "${CI_BRANCH}" | tr / _) # support overriding "latest" DOCKER_LATEST_TAG=${DOCKER_LATEST_TAG:-latest} if [ "$DOCKER_BUILD_CACHE_FROM" == "available" ]; then echo "Using --cache-from to improve performance" CACHE_FROM_TARGETS="" # shellcheck disable=2086 while read -r CACHE_TARGET; do if [ "${CACHE_TARGET}" == "" ]; then break fi echo "Working on Dockerfile target[${CACHE_TARGET}]..." TARGET_TAG=cache-${CI_BRANCH}-${CACHE_TARGET} TARGET_IMAGE=${EXTERNAL_REGISTRY_BASE_DOMAIN}/${REPOSITORY_NAME} echo "Checking for existing cache image for target[${CACHE_TARGET}]..." docker pull "${TARGET_IMAGE}:${TARGET_TAG}" || true docker pull "${TARGET_IMAGE}:cache-master-${CACHE_TARGET}" || true docker pull "${TARGET_IMAGE}:cache-main-${CACHE_TARGET}" || true echo "Building Dockerfile target[${CACHE_TARGET}]..." # shellcheck disable=2086 docker build --rm=false -t "${TARGET_IMAGE}:${TARGET_TAG}" -f "${BASEDIR}/${DOCKERFILE}" \ --target "${CACHE_TARGET}" \ ${CACHE_FROM_TARGETS} \ ${ROK8S_DOCKER_BUILD_EXTRAARGS} \ --cache-from "${TARGET_IMAGE}:${TARGET_TAG}" \ --cache-from "${TARGET_IMAGE}:cache-master-${CACHE_TARGET}" \ --cache-from "${TARGET_IMAGE}:cache-main-${CACHE_TARGET}" \ "${BASEDIR}" CACHE_FROM_TARGETS="${CACHE_FROM_TARGETS} --cache-from ${TARGET_IMAGE}:${TARGET_TAG}" done <<< "$(grep -i '^FROM.* AS ' ${BASEDIR}/${DOCKERFILE} | awk '{print $4}')" docker pull "${EXTERNAL_REGISTRY_BASE_DOMAIN}/${REPOSITORY_NAME}:$PREVIOUS_COMMIT" || true docker pull "${EXTERNAL_REGISTRY_BASE_DOMAIN}/${REPOSITORY_NAME}:$CI_BRANCH" || true docker pull "${EXTERNAL_REGISTRY_BASE_DOMAIN}/${REPOSITORY_NAME}:master" || true docker pull "${EXTERNAL_REGISTRY_BASE_DOMAIN}/${REPOSITORY_NAME}:main" || true if [ "${DOCKER_TARGET}" != "" ]; then DOCKER_TARGET="--target=${DOCKER_TARGET}" fi # shellcheck disable=2086 docker build --rm=false -t "${DOCKERTAG}:${DOCKER_LATEST_TAG}" -f "${BASEDIR}/${DOCKERFILE}" \ ${CACHE_FROM_TARGETS} \ ${DOCKER_TARGET} \ ${ROK8S_DOCKER_BUILD_EXTRAARGS} \ --cache-from "${EXTERNAL_REGISTRY_BASE_DOMAIN}/${REPOSITORY_NAME}:$PREVIOUS_COMMIT" \ --cache-from "${EXTERNAL_REGISTRY_BASE_DOMAIN}/${REPOSITORY_NAME}:$CI_BRANCH" \ --cache-from "${EXTERNAL_REGISTRY_BASE_DOMAIN}/${REPOSITORY_NAME}:master" \ --cache-from "${EXTERNAL_REGISTRY_BASE_DOMAIN}/${REPOSITORY_NAME}:main" \ "${BASEDIR}" else echo "--cache-from not available with this version of Docker" # shellcheck disable=2086 docker build --rm=false -t "${DOCKERTAG}:${DOCKER_LATEST_TAG}" -f "${BASEDIR}/${DOCKERFILE}" ${ROK8S_DOCKER_BUILD_EXTRAARGS} "${BASEDIR}" fi # shellcheck disable=2181 if [ $? -ne 0 ] then echo "Docker build failed! Aborting" exit 1 fi if [ "$ROK8S_ENABLE_CHANGE_DETECTION" ]; then #Check to see if the digest for this image has changed. If it has not, then indicate that printf "\\nRunning change detection...\\n" oldDigest=$(docker inspect "${EXTERNAL_REGISTRY_BASE_DOMAIN}"/"${REPOSITORY_NAME}":"$CI_BRANCH" | jq -r .[].Id) newDigest=$(docker inspect "${EXTERNAL_REGISTRY_BASE_DOMAIN}"/"${REPOSITORY_NAME}":"${DOCKER_LATEST_TAG}" | jq -r .[].Id) changeFile=".changesDetected" if [ -f $changeFile ]; then rm $changeFile fi if [ "$oldDigest" == "$newDigest" ]; then echo "false" > $changeFile else #Default to true so that tests will be run if something amiss echo "true" > $changeFile fi printf "Result of change detection: %s\\n" "$(cat $changeFile)" fi # Fire the image scanner if enabled - see the `docker-microscanner` script for details . docker-microscanner
true
ed5b251f829a88f725edf8b23282294ad700a405
Shell
trifacta/floating-elephants
/cloudera/cdh5/hue/start.sh
UTF-8
366
2.90625
3
[ "LicenseRef-scancode-dco-1.1", "Apache-2.0" ]
permissive
#!/bin/bash # Wait for DFS to come out of safe mode until hdfs dfsadmin -safemode wait do echo "Waiting for HDFS safemode to turn off" sleep 1 done sudo -u hdfs hdfs dfs -mkdir /user/hue sudo -u hdfs hdfs dfs -chmod -R 1777 /user/hue sudo -u hdfs hdfs dfs -chown hue:hadoop /user/hue service hue start tail -f `find /var/log -name *.log -or -name *.out`
true
c7a17100d012d82151cc3c226c3ec455bce8e4af
Shell
mingle/elasticsearch-opsworks
/init_rbenv
UTF-8
2,616
3.5
4
[]
no_license
#!/bin/bash BUNDLER_VERSION="1.11.2" export RBENV_VERSION=$(cat .ruby-version) export RBENV_ROOT=$HOME/.rbenv unset GEM_PATH unset GEM_HOME if [ ! -d $RBENV_ROOT ]; then echo "Installing rbenv." git clone git://github.com/sstephenson/rbenv.git $RBENV_ROOT fi if [ ! -d $RBENV_ROOT/plugins/rbenv-update ]; then echo "Installing rbenv-update plugin." git clone https://github.com/rkh/rbenv-update.git $RBENV_ROOT/plugins/rbenv-update fi if [ ! -d $RBENV_ROOT/plugins/ruby-build ]; then echo "Installing ruby-build plugin." git clone https://github.com/sstephenson/ruby-build.git $RBENV_ROOT/plugins/ruby-build fi if [ ! -d $RBENV_ROOT/plugins/rbenv-gemset ]; then echo "Installing rbenv-gemset plugin." git clone https://github.com/jf/rbenv-gemset.git $RBENV_ROOT/plugins/rbenv-gemset fi if [ ! -d $RBENV_ROOT/plugins/rbenv-vars ]; then echo "Installing rbenv-vars plugin." git clone https://github.com/sstephenson/rbenv-vars.git $RBENV_ROOT/plugins/rbenv-vars fi if [ ! -d $RBENV_ROOT/versions/$RBENV_VERSION ]; then echo "Installing ruby ${RBENV_VERSION}." $RBENV_ROOT/bin/rbenv update $RBENV_ROOT/bin/rbenv install $RBENV_VERSION if [[ $RBENV_VERSION =~ "jruby" ]]; then # should be the same as pristine since this is a new install, but `gem pristine` hits file permissions errors the first time $RBENV_ROOT/bin/rbenv exec gem install jruby-launcher fi echo "done" elif [[ ("true" = "${RBENV_UPDATE:-false}") || ($(uname -a) =~ Darwin) ]]; then echo "Updating rbenv..." $RBENV_ROOT/bin/rbenv update else echo "Environment up to date, ruby version: $RBENV_VERSION" fi if ! (echo $PATH | grep -F "$RBENV_ROOT" > /dev/null 2>&1 && grep -F 'export PATH="$HOME/.rbenv' $HOME/.bash_profile 2>&1 > /dev/null); then echo "Adding rbenv to PATH" echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> $HOME/.bash_profile export PATH="$RBENV_ROOT/bin:$PATH" fi if ! (type rbenv > /dev/null 2>&1 && grep -F 'eval "$(rbenv init -)"' $HOME/.bash_profile 2>&1 > /dev/null); then echo "Initializing rbenv in your .bash_profile" echo 'eval "$(rbenv init -)"' >> $HOME/.bash_profile eval "$(rbenv init -)" fi if ! ($RBENV_ROOT/shims/bundle --version 2> /dev/null | grep -F "$BUNDLER_VERSION" > /dev/null 2>&1); then echo "installing bundler $BUNDLER_VERSION" cmd="$RBENV_ROOT/bin/rbenv exec gem install --no-ri --no-rdoc bundler -v $BUNDLER_VERSION" echo "executing: $cmd" $cmd echo "done, result: $?" fi unset BUNDLER_VERSION $RBENV_ROOT/bin/rbenv exec ruby -S bundle install $RBENV_ROOT/bin/rbenv rehash
true
cdff291c017f9ddd28486c66a384569e8d8b7f39
Shell
NLGithubWP/LambdaML
/archived/ec2/kmeans/run_higgs_kmeans.sh
UTF-8
1,056
2.828125
3
[ "Apache-2.0" ]
permissive
#!/bin/bash world_size=$1 nr_cluster=$2 master_ip=$3 train_path="/home/ubuntu/dataset/higgs${world_size}" for ((i=0; i<world_size; i++)); do if [ $i == 0 ] then source /home/ubuntu/envs/pytorch/bin/activate nohup python3.6 /home/ubuntu/LambdaML/ec2/kmeans/higgs_kmeans.py --init-method "tcp://${master_ip}" --rank 0 --communication all-reduce -k "${nr_cluster}" --world-size "${world_size}" --train-file "${train_path}/${i}_${world_size}" --no-cuda > "/home/ubuntu/log/distrb_higgs_kmeans_r${i}_w${world_size}_k${nr_cluster}.txt" 2>&1 & else ssh "higgs-node00${i}" "source /home/ubuntu/envs/pytorch/bin/activate; cd /home/ubuntu/LambdaML/ec2/kmeans; nohup python3.6 higgs_kmeans.py --init-method tcp://${master_ip} --communication all-reduce --rank ${i} -k ${nr_cluster} --world-size ${world_size} --train-file ""${train_path}"/${i}_"${world_size}"" --no-cuda > /home/ubuntu/log/distrib_higgs_kmeans_r${i}_w${world_size}_k${nr_cluster}.txt 2>&1 &" fi done
true
7a65828ee555344bb5cfd427038b7150699fedf6
Shell
haamoon/lidar_transfer
/experiments/train.sh
UTF-8
722
2.625
3
[ "MIT" ]
permissive
#!/bin/bash # Parameter EXP="2048@0.05x3" VERSION="log_dropout_u0.1_l0.1" PRETRAINED="/automount_home_students/flanger/workspace/msc/lidar-bonnetal/train/models/darknet53/" MODEL="/media/flanger/SAMS1TB_0/msc/experiments/$EXP/logs/$VERSION" DATA="/media/flanger/SAMS1TB_0/msc/experiments/$EXP" source ~/workspace/msc/venv/bin/activate # Training cd ~/workspace/msc/lidar-bonnetal/train/tasks/semantic/ ./train.py \ -d "$DATA/dataset/" \ -p "$PRETRAINED" \ -ac "$DATA/arch_cfg_dropout.yaml" \ -dc "$DATA/data_cfg.yaml" \ -l "$MODEL" TITLE="$EXP/$VERSION done" MSG="" curl -u $PUSHBULLET_TOKEN: https://api.pushbullet.com/v2/pushes \ -d type=note -d title="$TITLE" -d body="$MSG" >/dev/null 2>&1
true
a61726fc0f2e51f361b3034ac20ab15ea81dc83f
Shell
astropy/conda-builder
/continuous-integration/travis/install_osx.sh
UTF-8
293
2.59375
3
[ "CC0-1.0" ]
permissive
MINICONDA_URL="http://repo.continuum.io/miniconda" MINICONDA_FILE="Miniconda3-3.7.3-MacOSX-x86_64.sh" wget "${MINICONDA_URL}/${MINICONDA_FILE}" bash $MINICONDA_FILE -b export PATH=/Users/travis/miniconda3/bin:$PATH conda update --yes conda conda install --yes pip conda-build jinja2 binstar
true
40a3c159a6599d14e65508f6b75b4a28a5ded3e6
Shell
drankye/recordservice
/server/csd/RECORD_SERVICE/src/scripts/client.sh
UTF-8
5,757
3.515625
4
[ "Apache-2.0" ]
permissive
#!/bin/bash # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. set -ex CMD=$1 function log { timestamp=$(date) echo "${timestamp}: $1" } # Replaces all occurrences of $1 with $2 in file $3, escaping $1 and $2 as necessary. function sed_replace { sed -i "s/$(echo $1 | sed -e 's/\([[\/.*]\|\]\)/\\&/g')/$(echo $2 | sed -e 's/[\/&]/\\&/g')/g" $3 } log "CMD: ${CMD}" log "PLANNER_CONF_FILE: ${PLANNER_CONF_FILE}" log "RECORDSERVICE_CONF_FILE: ${RECORDSERVICE_CONF_FILE}" log "CONF_DIR: ${CONF_DIR}" log "DIRECTORY_NAME: ${DIRECTORY_NAME}" RECORDSERVICE_CONF_DIR="${CONF_DIR}/${DIRECTORY_NAME}" log "RECORDSERVICE_CONF_DIR: ${RECORDSERVICE_CONF_DIR}" PLANNER_FILE="${RECORDSERVICE_CONF_DIR}/${PLANNER_CONF_FILE}" log "PLANNER_FILE: ${PLANNER_FILE}" PW_FILE="${RECORDSERVICE_CONF_DIR}/${PW_CONF_FILE}" log "PW_FILE: ${PW_FILE}" SPARK_FILE="${RECORDSERVICE_CONF_DIR}/${SPARK_CONF_FILE}" log "SPARK_FILE: ${SPARK_FILE}" log "HDFS_CONFIG: ${HDFS_CONFIG}" # As CM only copies $RECORDSERVICE_CONF_DIR to /etc/recordservice/conf.cloudera.record_service, # we should also copy YARN / HADOOP conf into RECORDSERVICE_CONF_DIR. YARN_CONF_DIR="${CONF_DIR}/yarn-conf" HADOOP_CONF_DIR="${CONF_DIR}/hadoop-conf" log "YARN_CONF_DIR: ${YARN_CONF_DIR}" log "HADOOP_CONF_DIR: ${HADOOP_CONF_DIR}" # Copy yarn-conf under recordservice-conf. # Copy hadoop-conf under recordservice-conf, if yarn-conf is not there. if [ -d "${YARN_CONF_DIR}" ]; then log "Copy ${YARN_CONF_DIR} to ${RECORDSERVICE_CONF_DIR}" cp ${YARN_CONF_DIR}/* ${RECORDSERVICE_CONF_DIR} elif [ -d "${HADOOP_CONF_DIR}" ]; then log "Copy ${HADOOP_CONF_DIR} to ${RECORDSERVICE_CONF_DIR}" cp ${HADOOP_CONF_DIR}/* ${RECORDSERVICE_CONF_DIR} fi # Because of OPSAPS-25695, we need to fix HADOOP config ourselves. log "CDH_MR2_HOME: ${CDH_MR2_HOME}" log "HADOOP_CLASSPATH: ${HADOOP_CLASSPATH}" for i in "${RECORDSERVICE_CONF_DIR}"/*; do log "i: $i" sed_replace "{{CDH_MR2_HOME}}" "${CDH_MR2_HOME}" "$i" sed_replace "{{HADOOP_CLASSPATH}}" "${HADOOP_CLASSPATH}" "$i" sed_replace "{{JAVA_LIBRARY_PATH}}" "" "$i" done # Adds a xml config to RECORDSERVICE_CONF_FILE add_to_recordservice_conf() { FILE=`find ${RECORDSERVICE_CONF_DIR} -name ${RECORDSERVICE_CONF_FILE}` log "Add $1:$2 to ${FILE}" CONF_END="</configuration>" NEW_PROPERTY="<property><name>$1</name><value>$2</value></property>" TMP_FILE="${RECORDSERVICE_CONF_DIR}/tmp-conf-file" cat ${FILE} | sed "s#${CONF_END}#${NEW_PROPERTY}#g" > ${TMP_FILE} cp ${TMP_FILE} ${FILE} rm -f ${TMP_FILE} echo ${CONF_END} >> ${FILE} } # Adds a properties conf to SPARK_FILE add_to_spark_conf() { log "ADD $1:$2 to ${SPARK_FILE}" NEW_PROPERTY="$1=$2" TMP_FILE="${RECORDSERVICE_CONF_DIR}/tmp-spark-conf-file" cat ${SPARK_FILE} > ${TMP_FILE} echo ${NEW_PROPERTY} >> ${TMP_FILE} log "Add prefix spark. in each line" sed -i -e 's/^/spark./' ${TMP_FILE} cp ${TMP_FILE} ${SPARK_FILE} rm -f ${TMP_FILE} } # Adds a xml config to hdfs-site.xml add_to_hdfs_site() { FILE=`find ${RECORDSERVICE_CONF_DIR} -name hdfs-site.xml` CONF_END="</configuration>" NEW_PROPERTY="<property><name>$1</name><value>$2</value></property>" TMP_FILE="${CONF_DIR}/tmp-hdfs-site" cat ${FILE} | sed "s#${CONF_END}#${NEW_PROPERTY}#g" > ${TMP_FILE} cp ${TMP_FILE} ${FILE} rm -f ${TMP_FILE} echo ${CONF_END} >> ${FILE} } # Append to hdfs-site.xml if HDFS_CONFIG is not empty. append_to_hdfs_site() { if [[ -n ${HDFS_CONFIG} ]]; then FILE=`find ${RECORDSERVICE_CONF_DIR} -name hdfs-site.xml` CONF_END="</configuration>" TMP_FILE="${CONF_DIR}/tmp-hdfs-site" cat ${FILE} | sed "s#${CONF_END}#${HDFS_CONFIG}#g" > ${TMP_FILE} cp ${TMP_FILE} ${FILE} rm -f ${TMP_FILE} echo ${CONF_END} >> ${FILE} fi } CONF_KEY=recordservice.planner.hostports CONF_VALUE= copy_planner_hostports_from_file() { log "copy from $1" if [ -f ${PLANNER_FILE} ]; then for line in $(cat $1) do log "line ${line}" if [[ ${line} == *":"*"="* ]]; then PLANNER_HOST=${line%:*} PLANNER_PORT=${line##*=} log "add ${PLANNER_HOST}:${PLANNER_PORT}" CONF_VALUE="${CONF_VALUE},${PLANNER_HOST}:${PLANNER_PORT}" fi done fi } case $CMD in (deploy) log "Deploy client configuration" copy_planner_hostports_from_file ${PLANNER_FILE} copy_planner_hostports_from_file ${PW_FILE} log "CONF_KEY: ${CONF_KEY}" log "CONF_VALUE: ${CONF_VALUE}" if [ -n "${CONF_VALUE}" ]; then # remove the first ',' CONF_VALUE=${CONF_VALUE:1} add_to_recordservice_conf ${CONF_KEY} ${CONF_VALUE} add_to_spark_conf ${CONF_KEY} ${CONF_VALUE} fi # Add zk quorum to hdfs-site.xml add_to_hdfs_site recordservice.zookeeper.connectString ${ZK_QUORUM} # Enable short circuit read in hdfs-site.xml. add_to_hdfs_site dfs.client.read.shortcircuit true # Append HDFS_CONFIG to hdfs-site.xml. # This can overwrite the original value. append_to_hdfs_site ;; (*) log "Don't understand [$CMD]" ;; esac
true
034b6b7d9f537c4ed2cb18cd57242378be783bc9
Shell
HughP/olac-1
/src/utils/ldc-server-check/syschk.sh
UTF-8
8,250
2.78125
3
[]
no_license
#! /bin/sh webroot=/web/org/language-archives base=/home/olac/bin dat=$base/syschk.dat dat_xsv_html=$base/syschk.dat.xsv_html dat_xercesj=$base/syschk.dat.xercesj tmp=/tmp/olac.syschk.tmp.$$ PS="/bin/ps awx" [ -f $dat ] && . $dat grep -v '^_OLACSEARCH_' $dat > $dat.copy mv -f $dat.copy $dat && chmod g+w $dat SCRIPT_ACCESSLOG_CRON="$base/access_log-cron.sh" HTTPD_ACCESS_LOG=`grep '^LOG=' $SCRIPT_ACCESSLOG_CRON | sed 's/^LOG=//'` CHKSUM_PHP="/usr/local/libexec/apache/libphp5.so" CHKSUM_PERL="/usr/bin/perl" CHKSUM_JAVA="/usr/local/bin/java" CHKSUM_JBOSS_JAVA=`$PS | grep jboss | grep java | grep -v grep | awk '{print $5}' | head -1` CHKSUM_JBOSS=`$PS | grep jboss | grep java | grep -v grep | sed -E 's@.*[ :]([^:]*run\.jar)[ :].*@\1@' | head -1` CHKSUM_XALAN="/mnt/unagi/speechd8/ldc/wwwhome/olac/xalan-J/bin/xalan.jar" CHKSUM_XERCESJ="/mnt/unagi/speechd8/ldc/wwwhome/olac/xerces-J/xml-apis.jar" CHKSUM_PYTHON="/usr/local/bin/python2.3" CHKSUM_XSV1="/mnt/unagi/speechd8/ldc/wwwhome/olac/xsv/lib/python2.3/site-packages/XSV/commandLine.py" CHKSUM_XSV2="/mnt/unagi/speechd8/ldc/wwwhome/olac/xsv/lib/python2.3/site-packages/XSV/driver.py" #CHKSUM2_DCXMLS="http://dublincore.org/schemas/xmls/" CHKSUM2_DC="http://dublincore.org/schemas/xmls/qdc/2006/01/06/dc.xsd" CHKSUM2_DCTERMS="http://dublincore.org/schemas/xmls/qdc/2006/01/06/dcterms.xsd" CHKSUM2_DCMITYPE="http://dublincore.org/schemas/xmls/qdc/2006/01/06/dcmitype.xsd" CHKSUM2_SIMPLEDC="http://dublincore.org/schemas/xmls/qdc/2006/01/06/simpledc.xsd" CHKSUM2_QUALIFIEDDC="http://dublincore.org/schemas/xmls/qdc/2006/01/06/qualifieddc.xsd" CHKSUM2_OLACDC="http://www.language-archives.org/OLAC/1.0/dc.xsd" CHKSUM2_OLACDCTERMS="http://www.language-archives.org/OLAC/1.0/dcterms.xsd" CHKSUM2_OLAC="http://www.language-archives.org/OLAC/1.0/olac.xsd" CHKSUM2_OLAC_EXTENSION="http://www.language-archives.org/OLAC/1.0/olac-extension.xsd" RESULT=SUCCESS ## ## httpd ## echo "Checking httpd ... " echo # get pid of the leader printf " * Get pid: " pid_httpd=`$PS -o comm,pid,ppid | grep httpd | egrep '\b1$' | awk '{print $2}'` if [ -n "$pid_httpd" ] ; then echo "OK ($pid_httpd)" #echo #$PS -p $pid_httpd -o pid,stat,%cpu,%mem,lstart #ecjp else echo "Fail" RESULT=FAIL fi printf " * Fetch l-a.org index page: " # fetch header only line=`curl -sI "http://www.language-archives.org/" | head -1` if [ -n "$line" ] ; then ret=`echo $line | awk '{print $2}'` if [ "$ret" = "200" ] ; then echo "OK" else echo "Fail" RESULT=FAIL fi #echo #echo $line #echo else echo "Fail" RESULT=FAIL fi echo ## ## mysql ## echo "Checking mysql ..." echo # mysql is on brown # its not so simple to have a remote process information printf " * Get number of archives: " mysql="mysql --defaults-file=/home/olac/.my.cnf.olac2" q1="select count(*) from OLAC_ARCHIVE" q2="select count(*) from ARCHIVED_ITEM" narc=`echo $q1 | $mysql | sed 1d` if [ "$narc" -gt 0 ] ; then echo $narc else echo "Fail" RESULT=FAIL fi printf " * Get number of archived items: " nitm=`echo $q2 | $mysql | sed 1d` if [ "$nitm" -gt 0 ] ; then echo $nitm else echo "Fail" RESULT=FAIL fi echo ## ## sendmail (actually postfix) ## echo "Checking sendmail ..." echo ## get pid of "master" # note that i'm not familiar with postfix # it seems that "master" is the deamon that takes send requests printf " * Get pid of postfix/master: " pid_master=`$PS -o comm,pid | grep '^master' | grep -v grep | awk '{print $2}'` if [ -n "$pid_master" ] ; then echo "OK ($pid_master)" else echo "Fail" RESULT=FAIL fi # send HELO and QUIT commands to the smtp server printf " * helo&quit test: " $base/syschk.smtp.exp > /dev/null 2>&1 if [ $? -eq 0 ] ; then echo "OK" else echo "Fail" RESULT=FAIL fi echo ## ## logfile cycling ## echo "Check http access log cycling ..." echo ## get path printf " * current access log is active: " # last log line a=`cat $HTTPD_ACCESS_LOG | grep www.language-archives.org | tail -1` #a=`tail $HTTPD_ACCESS_LOG | grep www.language-archives.org | grep '/tools/search/' | grep -m 1 'query=' | tail -1` #a=`tail -1 $HTTPD_ACCESS_LOG` # date b=`echo $a | awk '{print $5,$6}'` echo "_OLACSEARCH_LAST_ACCESS='$b'" >>$dat if [ -z "$b" -o "$b" = "$_OLACSEARCH_LAST_ACCESS" ] ; then _OLACSEARCH_MATCH_COUNT=`expr $_OLACSEARCH_MATCH_COUNT + 1` else _OLACSEARCH_MATCH_COUNT=0 fi if [ $_OLACSEARCH_MATCH_COUNT -lt 24 ] ; then echo "OK" else echo "Fail" RESULT=FAIL fi echo "_OLACSEARCH_MATCH_COUNT=$_OLACSEARCH_MATCH_COUNT" >>$dat echo ## ## search/report alive? ## echo "Checking OLAC Search/Report ... " echo URL_SEARCH="http://www.language-archives.org/tools/search/?query=hindi&archive=&page=1&webLangID=ENG" URL_REPORT="http://www.language-archives.org/tools/reports/?archive=41" printf " * Query OLAC Search: " # fetch header only line=`curl -sI "$URL_SEARCH" | head -1` if [ -n "$line" ] ; then ret=`echo $line | awk '{print $2}'` if [ "$ret" = "200" ] ; then echo "OK" else echo "Fail" RESULT=FAIL fi else echo "Fail" RESULT=FAIL fi printf " * Query OLAC Report: " # fetch header only line=`curl -sI "$URL_REPORT" | head -1` if [ -n "$line" ] ; then ret=`echo $line | awk '{print $2}'` if [ "$ret" = "200" ] ; then echo "OK" else echo "Fail" RESULT=FAIL fi else echo "Fail" RESULT=FAIL fi echo ## ## xsv run ## echo "Checking XSV & XALAN ..." echo printf " * Running /pkg/ldc/wwwhome/olac/bin/xsv_html: " /pkg/ldc/wwwhome/olac/bin/xsv_html /web/language-archives/OLAC/1.0/static-repository.xml > $tmp 2> /dev/null if [ -z "`diff $tmp $dat_xsv_html`" ] ; then echo "OK - got expected result" else echo "Fail - unexpected output" RESULT=FAIL fi rm -f $tmp echo " (for this to be successful, xsv and xalan should work correctly)" echo ## ## xercesj run ## echo "Checking Xerces-J ..." echo printf " * Running /pkg/ldc/wwwhome/olac/bin/xercesj.syschk: " /pkg/ldc/wwwhome/olac/bin/xercesj.syschk /web/language-archives/OLAC/1.0/static-repository.xml 2>&1 | sed -E 's/[0-9]+ ms//' > $tmp if [ -z "`diff $tmp $dat_xercesj`" ] ; then echo "OK - got expected result" else echo "Fail - unexpected result" RESULT=FAIL fi rm -f $tmp echo ## ## disk space ## echo "Checking disk space ..." echo printf " * Have enought space? " n=`df -k /web/language-archives | tail -1 | awk '{print $4}'` if [ "$n" -ge 200000 ] ; then echo "OK - $n 1K-blocks available" else echo "Fail - only $n 1K-blocks remaining" RESULT=FAIL fi echo ## ## symlinks ## echo "Checking symbolic links ..." echo find $webroot -type l -exec ls -l \{} \; > $tmp 2> /dev/null cat $tmp | $base/syschk.symlinks.py | while read a ; do echo " $a" done | tee $tmp.2 echo if [ -s $tmp.2 ] ; then echo " Fail" RESULT=FAIL else echo " OK" fi rm -f $tmp $tmp.2 echo ## ## file permissions ## echo "Checking file/directory permissions ..." echo dir=/web/language-archives/tools/search/logs/ printf " * $dir " if [ -r "$dir" -a -w "$dir" ] ; then echo "is read-/writable - OK" else echo "is not read-/writable - Fail" fi echo ## ## md5 checksum ## echo "Checking md5 checksum ..." echo for var in `set | grep '^CHKSUM_' | sed 's/=.*//' | sort` ; do path=`eval 'echo $'$var` printf " * %20s: %s" `echo $var | sed s'/[^_]*._//'` $path md5old=`eval 'echo $MD5_'$var` md5val=`md5 $path | awk '{print $NF}'` if [ "$md5old" = "$md5val" ] ; then echo " OK" else echo " <font color=red>Fail</font>" RESULT=FAIL fi #echo "MD5_$var=\"$md5val\"" >>$dat #echo "MD5_$var=\"$md5old\"" >>$dat done for var in `set | grep '^CHKSUM2_' | sed 's/=.*//' | sort` ; do path=`eval 'echo $'$var` printf " * %20s: %s" `echo $var | sed s'/[^_]*._//'` $path md5old=`eval 'echo $MD5_'$var` md5val=`curl -s "$path" | md5` if [ "$md5old" = "$md5val" ] ; then echo " OK" else echo " <font color=red>Fail</font>" RESULT=FAIL fi #echo "MD5_$var=\"$md5val\"" >>$dat #echo "MD5_$var=\"$md5old\"" >>$dat done echo ## ## return ## if [ "$RESULT" = FAIL ] ; then echo "Test failed" exit 1 else echo "Test succeeded" exit 0 fi
true
f2efa37ffd685eccf00e6811d7ecab1858ac67e4
Shell
petronny/aur3-mirror
/xkas/PKGBUILD
UTF-8
908
2.9375
3
[]
no_license
# This is an example PKGBUILD file. Use this as a start to creating your own, # and remove these comments. For more information, see 'man PKGBUILD'. # NOTE: Please fill out the license field for your package! If it is unknown, # then please put 'unknown'. # Maintainer: Your Name <youremail@domain.com> pkgname=xkas pkgver=14 pkgrel=1 pkgdesc="A multi-target cross assembler" arch=(i686 x86_64) url="http://byuu.org/programming/" license=(custom) depends=(gcc-libs) makedepends=() optdepends=() source=("http://byuu.org/files/${pkgname}_v$pkgver.tar.bz2") md5sums=('4bcb467a4955240b2cdd96021781a74b') build() { cd "$srcdir/$pkgname" sed -i -e '/^clear\|^strip/d' cc.sh ./cc.sh } package() { cd "$srcdir/$pkgname" install -d "$pkgdir/usr/share/licenses/xkas" sed -n '2,5p' libxkas/libxkas.hpp > "$pkgdir/usr/share/licenses/xkas/LICENSE" install -Dm755 xkas "$pkgdir/usr/bin/xkas" } # vim:set ts=2 sw=2 et:
true
d7744239c230178ebc9bb451f6740fc53451c452
Shell
foobarjimmy/productionScripts
/bak/pinglive.sh
UTF-8
353
3.65625
4
[]
no_license
#! /bin/bash # written by jim.li@20160425 echo -e "This is a program used for ping hosts" sec1=192.168.1 for sec2 in {1..10} do ipaddr="${sec1}.${sec2}" ping -c 1 -w 1 "${ipaddr}" &> /dev/null && result=0 || result=1 if [ "${result}" == "0" ];then echo "Server ${ipaddr} is alive!" else echo -e "\033[1;31mServer ${ipaddr} is down!\033[0m" fi done
true
14e20ffdfbdfe4f868971bffc5afacdd809a7640
Shell
slspeek/fai-experiments
/das/install-golang.sh
UTF-8
351
2.953125
3
[]
no_license
#!/bin/bash VERSION=1.4.2 ARCH=386 if test $(uname -m) = x86_64 ; then ARCH=amd64 fi cd /var/tmp wget -c https://storage.googleapis.com/golang/go${VERSION}.linux-${ARCH}.tar.gz cd /usr/local/ tar xvzf /var/tmp/go${VERSION}.linux-${ARCH}.tar.gz cd /usr/local/bin ln -s /usr/local/go/bin/go ln -s /usr/local/go/bin/gofmt ln -s /usr/local/go/bin/godoc
true
d765ccebf65d814fd6d4843c2ee54bbd60e26ec9
Shell
AtomToast/dotfiles
/.local/bin/scripts/killactive
UTF-8
118
2.625
3
[]
no_license
#!/bin/sh windowFocus=$(xdotool getwindowfocus) pid=$(xprop -id $windowFocus | grep PID | cut -d' ' -f3) kill -9 $pid
true
b38c240496b17302b36143cbf12453c550868282
Shell
charkost/irc-bot
/scripts/mpd_random.sh
UTF-8
209
2.578125
3
[ "MIT" ]
permissive
#!/usr/bin/env bash RANDOM_ON=~/.mpd_random mpc add "" && mpc -q random on && mpc -q play QUEUESIZE=`mpc playlist | wc -l` echo "$QUEUESIZE songs queued @ http://foss.tesyd.teimes.gr:8000/" touch $RANDOM_ON
true
dadf2d74844233f206781bbac47f487832f6034f
Shell
mrfireboy/cf
/ptran
UTF-8
330
3.375
3
[]
no_license
#!/bin/bash # if [ -z "$1" -o -z "$2" ];then exit fi # for in mysql environment if [ "$1" = 'inmysql' ]; then echo "$2" | sed -r -e "s/'/''/g" -e 's/\\/\\\\/g' exit fi # for sed replacement environment if [ "$1" = 'sed' ]; then echo "$2" | sed -r -e 's/\\/\\\\/g' -e "s/\//\\\\\//g" -e 's/\&/\\\&/g' exit fi
true
2e770e72ff56dcce3f427576221ef5cc647c672b
Shell
daiab/Train-To-Last
/utils/gen_lst/extract_file.sh
UTF-8
317
3.234375
3
[]
no_license
#!/usr/bin/env bash root=`pwd` echo "extract path: $root/data_extracted" mkdir -p ./data_extracted for file in `ls`; do find -name "*.rar" | xargs -i rar e {} ./data_extracted find -name "*.zip" | xargs -i unzip {} -d ./data_extracted find -name "*.tar.gz" | xargs -i tar -xzf {} -C ./data_extracted done
true
97b0d0fb07dcb235e8b91f235c730ea3ab5047bb
Shell
IgnasiLucas/Brachionus
/results/2019-07-10/README.sh
UTF-8
4,476
3.578125
4
[]
no_license
#!/bin/bash # # 2019-07-10 # ========== # # Once the genes and transcripts differentially expressed between selective # regimes are identified (2019-04-03), I need to run the functional analysis. # Genes in the B. plicatilis genome do not seem to have any functional annotation. # I believe that Eva used Blast2GO, but I'd like to try something else. I note # that the complete set of transcripts, including those discovered along this # project, are in 2019-03-29/z1.gtf. This file does not have CDS information, but # it includes all the genes and transcripts used in the differential gene expression # analysis, properly identified with the names given by cuffmerge. # # The cleanest way to run the functional analysis is to start from a fasta file # with all transcripts. While bedtools allows to extract sequences from gff files, # it does not join exons from the same transcript together (unless using a BED 12 # file). I have looked for "gff2fasta.py" scripts, and I learned about cgat scripts, # which can be installed with conda. They are not compatible with the current # environment. Thus, to run this folder you need to activate the cgat environment, # which is saved here as env-cgat.yaml, or spec-file.txt. GFF="../2019-03-29/z1.gtf" REF="../../data/reference.fa" DATADIR="../../data/2019-07-10" # gff2fasta outputs a header in the fasta file, which I want to re-direct to a log file. # It can also include transcript attributes found in the gtf file in the name of the # sequences in the fasta file. I want to process the output of gff2fasta in two different # and simultaneous ways: redirect the header to a log, and remove unnecessary attributes # from the names. I learned that I can do this with a named pipe and the tee command. if [ ! -e transcripts.fa ]; then mkfifo pipe # Here, I make grep read the pipe in the background, before the pipe carries anything. cat pipe | grep "^#" > transcripts.log & # Now, I send the output of gff2fasta both to the pipe and to the other grep command. cgat gff2fasta --genome-file $REF \ --merge-adjacent \ --is-gtf \ --header-attributes < $GFF | \ tee pipe | \ # I expect only the name lines of the fasta file to have spaces, and I expect the # first and the forth fields to be transcript and gene ids, respectively. grep -v "^#" | cut -d " " -f 1,4 > transcripts.fa rm pipe fi # I use TransDecoder to identify the CDS within the transcripts. if [ ! -e transdecoder/longest_orfs.pep ]; then TransDecoder.LongOrfs -t transcripts.fa -S -O transdecoder fi # Following TransDecoder's recommendations, I use blastp and pfam searches to identify the # most promising proteins. if [ ! -d $DATADIR ]; then mkdir $DATADIR; fi if [ ! -e transcripts.fa.transdecoder.pep ]; then if [ ! -e blastp.outfmt6 ]; then if [ ! -e $DATADIR/swissprot.00.phr ]; then update_blastdb.pl --decompress swissprot mv swissprot* $DATADIR/ mv taxdb* $DATADIR/ fi blastp -query transdecoder/longest_orfs.pep -db $DATADIR/swissprot -max_target_seqs 1 -outfmt 6 -evalue 1e-5 -num_threads 10 > blastp.outfmt6 fi if [ ! -e pfam.domtblout ]; then if [ ! -e $DATADIR/Pfam-A.hmm.h3f ]; then if [ ! -e Pfam-A.hmm ]; then wget ftp://ftp.ebi.ac.uk/pub/databases/Pfam/current_release/Pfam-A.hmm.gz gunzip Pfam-A.hmm.gz fi hmmpress Pfam-A.hmm mv Pfam* $DATADIR/ fi # hmmscan searches protein sequences against an (indexed) HMM database. hmmscan --cpu 50 --domtblout pfam.domtblout --noali $DATADIR/Pfam-A.hmm transdecoder/longest_orfs.pep > pfam.log fi TransDecoder.Predict -t transcripts.fa --retain_pfam_hits pfam.domtblout --retain_blastp_hits blastp.outfmt6 -O transdecoder --single_best_only fi #rm -r transdecoder #rm -r transdecoder.__checkpoints # There is a lot of rubbish generated. The main result here is the transcripts.fa.transdecoder.pep file, # which is a fasta file with the selected proteins that have blastp and/or pfam hits. Their names now # include information about those hits. The main identifier is the transcript_id. The gene_id is not # included in the name, but can easily be tracked from the 2019-03-29/z1.gtf file. # # In all, there are 49663 proteins, from 49663 transcripts. At this point, I abandon the cgat environment # and the present folder to run interproscan in the next one.
true
2d68a938b2025c4a6c2f91cbc788b4747baaa19d
Shell
vektor330/malacky
/utils/utils.sh
UTF-8
1,249
4.21875
4
[]
no_license
# Takes 2 arguments, environment name and "property key". # Returns the value of the property of that environment, from environments.conf. function getparam { # TODO DIR needs to be set as argument too! local _ENV="${1}" local _KEY="${2}" # TODO this grep has SERIOUS problems with prefix-ness! # should probably be grep "^${_ENV}\.${_KEY}$" cat "${DIR}/conf/environments.conf" | grep "${_ENV}.${_KEY}" | cut -d "=" -f 2 | tr -d "[[:space:]]" } # The same as echo, but writes on the standard error. function echoerr { echo "${@}" 1>&2 } # Takes 1 argument, file name. # Removes the BOM (byte order marker) from the specified file. function remove_bom { local _FILE="${1}" if [[ "$(file "${_FILE}")" == *UTF-8\ Unicode\ \(with\ BOM\)* ]] then echoerr "Removing UTF-8 BOM for ${_FILE}" tail -c +4 "${_FILE}" > "/tmp/killbom" || { echoerr "Failed to tail to /tmp/killbom"; exit 1; } mv "/tmp/killbom" "${_FILE}" fi } # Checks if the argument is a valid environment name, as described in the # environment config file. function is_environment { local _ENV="${1}" # TODO DIR needs to be a parameter, too cat "${DIR}/conf/environments.conf" | grep -v "#" | cut -d "." -f 1 | sort | uniq | grep "." | grep -q "${_ENV}" echo ${?} }
true
d9d20b0dd81302e364d0a4657384c1f0765c1776
Shell
danitfk/elkarbackup-docker
/elkarbackup/1.2/entrypoint.sh
UTF-8
4,821
3.765625
4
[]
no_license
#! /bin/bash dbadminusername=${EB_DB_USER:=root} dbadminpassword=${EB_DB_PASSWORD:=$MYSQL_ROOT_PASSWORD} dbhost=${EB_DB_HOST:=db} dbname=${EB_DB_NAME:=elkarbackup} dbusername=${EB_DB_USERNAME:=elkarbackup} dbuserpassword=${EB_DB_USERPASSWORD:=elkarbackup} # DB password empty? if [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ ! -n "${EB_DB_PASSWORD}" ] ;then echo >&2 'error: unknown database root password' echo >&2 ' You need to specify MYSQL_ROOT_PASSWORD or EB_DB_PASSWORD' exit 1 fi # Check database connection until mysqladmin ping -h "${EB_DB_HOST:=db}" --silent; do >&2 echo "MySQL is unavailable - sleeping" sleep 1 done # Check database configuration. Create DB if it does not exist. if ! mysql -u"$dbusername" -p"$dbuserpassword" -h"$dbhost" "$dbname" </dev/null &>/dev/null then echo "Attempting to create DB $dbname and user $dbusername in $dbhost" echo 'Create database' echo "CREATE DATABASE IF NOT EXISTS \`$dbname\` DEFAULT CHARACTER SET utf8;" | mysql -u"$dbadminusername" -p"$dbadminpassword" -h"$dbhost" echo 'Create user' if [ "$dbhost" = localhost ] then user="'$dbusername'@localhost" else user="'$dbusername'" fi echo "GRANT ALL ON \`$dbname\`.* TO $user IDENTIFIED BY '$dbuserpassword';" | mysql -u"$dbadminusername" -p"$dbadminpassword" -h"$dbhost" || true else echo DB seems to be ready fi # Allow www-data and elkarbackup user to write to /dev/stderr if [ ! -f /tmp/logpipe ]; then mkfifo -m 600 /tmp/logpipe fi chown www-data:www-data /tmp/logpipe setfacl -m u:www-data:rwx -m u:elkarbackup:rwx /tmp/logpipe cat <> /tmp/logpipe 1>&2 & # Log to stdout sed -i 's/%kernel.logs_dir%\/BnvLog.log/\/tmp\/logpipe/g' /etc/elkarbackup/config.yml sed -i 's/${APACHE_LOG_DIR}\/elkarbackup-ssl.access.log/\/proc\/self\/fd\/1/g' /etc/apache2/sites-available/elkarbackup-ssl.conf /etc/apache2/sites-available/elkarbackup.conf sed -i 's/${APACHE_LOG_DIR}\/elkarbackup.error.log/\/proc\/self\/fd\/2/g' /etc/apache2/sites-available/elkarbackup-ssl.conf /etc/apache2/sites-available/elkarbackup.conf # Configure parameters echo 'Configure parameters' sed -i "s#database_host:.*#database_host: $dbhost#" /etc/elkarbackup/parameters.yml sed -i "s#database_name:.*#database_name: $dbname#" /etc/elkarbackup/parameters.yml sed -i "s#database_user:.*#database_user: $dbusername#" /etc/elkarbackup/parameters.yml sed -i "s#database_password:.*#database_password: $dbuserpassword#" /etc/elkarbackup/parameters.yml # Migrate and delete cache content echo Delete cache content rm -fR /var/cache/elkarbackup/* echo Update DB php /usr/share/elkarbackup/app/console doctrine:migrations:migrate --no-interaction >/dev/null || true echo Create root user php /usr/share/elkarbackup/app/console elkarbackup:create_admin >/dev/null || true echo Clean cache php /usr/share/elkarbackup/app/console cache:clear >/dev/null || true echo Dump assets php /usr/share/elkarbackup/app/console assetic:dump >/dev/null || true echo Invalidate sessions rm -rf /var/lib/elkarbackup/sessions/* # set rwx permissions for www-data and the backup user in the cache and log directories # as described in http://symfony.com/doc/current/book/installation.html#configuration-and-setup echo Changing file permissions username="elkarbackup" setfacl -R -m u:www-data:rwx -m u:$username:rwx /var/cache/elkarbackup 2>/dev/null || ( echo "ACLs not supported. Remount with ACL and reconfigure with 'dpkg --configure --pending'" && false ) setfacl -dR -m u:www-data:rwx -m u:$username:rwx /var/cache/elkarbackup setfacl -R -m u:www-data:rwx -m u:$username:rwx /var/log/elkarbackup setfacl -dR -m u:www-data:rwx -m u:$username:rwx /var/log/elkarbackup chown -R $username.$username /var/cache/elkarbackup /var/log/elkarbackup /var/spool/elkarbackup chown -R www-data.www-data /var/lib/elkarbackup/sessions /etc/elkarbackup/parameters.yml /var/spool/elkarbackup/uploads uploadsdir="/var/spool/elkarbackup/uploads" olduploadsdir=`cat /etc/elkarbackup/parameters.yml|grep upload_dir|sed 's/.*: *//'` mkdir -p "$uploadsdir" || true if [ ! "$olduploadsdir" == "$uploadsdir" ]; then mv "$olduploadsdir"/* "$uploadsdir" || true fi chown -R www-data.www-data "$uploadsdir" sed -i "s#upload_dir:.*#upload_dir: $uploadsdir#" /etc/elkarbackup/parameters.yml sed -i -e "s#elkarbackupuser#$username#g" -e "s#\s*Cmnd_Alias\s*ELKARBACKUP_SCRIPTS.*#Cmnd_Alias ELKARBACKUP_SCRIPTS=$uploadsdir/*#" /etc/sudoers.d/elkarbackup chmod 0440 /etc/sudoers.d/elkarbackup # Delete apache pid file (https://github.com/docker-library/php/issues/53) if [ -f /run/apache2/apache2.pid ]; then rm -f /run/apache2/apache2.pid fi if [ "$DISABLE_CRON" == "true" ]; then /usr/sbin/apache2ctl -D FOREGROUND else /usr/sbin/cron && /usr/sbin/apache2ctl -D FOREGROUND fi
true
ee169577dc86d93d5902d0b4bde99b1079f570f6
Shell
rff/cfgbin
/bin/betterterm.sh
UTF-8
631
3.4375
3
[ "Unlicense" ]
permissive
#!/bin/sh # # source: http://rcr.io/words/dynamic-xterm-colors.html # reddit: http://www.reddit.com/r/commandline/comments/2ds233/xterm_party/ A=0 F="0.1" CODE=10 case ${1:-'fg'} in 'bg' ) CODE=11 ;; 'cu' ) CODE=12 ;; 'mo' ) CODE=13 ;; 'fg' ) CODE=10 ;; * ) echo "Invalid option '$1'." exit 1 ;; esac while true; do test $A -eq 628318 && A=0 || A=$((A + 1)) R=$(echo "s ($F*$A + 0)*127 + 128" | bc -l | cut -d'.' -f1) B=$(echo "s ($F*$A + 2)*127 + 128" | bc -l | cut -d'.' -f1) G=$(echo "s ($F*$A + 4)*127 + 128" | bc -l | cut -d'.' -f1) printf "\033]%d;#%02x%02x%02x\007" ${CODE} $R $B $G sleep 0.01 done
true
ff828ca64926233685dee98b8da585930c86451a
Shell
JOravetz/Depth_Conversion
/wrapper.process.deviation.sh
UTF-8
261
3.15625
3
[]
no_license
#! /bin/bash ### wrapper script to loop over each deviation survey - stored in deviations.lis ### ls -alt *deviation_survey_from_Program.dat | awk '{print $9}' > deviations.lis while read -r LINE ; do process.deviation.sh -s ${LINE} done < deviations.lis
true
81db0a12c55cb96bba1387fa2624d5eeaa115366
Shell
dcosson/dotfiles
/misc/git-find-pr
UTF-8
926
3.96875
4
[]
no_license
#!/bin/bash # Find the PR that merged the given SHA into master, and open it in the browser. # From http://genius.com/Andrew-warner-git-getpull-quickly-find-the-pull-request-that-merged-your-commit-to-master-annotated if [ -z $1 ]; then echo "Usage: git getpull <SHA>" 1>&2 elif [ -z "$(git rev-parse --git-dir 2>/dev/null)" ]; then echo "Not in a git directory" 1>&2 else repository_path=$(git config --get remote.origin.url 2>/dev/null | \ perl -lne 'print $1 if /(?:(?:https?:\/\/github.com\/)|:)(.*?).git/') pull_base_url=https://github.com/$repository_path/pull pull_id=$(git log $1..origin/master --ancestry-path --merges --oneline 2>/dev/null \ | perl -nle 'print $1 if /#(\d+)/' | tail -n 1) if [ -n "$pull_id" ]; then echo "$pull_base_url/$pull_id" | xargs open else echo "Sorry, couldn't find that pull" 1>&2 fi fi
true
ca7acafbf0fa1ae375b90004d9530aa1f724cc41
Shell
wdekkers/vagrant_php7_mysql_box
/etc/scripts/bootstrap.sh
UTF-8
1,147
3.109375
3
[]
no_license
# Install SQL Client yum install -y httpd mysql-server mysql-client rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm # Install PHP 7 yum install -y --enablerepo=webtatic-testing php70w php70w-opcache # Change php conf to start php7 instead php5 sed -i 's/php5/php7/g' /etc/httpd/conf.d/php.conf # Setup virtual hosts echo " <VirtualHost *:80> DocumentRoot "/vagrant/websites/yoursite.local" <Directory "/vagrant/websites/yoursite.local"> Allow From All AllowOverride All </Directory> ErrorLog /vagrant/var/logs/yoursite </VirtualHost> " > /etc/httpd/conf.d/my-websites.conf # Bind address to make MySQL available grep -q -F 'bind-address = 127.0.0.1' /etc/my.cnf || printf '\n\nbind-address = 127.0.0.1\n' >> /etc/my.cnf # Enable services chkconfig mysqld on chkconfig httpd on # Start / Stop services service mysqld start service httpd start service iptables stop # Create database with user root and no password mysql -u root -e "create database database_name; create user 'root'@'%' identified by ''; grant all privileges on *.* to 'root'@'%' with grant option; flush privileges; "
true
d1546d354b2fd1720f7821104d4ede981d951f90
Shell
ali4006/spot
/spot/pfs-example/command-line-script.sh
UTF-8
2,508
4.15625
4
[ "MIT" ]
permissive
#!/bin/bash function die { # die $DIR Error message local DIR=$1 shift local D=`date` echo "[ ERROR ] [ $D ] $*" exit 1 } INITDIR=$PWD if [ $# -lt 2 ]; then die ${INITDIR} "Needs 2 arguments and an optional flag. If you keep -r flag as an input, then the reprozip trace process is triggered . Usage: $0 [-r] <subject_folder> <name>" fi REPROZIP_FLAG=false #If reprozip flag is set if [ $# -eq 3 ]; then if [ $1 = "-r" ]; then REPROZIP_FLAG=true SUBJECT_FOLDER=$2 NAME=$3 fi else SUBJECT_FOLDER=$1 NAME=$2 fi EXECUTION_DIR=exec #To maintain the same subject folder name while processing we are taking only the subject folder name SUBJECT_FOLDER_ID="$(echo "$1" | awk -F"-" '{print $1}')" BEFORE_FILE=${EXECUTION_DIR}/${SUBJECT_FOLDER_ID}/checksums-before.txt AFTER_FILE=${EXECUTION_DIR}/${SUBJECT_FOLDER_ID}/checksums-after.txt create-execution-dir.sh ${SUBJECT_FOLDER} ${SUBJECT_FOLDER_ID} ${EXECUTION_DIR} || die ${INITDIR} "Cannot create execution directory." #checksums.sh ${EXECUTION_DIR}/${SUBJECT_FOLDER_ID} > ${BEFORE_FILE} || die ${INITDIR} "Checksum script failed." monitor.sh &> ${EXECUTION_DIR}/${SUBJECT_FOLDER_ID}/monitor.txt || die ${INITDIR} "Monitoring script failed." cd ${EXECUTION_DIR} || die ${INITDIR} "Cannot cd to ${EXECUTION_DIR}." #Adding the reprozip command to trace the processing of subjects if [ ${REPROZIP_FLAG} = true ]; then reprozip trace PreFreeSurferPipelineBatch.sh --StudyFolder=$PWD --Subjlist=${SUBJECT_FOLDER_ID} --runlocal || die ${INITDIR} "Pipeline failed." else PreFreeSurferPipelineBatch.sh --StudyFolder=$PWD --Subjlist=${SUBJECT_FOLDER_ID} --runlocal || die ${INITDIR} "Pipeline failed." fi cd ${INITDIR} || die ${INITDIR} "cd .. failed." #checksums.sh ${EXECUTION_DIR}/${SUBJECT_FOLDER_ID} > ${AFTER_FILE} || die ${INITDIR} "Checksum script failed." #Copying the .reprozip-trace folder in execution directory to the subject folder. if [ ${REPROZIP_FLAG} = true ]; then cp -r ${EXECUTION_DIR}/.reprozip-trace ${EXECUTION_DIR}/${SUBJECT_FOLDER_ID} fi ln -s ${EXECUTION_DIR}/${SUBJECT_FOLDER_ID} ${SUBJECT_FOLDER}-${NAME} || die ${INITDIR} "Cannot link results."
true
7b9644cc94d8b75c7ef8717da089b3f0352ab001
Shell
zv/metamage_1
/lamp/:/sbin/about
UTF-8
994
2.515625
3
[]
no_license
#!/bin/sh export APPLET=about /usr/bin/touch /app/$APPLET/window/select 2> /dev/null && exit || /bin/true rm /app/$APPLET 2> /dev/null iconid=128 cd -P /gui/new/port echo 0 > vis echo 220,68 > size echo About MacRelix > title echo > procid 4 /usr/bin/touch window echo 0 > window/text-font /bin/ln /gui/new/stack view /bin/ln /gui/new/frame view/icon echo 32 > view/icon/width echo 32 > view/icon/height echo 13 > view/icon/.margin-top echo 23 > view/icon/.margin-left echo 23 > view/icon/.margin-right /bin/ln /gui/new/icon view/icon/v echo $iconid > view/icon/v/data /bin/ln /gui/new/frame view/main echo 13 > view/main/.margin-top echo 13 > view/main/.margin-right echo 78 > view/main/.margin-left /bin/ln /gui/new/caption view/main/v echo >> view/main/v/text "MacRelix" echo >> view/main/v/text "by Joshua Juran" echo 1 > view/icon/v/disabling echo 1 > view/main/v/disabling /usr/bin/daemonize --cwd --ctty=tty -- /usr/bin/idle echo 1 > vis /bin/ln -s $PWD /app/$APPLET
true
e154385a48880ad8ebc54843dc8df98fe5af70eb
Shell
HugoWang3146/spring-demo-gradle-k8s
/scripts/start_spring_boot_demo_in_docker.sh
UTF-8
288
2.546875
3
[]
no_license
#!/usr/bin/env bash set -eux LOG_PATH='/var/log/spring-boot-demo' docker rm -f spring-boot-demo || true docker run \ -d \ -p 8080:8080 \ --name spring-boot-demo \ --mount type=bind,source=${LOG_PATH},target=${LOG_PATH} \ docker-registry.local:5000/spring-boot-demo
true
d6576eacf942ad130153c76ae35075be8973e494
Shell
joeytwiddle/jsh
/code/shellscript/unixext/mkdirandmv.sh
UTF-8
79
2.671875
3
[]
no_license
#!/bin/sh TARGET_FOLDER=`lastarg "$@"` mkdir -p "$TARGET_FOLDER" && mv "$@"
true
48d68abae675994fa96246843b02ce48c420dd9d
Shell
grohiro/dotfiles
/bin/issvn
UTF-8
427
3.609375
4
[]
no_license
#!/bin/bash # # This script returns string 'svn' when you are in a SVN working tree. # カレントディレクトリがSVNのワーキングコピーの場合に文字列 "svn" を返す. # shell のプロンプト(PS1)とかで使う. # example: PS1="\w\$(issvn @)$ " # ~/path/to/svn@svn$ # SVN=/usr/bin/svn if [ $($SVN info > /dev/null 2>&1; echo $?) == 0 ] then if [ $# -gt 0 ] then echo -n $1 fi echo "svn" fi
true
11d6ec467714b74e0460683db00028e535d351f9
Shell
IanXTs/COMP206
/MakeProject.sh
UTF-8
461
2.9375
3
[]
no_license
#bin/sh #Ian Tsai MiniAssignment 2 260741766 cd ~ if [ ! -d project ] then mkdir project fi cd ./project/ if [ ! -d cs206 ] then mkdir cs206 fi cd ./cs206/ if [ -d $1 ] then echo "This project name has already been used" exit 1 else mkdir $1 archive backup docs assets database source fi cd ./source "#!bin/sh cp 'ls | grep -i "\.[ch]$"' ../backup echo "You project directories have been created." > backup.sh chmod 755 backup.sh
true
d2fd8ba2ffe00d28aeb6a2f7a2c061f53eebde8a
Shell
Richesee/RDB
/TERMUX-TOOLS-RDB.sh
UTF-8
2,024
2.890625
3
[]
no_license
#!/bin/sh #Code Warna clear r="\033[1;31m" # merah g="\033[1;32m" # hijau y="\033[1;33m" # kuning b="\033[1;34m" # biru p="\033[1;35m" # ungu cy="\033[1;36m" # biru muda w="\033[1;37m" # putih #Banner1 clear echo $g"######## ######## ######## ## ## ## ## ## ## ## ## ## ## ## ## ######## ## ## ######## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ######## ######## " echo $r sleep 2 echo "====}Please Waiting{====" sleep 3 echo "Tools Proses" sleep 1 echo "DONE" clear #Banner2 echo $r"▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬" echo echo $g "AUTHOR"$w":"$r"RDB"$w"[King]" echo $g "GITHUB"$w":"$r"https://github.com/"$w"[Richesee]" echo $g "TEAM" $w" :"$r"User Termux Beginners" $w"[U T B I]" echo echo $r"▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬" #Title1 echo $y sleep 3 echo $r echo "[WARNING]"$b"DIWAJIBKAN INSTALL BAHAN BIAR GK EROR"$p echo "╔════════════════════╗ [1] INSTALL BAHAN ╚════════════════════╝" echo $y echo "╔════════════════════╗ [2] MASUK TOOLS ╚════════════════════╝" echo $cy echo "╔════════════════════╗ [3] Keluar (EXIT) ╚════════════════════╝" #Variabel1 echo $w read -p "Pilih Mana : " pil #If/elif/else #Data1 if [ $pil = "1" ]; then echo $HOME cd cdm sh bahan.sh #Data2 elif [ $pil = "2" ]; then echo $HOME apt update && apt upgrade pkg install bash -y pkg install git -y pkg install curl -y pkg install figlet -y cd cdm sh tls.sh #Data3 elif [ $pil = "3" ] then #warna echo $b clear echo "Thaks You Telah Menggunakan Tools Ini" sleep 1 exit fi
true
70288595808cd5fb5d14a4489dd1896c8301e9dc
Shell
chuanran/terraform_vsphere_provisioner
/files/customization.dd.sh.template
UTF-8
8,651
3.4375
3
[]
no_license
#!/bin/bash #This script is used to leverage TFD to customise configurations on fci Due Diligence fci_install_kit_dir="/root/fci-install-kit" fcdd_install_kit_dir="/root/fcdd-install-kit" km_hosts_prop_template_file="${fci_install_kit_dir}/helm/install.hosts.properties.template" custom_nfs_fcdd_file="${fcdd_install_kit_dir}/helm/CustomNFS-fcdd.yaml" #step 1. For Due Diligence, do the corresponding customization on helm config and properties file #step 1.1 For Due Diligence, copy generated install.hosts.properties to the corresponding dd folder km_fcdd_hosts_prop_file="${fcdd_install_kit_dir}/helm/install.hosts.properties" if [ -f "$km_fcdd_hosts_prop_file" ]; then if [ ! -s "$km_hosts_prop_template_file" ]; then echo "Attention!!! km template hosts prop file $km_hosts_prop_template_file failed to be copied to the vm. You may need to manually get it and put it on the vm" else cp $km_fcdd_hosts_prop_file "${km_fcdd_hosts_prop_file}.bak" sed -i '/^[[:space:]]*$/d' $km_hosts_prop_template_file cp $km_hosts_prop_template_file $km_fcdd_hosts_prop_file fi else echo "This is not km server, or $km_fcdd_hosts_prop_file does NOT exist. skipping fcdd hosts prop file generation" fi #step 1.2 on km, for ${fcdd_install_kit_dir}/helm/install.properties, change external.docker.registry.url to the km hostname km_fcdd_install_prop_file="${fcdd_install_kit_dir}/helm/install.properties" if [ -s "$km_fcdd_install_prop_file" ]; then orig_vm_type=$(echo "{vsphere_vm_hostname}" | awk -F "." '{print $1}' | awk -F "-" '{print $5}') km_hostname=$(echo "{vsphere_vm_hostname}" | sed "s/-$orig_vm_type/-km/") nfs2_hostname=$(echo "{vsphere_vm_hostname}" | sed "s/-$orig_vm_type/-nfs2/") grep -Eq "^external.docker.registry.url =" $km_fcdd_install_prop_file if [ $? -eq 0 ]; then old_km_hostname=$(grep -E "^external.docker.registry.url =" $km_fcdd_install_prop_file | awk -F "=" '{print $2}' | awk -F ":" '{print $1}' | awk '{print $1}') sed -i "s/$old_km_hostname/$km_hostname/g" $km_fcdd_install_prop_file else echo "external.docker.registry.url = ${km_hostname}:5000" >> $km_fcdd_install_prop_file fi grep -Eq "^external.nfsserver =" $km_fcdd_install_prop_file if [ $? -eq 0 ]; then old_nfs2_hostname=$(grep -E "^external.nfsserver =" $km_fcdd_install_prop_file | awk -F "=" '{print $2}' | awk '{print $1}') sed -i "s/$old_nfs2_hostname/$nfs2_hostname/g" $km_fcdd_install_prop_file else echo "external.nfsserver = ${nfs2_hostname}" >> $km_fcdd_install_prop_file fi grep -qE "^mount_point.1 = --path" $km_fcdd_install_prop_file if [ $? -eq 0 ]; then sed -i "/^mount_point.1 = --path/c mount_point.1 = --path /fcidd/fcdd-node-instance" $km_fcdd_install_prop_file else echo "mount_point.1 = --path /fcidd/fcdd-node-instance" >> $km_fcdd_install_prop_file fi grep -qE "^mount_point.2 = --path" $km_fcdd_install_prop_file if [ $? -eq 0 ]; then sed -i "/^mount_point.2 = --path/c mount_point.2 = --path /fcidd/fcdd-ml" $km_fcdd_install_prop_file else echo "mount_point.2 = --path /fcidd/fcdd-ml" >> $km_fcdd_install_prop_file fi grep -qE "^chart.args =" ${km_fcdd_install_prop_file} if [ $? -eq 0 ]; then sed -i '/^chart.args =/c\chart.args = -f fcdd-values.yaml -f CustomNFS-fcdd.yaml --set global.coreReleaseName=fci/' ${km_fcdd_install_prop_file} else echo "chart.args = -f fcdd-values.yaml -f CustomNFS-fcdd.yaml --set global.coreReleaseName=fci" >> ${km_fcdd_install_prop_file} fi fi #step 1.3 update datasource configuration in fcdd-values.yaml file helm_fcdd_values_file="${fcdd_install_kit_dir}/helm/fcdd-values.yaml" if [ -s "$helm_fcdd_values_file" ]; then #change DNB_USERNAME, DNB_PASSWORD to the correct value defined in custom.properties file grep "DNB_USERNAME:" $helm_fcdd_values_file | grep -qv "[[:space:]]#" if [ $? -eq 0 ]; then old_dnb_user_str=$(grep "DNB_USERNAME:" $helm_fcdd_values_file | grep -v "[[:space:]]#" | sed -e 's/^[ \t]*//') sed -i "s/$old_dnb_user_str/DNB_USERNAME: '{new_dnb_user}'/g" $helm_fcdd_values_file fi grep "DNB_PASSWORD:" $helm_fcdd_values_file | grep -qv "[[:space:]]#" if [ $? -eq 0 ]; then old_dnb_pwd_str=$(grep "DNB_PASSWORD:" $helm_fcdd_values_file | grep -v "[[:space:]]#" | sed -e 's/^[ \t]*//') sed -i "s/$old_dnb_pwd_str/DNB_PASSWORD: '{new_dnb_password}'/g" $helm_fcdd_values_file fi #change DOWJONES_USERNAME, DOWJONES_PASSWORD to the correct value defined in custom.properties file grep "DOWJONES_USERNAME:" $helm_fcdd_values_file | grep -qv "[[:space:]]#" if [ $? -eq 0 ]; then old_dj_user_str=$(grep "DOWJONES_USERNAME:" $helm_fcdd_values_file | grep -v "[[:space:]]#" | sed -e 's/^[ \t]*//') sed -i "s/$old_dj_user_str/DOWJONES_USERNAME: '{new_dj_user}'/g" $helm_fcdd_values_file fi grep "DOWJONES_PASSWORD:" $helm_fcdd_values_file | grep -qv "[[:space:]]#" if [ $? -eq 0 ]; then old_dj_pwd_str=$(grep "DOWJONES_PASSWORD:" $helm_fcdd_values_file | grep -v "[[:space:]]#" | sed -e 's/^[ \t]*//') sed -i "s/$old_dj_pwd_str/DOWJONES_PASSWORD: '{new_dj_password}'/g" $helm_fcdd_values_file fi #change KYCKR_USERNAME, KYCKR_PASSWORD to the correct value defined in custom.properties file grep "KYCKR_USERNAME:" $helm_fcdd_values_file | grep -qv "[[:space:]]#" if [ $? -eq 0 ]; then old_kyckr_user_str=$(grep "KYCKR_USERNAME:" $helm_fcdd_values_file | grep -v "[[:space:]]#" | sed -e 's/^[ \t]*//') sed -i "s/$old_kyckr_user_str/KYCKR_USERNAME: '{new_kyckr_user}'/g" $helm_fcdd_values_file fi grep "KYCKR_PASSWORD:" $helm_fcdd_values_file | grep -qv "[[:space:]]#" if [ $? -eq 0 ]; then old_kyckr_pwd_str=$(grep "KYCKR_PASSWORD:" $helm_fcdd_values_file | grep -v "[[:space:]]#" | sed -e 's/^[ \t]*//') sed -i "s/$old_kyckr_pwd_str/KYCKR_PASSWORD: '{new_kyckr_password}'/g" $helm_fcdd_values_file fi #change FACTIVA_EID, FACTIVA_NEWS_ENCRYTED_TOKEN_VALUE to the correct value defined in custom.properties file grep "FACTIVA_EID:" $helm_fcdd_values_file | grep -qv "[[:space:]]#" if [ $? -eq 0 ]; then old_factiva_eid_str=$(grep "FACTIVA_EID:" $helm_fcdd_values_file | grep -v "[[:space:]]#" | sed -e 's/^[ \t]*//') sed -i "s/$old_factiva_eid_str/FACTIVA_EID: '{new_factiva_eid}'/g" $helm_fcdd_values_file fi grep "FACTIVA_NEWS_ENCRYTED_TOKEN_VALUE:" $helm_fcdd_values_file | grep -qv "[[:space:]]#" if [ $? -eq 0 ]; then old_factiva_token_str=$(grep "FACTIVA_NEWS_ENCRYTED_TOKEN_VALUE:" $helm_fcdd_values_file | grep -v "[[:space:]]#" | sed -e 's/^[ \t]*//') sed -i "s/$old_factiva_token_str/FACTIVA_NEWS_ENCRYTED_TOKEN_VALUE: '{new_factiva_token}'/g" $helm_fcdd_values_file fi #change BING_NEWS_SUBSCRIPTION_KEY_V7, BING_WEB_SUBSCRIPTION_KEY_V7 to the correct value defined in custom.properties file grep "BING_NEWS_SUBSCRIPTION_KEY_V7:" $helm_fcdd_values_file | grep -qv "[[:space:]]#" if [ $? -eq 0 ]; then old_bing_news_key=$(grep "BING_NEWS_SUBSCRIPTION_KEY_V7:" $helm_fcdd_values_file | grep -v "[[:space:]]#" | sed -e 's/^[ \t]*//') sed -i "s/$old_bing_news_key/BING_NEWS_SUBSCRIPTION_KEY_V7: '{new_bing_news_key}'/g" $helm_fcdd_values_file fi grep "BING_WEB_SUBSCRIPTION_KEY_V7:" $helm_fcdd_values_file | grep -qv "[[:space:]]#" if [ $? -eq 0 ]; then old_bing_web_key=$(grep "BING_WEB_SUBSCRIPTION_KEY_V7:" $helm_fcdd_values_file | grep -v "[[:space:]]#" | sed -e 's/^[ \t]*//') sed -i "s/$old_bing_web_key/BING_WEB_SUBSCRIPTION_KEY_V7: '{new_bing_web_key}'/g" $helm_fcdd_values_file fi fi # step 1.4: Ensure the CustomNFS-fcdd.yaml exists with correct configuration echo "mlDataPvNfsPath: /fcidd/fcdd-ml" > ${custom_nfs_fcdd_file} echo "wexPvNfsPath: /fcidd/fcdd-wex" >> ${custom_nfs_fcdd_file} echo "nodejsPvNfsPath: /fcidd/fcdd-node-instance" >> ${custom_nfs_fcdd_file} echo "mongodbPvNfsPath: /fcidd/fcdd-mongo-data" >> ${custom_nfs_fcdd_file} echo "libertyPvNfsPath: /fcidd/fcdd-liberty-instance" >> ${custom_nfs_fcdd_file} #step 1.5 make sure .acceptLicenseInformation.lock and .acceptLicenseAgreement.lock are created to ignore license accepting if [ ! -f "${fcdd_install_kit_dir}/helm/.acceptLicenseInformation.lock" ]; then touch ${fcdd_install_kit_dir}/helm/.acceptLicenseInformation.lock fi if [ ! -f "${fcdd_install_kit_dir}/helm/.acceptLicenseAgreement.lock" ]; then touch ${fcdd_install_kit_dir}/helm/.acceptLicenseAgreement.lock fi
true
1939b479d2f9f6f402160f287a217e6bb15bbd1e
Shell
amerlyq/airy
/%wf/obsolete/ubuntu/gen/nosudo_reboot
UTF-8
762
3.15625
3
[ "MIT" ]
permissive
#!/bin/bash -e source ~/.shell/profile # Reboot w/o sudo: remove all previous entries for user and append to end # Or manually setting: launch editor of access file with errs checking '$ sudo visudo', and append your's user # If all that will break sudo command: '$ pkexec bash', and then change file manually CURR_USER=${CURR_USER:-${SUDO_USER:-${USER:-${USERNAME:-$(whoami)}}}} SYS_ENTRY="$CURR_USER ALL=(ALL) \ NOPASSWD:/usr/sbin/pm-hibernate,/usr/sbin/pm-suspend,\ /sbin/reboot,/sbin/halt,/sbin/shutdown,/sbin/poweroff" case "$CURR_PROF" in laptop) SYS_ENTRY="$SYS_ENTRY,/usr/bin/intel_backlight" ;; esac dst=/etc/sudoers sudo sed -i "/^$CURR_USER ALL=(ALL) NOPASSWD/d" $dst echo "$SYS_ENTRY" | sudo tee --append $dst echo "W: $dst <- reboot w/o sudo"
true
043a522ce7166a97b5736ef2ac96ac7c303f5789
Shell
nvllsvm/dotfiles
/scripts/open-term
UTF-8
227
2.984375
3
[]
no_license
#!/usr/bin/env sh TARGET="$(basename "$0")" if [ "$(hostname)" = "$TARGET" ]; then exec alacritty --title "$TARGET" --command zsh -ic tmux-attach else exec alacritty --title "$TARGET" --command zsh -ic "ssh $TARGET" fi
true
46cdb7fe3977ea638ddace8d04cc55ceca9d94f8
Shell
Harrison21/progblack_lectures
/build.sh
UTF-8
296
2.734375
3
[ "CC0-1.0" ]
permissive
#!/bin/bash sed '/^---/ d' PITCHME.md | sed '/^@/ d' | sed '/^:::/ d' | sed 's/{.*}//' > README.md PATHEND=$(pwd | rev | cut -d'/' -f-2 | rev) pandoc -V theme=simple -t revealjs -s PITCHME.md -o PITCHME.html git add . git commit -m "Working on presentation $PATHEND" git push -u origin main
true
5892592597f849317fbea5bcbe44b0e34e017d02
Shell
salmanspice/k8s-ha-postgres
/chart/files/haproxy-scripts/manage-master.sh
UTF-8
697
3.3125
3
[]
no_license
#!/bin/sh -e pod_name=$(cat $1 | cut -s -d ',' -f 1) addr=$(cat $1 | cut -s -d ',' -f 2) echo "master backend state before:" echo "show servers state master" | nc localhost 9998 echo "Disabling server master0 and shutting down the sessions..." echo "set server master/master0 state maint" | nc localhost 9998 echo "shutdown sessions server master/master0" | nc localhost 9998 if [ -n "$pod_name" ]; then echo "Enabling server master0 for pod $pod_name with ip $addr..." echo "set server master/master0 addr $addr" | nc localhost 9998 echo "set server master/master0 state ready" | nc localhost 9998 fi echo "master backend state after:" echo "show servers state master" | nc localhost 9998
true
e7d69bc5ec585927465e5542dde82de128875474
Shell
freebsd/freebsd-ports
/audio/logitechmediaserver/files/pkg-install.in
UTF-8
1,292
3.265625
3
[ "BSD-2-Clause" ]
permissive
#!/bin/sh name=%%PORTNAME%% comment="Slim Devices SlimServer/SqueezeCenter pseudo-user" slimdir="%%PREFIX%%/%%SLIMDIR%%" statedir=%%SLIMDBDIR%% cachedir=${statedir}/cache prefsdir=${statedir}/prefs playlistdir=${statedir}/playlists oldprefsdir=/var/db/squeezecenter/prefs logdir=/var/log/${name} conffile=${prefsdir}/server.prefs pidfile=/var/run/${name}/${name}.pid newsyslogfile=/etc/newsyslog.conf logcomment="# added by audio/${name} port" serverlogfile=/var/log/${name}/server.log serverlogline="${serverlogfile} ${u}:${g} 644 3 100 * J ${pidfile}" case $2 in POST-INSTALL) if egrep -q "^${serverlogfile}\>" ${newsyslogfile}; then echo "Using existing ${newsyslogfile} entry." else echo "Adding ${name} log entry to ${newsyslogfile}." echo "$logcomment" >> ${newsyslogfile} echo "$serverlogline" >> ${newsyslogfile} fi for file in %%CONFFILES%%; do path="${slimdir}/${file}" if [ ! -e ${path} ]; then cp ${path}.sample ${path} chmod 644 ${path} fi done if [ ! -f ${serverlogfile} ]; then touch ${serverlogfile} chown -H ${u}:${g} ${serverlogfile} fi if [ ! -e ${conffile} ]; then if [ -e ${oldprefsdir}/server.prefs ]; then mkdir -p ${statedir} cp -r ${oldprefsdir}* ${statedir} chown -RH ${u}:${g} ${prefsdir} fi fi ;; esac
true
3cef9a246051f0570c28c6c13ad8761d40af8e25
Shell
nasrulain/assignment-guessinggame
/guessinggame.sh
UTF-8
963
4.03125
4
[]
no_license
#!/usr/bin/env bash # File: guessinggame.sh # Peer graded assignment - The Unix Workbench by Coursera/John's Hopkins University # Counting no. of files in the directory filecount=$(ls -lA | wc -l) num="^[0-9]+$" # Function with IF condition to check guessed value function output { if [[ $guesscount -lt $filecount ]] then echo "Too low!" elif [[ $guesscount -gt $filecount ]] then echo "Too high!" else echo "" echo "Well done! Your guess is correct!" exit 0 fi } # While loop while [[ 0 ]] do echo "Guess how many files are in the current directory? " read -p "Enter your Guess: " guesscount if [[ $guesscount =~ $num ]] then output elif ! [[ $guesscount =~ $num ]] then echo "You have entered non-integer value. Enter only integer value." else echo "You have entered non-integer value. Enter only integer value." fi echo "" done
true
5299d6d2ba069347b182c5bacb6c6b9b579abb9d
Shell
nicolasbock/ebuildtester
/ebuildtester.bash-completion
UTF-8
1,570
2.828125
3
[ "BSD-3-Clause" ]
permissive
# vim: syntax=sh:tabstop=4:shiftwidth=4:expandtab _ebuildtester() { local cur prev opts prefix COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" opts=( --help --version --atom --binhost --live-ebuild --manual --portage-dir --overlay-dir --update --install-basic-packages --threads --use --global-use --unmask --unstable --gcc-version --python-single-target --python-targets --rm --storage-opt --with-X --with-vnc --profile --features --docker-image --docker-command --pull --show-options --ccache --batch --debug ) case "${prev}" in --portage-dir|--overlay-dir|--ccache) COMPREPLY=( $(compgen -o filenames -o dirnames -o plusdirs ${cur}) ) compopt -o nospace -o filenames -o dirnames -o plusdirs ;; --features) if [[ ${cur} =~ ^- ]]; then prefix=("-P" "-") else prefix=() fi echo COMPREPLY=( $(compgen ${prefix[@]} -W "ccache sandbox userfetch" -- ${cur#-}) ) ;; *) if [[ ${cur} =~ ^-.* || ${COMP_CWORD} -eq 1 ]] ; then COMPREPLY=( $(compgen -W "${opts[*]}" -- ${cur}) ) else echo "I should not be here" exit 1 fi ;; esac } complete -F _ebuildtester ebuildtester
true
185481346736b962dfbae7334abcfe25f414cc3f
Shell
lecorref/config_personnal
/aliases
UTF-8
806
3.15625
3
[]
no_license
#!/bin/bash # Definition des alias raccourcis alias cdt='cd ~/test/' # Definition des alias de compilation alias gccf="gcc -Wall -Wextra -Werror" alias g++f="g++ -Wall -Wextra -Werror" # Definition des alias alias clean="find . -name '*~' -execdir rm {} \;" alias modsh="vim $C_PATH_TO_PERSONNAL_CONFIG/zshrc" alias purgevim="rf -f ~/.vim/tmp/*.swp ~/.vim/tmp/.*.swp" alias rl="source ~/.zshrc" # School only aliases if [[ `uname` = "Darwin" ]]; then # misc alias auteur="echo '$USER' > auteur" alias libft="cp -r $LIB .; rm -rf libft/.git" alias op=ocamlopt # cd alias alias cdc='cd ~/Rendu' alias cdl='cd $LIB' alias goinfre='cd /nfs/sgoinfre/goinfre/' # compil alias alias gccl="gcc -I $LIB/includes -L $LIB -lft" alias gcclf="gcc -Wall -Wextra -Werror -I $LIB/includes -L $LIB -lft" fi
true
dd832d1622764c234a1d4caa40a824a0786497dc
Shell
fdinardo/arch_scripts
/custom/completions/eng.completion.bash
UTF-8
317
3.375
3
[]
no_license
_eng() { local cur=${COMP_WORDS[COMP_CWORD]} local list_path=$(echo $PATH | tr ":" "\n") case "$cur" in *) for myPath in $list_path do list_files="$list_files $(ls $myPath -1 2> /dev/null)" done COMPREPLY=( $(compgen -W "$list_files" -- $cur) ) return 0 ;; esac } complete -F _eng eng
true
fe5bed4148c0db42bf97bdd0e9f7027ede4fd607
Shell
Sakshi2106/Threading_Library
/many-one/test.sh
UTF-8
695
2.625
3
[]
no_license
#!/bin/bash echo "" echo "" echo -e "I)--------------------------------------------RUNNING MANY-ONE TESTING-------------------------------------------------" echo "" echo "" echo -e "1)----------------------------------RUNNING APITEST TEST-----------------------------" echo "./exe/apitest" ./exe/apitest echo "" echo "" echo -e "2)----------------------------------RUNNING SPINLOCK TEST----------------------------" echo "./exe/spinlocktest" echo "Wait for a minute" ./exe/spinlock echo "" echo "" echo -e "3)-----------------------------------RUNNING MATRIX MULTIPLICATION TEST-----------------------------" echo "./exe/matrix" echo "Reads matrix from matrix.txt" ./exe/matrix echo "" echo ""
true
a55cc66188efa43678bc76068ba9252438ad588f
Shell
mswishe7/Scripts
/sshcommand
UTF-8
411
3.375
3
[]
no_license
#!/bin/bash #Usage: ./sshcommand <user> <host> <command> BB=/bin/busybox if [ "$#" -lt 3 ];then echo "Usage: ./sshcommand <user> <host> <command>" exit 1 fi if [ -z "$SSHPASS" ];then echo "SSHPASS Environment variable not set. Enter Password:" read -s password export SSHPASS=${password} fi sshpass -e scp ${BB} $1@$2: sshpass -e ssh $1@$2 ./busybox $3 sshpass -e ssh $1@$2 ./busybox rm -f ./busybox
true
b722836631ce3d638744114ecb0576667c1a0601
Shell
wolxXx/lxclister
/grab.sh
UTF-8
3,339
3.875
4
[]
no_license
#!/bin/bash function startUp () { clear; echo "wolxXxShellTools: grab containers and their meta."; echo "v.0.2 | devops@wolxXx.de | git.wolxxx.de | https://github.com/wolxXx" echo "licensed under MIT general public open source license. " echo "love it, share it, extend it. improve the world!" echo "________________________________________________"; echo ""; } function checkRoot () { ME=$(whoami); if [ ! "root" == $ME ]; then echo "you must be root!"; echo "you are $ME. you rock, sure, but root rocks more ;)"; echo ""; exit 1; fi; } function displayHelp () { echo ""; echo "HELP:"; echo "no params required!"; echo "you must be root to run this."; echo "this script grabs all containers in /var/lib/lxc"; echo "and grabs their configuration"; echo "and writes it into containers.js file"; echo "for having it in list.html."; echo ""; echo "it does NOT update existing section objects."; echo "maybe later. if needed."; } startUp; if [ "$1" == "--help" ]; then displayHelp; exit 0; fi; checkRoot; here=$(dirname $(readlink -f $0)); cd $here; rm containers.js; echo "//containers in /var/lib/lxc" > containers.js; echo "" >> containers.js; echo "var containers = [];" >> containers.js; chmod 777 containers.js; CONTAINERS=$(for i in /var/lib/lxc/*; do test -e /var/lib/lxc/$i/config || basename $i; done) for CONTAINER in $CONTAINERS do echo ""; echo "checking now container: $CONTAINER"; found=$(cat containers.js | grep "name: '$CONTAINER'"); if [ ! '' == "$found" ]; then echo "found in containers.js"; continue; fi; echo "" >> containers.js; echo "//container: $CONTAINER" >> containers.js; echo "containers.push({" >> containers.js; echo " name: '$CONTAINER'," >> containers.js; ip=$(cat /var/lib/lxc/$CONTAINER/config | grep "ipv4"); if [ ! '' == "$ip" ]; then ip=$(echo $ip | cut -d"=" -f2 | cut -d"/" -f1); echo "found configured ip: $ip"; echo " ip: '$ip'," >> containers.js; fi; mac=$(cat /var/lib/lxc/$CONTAINER/config | grep "hwaddr"); if [ ! '' == "$mac" ]; then mac=$(echo $mac | cut -d"=" -f2); echo "found configured mac: $mac"; echo " mac: '$mac'," >> containers.js; fi; arch=$(cat /var/lib/lxc/$CONTAINER/config | grep "lxc.arch"); if [ ! '' == "$arch" ]; then arch=$(echo $arch | cut -d"=" -f2); echo "found configured arch: $arch"; echo " arch: '$arch'," >> containers.js; fi; echo "});" >> containers.js; done echo "" >> containers.js; echo "var macs = [];" >> containers.js; echo "containers.forEach(function (container) {" >> containers.js; echo " if (-1 === macs.indexOf(container.mac)) {" >> containers.js; echo "" >> containers.js; echo " macs.push(container.mac);" >> containers.js; echo "" >> containers.js; echo " console.log('added mac ' + container.mac);" >> containers.js; echo " return;" >> containers.js; echo "" >> containers.js; echo " }" >> containers.js; echo "" >> containers.js; echo " alert('duplicate mac: ' + container.mac + ' in ' + container.name);" >> containers.js; echo "});" >> containers.js; exit 0;
true
2bf5fcc124c4e96e2aa84b9bf458f98245052dd4
Shell
ArielMn22/C
/programinc.sh
UTF-8
1,207
3.625
4
[]
no_license
#!/bin/bash PROGRAMS="vim git gcc make" REPOSITORY="http://github.com/ArielMn22/C" SN=0 # Sim ou Não returno=0 # Checa o return do comando clonar(){ echo "Clonando repositório..." git clone $REPOSITORY &>/dev/null var=$? if [[ $var == 0 ]]; then echo "Repositório clonado com sucesso..." else if [[ $var == 128 ]]; then echo "Repositório já clonado..." else echo "Repositório não foi clonado..." fi fi } clear; echo "Atualizando..." apt update &>/dev/null || echo "Algo deu errado com o update..." for x in $PROGRAMS; do echo "Instalando $x..." apt install $x -y &>/dev/null || echo "Algo deu errado com $x..." done read -p "Deseja clonar o repositório \"$REPOSITORY\"? >" SN SN=$(echo $SN | tr A-Z a-z) case $SN in "sim"|"s"|"ss"|"yes"|"si") clonar ;; "nao"|"não"|"no") echo "Repositório não clonado..." ;; *) echo "Repositório não clonado" ;; esac echo ' set nocompatible set nu syntax on set encoding=utf-8 set showcmd filetype plugin indent on set tabstop=2 shiftwidth=2 set expandtab set backspace=indent,eol,start set hlsearch set incsearch set ignorecase set smartcase' > ~/.vimrc
true
05b3b8db28bcb97f2d4d2777c6fe85e038baee9e
Shell
chnoeli/Arma-3-Mod-Download-Script
/linux.sh
UTF-8
2,700
3.78125
4
[ "MIT" ]
permissive
#!/bin/bash #******************************************************************************* gameId="107410" #The 'gameId' is the id of the game for which you want to download mods from the Steam workshop. # #For example: #gameId="107410" # Arma 3 steamcmdLocation="./steamcmd" #The 'steamcmdLocation' is the path to the folder where the stemacmd.sh file is located. #The path can be either relative to the script or absolute. # #For example: #steamcmdLocation="./steamcmd" #steamcmdLocation="/home/steam/steamcmd" modsDestFolder="/home/arma3server/serverfiles/mods" #The 'modsDestFolder' is the path to the folder where the downloaded mods will be #linked after downloading from the workshop. This is necessary because during download #from the workshop the folders will be named with the id and stored in the workshop folder of Steam. #By using a hard link to the 'modsDestFolder' the mods will be renamed (no additional disk space will be used). #The path can be either relative to the script or absolute. # #For example: #modsDestFolder="./arma3server/serverfiles/mods" #modsDestFolder="/home/arma3server/serverfiles/mods" #username="" #password="" #If you want to use the script in a non interactive way you can hardcode the Username and Password here and comment out the 'read' lines. downloadPath="./mods" #******************************************************************************* workshopLoction=$steamcmdLocation/$downloadPath/steamapps/workshop/content/$gameId arrPos=0 currI=0 #arma additional #Read CSV file IFS="," while read f1 f2 do arrModsId+=($f1) arrModsName+=($f2) let arrPos=$arrPos+1 done < modList.csv read -p 'Steam username: ' username read -sp 'password: ' password #Steam download for index in ${!arrModsId[*]} do echo echo "*******************************************************************************" echo "Start download of:" ${arrModsName[$index]} echo "*******************************************************************************" echo $steamcmdLocation/"steamcmd.sh" +login $username $password +force_install_dir $downloadPath +workshop_download_item $gameId ${arrModsId[$index]} validate +quit cp -al $workshopLoction/${arrModsId[$index]} $modsDestFolder/${arrModsName[$index]} echo echo "*******************************************************************************" echo "Finished download of:" ${arrModsName[$index]} echo echo "$currI of" ${#arrModsId[*]} "done!" echo "*******************************************************************************" let currI=$index+1 done
true
53b754406bc13404e2644f34673b351c8d64e131
Shell
closescreen/clhousesample
/to_history_ref_hours_wash.sh
UTF-8
1,909
3.140625
3
[]
no_license
#!/usr/bin/env bash #> Сохраняет из history_ref_from_history_v04.py в clickhouse history_ref_DAY #> Один процесс на день. День либо залился, либо нет. #> Если нет или частично - таблица удаляется и наливается заново. #( set -u set +x set -o pipefail cd `dirname $0` export PERL5LIB=${PERL5LIB:-""}:/usr/local/rle/var/share3/TIKETS/bike # single process! --wait must be enabled for return status after washing serv=`hostname` if [[ ${1:-""} == "start" ]];then shift && nice fork -pf="$0.$serv.pids" --single "$0 $@" --wait --status # enable -wait elif [[ ${1:-""} == "stop" ]];then shift && fork -pf="$0.$serv.pids" -kila else # --------- begin of script body ---- # Параметры: day=${1?DAY!} deb=${2:-""} # можно указать "0" (нет debug) / "1" (info) / "2" или "deb" (максимум отладки) [[ -z "$deb" ]] && deb=0; # - debug off [[ "$deb" != "0" ]] && [[ "$deb" != "1" ]] && deb=2 # full debug level washdeb="" # указание debug для washing [[ "$deb" == "2" ]] && washdeb="-d" && set -x my_server=`hostname` # dm22 db="rnd600" main_table="history_ref" # каждый сервер хранит свои usergroups ug_from="" && ug_to="" [[ "$my_server" == "dm22" ]] && ug_from=1 && ug_to=128 [[ "$my_server" == "dm23" ]] && ug_from=129 && ug_to=256 [[ -z "$ug_from" ]] && echo "ug_from!">&2 && exit 2 d="$day" #day_table="${main_table}_${d//-/_}" # like: history_ref_2015_05_16 hours -t=$day -n=24 | files "../../reg_history_ref/%F/%H_${my_server}.txt" | washing $washdeb -r='[[ -s %f ]]' -comm="результ. файлы проверяются на непусто" \ -cmd=" ./to_history_ref_hour.sh \"%f\" \"$ug_from\" \"$ug_to\" " || exit 1 # ВЫХОД при ошибке # --------- end of script bidy ------ fi #)>>"$0.log" 2>&1
true
8f64d83e44102805bd8e508a94478766d49d7bff
Shell
m301/ModularScripts
/custom/docker.sh
UTF-8
766
2.953125
3
[]
no_license
#!/usr/bin/env sh choices=( apache-start remove-none digi-start digi-stop clear-unused clean-unused) case $1 in "${choices[0]}") # docker network create --subnet=172.18.0.0/16 net1 docker run --net net1 --ip 172.18.0.10 -v ~/Playground/docker-apache/apache2/sites-available/:/etc/apache2/sites-available/ -v /mnt/micro/:/mnt/yocto/ apache ;; "${choices[1]}") docker rmi $(docker images | grep "^<none>" | awk "{print $3}") ;; "${choices[2]}") docker run -d -p 5672:5672 -p 15672:15672 --name rabbitmq rabbitmq:management ;; "${choices[4]}") docker ps -aq | xargs docker rm ;; "${choices[5]}") docker ps -aq | xargs docker rm ;; "shortlist") echo "$(IFS=' ' ; echo "${choices[*]}")" ;; *) echo "[$(IFS=, ; echo "${choices[*]}")][$1]==-1 is true! Dude ? " esac
true
eab34117fabb99665478ce3c81f009f8eb0d0091
Shell
wangdabin/hdqsEJB
/bin/.svn/text-base/alterColumn.sh.svn-base
UTF-8
648
2.59375
3
[]
no_license
#!/usr/bin/ksh . ~/.bash_profile export NLS_LANG=AMERICAN_AMERICA.UTF8 flog=$BASE_HOME/alertColumn.log ouid="$SOP_USER/$SOP_PASSWD" #################### CMD_SQLPLUS=$ORACLE_HOME/bin/sqlplus #################### if [ ! -d $BASE_HOME ]; then mkdir -p $BASE_HOME fi echo "*********************************************" echo "*************init DB start *************" echo "*********************************************" $CMD_SQLPLUS -s $ouid 1>$flog 2>&1 <<!!! set autocommit on alter table PSQBM modify BEIYZF VARCHAR2(22); commit; !!! echo "**************modify table PSQBM filed BEIYZF length compeleted****************************"
true
1db47d526cc0e2c6f111cdb1139bbab19632d541
Shell
Mobasherah12/open-event-scraper
/build.sh
UTF-8
1,170
2.96875
3
[ "MIT" ]
permissive
# thanks to https://gist.github.com/domenic/ec8b0fc8ab45f39403dd #!/bin/sh set -e git config --global user.name "Travis CI" git config --global user.email "noreply+travis@fossasia.org" python scraper.py python event.py # don't continue if no changes if git diff-index --quiet HEAD; then exit 0 fi git pull git commit -m '[Auto] updated json files [ci skip]' out/*.json || echo "no changes" git push "https://${GH_TOKEN}@github.com/OpenTechSummit/open-event-scraper" HEAD:master git clone --depth=1 "https://${GH_TOKEN}@github.com/OpenTechSummit/2016.opentechsummit.net.git" ots-repo node schedule/generator > ots-repo/programm/index.html cd ots-repo rm -rf programm mkdir programm cd programm mkdir css mkdir js mkdir json mkdir speakers mkdir audio node ../../schedule/generator.js>index.html rsync -r ../../out/*.json json rsync -r ../../css/schedule.css css rsync -r ../../css/bootstrap.min.css css rm -rf speakers rsync -r ../../speakers/* speakers rm -rf audio rsync -r ../../audio/* audio rsync -r ../../img/* img git add index.html speakers/*.jpg json/*.json css/ audio/ img/ git commit -m '[Auto] updated schedule' || echo "no changes" git push origin gh-pages exit 0
true