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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
ed5502e9e0475fada1f1732fbc8b70f632c573a0
|
Shell
|
3683/sjohnso
|
/ansible/proxy/alpine/connect-to-bmns
|
UTF-8
| 1,241
| 4.1875
| 4
|
[] |
no_license
|
#!/bin/bash
SELF=$(basename $0)
usage() {
cat << USAGE
Usage: ${SELF} [OPTION]... [OPTION]...
Options:
-h|--help show this help message and exit
-c|--config CONFIG path to ssh config file to use
-b|--bmn BMN name of BMNs to initiate connects to
(use multiple -b to specify more than one)
USAGE
exit 1
}
error() {
echo "ERROR: $1"
exit 1
}
if [[ ! "$@" ]] ; then
usage
fi
TEMP=$(getopt -o hb:c: -l help,bmn:,config: -n ${SELF} -- "$@")
if [ $? != 0 ] ; then
usage
fi
eval set -- "${TEMP}"
while true ; do
case "$1" in
-b|--bmn)
BMNS+=($2); shift;;
-c|--config)
CONFIG=$2; shift;;
-h|--help)
usage;;
--)
shift; break;;
*)
usage;;
esac
shift
done
if [ "${CONFIG}" = "" ] ; then
error "must specify the ssh config file to create... exiting."
fi
if ! [[ "${CONFIG}" =~ ^/ ]] ; then
error "ssh config path must start with '~/' or '/'"
fi
if [[ ${#BMNS[@]} -le 0 ]] ; then
error "must specify at least one BMN... exiting."
fi
# Start controlmaster for each BMN
for BMN in ${BMNS[@]} ; do
CMD="ssh -x -F ${CONFIG} -N -f ${BMN}"
echo "Executing: ${CMD}"
${CMD}
done
| true
|
a6834960c6835765ca6197477ca439b1c543f57b
|
Shell
|
eemperor/ash-linux-formula
|
/ash-linux/el6/STIGbyID/cat1/files/V38491.sh
|
UTF-8
| 760
| 3.203125
| 3
|
[
"Apache-2.0"
] |
permissive
|
#!/bin/sh
#
# STIG URL: http://www.stigviewer.com/stig/red_hat_enterprise_linux_6/2014-06-11/finding/V-38491
# Finding ID: V-38491
# Version: RHEL-06-000019
# Finding Level: High
#
# There must be no .rhosts or hosts.equiv files on the system. Trust
# files are convenient, but when used in conjunction with the
# R-services, they can allow unauthenticated access to a system.
#
############################################################
# Standard outputter function
diag_out() {
echo "${1}"
}
diag_out "----------------------------------"
diag_out "STIG Finding ID: V-38491"
diag_out " Find and Delete rhost-related"
diag_out " files: /etc/hosts.equiv"
diag_out " ${HOME}/.rhosts"
diag_out "----------------------------------"
| true
|
103fc2af7d0fea0ac219bb321de366cddc9e9176
|
Shell
|
gabrielecerami/khaleesi
|
/run.sh
|
UTF-8
| 2,185
| 3.8125
| 4
|
[] |
no_license
|
#! /usr/bin/env bash
set -e -u
source functions.bash
collect_logs() {
local cmdline="ansible-playbook -i local_hosts \
playbooks/collect_logs.yml \
--extra-vars @settings.yml \
--extra-vars @nodes.yml \
-u $REMOTE_USER -s"
if [[ ! -z $skip_tags_collect ]]; then
skip_tags=${skip_tags_collect#--skip_tags}
cmdline+=" --skip-tags $skip_tags_collect"
fi
execute $cmdline
}
main() {
if [ ! -e nodes.yml ]; then
echo "Please create a nodes.yml file to define your environment"
echo "See https://github.com/redhat-openstack/khaleesi/blob/master/doc/packstack.md"
return 1
fi
local playbook=${1:-'aio.yml'}
# If the playbook does NOT contain a '/', default to the packstack playbooks
[[ $playbook =~ '/' ]] || playbook="playbooks/packstack/$playbook"
echo "Playing: $playbook"
generate_settings_file
echo -n "settings: settings.yml"
local cmdline="ansible-playbook -i local_hosts $playbook \
--extra-vars @settings.yml "
if [[ -e repo_settings.yml ]]; then
echo -n ", repo_settings.yml"
cmdline+=" --extra-vars @repo_settings.yml"
fi
if [[ -e job_settings.yml ]]; then
echo -n ", job_settings.yml"
cmdline+=" --extra-vars @job_settings.yml"
fi
echo
cmdline+=" --extra-vars @nodes.yml"
[[ -n ${REMOTE_USER:-''} ]] && cmdline+=" -u $REMOTE_USER -s"
# tags and skip tags
# Remove extraneous '--tags' first.
#Jobs that use this should switch to just providing the tags
[[ -n ${TAGS:-''} ]] && cmdline+=" --tags ${TAGS#--tags=}"
[[ -n ${SKIP_TAGS:-''} ]] && cmdline+=" --skip-tags ${SKIP_TAGS#--skip_tags}"
local khaleesi_verbose=${KHALEESI_VERBOSE:-false}
local khaleesi_ssh_verbose=${KHALEESI_SSH_VERBOSE:-false}
if $khaleesi_verbose || $khaleesi_ssh_verbose; then
cmdline+=" -v"
$khaleesi_ssh_verbose && cmdline+="vvv"
fi
# collect logs only if the settings are proper
on_exit collect_logs
execute $cmdline
}
# requires a 0 exit code for clean.sh to execute
on_exit init.print_result
main "$@" || true
| true
|
0b496cf21e6e795cf92be2599e47339c8d9a67c7
|
Shell
|
triton/triton
|
/nixos/maintainers/scripts/ec2/create-amis.sh
|
UTF-8
| 8,988
| 3.71875
| 4
|
[
"MIT"
] |
permissive
|
#! /bin/sh -e
set -o pipefail
#set -x
stateDir=${TMPDIR:-/tmp}/ec2-image
echo "keeping state in $stateDir"
mkdir -p $stateDir
version=$(nix-instantiate --eval --strict '<nixpkgs>' -A lib.nixpkgsVersion | sed s/'"'//g)
echo "NixOS version is $version"
rm -f ec2-amis.nix
for type in hvm pv; do
link=$stateDir/$type
imageFile=$link/nixos.img
system=x86_64-linux
arch=x86_64
# Build the image.
if ! [ -L $link ]; then
if [ $type = pv ]; then hvmFlag=false; else hvmFlag=true; fi
echo "building image type '$type'..."
nix-build -o $link \
'<nixpkgs/nixos>' \
-A config.system.build.amazonImage \
--arg configuration "{ imports = [ <nixpkgs/nixos/maintainers/scripts/ec2/amazon-image.nix> ]; ec2.hvm = $hvmFlag; }"
fi
for store in ebs s3; do
bucket=nixos-amis
bucketDir="$version-$type-$store"
prevAmi=
prevRegion=
for region in eu-west-1 eu-central-1 us-east-1 us-west-1 us-west-2 ap-southeast-1 ap-southeast-2 ap-northeast-1 sa-east-1; do
name=nixos-$version-$arch-$type-$store
description="NixOS $system $version ($type-$store)"
amiFile=$stateDir/$region.$type.$store.ami-id
if ! [ -e $amiFile ]; then
echo "doing $name in $region..."
if [ -n "$prevAmi" ]; then
ami=$(ec2-copy-image \
--region "$region" \
--source-region "$prevRegion" --source-ami-id "$prevAmi" \
--name "$name" --description "$description" | cut -f 2)
else
if [ $store = s3 ]; then
# Bundle the image.
imageDir=$stateDir/$type-bundled
if ! [ -d $imageDir ]; then
rm -rf $imageDir.tmp
mkdir -p $imageDir.tmp
ec2-bundle-image \
-d $imageDir.tmp \
-i $imageFile --arch $arch \
--user "$AWS_ACCOUNT" -c "$EC2_CERT" -k "$EC2_PRIVATE_KEY"
mv $imageDir.tmp $imageDir
fi
# Upload the bundle to S3.
if ! [ -e $imageDir/uploaded ]; then
echo "uploading bundle to S3..."
ec2-upload-bundle \
-m $imageDir/nixos.img.manifest.xml \
-b "$bucket/$bucketDir" \
-a "$EC2_ACCESS_KEY" -s "$EC2_SECRET_KEY" \
--location EU
touch $imageDir/uploaded
fi
extraFlags="$bucket/$bucketDir/nixos.img.manifest.xml"
else
# Convert the image to vhd format so we don't have
# to upload a huge raw image.
vhdFile=$stateDir/$type.vhd
if ! [ -e $vhdFile ]; then
qemu-img convert -O vpc $imageFile $vhdFile.tmp
mv $vhdFile.tmp $vhdFile
fi
taskId=$(cat $stateDir/$region.$type.task-id 2> /dev/null || true)
volId=$(cat $stateDir/$region.$type.vol-id 2> /dev/null || true)
snapId=$(cat $stateDir/$region.$type.snap-id 2> /dev/null || true)
# Import the VHD file.
if [ -z "$snapId" -a -z "$volId" -a -z "$taskId" ]; then
echo "importing $vhdFile..."
taskId=$(ec2-import-volume $vhdFile --no-upload -f vhd \
-o "$EC2_ACCESS_KEY" -w "$EC2_SECRET_KEY" \
--region "$region" -z "${region}a" \
--bucket "$bucket" --prefix "$bucketDir/" \
| tee /dev/stderr \
| sed 's/.*\(import-vol-[0-9a-z]\+\).*/\1/ ; t ; d')
echo -n "$taskId" > $stateDir/$region.$type.task-id
fi
if [ -z "$snapId" -a -z "$volId" ]; then
ec2-resume-import $vhdFile -t "$taskId" --region "$region" \
-o "$EC2_ACCESS_KEY" -w "$EC2_SECRET_KEY"
fi
# Wait for the volume creation to finish.
if [ -z "$snapId" -a -z "$volId" ]; then
echo "waiting for import to finish..."
while true; do
volId=$(ec2-describe-conversion-tasks "$taskId" --region "$region" | sed 's/.*VolumeId.*\(vol-[0-9a-f]\+\).*/\1/ ; t ; d')
if [ -n "$volId" ]; then break; fi
sleep 10
done
echo -n "$volId" > $stateDir/$region.$type.vol-id
fi
# Delete the import task.
if [ -n "$volId" -a -n "$taskId" ]; then
echo "removing import task..."
ec2-delete-disk-image -t "$taskId" --region "$region" -o "$EC2_ACCESS_KEY" -w "$EC2_SECRET_KEY" || true
rm -f $stateDir/$region.$type.task-id
fi
# Create a snapshot.
if [ -z "$snapId" ]; then
echo "creating snapshot..."
snapId=$(ec2-create-snapshot "$volId" --region "$region" | cut -f 2)
echo -n "$snapId" > $stateDir/$region.$type.snap-id
ec2-create-tags "$snapId" -t "Name=$description" --region "$region"
fi
# Wait for the snapshot to finish.
echo "waiting for snapshot to finish..."
while true; do
status=$(ec2-describe-snapshots "$snapId" --region "$region" | head -n1 | cut -f 4)
if [ "$status" = completed ]; then break; fi
sleep 10
done
# Delete the volume.
if [ -n "$volId" ]; then
echo "deleting volume..."
ec2-delete-volume "$volId" --region "$region" || true
rm -f $stateDir/$region.$type.vol-id
fi
extraFlags="-b /dev/sda1=$snapId:20:true:gp2"
if [ $type = pv ]; then
extraFlags+=" --root-device-name=/dev/sda1"
fi
extraFlags+=" -b /dev/sdb=ephemeral0 -b /dev/sdc=ephemeral1 -b /dev/sdd=ephemeral2 -b /dev/sde=ephemeral3"
fi
# Register the AMI.
if [ $type = pv ]; then
kernel=$(ec2-describe-images -o amazon --filter "manifest-location=*pv-grub-hd0_1.04-$arch*" --region "$region" | cut -f 2)
[ -n "$kernel" ]
echo "using PV-GRUB kernel $kernel"
extraFlags+=" --virtualization-type paravirtual --kernel $kernel"
else
extraFlags+=" --virtualization-type hvm"
fi
ami=$(ec2-register \
-n "$name" \
-d "$description" \
--region "$region" \
--architecture "$arch" \
$extraFlags | cut -f 2)
fi
echo -n "$ami" > $amiFile
echo "created AMI $ami of type '$type' in $region..."
else
ami=$(cat $amiFile)
fi
if [ -z "$NO_WAIT" -o -z "$prevAmi" ]; then
echo "waiting for AMI..."
while true; do
status=$(ec2-describe-images "$ami" --region "$region" | head -n1 | cut -f 5)
if [ "$status" = available ]; then break; fi
sleep 10
done
ec2-modify-image-attribute \
--region "$region" "$ami" -l -a all
fi
echo "region = $region, type = $type, store = $store, ami = $ami"
if [ -z "$prevAmi" ]; then
prevAmi="$ami"
prevRegion="$region"
fi
echo " \"15.09\".$region.$type-$store = \"$ami\";" >> ec2-amis.nix
done
done
done
| true
|
f19e6217bd2e0ce160b212843618cd91297e03d4
|
Shell
|
moj3ve/TheosScript
|
/setup.sh
|
UTF-8
| 3,706
| 3.734375
| 4
|
[] |
no_license
|
#!/bin/sh
# heavy thanks to kritanta for the baseline of this script.
NC='\033[0m' # No Color.
VI='\033[0;95m' # Violet.
YE='\033[1;93m' # Yellow.
CYA='\033[0;96m' # Cyan.
GR='\033[0;32m' # Green.
BAD='\033[0;91m' # Strong red. For errors.
command -v theos >/dev/null 2>&1 || commandinstalled="false"
if [[ $commandinstalled != "false" ]]; then
echo -e "${CYA}The THEOS Command is already installed.${NC}"
exit 0
fi
nosudo() {
echo "This cannot be ran as root or with sudo."
exit 1
}
if [ $SHELL == "/bin/zsh" ]; then
profile1="~/.zshrc"
profile2="~/.zprofile"
else
profile1="~/.bashrc"
profile2="~/.profile"
fi
crd=$PWD
[[ $UID == 0 || $EUID == 0 ]] && nosudo
sudo -p "Password for installation: " printf "" || exit 1
x=$PWD
need=""
command -v fakeroot >/dev/null 2>&1 || need+="fakeroot "
command -v curl >/dev/null 2>&1 || need+="curl "
command -v wget >/dev/null 2>&1 || need+="wget "
command -v git >/dev/null 2>&1 || need+="git "
command -v python >/dev/null 2>&1 || need+="python "
command -v perl >/dev/null 2>&1 || need+="perl"
iosInstall() {
echo "This script is incompatable with iOS."
exit 1
}
macosInstall() {
command -v ldid >/dev/null 2>&1 || need+="ldid "
command -v xz >/dev/null 2>&1 || need+="xz"
if [ "$need" != "" ]; then
read -p "Using Brew To Install Dependencies (${need}). Press Enter to Continue." || exit 1
brew install $need
echo -e "${GR}All dependencies installed successfully.${NC}"
fi
}
linuxInstall() {
command -v clang-6.0 >/dev/null 2>&1 || need+="clang-6.0 "
if [ "$need" != "" ]; then
read -p "Installing Dependencies (${need}). Press Enter to Continue." || exit 1
if [ -x "$(command -v apk)" ]; then sudo apk add --no-cache $need || failedinstall=1
elif [ -x "$(command -v apt-get)" ]; then sudo apt-get install $need || failedinstall=1
elif [ -x "$(command -v dnf)" ]; then sudo dnf install $need || failedinstall=1
elif [ -x "$(command -v zypper)" ]; then sudo zypper install $need || failedinstall=1
else failedinstall=1;
fi
if [ $failedinstall == 1 ]; then
echo -e "${BAD}You need to manually install:${NC} $need">&2;
else
echo -e "${GR}All dependencies installed successfully.${NC}"
fi
fi
}
script() {
distr=$(uname -s)
arch=$(uname -p)
if [ "$distr" == "Darwin" ]; then
if [ "$arch" == "arm" ] || [ "$arch" == "arm64" ]; then iosInstall
else macosInstall
fi
else linuxInstall
fi
cd $HOME
git clone https://github.com/ajaidan0/theosscript
cd $HOME/theosscript
sudo chmod +x ./theos
if [ "$distr" == "Darwin" ]; then
sudo ln ./theos /usr/local/bin/theos
else sudo ln ./theos /usr/bin/theos
fi
cd $x
if [ $THEOS_DEVICE_IP == "" ]; then
read -p "Enter your iPhone's IP Address (just press enter for none): " IP
if [[ $IP != "" ]]; then
echo "export THEOS_DEVICE_IP=$IP" >> $profile1
echo "export THEOS_DEVICE_IP=$IP" >> $profile2
echo ""
echo -e "${YE}The script will now set up ssh-copy-id. It will ask you some questions, make sure you answer them.${NC}"
echo ""
ssh-keygen
ssh-copy-id root@$IP
ssh-copy-id mobile@$IP
fi
fi
if [[ $IP != "" ]]; then
echo "The THEOS Command has been installed. Please restart your terminal to allow the variables to take effect."
else
echo "The THEOS Command has been installed."
fi
}
script
| true
|
84b1ef64a6976fed2ab5c982b7f63ba3c57a71ff
|
Shell
|
christophercook/host-profiles
|
/setup-node.sh
|
UTF-8
| 780
| 3.65625
| 4
|
[] |
no_license
|
#!/bin/bash
# Check if running as root
if [ "$EUID" -ne 0 ]; then
echo "This script must be run as root"
exit 1
fi
# Ubuntu specific
if [ "$(lsb_release -si)" = "Ubuntu" ]; then
# Install nodejs 8.x if not found
if [ -z "$(which node)" ]; then
curl -sL https://deb.nodesource.com/setup_8.x | bash -
apt-get install -y nodejs
fi
# Install yarn if not found
if [ -z "$(which yarn)" ]; then
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list
apt-get update && apt-get install yarn
fi
fi
# Suggest other npm packages to install
echo 'Suggested node packages:'
echo ' yarn global add create-react-app, serverless, typescript, vue-cli'
| true
|
94370ca352549dbaad4d43ef9e0f7408128d4904
|
Shell
|
pyj6767/parkyj6767_linux_Scirpt
|
/write_atomlabel
|
UTF-8
| 2,157
| 3.765625
| 4
|
[] |
no_license
|
#!/bin/sh
#Script Name : write_atomlabel | Made by Young-Jun Park, yjpark29@postech.ac.kr
#Description
#: write_atomlabel (for CONTCAR)
#Condition : there is CONTCAR file in current directory
#Specifying linenumber
#------------------------------------------------------------------------
#Direct/Cartesian Check
Direct_check=`grep Direct CONTCAR`
Cartesian_check=`grep Cartesian CONTCAR`
if [[ -n $Direct_check ]];then
DC_linenumber=`grep -n Direct CONTCAR | awk -F":" '{print $1}'`
elif [[ -n $Cartesian_check ]];then
DC_linenumber=`grep -n Cartesian CONTCAR | awk -F":" '{print $1}'`
else
echo 'Error : Cannot specify Direct/Cartesian'
fi
#Selective Dynamics Check
Selective_check=`grep Selective CONTCAR`
if [[ -z $Selective_check ]];then
atomname_linenumber=$(echo "scale=0;$DC_linenumber - 2 " | bc -l)
atomnumber_linenumber=$(echo "scale=0;$DC_linenumber - 1 " | bc -l)
else
atomname_linenumber=$(echo "scale=0;$DC_linenumber - 3 " | bc -l)
atomnumber_linenumber=$(echo "scale=0;$DC_linenumber - 2 " | bc -l)
fi
atomtype_number=`sed -n ''"$atomname_linenumber"'p' CONTCAR | wc -w`
linenumber=`echo $DC_linenumber`
#-------------------------------------------------------------------------
already_check=`expr $linenumber + 1`
position_field=`sed -n ''"$already_check"'p' CONTCAR | wc -w`
if [ $position_field -ge 4 ];then
echo 'Exit : CONTCAR File already treated'
exit 0
fi
#get total atom number
for k in $(seq $atomtype_number)
do
atomnumber=`sed -n ''"$atomnumber_linenumber"'p' CONTCAR | awk '{print $'"$k"'}'`
totalatom=`expr $sum + $atomnumber`
sum=$totalatom
done
#iteration - according to atom type
for i in $(seq $atomtype_number)
do
per_atomname=`sed -n ''"$atomname_linenumber"'p' CONTCAR | awk '{print $'"$i"'}'`
per_atomnumber=`sed -n ''"$atomnumber_linenumber"'p' CONTCAR | awk '{print $'"$i"'}'`
#iteration - according to number of atom
for j in $(seq $per_atomnumber)
do
linenumber=`expr $linenumber + 1`
perl -p -i -e '$.=='"$linenumber"' and s/$/ '"$per_atomname"''"$j"'/' CONTCAR
#awk '{ if (NR=='"$linenumber"') { print $0 " '"$per_atomname"''"$j"'" } else { print $0 } }' CONTCAR
done
done
echo 'write_atomlabel : Complete Labeling!'
exit 0
| true
|
62f939d0ab27ecf32135a53bfce0515dd65da540
|
Shell
|
FreeWebOS/luna-service2
|
/src/libluna-service2/test/run_unit_tests
|
UTF-8
| 1,044
| 3.96875
| 4
|
[
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] |
permissive
|
#!/bin/sh
BASE_DIR=${HOME}/luna-desktop-binaries/staging
LIB_DIR="${BASE_DIR}/lib;${BASE_DIR}/usr/lib"
LOG_DIR="$1"
LOG_XML=${LOG_DIR}/unittests.xml
LOG_HTML=${LOG_DIR}/unittests.html
function usage()
{
cat <<EOF
Usage: `basename $0` PATH_TO_BUILD_DIR
Run all unit tests and generate test report (${LOG_HTML})
PATH_TO_BUILD_DIR is path to directory containing compiled unit test executables.
EOF
}
if [ $# -lt 1 -o ! -d "$1" ]
then
usage
exit 1
fi
TEST_DIR=`readlink -f $1`
if [ ! -d "${LOG_DIR}" ]
then
mkdir ${LOG_DIR}
fi
TESTS=`find ${TEST_DIR} -maxdepth 1 -type f -executable`
if [ -z "${TESTS}" ]
then
echo "INFO: No unit test executables available (compiled?). Nothing to do."
exit 0
fi
LD_LIBRARY_PATH=${LIB_DIR} gtester -k ${TESTS} -o ${LOG_XML}
RESULT=$?
# TODO: bug in gtester-report. remove when fixed!
# SEE: https://bugs.launchpad.net/ubuntu/+source/glib2.0/+bug/1036260
sed -i '3i\<info><package/><version/><revision/></info>' ${LOG_XML}
gtester-report ${LOG_XML} > ${LOG_HTML}
exit $RESULT
| true
|
473135267ae9ceeae21438256a751a686e4b9e01
|
Shell
|
senycorp/studiz
|
/build/publisher
|
UTF-8
| 503
| 3.421875
| 3
|
[
"MIT",
"Apache-2.0"
] |
permissive
|
#!/bin/bash
#################################################
# This script is used by phpStorms FileWatcher #
# to automatically update package assets in #
# public folder. #
#################################################
# Get source file
source="$(pwd)/$1"
# Build target path in public folder
target=${1/public\/}
target="$(pwd)/${target/workbench/public/packages}"
targetDirectory=${target%/*}/
# Copy asset
mkdir -p $targetDirectory && cp $source $target
| true
|
61ea54fa4a42b79bad78679dee2a87ffc8f08b1d
|
Shell
|
jesperfj/hk-gh
|
/setup
|
UTF-8
| 2,861
| 3.984375
| 4
|
[] |
no_license
|
#!/bin/bash
function usage {
cat <<EOF
setup 1: sets up a new Heroku app for branch
Usage: hk setup [-b branch] [app name]
Example:
hk setup
hk setup -b my-topic-branch
hk setup my-app-name
EOF
}
if [ "$HKPLUGINMODE" = info ]; then
usage
exit 0
fi
if [ ! -e "$HOME/.heroku/github" ]; then
echo "No Github credentials. Log in with 'hk gh-login' first."
exit 1
fi
while getopts :b: opt; do
case $opt in
b)
BRANCH=$OPTARG
;;
\?)
# ignore unknown options
;;
esac
done
shift $(($OPTIND - 1))
HEROKUAPP=$1
BRANCH=${BRANCH:-$(git symbolic-ref --short -q HEAD)} || {
echo "Could not determine branch. Perhaps HEAD is detached?"
echo "You can set branch explicitly with -b option."
exit 1;
}
TOKEN=$(cat $HOME/.heroku/github)
GITHUB_REPO=$(git config --get remote.origin.url | \
sed -e 's/http:\/\/github.com\///' \
-e 's/https:\/\/github.com\///' \
-e 's/git@github\.com://' \
-e 's/git:\/\/github\.com\///' \
-e 's/\.git//' )
TAR_URL=$(curl -s -u "$TOKEN:x-oauth-basic" -w "%{redirect_url}" \
https://api.github.com/repos/$GITHUB_REPO/tarball/$BRANCH)
echo "Setting up new Heroku app for branch $BRANCH in $GITHUB_REPO"
echo -n "Starting setup..."
START_SETUP=$(echo "{\"source_blob\": { \"url\": \"$TAR_URL\" }}" | hk api post /app-setups)
SETUP_ID=$(echo $START_SETUP | jq -r .id)
HAIKU_NAME=$(echo $START_SETUP | jq -r .app.name)
if [ -z "$SETUP_ID" ]; then
echo " failed"
echo "JSON response:"
echo $START_SETUP
exit 1
fi
echo " done"
echo " (haiku app = $HAIKU_NAME, setup id = $SETUP_ID)"
echo -n "Deploying and running scripts"
while true; do
echo -n '.'
sleep 5
SETUP_RESULT=$(hk api get /app-setups/$SETUP_ID)
STATUS=$(echo $SETUP_RESULT | jq -r .status)
if [ "$STATUS" != "pending" ]; then
if [ "$STATUS" == "succeeded" ]; then
echo " done"
echo "Post deploy script output:"
echo $SETUP_RESULT | jq -r .postdeploy.output
break
else
echo " failed"
echo $SETUP_RESULT | jq -r .failure_message
exit 1;
fi
fi
done
# heroku rename
function hmv {
new_name=$(echo "{\"name\": \"$2\"}" | hk api patch /apps/$1 | jq -r .name)
if [ "$2" == "$new_name" ]; then
echo "Renamed app to $new_name"
else
echo "App rename of $new_name failed"
fi
}
if [ -z "$HEROKUAPP" ]; then
if [ "$BRANCH" == "master" ]; then
# can't rename, so haiku name is the name
HEROKUAPP=$HAIKU_NAME
else
# set name to <master app name>-<branch name>
HEROKUAPP="$(git config --get branch.master.heroku)-$BRANCH"
echo "Renaming from $HAIKU_NAME to $HEROKUAPP..."
hmv $HAIKU_NAME $HEROKUAPP
fi
else
hmv $HAIKU_NAME $HEROKUAPP
fi
git config branch.$BRANCH.heroku $HEROKUAPP
exit 0
| true
|
2c31503089eac2be40fd476bac8aa4edeb084f09
|
Shell
|
somic/puppet-monitoring_check
|
/files/remediation.sh
|
UTF-8
| 1,339
| 4.3125
| 4
|
[
"Apache-2.0"
] |
permissive
|
#!/bin/bash
# Takes a check command, and an action command
# If the action doesn't return a 0, the action is run and the output is returned
RETRIES=1
while getopts "n:c:a:r:" arg; do
case $arg in
n)
# The name of the check we're running
NAME=$OPTARG
;;
c)
# The check that we're running
CHECK=$OPTARG
;;
a)
# The action to take in the case of a non 0 exit
ACTION=$OPTARG
;;
r)
# Number of times to retry the action
RETRIES=$OPTARG
;;
esac
done
CHECK_OUTPUT=$($CHECK)
CHECK_EXITCODE=$?
echo -e "$CHECK_OUTPUT"
# For logic, it is easier to compare attempts to max_attempts.
# When a users says "0" retries, they really mean max_attempts=1
let MAX_ATTEMPTS=$RETRIES+1
if [ $CHECK_EXITCODE -eq 2 ]; then
# The check failed. Lets try remediation
if [[ -f "/tmp/$NAME" ]]; then
ATTEMPTS=$(cat "/tmp/$NAME")
else
ATTEMPTS=0
echo $ATTEMPTS > "/tmp/$NAME"
fi
echo ""
if [ $ATTEMPTS -ge $MAX_ATTEMPTS ]; then
echo "Not doing remediation. Already did $ATTEMPTS out of $MAX_ATTEMPTS attempts" >&2
else
ATTEMPTS=$((ATTEMPTS + 1))
echo "Trying remediation attempt $ATTEMPTS out of $MAX_ATTEMPTS..." >&2
$ACTION
echo $ATTEMPTS >"/tmp/$NAME"
fi
else
# The check has succeeded. Let's clean up
rm -f "/tmp/$NAME"
fi
exit $CHECK_EXITCODE
| true
|
dddb791125e0626cfd09e099187bbdc2d7997ebd
|
Shell
|
xwmhmily/miniSwoole
|
/shell/process.sh
|
UTF-8
| 210
| 2.796875
| 3
|
[
"MIT"
] |
permissive
|
#!/bin/bash
# Heartbeat the process
# Usage: sh process.sh
PHP=`which php`
PARENT_PATH=$(dirname "$PWD")
PROCESS_HEARTBEAT_FILE=$PARENT_PATH"/Boostrap.php"
cat logo.txt && $PHP $PROCESS_HEARTBEAT_FILE process
| true
|
24a17b2e354783815f0e905178d36e06b56e6a28
|
Shell
|
tmarble/gtalkice
|
/entrypoint.sh
|
UTF-8
| 1,253
| 3.65625
| 4
|
[
"MIT"
] |
permissive
|
#!/bin/sh
# entrypoint.sh
set -x
echo "YOU SAID $@"
# NOTE test will work for bash AND dash
# if test "X$@" = "X"; then
if [ "X$@" = "X" ]; then
cmd="iceweasel"
else
cmd=$@
fi
USER=${DOCKER_USER:-browser}
USER_UID=${DOCKER_UID:-1000}
USER_GID=${DOCKER_GID:-100}
# create user, if needed
if getent passwd $USER > /dev/null; then
echo "user exists: $USER"
else
echo "creating user: $USER"
# addgroup --gid $USER_GID $USER
adduser --disabled-login --uid $USER_UID --gid $USER_GID --gecos 'Browser User' --home /tmp/$USER $USER
if [ ! -d /home/$USER/.config ]; then
mkdir -p /home/$USER/.config
fi
if [ ! -e /home/$USER/.mozilla ]; then
ln -s .config/.mozilla /home/$USER/.mozilla
fi
chown -R $USER_UID.$USER_GID /home/$USER
chmod 770 /home/$USER/.config
mv /tmp/$USER/.[a-z]* /home/$USER/
usermod --home /home/$USER $USER
# addgroup $USER users
addgroup $USER audio
addgroup $USER video
fi
echo "DETAILS..."
ls -l /dev/video0
ls -l /tmp/.X11-unix
ls -ld /home/$USER/.config
ls -l /home/$USER/.config
echo "ENV..."
env
echo "GO..."
cd /home/$USER
if [ "$cmd" = "rootbash" ]; then
exec /bin/bash
fi
export HOME=/home/$USER
exec sudo --preserve-env -u $USER $cmd
| true
|
5e0e8918566e507bb7ea7c9b4edf598d6a54b40a
|
Shell
|
Biazid/Sports-Equipment-Management-System
|
/12.8/unixjobs/Base/Shell/Index Maintenance/rebuild_index_tablespace.sh
|
UTF-8
| 1,562
| 3.421875
| 3
|
[] |
no_license
|
#!/bin/sh
#-------------------------------------------------------
# File: rebuild_index_tablespace.sh
# Desc: Rebuild Indexes - Single Tablespace
# Runs: Noon Every Sunday = 0 12 * * 0
# Parm: 1 - Tablespace for which to Rebuild Indexes
# Parm: 2 - Parallel Degree (default 4)
#-------------------------------------------------------
# 1.0 07/11/2002 Initial script creation
# 1.1 07/12/2002 Added check for version 7 syntax
# 1.2 07/12/2002 Added whenever sqlerror
# 1.3 08/08/2002 Added TJS_SQL_SET1 and TJS_SQL_SET2
#-------------------------------------------------------
if [ $# -lt 1 ]
then
echo "Usage: `basename $0` TABLESPACE {PARALLEL_DEGREE (default 4)}"
exit 1
fi
if [ $# -lt 2 ]
then
TJS_PARALLEL_DEGREE=4
else
TJS_PARALLEL_DEGREE=$2
fi
TJS_LOG_TRAIL="$1"
export TJS_LOG_TRAIL
. $TJS_DIR/tjs_start_log.sh
if [ "$ORACLE_VERS" = "7.3" -o "$ORACLE_VERS" = "7.4" ]
then
TJS_NOLOG=unrecoverable
TJS_NOIOT=""
else
TJS_NOLOG=nologging
TJS_NOIOT="and index_type <> 'IOT - TOP'"
fi
$ORACLE_HOME/bin/sqlplus -s <<EOF
$ORACLE_DBA_UID/$ORACLE_DBA_UPW
WHENEVER SQLERROR EXIT FAILURE
$TJS_SQL_SET1
spool $TJS_TMP_FILE
select 'alter index '||owner||'.'||index_name||' rebuild parallel (degree $TJS_PARALLEL_DEGREE) $TJS_NOLOG;'
from all_indexes
where owner not in ('SYS','SYSTEM','DBSNMP','OUTLN')
and tablespace_name != 'SYSTEM'
and tablespace_name = upper('$1') $TJS_NOIOT
order by owner, table_name, index_name;
spool off
$TJS_SQL_SET2
@$TJS_TMP_FILE
EOF
TJS_RETURN_CODE=$?
rm -f $TJS_TMP_FILE
. $TJS_DIR/tjs_stop_log.sh
| true
|
2e00101144dc3c7e84dff1669ef420be4155e861
|
Shell
|
l3e0x7b/MyPrecious
|
/ShellScripts/st3_pc_channel_auto_update.sh
|
UTF-8
| 705
| 3.453125
| 3
|
[] |
no_license
|
#!/bin/bash
##
## Description: 定时推送最新 Sublime Text 3 package-control channel 文件到 GitHub。
##
## Author: l3e0x7b, <lyq0x7b@foxmail.com>
##
script_path='/opt/MyPrecious/ShellScripts' # 此脚本所在路径
repo='/opt/MyPrecious' # GitHub 仓库路径
cd ${repo} || exit
git pull
curl -Ssl https://packagecontrol.io/channel_v3.json -o Files/channel_v3.json
git add Files/channel_v3.json
git commit -m "Update Files/channel_v3.json"
git push origin main
if ! grep st3_pc_channel_auto_update /etc/crontab &> /dev/null; then
echo "0 0 * * * root bash ${script_path}/st3_pc_channel_auto_update.sh &> /dev/null" >> /etc/crontab
systemctl restart cron || systemctl restart crond
fi
| true
|
57c45276100e9dd11702f0e50a7d8b4148f8010f
|
Shell
|
tewksbum/amazon-chime-media-capture-pipeline-demo
|
/deploy.sh
|
UTF-8
| 2,977
| 3.71875
| 4
|
[
"MIT-0"
] |
permissive
|
#!/bin/bash
if ! [ -x "$(command -v node)" ]; then
echo 'Error: node is not installed. https://nodejs.org/en/download/' >&2
exit 1
fi
NODEVER="$(node --version)"
REQNODE="v12.0.0"
if ! [ "$(printf '%s\n' "$REQNODE" "$NODEVER" | sort -V | head -n1)" = "$REQNODE" ]; then
echo 'node must be version 12+ https://nodejs.org/en/download/'
exit 1
fi
if ! [ -x "$(command -v npm)" ]; then
echo 'Error: npm is not installed. https://www.npmjs.com/get-npm' >&2
exit 1
fi
if ! [ -x "$(command -v yarn)" ]; then
echo 'Error: yarn is not installed. https://yarnpkg.com/getting-started/install' >&2
exit 1
fi
if ! [ -x "$(command -v jq)" ]; then
echo 'Error: jq is not installed. https://stedolan.github.io/jq/download/' >&2
exit 1
fi
if ! [ -x "$(command -v pip3)" ]; then
echo 'Error: pip3 is not installed. https://pip.pypa.io/en/stable/installing/' >&2
exit 1
fi
if ! [ -x "$(command -v aws)" ]; then
echo 'Error: aws is not installed. https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html' >&2
exit 1
fi
if ! [ -x "$(command -v cdk)" ]; then
echo 'Error: cdk is not installed. https://docs.aws.amazon.com/cdk/latest/guide/getting_started.html#getting_started_install' >&2
exit 1
fi
if [ -f "cdk.context.json" ]; then
echo ""
echo "INFO: Removing cdk.context.json"
rm cdk.context.json
else
echo ""
echo "INFO: cdk.context.json not present, nothing to remove"
fi
if [ ! -f "yarn.lock" ]; then
echo ""
echo "Installing Packages"
echo ""
yarn
fi
echo ""
echo "Building Packages"
echo ""
if [ ! -d "python-layer/python/lib/python3.6/site-packages" ]; then
pushd python-layer/python/lib/python3.6
pip3 install -r requirements.txt --target site-packages
popd
fi
echo ""
echo "Checking ffmpeg Layer"
echo ""
FFMPEGLAYER_STATUS=$( aws cloudformation describe-stacks --stack-name ffmpegLayerStack --region us-east-1 | jq -r ".Stacks[0].StackStatus" )
if [ "$FFMPEGLAYER_STATUS" != "CREATE_COMPLETE" ]; then
echo "Deploying ffmpeg Layer"
TEMPLATE_URL=$(aws serverlessrepo create-cloud-formation-template --application-id arn:aws:serverlessrepo:us-east-1:145266761615:applications/ffmpeg-lambda-layer --region us-east-1 | jq -r '.TemplateUrl' | awk -F '?' '{print $1}')
aws cloudformation create-stack --stack-name ffmpegLayerStack --template-url $TEMPLATE_URL --region us-east-1 --capabilities CAPABILITY_AUTO_EXPAND
fi
FFMPEGLAYER_ARN=''
loopCount=0
while [[ "$FFMPEGLAYER_ARN" == '' || "$FFMPEGLAYER_ARN" == null ]]
do
if [ "$loopCount" -gt "5" ]; then
echo "Error creating ffmpegLayer"
exit 1
fi
let loopCount++
sleep 10
FFMPEGLAYER_ARN=$( aws cloudformation describe-stacks --stack-name ffmpegLayerStack --region us-east-1 | jq -r ".Stacks[0].Outputs[0].OutputValue" )
done
echo "ARN: $FFMPEGLAYER_ARN"
echo ""
echo "Building CDK"
echo ""
yarn run build
echo ""
echo "Deploying CDK"
echo ""
cdk deploy -O client/src/cdk-outputs.json -c ffmpegLayerARN=$FFMPEGLAYER_ARN
| true
|
a73c447153ce4c75201fa044688c114be89a5f54
|
Shell
|
whylu/cronMs
|
/cronMs.sh
|
UTF-8
| 1,580
| 4
| 4
|
[] |
no_license
|
# the install path
cronMs_path=$(pwd)
# the config path
config=$cronMs_path/config
# the pid file folder path of running process
startpid=$cronMs_path/startpid
# the status file path
status=$cronMs_path/status
# $1 => pid
# $2 => call interval time in second
# $3 => command
function addStatus() {
echo pid: $1, interval: $2 s, command: $3 >> $status
}
# $1 => call interval time in second
# $2 => command
function call_endless_loop() {
fullLine=$@
set -- $fullLine
interval=$1
shift
command=$@
echo $BASHPID start
touch $startpid/$BASHPID
addStatus $BASHPID $interval $command
while true;
do
$("$command") &
sleep $interval
done
}
function cron_start() {
while read line; do
set -- $line
interval=$1
shift
command=$@
if [ "$interval" > "0" ]; then
call_endless_loop $interval $command &
fi
done < $config
}
function cron_stop() {
if [ "$(ls -A $startpid)" ]; then
for file in $startpid/*;
do
echo kill "$(basename $file)"
kill -TERM "$(basename $file)"
rm -f $file
done
else
echo no pid to kill
fi
> $status
}
case "$1" in
start)
echo "start..."
cron_stop
cron_start >./log/msg.log 2>&1 &
;;
stop)
echo "stop..."
cron_stop
;;
status)
echo "pid | interval | command"
cat $status
;;
*)
echo "Usage $0 (start | stop | status)"
;;
esac
| true
|
c9a48523a2131bafb86a863899f066ca206a2b08
|
Shell
|
stewrav/opensuse-mods
|
/usr/local/bin/deadlinks
|
UTF-8
| 702
| 4
| 4
|
[] |
no_license
|
#!/usr/bin/sh
# Show dead symbolic links
# Checks only current directory, not subdirectory
# hence quicker
# Specify local variables
typeset dir
[[ $# -gt 1 ]] && {
print -u2 "Usage: ${0##*/} <directory>"
exit 1
}
# Specify default directory as home
if [[ $1 = "" ]]; then
dir=$HOME
else
dir=$1
fi
[[ -a "$dir" ]] || {
print -u2 "${0##*/}: $dir does not exist"
exit 2
}
[[ -d "$dir" ]] || {
print -u2 "${0##*/}: $dir is not a directory"
exit 3
}
[[ -r "$dir" ]] || {
print -u2 "${0##*/}: $dir cannot be read"
exit 4
}
[[ -x "$dir" ]] || {
print -u2 "${0##*/}: $dir cannot be searched"
exit 5
}
find $dir/* -prune -type l ! -path '*/.netscape/lock' -print | perl -nle '-e || print'
| true
|
6fdb603057324dda5b306862582014a0df3c1fd9
|
Shell
|
ArbitratorDAO/escrow-contract
|
/travscripts/AfterScript.sh
|
UTF-8
| 350
| 2.890625
| 3
|
[] |
no_license
|
#!/bin/bash
if [[ $TRAVIS_BRANCH =~ (feature/test-?(\/[a-zA-Z0-9/._-]*)?) ]]; then
echo " ==> Detected a CONTRACT(S) branch"
#jump back to root
cd $TRAVIS_BUILD_DIR
echo " ==> JUMPING LOCATIONS: NOW IN $TRAVIS_BUILD_DIR"
#run solcover
echo " ==> RUNNING solidity-coverage" &&
npm run coverage && cat coverage/lcov.info | coveralls
fi;
| true
|
2c01ee15e2686013c0649e485f893569651d942b
|
Shell
|
jhsu802701/generic_app_old
|
/gem_test.sh
|
UTF-8
| 277
| 2.53125
| 3
|
[
"MIT"
] |
permissive
|
#!/bin/bash
gem uninstall generic_app
DIR_GENERIC_APP=$PWD
DIR_PARENT="${PWD%/*}"
mkdir -p log
echo '=============='
echo 'bundle install'
bin/setup >/dev/null
echo '===='
echo 'rake'
rake
echo '======================'
echo 'bundle exec rubocop -D'
bundle exec rubocop -D
| true
|
a75c962fd2df915f56a03a66f96e035a447026a5
|
Shell
|
alanplatt/osimage-builder
|
/scripts/common/virtualbox.sh
|
UTF-8
| 1,044
| 3.546875
| 4
|
[
"Apache-2.0"
] |
permissive
|
#!/bin/sh -eux
HOME_DIR="/home/vagrant"
pubkey_url="https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub";
case "$PACKER_BUILDER_TYPE" in
virtualbox-iso|virtualbox-ovf)
#Install VBOX tools
VER="`cat /home/vagrant/.vbox_version`"
ISO="VBoxGuestAdditions_$VER.iso"
mkdir -p /tmp/vbox
mount -o loop $HOME_DIR/$ISO /tmp/vbox
sh /tmp/vbox/VBoxLinuxAdditions.run \
|| echo "VBoxLinuxAdditions.run exited $? and is suppressed." \
"For more read https://www.virtualbox.org/ticket/12479"
umount /tmp/vbox
rm -rf /tmp/vbox
mkdir -p $HOME_DIR/.ssh
if command -v wget >/dev/null 2>&1; then
wget --no-check-certificate "$pubkey_url" -O $HOME_DIR/.ssh/authorized_keys
elif command -v curl >/dev/null 2>&1; then
curl --insecure --location "$pubkey_url" > $HOME_DIR/.ssh/authorized_keys
else
echo "Cannot download vagrant public key"
exit 1
fi
chown -R vagrant $HOME_DIR/.ssh
chmod -R go-rwsx $HOME_DIR/.ssh
;;
esac
| true
|
5d7b5fa2a8d331f3bb5ee49c8407f7ac114012b7
|
Shell
|
jianyuh/cpu_gpu_profiling
|
/mkl/setfreq.sh
|
UTF-8
| 508
| 2.65625
| 3
|
[] |
no_license
|
#!/bin/sh
#export freq=2300000
#for i in $(seq 0 1 0)
#do
# echo ${i}
# cpufreq-set -c ${i} -g userspace
# cpufreq-set -c ${i} -f ${freq}
#done
#for x in /sys/devices/system/cpu/cpu[0-3]/cpufreq/;do
#for x in /sys/devices/system/cpu/cpu[0-71]/cpufreq;do
for i in $(seq 0 1 7)
do
echo /sys/devices/system/cpu/cpu${i}/cpufreq/scaling_max_freq
#echo 2501000 #> $x/scaling_max_freq
#echo 2300000 #> $x/scaling_max_freq
echo 3400000 > /sys/devices/system/cpu/cpu${i}/cpufreq/scaling_max_freq
done
| true
|
b762a663795a5aeeef9bde3610f4df7d39e9d6c4
|
Shell
|
petronny/aur3-mirror
|
/liferea-ext4/PKGBUILD
|
UTF-8
| 1,395
| 2.765625
| 3
|
[] |
no_license
|
# Maintainer: Alex Weil <ajonat at gmail dot com>
_pkgrealname=liferea
pkgname=${_pkgrealname}-ext4
pkgver=1.7.4
pkgrel=2
pkgdesc="A GTK desktop news aggregator for online news feeds and weblogs patched for ext4 filesystem to improve speed"
arch=('i686' 'x86_64')
url="http://liferea.sourceforge.net/"
license=('GPL')
depends=('gconf>=2.28.0' 'libwebkit>=1.1.11' 'libnotify>=0.4.5' 'libxslt>=1.1.24' 'sqlite3>=3.6.15' 'libunique' 'libsoup>=2.28.2' 'gtk2>=2.18.0' 'hicolor-icon-theme')
makedepends=('pkgconfig' 'diffutils' 'intltool')
options=('!libtool' '!emptydirs')
conflicts=('liferea')
install=liferea-ext4.install
source=(http://downloads.sourceforge.net/sourceforge/${_pkgrealname}/${_pkgrealname}-${pkgver}.tar.gz getenv_sync.patch libnotify.patch)
md5sums=('69ece60acc93a58cffb66e0e4f753704'
'a2724ece5abef7a3c42e44dfdeab06b5')
build() {
cd "${srcdir}/${_pkgrealname}-${pkgver}"
patch -Np1 -i ../getenv_sync.patch || return 1
patch -Np1 -i ../libnotify.patch || return 1
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-schemas-install || return 1
make || return 1
make DESTDIR="${pkgdir}" install || return 1
install -d "${pkgdir}/usr/share/gconf/schemas"
gconf-merge-schema "${pkgdir}/usr/share/gconf/schemas/${_pkgrealname}.schemas" \
"${pkgdir}"/etc/gconf/schemas/*.schemas || return 1
rm -f "${pkgdir}"/etc/gconf/schemas/*.schemas
}
| true
|
adffeb12ced9bdd856246f4aaebe7c31a46e44c4
|
Shell
|
zyex1108/SWARM-Gravity-Inversion
|
/scripts/gnv2gps.scr
|
UTF-8
| 1,280
| 3.4375
| 3
|
[
"MIT"
] |
permissive
|
#! /bin/bash
if [ $# -lt 3 ]
then
echo "usage: $0 year month day"
exit
fi
DIR=..
#DIR=$HOME/my_packages
if [ ! $INPUTexe ]; then
export INPUTexe=$DIR/bin
fi
if [ ! $INPUTdata ]; then
export INPUTdata=$DIR/data
fi
year=$1; month=$2; day=$3
ver=02
###############################################
if [ `expr length $ver` -eq 1 ]
then ver=0$ver
fi
if [ `expr length $month` -eq 1 ]
then month=0$month
fi
if [ `expr length $day` -eq 1 ]
then day=0$day
fi
case "$ver" in
01) dt=60 ;;
02) dt=5 ;;
esac
epoch=$year-$month-$day
DATA=.
INPUTA=$DATA/GNV1B_"$epoch"_A_"$ver".asc
INPUTB=$DATA/GNV1B_"$epoch"_B_"$ver".asc
OUTPUTA=$DATA/GPS"$ver"_"$epoch"_A.asc
OUTPUTB=$DATA/GPS"$ver"_"$epoch"_B.asc
FLEOP=$INPUTdata/eopc04_08_IAU2000.62-now
EXE=$INPUTexe/gnv2gps.e
PARAM=stdin
cat << PARAMEND1 > $PARAM
/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+--*/
Everybody Can Have Orbit: Global Set Option Cards
/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+--*/
EPOCH $year $month $day
GNV1B $INPUTA $INPUTB
GNV1C $OUTPUTA $OUTPUTB
EOP $FLEOP
DAYS 1
DT $dt
PARAMEND1
$EXE $PARAM
#time $INPUTexe $PARAM
rm $PARAM
| true
|
339ada90c09eafef455e6e664b2657f92620f7e1
|
Shell
|
a-vaniev/ubuntu-scripts
|
/thumbnailer/libreoffice/lo-thumbnailer-install.sh
|
UTF-8
| 2,630
| 3.234375
| 3
|
[] |
no_license
|
#!/bin/sh
# LibreOffice thumbnailer
# test Ubuntu distribution
DISTRO=$(lsb_release -is 2>/dev/null)
[ "${DISTRO}" != "Ubuntu" ] && { zenity --error --text="This automatic installation script is for Ubuntu only"; exit 1; }
# install tools
sudo apt-get -y install libfile-mimeinfo-perl gvfs-bin unzip netpbm
# install thumbnailer icons
sudo mkdir /usr/local/sbin/lo-thumbnailer.res
sudo wget -O /usr/local/sbin/lo-thumbnailer.res/lo-database.png https://raw.githubusercontent.com/NicolasBernaerts/ubuntu-scripts/master/thumbnailer/libreoffice/icons/lo-database.png
sudo wget -O /usr/local/sbin/lo-thumbnailer.res/lo-graphics.png https://raw.githubusercontent.com/NicolasBernaerts/ubuntu-scripts/master/thumbnailer/libreoffice/icons/lo-graphics.png
sudo wget -O /usr/local/sbin/lo-thumbnailer.res/lo-presentation.png https://raw.githubusercontent.com/NicolasBernaerts/ubuntu-scripts/master/thumbnailer/libreoffice/icons/lo-presentation.png
sudo wget -O /usr/local/sbin/lo-thumbnailer.res/lo-spreadsheet.png https://raw.githubusercontent.com/NicolasBernaerts/ubuntu-scripts/master/thumbnailer/libreoffice/icons/lo-spreadsheet.png
sudo wget -O /usr/local/sbin/lo-thumbnailer.res/lo-text.png https://raw.githubusercontent.com/NicolasBernaerts/ubuntu-scripts/master/thumbnailer/libreoffice/icons/lo-text.png
# install main script
sudo wget -O /usr/local/sbin/lo-thumbnailer https://raw.githubusercontent.com/NicolasBernaerts/ubuntu-scripts/master/thumbnailer/libreoffice/lo-thumbnailer
sudo chmod +rx /usr/local/sbin/lo-thumbnailer
# thumbnailer integration
sudo wget -O /usr/share/thumbnailers/lo.thumbnailer https://raw.githubusercontent.com/NicolasBernaerts/ubuntu-scripts/master/thumbnailer/libreoffice/lo.thumbnailer
# if present, disable gsf-office.thumbnailer (used in UbuntuGnome 16.04)
[ -f "/usr/share/thumbnailers/gsf-office.thumbnailer" ] && sudo mv /usr/share/thumbnailers/gsf-office.thumbnailer /usr/share/thumbnailers/gsf-office.thumbnailer.org
# if apparmor installed,
if [ -d "/etc/apparmor.d" ]
then
# declare the profile
sudo wget -O /etc/apparmor.d/usr.local.sbin.lo-thumbnailer https://raw.githubusercontent.com/NicolasBernaerts/ubuntu-scripts/master/thumbnailer/libreoffice/usr.local.sbin.lo-thumbnailer
# reload apparmor profiles
sudo service apparmor reload
fi
# stop nautilus
nautilus -q
# remove previously cached files (thumbnails and masks)
[ -d "$HOME/.cache/thumbnails" ] && rm --recursive --force $HOME/.cache/thumbnails/*
[ -d "$HOME/.thumbnails" ] && rm --recursive --force $HOME/.thumbnails/*
[ -d "$HOME/.cache/lo-thumbnailer" ] && rm --recursive --force $HOME/.cache/lo-thumbnailer
| true
|
18ddb3d27bf9bbd9da16f1f1bdc74fb2668262a1
|
Shell
|
d2bilisim/httpry
|
/sbin/httpry-logrotation
|
UTF-8
| 499
| 3.375
| 3
|
[] |
no_license
|
#!/bin/sh
# DansGuardian logrotation script for version 2.12.0.0
# httpry için modifiye edildi
LOG_DIR=/var/log
NUM_LOGS=4
LOG=$LOG_DIR/httpry.log
/usr/local/etc/rc.d/httpry stop
# Keep a maximum of $NUM_LOGS logs around.
if [ -f $LOG.$NUM_LOGS ]; then rm -f $LOG.$NUM_LOGS; fi
n=$(( $NUM_LOGS - 1 ))
while [ $n -gt 0 ]; do
if [ -f $LOG.$n ]; then
mv $LOG.$n $LOG.$(( $n + 1 ))
fi
n=$(( $n - 1 ))
done
if [ -f $LOG ]; then
mv $LOG $LOG.1
fi
sleep 5
/usr/local/etc/rc.d/httpry start
| true
|
5f2d652d375f5d76cfd1996d475954621a43b2b6
|
Shell
|
uuie/utilities-uuie
|
/ios-image-define-script/emotion_gen.sh
|
UTF-8
| 1,039
| 3.53125
| 4
|
[] |
no_license
|
#!/bin/sh
echo $SOURCE_ROOT
EMOTIONSDIR=$SOURCE_ROOT/Resources/emotions
TARGETFILE=$SOURCE_ROOT/emotions.plist
TEMPTARGET=$SOURCE_ROOT/emotions.plist.tmp
EMOTIONLIST=$SOURCE_ROOT/emotionlist.tmp
find $EMOTIONSDIR -name "*.gif"|awk '{print "\""$0"\""}' | xargs basename >$EMOTIONLIST
echo '<?xml version="1.0" encoding="UTF-8"?>'>$TEMPTARGET
echo '<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">'>>$TEMPTARGET
echo '<plist version="1.0">'>>$TEMPTARGET
echo '<dict>'>>$TEMPTARGET
cat $EMOTIONLIST | while read line
do
KEY=`echo $line|sed 's/[0-9][0-9]\(.*\).gif/\1/' `
echo ' <key>'$KEY'</key>'>>$TEMPTARGET
echo ' <string>'$line'</string>'>>$TEMPTARGET
done
echo '</dict>'>>$TEMPTARGET
echo '</plist>'>>$TEMPTARGET
echo diff -b $TEMPTARGET $TARGETFILE
HAS_CHANGE=`diff $TEMPTARGET $TARGETFILE`
if [ -z "$HAS_CHANGE" ];then
echo No change found since last modify
else
cat $TEMPTARGET >$TARGETFILE
fi
echo $TARGET_FILE generated
rm -f $EMOTIONLIST $TEMPTARGET
exit 0
| true
|
c71f51fdce63bc709c15522dc4d6c7838fadcf27
|
Shell
|
S10MC2015/cms-django
|
/dev-tools/code_style.sh
|
UTF-8
| 194
| 2.53125
| 3
|
[
"Apache-2.0"
] |
permissive
|
#!/bin/bash
# This script can be used to run both our code style tools black and pylint.
cd $(dirname "$BASH_SOURCE")/..
# Run black
pipenv run black .
# Run pylint
pipenv run pylint_runner
| true
|
30013f4581152e42c4c001b977b5796169de2db0
|
Shell
|
efrecon/docker-images
|
/binenv/hooks/build
|
UTF-8
| 1,908
| 3.84375
| 4
|
[
"BSD-3-Clause"
] |
permissive
|
#!/usr/bin/env sh
# Set good defaults to allow script to be run by hand. The two variables below
# will never be used when run from within the Docker hub.
DOCKER_REPO=${DOCKER_REPO:-"efrecon/binenv"}
SOURCE_COMMIT=${SOURCE_COMMIT:-$(git log --no-decorate|grep '^commit'|head -n 1| awk '{print $2}')}
# Minimum version of bat to build for.
MINVER=${MINVER:-0.7.0}
# You shouldn't really need to have to modify the following variables.
GH_PROJECT=devops-works/binenv
# shellcheck disable=SC1091
. "$(dirname "$0")/reg-tags/image_tags.sh"
# Login at the Docker hub to be able to access info about the image.
token=$(img_auth "$DOCKER_REPO")
echo "============== Gettings latest releases for $GH_PROJECT at github"
for tag in $(github_releases "$GH_PROJECT"); do
if [ "$(img_version "${tag#v}")" -ge "$(img_version "$MINVER")" ]; then
# Get the revision out of the org.opencontainers.image.revision label, this
# will be the label where we store information about this repo (it cannot be
# the tag, since we tag as the base image).
revision=$(img_labels --verbose --token "$token" -- "$DOCKER_REPO" "$tag" |
grep "^org.opencontainers.image.revision" |
sed -E 's/^org.opencontainers.image.revision=(.+)/\1/')
# If the revision is different from the source commit (including empty,
# which will happen when our version of the image does not already exist),
# build the image, making sure we label with the git commit sha at the
# org.opencontainers.image.revision OCI label, but using the same tag as the
# library image.
if [ "$revision" != "$SOURCE_COMMIT" ]; then
echo "============== No ${DOCKER_REPO}:$tag at $SOURCE_COMMIT"
docker build \
--build-arg BINENV_VERSION="$tag" \
--tag "${DOCKER_REPO}:$tag" \
--label "org.opencontainers.image.revision=$SOURCE_COMMIT" \
.
fi
fi
done
| true
|
3de498d34adfac7e0b7ad1c81191fd8e1f00ffd2
|
Shell
|
bugfix82/slackbuilds
|
/qemu/doinst.sh.in
|
UTF-8
| 395
| 3.203125
| 3
|
[] |
no_license
|
#!/bin/sh
user=kvm
group=kvm
/usr/bin/getent group ${group} > /dev/unll 2>&1 || (echo "Group ${group} not found, creating.."; /usr/sbin/groupadd -r ${group})
/usr/bin/id ${user} > /dev/null 2>&1 || (echo "User ${user} not found, creating.." ; /usr/sbin/useradd -r -s /sbin/nologin -g ${group} ${user})
echo -e "\n \
Be sure to add current user (${USER}) to group ${group} and relogin. \
\n"
| true
|
7938686a49baccf3232a3ca95cc68defe11f967f
|
Shell
|
simon-mo/inferline-models
|
/model_containers/old_containers/build_td2_docker_images.sh
|
UTF-8
| 589
| 3.078125
| 3
|
[] |
no_license
|
#!/usr/bin/env bash
set -e
set -u
set -o pipefail
unset CDPATH
# one-liner from http://stackoverflow.com/a/246128
# Determines absolute path of the directory containing
# the script.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Build RPC base images for python/anaconda and deep learning
# models
cd $DIR/../../../container_utils/
time docker build -t model-comp/py-rpc -f RpcDockerfile ./
cd $DIR
# Build model-specific images
time docker build -t model-comp/gensim-lda -f GensimLdaDockerfile ./
time docker build -t model-comp/gensim-docsim -f GensimDocsimDockerfile ./
| true
|
904bea8390da9e9fad37924c6fc5fcc144db695f
|
Shell
|
Vaishnav-P/SEM4
|
/system/lab2/armstrong.sh
|
UTF-8
| 527
| 4.09375
| 4
|
[] |
no_license
|
nofdigits()
{
count=0;
number=$1;
while [ $number != 0 ]
do
number=$(($number/10));
count=$(($count + 1));
done
return $count;
}
armstrong()
{
echo " Enter the number "
read num
`nofdigits $num`
count=$?
echo $count
temp=$num
sum=0
while [ $num != 0 ]
do
rem=$(( $num % 10 ))
sum=$( echo "$sum + $rem ^ $count" | bc )
num=$(( $num / 10 ))
done
echo $sum
if [ $sum -eq $temp ]
then
echo "Armstrong"
else
echo " Not Armstrong "
fi
}
armstrong
| true
|
ff2a46919f8035cee353aa5c80f8ab01e4ee5e76
|
Shell
|
Dmdv/ecs-workshop-blue-green-deployments
|
/bin/scripts/destroy.sh
|
UTF-8
| 1,614
| 2.921875
| 3
|
[
"MIT-0"
] |
permissive
|
#!/usr/bin/env bash
######################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# SPDX-License-Identifier: MIT-0 #
######################################################################
GREEN="\033[1;32m"
YELLOW="\033[1;33m"
echo -e "${GREEN}Start cleanup..."
export AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
export AWS_DEFAULT_REGION=$(aws configure get region)
export CODE_REPO_NAME=nginx-sample
export API_NAME=nginx-sample
export CONTAINER_PORT=80
export CIDR_RANGE=10.0.0.0/16
export CODE_REPO_URL=$(aws cloudformation describe-stacks --stack-name BlueGreenContainerImageStack --query 'Stacks[*].Outputs[?ExportName==`repositoryCloneUrlHttp`].OutputValue' --output text)
export ECR_REPO_NAME=$(aws cloudformation describe-stacks --stack-name BlueGreenContainerImageStack --query 'Stacks[*].Outputs[?ExportName==`ecrRepoName`].OutputValue' --output text)
export CODE_BUILD_PROJECT_NAME=$(aws cloudformation describe-stacks --stack-name BlueGreenContainerImageStack --query 'Stacks[*].Outputs[?ExportName==`codeBuildProjectName`].OutputValue' --output text)
export ECS_TASK_ROLE_ARN=$(aws cloudformation describe-stacks --stack-name BlueGreenContainerImageStack --query 'Stacks[*].Outputs[?ExportName==`ecsTaskRoleArn`].OutputValue' --output text)
cdk --app "npx ts-node bin/pipeline-stack.ts" destroy --require-approval never
cdk --app "npx ts-node bin/container-image-stack.ts" destroy --require-approval never
echo -e "${GREEN}Cleanup completed..."
| true
|
08c67024bf5693f07e0d4caf57d78805656622f3
|
Shell
|
KINGgemeenten/websitecrawler
|
/scripts/local/run.sh
|
UTF-8
| 2,814
| 3.578125
| 4
|
[] |
no_license
|
#!/bin/bash
(
# Obtain an exclusive lock, give up if unable (non-block)
if flock -x -n 200
then
# Check for updated inject URL's and domain URL filter
echo Downloading updated seed.txt
if curl -s -f http://example.org/ > seed.txt.new
then
# Check it has changed
if ! diff -q inject_urls/seed.txt seed.txt.new
then
# Attempt to fetch the other file
echo Downloading domain-urlfilter.txt
if curl -s -f http://example.org/ > domain-urlfilter.txt.new
then
# Check domain URL filter has changed
if ! diff -q conf/domain-urlfilter.txt domain-urlfilter.txt.new
then
# And if all lines have at least one dot
if [ `grep "\n" domain-urlfilter.txt.new | wc -l` -eq `grep . domain-urlfilter.txt.new | wc -l` ]
then
# Copy stuff to their new home
# mv seed.txt.new inject_urls/seed.txt
# mv domain-urlfilter.txt.new conf/domain-urlfilter.txt
# Inject some
echo ./inject.sh
else
echo Domain-urlfilter.txt does not conform to specs
fi
else
echo Domain-urlfilter.txt has not changed
fi
else
echo Could not download domain-urlfilter.txt
fi
else
echo Seed.txt has not changed
fi
echo Could not download seed.txt
fi
# Remove temp crap if it's still there
rm -f seed.txt.new domain-urlfilter.txt.new
# Check if there are URL's for one time free generation
if [ "$(ls -A free_urls/)" ]
then
# Generate filtered and normalized segment from the seed list
bin/nutch freegen free_urls/ crawl/segments/ -filter -normalize
# Remove the seed lists
rm free_urls/*
else
# Generate a fetch list (list of URL's to download) from the CrawlDB
bin/nutch generate crawl/crawldb crawl/segments -noFilter -noNorm -numFetchers 1 -adddays 0 -topN 40000
fi
# Check if we got a valid fetch list
if [ $? -ne 0 ]
then
echo "No fetch list generated"
exit
fi
# Get the newly created segement
SEGMENT=crawl/segments/`ls -tr crawl/segments|tail -1`
# Fetch (download and parse) the previously generated segment
bin/nutch fetch $SEGMENT
# We no longer need the segment's fetch list, free some bytes
rm -r $SEGMENT/crawl_generate
# Update the CrawlDB with the fetched records and newly discovered URL's
bin/nutch updatedb crawl/crawldb $SEGMENT
# Write the segment to the configured indexing backend
bin/nutch index -Dindexer.skip.notmodified=true crawl/crawldb $SEGMENT -deleteGone
# Delete any Hadoop tmp directory
rm -rf /tmp/hadoop-$USER
fi
) 200>/var/lock/run-crawl.lock
| true
|
b38513035b19a8ebdd2e673e4f8efe5041e9ff0f
|
Shell
|
dams946/TP_RT801
|
/TP_801/creaion_dest_contener/test_create.sh
|
UTF-8
| 1,782
| 3.265625
| 3
|
[] |
no_license
|
if [ $# -ne 6 ]
then
echo "le nombre d'argument manquante"
exit 1
fi
echo "---creation du conteneur---"
lxc-create -n $2 -t $1
if [ $? -ne 0 ]; then
echo "la creation du conteneur a échoué "
exit 1
fi
echo "Creation du Conteneur OK"
echo "-------------------------------------------------"
echo " Parametre du système"
echo "--- CPU / RAM"
echo "lxc.cgroup.cpuset.cpus= "$5 >> /var/lib/lxc/$2/config
if [ $? -ne 0 ]
then
echo "Attribution du CPU à échoue"
exit 1
fi
echo "--Attribution de CPU OK-- "
echo "------------------------------------------------------------"
echo "--------------------------changer le mot---------------------"
pass=$(openssl passwd -1 -salt ubuntu $6)
sed -i -e "s,^root:[^:]\+:,root:$pass:," /var/lib/lxc/$2/rootfs/etc/shadow
echo "lxc-cgroup.limit_in_bytes="$4 >> /var/lib/lxc/$2/config
if [ $? -ne 0 ]
then
echo "Attribution du RAM à échoue"
exit 1
fi
echo "--Attribution de RAM OK-- "
echo "-----------------------------------------"
echo "---> NETWORK---"
ed -i "s/lxc.net.0.type = veth/lxc.net.0.type = veth/g" /var/lib/lxc/$2/config
sed -i "s/lxc.net.0.link = lxcbr0/lxc.net.0.link = br1/g" /var/lib/lxc/$2/config
echo "lxc.net.0.veth.pair = br1-$2" >> /var/lib/lxc/$2/config
truncate -s 0 /var/lib/lxc/"$2"/rootfs/etc/netplan/10-lxc.yaml
cat int.txt >> /var/lib/lxc/"$2"/rootfs/etc/netplan/10-lxc.yaml
var2=$(echo $3)
sed -i 's,eth0: {dhcp4: true},eth0:\n addresses:\n - '$var2'\n gateway4: 192.168.10.1,g' /var/lib/lxc/"$2"/rootfs/etc/netplan/10-lxc.yaml
echo "--------------------------------------------"
lxc-start -n $2
echo "nameserver 8.8.8.8" | lxc-attach $2 tee /etc/resolv.conf > /dev/null
if [ $? -ne 0 ]
then
echo "------------DNS OK-----"
exit 1
fi
lxc-ls -f
| true
|
5a31214f688ed6a25a280c9c4f5025e8595ada0c
|
Shell
|
simontime/vgmstream
|
/version.sh
|
UTF-8
| 90
| 2.8125
| 3
|
[
"ISC",
"LicenseRef-scancode-public-domain"
] |
permissive
|
#!/bin/sh
DIR="`dirname "$0"`"
VERSION="`git describe --always | tr : _`"
echo "$VERSION"
| true
|
14688dc2388466d3bd2a0bcb616698e93f1a36ec
|
Shell
|
pallocate/tedit
|
/build/bin/build-scripts/plugins
|
UTF-8
| 1,061
| 3.578125
| 4
|
[
"MIT"
] |
permissive
|
#!/bin/sh
clear
cd /home/projects/plugins/plugins
# Print usage
printUsage () {
echo "Usage: $0 task"
echo
echo "Tasks:"
echo "all tests api"
}
PLUGINS_DIR="build/dist/platform/jvm/plugins"
DEPENDENCIES=$JNA:$PEN:$EXPOSED
task="all"
if [ $1 ]; then
task=$1
fi
### All (default) ###
if [ $task = "all" ]; then
cmd-timed "kotlinc -d . -cp $DEPENDENCIES src/common src/jvm"
rm -Rf $PLUGINS_DIR/**
mv -f plugins/** $PLUGINS_DIR
rm -R plugins
### Api ###
elif [ $task = "api" ]; then
echo "Creating api docs.." ; echo
java -cp $DEPENDENCIES -jar $DOKKA src/common src/jvm -output build/docs/plugins
### Tests ###
elif [ $task = "tests" ]; then
DEPENDENCIES=$JUNIT:$PLUGINS:$PEN_TESTS:$DEPENDENCIES
kotlinc -d $PLUGINS_DIR/examples.jar -cp $DEPENDENCIES -Xmulti-platform src/common_tests
if [ $? -eq 0 ]; then
cmd-timed "kotlinc -d build/dist/platform/jvm/plugins/tests.jar -cp $DEPENDENCIES:$PLUGINS_DIR/examples.jar -Xmulti-platform src/jvm_tests"
fi
else
printUsage
fi
echo
| true
|
cf12de93c3657df665034fafbe9905bad5cbe9b7
|
Shell
|
sgseo/hlshell
|
/install
|
UTF-8
| 1,715
| 2.625
| 3
|
[] |
no_license
|
#!/bin/bash
#希望你能尊重开发者的作品如果您转载请【保留本版权信息】
#狐狸脚本官网 http://www.hlshell.com
#————————————————————————————————————————
# ╦ ╦╦ ╔═╗╦ ╦╔═╗╦ ╦ ╔═╗╔═╗╔╦╗
# ╠═╣║ ╚═╗╠═╣║╣ ║ ║ ║ ║ ║║║║
# ╩ ╩╩═╝╚═╝╩ ╩╚═╝╩═╝╩═╝o╚═╝╚═╝╩ ╩
# Copyright © 2015-2016 狐狸脚本官网版权
#————————————————————————————————————————
files="/etc/s-hell"
source $files/cfg
rm -rf hlsh* dns* ots* install* *.sh* *.log*
cd /etc/hl-tmp
mkdir $files/log
rm -rf $files/log/*
function installep(){
wget -q $DOWNLOAD_URL/s~h/ep.sh -O ep.sh;sh ep.sh | tee $files/log/ep.log
}
function installsql(){
yum -y install mysql mysql-devel mysql-server
# rm -rf /var/lib/mysql
# mysql_install_db
chown -R mysql /var/lib/mysql
wget -q $DOWNLOAD_URL/s~h/sql.sh -O sql.sh;sh sql.sh | tee $files/log/sql.log
}
function installpm(){
wget -q $DOWNLOAD_URL/s~h/pm.sh -O upm.sh;sh upm.sh | tee $files/log/upm.log
}
function installfp(){
wget -q $DOWNLOAD_URL/s~h/fixphp.sh -O fixphp.sh;sh fixphp.sh | tee $files/log/fxp.log
}
function install52(){
wget -q $DOWNLOAD_URL/s~h/php52.sh -O php52.sh;sh php52.sh | tee $files/log/hp2.log
}
function install53(){
wget -q $DOWNLOAD_URL/s~h/php53.sh -O php53.sh;sh php53.sh | tee $files/log/hp3.log
rm -rf /tmp/*
}
function installend(){
wget -q $DOWNLOAD_URL/ok -O ok;sh ok
exit 1
}
installep
installsql
installpm
installfp
install52
install53
installend
| true
|
3b4f5828001a8a39d9aa8eee06d28e259510d128
|
Shell
|
devops-life/shell_python
|
/doc/Service/nagios/nrpe/check_http_status.sh
|
UTF-8
| 209
| 3.046875
| 3
|
[] |
no_license
|
#!/bin/sh
check=`curl -o /dev/null -s -m 10 --connect-timeout 10 -w %{http_code} $1`
if [ "$check" == "200" ]
then
echo "$1 is ok"
exit 0
else
echo "$1 Status: $check"
exit 2
fi
| true
|
b83def040719a4d36333f84da19573bf3ab7d165
|
Shell
|
rainmaple/paraflow
|
/paraflow-1.0-alpha1/bin/paraflow-run-class.sh
|
UTF-8
| 2,765
| 3.59375
| 4
|
[
"Apache-2.0"
] |
permissive
|
#!/usr/bin/env bash
if [ $# -lt 1 ];
then
echo "USAGE: $0 [-daemon] [-name serviceName] [-loggc] classname [opts]"
exit 1
fi
# get base dir
base_dir=$(dirname $0)
# add local jars into classpath
for file in "$base_dir"/../libs/*.jar;
do
CLASSPATH="$CLASSPATH":"$file"
done
if [ "x$PARAFLOW_HOME" = "x" ]; then
export PARAFLOW_HOME="$base_dir/../"
fi
# JMX settings
if [ -z "PARAFLOW_JMX_OPTS" ]; then
PARAFLOW_JMX_OPTS="-Dcom.sun.management.jxmremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false "
fi
# JMX port
if [ $JMX_PORT ]; then
PARAFLOW_JMX_OPTS="$PARAFLOW_JMX_OPTS -Dcom.sun.management.jmxremote.port=$JMX_PORT "
fi
# Log directory
if [ "x$LOG_DIR" = "x" ]; then
LOG_DIR="$base_dir/../logs"
fi
# Log4j settings
if [ -z "PARAFLOW_LOG4J_OPTS" ]; then
LOG4J_PATH="$base_dir/../config/log4j.properties"
PARAFLOW_LOG4J_OPTS="-Dlog4j.configuration=file:{$LOG4J_PATH}"
fi
# Generic jvm settings
if [ -z "$PARAFLOW_OPTS" ]; then
PARAFLOW_OPTS=""
fi
# Which java to use
if [ -z "$JAVA_HOME" ]; then
JAVA="java"
else
JAVA="$JAVA_HOME/bin/java"
fi
# Memory options
if [ -z "$PARAFLOW_HEAP_OPTS" ]; then
PARAFLOW_HEAP_OPTS="-Xmx256M"
fi
# JVM performance options
if [ -z "$PARAFLOW_JVM_PERFORMANCE_OPTS" ]; then
PARAFLOW_JVM_PERFORMANCE_OPTS="-server -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:+DisableExplicitGC -Djava.awt.headless=true"
fi
# Parse commands
while [ $# -gt 0 ]; do
COMMAND=$1
case $COMMAND in
-name)
DAEMON_NAME=$2
CONSOLE_OUTPUT_FILE=$LOG_DIR/$DAEMON_NAME.out
shift 2
;;
-loggc)
if [ -z "$PARAFLOW_GC_LOG_OPTS" ]; then
GC_LOG_ENABLED="true"
fi
shift
;;
-daemon)
DAEMON_MODE="true"
shift
;;
*)
break
;;
esac
done
# GC options
GC_FILE_SUFFIX='-gc.log'
GC_LOG_FILE_NAME=''
if [ "x$GC_LOG_ENABLED" = "xtrue" ]; then
GC_LOG_FILE_NAME=$DAEMON_NAME$GC_FILE_SUFFIX
PARAFLOW_GC_LOG_OPTS="-Xloggc:$LOG_DIR/$GC_LOG_FILE_NAME -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M"
fi
PARAFLOW_OPTS="-Dname=$DAEMON_NAME"
# Launch mode
if [ "x$DAEMON_MODE" = "xtrue" ]; then
echo "$DAEMON_NAME running in daemon mode."
nohup ${JAVA} ${PARAFLOW_HEAP_OPTS} ${PARAFLOW_JVM_PERFORMANCE_OPTS} ${PARAFLOW_GC_LOG_OPTS} ${PARAFLOW_JMX_OPTS} ${PARAFLOW_LOG4J_OPTS} -cp ${CLASSPATH} ${PARAFLOW_OPTS} "$@" > ${CONSOLE_OUTPUT_FILE} 2>&1 < /dev/null &
else
exec ${JAVA} ${PARAFLOW_HEAP_OPTS} ${PARAFLOW_JVM_PERFORMANCE_OPTS} ${PARAFLOW_GC_LOG_OPTS} ${PARAFLOW_JMX_OPTS} ${PARAFLOW_LOG4J_OPTS} -cp ${CLASSPATH} ${PARAFLOW_OPTS} "$@"
fi
| true
|
a449147c0d572ff1a55e5120b210ce657dc2edc8
|
Shell
|
apolonio/regex
|
/modulo3/modulo3_ex2.1.sh
|
UTF-8
| 664
| 3.453125
| 3
|
[] |
no_license
|
#!/bin/bash
#Scritp que verifica vários IPs com base nos IPs que estao dentro do arquivo hosts.txt
#Autor: Apolonio Santiago Junior (apolocomputacao@gmail.com)
#Versao 1.1
#Acrescentado uma variavel que recebe um arquivo
#Utilização ./modulo3_ex2.1.sh hosts.txt
lista=$(cat hosts.txt)
#A variavel $lista nao pode estar entre aspas
#senao o for vai tratar tudo como uma variavel
#pois ele nao consideraria as quebras de linhas entao use no for sem as aspas
for h in $lista
do
#Tanto a saida padrao com o saída de erro esta apontando para NULL
if ping -c1 -W2 "$h" 2> /dev/null 1>&2
then
echo "O host "$h" esta UP!"
else
echo "O host "$h" esta DOWN!"
fi
done
| true
|
5ca136f143f0cac354482eff7e900a3dbdf62edf
|
Shell
|
umair-uas/performane_toolkits_sh
|
/tools/write_emmc
|
UTF-8
| 1,818
| 3.328125
| 3
|
[] |
no_license
|
#!/bin/bash
logfile=write_emmc.log
echo "####################64k##############################"|tee $logfile
data_avail=`adb shell df -k|awk '/\/data/{if(match($6,"/data"))print $4;}'`
#data_avail=$1
echo "$data_avail"|tee -a $logfile
count_64k=0
count_64k=$(($data_avail/64))
echo "count_64k=$count_64k"|tee -a $logfile
#for i in {1..$count_64k};
for i in $(seq 1 1 $count_64k)
do
adb shell "dd if=//dev/urandom of=//data/tmp/${RANDOM}_64k.dat bs=64k count=1"
echo $i|tee -a $logfile
done;
#delete 30% of the count_64k
count_64k=``
delete_count=0
delete_count=$(($count_64k*30))
delete_count=$(($delete_count/100))
echo "delete_count=$delete_count"|tee -a $logfile
file_list=`ls *_64k`
j=0
for file in $file_list;do
echo "$j, rm -f $file"|tee -a $logfile
rm -f $file
j=`expr $j + 1`
if [ $j -gt $delete_count ];then
break;
fi
done
####################128k##############################
data_avail=`adb shell df -k|awk '/\/data/{if(match($6,"/data"))print $4;}'`
count_128k=0
count_128k=$(($data_avail/128))
echo "count_128k=$count_128k"|tee -a $logfile
for i in $(seq 1 1 $count_128k)
do
adb shell "dd if=//dev/urandom of=//data/tmp/${RANDOM}_128k.dat bs=128k count=1"
echo $i|tee -a $logfile
done;
file_list=`ls *_64k`
j=0
for file in $file_list;do
echo "$j, rm -f $file"|tee -a $logfile
rm -f $file
j=`expr $j + 1`
if [ $j -gt $delete_count ];then
break;
fi
done
####################256k##############################
data_avail=`adb shell df -k|awk '/\/data/{if(match($6,"/data"))print $4;}'`
count_256k=0
count_256k=$(($data_avail/256))
echo "count_256k=$count_256k"|tee -a $logfile
for i in $(seq 1 1 $count_256k)
do
adb shell "dd if=//dev/urandom of=//data/tmp/${RANDOM}_256k.dat bs=256k count=1"
echo $i|tee -a $logfile
done;
| true
|
48980e0ab321c701e9c51ce3c23de5fad296e5fc
|
Shell
|
mikew-lunarg/Vulkan-Builder
|
/MOVE_BUILD.txt
|
UTF-8
| 389
| 2.921875
| 3
|
[] |
no_license
|
#! /bin/bash -x
exit 1
# MOVE_BUILD : move build/install directories to a common dir
# TODO make this a cmdline arg
DIR="."
# capture the state of local branches per repo
ivr g bb > "$DIR/g_bb.txt"
mv ~/VK_INSTALL/ "$DIR"
mv ~/kvh/BUILD/ "$DIR/kvh"
mv ~/kvl/BUILD/ "$DIR/kvl"
mv ~/kvt/BUILD/ "$DIR/kvt"
mv ~/kvv/BUILD/ "$DIR/kvv"
mv ~/lvt/BUILD/ "$DIR/lvt"
mv ~/lvs/BUILD/ "$DIR/lvs"
| true
|
0b73611a7a6820246af7d651dfd6be92dd42ab1a
|
Shell
|
scriptzteam/SCENE-SCRiPTS
|
/Others/Other/glftpd_scripts/ip/keygen.Archive.sh
|
UTF-8
| 922
| 3.609375
| 4
|
[
"WTFPL"
] |
permissive
|
#!/bin/sh
# iP Keygen Only Archive (v0.2)
#
# This script copies keygen.only releases to an archive dir.
#
# Author: ip
#
# Disclamer: This code carries no warranty ..use at own risk...blah
#
# Best run from your freespace script.
#
# Ex.: ./keygen.Archive.sh /glftpd/site/0107
#
# $1 = Path of Dated Dir to Archive
#
######## CONFIG ######
archivedir="/iP/site/archive/keygen" #Where you Want Them Sent
####### END CONFIG
list=`ls $1`
for x in $list
do
if `test `echo $x|grep -i "keygen"` = true >> /dev/null`;then
if `test `echo $x|grep -i "only"` = true >> /dev/null`;then
mv $1/$x $archivedir >> /dev/null 2>&1
echo "$0 - Moving $x"
fi
fi
if `test `echo $x|grep -i "keymaker"` = true >> /dev/null`;then
if `test `echo $x|grep -i "only"` = true `;then
mv $1/$x $archivedir >> /dev/null 2>&1
echo "$0 - Moving $x"
fi
fi
done
exit 0;
| true
|
73a4c583709ae4cbe1625dfd19376232b965b784
|
Shell
|
ajaypb-eci/ECI
|
/ShellCode/EqualNumbers.sh
|
UTF-8
| 167
| 3.25
| 3
|
[] |
no_license
|
echo "Enter the a number:"
read a
echo "Enter the b number:"
read b
if [ "$a" == "$b" ]; then
echo "Two numbers are equal"
else
echo "Two numbers are Not equal"
fi
| true
|
d61b4ad7ff8e44b26d74cbfd304d7833b2021986
|
Shell
|
gnfisher/manjaro-dotfiles
|
/zshrc
|
UTF-8
| 1,242
| 2.9375
| 3
|
[] |
no_license
|
# The following lines were added by compinstall
zstyle ':completion:*' completer _expand _complete _ignored _correct _approximate
zstyle :compinstall filename '/home/greg/.zshrc'
autoload -Uz compinit
compinit
# End of lines added by compinstall
export PATH=$HOME/.bin:/usr/local/bin:$PATH
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
PROMPT='%F{green}%n%f@%F{magenta}%m%f %F{blue}%B%~%b%f %# '
export PS1='%B%~%b %# '
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash
HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
setopt appendhistory
# No arguments: `git status`
# With arguments: acts like `git`
g() {
if [[ $# -gt 0 ]]; then
git "$@"
else
git status
fi
}
# Make directory and change into it.
function mcd() {
mkdir -p "$1" && cd "$1";
}
# Load .env file into shell session for environment variables
function envup() {
if [ -f .env ]; then
export $(sed '/^ *#/ d' .env)
else
echo 'No .env file found' 1>&2
return 1
fi
}
# Aliases
alias tas="tmux -2 attach-session -t"
alias rs="bin/rails"
alias ra="bin/rake"
alias sp="bin/rspec"
alias gbc="git branch | cat"
alias vimrc="vim ~/.dotfiles/vimrc"
alias migrate="bin/rails db:migrate db:rollback && bin/rails db:migrate db:test:prepare"
| true
|
f427428ecbe5bb92809e1ccd5df17c5bc4b492b6
|
Shell
|
fedor-git/openvpn-server-route-add
|
/updown.sh
|
UTF-8
| 670
| 3.421875
| 3
|
[] |
no_license
|
#!/bin/bash
openvpn_config_dir="/etc/openvpn"
# static = true
# dynamic = false
static=true
# ./route-static.sh username [ up/down ]
# ./route-dynamic.sh username user_ip [ up/down ]
if $static ; then
script='route-static.sh'
else
script='route-dynamic.sh'
fi
case "$1" in
"connect" )
if $static ; then
eval "$openvpn_config_dir/src/$script $common_name up"
else
eval "$openvpn_config_dir/src/$script $common_name $ifconfig_pool_remote_ip up"
fi
;;
"disconnect" )
if $static ; then
eval "$openvpn_config_dir/src/$script $common_name down"
else
eval "$openvpn_config_dir/src/$script $common_name $ifconfig_pool_remote_ip down"
fi
;;
* )
echo "Error input"
;;
esac
| true
|
5566089ae771244ca3bcc2220847b7af43974adc
|
Shell
|
Harvard-MolSys-Lab/dynamic-workbench
|
/meta/setup/bootstrap.sh
|
UTF-8
| 4,417
| 3.328125
| 3
|
[] |
no_license
|
# Add MongoDB Package
echo 'Add MongoDB Package...'
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
echo 'MongoDB Package added.'
# Update System
echo 'Update system packages...'
apt-get -y update
echo 'Update completed.'
# Install other helper apps
echo 'Install system dependencies...'
apt-get -y install libssl-dev git-core pkg-config build-essential curl gcc g++
echo 'Install completed.'
# Install JSDuck
echo 'Installing JSDuck...'
sudo gem install jsduck
echo "Installed JSDuck: `jsduck --version`"
# Install Pandoc
echo 'Installing Pandoc...'
sudo apt-get -y install pandoc texlive
echo "Installed Pandoc: `which pandoc`"
echo "Installed xelatex: `which xelatex`"
# Install NodeJS
echo 'Installing NodeJS...'
# To install the current version, you'd want to use these commands instead.
# curl -sL https://deb.nodesource.com/setup | sudo bash -
# sudo apt-get install -y nodejs
echo 'Building from source...'
NODE_VERSION="0.6.19"
wget "http://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}.tar.gz"
tar -xvf node-v${NODE_VERSION}.tar.gz
cd node-v${NODE_VERSION}
./configure
make
sudo make install
echo "NodeJS install completed. Installed version: `node -v`"
echo "NodeJS installed to: `which node`"
echo "npm installed to: `which npm`"
# Install MongoDB
echo 'Install MongoDB...'
sudo apt-get install -y mongodb-org
echo "MongoDB install completed. Installed: `mongo --version`"
# Create and link relevant directories
echo 'Creating and linking user directories...'
sudo mkdir -p /mnt/dynamic-logs/logs
sudo mkdir -p /mnt/dynamic-user-data/files
sudo mkdir -p /home/webserver-user/share
sudo mkdir -p /home/webserver-user/fileshare/
sudo ln -s /mnt/dynamic-logs/logs /home/webserver-user/logs
sudo ln -s /mnt/dynamic-user-data/files /home/webserver-user/fileshare/files
sudo ln -s /mnt/infomachine2 /home/webserver-user/share/infomachine2
sudo ln -s /home/webserver-user/share/infomachine2 /home/webserver-user/app
sudo ln -s /home/webserver-user/logs /home/webserver-user/app/logs
# Change ownership
sudo chown -R webserver-user /mnt/infomachine2
sudo chown -R webserver-user /mnt/infomachine2/*
sudo chown -R webserver-user /mnt/dynamic-user-data
sudo chown -R webserver-user /mnt/dynamic-user-data/*
sudo chown -R webserver-user /mnt/dynamic-logs
sudo chown -R webserver-user /home/webserver-user/app/
sudo chown -R webserver-user /home/webserver-user/app/*
sudo chown -R webserver-user /home/webserver-user/logs/
sudo chown -R webserver-user /home/webserver-user/fileshare/
echo 'User setup completed.'
echo 'Setting up home directory for webserver-user...'
sudo cp -r /home/webserver-user/app/meta/home/* /home/webserver-user
sudo chown -R webserver-user /home/webserver-user
sudo chmod a+x /home/webserver-user/{repair,startup}
echo 'Home directory setup completed.'
echo 'Setting up Mongo data directory...'
sudo mkdir -p /data/db
sudo chmod 0755 /data/db
sudo chown mongodb:mongodb /data/db
# Install dependencies with npm
echo 'Installing dependencies with npm'
# tell npm to use known registrars, avoiding SSL errors
# https://github.com/npm/npm/wiki/Troubleshooting#ssl-error
sudo -H -u webserver-user sh -c 'cd /home/webserver-user/app && npm config set ca=""'
# force installation of latest dependencies from package.json
# use sudo so we can execute in context of webserver-user
# use -H to export home directory to subshell
# http://askubuntu.com/questions/338447/why-doesnt-home-change-if-i-use-sudo
sudo -H -u webserver-user sh -c 'cd /home/webserver-user/app && npm install && npm update'
echo 'Dependency installation completed.'
# Build bundled tools
echo 'Building tools...'
sudo -H -u webserver-user sh /home/webserver-user/app/meta/setup/tools.sh
echo 'Building tools completed.'
# Setup auto-start
echo 'Setting up Workbench to auto-start...'
sudo cp /home/webserver-user/app/meta/etc/init/workbench.conf /etc/init/workbench.conf
echo 'Completed.'
echo 'Starting workbench...'
sudo start workbench
echo 'Completed.'
echo "Workbench status: `sudo status workbench`"
export IP="`ifconfig eth1 2>/dev/null|awk '/inet addr:/ {print $2}'|sed 's/addr://'`"
echo "IP address: ${IP}"
echo "Setup completed. Use vagrant ssh to enter the virtual machine, or open http://$IP:3000 in a browser."
| true
|
4abbfc52325af842c831183ff4803e9bfce801b0
|
Shell
|
zioncoin2100/js-zion-sdk
|
/bower_publish.sh
|
UTF-8
| 301
| 2.890625
| 3
|
[
"Apache-2.0",
"MIT"
] |
permissive
|
#!/bin/bash
git clone "https://zion-jenkins@github.com/zion/bower-js-zion-sdk.git" bower
if [ ! -d "bower" ]; then
echo "Error cloning"
exit 1
fi
cp dist/* bower
cd bower
git add .
git commit -m $TRAVIS_TAG
git tag -a $TRAVIS_TAG -m $TRAVIS_TAG
git push origin master --tags
cd ..
rm -rf bower
| true
|
9b7a05d81b156c29f911cbbd8cf299c0a6da4137
|
Shell
|
tox2ik/local-bin
|
/ctorrent-pwd-fd
|
UTF-8
| 466
| 3.46875
| 3
|
[] |
no_license
|
#!/bin/bash
param=$1
param="${param%.torrent}.*\.torrent"
found=$(fd "${param}")
c=$( echo -e "$found" | wc -l)
if [[ $c -eq 1 ]] && [[ -n $found ]]; then
dirname "$found" >&2
ctorrent-pwd "$found"
else
echo '# 1:' $1
echo '# p:' $param
echo '# c:' $c
echo -e "$found" | sed 's/^/# /'
if echo -e "$found" | grep -q -e '\.bf$'; then
echo '# ==='
echo -e "$found" | grep '\.bf$' | sed "s/^/rm '/; s/\$/'/" #| sed '/^/rm "/; s/$/"/'
fi
fi
| true
|
d07cdd97e584e855297c2717053a2a77c2c81e05
|
Shell
|
ijleesw/data-compression
|
/test.sh
|
UTF-8
| 14,941
| 2.875
| 3
|
[] |
no_license
|
echo "Building executables"
echo ""
rm result/tunstall/* > /dev/null 2>&1
rm result/golomb/* > /dev/null 2>&1
rm result/arithmetic/* > /dev/null 2>&1
rm result/gzip/* > /dev/null 2>&1
rm result/bzip2/* > /dev/null 2>&1
rm result/xz/* > /dev/null 2>&1
rm result/static_huffman/* > /dev/null 2>&1
rm result/adaptive_huffman/* > /dev/null 2>&1
rm result/lz77/* > /dev/null 2>&1
rm result/lz78/* > /dev/null 2>&1
rm result/lzss/* > /dev/null 2>&1
rm result/lzw/* > /dev/null 2>&1
make clean
make
echo "Running Static Huffman Code Compression/Decompression"
python src/main.py -c static_huffman -i data/SD1 -v
python src/main.py -c static_huffman -i data/SD2 -v
python src/main.py -c static_huffman -i data/SD3 -v
python src/main.py -c static_huffman -i data/SD4 -v
python src/main.py -c static_huffman -i data/dnaby -v
python src/main.py -c static_huffman -i data/englishby -v
python src/main.py -c static_huffman -i data/xmlby -v
echo "Running Adaptive Huffman Code Compression/Decompression"
python src/main.py -c adaptive_huffman -i data/SD1 -v
python src/main.py -c adaptive_huffman -i data/SD2 -v
python src/main.py -c adaptive_huffman -i data/SD3 -v
python src/main.py -c adaptive_huffman -i data/SD4 -v
python src/main.py -c adaptive_huffman -i data/dnaby -v
python src/main.py -c adaptive_huffman -i data/englishby -v
python src/main.py -c adaptive_huffman -i data/xmlby -v
echo "Running Golomb Code Compression/Decompression"
./golomb data/SD1 result/golomb/SD1_compressed result/golomb/SD1_decompressed
./golomb data/SD2 result/golomb/SD2_compressed result/golomb/SD2_decompressed
./golomb data/SD3 result/golomb/SD3_compressed result/golomb/SD3_decompressed
./golomb data/SD4 result/golomb/SD4_compressed result/golomb/SD4_decompressed
./golomb data/dnaby result/golomb/dnaby_compressed result/golomb/dnaby_decompressed
./golomb data/englishby result/golomb/englishby_compressed result/golomb/englishby_decompressed
./golomb data/xmlby result/golomb/xmlby_compressed result/golomb/xmlby_decompressed
echo "Running Tunstall Code Compression/Decompression"
./tunstall data/SD1 result/tunstall/SD1_compressed result/tunstall/SD1_decompressed
./tunstall data/SD2 result/tunstall/SD2_compressed result/tunstall/SD2_decompressed
./tunstall data/SD3 result/tunstall/SD3_compressed result/tunstall/SD3_decompressed
./tunstall data/SD4 result/tunstall/SD4_compressed result/tunstall/SD4_decompressed
./tunstall data/dnaby result/tunstall/dnaby_compressed result/tunstall/dnaby_decompressed
./tunstall data/englishby result/tunstall/englishby_compressed result/tunstall/englishby_decompressed
./tunstall data/xmlby result/tunstall/xmlby_compressed result/tunstall/xmlby_decompressed
echo "Running Arithmetic Coding Compression/Decompression"
./arithmetic data/SD1 result/arithmetic/SD1_compressed result/arithmetic/SD1_decompressed
./arithmetic data/SD2 result/arithmetic/SD2_compressed result/arithmetic/SD2_decompressed
./arithmetic data/SD3 result/arithmetic/SD3_compressed result/arithmetic/SD3_decompressed
./arithmetic data/SD4 result/arithmetic/SD4_compressed result/arithmetic/SD4_decompressed
./arithmetic data/dnaby result/arithmetic/dnaby_compressed result/arithmetic/dnaby_decompressed
./arithmetic data/englishby result/arithmetic/englishby_compressed result/arithmetic/englishby_decompressed
./arithmetic data/xmlby result/arithmetic/xmlby_compressed result/arithmetic/xmlby_decompressed
echo "Running LZ77 Compression/Decompression"
python src/main.py -c lz77 -i data/SD1 -v
python src/main.py -c lz77 -i data/SD2 -v
python src/main.py -c lz77 -i data/SD3 -v
python src/main.py -c lz77 -i data/SD4 -v
python src/main.py -c lz77 -i data/dnaby -v
python src/main.py -c lz77 -i data/englishby -v
python src/main.py -c lz77 -i data/xmlby -v
echo "Running LZ78 Compression/Decompression"
./lz78 -i data/SD1 -o result/lz78/SD1_compressed
./lz78 -i data/SD2 -o result/lz78/SD2_compressed
./lz78 -i data/SD3 -o result/lz78/SD3_compressed
./lz78 -i data/SD4 -o result/lz78/SD4_compressed
./lz78 -i data/dnaby -o result/lz78/dnaby_compressed
./lz78 -i data/englishby -o result/lz78/englishby_compressed
./lz78 -i data/xmlby -o result/lz78/xmlby_compressed
./lz78 -i result/lz78/SD1_compressed -o result/lz78/SD1_decompressed -d
./lz78 -i result/lz78/SD2_compressed -o result/lz78/SD2_decompressed -d
./lz78 -i result/lz78/SD3_compressed -o result/lz78/SD3_decompressed -d
./lz78 -i result/lz78/SD4_compressed -o result/lz78/SD4_decompressed -d
./lz78 -i result/lz78/dnaby_compressed -o result/lz78/dnaby_decompressed -d
./lz78 -i result/lz78/englishby_compressed -o result/lz78/englishby_decompressed -d
./lz78 -i result/lz78/xmlby_compressed -o result/lz78/xmlby_decompressed -d
echo "Running LZSS Compression/Decompression"
python src/main.py -c lzss -i data/SD1 -v
python src/main.py -c lzss -i data/SD2 -v
python src/main.py -c lzss -i data/SD3 -v
python src/main.py -c lzss -i data/SD4 -v
python src/main.py -c lzss -i data/dnaby -v
python src/main.py -c lzss -i data/englishby -v
python src/main.py -c lzss -i data/xmlby -v
echo "Running LZW Compression/Decompression"
python src/main.py -c lzw -i data/SD1 -v
python src/main.py -c lzw -i data/SD2 -v
python src/main.py -c lzw -i data/SD3 -v
python src/main.py -c lzw -i data/SD4 -v
python src/main.py -c lzw -i data/dnaby -v
python src/main.py -c lzw -i data/englishby -v
python src/main.py -c lzw -i data/xmlby -v
echo "Running Unix gzip"
cp data/SD1 result/gzip/SD1_compressed
cp data/SD2 result/gzip/SD2_compressed
cp data/SD3 result/gzip/SD3_compressed
cp data/SD4 result/gzip/SD4_compressed
cp data/dnaby result/gzip/dnaby_compressed
cp data/englishby result/gzip/englishby_compressed
cp data/xmlby result/gzip/xmlby_compressed
gzip result/gzip/SD1_compressed
gzip result/gzip/SD2_compressed
gzip result/gzip/SD3_compressed
gzip result/gzip/SD4_compressed
gzip result/gzip/dnaby_compressed
gzip result/gzip/englishby_compressed
gzip result/gzip/xmlby_compressed
echo "Running Unix bzip2"
cp data/SD1 result/bzip2/SD1_compressed
cp data/SD2 result/bzip2/SD2_compressed
cp data/SD3 result/bzip2/SD3_compressed
cp data/SD4 result/bzip2/SD4_compressed
cp data/dnaby result/bzip2/dnaby_compressed
cp data/englishby result/bzip2/englishby_compressed
cp data/xmlby result/bzip2/xmlby_compressed
bzip2 result/bzip2/SD1_compressed
bzip2 result/bzip2/SD2_compressed
bzip2 result/bzip2/SD3_compressed
bzip2 result/bzip2/SD4_compressed
bzip2 result/bzip2/dnaby_compressed
bzip2 result/bzip2/englishby_compressed
bzip2 result/bzip2/xmlby_compressed
echo "Running Unix xz"
cp data/SD1 result/xz/SD1_compressed
cp data/SD2 result/xz/SD2_compressed
cp data/SD3 result/xz/SD3_compressed
cp data/SD4 result/xz/SD4_compressed
cp data/dnaby result/xz/dnaby_compressed
cp data/englishby result/xz/englishby_compressed
cp data/xmlby result/xz/xmlby_compressed
xz result/xz/SD1_compressed
xz result/xz/SD2_compressed
xz result/xz/SD3_compressed
xz result/xz/SD4_compressed
xz result/xz/dnaby_compressed
xz result/xz/englishby_compressed
xz result/xz/xmlby_compressed
echo ""
# How to use checker:
# Add ./checker <data name> <original file path> <compressed file path> <decompressed file path>
echo "Compression Ratio of Static Huffman Code"
./checker SD1 data/SD1 result/static_huffman/SD1_compressed result/static_huffman/SD1_decompressed
./checker SD2 data/SD2 result/static_huffman/SD2_compressed result/static_huffman/SD2_decompressed
./checker SD3 data/SD3 result/static_huffman/SD3_compressed result/static_huffman/SD3_decompressed
./checker SD4 data/SD4 result/static_huffman/SD4_compressed result/static_huffman/SD4_decompressed
./checker dnaby data/dnaby result/static_huffman/dnaby_compressed result/static_huffman/dnaby_decompressed
./checker englishby data/englishby result/static_huffman/englishby_compressed result/static_huffman/englishby_decompressed
./checker xmlby data/xmlby result/static_huffman/xmlby_compressed result/static_huffman/xmlby_decompressed
echo ""
echo "Compression Ratio of Adaptive Huffman Code"
./checker SD1 data/SD1 result/adaptive_huffman/SD1_compressed result/adaptive_huffman/SD1_decompressed
./checker SD2 data/SD2 result/adaptive_huffman/SD2_compressed result/adaptive_huffman/SD2_decompressed
./checker SD3 data/SD3 result/adaptive_huffman/SD3_compressed result/adaptive_huffman/SD3_decompressed
./checker SD4 data/SD4 result/adaptive_huffman/SD4_compressed result/adaptive_huffman/SD4_decompressed
./checker dnaby data/dnaby result/adaptive_huffman/dnaby_compressed result/adaptive_huffman/dnaby_decompressed
./checker englishby data/englishby result/adaptive_huffman/englishby_compressed result/adaptive_huffman/englishby_decompressed
./checker xmlby data/xmlby result/adaptive_huffman/xmlby_compressed result/adaptive_huffman/xmlby_decompressed
echo ""
echo "Compression Ratio of Golomb Code"
./checker SD1 data/SD1 result/golomb/SD1_compressed result/golomb/SD1_decompressed
./checker SD2 data/SD2 result/golomb/SD2_compressed result/golomb/SD2_decompressed
./checker SD3 data/SD3 result/golomb/SD3_compressed result/golomb/SD3_decompressed
./checker SD4 data/SD4 result/golomb/SD4_compressed result/golomb/SD4_decompressed
./checker dnaby data/dnaby result/golomb/dnaby_compressed result/golomb/dnaby_decompressed
./checker englishby data/englishby result/golomb/englishby_compressed result/golomb/englishby_decompressed
./checker xmlby data/xmlby result/golomb/xmlby_compressed result/golomb/xmlby_decompressed
echo ""
echo "Compression Ratio of Tunstall Code"
./checker SD1 data/SD1 result/tunstall/SD1_compressed result/tunstall/SD1_decompressed
./checker SD2 data/SD2 result/tunstall/SD2_compressed result/tunstall/SD2_decompressed
./checker SD3 data/SD3 result/tunstall/SD3_compressed result/tunstall/SD3_decompressed
./checker SD4 data/SD4 result/tunstall/SD4_compressed result/tunstall/SD4_decompressed
./checker dnaby data/dnaby result/tunstall/dnaby_compressed result/tunstall/dnaby_decompressed
./checker englishby data/englishby result/tunstall/englishby_compressed result/tunstall/englishby_decompressed
./checker xmlby data/xmlby result/tunstall/xmlby_compressed result/tunstall/xmlby_decompressed
echo ""
echo "Compression Ratio of Arithmetic Coding"
./checker SD1 data/SD1 result/arithmetic/SD1_compressed result/arithmetic/SD1_decompressed
./checker SD2 data/SD2 result/arithmetic/SD2_compressed result/arithmetic/SD2_decompressed
./checker SD3 data/SD3 result/arithmetic/SD3_compressed result/arithmetic/SD3_decompressed
./checker SD4 data/SD4 result/arithmetic/SD4_compressed result/arithmetic/SD4_decompressed
./checker dnaby data/dnaby result/arithmetic/dnaby_compressed result/arithmetic/dnaby_decompressed
./checker englishby data/englishby result/arithmetic/englishby_compressed result/arithmetic/englishby_decompressed
./checker xmlby data/xmlby result/arithmetic/xmlby_compressed result/arithmetic/xmlby_decompressed
echo ""
echo "Compression Ratio of LZ77"
./checker SD1 data/SD1 result/lz77/SD1_compressed result/lz77/SD1_decompressed
./checker SD2 data/SD2 result/lz77/SD2_compressed result/lz77/SD2_decompressed
./checker SD3 data/SD3 result/lz77/SD3_compressed result/lz77/SD3_decompressed
./checker SD4 data/SD4 result/lz77/SD4_compressed result/lz77/SD4_decompressed
./checker dnaby data/dnaby result/lz77/dnaby_compressed result/lz77/dnaby_decompressed
./checker englishby data/englishby result/lz77/englishby_compressed result/lz77/englishby_decompressed
./checker xmlby data/xmlby result/lz77/xmlby_compressed result/lz77/xmlby_decompressed
echo ""
echo "Compression Ratio of LZ78"
./checker SD1 data/SD1 result/lz78/SD1_compressed result/lz78/SD1_decompressed
./checker SD2 data/SD2 result/lz78/SD2_compressed result/lz78/SD2_decompressed
./checker SD3 data/SD3 result/lz78/SD3_compressed result/lz78/SD3_decompressed
./checker SD4 data/SD4 result/lz78/SD4_compressed result/lz78/SD4_decompressed
./checker dnaby data/dnaby result/lz78/dnaby_compressed result/lz78/dnaby_decompressed
./checker englishby data/englishby result/lz78/englishby_compressed result/lz78/englishby_decompressed
./checker xmlby data/xmlby result/lz78/xmlby_compressed result/lz78/xmlby_decompressed
echo ""
echo "Compression Ratio of LZSS"
./checker SD1 data/SD1 result/lzss/SD1_compressed result/lzss/SD1_decompressed
./checker SD2 data/SD2 result/lzss/SD2_compressed result/lzss/SD2_decompressed
./checker SD3 data/SD3 result/lzss/SD3_compressed result/lzss/SD3_decompressed
./checker SD4 data/SD4 result/lzss/SD4_compressed result/lzss/SD4_decompressed
./checker dnaby data/dnaby result/lzss/dnaby_compressed result/lzss/dnaby_decompressed
./checker englishby data/englishby result/lzss/englishby_compressed result/lzss/englishby_decompressed
./checker xmlby data/xmlby result/lzss/xmlby_compressed result/lzss/xmlby_decompressed
echo ""
echo "Compression Ratio of LZW"
./checker SD1 data/SD1 result/lzw/SD1_compressed result/lzw/SD1_decompressed
./checker SD2 data/SD2 result/lzw/SD2_compressed result/lzw/SD2_decompressed
./checker SD3 data/SD3 result/lzw/SD3_compressed result/lzw/SD3_decompressed
./checker SD4 data/SD4 result/lzw/SD4_compressed result/lzw/SD4_decompressed
./checker dnaby data/dnaby result/lzw/dnaby_compressed result/lzw/dnaby_decompressed
./checker englishby data/englishby result/lzw/englishby_compressed result/lzw/englishby_decompressed
./checker xmlby data/xmlby result/lzw/xmlby_compressed result/lzw/xmlby_decompressed
echo ""
echo "Compression Ratio of gzip"
./checker SD1 data/SD1 result/gzip/SD1_compressed.gz -skip
./checker SD2 data/SD2 result/gzip/SD2_compressed.gz -skip
./checker SD3 data/SD3 result/gzip/SD3_compressed.gz -skip
./checker SD4 data/SD4 result/gzip/SD4_compressed.gz -skip
./checker dnaby data/dnaby result/gzip/dnaby_compressed.gz -skip
./checker englishby data/englishby result/gzip/englishby_compressed.gz -skip
./checker xmlby data/xmlby result/gzip/xmlby_compressed.gz -skip
echo ""
echo "Compression Ratio of bzip2"
./checker SD1 data/SD1 result/bzip2/SD1_compressed.bz2 -skip
./checker SD2 data/SD2 result/bzip2/SD2_compressed.bz2 -skip
./checker SD3 data/SD3 result/bzip2/SD3_compressed.bz2 -skip
./checker SD4 data/SD4 result/bzip2/SD4_compressed.bz2 -skip
./checker dnaby data/dnaby result/bzip2/dnaby_compressed.bz2 -skip
./checker englishby data/englishby result/bzip2/englishby_compressed.bz2 -skip
./checker xmlby data/xmlby result/bzip2/xmlby_compressed.bz2 -skip
echo ""
echo "Compression Ratio of xz"
./checker SD1 data/SD1 result/xz/SD1_compressed.xz -skip
./checker SD2 data/SD2 result/xz/SD2_compressed.xz -skip
./checker SD3 data/SD3 result/xz/SD3_compressed.xz -skip
./checker SD4 data/SD4 result/xz/SD4_compressed.xz -skip
./checker dnaby data/dnaby result/xz/dnaby_compressed.xz -skip
./checker englishby data/englishby result/xz/englishby_compressed.xz -skip
./checker xmlby data/xmlby result/xz/xmlby_compressed.xz -skip
echo ""
echo "Removing executables"
make clean
rm -r lz78.dSYM > /dev/null 2>&1
| true
|
90fc4b96ba3301987b8fb60d71802f317c36d4e6
|
Shell
|
Thlr/dotfiles-arch
|
/scripts/.local/bin/statusbar/updates
|
UTF-8
| 111
| 2.515625
| 3
|
[] |
no_license
|
#!/bin/sh
case $BUTTON in
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
paru -Sy
echo "$( paru -Qu | wc -l)"
| true
|
defb281c6e9355d6623dfb40726c7c7559a9d255
|
Shell
|
leodh/RPython-internship
|
/Interpreters/AE/scriptTests.sh
|
UTF-8
| 675
| 3.265625
| 3
|
[] |
no_license
|
#!/bin/sh
#To compare performances of AE-interpreter
export i=5
export name=""
export begin=0
export end=0
exporte time=0
until [ "$i" -gt 50 ];
do
echo "Generating an example of depth $i"
name="exampleDepth$i"
python writeExpr.py -i $name $i
echo "Interpreting with python and interpreter.py"
# begin=`date+%s`
time python interpreter.py $name
# end=`date+%s`
# time=`expr $end - $begin`
# echo "It took $time"
rm *.pyc
echo "interpreting with pypy and interpreter.py"
time pypy interpreter.py $name
rm *.pyc
echo "using translated version of RPinterpreter.py"
time ./RPinterpreter-c $name
i=`expr $i + 5`
done
| true
|
e27bed9273864e36deb51481fdd8a7c54932445d
|
Shell
|
zahirekrem09/Bash_Script
|
/bashscript_notebook/fordongu.sh
|
UTF-8
| 280
| 3.390625
| 3
|
[] |
no_license
|
#!/bin/bash
for i in 1 2 3 4 5
do
echo $i
done
for i in ls pwd
do
echo "-----------$i----------------"
$i
echo
done
for i in {1..10..2}
do
echo $i
done
for (( i=0 ; i<=10 ; i++ ))
do
if [ $i -gt 5 ]
then
break
fi
echo $i
sleep 1
done
| true
|
bdd6561f538cab266952b84b5b887243047c7fac
|
Shell
|
rlacerda83/common-sdk
|
/bin/init.sh
|
UTF-8
| 451
| 3.296875
| 3
|
[
"MIT"
] |
permissive
|
#!/bin/bash
# @Date: 2016-07-08T08:56:28-03:00
# @Modified at 2016-07-08T08:57:32-03:00
# {release_id}
commonSdk="$(dirname $0)/../";
PW=`pwd`;
CURRENT_BRANCH=`git branch | grep '\*' | awk '{print $2}'`
if [ $# -eq 0 ]
then
echo "No arguments supplied";
exit 1;
fi
PROJECT_NAME=$1;
size=${#PROJECT_NAME}
if [ $size -lt 7 ]
then
echo "Project Name missed!";
exit 2;
fi
h1() {
printf "\n- $1\n";
}
h1 "gpupo/common-sdk";
| true
|
f88efe1dfa1855371e57a984f3e60d09b3d22f9d
|
Shell
|
laggardkernel/spacezsh-prompt
|
/lib/utils/+vi-hg-untracked
|
UTF-8
| 539
| 2.84375
| 3
|
[
"MIT"
] |
permissive
|
#!/usr/bin/env zsh
# vim: ft=zsh fdm=marker foldlevel=0 sw=2 ts=2 sts=2 et
#
# spacezsh/sections/hg_status
# hg: Show marker if there are untracked files in repository
# Make sure you have added unstaged to your 'formats': %u
function +vi-hg-untracked {
[[ -n "${hook_com[index]}" ]] || hook_com[index]=$(command hg status 2>/dev/null)
if <<< "${hook_com[index]}" command grep -E '^\? ' &> /dev/null ; then
hook_com[unstaged]+="${SPACESHIP_VCS_UNTRACKED}"
_SS_DATA[vcs_workdir_half_dirty]=true
fi
}
+vi-hg-untracked "$@"
| true
|
475db6966d5a9eaa34949e51f320b4b43731a2de
|
Shell
|
CESNET/perun-services
|
/slave/process-k5login-root/bin/process-k5login_root.sh
|
UTF-8
| 703
| 3.5625
| 4
|
[
"BSD-2-Clause",
"BSD-2-Clause-Views"
] |
permissive
|
#!/bin/bash
PROTOCOL_VERSION='3.0.0'
function process {
if [ -z "$DST_FILE" ]; then
DST_FILE="/root/.k5login"
fi
### Status codes
I_CHANGED=(0 "${DST_FILE} updated")
I_NOT_CHANGED=(0 "${DST_FILE} has not changed")
E_CHOWN=(50 'Cannot chown on ${FROM_PERUN}')
E_CHMOD=(51 'Cannot chmod on ${FROM_PERUN}')
FROM_PERUN="${WORK_DIR}/k5login_root"
create_lock
# Destination file doesn't exist
if [ ! -f ${DST_FILE} ]; then
catch_error E_CHOWN chown root.root $FROM_PERUN
catch_error E_CHMOD chmod 0644 $FROM_PERUN
fi
# Create diff between old.perun and .new
diff_mv_sync "${FROM_PERUN}" "${DST_FILE}"
if [ $? -eq 0 ]; then
log_msg I_CHANGED
else
log_msg I_NOT_CHANGED
fi
}
| true
|
582d8fcfb79c77803c840dad280a73378467de9f
|
Shell
|
achaphiv/ppa-fonts
|
/ppa/bin/build-cairo
|
UTF-8
| 822
| 3.453125
| 3
|
[] |
no_license
|
#!/bin/bash
set -ex
starting_dir=$(pwd)
version=$1
ppa_version=$2
package='cairo'
dist=$(lsb_release -s -c)
new_version=${version}${ppa_version}
build_dir=build-${package}-${dist}
rm -rf ${build_dir}
mkdir ${build_dir}
cd ${build_dir}
apt-get source ${package}=${version}
cd ${package}*/
for patch in $starting_dir/patches/2.10.1/cairo-infinality-remix/cairo-respect-fontconfig_pb.patch; do
cp $patch debian/patches
echo $(basename $patch) >> debian/patches/series
done
changelog=$(mktemp)
cat <<-EOF > ${changelog}
${package} (${new_version}) ${dist}; urgency=low
* Add patches
-- ${DEBFULLNAME} <${DEBEMAIL}> $(date -R)
EOF
cat debian/changelog >> ${changelog}
mv ${changelog} debian/changelog
debuild -S -sd -pgpg2
cd ../
dput -c ${starting_dir}/conf/dput.cf ppa *changes
cd ${starting_dir}
| true
|
235ea00d89c1b7125411695c9068430980ae5475
|
Shell
|
Vzlentin/boisseau-de-riz
|
/.bashrc
|
UTF-8
| 668
| 2.75
| 3
|
[] |
no_license
|
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
alias ls='ls --color=auto'
alias la='ls -la'
alias vim='nvim'
alias locate='plocate'
alias p='sudo pacman'
(cat ~/.cache/wal/sequences &)
source ~/.cache/wal/colors-tty.sh
LF_ICONS=$(sed ~/.config/core/diricons \
-e '/^[ \t]*#/d' \
-e '/^[ \t]*$/d' \
-e 's/[ \t]\+/=/g' \
-e 's/$/ /')
LF_ICONS=${LF_ICONS//$'\n'/:}
export LF_ICONS
export TERMINAL=/usr/local/bin/st
export BROWSER=/usr/bin/brave
export PATH="${PATH}:${HOME}/.local/bin/"
if [ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then
exec startx
fi
| true
|
2f7752b3d9d683c67ee26ba5031b30b36ab93d59
|
Shell
|
ilpan/six
|
/mac.sh
|
UTF-8
| 1,302
| 2.625
| 3
|
[
"MIT"
] |
permissive
|
#!/bin/bash
# install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install required apps
brew install axel curl wget zsh git
# configure git
git config --global user.name "ilpan"
git config --global user.email "pna.dev@outlook.com"
# install oh-my-zsh and other
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" && \
curl https://raw.githubusercontent.com/zakaziko99/agnosterzak-ohmyzsh-theme/master/agnosterzak.zsh-theme -o agnosterzak.zsh-theme && \
mv agnosterzak.zsh-theme $ZSH_CUSTOM/themes/ && \
sed -i "s/.*ZSH_THEME=\".*\"/ZSH_THEME=\"agnosterzak\"/g" ${HOME}/.zshrc && \
git clone https://github.com/powerline/fonts.git --depth=1 && cd fonts && ./install.sh && cd .. && rm -rf fonts
# init python
wget -c --no-check-certificate https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
source virtualenv.sh
# init golang
brew install go dep
# add some configurations on zshrc
./configure_zshrc.py
# install vim
brew install vim && && curl https://j.mp/spf13-vim3 -L > spf13-vim.sh && sh spf13-vim.sh
# install jenv
curl -L -s get.jenv.io | bash && \
source ${HOME}/.jenv/bin/jenv-init.sh # && \
# jenv selfupdate
# install itemr2
brew cask install iterm2
| true
|
24c500ca2c1c4f678ec98a74d0cde484a439869e
|
Shell
|
BamaComputationalBiology/Applied-Bioinformatics
|
/dontpanic.sh
|
UTF-8
| 211
| 2.59375
| 3
|
[] |
no_license
|
#!/bin/bash
# Escaping the apostrophe can be tricky in awk
awk 'BEGIN { print "Don\47t Panic!" }' # POSIX awk version
awk 'BEGIN { print "Don\047t Panic!" }' # if followed by an octal digit, \047 is required
| true
|
78826458e3df795a4d85b25b578f2dafffb1ad9c
|
Shell
|
ReMalone/CSCE-Old-College-Assignments-
|
/CSCE3600/bash/minor4/minor4.sh
|
UTF-8
| 490
| 2.984375
| 3
|
[] |
no_license
|
#Robert E Malone
#Minor 4
#Couldn't get my duplicate to work in time
#Also had trouble trying to get my SIGINT to register 3 times before
#closing
#!/bin/bash
echo "$(date) ) intial users logged in"
num1=$(users | wc -w)
#Manage to set trap comment to exit when Ctrl-c
trap '' INT
#Used a forloop to check how many users are logged in and which users
for USER in $(who -q | grep $USER)
do
echo ">$USER logged in"
echo "$(date) ) # of users: $num1"
trap exit INT
sleep 10
done
| true
|
228d936cddd4966c0155346a67b96c8c02cc9e4e
|
Shell
|
j-bowe/panosh
|
/paloalto-inventory.sh
|
UTF-8
| 3,183
| 3.5
| 4
|
[] |
no_license
|
#!/bin/bash
#not using the central var file as it creates loops in the inventory check
subfolder="inventory"
today=$(date +%m-%d-%Y)
vendor="paloalto"
win="success.txt"
fail="error.txt"
final="$vendor$subfolder.txt"
bounce="${HOME}/$vendor/reboots"
dump="${HOME}/$vendor/$subfolder/$today"
inventory="${HOME}/panosh/$vendor-inventory.txt"
rebootlist="rebootlist.txt"
donotinstall="false"
downloadagain="y"
shopt -s nocasematch
if [ -z "$subfolder" ]
then
subfolder=temp
fi
if [ ! -d "$dump" ]
then
mkdir -p "$dump"
fi
if [ ! -d "$bounce" ]
then
mkdir -p "$bounce"
fi
function sys_info() {
apiaction="api/?&type=op&cmd="
apixpath=""
apielement="<show><system><info></info></system></show>"
apikey="&key=$key"
apiurl="https://$ip":"$port/$apiaction$apixpath$apielement$apikey"
curl -sk --connect-timeout 59.01 -# --output "$dump/$name.sn" "$apiurl"
realsn=$(xmllint --xpath "string(//serial)" "$dump/$name.sn")
realname=$(xmllint --xpath "string(//devicename)" "$dump/$name.sn")
realmodel=$(xmllint --xpath "string(//model)" "$dump/$name.sn")
}
function get_api_key() {
apiurl="https://$ip:$port/api/?type=keygen&user=$username&password=$password"
echo
curl -sk --connect-timeout 59.01 -# --output "$dump/$name.key" "$apiurl"
key=$(xmllint --xpath "string(//key)" "$dump/$name.key")
}
function error_check(){
error=$(xmllint --xpath "string(//msg)" "$dump/$name.key" 2>/dev/null)
}
if [ "$1" == "help" ] || [ "$1" == "--h" ]|| [ "$1" == "-h" ]
then
echo " $0 <hostname> <ip addr> <port> <username> [enter]"
echo
echo " $0 FRWL-NAME-01 1.2.3.4 443 admin [enter]"
echo
echo " You'll be prompted for the password "
echo
exit 0
fi
if [ "$1" ]
then tempname="$1"
ip="$2"
port="$3"
username="$4"
if [ -z "$4" ]
then echo && echo " Here's How To Use Me:"
echo
"$0" help
exit 0
fi
read -s -p " Password: " temppassword
else
read -p " Name: " tempname
read -p " IP Address: " ip
read -p " Port Number: " port
read -p " Username: " username
read -s -p " Password: " temppassword
fi
name=$(tr "[:lower:]" "[:upper:]" <<< $tempname)
# one liner to urlencode the password if there are special characters
password=$(echo -n "$temppassword" | curl -Gso /dev/null -w %{url_effective} --data-urlencode @- "" | cut -c 3-)
# using this to see if we already have the device name in the inventory
chkname=$(grep -i $name "$inventory" 2>/dev/null)
chkip=$(grep -i $ip "$inventory" 2>/dev/null)
if [ "$chkname" ] || [ "$chkip" ]
then
echo
echo " Asset exists in inventory, exiting..."
echo
exit 0
fi
#function calls
get_api_key
error_check
if [ "$error" ]
then
echo
echo "$error"
echo " We sent : $apiurl "
exit 0
fi
echo " "
#-=add to inventory?=-
echo & echo " Do you want to add to the existing inventory?"
echo & read -n1 -p " Please confirm (y/n) : " confirm
if [ "$confirm" != "y" ];
then
echo " OK. Here's your URL key:"
echo " $key "
exit
else
echo "${name}_${ip}_${port}_${key}" >> "$inventory"
echo " Checking to see if it is accessible "
sys_info
echo -e " $realname\t\t$realmodel\t\t$realsn" > "$dump/$win"
column -te "$dump/$win"
echo
echo
fi
| true
|
e5255b601e9db7dd2930c78d7e937b372bc0493d
|
Shell
|
cjaganmohan/Testing-AI-Systems
|
/deepTest-master/models/Autumn_reproduce.sh
|
UTF-8
| 954
| 3.03125
| 3
|
[] |
no_license
|
#! /bin/sh
slash="/"
#transformation_name=Original
#directory_name=NA
group_number=20
dataset='/home/jagan/Desktop/Autumn/prediction-in-batches/Grp20_4243_4248/'
#python2 autumn_reproduce_modified_V2.py --transformation $transformation_name --directory $directory_name --group $group_number --dataset $dataset
for d in $(find '/home/jagan/Desktop/IndividualTransformations/' -maxdepth 1 -type d | natsort)
do
transformation_name=$(basename $d) # to print the folder name --- https://stackoverflow.com/a/3362952
directory_name=$d$slash # to print the physical path
if [ $transformation_name != IndividualTransformations ]
then
#echo $count
echo $transformation_name
echo $directory_name
echo $group_number
echo $dataset
#sudo killall -9 python
python2 autumn_reproduce_modified_V2.py --transformation $transformation_name --directory $directory_name --group $group_number --dataset $dataset
#sudo killall -9 python
fi
done
| true
|
16d9a3a1378eff563fe17f6d8aa6fd76dd482775
|
Shell
|
ipfire/ipfire-2.x
|
/src/initscripts/packages/keepalived
|
UTF-8
| 2,241
| 3.328125
| 3
|
[] |
no_license
|
#!/bin/sh
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
###############################################################################
. /etc/sysconfig/rc
. ${rc_functions}
[ -r "/etc/sysconfig/keepalive" ] && . /etc/sysconfig/keepalive
case "${1}" in
start)
# Load IPVS module
modprobe ip_vs
# Enable connection tracking for IPVS
sysctl -w net.ipv4.vs.conntrack=1 &>/dev/null
boot_mesg "Starting keepalive daemon..."
loadproc /usr/sbin/keepalived ${KEEPALIVED_OPTIONS}
;;
stop)
boot_mesg "Stopping keepalive daemon..."
killproc /usr/sbin/keepalived
;;
reload)
boot_mesg "Reloading keepalive daemon..."
reloadproc /usr/sbin/keepalived
;;
restart)
${0} stop
sleep 1
${0} start
;;
status)
statusproc /usr/sbin/keepalived
;;
*)
echo "Usage: ${0} {start|stop|reload|restart|status}"
exit 1
;;
esac
| true
|
68099fcfeb7d3c848b0b24adee53fd15c905dcde
|
Shell
|
Silentsoul04/packetstorm-exploits
|
/1611-exploits/bart-ransomware.txt
|
UTF-8
| 8,663
| 2.96875
| 3
|
[] |
no_license
|
#!/bin/sh
#
# Bart Ransomware (Win32/Filecoder.Bart) (Kidnapping) Resource Hacking
#
#
# Copyright 2016 (c) Todor Donev
# <todor.donev at gmail.com>
# https://www.ethical-hacker.org/
# https://www.facebook.com/ethicalhackerorg
#
#
## Thanks to Maya Hristova that support me.
#
#
# Description:
# Bart is a simple yet insidious ransomware
# program that locks files in encrypted,
# inaccessible archives until a ransom is paid.
# Bart, like most ransomware programs, searches
# for files that match a given description, then
# encrypts those files, leaving them unusable.
# This means all files of certain extensions (e.g.
# .pdf, .xls, etc.) will be inaccessible until
# the victim acquires the key. To obtain the key,
# the victim must pay a ransom.
#
# Some of the main features of Bart ransomware
# include the following:
# o The software enters computer through a ZIP
# attachment on an email.
# o The attachment contains a JavaScript file
# that, if executed, initiates the installation
# of Bart.
# o Unlike similar malware, Bart locks your
# files in encrypted, password-protected ZIP
# archives, rendering the files inaccessible.
# After the encryption, the naming format
# for the resulting ZIP archive is as follows:
# original_name.bart.zip.
#
# Disclaimer:
# This or previous programs is for Educational
# purpose ONLY. Do not use it without permission.
# The usual disclaimer applies, especially the
# fact that Todor Donev is not liable for any
# damages caused by direct or indirect use of the
# information or functionality provided by these
# programs. The author or any Internet provider
# bears NO responsibility for content or misuse
# of these programs or any derivatives thereof.
# By using these programs you accept the fact
# that any damage (dataloss, system crash,
# system compromise, etc.) caused by the use
# of these programs is not Todor Donev's
# responsibility.
#
# Use them at your own risk!
#
[todor@adamantium]$ strings bart.bin | grep -i -A 235 "Tahoma"
# Tahoma
# Control Panel\Desktop
# WallpaperStyle
# TileWallpaper
# AnOh/Cz9MMLiZMS9k/8huVvEbF6cg1TklaAQBLADaGiV
# winnt
# Application Data
# AppData
# PerfLogs
# Program Files (x86)
# Program Files
# ProgramData
# temp
# Recovery
# $Recycle.Bin
# System Volume Information
# Boot
# Windows
# .n64
# .m4u
# .m3u
# .mid
# .wma
# .flv
# .3g2
# .mkv
# .3gp
# .mp4
# .mov
# .avi
# .asf
# .mpeg
# .vob
# .mpg
# .wmv
# .fla
# .swf
# .wav
# .mp3
# .qcow2
# .vdi
# .vmdk
# .vmx
# .gpg
# .aes
# .ARC
# .PAQ
# .tar.bz2
# .tbk
# .bak
# .tar
# .tgz
# .rar
# .zip
# .djv
# .djvu
# .svg
# .bmp
# .png
# .gif
# .raw
# .cgm
# .jpeg
# .jpg
# .tif
# .tiff
# .NEF
# .psd
# .cmd
# .bat
# .class
# .jar
# .java
# .asp
# .brd
# .sch
# .dch
# .dip
# .vbs
# .asm
# .pas
# .cpp
# .php
# .ldf
# .mdf
# .ibd
# .MYI
# .MYD
# .frm
# .odb
# .dbf
# .mdb
# .SQLITEDB
# .SQLITE3
# .asc
# .lay6
# .lay
# .ms11(Security copy)
# .ms11
# .sldm
# .sldx
# .ppsm
# .ppsx
# .ppam
# .docb
# .sxm
# .otg
# .odg
# .uop
# .potx
# .potm
# .pptx
# .pptm
# .std
# .sxd
# .pot
# .pps
# .sti
# .sxi
# .otp
# .odp
# .wb2
# .123
# .wks
# .wk1
# .xltx
# .xltm
# .xlsx
# .xlsm
# .xlsb
# .slk
# .xlw
# .xlt
# .xlm
# .xlc
# .dif
# .stc
# .sxc
# .ots
# .ods
# .hwp
# .602
# .dotm
# .dotx
# .docm
# .docx
# .DOT
# .3dm
# .max
# .3ds
# .txt
# .CSV
# .uot
# .RTF
# .pdf
# .XLS
# .PPT
# .stw
# .sxw
# .ott
# .odt
# .DOC
# .pem
# .p12
# .csr
# .crt
# .key
# !!! IMPORTANT INFORMATION !!!
# All your files are encrypted.
# Decrypting of your files is only possible with the private key, which is on our secret server.
# To receive your private key follow one of the links:
# 1. http://%s.tor2web.org/?id=%s
# 2. http://%s.onion.to/?id=%s
# 3. http://%s.onion.cab/?id=%s
# 4. http://%s.onion.link/?id=%s
# If all addresses are not available, follow these steps:
# 1. Download and install Tor Browser: https://torproject.org/download/download-easy.html
# 2. After successfull installation, run the browser and wait for initialization.
# 3. Type in the address bar:
# %s.onion/?id=%s
# 4. Follow the instructions on the site.
# !!! INFORMAZIONI IMPORTANTI !!!
# Tutti i file sono criptati.
# Decifrare dei file ? possibile solo con la chiave privata, che ? sul nostro server segreto.
# Per ricevere la chiave privata seguire uno dei link :
# 1. http://%s.tor2web.org/?id=%s
# 2. http://%s.onion.to/?id=%s
# 3. http://%s.onion.cab/?id=%s
# 4. http://%s.onion.link/?id=%s
# Se tutti gli indirizzi non sono disponibili, attenersi alla seguente procedura:
# 1. Scaricare e installare Tor Browser: https://torproject.org/download/download-easy.html
# 2. Dopo l'installazione di successo, eseguire il browser e attendere l'inizializzazione.
# 3. Digitare nella barra degli indirizzi:
# %s.onion/?id=%s
# 4. Seguire le istruzioni sul sito
# !!! INFORMATIONS IMPORTANTES !!!
# Tous vos fichiers sont crypt?s.
# D?chiffrer de vos fichiers est seulement possible avec la cl? priv?e, qui est sur notre serveur secret.
# Pour recevoir votre cl? priv?e suivre l'un des liens:
# 1. http://%s.tor2web.org/?id=%s
# 2. http://%s.onion.to/?id=%s
# 3. http://%s.onion.cab/?id=%s
# 4. http://%s.onion.link/?id=%s
# Si toutes les adresses ne sont pas disponibles, proc?dez comme suit:
# 1. T?l?chargez et installez Tor Browser: https://torproject.org/download/download-easy.html
# 2. Une fois l'installation r?ussie, ex?cutez le navigateur et attendez que l'initialisation.
# 3. Tapez dans la barre d'adresse:
# %s.onion/?id=%s
# 4. Suivez les instructions sur le site.
# !!! WICHTIGE INFORMATIONEN !!!
# Alle Ihre Dateien werden verschl?sselt.
# Entschl?sseln der Dateien ist nur mit dem privaten Schl?ssel, die auf unserer geheimen Server ist.
# So empfangen Sie Ihren privaten Schl?ssel auf einen der Links folgen:
# 1. http://%s.tor2web.org/?id=%s
# 2. http://%s.onion.to/?id=%s
# 3. http://%s.onion.cab/?id=%s
# 4. http://%s.onion.link/?id=%s
# Wenn alle Adressen nicht verf?gbar sind, gehen Sie folgenderma?en vor:
# 1. Downloaden und installieren Browser Tor: https://torproject.org/download/download-easy.html
# 2. Nach erfolgreicher Installation der Browser ausgef?hrt wird und f?r die Initialisierung warten.
# 3. Geben Sie in der Adressleiste:
# %s.onion/?id=%s
# 4. Folgen Sie den Anweisungen auf der Website.
# !!! Your personal identification ID: %s !!!
# !!! La vostra identificazione personale ID: %s !!!
# !!! Votre identification personnelle ID: %s !!!
# !!! Ihre pers?nliche Identifikations ID: %s !!!
# !!! Su identificaci?n personal ID : %s !!!
# khh5cmzh5q7yp7th # DARKWEB ADDRESS: http://khh5cmzh5q7yp7th.onion/
# .bart # LOCKED FILE FORMAT: .bart.zip
# .recover.
# \\.\
# recover.txt
# \recover.bmp
# \recover.txt
# notepad.exe "
[todor@adamantium]$ sed -i 's/khh5cmzh5q7yp7th/1234567890123456/g' bart.bin
[todor@adamantium]$ strings bart.bin | grep -i -A 5 "personal"
# !!! Your personal identification ID: %s !!!
# !!! La vostra identificazione personale ID: %s !!!
# !!! Votre identification personnelle ID: %s !!!
# !!! Ihre pers?nliche Identifikations ID: %s !!!
# !!! Su identificaci?n personal ID : %s !!!
# 1234567890123456 # DARKWEB ADDRESS IS CHANGED TO: http://1234567890123456.onion/ (Invalid TOR address)
# .bart
# .recover.
# \\.\
# recover.txt
[todor@adamantium]$ sed -i 's/.bart/.ethk/g' bart.bin
[todor@adamantium]$ strings bart.bin | grep -i -A 5 "personal"
# !!! Your personal identification ID: %s !!!
# !!! La vostra identificazione personale ID: %s !!!
# !!! Votre identification personnelle ID: %s !!!
# !!! Ihre pers?nliche Identifikations ID: %s !!!
# !!! Su identificaci?n personal ID : %s !!!
# 1234567890123456 # DARKWEB ADDRESS IS CHANGED TO: http://1234567890123456.onion/ (Invalid TOR address)
# .ethk # LOCKED FILE FORMAT IS CHANGED TO: .ethk.zip
# .recover.
# \\.\
# recover.txt
| true
|
807525641f58ee59a5c248917f88f29dd1d37d93
|
Shell
|
Woodehh/SecureNEO
|
/scripts/debian-install-secureneo.sh
|
UTF-8
| 1,059
| 2.765625
| 3
|
[
"MIT"
] |
permissive
|
#running the script:
#wget -O - https://github.com/ITSVision/SecureNEO/blob/master/scripts/debian-install-secureneo.sh | bash
# Update and upgrade
apk update && apk upgrade
#add dependencies
apt-get install git curl php7.0-cli php7.0-dev php-pear php7.0-curl php7.0-mcrypt php7.0-mbstring php7.0-gmp php7.0-bcmath g++ make util-linux
#install scrypt
printf "\n" | pecl install scrypt
echo "extension=scrypt.so" >> /etc/php/7.0/cli/php.ini
#switch to homedir
cd /home/neo/
#clone the git
git clone https://github.com/ITSVision/neo-php.git
#start the script
echo "php /home/neo/neo-php/examples/cli-create-wallet-interactive.php" > /home/neo/.bash_login
#setup autologin
mkdir /etc/systemd/system/getty@tty1.service.d/
echo "[Service]" > /etc/systemd/system/getty@tty1.service.d/autologin.conf
echo "ExecStart=" >> /etc/systemd/system/getty@tty1.service.d/autologin.conf
echo "ExecStart=-/sbin/agetty --autologin neo --noclear %I 38400 linux" >> /etc/systemd/system/getty@tty1.service.d/autologin.conf
systemctl enable getty@tty1.service
#reboot
reboot
| true
|
b5a018eee4b232fe61f5eda5a7b3085319d7d75b
|
Shell
|
HyperTK/LCD-show
|
/LCD35-show
|
UTF-8
| 1,541
| 3.28125
| 3
|
[] |
no_license
|
#!/bin/bash
# This is a modified "LCD35-show" script to replace the one in https://github.com/goodtft/LCD-show. Use this script for Raspbian 9.8 Stretch. Might not work with older or newer versions of Raspbian!
sudo rm -rf /etc/X11/xorg.conf.d/40-libinput.conf
sudo mkdir /etc/X11/xorg.conf.d
sudo cp ./usr/tft35a-overlay.dtb /boot/overlays/
sudo cp ./usr/tft35a-overlay.dtb /boot/overlays/tft35a.dtbo
# Michel: these two file have to be removed again when you want to switch back to HDMI:
sudo cp -rf ./usr/99-calibration.conf-35 /etc/X11/xorg.conf.d/99-calibration.conf
sudo cp -rf ./usr/99-fbturbo.conf /usr/share/X11/xorg.conf.d/
if [ -b /dev/mmcblk0p7 ]
then
sudo cp ./usr/cmdline.txt-noobs /boot/cmdline.txt
else
sudo cp ./usr/cmdline.txt /boot/
fi
sudo cp ./usr/inittab /etc/
sudo cp ./boot/config-35.txt /boot/config.txt
nodeplatform=`uname -n`
# kernel=`uname -r`
version=`uname -v`
if test "$nodeplatform" = "raspberrypi"
then
echo "this is raspberrypi kernel"
version=${version%% *}
version=${version#*#}
echo $version
if test $version -lt 970
then
echo "reboot"
else
echo "need to update touch configuration"
sudo apt-get install xserver-xorg-input-evdev
sudo cp -rf /usr/share/X11/xorg.conf.d/10-evdev.conf /usr/share/X11/xorg.conf.d/45-evdev.conf
echo "reboot"
fi
else
echo "this is not raspberrypi kernel, no need to update touch configure, reboot"
fi
sudo reboot
| true
|
caa63377abd9601e387b5dd3d81826b3c8113e3a
|
Shell
|
mirdesign/NGS-FluAnalyzer
|
/config/config_sample_1707.sh
|
UTF-8
| 2,145
| 3.484375
| 3
|
[] |
no_license
|
#!/bin/sh
#############################################################
# #
# Contact: #
# Maarten Pater (m.pater@amc.uva.nl / www.mirdesign.nl) #
# Bjorn Koel (b.f.koel@amc.uva.nl) #
# #
#############################################################
# configuration file for sample 1707 #
#############################################################
### configuration file for sample 1707
# Name of the current analysis, which could be the name of the output directory of the previous step in the analysis (e.g. translate_sam_to_AA--job7F)
current_analysis='1707'
primer_list_AA_file='H3N2_primer_positions-AA.csv'
primer_list_nt_file='H3N2_primer_positions-nt.csv'
experiment_name="experiment_all.txt"
# Path to directory holding the files to be renamed
input_dir='/home/mpater/FluAnalyser/data/patients'
primer_dir='/home/mpater/FluAnalyser/data/primer_position_identification_lists'
### configuration file for 1.NGS_file_renaming.sh
# part of the filename to replace with nothing
string_to_replace='.placeholder-'
## Run script in parallel mode?
## If yes, the output on screen will be messy but the running time will decrease significantly.
## 1 = yes
## 0 = no
run_script_in_parallel=0
# Do you want to auto continue the next shell script?
# "Continious" will automatically proceed.
# "Ask" will ask before proceed.
# "No" will not proceed.
#ProceedAfterShellEndOnSucces="No"
ProceedAfterShellEndOnSucces="Ask"
#ProceedAfterShellEndOnSucces="Continious"
# new text (Use "-" to remove a part of the filename as it replaces the full string ending in "-" with only "-")
new_string="-"
#### INVARIABLE PART OF THE SCRIPT -- DO NOT CHANGE ANYTHING BELOW ####
# Check if no other config has been loaded already
# Please always copy this part when building a new configuration file
if [ -n "$__CONFIG_LOADED" ]; then
echo "Please do not load multiple config files. Check config_manual.sh for mistakes."
exit
fi
__CONFIG_LOADED="${0}"
| true
|
f404b4b0b1b20661584f7e382f410aed72eea3e9
|
Shell
|
tstroband/waf-sampler
|
/cmd/stack-update.sh
|
UTF-8
| 1,071
| 3.5625
| 4
|
[
"Apache-2.0"
] |
permissive
|
#!/usr/bin/env bash
function usage() {
echo "usage:"
echo " stack-update -stack=<stack-name> -profile=<profile>"
echo " [-exec=<exec>] [-<param-name>=<param-value>]*"
echo "parameters:"
echo " -stack The name of the Cloud Formation stack"
echo " template"
echo " -profile The name of AWS profile to use"
echo " Default: 'default'"
echo " -exec Execute the change set immediately. Set to 'false' "
echo " to review first and execute manually."
echo " Valid values: 'true' or 'false'."
echo " Default: 'true'"
echo " -<param-name> A template parameter name"
echo " <param-value> The corresponding template parameter value"
exit 1
}
source aws_base.shinc
buildCfParams
if [ -z ${stack+x} ]; then
echo "error: 'stack' parameter must be set"
usage
fi
stackName=$stack
app=$stack
updateStack $stack $stackName $app "$cfParams" $exec
echo "done!"
| true
|
286e13d0ab96d3f301666e2665e9106e01edfdeb
|
Shell
|
wbotelhos/jenkins
|
/job.sh
|
UTF-8
| 2,039
| 4.03125
| 4
|
[] |
no_license
|
#!/bin/bash
##################
# --- Common --- #
##################
GRAY='\033[0;36m'
GREEN='\033[0;32m'
NO_COLOR='\033[1;0m'
YELLOW='\033[1;33m'
if [ $UID != 0 ]; then
echo -e "${YELLOW}You need to be root!${NO_COLOR}\n"
exit 1
fi
EXEC=$(echo $0 | rev | cut -d '/' -f 1 | rev)
FILE_PATH=$(echo $0 | sed 's,/job.sh,,g')
#####################
# --- Variables --- #
#####################
LOCAL_FILE=${FILE_PATH}/.jenkins/jobs/example.xml
USERNAME='tomcat'
##########################
# --- Configurations --- #
##########################
JOB_NAME='Jenkins#job'
JENKINS_PATH=/home/${USERNAME}/.jenkins
JOBS_PATH=${JENKINS_PATH}/jobs
#####################
# --- Functions --- #
#####################
ask() {
read -p 'Job Name: ' NAME
if [ "${NAME}" == '' ]; then
echo -e "${RED}Job name missing, config aborted!${NO_COLOR}\n"
exit 1
fi
read -p 'Job Description: ' DESCRIPTION
if [ "${DESCRIPTION}" == '' ]; then
echo -e "${RED}Job description missing, config aborted!${NO_COLOR}\n"
exit 1
fi
read -p 'Git URL: ' URL
if [ "${URL}" == '' ]; then
echo -e "${RED}Job Git URL missing, config aborted!${NO_COLOR}\n"
exit 1
fi
read -p 'Build Command: ' COMMAND
if [ "${COMMAND}" == '' ]; then
echo -e "${RED}Job Git URL missing, config aborted!${NO_COLOR}\n"
exit 1
fi
}
begin() {
echo -e "-------------------------------------"
echo -e "${GRAY}Starting ${JOB_NAME}...${NO_COLOR}\n"
}
create() {
cat $LOCAL_FILE | \
sed s,{name},${NAME},g | \
sed s,{description},${DESCRIPTION},g | \
sed s,{url},${URL},g | \
sed s,{command},${COMMAND},g > ${JOBS_PATH}/${NAME}/config.xml
}
end() {
echo -e "${GREEN}Done!${NO_COLOR}"
echo -e "-------------------------------------\n"
}
mk() {
mkdir -p ${JOBS_PATH}/${NAME}
}
permission() {
chown -R tomcat:tomcat $JOBS_PATH
}
restart() {
sudo service tomcat stop
sleep 2
sudo service tomcat start
}
###################
# --- Install --- #
###################
begin
ask
mk
create
permission
restart
end
| true
|
73c784df740f73718e7072624dcf86186598f81e
|
Shell
|
THGLab/CSpred
|
/install/create-virtual-environment.sh
|
UTF-8
| 801
| 2.8125
| 3
|
[] |
no_license
|
#!/bin/bash
# Copyright (c) 2021 The Center for Biomolecular NMR Data Processing and Analysis
# License: https://opensource.org/licenses/MIT
PYTHONVERS=3.8
ORIGIN=$(dirname $(readlink -f $0))
PYTHON=python$PYTHONVERS
VENV=$ORIGIN/../venv
MODELS=$ORIGIN/../models
$PYTHON -m venv $VENV
$VENV/bin/pip install -U pip
$VENV/bin/pip install -r $ORIGIN/requirements.txt
ln -s $ORIGIN/../bins/mkdssp $VENV/bin/
ln -s $ORIGIN/../bins/mTM-align/mTM-align $VENV/bin/
ln -s $ORIGIN/../bins/ncbi-blast-2.9.0+/bin/blastp $VENV/bin/
ln -s $ORIGIN/../bins/ncbi-blast-2.9.0+/bin/makeblastdb $VENV/bin/
if [ ! -d $MODELS ]; then
mkdir $MODELS
echo "Installing February 14, 2020 models from datadryad"
URL=https://datadryad.org/stash/downloads/file_stream/242856
curl --location $URL |tar -xz -o -C $MODELS
fi
| true
|
03c9dd0b246faf1b2eb20fa11f2123704d5e330b
|
Shell
|
MarvelousMari/Learning-Bash
|
/shellclass/localusers/disable-local-user.sh
|
UTF-8
| 2,765
| 4.4375
| 4
|
[] |
no_license
|
#!/bin/bash
# usage statement/ man page
usage () {
echo "USAGE: [-dra] USER [USERN]"
echo "Disable a local Linux user"
echo " -d Deletes account rather than disabling"
echo " -r Removes home directory for the account(s)"
echo " -a Archive home directory for the account(s)"
}
# check for root privliges
if [[ "${UID}" -ne 0 ]]
then
echo "root privliges required!"
usage
exit 1
fi
# Accepts a list of Usernames as Arguments, must have at least 1 username else
# show usage statement and exit 1, all sent via stdErr
if [[ "${#}" < 1 ]]
then
echo "need at least 1 USER argument"
usage
exit 1
fi
# disables by default
# set defaults
DEL_ACCT='false'
DEL_HOME='false'
ARCHIVE='false'
# options are
# -d Deletes acounts instead of disabling
# -r Removes home directory for accounts
# -a Creates an archive of the home directory associated with the account(s)
# stores the archive in /archives (will need to be created if it doesn't exist)
# * Any non specified option cause the script to show usage statement an exit 1
while getopts dra OPTION
do
case ${OPTION} in
d)
DEL_ACCT='true'
echo "DEL_ACCT: ${DEL_ACCT}"
;;
r)
DEL_HOME='true'
echo "DEL_HOME: ${DEL_HOME}"
;;
a)
ARCHIVE='true'
echo "ARCHIVE: ${ARCHIVE}"
;;
?)
usage
exit 1
esac
done
shift $((OPTIND -1))
for USR_IN_PROGRESS in ${@}
do
# if the user exists and has a UID over 1000
id -u ${USR_IN_PROGRESS}
if [[ "${?}" != "0" ]]
then
echo "${USR_IN_PROGRESS} is not a valid username"
usage
exit 1
fi
if [[ $(id -u ${USR_IN_PROGRESS}) -lt 1000 ]]
then
echo "${USR_IN_PROGRESS} has a UID under 1000 will not disable"
usage
exit 1
fi
if [[ "${ARCHIVE}" == "true" ]]
then
if [[ (! -d "${PWD}/archive") ]]
then
mkdir "archive"
fi
tar -zcf "${PWD}/archive/${USR_IN_PROGRESS}.tar.gz" "/home/${USR_IN_PROGRESS}"
if [[ "${?}" -ne 0 ]]
then
echo "Failed to archive the home folder of: ${USR_IN_PROGRESS}"
exit 1
fi
fi
if [[ "${DEL_HOME}" == "true" ]]
then
rm -dfr "/home/${USR_IN_PROGRESS}"
if [[ "${?}" -ne 0 ]]
then
echo "Failed to delete home folder of: ${USR_IN_PROGRESS}"
exit 1
fi
fi
if [[ "${DEL_ACCT}" == "true" ]]
then
# Delete
userdel ${USR_IN_PROGRESS}
if [[ "${?}" -ne 0 ]]
then
echo "Failed to delete user: ${USR_IN_PROGRESS}"
exit 1
fi
else
# disables
chage -E 0 ${USR_IN_PROGRESS}
if [[ "${?}" -ne 0 ]]
then
echo "Failed to disable user: ${USR_IN_PROGRESS}"
exit 1
fi
fi
done
exit 0
# Informs user of any errors
# Displays username and any action performed on the account
| true
|
dac340d23a27322ce089ad4b1ac092857f08359b
|
Shell
|
s23575/pjatk-sop
|
/SOP_BASH/s23575_KB1.sh
|
UTF-8
| 147
| 3.1875
| 3
|
[] |
no_license
|
#!/bin/bash
j=1
echo -e "program nazywa się: `basename $0`"
for i in $@
do
echo "param$j: $i"
((j+=1))
done
echo -e "param*: $@\nparam#: $#"
| true
|
9318a9f99fb70c59c7aa659d89462c5b47badec7
|
Shell
|
dieterichlawson/nis
|
/bin/make_gif.sh
|
UTF-8
| 554
| 2.96875
| 3
|
[] |
no_license
|
#!/bin/bash
LOGDIR=$1
TAG=$2
mkdir .tmp_ims
echo "Extracting images from TB summaries"
python3 save_images.py --logdir=$LOGDIR --tag=$TAG --outdir=.tmp_ims
echo "Labelling images with step"
ls .tmp_ims | parallel 'convert .tmp_ims/{} -scale 200% -quality 100% -compress LossLess -background Black -fill white -pointsize 10 label:{= $_ =~
/image_0*(\d*).png/; $_ = $1; =} -gravity Center -append .tmp_ims/{.}_lb.png'
echo "Making gif"
convert -delay 2 -loop 0 -colors 256 -compress LossLess -quality 100% .tmp_ims/image_0*_lb.png out.gif
rm -rf .tmp_ims
| true
|
8fa5a9f19c4f437c7d16883a8287e56443d19097
|
Shell
|
mschlenstedt/Loxberry
|
/sbin/testenvironment.sh
|
UTF-8
| 605
| 3.859375
| 4
|
[
"Apache-2.0"
] |
permissive
|
#!/bin/bash
if test $UID -ne 0; then
echo "$0: This script has to be run as root. Exiting.<br>"
exit 1
fi
if [ ! -d $LBHOMEDIR ]; then
echo "$0: Cannot find LoxBerry home directory ($LBHOMEDIR). Exiting.<br>"
exit 1
fi
if [ "$LBHOMEDIR" == "" ]; then
echo "$0: Variable LBHOMEDIR is empty. Exiting.<br>"
exit 1
fi
if [ ! -e "$LBHOMEDIR/config/system/general.cfg" ] && [ ! -e "$LBHOMEDIR/config/system/general.cfg.default" ]; then
echo "$0: Cannot find general.cfg or general.cfg.default. Something is strange here. Exiting.<br>"
exit 1
fi
echo "$0: LoxBerry home directory is $LBHOMEDIR<br>"
| true
|
d849009507585f1ef5f8a532aa8ab0530fe9dea7
|
Shell
|
zieckey/blog
|
/deploy.sh
|
UTF-8
| 849
| 3.40625
| 3
|
[] |
no_license
|
#!/bin/bash
# 注意,需要先更新 public 目标到最新状态,在blog当前目录下进行如下操作
# cd public
# git submodule init
# git submodule update // 这样能把public目标更新到跟 git@github.com:zieckey/zieckey.github.io.git 一致
echo -e "\033[0;32mDeploying updates to GitHub...\033[0m"
msg="rebuilding site `date`"
if [ $# -eq 1 ]
then msg="$1"
fi
# Push Hugo content
# git add -A
git st
git commit -a -m "$msg"
git st
git push origin master
# Build the project.
#hugo --theme=hyde
hugo --theme=hyde --baseUrl="http://blog.codeg.cn/"
sleep 1
git st
# Go To Public folder
cd public
git st
# Add changes to git.
git add -A
git st
# Commit changes.
git commit -a -m "$msg"
# Push source and build repos.
git push origin master
# Come Back
cd ..
git commit -a -m "Update submodule : public"
git push origin master
| true
|
c16c3162f759b0dd954d026129452f32d4df1500
|
Shell
|
thomasspitaler/craft-scripts
|
/backup
|
UTF-8
| 140
| 2.515625
| 3
|
[] |
no_license
|
#! /usr/bin/env bash
if [[ "$#" -gt 0 ]]; then
echo "usage: backup"
exit 1
fi
$(dirname $0)/backup-database
$(dirname $0)/backup-assets
| true
|
d22c3b1d443c64ee02068d14384333d47e27b167
|
Shell
|
macsforme/dominicus-dependencies
|
/build.sh
|
UTF-8
| 721
| 3.15625
| 3
|
[] |
no_license
|
#!/bin/sh
echo Setting environmental variables...
export MACOSX_DEPLOYMENT_TARGET=10.6
export CPPFLAGS=-I../../dependencies/include
export LDFLAGS=-L../../dependencies/lib
mkdir -p dependencies/include
mkdir -p dependencies/lib
echo Building SDL...
cd src/SDL-1.2.15
./configure --disable-shared --prefix=`pwd`/../../dependencies
make -j`sysctl -n hw.ncpu`
make install
cd ../../
echo building libPNG...
cd src/libpng-1.6.34
./configure --disable-shared --prefix=`pwd`/../../dependencies
make -j`sysctl -n hw.ncpu`
make install
cd ../../
echo building FreeType 2...
cd src/freetype-2.9
./configure --disable-shared --prefix=`pwd`/../../dependencies
make -j`sysctl -n hw.ncpu`
make install
cd ../../
echo Done.
exit
| true
|
28c438303af6bde0ca9c8cca4a4fd195d4abcbf2
|
Shell
|
ajaykumar011/myshellscripts
|
/specialvar.sh
|
UTF-8
| 481
| 3.765625
| 4
|
[] |
no_license
|
#!/bin/bash
#Display the username and uid executing the scirpt
if [[ "${UID}" -eq 0 ]]
then
echo "You are root"
echo "your username is ${USER}"
#USER_NAME='id -un'
USER_NAME=$(id -un)
echo "you username from another method is $USER_NAME"
echo "your uid id ${UID}"
echo "your group id ${GROUPS}"
else
echo "you are not root"
echo "you are ${USER}"
exit 1
fi
#to Display the contents of any command we can use ( )
echo "Today is $(date)"
| true
|
9e34a81658b6c5186d914c4be9e386f72fe2811c
|
Shell
|
AutomationWithAnsible/ansible-setup
|
/example/example_setup.sh
|
UTF-8
| 1,484
| 3.640625
| 4
|
[
"MIT"
] |
permissive
|
#!/bin/bash
set -e
## This is an example setup script that you would encapsulate the installation
# What version of ansible setup to use
SETUP_VERSION="master"
# Whats my path
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
## Array of versions to install
## 1. Install Ansible 1.9.4
ANSIBLE_VERSIONS[0]="1.9.4"
INSTALL_TYPE[0]="pip"
# Make this the default for v1
ANSIBLE_V1_PATH="${ANSIBLE_VERSIONS[0]}"
## 2. Install Ansible dev
ANSIBLE_VERSIONS[1]="devel"
PYTHON_REQUIREMENTS[1]="$DIR/python_requirements.txt"
INSTALL_TYPE[1]="git"
# Make this the default for development
ANSIBLE_DEV_PATH="${ANSIBLE_VERSIONS[1]}"
## 3. Install Ansible stable-2.0
ANSIBLE_VERSIONS[2]="stable-2.0"
PYTHON_REQUIREMENTS[2]="$DIR/python_requirements.txt"
INSTALL_TYPE[2]="git"
# Make this default for v2
ANSIBLE_V2_PATH="${ANSIBLE_VERSIONS[2]}"
## 4. Install Ansible 1.9.3
ANSIBLE_VERSIONS[3]="stable-2.0"
PYTHON_REQUIREMENTS[3]="$DIR/python_requirements.txt"
INSTALL_TYPE[3]="pip"
# Whats the system default version
ANSIBLE_DEFAULT_VERSION="${ANSIBLE_VERSIONS[1]}"
## Create a temp dir to download the setup script
filename=$( echo ${0} | sed 's|/||g' )
my_temp_dir="$(mktemp -dt ${filename}.XXXX)"
## Get setup script from gitub
curl -s https://raw.githubusercontent.com/AutomationWithAnsible/ansible-setup/$SETUP_VERSION/setup.sh -o $my_temp_dir/setup.sh
## Run the setup
. $my_temp_dir/setup.sh
# You can do other stuff here like install test-kitchen or whatever
exit 0
| true
|
7b3b44c658eee24d76509480339705d4b52532ee
|
Shell
|
robertalks/hostap
|
/hostapd/test-build
|
UTF-8
| 462
| 3.328125
| 3
|
[
"BSD-3-Clause"
] |
permissive
|
#!/bin/sh -e
nocpu=$(grep -c MHz /proc/cpuinfo 2>/dev/null || echo 1)
if [ ! -e .config ]; then
cp -f defconfig .config
fi
if [ -x hostapd ]; then
echo "Pre-Cleaning ..."
make clean >/dev/null 2>&1
fi
echo "Running test build, please wait ..."
if make -j$nocpu >/dev/null 2>&1; then
echo "Build successful..."
else
echo "Test building failed."
fi
echo "Cleaning ..."
make clean >/dev/null 2>&1
echo "Removing .config ..."
rm -f .config >/dev/null 2>&1
| true
|
c6190b11dc37ed1f6dd0b4acf3c2579f7f400f01
|
Shell
|
chipster/chipster-tools
|
/setup/bundles/builds/binaries.bash
|
UTF-8
| 1,523
| 3.125
| 3
|
[
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] |
permissive
|
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
source $(dirname "$0")/build-env.bash
# we don't need a python image to install python
# most likely the tool wrappers are going to be written in R and hence this r-deps image will be used to run this python eventually
image="comp-20.04-r-deps"
# this installation doesn't need anythin from tools-bin
BUNDLE_COLLECTION_VERSION=""
function finish {
bash $BUNDLE_SCRIPTS_DIR/clean-up.bash $JOB_NAME $BUILD_NUMBER
}
trap finish EXIT
bash $BUNDLE_SCRIPTS_DIR/start-pod.bash $JOB_NAME $BUILD_NUMBER $image \"$BUNDLE_COLLECTION_VERSION\"
bash $BUNDLE_SCRIPTS_DIR/run-in-pod.bash $JOB_NAME $BUILD_NUMBER ubuntu - <<EOF
# simply copy the old files (built in Ubuntu 16.04), because we cannot build these anymore in Ubuntu 20.04
f="binaries-Ubuntu-16.04_2021-08-25.tar.lz4"; wget https://a3s.fi/bundle-builds/\$f; lz4 -d \$f -c | tar x -C $TOOLS_PATH; rm \$f
cd $TOOLS_PATH
# these are now installed in bundle_aligners or not used anymore
rm -rf STAR bowtie bowtie2 bwa hisat2 samtools tophat tophat2 tophat tophat-1.3.2.Linux_x86_64 tophat-2.1.1.Linux_x86_64
# these are now installed in bundle_binaries2
rm -rf enabrowsertools enaBrowserTools-1.5.4
# make space for the new version
mv FastQC fastqc-0.11.3
ls -lah $TOOLS_PATH/
# used to be:
# checkout https://github.com/chipster/chipster-tools.git
# cd build && sudo bash run_install_chipster.bash
EOF
bash $BUNDLE_SCRIPTS_DIR/move-to-artefacts.bash $TOOLS_PATH/'*' $JOB_NAME $BUILD_NUMBER
| true
|
8124ff6aae9326f64424de329cc723154f43623d
|
Shell
|
rajeshdavinci/usbmonitor
|
/usbmonitor/usbmonitor.sh
|
UTF-8
| 292
| 2.703125
| 3
|
[] |
no_license
|
#!/bin/bash
set -x
mkdir -p /opt/usb-notifier
xauthority=$(printenv | grep XAUTHORITY | cut -d = -f 2)
sed -i "9i Environment=XAUTHORITY=$xauthority" usbmonitor.service
cp usbmonitor.service /lib/systemd/system
systemctl daemon-reload
systemctl enable usbmonitor
systemctl start usbmonitor
| true
|
22203c58ba43094eb092a47a340f6a306259f13e
|
Shell
|
I201821180/gnn-asymptotics
|
/gnn_dynamics/run.sh
|
UTF-8
| 395
| 3.1875
| 3
|
[
"MIT"
] |
permissive
|
#!/usr/bin/env bash
function run () {
seed=$1
if [ ! -d "$seed" ]; then
rm -rf $seed
mkdir $seed
fi
for S in 0.5 1.0 1.2 1.5 2.0 4.0
do
if [ "$seed/$S" ]; then
rm -rf $seed/$S
mkdir $seed/$S
fi
python main.py -s $seed -S $S -O $seed/$S > log.txt
cp $seed/$S/streamplot.pdf $seed/$S.pdf
mv log.txt $seed/$S
done
}
seed=15
run $seed
seed=4
run $seed
| true
|
afd3da292b33bec70f8b3835be83165e6453cb7d
|
Shell
|
NCIP/cadsr-api
|
/cadsrapi/software/freestyle-search/software/freestylesearch/src/resources/scripts/autorun.sh
|
UTF-8
| 1,056
| 2.65625
| 3
|
[
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause"
] |
permissive
|
#!/bin/bash
echo "Executing Auto Run for Freestyle Search Engine"
echo "\$Header: /share/content/gforge/freestylesearch/freestylesearch/scripts/autorun.sh,v 1.3 2008-04-22 20:28:39 hebell Exp $"
echo "\$Name: not supported by cvs2svn $"
DATE=`date +%Y%m%d`
JAVA_HOME=/usr/jdk1.6.0_71
BASE_DIR=/local/content/freestyle/bin
export JAVA_HOME BASE_DIR
ORACLE_HOME=/app/oracle/product/dbhome/9.2.0
PATH=$ORACLE_HOME/bin:$PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
TNS_ADMIN=$ORACLE_HOME/network/admin
JAVA_PARMS='-Xms512m -Xmx512m -XX:PermSize=64m'
export JAVA_PARMS ORACLE_HOME TNS_ADMIN PATH LD_LIBRARY_PATH
echo "Executing job as `id`"
echo "Executing on `date`"
$JAVA_HOME/bin/java -client $JAVA_PARMS -classpath $BASE_DIR/cadsrapi41-beans.jar:$BASE_DIR/sdk-system-client-4.5.jar:$BASE_DIR/hibernate-3.2.0.ga-modified.jar:$BASE_DIR/org.springframework.core-3.0.5.RELEASE.jar:$BASE_DIR/log4j-1.2.16.jar:$BASE_DIR/ojdbc14.jar:$BASE_DIR/freestylesearch.jar gov.nih.nci.cadsr.freestylesearch.util.Seed $BASE_DIR/log4j.xml $BASE_DIR/seed.xml
| true
|
d3cca984e655d3ee17e56a0fe4b3777cd39f91a0
|
Shell
|
falcosecurity/test-infra
|
/tools/deploy_prow.sh
|
UTF-8
| 3,163
| 3.46875
| 3
|
[
"Apache-2.0"
] |
permissive
|
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
# Specific to Prow instance
CLUSTER="falco-prow"
ZONE="eu-west-1"
function main() {
echo "Getting Kubeconfig for cluster access"
updateKubeConfig
echo "Launching Configmaps, and prereq software"
launchConfig
echo "Launching Prow microservices"
launchProw
echo "Launching Prow monitoring"
launchMonitoring
echo "Launching Actions Runner Controller"
launchARC
echo "All done!"
}
function updateKubeConfig() {
aws eks --region ${ZONE} update-kubeconfig --name ${CLUSTER}-test-infra
}
function launchInfraConfig() {
#ALB Ingress and ebs CSI driver
kubectl apply -k "github.com/kubernetes-sigs/aws-ebs-csi-driver/deploy/kubernetes/overlays/stable/arm64/?ref=release-0.9"
# Metrics Server
local metrics_server_version="v0.4.4"
kubectl apply -f "https://github.com/kubernetes-sigs/metrics-server/releases/download/${metrics_server_version}/components.yaml"
}
function launchProwConfig() {
kubectl create configmap plugins --from-file=plugins.yaml=./config/plugins.yaml || true
kubectl create configmap config --from-file "./config/config.yaml" || true
kubectl create configmap config --from-file "./config/config.yaml" -n test-pods || true
kubectl create configmap job-config --from-file "./config/jobs/config.yaml" || true
kubectl create configmap branding --from-file "./config/branding" || true
kubectl create secret generic s3-credentials --from-literal=service-account.json="${PROW_SERVICE_ACCOUNT_JSON}" || true
#Github related items
kubectl create secret generic hmac-token --from-literal=hmac="${PROW_HMAC_TOKEN}" || true
kubectl create secret generic oauth-token --from-literal=oauth="${PROW_OAUTH_TOKEN}" || true
kubectl create secret generic oauth-token --from-literal=oauth="${PROW_SERVICE_ACCOUNT_JSON}" -n test-pods || true
# PR Status
# Those secrets do not appear to exist anymore
#
# kubectl create secret generic github-oauth-config --from-literal=secret=" ... prow-prstatus-github-oauth-app.yaml ..." || true
# kubectl create secret generic cookie --from-literal=secret=" ... prow-prstatus-cookie-encryption-key.txt ..." || true
# Related to OAuth setup... need to setup base url on Github for callback before we can create these
# kubectl create secret generic github-oauth-config --from-file=secret=" ... config/prow/github-oauth-config ..." || true
# kubectl create secret generic cookie --from-file=secret=" ... config/prow/cookie ..." || true
}
function launchConfig(){
launchInfraConfig
launchProwConfig
}
function launchProw(){
kubectl apply -f config/prow/
}
function launchMonitoring(){
make -C config/prow/monitoring
}
function launchARC(){
kubectl apply -f https://github.com/actions/actions-runner-controller/releases/download/v0.27.1/actions-runner-controller.yaml --server-side --force-conflicts
kubectl create secret generic controller-manager -n actions-runner-system --from-literal=github_token=${PROW_OAUTH_TOKEN} || true
kubectl apply -f config/prow/arc/
}
function cleanup() {
returnCode="$?"
exit "${returnCode}"
}
trap cleanup EXIT
main "$@"
cleanup
| true
|
a66e970b5c9429105953a748d3eb750ddc59f68f
|
Shell
|
snatch-dev/Convey
|
/scripts/pack.sh
|
UTF-8
| 237
| 3.109375
| 3
|
[
"MIT"
] |
permissive
|
#!/bin/bash
for dir in src/*/
do
dir=${dir%*/}
echo Publishing NuGet package: ${dir##*/}
chmod +x ./$dir/scripts/dotnet-pack.sh
exec ./$dir/scripts/dotnet-pack.sh &
wait
done
echo Finished publishing NuGet packages.
| true
|
78242d7862df28e1fe2b10cb5d4cb5f838bb4428
|
Shell
|
arthur31416/emission
|
/scripts/deploy_master.sh
|
UTF-8
| 1,381
| 3.25
| 3
|
[
"MIT"
] |
permissive
|
#!/bin/sh
# Give us a CLI to work with
yarn global add s3-cli
# Createa bundle with embedded storybooks also into Emission.js
yarn bundle-with-storybooks
# Uploads the file to our s3 bucket - credentials are in the ENV vars for same-repo PRs
s3-cli put Pod/Assets/Emission.js "s3://artsy-emission-js/Emission-master.js"
# Get the most recent PR commit
SHA=`git rev-list --min-parents=2 --max-count=1 HEAD`
# Pull the name of the PR out of the auto-generated commit description
PR_DESC=`git log --format=%B -n 1 $SHA | tail -1`
# Get the PR number out of the merge commit title
PR_NUM=`git log --format=%B -n 1 $SHA | grep -Eo '#[0-9]+' | tail -n 1 | cut -d "#" -f 2`
# Just some potential useful metadata for later
# format hardcoded because https://stackoverflow.com/questions/7216358/date-command-on-os-x-doesnt-have-iso-8601-i-option
DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"`
# Pulls the native code version from the package.json
NATIVE_VERSION=`ruby -e "require'json';puts(JSON.parse(File.read('package.json'))['native-code-version'])"`
# Create a metadata file
echo "{\"title\": \"$PR_DESC\",\"sha\": \"$SHA\", \"date\": \"$DATE\", \"number\": $PR_NUM, \"native_version\": $NATIVE_VERSION }" > head_metadata.json
cat head_metadata.json
# Uploads the metadata so that the app can show some info
s3-cli put head_metadata.json "s3://artsy-emission-js/master-metadata.json"
| true
|
373dfb98cc5ba2680c5ccfbdf82ccada64108a89
|
Shell
|
olevole/one
|
/share/scripts/freebsd/net-vmcontext/vmcontext
|
UTF-8
| 3,485
| 3.515625
| 4
|
[
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
#!/bin/sh
# -------------------------------------------------------------------------- #
# Copyright 2002-2014, OpenNebula Project (OpenNebula.org), C12G Labs #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
# a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
#
# Opennebula network contextualization initscript for FreeBSD
# Copy to /etc/rc.d as vmcontext
# PROVIDE: vmcontext
# REQUIRE: FILESYSTEMS
# BEFORE: netif hostname
. /etc/rc.subr
. /etc/network.subr
name="vmcontext"
start_cmd="vmcontext_start"
stop_cmd=":"
# Gets IP address from a given MAC
mac2ip() {
local mac=$1
ip_a=$( let 0x`echo $mac | cut -d: -f 3` )
ip_b=$( let 0x`echo $mac | cut -d: -f 4` )
ip_c=$( let 0x`echo $mac | cut -d: -f 5` )
ip_d=$( let 0x`echo $mac | cut -d: -f 6` )
echo "$ip_a.$ip_b.$ip_c.$ip_d"
}
# Gets the network part of an IP
get_network() {
local IP=$1
echo ${IP} | cut -d'.' -f1,2,3
}
get_interfaces() {
local i mac
local IFCMD="/sbin/ifconfig"
for i in `${IFCMD} -l 2>/dev/null`; do
case "${i%%[0-9]*}" in
ipfw|ppp|sl|lp|faith|fwe|fwip|plip|pfsync|pflog|tun|vboxnet|lo)
continue
;;
*)
mac=`${IFCMD} ${i} 2>/dev/null| /usr/bin/awk '/ether / {print $2}'`
[ -n "${mac}" ] && echo "${i}-${mac}"
;;
esac
done
}
get_dev() {
echo $1 | cut -d'-' -f 1
}
get_mac() {
echo $1 | cut -d'-' -f 2
}
gen_hosts() {
NETWORK=$1
echo "127.0.0.1 localhost"
for n in `seq -w 01 99`; do
n2=`echo $n | sed 's/^0*//'`
echo ${NETWORK}.$n2 cluster${n}
done
}
gen_exports() {
NETWORK=$1
echo "/images -network ${NETWORK}.0/24"
}
gen_hostname() {
MAC=$1
NUM=`mac2ip $MAC | cut -d'.' -f4`
NUM2=`echo 000000$NUM | sed 's/.*\(..\)/\1/'`
sysrc -q hostname="cluster${NUM2}" > /dev/null
}
gen_interface() {
DEV_MAC=$1
local default="${2}"
DEV=`get_dev $DEV_MAC`
MAC=`get_mac $DEV_MAC`
IP=`mac2ip $MAC`
NETWORK=`get_network $IP`
[ -z "${DEV}" ] && return 0
sysrc -q ifconfig_${DEV}="inet ${IP} netmask 255.255.255.0" > /dev/null
# detect for first interface
[ "${default}" = "0" ] && sysrc -q defaultrouter="${NETWORK}.1" > /dev/null
echo ""
}
vmcontext_start() {
local IFACES i num
echo -n "Starting the Opennebula contextualization network"
IFACES=`get_interfaces`
num=0
for i in $IFACES; do
MASTER_DEV_MAC=$i
DEV=`get_dev $i`
MAC=`get_mac $i`
IP=`mac2ip $MAC`
NETWORK=`get_network $IP`
# gen_hosts $NETWORK > /etc/hosts
# gen_exports $NETWORK > /etc/exports
gen_hostname $MAC
gen_interface $i ${num}
num=$(( num + 1 ))
done
}
load_rc_config $name
run_rc_command "$1"
| true
|
0b9984e461f42be8f248bfda260fe3a1e7a278ce
|
Shell
|
DougKeller/Operating-Systems
|
/project1/compileOS.sh
|
UTF-8
| 473
| 2.59375
| 3
|
[] |
no_license
|
# Create an empty image file named floppya.img
dd if=/dev/zero of=floppya.img bs=512 count=2880
# Copy bootload into beginning of floppya
dd if=bootload of=floppya.img bs=512 count=1 conv=notrunc
# Compile kernel.c
bcc -ansi -c -o kernel.o kernel.c
# Assemble kernel.asm and link it with kernel
as86 kernel.asm -o kernel_asm.o
ld86 -o kernel -d kernel.o kernel_asm.o
# Copy compiled kernel into sector 3 of floppya
dd if=kernel of=floppya.img bs=512 conv=notrunc seek=3
| true
|
59003244161461abcb970f15a8526246e2486fa7
|
Shell
|
ViSual-BBS/identity-idp
|
/bin/job_runs.sh
|
UTF-8
| 868
| 4.21875
| 4
|
[
"CC0-1.0",
"LicenseRef-scancode-public-domain"
] |
permissive
|
#!/bin/bash
set -euo pipefail
usage() {
cat >&2 <<EOM
usage: $(basename "$0") {start|stop|status} [PIDFILE]
Init script for IdP background job runner.
PIDFILE: if provided, fork to run in background (allowing stop/status as well)
EOM
}
run() {
echo >&2 "+ $*"
"$@"
}
if [ $# -lt 1 ] || [ $# -gt 2 ]; then
usage
exit 1
fi
PIDFILE=
if [ $# -ge 2 ]; then
PIDFILE="$2"
fi
case $1 in
start)
# If PIDFILE is given, fork into background
if [ -n "$PIDFILE" ]; then
run rbenv exec bundle exec rake "job_runs:run[$PIDFILE]" &
# save last process pid to the pidfile
echo "$!" > "$PIDFILE"
else
run rbenv exec bundle exec rake job_runs:run
fi
;;
stop)
pid="$(run cat "$PIDFILE")"
run kill -2 "$pid"
;;
status)
pid="$(run cat "$PIDFILE")"
run ps -fp "$pid"
;;
*)
usage
;;
esac
| true
|
75af28aef38bf883795be136b439d7c979f5df3c
|
Shell
|
folken-IT/Scripts
|
/template.sh
|
UTF-8
| 689
| 3.609375
| 4
|
[] |
no_license
|
#!/bin/bash
#######################################################################
#Name: template.sh
#Description: Script to test bash functionalities
#Args: 1) String name
# 2) second argument
# None
#Author: Folken
#Date: 08.03.2021
#######################################################################
###IMPORT SECTION###
source ./libs/functions.sh
###VARIABLES SECTION ###
name="$1"
fN=$(basename "$0" .sh)
f_log "$fN" ""
f_log "$fN" "PROGAM START"
sleep 2
###MAIN SECTION###
if [ -z "$name" ]
then
f_log "$fN" "Variable name vacia"
else
f_log "$fN" "Hello $name!"
fi
f_log "$fN" "PROGAM END"
| true
|
d05a3c4054d6c8b184e09b1e848cd06b3a5e37cc
|
Shell
|
future-c/linux-shell
|
/remoteOperation.sh
|
UTF-8
| 216
| 2.875
| 3
|
[
"CC0-1.0"
] |
permissive
|
#!/bin/bash
#变量定义
ip_array=("hn.future.ccapp.wang")
user="root"
remote_cmd="service apache2 restart"
#本地通过ssh执行远程服务器的脚本
for ip in ${ip_array[*]}
do
ssh $user@$ip $remote_cmd
done
| true
|
1404fa5b1708188c805f8e17e8081877be1e049c
|
Shell
|
touchdownnation/Quickstart_to_Apache_Kafka
|
/Kafka_cluster.sh
|
UTF-8
| 2,117
| 2.53125
| 3
|
[] |
no_license
|
#Step 1 : Download and install kafka
wget https://www-eu.apache.org/dist/kafka/2.4.0/kafka_2.12-2.4.0.tgz
tar -xzf Kafka_2.12-2.4.0.tgz
#Step 2 : Start the server
cd Kafka_2.12-2.4.0
bin/zookeeper-server-start.sh config/zookeeper.properties
bin/kafka-server-start.sh config/server.properties
#Step 3 : Create an topic
bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic test
#Listing the topics
bin/kafka-topics.sh —-list —-bootstrap-server localhost:9092
#Step 4 : Send message
bin/kafka-console-producer.sh —-broker-list localhost:9092 —-topic test
#eg.This is an first message
#Step 5 : Start consumer
bin/kafka-console-consumer.sh —-bootstrap-server localhost:9092 —-topic test —from-beginning
#Step 6 : Multi-Cluster
#Create config file for nodes
cp config/server.properties config/server-1.properties
cp config/server.properties config/server-2.properties
#Edit config file
config/server-1.properties:
broker.id=1
listeners=PLAINTEXT://:9093
log.dirs=/tmp/kafka-logs-1
config/server-2.properties:
broker.id=2
listeners=PLAINTEXT://:9094
log.dirs=/tmp/kafka-logs-2
#Start the nodes
bin/kafka-server-start.sh config/server-1.properties
bin/kafka-server-start.sh config/server-2.properties
#Create new topic
bin/kafka-topics.sh —-create —-bootstrap-server localhost:9092 —-replication-factor 3 —-partitions 1 —-topic my-rep-topic
#To check broker
bin/kafka-topics.sh —-describe —-bootstrap-server localhost:9092 —-topic my-rep-topic
#Publish messages
bin/kafka-console-producer.sh —-broker-list localhost:9092 —-topic my-rep-topic
#Consume message
bin/kafka-console-consumer.sh —-bootstrap-server localhost:9092 —-topic my-rep-topic —-from-beginning
#Check falt-tolerance
ps aux | grep server-1.properties
kill -9 <id_no.>
#Check leader and message
bin/kafka-topics.sh —-describe —-bootstrap-server localhost:9092 —-topic my-rep-topic
bin/kafka-console-consumer.sh —-bootstrap-server localhost:9092 --from-beginning —-topic my-rep-topic
| true
|
2dd344ac575eda0fa6100ae88ae97b4f4b12705f
|
Shell
|
Ankit-asr/Sequences
|
/MarchtoJune.sh
|
UTF-8
| 157
| 3.203125
| 3
|
[] |
no_license
|
#! /bin/bash
read -p "Enter the date and month in mmdd format : " input
if [ $input -le 0620 ] && [ $input -ge 0320 ]
then
echo "True"
else
echo "False"
fi
| true
|
d2c8a1d7fa7fe793346985d841b4a1c3fa1fc819
|
Shell
|
telmich/nsbin
|
/suche_vi_files
|
UTF-8
| 177
| 2.921875
| 3
|
[] |
no_license
|
#!/bin/sh
#
# Nico Schottelius <nico@schottelius.(net|org)>
# Date: 04-Apr-2003
# Last Modified: -
#
if [ -z "$1" ]; then
file=.
else
file=$1
fi
find "$file" -name .\*.swp 2>/dev/null
| true
|
51ee5be0fad81966e6c2fce34b0eef68c877b577
|
Shell
|
FusionPlmH/Fusion-Project
|
/vtools-scene/app/src/main/assets/powercfg/msmnile/powercfg-base-default.sh
|
UTF-8
| 4,734
| 2.578125
| 3
|
[] |
no_license
|
#! /vendor/bin/sh
target=`getprop ro.board.platform`
chmod 0755 /sys/devices/system/cpu/cpu0/online
chmod 0755 /sys/devices/system/cpu/cpu1/online
chmod 0755 /sys/devices/system/cpu/cpu2/online
chmod 0755 /sys/devices/system/cpu/cpu3/online
chmod 0755 /sys/devices/system/cpu/cpu4/online
chmod 0755 /sys/devices/system/cpu/cpu5/online
chmod 0755 /sys/devices/system/cpu/cpu6/online
chmod 0755 /sys/devices/system/cpu/cpu7/online
# Core control parameters for gold
echo 2 > /sys/devices/system/cpu/cpu4/core_ctl/min_cpus
echo 60 > /sys/devices/system/cpu/cpu4/core_ctl/busy_up_thres
echo 30 > /sys/devices/system/cpu/cpu4/core_ctl/busy_down_thres
echo 100 > /sys/devices/system/cpu/cpu4/core_ctl/offline_delay_ms
echo 3 > /sys/devices/system/cpu/cpu4/core_ctl/task_thres
# Core control parameters for gold+
echo 0 > /sys/devices/system/cpu/cpu7/core_ctl/min_cpus
echo 60 > /sys/devices/system/cpu/cpu7/core_ctl/busy_up_thres
echo 30 > /sys/devices/system/cpu/cpu7/core_ctl/busy_down_thres
echo 100 > /sys/devices/system/cpu/cpu7/core_ctl/offline_delay_ms
echo 1 > /sys/devices/system/cpu/cpu7/core_ctl/task_thres
# Controls how many more tasks should be eligible to run on gold CPUs
# w.r.t number of gold CPUs available to trigger assist (max number of
# tasks eligible to run on previous cluster minus number of CPUs in
# the previous cluster).
#
# Setting to 1 by default which means there should be at least
# 4 tasks eligible to run on gold cluster (tasks running on gold cores
# plus misfit tasks on silver cores) to trigger assitance from gold+.
echo 1 > /sys/devices/system/cpu/cpu7/core_ctl/nr_prev_assist_thresh
# Disable Core control on silver
echo 0 > /sys/devices/system/cpu/cpu0/core_ctl/enable
# Setting b.L scheduler parameters
echo 95 95 > /proc/sys/kernel/sched_upmigrate
echo 85 85 > /proc/sys/kernel/sched_downmigrate
echo 100 > /proc/sys/kernel/sched_group_upmigrate
echo 95 > /proc/sys/kernel/sched_group_downmigrate
echo 1 > /proc/sys/kernel/sched_walt_rotate_big_tasks
# cpuset parameters
echo 0-2 > /dev/cpuset/background/cpus
echo 0-3 > /dev/cpuset/system-background/cpus
echo 4-7 > /dev/cpuset/foreground/boost/cpus
echo 0-7 > /dev/cpuset/foreground/cpus
echo 0-7 > /dev/cpuset/top-app/cpus
# Turn off scheduler boost at the end
echo 0 > /proc/sys/kernel/sched_boost
# Turn on scheduler boost for top app main
echo 1 > /proc/sys/kernel/sched_boost_top_app
# configure governor settings for silver cluster
echo "schedutil" > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
echo 0 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/rate_limit_us
echo 1209600 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/hispeed_freq
echo 576000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq
echo 1 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/pl
# configure governor settings for gold cluster
echo "schedutil" > /sys/devices/system/cpu/cpufreq/policy4/scaling_governor
echo 0 > /sys/devices/system/cpu/cpufreq/policy4/schedutil/rate_limit_us
echo 1612800 > /sys/devices/system/cpu/cpufreq/policy4/schedutil/hispeed_freq
echo 1 > /sys/devices/system/cpu/cpufreq/policy4/schedutil/pl
# configure governor settings for gold+ cluster
echo "schedutil" > /sys/devices/system/cpu/cpufreq/policy7/scaling_governor
echo 0 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/rate_limit_us
echo 1612800 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/hispeed_freq
echo 1 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/pl
# configure input boost settings
echo "0:1324800" > /sys/module/cpu_boost/parameters/input_boost_freq
echo 120 > /sys/module/cpu_boost/parameters/input_boost_ms
echo "0:0 1:0 2:0 3:0 4:2323200 5:0 6:0 7:2323200" > /sys/module/cpu_boost/parameters/powerkey_input_boost_freq
echo 400 > /sys/module/cpu_boost/parameters/powerkey_input_boost_ms
echo 120 > /proc/sys/vm/watermark_scale_factor
# limt the GPU max frequency
echo 585000000 > /sys/class/kgsl/kgsl-3d0/devfreq/max_freq
echo 1 > /sys/devices/system/cpu/cpu0/online
echo 1 > /sys/devices/system/cpu/cpu1/online
echo 1 > /sys/devices/system/cpu/cpu2/online
echo 1 > /sys/devices/system/cpu/cpu3/online
echo 1 > /sys/devices/system/cpu/cpu4/online
echo 1 > /sys/devices/system/cpu/cpu5/online
echo 1 > /sys/devices/system/cpu/cpu6/online
echo 1 > /sys/devices/system/cpu/cpu7/online
echo 0 > /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk
echo 5 > /proc/sys/vm/dirty_background_ratio
echo 50 > /proc/sys/vm/overcommit_ratio
echo 100 > /proc/sys/vm/swap_ratio
echo 100 > /proc/sys/vm/vfs_cache_pressure
echo 20 > /proc/sys/vm/dirty_ratio
echo 3 > /proc/sys/vm/page-cluster
echo 2000 > /proc/sys/vm/dirty_expire_centisecs
echo 5000 > /proc/sys/vm/dirty_writeback_centisecs
| true
|
4306285d34538f24844c253df52e63f8933944b8
|
Shell
|
wikibook/ibatisinaction
|
/build/ant.sh
|
UTF-8
| 480
| 2.6875
| 3
|
[] |
no_license
|
if [ -z "$COMMAND_ARGS"]; then
# Assume a dev build by default
COMMAND_ARGS="-buildfile build.xml -propertyfile build.properties"
fi
BUILD_CP=$JAVA_HOME/lib/tools.jar
for JAR in ../devlib/*.jar
do
BUILD_CP=$BUILD_CP:$JAR
done
echo BUILD_CP: $BUILD_CP
echo COMMAND_ARGS: $COMMAND_ARGS
echo $JAVA_HOME/bin/java -classpath $BUILD_CP org.apache.tools.ant.Main $COMMAND_ARGS $1
$JAVA_HOME/bin/java -classpath $BUILD_CP org.apache.tools.ant.Main $COMMAND_ARGS $1
| true
|
db08ec5015b2b0c1d9f254ddb686afabaa8f38d7
|
Shell
|
Dennis4472373/Intro_Research_Methods
|
/data_2013.sh
|
UTF-8
| 880
| 3.515625
| 4
|
[] |
no_license
|
# The data from 2013:
# These functions collect the data from March 2013. To change the dates, change the "2013/03/*.out.gz"
# into another dates, for example /2014/07/*.out.gz for July 2014.
# The total tweets from March 2013
function q1 {
zless /net/corpora/twitter2/Tweets/2013/03/*.out.gz | \
/net/corpora/twitter2/tools/tweet2tab -i text | wc -l
}
# The total tweets from March 2013 about Artificial Intelligence
# To change the search words, change ""Kunstmatige Intelligentie\|Artificial Intelligence""
# into the keywords that you want to use.
function q2 {
zless /net/corpora/twitter2/Tweets/2013/03/*.out.gz | \
/net/corpora/twitter2/tools/tweet2tab -i text | \
grep -iw "Kunstmatige Intelligentie\|Artificial Intelligence" | wc -l
}
echo "The total tweets from March 2013:"
q1
echo "The total tweets from March 2013 about artificial Intelligence"
q2
| true
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.